Mesa (master): vl/video_buffer: fix up surface ordering for the interlaced case

Maarten Lankhorst mlankhorst at kemper.freedesktop.org
Wed Jan 16 16:23:11 UTC 2013


Module: Mesa
Branch: master
Commit: 4b8af72f96825cba8519b2c381ccde42decb69d3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4b8af72f96825cba8519b2c381ccde42decb69d3

Author: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Date:   Tue Dec 18 13:17:22 2012 +0100

vl/video_buffer: fix up surface ordering for the interlaced case

It seems the other code expects surface[0..1] to be the luma field in interlaced case.

See for example vdpau/surface.c vlVdpVideoSurfaceClear and vlVdpVideoSurfacePutBitsYCbCr.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>

---

 src/gallium/auxiliary/vl/vl_video_buffer.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c
index 511485f..d61dab2 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.c
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
@@ -356,20 +356,20 @@ vl_video_buffer_surfaces(struct pipe_video_buffer *buffer)
    pipe = buf->base.context;
 
    depth = buffer->interlaced ? 2 : 1;
-   for (i = 0, surf = 0; i < depth; ++i ) {
-      for (j = 0; j < VL_NUM_COMPONENTS; ++j, ++surf) {
+   for (i = 0, surf = 0; i < VL_NUM_COMPONENTS; ++i) {
+      for (j = 0; j < depth; ++j, ++surf) {
          assert(surf < (VL_NUM_COMPONENTS * 2));
 
-         if (!buf->resources[j]) {
+         if (!buf->resources[i]) {
             pipe_surface_reference(&buf->surfaces[surf], NULL);
             continue;
          }
 
          if (!buf->surfaces[surf]) {
             memset(&surf_templ, 0, sizeof(surf_templ));
-            surf_templ.format = vl_video_buffer_surface_format(buf->resources[j]->format);
-            surf_templ.u.tex.first_layer = surf_templ.u.tex.last_layer = i;
-            buf->surfaces[surf] = pipe->create_surface(pipe, buf->resources[j], &surf_templ);
+            surf_templ.format = vl_video_buffer_surface_format(buf->resources[i]->format);
+            surf_templ.u.tex.first_layer = surf_templ.u.tex.last_layer = j;
+            buf->surfaces[surf] = pipe->create_surface(pipe, buf->resources[i], &surf_templ);
             if (!buf->surfaces[surf])
                goto error;
          }




More information about the mesa-commit mailing list