st/vdpau: Use transfer_inline_write to upload ycbcr data
authorChristian König <deathsimple@vodafone.de>
Fri, 10 Feb 2012 11:56:27 +0000 (12:56 +0100)
committerChristian König <deathsimple@vodafone.de>
Tue, 21 Feb 2012 10:13:20 +0000 (11:13 +0100)
Uses less code and looks at least a bit cleaner than mapping manually.

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

index 84467fdc0d237d07cbc5cbc8ea4e5a9f0ef7f374..a0ebe001aa87da17b12a05a04c0e69dc357cd56b 100644 (file)
@@ -239,24 +239,11 @@ vlVdpVideoSurfacePutBitsYCbCr(VdpVideoSurface surface,
             sv->texture->width0, sv->texture->height0, 1
          };
 
-         struct pipe_transfer *transfer;
-         void *map;
-
-         transfer = pipe->get_transfer(pipe, sv->texture, 0, PIPE_TRANSFER_WRITE, &dst_box);
-         if (!transfer)
-            return VDP_STATUS_RESOURCES;
-
-         map = pipe->transfer_map(pipe, transfer);
-         if (map) {
-            util_copy_rect(map, sv->texture->format, transfer->stride, 0, 0,
-                           dst_box.width, dst_box.height,
-                           source_data[i] + source_pitches[i] * j,
-                           source_pitches[i] * sv->texture->depth0,
-                           0, 0);
-         }
-
-         pipe->transfer_unmap(pipe, transfer);
-         pipe->transfer_destroy(pipe, transfer);
+         pipe->transfer_inline_write(pipe, sv->texture, 0,
+                                     PIPE_TRANSFER_WRITE, &dst_box,
+                                     source_data[i] + source_pitches[i] * j,
+                                     source_pitches[i] * sv->texture->depth0,
+                                     0);
       }
    }