diff --git a/va/x11/va_dri3.c b/va/x11/va_dri3.c index 2d0f299a6..627563d0c 100644 --- a/va/x11/va_dri3.c +++ b/va/x11/va_dri3.c @@ -128,34 +128,6 @@ va_isDRI3Connected(VADriverContextP ctx, int *outfd) return 0; } -VAStatus va_DRI3_GetNumCandidates( - VADisplayContextP pDisplayContext, - int *num_candidates -) -{ - VADriverContextP const ctx = pDisplayContext->pDriverContext; - struct drm_state * drm_state = (struct drm_state *)ctx->drm_state; - int fd = -1; - - if (va_isDRI3Connected(ctx, &fd) && fd != -1) - return VA_STATUS_ERROR_UNKNOWN; - - drm_state->fd = fd; - drm_state->auth_type = VA_DRM_AUTH_CUSTOM; - return VA_DRM_GetNumCandidates(ctx, num_candidates); -} - -VAStatus va_DRI3_GetDriverName( - VADisplayContextP pDisplayContext, - char **driver_name, - int candidate_index -) -{ - VADriverContextP const ctx = pDisplayContext->pDriverContext; - - return VA_DRM_GetDriverName(ctx, driver_name, candidate_index); -} - VAStatus va_DRI3_GetDriverNames( VADisplayContextP pDisplayContext, char **drivers, diff --git a/va/x11/va_dri3.h b/va/x11/va_dri3.h index d959382bc..e032c2731 100644 --- a/va/x11/va_dri3.h +++ b/va/x11/va_dri3.h @@ -36,19 +36,6 @@ #include "sysdeps.h" #include "va_backend.h" -DLL_HIDDEN -VAStatus va_DRI3_GetNumCandidates( - VADisplayContextP pDisplayContext, - int *num_candidates -); - -DLL_HIDDEN -VAStatus va_DRI3_GetDriverName( - VADisplayContextP pDisplayContext, - char **driver_name_ptr, - int candidate_index -); - DLL_HIDDEN VAStatus va_DRI3_GetDriverNames( VADisplayContextP pDisplayContext, diff --git a/va/x11/va_fglrx.c b/va/x11/va_fglrx.c index 845a30f36..b85603d3c 100644 --- a/va/x11/va_fglrx.c +++ b/va/x11/va_fglrx.c @@ -238,26 +238,6 @@ static Bool VA_FGLRXGetClientDriverName(Display *dpy, int screen, char **clientD return success; } -VAStatus va_FGLRX_GetDriverName( - VADisplayContextP pDisplayContext, - char **driver_name, - int candidate_index -) -{ - VADriverContextP ctx = pDisplayContext->pDriverContext; - Bool result; - - if (candidate_index != 0) - return VA_STATUS_ERROR_INVALID_PARAMETER; - - result = VA_FGLRXGetClientDriverName(ctx->native_dpy, ctx->x11_screen, - driver_name); - if (!result) - return VA_STATUS_ERROR_UNKNOWN; - - return VA_STATUS_SUCCESS; -} - VAStatus va_FGLRX_GetDriverNames( VADisplayContextP pDisplayContext, char **drivers, diff --git a/va/x11/va_fglrx.h b/va/x11/va_fglrx.h index 2a68da513..bbda27448 100644 --- a/va/x11/va_fglrx.h +++ b/va/x11/va_fglrx.h @@ -30,13 +30,6 @@ #include #include "va_backend.h" -DLL_HIDDEN -VAStatus va_FGLRX_GetDriverName( - VADisplayContextP pDisplayContext, - char **driver_name, - int candidate_index -); - DLL_HIDDEN VAStatus va_FGLRX_GetDriverNames( VADisplayContextP pDisplayContext, diff --git a/va/x11/va_nvctrl.c b/va/x11/va_nvctrl.c index 044fc3821..18c56412a 100644 --- a/va/x11/va_nvctrl.c +++ b/va/x11/va_nvctrl.c @@ -397,32 +397,6 @@ static Bool VA_NVCTRLGetClientDriverName(Display *dpy, int screen, return True; } -VAStatus va_NVCTRL_GetDriverName( - VADisplayContextP pDisplayContext, - char **driver_name, - int candidate_index -) -{ - VADriverContextP ctx = pDisplayContext->pDriverContext; - int direct_capable; - Bool result; - - if (candidate_index != 0) - return VA_STATUS_ERROR_INVALID_PARAMETER; - - result = VA_NVCTRLQueryDirectRenderingCapable(ctx->native_dpy, ctx->x11_screen, - &direct_capable); - if (!result || !direct_capable) - return VA_STATUS_ERROR_UNKNOWN; - - result = VA_NVCTRLGetClientDriverName(ctx->native_dpy, ctx->x11_screen, - driver_name); - if (!result) - return VA_STATUS_ERROR_UNKNOWN; - - return VA_STATUS_SUCCESS; -} - VAStatus va_NVCTRL_GetDriverNames( VADisplayContextP pDisplayContext, char **drivers, diff --git a/va/x11/va_nvctrl.h b/va/x11/va_nvctrl.h index 0d3a43192..6fa189b4e 100644 --- a/va/x11/va_nvctrl.h +++ b/va/x11/va_nvctrl.h @@ -29,13 +29,6 @@ #include #include "va_backend.h" -DLL_HIDDEN -VAStatus va_NVCTRL_GetDriverName( - VADisplayContextP pDisplayContext, - char **driver_name, - int candidate_index -); - DLL_HIDDEN VAStatus va_NVCTRL_GetDriverNames( VADisplayContextP pDisplayContext, diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c index 96031c0a8..397b177af 100644 --- a/va/x11/va_x11.c +++ b/va/x11/va_x11.c @@ -45,20 +45,6 @@ #include #include -struct driver_name_map { - const char *key; - const char *name; -}; - -static const struct driver_name_map g_dri2_driver_name_map[] = { - { "i965", "iHD" }, // Intel iHD VAAPI driver with i965 DRI driver - { "i965", "i965" }, // Intel i965 VAAPI driver with i965 DRI driver - { "iris", "iHD" }, // Intel iHD VAAPI driver with iris DRI driver - { "iris", "i965" }, // Intel i965 VAAPI driver with iris DRI driver - { "crocus", "i965" }, // Intel i965 VAAPI driver with crocus DRI driver - { NULL, NULL } -}; - static int va_DisplayContextIsValid( VADisplayContextP pDisplayContext ) @@ -91,126 +77,6 @@ static void va_DisplayContextDestroy( free(pDisplayContext); } -static VAStatus va_DRI2_GetNumCandidates( - VADisplayContextP pDisplayContext, - int *num_candidates -) -{ - char *driver_name = NULL; - const struct driver_name_map *m = NULL; - VADriverContextP ctx = pDisplayContext->pDriverContext; - - *num_candidates = 0; - - if (!(va_isDRI2Connected(ctx, &driver_name) && driver_name)) - return VA_STATUS_ERROR_UNKNOWN; - - for (m = g_dri2_driver_name_map; m->key != NULL; m++) { - if (strcmp(m->key, driver_name) == 0) { - (*num_candidates)++; - } - } - - free(driver_name); - - /* - * If the dri2 driver name does not have a mapped vaapi driver name, then - * assume they have the same name. - */ - if (*num_candidates == 0) - *num_candidates = 1; - - return VA_STATUS_SUCCESS; -} - -static VAStatus va_DRI2_GetDriverName( - VADisplayContextP pDisplayContext, - char **driver_name_ptr, - int candidate_index -) -{ - const struct driver_name_map *m = NULL; - int current_index = 0; - VADriverContextP ctx = pDisplayContext->pDriverContext; - - *driver_name_ptr = NULL; - - if (!(va_isDRI2Connected(ctx, driver_name_ptr) && *driver_name_ptr)) - return VA_STATUS_ERROR_UNKNOWN; - - for (m = g_dri2_driver_name_map; m->key != NULL; m++) { - if (strcmp(m->key, *driver_name_ptr) == 0) { - if (current_index == candidate_index) { - break; - } - current_index++; - } - } - - /* - * If the dri2 driver name does not have a mapped vaapi driver name, then - * assume they have the same name. - */ - if (!m->name) - return VA_STATUS_SUCCESS; - - /* Use the mapped vaapi driver name */ - free(*driver_name_ptr); - *driver_name_ptr = strdup(m->name); - if (!*driver_name_ptr) - return VA_STATUS_ERROR_ALLOCATION_FAILED; - - return VA_STATUS_SUCCESS; -} - -static VAStatus va_DisplayContextGetDriverName( - VADisplayContextP pDisplayContext, - char **driver_name, int candidate_index -) -{ - VAStatus vaStatus; - - if (driver_name) - *driver_name = NULL; - else - return VA_STATUS_ERROR_UNKNOWN; - - vaStatus = va_DRI3_GetDriverName(pDisplayContext, driver_name, candidate_index); - if (vaStatus != VA_STATUS_SUCCESS) - vaStatus = va_DRI2_GetDriverName(pDisplayContext, driver_name, candidate_index); -#ifdef HAVE_NVCTRL - if (vaStatus != VA_STATUS_SUCCESS) - vaStatus = va_NVCTRL_GetDriverName(pDisplayContext, driver_name, candidate_index); -#endif -#ifdef HAVE_FGLRX - if (vaStatus != VA_STATUS_SUCCESS) - vaStatus = va_FGLRX_GetDriverName(pDisplayContext, driver_name, candidate_index); -#endif - - return vaStatus; -} - -static VAStatus va_DisplayContextGetNumCandidates( - VADisplayContextP pDisplayContext, - int *num_candidates -) -{ - VAStatus vaStatus; - - vaStatus = va_DRI3_GetNumCandidates(pDisplayContext, num_candidates); - if (vaStatus != VA_STATUS_SUCCESS) - vaStatus = va_DRI2_GetNumCandidates(pDisplayContext, num_candidates); - - /* A call to va_DisplayContextGetDriverName will fallback to other - * methods (i.e. NVCTRL, FGLRX) when DRI2 is unsuccessful. All of those - * fallbacks only have 1 candidate driver. - */ - if (vaStatus != VA_STATUS_SUCCESS) - *num_candidates = 1; - - return VA_STATUS_SUCCESS; -} - static VAStatus va_DisplayContextGetDriverNames( VADisplayContextP pDisplayContext, char **drivers, unsigned *num_drivers @@ -268,8 +134,6 @@ VADisplay vaGetDisplay( pDisplayContext->vaIsValid = va_DisplayContextIsValid; pDisplayContext->vaDestroy = va_DisplayContextDestroy; - pDisplayContext->vaGetNumCandidates = va_DisplayContextGetNumCandidates; - pDisplayContext->vaGetDriverNameByIndex = va_DisplayContextGetDriverName; pDisplayContext->vaGetDriverNames = va_DisplayContextGetDriverNames; pDriverContext = va_newDriverContext(pDisplayContext);