st/vdpau: some mixer fixes
authorChristian König <deathsimple@vodafone.de>
Mon, 12 Dec 2011 15:28:24 +0000 (16:28 +0100)
committerChristian König <deathsimple@vodafone.de>
Wed, 14 Dec 2011 13:20:44 +0000 (14:20 +0100)
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 <m.b.lankhorst@gmail.com>

Signed-off-by: Christian König <deathsimple@vodafone.de>
src/gallium/state_trackers/vdpau/mixer.c
src/gallium/state_trackers/vdpau/output.c
src/gallium/state_trackers/vdpau/vdpau_private.h

index 5657e7c83b09a3906436ce112cd143ce99f3754d..1588744ad633c000811019fff308bb222f5796bd 100644 (file)
@@ -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;
 }
index d83831e5dd2eee9fe480e39d518b97fa7b18e3a4..cca69c4373eb60fbf57d9528dba16286b5312238 100644 (file)
@@ -114,6 +114,8 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
    
    pipe_resource_reference(&res, NULL);
 
+   vl_compositor_reset_dirty_area(&vlsurface->dirty_area);
+
    return VDP_STATUS_OK;
 }
 
index eba9e2f2d3799697d1a90d8aec17c543bd01d112..1922b703d33ca21e8e361e010ac09b0792ace9d2 100644 (file)
@@ -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