[Mesa-dev] [PATCH 2/2] vdpau: skip vlVdpOutputSurfacePutBitsNative with a zero-area rectangle
Christian König
deathsimple at vodafone.de
Mon Feb 13 09:41:49 UTC 2017
Am 12.02.2017 um 18:49 schrieb Kai Wasserbäch:
> 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"?
Actually I'm not sure if that is an application bug.
Trying to put a box with zero width and hight might not make much sense,
but the interface doesn't forbids that explicitly.
Anyway we need to catch this case in the state tracker and so the patch
is Reviewed-by: Christian König <christian.koenig at amd.com>.
Regards,
Christian.
>
>> 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
>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170213/acd2c80e/attachment.html>
More information about the mesa-dev
mailing list