[Mesa-dev] [PATCH 02/11] loader/dri3: Make sure we always have a context for image blit operations

Michel Dänzer michel at daenzer.net
Tue Aug 15 07:33:29 UTC 2017


On 15/08/17 03:57 PM, Michel Dänzer wrote:
> On 11/08/17 11:14 PM, Thomas Hellstrom wrote:
>> The code was relying on us always having a current context for client local
>> image blit operations. Otherwise the blit would be skipped. However,
>> glxSwapBuffers, for example, doesn't require a current context and that was a
>> common problem in the dri1 era. It seems the problem has resurfaced with dri3.
>>
>> If we don't have a current context when we want to blit, try creating a private
>> dri context and maintain a context cache of a single context.
>>
>> Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
> 
> [...]
> 
>> @@ -149,6 +254,9 @@ loader_dri3_drawable_init(xcb_connection_t *conn,
>>     draw->have_fake_front = 0;
>>     draw->first_init = true;
>>  
>> +   draw->have_image_blit = draw->ext->image->base.version >= 9 &&
>> +      draw->ext->image->blitImage != NULL;
> 
> Is it really worth having a dedicated drawable field for this? Seems
> like open-coding this in loader_dri3_blit_image should be fine.

I see the field is used in more places in later patches, but I still
think making it a helper function instead of a dedicated field should be
fine.


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


More information about the mesa-dev mailing list