• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

修訂b88e0895f0c4657e2e24fcfd4aa0078c2cb222a4 (tree)
時間2009-07-08 18:42:05
作者Gwenole Beauchesne <gbeauchesne@spli...>
CommiterAustin Yuan

Log Message

Fix driver name retrieval for dri1 and dri2.

Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>

Change Summary

差異

--- a/src/va.c
+++ b/src/va.c
@@ -116,21 +116,8 @@ static Bool va_checkString(const char* value, char *variable)
116116 static VAStatus va_getDriverName(VADisplay dpy, char **driver_name)
117117 {
118118 VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
119- VADriverContextP ctx = CTX(dpy);
120119
121- VAStatus ret;
122- ret = pDisplayContext->vaGetDriverName(pDisplayContext, driver_name);
123- if (ret == VA_STATUS_SUCCESS)
124- {
125- if (isDRI2Connected(ctx, driver_name))
126- {
127- ret = VA_STATUS_SUCCESS;
128- } else if (isDRI1Connected(ctx, driver_name))
129- {
130- ret = VA_STATUS_SUCCESS;
131- }
132- }
133- return ret;
120+ return pDisplayContext->vaGetDriverName(pDisplayContext, driver_name);
134121 }
135122
136123 static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
--- a/src/va_backend.h
+++ b/src/va_backend.h
@@ -414,7 +414,7 @@ struct VADriverContext
414414
415415 Display *x11_dpy;
416416 int x11_screen;
417- int dri2;
417+ int old_dri2; /* obsolete */
418418 int version_major;
419419 int version_minor;
420420 int max_profiles;
--- a/src/x11/va_x11.c
+++ b/src/x11/va_x11.c
@@ -104,34 +104,10 @@ static VAStatus va_DRI2GetDriverName (
104104 )
105105 {
106106 VADriverContextP ctx = pDisplayContext->pDriverContext;
107- VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
108- int eventBase, errorBase;
109- char *device_name;
110- int driver_major;
111- int driver_minor;
112- int driver_patch;
113- Bool result = True;
114107
115- if (!VA_DRI2QueryExtension(ctx->x11_dpy, &eventBase, &errorBase)) {
116- va_infoMessage("DRI2 extension isn't present\n");
108+ if (!isDRI2Connected(ctx, driver_name))
117109 return VA_STATUS_ERROR_UNKNOWN;
118- }
119110
120- if (!VA_DRI2QueryVersion(ctx->x11_dpy, &driver_major, &driver_minor)) {
121- va_errorMessage("VA_DRI2QueryVersion failed\n");
122- return VA_STATUS_ERROR_UNKNOWN;
123- }
124-
125- if (!VA_DRI2Connect(ctx->x11_dpy, RootWindow(ctx->x11_dpy, ctx->x11_screen),
126- driver_name, &device_name)) {
127- va_infoMessage("DRI2 isn't enabled, fallback to DRI1\n");
128- return VA_STATUS_ERROR_UNKNOWN;
129- }
130-
131- va_infoMessage("VA_DRI2Connect: %d.%d.%d %s (screen %d)\n",
132- driver_major, driver_minor, driver_patch, *driver_name, ctx->x11_screen);
133- ctx->dri2 = 1;
134-
135111 return VA_STATUS_SUCCESS;
136112 }
137113
@@ -141,57 +117,11 @@ static VAStatus va_DRIGetDriverName (
141117 )
142118 {
143119 VADriverContextP ctx = pDisplayContext->pDriverContext;
144- VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
145- int eventBase, errorBase;
146- int direct_capable;
147- int driver_major;
148- int driver_minor;
149- int driver_patch;
150- Bool result = True;
151- char *x_driver_name = NULL;
152120
153- if (!VA_DRIQueryExtension(ctx->x11_dpy, &eventBase, &errorBase)) {
154- va_errorMessage("VA_DRIQueryExtension failed\n");
121+ if (!isDRI1Connected(ctx, driver_name))
155122 return VA_STATUS_ERROR_UNKNOWN;
156- }
157-
158- if (result)
159- {
160- result = VA_DRIQueryDirectRenderingCapable(ctx->x11_dpy, ctx->x11_screen, &direct_capable);
161- if (!result)
162- {
163- va_errorMessage("VA_DRIQueryDirectRenderingCapable failed\n");
164- }
165- }
166- if (result)
167- {
168- result = direct_capable;
169- if (!result)
170- {
171- va_errorMessage("VA_DRIQueryDirectRenderingCapable returned false\n");
172- }
173- }
174- if (result)
175- {
176- result = VA_DRIGetClientDriverName(ctx->x11_dpy, ctx->x11_screen, &driver_major, &driver_minor,
177- &driver_patch, &x_driver_name);
178- if (!result)
179- {
180- va_errorMessage("VA_DRIGetClientDriverName returned false\n");
181- }
182- }
183- if (result)
184- {
185- vaStatus = VA_STATUS_SUCCESS;
186- va_infoMessage("VA_DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
187- driver_major, driver_minor, driver_patch, x_driver_name, ctx->x11_screen);
188- if (driver_name)
189- *driver_name = strdup(x_driver_name);
190- }
191- if (x_driver_name)
192- XFree(x_driver_name);
193123
194- return vaStatus;
124+ return VA_STATUS_SUCCESS;
195125 }
196126
197127 static VAStatus va_DisplayContextGetDriverName (
@@ -199,13 +129,7 @@ static VAStatus va_DisplayContextGetDriverName (
199129 char **driver_name
200130 )
201131 {
202- VADriverContextP ctx = pDisplayContext->pDriverContext;
203- VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
204- int direct_capable;
205- int driver_major;
206- int driver_minor;
207- int driver_patch;
208- Bool result = True;
132+ VAStatus vaStatus;
209133 char *driver_name_env;
210134
211135 if (driver_name)