[PATCH xf86-video-amdgpu 3/6] Add amdgpu_pixmap_get_tiling_info

Michel Dänzer michel at daenzer.net
Wed Jun 8 14:43:17 UTC 2016


On 08.06.2016 22:57, StDenis, Tom wrote:
> From: Michel Dänzer <michel at daenzer.net>
>  
>> +uint64_t amdgpu_pixmap_get_tiling_info(PixmapPtr pixmap)
>> +{
>> +       struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);
>> +       uint32_t handle;
>> +
>> +       if (!priv || !priv->handle_valid) {
>> +               amdgpu_pixmap_get_handle(pixmap, &handle);
>> +               priv = amdgpu_get_pixmap_private(pixmap);
> 
> If this fails won't you just end up with a NULL pointer?

Yes, but if calloc fails for tens of bytes, that's probably one of our
lesser concerns. :) In particular, in that case we'd already crash in
amdgpu_pixmap_get_handle before we get back here.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-driver-ati mailing list