summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2015-11-05 11:56:37 -0500
committerLeo Liu <[email protected]>2015-11-08 18:15:57 -0500
commit25526d77b1b69822145bcf11411e9398426e2984 (patch)
treeee1c5d8c0d6c3249eb28c78d33ea135d4ac664ca /src/gallium/state_trackers
parent7da86e0ec0cd38dcf58db97bb5c8a0eff9a3dd15 (diff)
st/va: use vl screen drm support from vl_wys_drm
v2: move the dup to vl_wys_drm for pipe loader Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/va/context.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 25fa9058edb..98c4104da48 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -28,8 +28,6 @@
#include "pipe/p_screen.h"
#include "pipe/p_video_codec.h"
-#include "pipe-loader/pipe_loader.h"
-#include "state_tracker/drm_driver.h"
#include "util/u_memory.h"
#include "util/u_handle_table.h"
#include "util/u_video.h"
@@ -133,32 +131,16 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
return VA_STATUS_ERROR_INVALID_PARAMETER;
}
-#if GALLIUM_STATIC_TARGETS
drm_fd = drm_info->fd;
-#else
- drm_fd = dup(drm_info->fd);
-#endif
if (drm_fd < 0) {
FREE(drv);
return VA_STATUS_ERROR_INVALID_PARAMETER;
}
- drv->vscreen = CALLOC_STRUCT(vl_screen);
+ drv->vscreen = vl_drm_screen_create(drm_fd);
if (!drv->vscreen)
goto error_screen;
-
-#if GALLIUM_STATIC_TARGETS
- drv->vscreen->pscreen = dd_create_screen(drm_fd);
-#else
- if (pipe_loader_drm_probe_fd(&drv->vscreen->dev, drm_fd))
- drv->vscreen->pscreen =
- pipe_loader_create_screen(drv->vscreen->dev, PIPE_SEARCH_DIR);
-#endif
-
- if (!drv->vscreen->pscreen)
- goto error_pipe;
-
}
break;
default:
@@ -203,7 +185,7 @@ error_pipe:
if (ctx->display_type == VA_DISPLAY_GLX || ctx->display_type == VA_DISPLAY_X11)
vl_screen_destroy(drv->vscreen);
else
- FREE(drv->vscreen);
+ vl_drm_screen_destroy(drv->vscreen);
error_screen:
FREE(drv);
@@ -343,7 +325,7 @@ vlVaTerminate(VADriverContextP ctx)
if (ctx->display_type == VA_DISPLAY_GLX || ctx->display_type == VA_DISPLAY_X11)
vl_screen_destroy(drv->vscreen);
else
- FREE(drv->vscreen);
+ vl_drm_screen_destroy(drv->vscreen);
handle_table_destroy(drv->htab);
FREE(drv);