Skip to content

Commit b652415

Browse files
committed
x11: remove legacy code paths
Signed-off-by: Emil Velikov <[email protected]>
1 parent c620701 commit b652415

File tree

7 files changed

+0
-237
lines changed

7 files changed

+0
-237
lines changed

va/x11/va_dri3.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -128,34 +128,6 @@ va_isDRI3Connected(VADriverContextP ctx, int *outfd)
128128
return 0;
129129
}
130130

131-
VAStatus va_DRI3_GetNumCandidates(
132-
VADisplayContextP pDisplayContext,
133-
int *num_candidates
134-
)
135-
{
136-
VADriverContextP const ctx = pDisplayContext->pDriverContext;
137-
struct drm_state * drm_state = (struct drm_state *)ctx->drm_state;
138-
int fd = -1;
139-
140-
if (va_isDRI3Connected(ctx, &fd) && fd != -1)
141-
return VA_STATUS_ERROR_UNKNOWN;
142-
143-
drm_state->fd = fd;
144-
drm_state->auth_type = VA_DRM_AUTH_CUSTOM;
145-
return VA_DRM_GetNumCandidates(ctx, num_candidates);
146-
}
147-
148-
VAStatus va_DRI3_GetDriverName(
149-
VADisplayContextP pDisplayContext,
150-
char **driver_name,
151-
int candidate_index
152-
)
153-
{
154-
VADriverContextP const ctx = pDisplayContext->pDriverContext;
155-
156-
return VA_DRM_GetDriverName(ctx, driver_name, candidate_index);
157-
}
158-
159131
VAStatus va_DRI3_GetDriverNames(
160132
VADisplayContextP pDisplayContext,
161133
char **drivers,

va/x11/va_dri3.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,6 @@
3636
#include "sysdeps.h"
3737
#include "va_backend.h"
3838

39-
DLL_HIDDEN
40-
VAStatus va_DRI3_GetNumCandidates(
41-
VADisplayContextP pDisplayContext,
42-
int *num_candidates
43-
);
44-
45-
DLL_HIDDEN
46-
VAStatus va_DRI3_GetDriverName(
47-
VADisplayContextP pDisplayContext,
48-
char **driver_name_ptr,
49-
int candidate_index
50-
);
51-
5239
DLL_HIDDEN
5340
VAStatus va_DRI3_GetDriverNames(
5441
VADisplayContextP pDisplayContext,

va/x11/va_fglrx.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -238,26 +238,6 @@ static Bool VA_FGLRXGetClientDriverName(Display *dpy, int screen, char **clientD
238238
return success;
239239
}
240240

241-
VAStatus va_FGLRX_GetDriverName(
242-
VADisplayContextP pDisplayContext,
243-
char **driver_name,
244-
int candidate_index
245-
)
246-
{
247-
VADriverContextP ctx = pDisplayContext->pDriverContext;
248-
Bool result;
249-
250-
if (candidate_index != 0)
251-
return VA_STATUS_ERROR_INVALID_PARAMETER;
252-
253-
result = VA_FGLRXGetClientDriverName(ctx->native_dpy, ctx->x11_screen,
254-
driver_name);
255-
if (!result)
256-
return VA_STATUS_ERROR_UNKNOWN;
257-
258-
return VA_STATUS_SUCCESS;
259-
}
260-
261241
VAStatus va_FGLRX_GetDriverNames(
262242
VADisplayContextP pDisplayContext,
263243
char **drivers,

va/x11/va_fglrx.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030
#include <X11/Xlib.h>
3131
#include "va_backend.h"
3232

33-
DLL_HIDDEN
34-
VAStatus va_FGLRX_GetDriverName(
35-
VADisplayContextP pDisplayContext,
36-
char **driver_name,
37-
int candidate_index
38-
);
39-
4033
DLL_HIDDEN
4134
VAStatus va_FGLRX_GetDriverNames(
4235
VADisplayContextP pDisplayContext,

va/x11/va_nvctrl.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -397,32 +397,6 @@ static Bool VA_NVCTRLGetClientDriverName(Display *dpy, int screen,
397397
return True;
398398
}
399399

400-
VAStatus va_NVCTRL_GetDriverName(
401-
VADisplayContextP pDisplayContext,
402-
char **driver_name,
403-
int candidate_index
404-
)
405-
{
406-
VADriverContextP ctx = pDisplayContext->pDriverContext;
407-
int direct_capable;
408-
Bool result;
409-
410-
if (candidate_index != 0)
411-
return VA_STATUS_ERROR_INVALID_PARAMETER;
412-
413-
result = VA_NVCTRLQueryDirectRenderingCapable(ctx->native_dpy, ctx->x11_screen,
414-
&direct_capable);
415-
if (!result || !direct_capable)
416-
return VA_STATUS_ERROR_UNKNOWN;
417-
418-
result = VA_NVCTRLGetClientDriverName(ctx->native_dpy, ctx->x11_screen,
419-
driver_name);
420-
if (!result)
421-
return VA_STATUS_ERROR_UNKNOWN;
422-
423-
return VA_STATUS_SUCCESS;
424-
}
425-
426400
VAStatus va_NVCTRL_GetDriverNames(
427401
VADisplayContextP pDisplayContext,
428402
char **drivers,

va/x11/va_nvctrl.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@
2929
#include <X11/Xlib.h>
3030
#include "va_backend.h"
3131

32-
DLL_HIDDEN
33-
VAStatus va_NVCTRL_GetDriverName(
34-
VADisplayContextP pDisplayContext,
35-
char **driver_name,
36-
int candidate_index
37-
);
38-
3932
DLL_HIDDEN
4033
VAStatus va_NVCTRL_GetDriverNames(
4134
VADisplayContextP pDisplayContext,

va/x11/va_x11.c

Lines changed: 0 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,6 @@
4545
#include <fcntl.h>
4646
#include <errno.h>
4747

48-
struct driver_name_map {
49-
const char *key;
50-
const char *name;
51-
};
52-
53-
static const struct driver_name_map g_dri2_driver_name_map[] = {
54-
{ "i965", "iHD" }, // Intel iHD VAAPI driver with i965 DRI driver
55-
{ "i965", "i965" }, // Intel i965 VAAPI driver with i965 DRI driver
56-
{ "iris", "iHD" }, // Intel iHD VAAPI driver with iris DRI driver
57-
{ "iris", "i965" }, // Intel i965 VAAPI driver with iris DRI driver
58-
{ "crocus", "i965" }, // Intel i965 VAAPI driver with crocus DRI driver
59-
{ NULL, NULL }
60-
};
61-
6248
static int va_DisplayContextIsValid(
6349
VADisplayContextP pDisplayContext
6450
)
@@ -91,126 +77,6 @@ static void va_DisplayContextDestroy(
9177
free(pDisplayContext);
9278
}
9379

94-
static VAStatus va_DRI2_GetNumCandidates(
95-
VADisplayContextP pDisplayContext,
96-
int *num_candidates
97-
)
98-
{
99-
char *driver_name = NULL;
100-
const struct driver_name_map *m = NULL;
101-
VADriverContextP ctx = pDisplayContext->pDriverContext;
102-
103-
*num_candidates = 0;
104-
105-
if (!(va_isDRI2Connected(ctx, &driver_name) && driver_name))
106-
return VA_STATUS_ERROR_UNKNOWN;
107-
108-
for (m = g_dri2_driver_name_map; m->key != NULL; m++) {
109-
if (strcmp(m->key, driver_name) == 0) {
110-
(*num_candidates)++;
111-
}
112-
}
113-
114-
free(driver_name);
115-
116-
/*
117-
* If the dri2 driver name does not have a mapped vaapi driver name, then
118-
* assume they have the same name.
119-
*/
120-
if (*num_candidates == 0)
121-
*num_candidates = 1;
122-
123-
return VA_STATUS_SUCCESS;
124-
}
125-
126-
static VAStatus va_DRI2_GetDriverName(
127-
VADisplayContextP pDisplayContext,
128-
char **driver_name_ptr,
129-
int candidate_index
130-
)
131-
{
132-
const struct driver_name_map *m = NULL;
133-
int current_index = 0;
134-
VADriverContextP ctx = pDisplayContext->pDriverContext;
135-
136-
*driver_name_ptr = NULL;
137-
138-
if (!(va_isDRI2Connected(ctx, driver_name_ptr) && *driver_name_ptr))
139-
return VA_STATUS_ERROR_UNKNOWN;
140-
141-
for (m = g_dri2_driver_name_map; m->key != NULL; m++) {
142-
if (strcmp(m->key, *driver_name_ptr) == 0) {
143-
if (current_index == candidate_index) {
144-
break;
145-
}
146-
current_index++;
147-
}
148-
}
149-
150-
/*
151-
* If the dri2 driver name does not have a mapped vaapi driver name, then
152-
* assume they have the same name.
153-
*/
154-
if (!m->name)
155-
return VA_STATUS_SUCCESS;
156-
157-
/* Use the mapped vaapi driver name */
158-
free(*driver_name_ptr);
159-
*driver_name_ptr = strdup(m->name);
160-
if (!*driver_name_ptr)
161-
return VA_STATUS_ERROR_ALLOCATION_FAILED;
162-
163-
return VA_STATUS_SUCCESS;
164-
}
165-
166-
static VAStatus va_DisplayContextGetDriverName(
167-
VADisplayContextP pDisplayContext,
168-
char **driver_name, int candidate_index
169-
)
170-
{
171-
VAStatus vaStatus;
172-
173-
if (driver_name)
174-
*driver_name = NULL;
175-
else
176-
return VA_STATUS_ERROR_UNKNOWN;
177-
178-
vaStatus = va_DRI3_GetDriverName(pDisplayContext, driver_name, candidate_index);
179-
if (vaStatus != VA_STATUS_SUCCESS)
180-
vaStatus = va_DRI2_GetDriverName(pDisplayContext, driver_name, candidate_index);
181-
#ifdef HAVE_NVCTRL
182-
if (vaStatus != VA_STATUS_SUCCESS)
183-
vaStatus = va_NVCTRL_GetDriverName(pDisplayContext, driver_name, candidate_index);
184-
#endif
185-
#ifdef HAVE_FGLRX
186-
if (vaStatus != VA_STATUS_SUCCESS)
187-
vaStatus = va_FGLRX_GetDriverName(pDisplayContext, driver_name, candidate_index);
188-
#endif
189-
190-
return vaStatus;
191-
}
192-
193-
static VAStatus va_DisplayContextGetNumCandidates(
194-
VADisplayContextP pDisplayContext,
195-
int *num_candidates
196-
)
197-
{
198-
VAStatus vaStatus;
199-
200-
vaStatus = va_DRI3_GetNumCandidates(pDisplayContext, num_candidates);
201-
if (vaStatus != VA_STATUS_SUCCESS)
202-
vaStatus = va_DRI2_GetNumCandidates(pDisplayContext, num_candidates);
203-
204-
/* A call to va_DisplayContextGetDriverName will fallback to other
205-
* methods (i.e. NVCTRL, FGLRX) when DRI2 is unsuccessful. All of those
206-
* fallbacks only have 1 candidate driver.
207-
*/
208-
if (vaStatus != VA_STATUS_SUCCESS)
209-
*num_candidates = 1;
210-
211-
return VA_STATUS_SUCCESS;
212-
}
213-
21480
static VAStatus va_DisplayContextGetDriverNames(
21581
VADisplayContextP pDisplayContext,
21682
char **drivers, unsigned *num_drivers
@@ -268,8 +134,6 @@ VADisplay vaGetDisplay(
268134

269135
pDisplayContext->vaIsValid = va_DisplayContextIsValid;
270136
pDisplayContext->vaDestroy = va_DisplayContextDestroy;
271-
pDisplayContext->vaGetNumCandidates = va_DisplayContextGetNumCandidates;
272-
pDisplayContext->vaGetDriverNameByIndex = va_DisplayContextGetDriverName;
273137
pDisplayContext->vaGetDriverNames = va_DisplayContextGetDriverNames;
274138

275139
pDriverContext = va_newDriverContext(pDisplayContext);

0 commit comments

Comments
 (0)