st/vdpau: fix unwanted output scaling
[mesa.git] / src / gallium / state_trackers / vdpau / output.c
index 9392f4856b1e7407b11e76cd3069edf1d3410d67..cca69c4373eb60fbf57d9528dba16286b5312238 100644 (file)
@@ -35,6 +35,9 @@
 
 #include "vdpau_private.h"
 
+/**
+ * Create a VdpOutputSurface.
+ */
 VdpStatus
 vlVdpOutputSurfaceCreate(VdpDevice device,
                          VdpRGBAFormat rgba_format,
@@ -111,9 +114,14 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
    
    pipe_resource_reference(&res, NULL);
 
+   vl_compositor_reset_dirty_area(&vlsurface->dirty_area);
+
    return VDP_STATUS_OK;
 }
 
+/**
+ * Destroy a VdpOutputSurface.
+ */
 VdpStatus
 vlVdpOutputSurfaceDestroy(VdpOutputSurface surface)
 {
@@ -134,6 +142,9 @@ vlVdpOutputSurfaceDestroy(VdpOutputSurface surface)
    return VDP_STATUS_OK;
 }
 
+/**
+ * Retrieve the parameters used to create a VdpOutputSurface.
+ */
 VdpStatus
 vlVdpOutputSurfaceGetParameters(VdpOutputSurface surface,
                                 VdpRGBAFormat *rgba_format,
@@ -141,7 +152,7 @@ vlVdpOutputSurfaceGetParameters(VdpOutputSurface surface,
 {
    vlVdpOutputSurface *vlsurface;
 
-   VDPAU_MSG(VDPAU_TRACE, "[VDPAU] getting surface parameters\n");
+   VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Getting output surface parameters\n");
         
    vlsurface = vlGetDataHTAB(surface);
    if (!vlsurface)
@@ -154,6 +165,10 @@ vlVdpOutputSurfaceGetParameters(VdpOutputSurface surface,
    return VDP_STATUS_OK;
 }
 
+/**
+ * Copy image data from a VdpOutputSurface to application memory in the
+ * surface's native format.
+ */
 VdpStatus
 vlVdpOutputSurfaceGetBitsNative(VdpOutputSurface surface,
                                 VdpRect const *source_rect,
@@ -163,6 +178,10 @@ vlVdpOutputSurfaceGetBitsNative(VdpOutputSurface surface,
    return VDP_STATUS_NO_IMPLEMENTATION;
 }
 
+/**
+ * Copy image data from application memory in the surface's native format to
+ * a VdpOutputSurface.
+ */
 VdpStatus
 vlVdpOutputSurfacePutBitsNative(VdpOutputSurface surface,
                                 void const *const *source_data,
@@ -172,6 +191,10 @@ vlVdpOutputSurfacePutBitsNative(VdpOutputSurface surface,
    return VDP_STATUS_NO_IMPLEMENTATION;
 }
 
+/**
+ * Copy image data from application memory in a specific indexed format to
+ * a VdpOutputSurface.
+ */
 VdpStatus
 vlVdpOutputSurfacePutBitsIndexed(VdpOutputSurface surface,
                                  VdpIndexedFormat source_indexed_format,
@@ -195,7 +218,7 @@ vlVdpOutputSurfacePutBitsIndexed(VdpOutputSurface surface,
    struct pipe_box box;
    struct pipe_video_rect dst_rect;
 
-   VDPAU_MSG(VDPAU_TRACE, "[VDPAU] uploading indexed output surface\n");
+   VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Uploading indexed output surface\n");
 
    vlsurface = vlGetDataHTAB(surface);
    if (!vlsurface)
@@ -291,7 +314,7 @@ vlVdpOutputSurfacePutBitsIndexed(VdpOutputSurface surface,
    vl_compositor_clear_layers(compositor);
    vl_compositor_set_palette_layer(compositor, 0, sv_idx, sv_tbl, NULL, NULL, false);
    vl_compositor_render(compositor, vlsurface->surface,
-                        RectToPipe(destination_rect, &dst_rect), NULL, false);
+                        RectToPipe(destination_rect, &dst_rect), NULL, NULL);
 
    pipe_sampler_view_reference(&sv_idx, NULL);
    pipe_sampler_view_reference(&sv_tbl, NULL);
@@ -304,6 +327,10 @@ error_resource:
    return VDP_STATUS_RESOURCES;
 }
 
+/**
+ * Copy image data from application memory in a specific YCbCr format to
+ * a VdpOutputSurface.
+ */
 VdpStatus
 vlVdpOutputSurfacePutBitsYCbCr(VdpOutputSurface surface,
                                VdpYCbCrFormat source_ycbcr_format,
@@ -404,6 +431,10 @@ BlenderToPipe(struct pipe_context *context,
    return context->create_blend_state(context, &blend);
 }
 
+/**
+ * Composite a sub-rectangle of a VdpOutputSurface into a sub-rectangle of
+ * another VdpOutputSurface; Output Surface object VdpOutputSurface.
+ */
 VdpStatus
 vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface,
                                       VdpRect const *destination_rect,
@@ -424,7 +455,7 @@ vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface,
 
    void *blend;
 
-   VDPAU_MSG(VDPAU_TRACE, "[VDPAU] composing output surfaces\n");
+   VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Composing output surfaces\n");
 
    dst_vlsurface = vlGetDataHTAB(destination_surface);
    if (!dst_vlsurface)
@@ -454,6 +485,10 @@ vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface,
    return VDP_STATUS_OK;
 }
 
+/**
+ * Composite a sub-rectangle of a VdpBitmapSurface into a sub-rectangle of
+ * a VdpOutputSurface; Output Surface object VdpOutputSurface.
+ */
 VdpStatus
 vlVdpOutputSurfaceRenderBitmapSurface(VdpOutputSurface destination_surface,
                                       VdpRect const *destination_rect,