[Mesa-dev] [PATCH 1/2] st/vdpau: implement vlVdpOutputSurfaceQueryCapabilities

Christian König deathsimple at vodafone.de
Mon Feb 6 12:55:18 PST 2012


On 06.02.2012 15:07, Maarten Lankhorst wrote:
> Op 06-02-12 12:50, Christian König schreef:
>> Fixing some problems with gstreamer.
>>
>> Signed-off-by: Christian König<deathsimple at vodafone.de>
>> ---
>>   src/gallium/state_trackers/vdpau/query.c |   38 
>> ++++++++++++++++++++++++++++-
>>   1 files changed, 36 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/state_trackers/vdpau/query.c 
>> b/src/gallium/state_trackers/vdpau/query.c
>> index 18ca0b1..17382fd 100644
>> --- a/src/gallium/state_trackers/vdpau/query.c
>> +++ b/src/gallium/state_trackers/vdpau/query.c
>> @@ -188,12 +188,46 @@ VdpStatus
>>   vlVdpOutputSurfaceQueryCapabilities(VdpDevice device, VdpRGBAFormat 
>> surface_rgba_format,
>>                                       VdpBool *is_supported, uint32_t 
>> *max_width, uint32_t *max_height)
>>   {
>> +   vlVdpDevice *dev;
>> +   struct pipe_screen *pscreen;
>> +   enum pipe_format format;
>> +
>> +   VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpOutputSurface 
>> capabilities\n");
>> +
>> +   dev = vlGetDataHTAB(device);
>> +   if (!dev)
>> +      return VDP_STATUS_INVALID_HANDLE;
>> +
>> +   pscreen = dev->vscreen->pscreen;
>> +   if (!pscreen)
>> +      return VDP_STATUS_RESOURCES;
>> +
>> +   format = FormatRGBAToPipe(surface_rgba_format);
>> +   if (format == PIPE_FORMAT_NONE || format == PIPE_FORMAT_A8_UNORM)
>> +      return VDP_STATUS_INVALID_RGBA_FORMAT;
>> +
>>      if (!(is_supported&&  max_width&&  max_height))
>>         return VDP_STATUS_INVALID_POINTER;
>>
>> -   VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpOutputSurface 
>> capabilities\n");
>> +   *is_supported = pscreen->is_format_supported
>> +   (
>> +      pscreen, format, PIPE_TEXTURE_3D, 1,
>> +      PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET
>> +   );
>> +   if (*is_supported) {
>> +      uint32_t max_2d_texture_level = pscreen->get_param(
>> +         pscreen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
>>
>> -   return VDP_STATUS_NO_IMPLEMENTATION;
>> +      if (!max_2d_texture_level)
>> +         return VDP_STATUS_RESOURCES;
> Shouldn't this be VDP_STATUS_ERROR since it's an internal error, not 
> an out of memory problem?
Good catch, that's a copy & paste error and we should fix origin of this 
line in the previous function also.

>
> If-fixed-reviewed-by: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Fixed committed.

Thanks,
Christian.


More information about the mesa-dev mailing list