From 00a2cb15820f044f71f97482bc86fd23a94902c3 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Wed, 1 Feb 2023 17:23:24 +0000 Subject: [PATCH] drm: remove no longer used helpers Signed-off-by: Emil Velikov --- va/drm/va_drm_utils.c | 92 ------------------------------------------- va/drm/va_drm_utils.h | 26 ------------ 2 files changed, 118 deletions(-) diff --git a/va/drm/va_drm_utils.c b/va/drm/va_drm_utils.c index dca557c6c..44925502a 100644 --- a/va/drm/va_drm_utils.c +++ b/va/drm/va_drm_utils.c @@ -31,22 +31,6 @@ #include "va_drm_utils.h" #include "va_drmcommon.h" -struct driver_name_map { - const char *key; - const char *name; -}; - -static const struct driver_name_map g_driver_name_map[] = { - { "i915", "iHD" }, // Intel Media driver - { "i915", "i965" }, // Intel OTC GenX driver - { "pvrsrvkm", "pvr" }, // Intel UMG PVR driver - { "radeon", "r600" }, // Mesa Gallium driver - { "radeon", "radeonsi" }, // Mesa Gallium driver - { "amdgpu", "radeonsi" }, // Mesa Gallium driver - { "nvidia-drm", "nvidia" }, // NVIDIA driver - { NULL, NULL } -}; - static char * va_DRM_GetDrmDriverName(int fd) { @@ -62,82 +46,6 @@ va_DRM_GetDrmDriverName(int fd) return driver_name; } -/* Returns the VA driver candidate num for the active display*/ -VAStatus -VA_DRM_GetNumCandidates(VADriverContextP ctx, int * num_candidates) -{ - struct drm_state * const drm_state = ctx->drm_state; - int count = 0; - const struct driver_name_map *m = NULL; - char *driver_name; - - if (!drm_state || drm_state->fd < 0) - return VA_STATUS_ERROR_INVALID_DISPLAY; - - driver_name = va_DRM_GetDrmDriverName(drm_state->fd); - if (!driver_name) - return VA_STATUS_ERROR_UNKNOWN; - - for (m = g_driver_name_map; m->key != NULL; m++) { - if (strcmp(m->key, driver_name) == 0) { - count ++; - } - } - - free(driver_name); - - /* - * If the drm driver name does not have a mapped vaapi driver name, then - * assume they have the same name. - */ - if (count == 0) - count = 1; - - *num_candidates = count; - return VA_STATUS_SUCCESS; -} - -/* Returns the VA driver name for the active display */ -VAStatus -VA_DRM_GetDriverName(VADriverContextP ctx, char **driver_name_ptr, int candidate_index) -{ - struct drm_state * const drm_state = ctx->drm_state; - const struct driver_name_map *m; - int current_index = 0; - - *driver_name_ptr = NULL; - - if (!drm_state || drm_state->fd < 0) - return VA_STATUS_ERROR_INVALID_DISPLAY; - - *driver_name_ptr = va_DRM_GetDrmDriverName(drm_state->fd); - if (!*driver_name_ptr) - return VA_STATUS_ERROR_UNKNOWN; - - for (m = g_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 drm 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; -} /* Returns the VA driver names and how many they are, for the active display */ VAStatus diff --git a/va/drm/va_drm_utils.h b/va/drm/va_drm_utils.h index bfcb6619a..963933f65 100644 --- a/va/drm/va_drm_utils.h +++ b/va/drm/va_drm_utils.h @@ -42,32 +42,6 @@ extern "C" { #endif -DLL_HIDDEN -VAStatus -VA_DRM_GetNumCandidates(VADriverContextP ctx, int * num_candidates); - -/** - * \brief Returns the VA driver name for the active display. - * - * This functions returns a newly allocated buffer in @driver_name_ptr that - * contains the VA driver name for the active display. Active display means - * the display obtained with any of the vaGetDisplay*() functions. - * - * The VADriverContext.drm_state structure must be valid, i.e. allocated - * and containing an open DRM connection descriptor. The DRM connection - * does *not* need to be authenticated as it only performs a call to - * drmGetVersion(). - * - * @param[in] ctx the pointer to a VADriverContext - * @param[out] driver_name_ptr the newly allocated buffer containing - * the VA driver name - * @return VA_STATUS_SUCCESS if operation is successful, or another - * #VAStatus value otherwise. - */ -DLL_HIDDEN -VAStatus -VA_DRM_GetDriverName(VADriverContextP ctx, char **driver_name_ptr, int candidate_index); - DLL_HIDDEN VAStatus VA_DRM_GetDriverNames(VADriverContextP ctx, char **drivers, unsigned *num_drivers);