diff options
Diffstat (limited to 'src/gallium/winsys/g3dvl/dri')
-rw-r--r-- | src/gallium/winsys/g3dvl/dri/dri_winsys.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gallium/winsys/g3dvl/dri/dri_winsys.c b/src/gallium/winsys/g3dvl/dri/dri_winsys.c index ffb94de4a7b..42b33d191d4 100644 --- a/src/gallium/winsys/g3dvl/dri/dri_winsys.c +++ b/src/gallium/winsys/g3dvl/dri/dri_winsys.c @@ -237,21 +237,31 @@ vl_video_create(struct vl_screen *vscreen) struct vl_dri_screen *vl_dri_scrn = (struct vl_dri_screen*)vscreen; struct vl_dri_context *vl_dri_ctx; + if (!vscreen->pscreen->video_context_create) { + debug_printf("[G3DVL] No video support found on %s/%s.\n", + vscreen->pscreen->get_vendor(vscreen->pscreen), + vscreen->pscreen->get_name(vscreen->pscreen)); + goto no_vpipe; + } + vl_dri_ctx = CALLOC_STRUCT(vl_dri_context); if (!vl_dri_ctx) goto no_struct; - if (!vscreen->pscreen->video_context_create) { + vl_dri_ctx->base.pipe = vscreen->pscreen->context_create(vscreen->pscreen, vl_dri_ctx); + if (!vl_dri_ctx->base.pipe) { debug_printf("[G3DVL] No video support found on %s/%s.\n", vscreen->pscreen->get_vendor(vscreen->pscreen), vscreen->pscreen->get_name(vscreen->pscreen)); - goto no_vpipe; + goto no_pipe; } - vl_dri_ctx->base.vpipe = vscreen->pscreen->video_context_create(vscreen->pscreen, vl_dri_ctx); + vl_dri_ctx->base.vpipe = vscreen->pscreen->video_context_create(vscreen->pscreen, + vl_dri_ctx->base.pipe, + vl_dri_ctx); if (!vl_dri_ctx->base.vpipe) - goto no_vpipe; + goto no_pipe; vl_dri_ctx->base.vpipe->priv = vl_dri_ctx; vl_dri_ctx->base.vscreen = vscreen; @@ -259,9 +269,11 @@ vl_video_create(struct vl_screen *vscreen) return &vl_dri_ctx->base; -no_vpipe: +no_pipe: FREE(vl_dri_ctx); + no_struct: +no_vpipe: return NULL; } @@ -271,6 +283,7 @@ void vl_video_destroy(struct vl_context *vctx) assert(vctx); + vl_dri_ctx->base.pipe->destroy(vl_dri_ctx->base.pipe); vl_dri_ctx->base.vpipe->destroy(vl_dri_ctx->base.vpipe); FREE(vl_dri_ctx); } |