From 9e51c200a78b8be8be195e0d82d69e952afd1343 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Mon, 12 Dec 2011 16:28:24 +0100 Subject: [PATCH] st/vdpau: some mixer fixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Correctly use destination_rect and destination_video_rect in the mixer, and also use a dirty area tracking for output surfaces. Based on work of Maarten Lankhorst Signed-off-by: Christian König --- src/gallium/state_trackers/vdpau/mixer.c | 7 +++++-- src/gallium/state_trackers/vdpau/output.c | 2 ++ src/gallium/state_trackers/vdpau/vdpau_private.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c index 5657e7c83b0..1588744ad63 100644 --- a/src/gallium/state_trackers/vdpau/mixer.c +++ b/src/gallium/state_trackers/vdpau/mixer.c @@ -152,7 +152,7 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, uint32_t layer_count, VdpLayer const *layers) { - struct pipe_video_rect src_rect; + struct pipe_video_rect src_rect, dst_rect, dst_clip; vlVdpVideoMixer *vmixer; vlVdpSurface *surf; @@ -173,7 +173,10 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, vl_compositor_clear_layers(&vmixer->compositor); vl_compositor_set_buffer_layer(&vmixer->compositor, 0, surf->video_buffer, RectToPipe(video_source_rect, &src_rect), NULL); - vl_compositor_render(&vmixer->compositor, dst->surface, NULL, NULL, NULL); + vl_compositor_render(&vmixer->compositor, dst->surface, + RectToPipe(destination_video_rect, &dst_rect), + RectToPipe(destination_rect, &dst_clip), + &dst->dirty_area); return VDP_STATUS_OK; } diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c index d83831e5dd2..cca69c4373e 100644 --- a/src/gallium/state_trackers/vdpau/output.c +++ b/src/gallium/state_trackers/vdpau/output.c @@ -114,6 +114,8 @@ vlVdpOutputSurfaceCreate(VdpDevice device, pipe_resource_reference(&res, NULL); + vl_compositor_reset_dirty_area(&vlsurface->dirty_area); + return VDP_STATUS_OK; } diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h index eba9e2f2d37..1922b703d33 100644 --- a/src/gallium/state_trackers/vdpau/vdpau_private.h +++ b/src/gallium/state_trackers/vdpau/vdpau_private.h @@ -323,6 +323,7 @@ typedef struct struct pipe_surface *surface; struct pipe_sampler_view *sampler_view; struct pipe_fence_handle *fence; + struct u_rect dirty_area; } vlVdpOutputSurface; typedef struct -- 2.30.2