diff options
author | Christian König <[email protected]> | 2011-07-08 14:44:19 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2011-07-08 14:44:19 +0200 |
commit | bd5fd67a3e3cda4b7676dd4745fc5d5524709210 (patch) | |
tree | 03fc88a9763ad0edf639b2821383a7866c972ff5 /src/gallium/state_trackers/xorg | |
parent | 10fd45114d4a7bbac4093755305ea5e4ba3ab6a5 (diff) |
[g3dvl] move compositor creation and handling directly into the state trackers
Diffstat (limited to 'src/gallium/state_trackers/xorg')
-rw-r--r-- | src/gallium/state_trackers/xorg/xvmc/attributes.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xvmc/context.c | 7 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xvmc/surface.c | 20 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xvmc/xvmc_private.h | 4 |
4 files changed, 16 insertions, 17 deletions
diff --git a/src/gallium/state_trackers/xorg/xvmc/attributes.c b/src/gallium/state_trackers/xorg/xvmc/attributes.c index 06d5dc919b4..817af531a32 100644 --- a/src/gallium/state_trackers/xorg/xvmc/attributes.c +++ b/src/gallium/state_trackers/xorg/xvmc/attributes.c @@ -113,7 +113,7 @@ Status XvMCSetAttribute(Display *dpy, XvMCContext *context, Atom attribute, int context_priv->color_standard, &context_priv->procamp, true, csc ); - context_priv->compositor->set_csc_matrix(context_priv->compositor, csc); + vl_compositor_set_csc_matrix(&context_priv->compositor, csc); XVMC_MSG(XVMC_TRACE, "[XvMC] Set attribute %s to value %d.\n", attr, value); diff --git a/src/gallium/state_trackers/xorg/xvmc/context.c b/src/gallium/state_trackers/xorg/xvmc/context.c index fbfa1afe44c..7b74825b37e 100644 --- a/src/gallium/state_trackers/xorg/xvmc/context.c +++ b/src/gallium/state_trackers/xorg/xvmc/context.c @@ -260,8 +260,7 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id, return BadAlloc; } - context_priv->compositor = vctx->vpipe->create_compositor(vctx->vpipe); - if (!context_priv->compositor) { + if (!vl_compositor_init(&context_priv->compositor, vctx->pipe)) { XVMC_MSG(XVMC_ERR, "[XvMC] Could not create VL compositor.\n"); context_priv->decoder->destroy(context_priv->decoder); vl_video_destroy(vctx); @@ -280,7 +279,7 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id, context_priv->color_standard, &context_priv->procamp, true, csc ); - context_priv->compositor->set_csc_matrix(context_priv->compositor, csc); + vl_compositor_set_csc_matrix(&context_priv->compositor, csc); context_priv->vctx = vctx; context_priv->subpicture_max_width = subpic_max_w; @@ -320,7 +319,7 @@ Status XvMCDestroyContext(Display *dpy, XvMCContext *context) vscreen = vctx->vscreen; pipe_surface_reference(&context_priv->drawable_surface, NULL); context_priv->decoder->destroy(context_priv->decoder); - context_priv->compositor->destroy(context_priv->compositor); + vl_compositor_cleanup(&context_priv->compositor); vl_video_destroy(vctx); vl_screen_destroy(vscreen); FREE(context_priv); diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index 3db17d1ac51..292610be631 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -493,7 +493,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, static int dump_window = -1; struct pipe_video_context *vpipe; - struct pipe_video_compositor *compositor; + struct vl_compositor *compositor; XvMCSurfacePrivate *surface_priv; XvMCContextPrivate *context_priv; @@ -519,7 +519,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, subpicture_priv = surface_priv->subpicture ? surface_priv->subpicture->privData : NULL; vpipe = context_priv->vctx->vpipe; - compositor = context_priv->compositor; + compositor = &context_priv->compositor; if (!context_priv->drawable_surface || context_priv->dst_rect.x != dst_rect.x || context_priv->dst_rect.y != dst_rect.y || @@ -527,7 +527,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, context_priv->drawable_surface = vl_drawable_surface_get(context_priv->vctx, drawable); context_priv->dst_rect = dst_rect; - compositor->reset_dirty_area(compositor); + vl_compositor_reset_dirty_area(compositor); } if (!context_priv->drawable_surface) @@ -547,8 +547,8 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, unmap_and_flush_surface(surface_priv); - compositor->clear_layers(compositor); - compositor->set_buffer_layer(compositor, 0, surface_priv->video_buffer, &src_rect, NULL); + vl_compositor_clear_layers(compositor); + vl_compositor_set_buffer_layer(compositor, 0, surface_priv->video_buffer, &src_rect, NULL); if (subpicture_priv) { XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p has subpicture %p.\n", surface, surface_priv->subpicture); @@ -556,11 +556,11 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, assert(subpicture_priv->surface == surface); if (subpicture_priv->palette) - compositor->set_palette_layer(compositor, 1, subpicture_priv->sampler, subpicture_priv->palette, - &subpicture_priv->src_rect, &subpicture_priv->dst_rect); + vl_compositor_set_palette_layer(compositor, 1, subpicture_priv->sampler, subpicture_priv->palette, + &subpicture_priv->src_rect, &subpicture_priv->dst_rect); else - compositor->set_rgba_layer(compositor, 1, subpicture_priv->sampler, - &subpicture_priv->src_rect, &subpicture_priv->dst_rect); + vl_compositor_set_rgba_layer(compositor, 1, subpicture_priv->sampler, + &subpicture_priv->src_rect, &subpicture_priv->dst_rect); surface_priv->subpicture = NULL; subpicture_priv->surface = NULL; @@ -569,7 +569,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, // Workaround for r600g, there seems to be a bug in the fence refcounting code vpipe->screen->fence_reference(vpipe->screen, &surface_priv->fence, NULL); - compositor->render_picture(compositor, PictureToPipe(flags), context_priv->drawable_surface, &dst_rect, &surface_priv->fence); + vl_compositor_render(compositor, PictureToPipe(flags), context_priv->drawable_surface, &dst_rect, &surface_priv->fence); XVMC_MSG(XVMC_TRACE, "[XvMC] Submitted surface %p for display. Pushing to front buffer.\n", surface); diff --git a/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h b/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h index 8d26b196fdc..5f8d9d13cb3 100644 --- a/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h +++ b/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h @@ -37,6 +37,7 @@ #include <util/u_math.h> #include <vl/vl_csc.h> +#include <vl/vl_compositor.h> #define BLOCK_SIZE_SAMPLES 64 #define BLOCK_SIZE_BYTES (BLOCK_SIZE_SAMPLES * 2) @@ -44,7 +45,6 @@ struct vl_context; struct pipe_video_decoder; -struct pipe_video_compositor; struct pipe_video_decode_buffer; struct pipe_video_buffer; @@ -55,10 +55,10 @@ typedef struct { struct vl_context *vctx; struct pipe_video_decoder *decoder; - struct pipe_video_compositor *compositor; enum VL_CSC_COLOR_STANDARD color_standard; struct vl_procamp procamp; + struct vl_compositor compositor; unsigned short subpicture_max_width; unsigned short subpicture_max_height; |