[PATCH] present: Cancel the copy on unflip when aborting a pending flip

Michel Dänzer michel at daenzer.net
Fri Feb 19 09:49:10 UTC 2016


On 19.11.2015 18:23, Michel Dänzer wrote:
> On 16.02.2015 20:51, Chris Wilson wrote:
>> If we handle a vblank notification and perform a copy whilst a flip is
>> still pending, we mark the pending flip for abort. After marking the
>> next flip completion for abortion, we then proceed to copy the requested
>> region into the restored Window drawable. However, when we then process
>> the unflip for the aborted Pixmap we copy the contents of flip pixmap
>> over top of the previously copied region - overwriting it with stale
>> data.
>>
>> A simplish hack that seems to prevent this is to mark the flip_window as
>> NULL during set_abort so that unflip skips the copy back over the
>> updated contents.
>>
>> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
>> ---
>>  present/present.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/present/present.c b/present/present.c
>> index 9a283d4..e9ccfb8 100644
>> --- a/present/present.c
>> +++ b/present/present.c
>> @@ -401,10 +401,12 @@ present_set_abort_flip(ScreenPtr screen)
>>       * 2D applications drawing to the wrong pixmap.
>>       */
>>  
>> -    if (screen_priv->flip_window)
>> +    if (screen_priv->flip_window) {
>>          present_set_tree_pixmap(screen_priv->flip_window,
>>                                  screen_priv->flip_pixmap,
>>                                  pixmap);
>> +	screen_priv->flip_window = NULL;
>> +    }
>>  
>>      if (screen->root)
>>          present_set_tree_pixmap(screen->root, NULL, pixmap);
>>
> 
> Have you found a less hackish solution in the meantime?

I think I have now: https://patchwork.freedesktop.org/patch/74387/


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


More information about the xorg-devel mailing list