• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

hardware/intel/libva


Commit MetaInfo

Revisão201210bc42750d08ff2f3d8117722f683eade3c2 (tree)
Hora2009-09-14 15:37:38
AutorGwenole Beauchesne <gbeauchesne@spli...>
CommiterAustin Yuan

Mensagem de Log

Clean up NVIDIA driver detection code.

Mudança Sumário

Diff

--- a/src/x11/va_x11.c
+++ b/src/x11/va_x11.c
@@ -42,26 +42,6 @@
4242
4343 static VADisplayContextP pDisplayContexts = NULL;
4444
45-static void va_errorMessage(const char *msg, ...)
46-{
47- va_list args;
48-
49- fprintf(stderr, "libva error: ");
50- va_start(args, msg);
51- vfprintf(stderr, msg, args);
52- va_end(args);
53-}
54-
55-static void va_infoMessage(const char *msg, ...)
56-{
57- va_list args;
58-
59- fprintf(stderr, "libva: ");
60- va_start(args, msg);
61- vfprintf(stderr, msg, args);
62- va_end(args);
63-}
64-
6545 static int va_DisplayContextIsValid (
6646 VADisplayContextP pDisplayContext
6747 )
@@ -132,49 +112,21 @@ static VAStatus va_NVCTRL_GetDriverName (
132112 )
133113 {
134114 VADriverContextP ctx = pDisplayContext->pDriverContext;
135- VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
136- int direct_capable;
137- int driver_major;
138- int driver_minor;
139- int driver_patch;
140- Bool result = True;
141- char *nvidia_driver_name = NULL;
115+ int direct_capable, driver_major, driver_minor, driver_patch;
116+ Bool result;
142117
143- if (result)
144- {
145- result = VA_NVCTRLQueryDirectRenderingCapable(ctx->x11_dpy, ctx->x11_screen, &direct_capable);
146- if (!result)
147- {
148- va_errorMessage("VA_NVCTRLQueryDirectRenderingCapable failed\n");
149- }
150- }
151- if (result)
152- {
153- result = direct_capable;
154- if (!result)
155- {
156- va_errorMessage("VA_NVCTRLQueryDirectRenderingCapable returned false\n");
157- }
158- }
159- if (result)
160- {
161- result = VA_NVCTRLGetClientDriverName(ctx->x11_dpy, ctx->x11_screen, &driver_major, &driver_minor,
162- &driver_patch, &nvidia_driver_name);
163- if (!result)
164- {
165- va_errorMessage("VA_NVCTRLGetClientDriverName returned false\n");
166- }
167- }
168- if (result)
169- {
170- vaStatus = VA_STATUS_SUCCESS;
171- va_infoMessage("va_NVCTRL_GetDriverName: %d.%d.%d %s (screen %d)\n",
172- driver_major, driver_minor, driver_patch,
173- nvidia_driver_name, ctx->x11_screen);
174- if (driver_name)
175- *driver_name = nvidia_driver_name;
176- }
177- return vaStatus;
118+ result = VA_NVCTRLQueryDirectRenderingCapable(ctx->x11_dpy, ctx->x11_screen,
119+ &direct_capable);
120+ if (!result || !direct_capable)
121+ return VA_STATUS_ERROR_UNKNOWN;
122+
123+ result = VA_NVCTRLGetClientDriverName(ctx->x11_dpy, ctx->x11_screen,
124+ &driver_major, &driver_minor,
125+ &driver_patch, driver_name);
126+ if (!result)
127+ return VA_STATUS_ERROR_UNKNOWN;
128+
129+ return VA_STATUS_SUCCESS;
178130 }
179131
180132 static VAStatus va_DisplayContextGetDriverName (