st/xa: Fix regression in xa_yuv_planar_blit()
authorThomas Hellstrom <thellstrom@vmware.com>
Sun, 28 Sep 2014 15:17:22 +0000 (17:17 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 30 Sep 2014 06:31:33 +0000 (08:31 +0200)
Commit "st/xa: scissor to help tilers" broke xa_yuv_planar_blit() and vmwgfx
textured video. Fix this by implementing scissors also in the yuv draw path.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/xa/xa_renderer.c
src/gallium/state_trackers/xa/xa_yuv.c

index 121d8ed3b9b9bc37c6c7974d07289ad2134687a4..780b24777af20026c50844aa3f6c8ace0aa5d4c4 100644 (file)
@@ -530,11 +530,22 @@ renderer_draw_yuv(struct xa_context *r,
                          src_x, src_y, src_w, src_h,
                          dst_x, dst_y, dst_w, dst_h, srf);
 
+   if (!r->scissor_valid) {
+       r->scissor.minx = 0;
+       r->scissor.miny = 0;
+       r->scissor.maxx = r->dst->tex->width0;
+       r->scissor.maxy = r->dst->tex->height0;
+   }
+
+   r->pipe->set_scissor_states(r->pipe, 0, 1, &r->scissor);
+
    cso_set_vertex_elements(r->cso, num_attribs, r->velems);
    util_draw_user_vertex_buffer(r->cso, r->buffer, PIPE_PRIM_QUADS,
                                 4,     /* verts */
                                 num_attribs);  /* attribs/vert */
    r->buffer_size = 0;
+
+   xa_scissor_reset(r);
 }
 
 void
index 43f56ff05154d13d0d457a92fad148d1b1ea98ad..15196392ac79b6981b569999ef2f04ed90d10e76 100644 (file)
@@ -146,6 +146,7 @@ xa_yuv_planar_blit(struct xa_context *r,
        int w = box->x2 - box->x1;
        int h = box->y2 - box->y1;
 
+        xa_scissor_update(r, x, y, box->x2, box->y2);
        renderer_draw_yuv(r,
                          (float)src_x + scale_x * (x - dst_x),
                          (float)src_y + scale_y * (y - dst_y),