summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/g3dvl
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-07-08 12:03:13 +0200
committerChristian König <[email protected]>2011-07-08 12:03:13 +0200
commit2ec350ff1d9f13ec95d7b9d46f57ad9b9efcc8ea (patch)
tree64c473beacf39929a013d728b3639bdd98407f91 /src/gallium/winsys/g3dvl
parent7eca76952b6726be9459375dde7478a01789577e (diff)
[g3dvl] make pipe_context mandatory for creation pipe_video_context
Diffstat (limited to 'src/gallium/winsys/g3dvl')
-rw-r--r--src/gallium/winsys/g3dvl/dri/dri_winsys.c23
-rw-r--r--src/gallium/winsys/g3dvl/vl_winsys.h1
-rw-r--r--src/gallium/winsys/g3dvl/xlib/xsp_winsys.c13
3 files changed, 30 insertions, 7 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);
}
diff --git a/src/gallium/winsys/g3dvl/vl_winsys.h b/src/gallium/winsys/g3dvl/vl_winsys.h
index 152a4a62292..2d80c1d9b32 100644
--- a/src/gallium/winsys/g3dvl/vl_winsys.h
+++ b/src/gallium/winsys/g3dvl/vl_winsys.h
@@ -44,6 +44,7 @@ struct vl_screen
struct vl_context
{
struct vl_screen *vscreen;
+ struct pipe_context *pipe;
struct pipe_video_context *vpipe;
};
diff --git a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c
index 1a67e2436e4..3caf6603243 100644
--- a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c
+++ b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c
@@ -172,18 +172,26 @@ void vl_screen_destroy(struct vl_screen *vscreen)
struct vl_context*
vl_video_create(struct vl_screen *vscreen)
{
+ struct pipe_video_context *pipe;
struct pipe_video_context *vpipe;
struct vl_context *vctx;
assert(vscreen);
assert(vscreen->pscreen->video_context_create);
- vpipe = vscreen->pscreen->video_context_create(vscreen->pscreen, NULL);
- if (!vpipe)
+ pipe = vscreen->pscreen->context_create(vscreen->pscreen, NULL);
+ if (!pipe)
return NULL;
+ vpipe = vscreen->pscreen->video_context_create(vscreen->pscreen, pipe, NULL);
+ if (!vpipe) {
+ pipe->destroy(pipe);
+ return NULL;
+ }
+
vctx = CALLOC_STRUCT(vl_context);
if (!vctx) {
+ pipe->destroy(pipe);
vpipe->destroy(vpipe);
return NULL;
}
@@ -199,6 +207,7 @@ void vl_video_destroy(struct vl_context *vctx)
{
assert(vctx);
+ vctx->pipe->destroy(vctx->pipe);
vctx->vpipe->destroy(vctx->vpipe);
FREE(vctx);
}