[Mesa-dev] [PATCH 2/2] vdpau: skip vlVdpOutputSurfacePutBitsNative with a zero-area rectangle

Marek Olšák maraeo at gmail.com
Sun Feb 12 14:53:57 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

This prevents errors:
"EE r600_texture.c:1571 r600_texture_transfer_map - failed to create
 temporary texture to hold untiled copy"

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99542
---
 src/gallium/state_trackers/vdpau/output.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c
index 8b26f7a..6506280 100644
--- a/src/gallium/state_trackers/vdpau/output.c
+++ b/src/gallium/state_trackers/vdpau/output.c
@@ -256,20 +256,27 @@ vlVdpOutputSurfacePutBitsNative(VdpOutputSurface surface,
    pipe = vlsurface->device->context;
    if (!pipe)
       return VDP_STATUS_INVALID_HANDLE;
 
    if (!source_data || !source_pitches)
        return VDP_STATUS_INVALID_POINTER;
 
    pipe_mutex_lock(vlsurface->device->mutex);
 
    dst_box = RectToPipeBox(destination_rect, vlsurface->sampler_view->texture);
+
+   /* Check for a no-op. (application bug?) */
+   if (!dst_box.width || !dst_box.height) {
+      pipe_mutex_unlock(vlsurface->device->mutex);
+      return VDP_STATUS_OK;
+   }
+
    pipe->texture_subdata(pipe, vlsurface->sampler_view->texture, 0,
                          PIPE_TRANSFER_WRITE, &dst_box, *source_data,
                          *source_pitches, 0);
    pipe_mutex_unlock(vlsurface->device->mutex);
 
    return VDP_STATUS_OK;
 }
 
 /**
  * Copy image data from application memory in a specific indexed format to
-- 
2.7.4



More information about the mesa-dev mailing list