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

Kai Wasserbäch kai at dev.carbon-project.org
Sun Feb 12 17:49:37 UTC 2017


Hey Marek,
Marek Olšák wrote on 12.02.2017 15:53:
> 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;
> +   }
> +

since this is marked as an application bug, should there be a "warn once" along
the lines of "application called vlVdpOutputSurfacePutBitsNative() with a
zero-area rectangle, this is most likely a bug"?

>     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

In any case, this series is:
  Tested-by: Kai Wasserbäch <kai at dev.carbon-project.org>
  Reviewed-by: Kai Wasserbäch <kai at dev.carbon-project.org>

Cheers,
Kai

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170212/ea8f3eb1/attachment.sig>


More information about the mesa-dev mailing list