hardware/intel/libva
Revisão | 201210bc42750d08ff2f3d8117722f683eade3c2 (tree) |
---|---|
Hora | 2009-09-14 15:37:38 |
Autor | Gwenole Beauchesne <gbeauchesne@spli...> |
Commiter | Austin Yuan |
Clean up NVIDIA driver detection code.
@@ -42,26 +42,6 @@ | ||
42 | 42 | |
43 | 43 | static VADisplayContextP pDisplayContexts = NULL; |
44 | 44 | |
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 | - | |
65 | 45 | static int va_DisplayContextIsValid ( |
66 | 46 | VADisplayContextP pDisplayContext |
67 | 47 | ) |
@@ -132,49 +112,21 @@ static VAStatus va_NVCTRL_GetDriverName ( | ||
132 | 112 | ) |
133 | 113 | { |
134 | 114 | 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; | |
142 | 117 | |
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; | |
178 | 130 | } |
179 | 131 | |
180 | 132 | static VAStatus va_DisplayContextGetDriverName ( |