Skip to content

Commit 00a2cb1

Browse files
committed
drm: remove no longer used helpers
Signed-off-by: Emil Velikov <[email protected]>
1 parent b652415 commit 00a2cb1

File tree

2 files changed

+0
-118
lines changed

2 files changed

+0
-118
lines changed

va/drm/va_drm_utils.c

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,6 @@
3131
#include "va_drm_utils.h"
3232
#include "va_drmcommon.h"
3333

34-
struct driver_name_map {
35-
const char *key;
36-
const char *name;
37-
};
38-
39-
static const struct driver_name_map g_driver_name_map[] = {
40-
{ "i915", "iHD" }, // Intel Media driver
41-
{ "i915", "i965" }, // Intel OTC GenX driver
42-
{ "pvrsrvkm", "pvr" }, // Intel UMG PVR driver
43-
{ "radeon", "r600" }, // Mesa Gallium driver
44-
{ "radeon", "radeonsi" }, // Mesa Gallium driver
45-
{ "amdgpu", "radeonsi" }, // Mesa Gallium driver
46-
{ "nvidia-drm", "nvidia" }, // NVIDIA driver
47-
{ NULL, NULL }
48-
};
49-
5034
static char *
5135
va_DRM_GetDrmDriverName(int fd)
5236
{
@@ -62,82 +46,6 @@ va_DRM_GetDrmDriverName(int fd)
6246
return driver_name;
6347
}
6448

65-
/* Returns the VA driver candidate num for the active display*/
66-
VAStatus
67-
VA_DRM_GetNumCandidates(VADriverContextP ctx, int * num_candidates)
68-
{
69-
struct drm_state * const drm_state = ctx->drm_state;
70-
int count = 0;
71-
const struct driver_name_map *m = NULL;
72-
char *driver_name;
73-
74-
if (!drm_state || drm_state->fd < 0)
75-
return VA_STATUS_ERROR_INVALID_DISPLAY;
76-
77-
driver_name = va_DRM_GetDrmDriverName(drm_state->fd);
78-
if (!driver_name)
79-
return VA_STATUS_ERROR_UNKNOWN;
80-
81-
for (m = g_driver_name_map; m->key != NULL; m++) {
82-
if (strcmp(m->key, driver_name) == 0) {
83-
count ++;
84-
}
85-
}
86-
87-
free(driver_name);
88-
89-
/*
90-
* If the drm driver name does not have a mapped vaapi driver name, then
91-
* assume they have the same name.
92-
*/
93-
if (count == 0)
94-
count = 1;
95-
96-
*num_candidates = count;
97-
return VA_STATUS_SUCCESS;
98-
}
99-
100-
/* Returns the VA driver name for the active display */
101-
VAStatus
102-
VA_DRM_GetDriverName(VADriverContextP ctx, char **driver_name_ptr, int candidate_index)
103-
{
104-
struct drm_state * const drm_state = ctx->drm_state;
105-
const struct driver_name_map *m;
106-
int current_index = 0;
107-
108-
*driver_name_ptr = NULL;
109-
110-
if (!drm_state || drm_state->fd < 0)
111-
return VA_STATUS_ERROR_INVALID_DISPLAY;
112-
113-
*driver_name_ptr = va_DRM_GetDrmDriverName(drm_state->fd);
114-
if (!*driver_name_ptr)
115-
return VA_STATUS_ERROR_UNKNOWN;
116-
117-
for (m = g_driver_name_map; m->key != NULL; m++) {
118-
if (strcmp(m->key, *driver_name_ptr) == 0) {
119-
if (current_index == candidate_index) {
120-
break;
121-
}
122-
current_index ++;
123-
}
124-
}
125-
126-
/*
127-
* If the drm driver name does not have a mapped vaapi driver name, then
128-
* assume they have the same name.
129-
*/
130-
if (!m->name)
131-
return VA_STATUS_SUCCESS;
132-
133-
/* Use the mapped vaapi driver name */
134-
free(*driver_name_ptr);
135-
*driver_name_ptr = strdup(m->name);
136-
if (!*driver_name_ptr)
137-
return VA_STATUS_ERROR_ALLOCATION_FAILED;
138-
139-
return VA_STATUS_SUCCESS;
140-
}
14149

14250
/* Returns the VA driver names and how many they are, for the active display */
14351
VAStatus

va/drm/va_drm_utils.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,6 @@
4242
extern "C" {
4343
#endif
4444

45-
DLL_HIDDEN
46-
VAStatus
47-
VA_DRM_GetNumCandidates(VADriverContextP ctx, int * num_candidates);
48-
49-
/**
50-
* \brief Returns the VA driver name for the active display.
51-
*
52-
* This functions returns a newly allocated buffer in @driver_name_ptr that
53-
* contains the VA driver name for the active display. Active display means
54-
* the display obtained with any of the vaGetDisplay*() functions.
55-
*
56-
* The VADriverContext.drm_state structure must be valid, i.e. allocated
57-
* and containing an open DRM connection descriptor. The DRM connection
58-
* does *not* need to be authenticated as it only performs a call to
59-
* drmGetVersion().
60-
*
61-
* @param[in] ctx the pointer to a VADriverContext
62-
* @param[out] driver_name_ptr the newly allocated buffer containing
63-
* the VA driver name
64-
* @return VA_STATUS_SUCCESS if operation is successful, or another
65-
* #VAStatus value otherwise.
66-
*/
67-
DLL_HIDDEN
68-
VAStatus
69-
VA_DRM_GetDriverName(VADriverContextP ctx, char **driver_name_ptr, int candidate_index);
70-
7145
DLL_HIDDEN
7246
VAStatus
7347
VA_DRM_GetDriverNames(VADriverContextP ctx, char **drivers, unsigned *num_drivers);

0 commit comments

Comments
 (0)