[Mesa-dev] [PATCH] vl/dri3: remove the wait before getting back buffer
Michel Dänzer
michel at daenzer.net
Mon Mar 25 15:02:12 UTC 2019
On 2019-03-21 8:10 p.m., Liu, Leo wrote:
> On 2019-03-20 1:56 p.m., Michel Dänzer wrote:
>> On 2019-03-20 4:42 p.m., Liu, Leo wrote:
>>> The wait here is unnecessary since we got a pool of back buffers,
>>> and the wait for swap buffer will happen before the present pixmap,
>>> at the same time the previous back buffer will be put back to pool
>>> for reuse after the check for PresentIdleNotify event
>>>
>>> Signed-off-by: Leo Liu <leo.liu at amd.com>
>>>
>>> [...]
>>>
>>> @@ -626,13 +621,6 @@ vl_dri3_screen_texture_from_drawable(struct vl_screen *vscreen, void *drawable)
>>> if (!dri3_set_drawable(scrn, (Drawable)drawable))
>>> return NULL;
>>>
>>> - if (scrn->flushed) {
>>> - while (scrn->special_event && scrn->recv_sbc < scrn->send_sbc)
>>> - if (!dri3_wait_present_events(scrn))
>>> - return NULL;
>>> - }
>>> - scrn->flushed = false;
>>> -
>>> buffer = (scrn->is_pixmap) ?
>>> dri3_get_front_buffer(scrn) :
>>> dri3_get_back_buffer(scrn);
>>>
>> Hmm. Is the wait here not necessary before getting a pixmap's front
>> buffer either though? Maybe wait only here for a pixmap, and only in
>> vl_dri3_flush_frontbuffer for a window?
>>
>> Sorry I didn't realize this earlier.
>>
> The pixmap case is used by Totem player, or previous GLX case for MPV
> player, and the front buffer of the pixmap is a temporary buffer, and
> later as source for GL to present.
>
> For pixmap case, there is no need to wait, and the dri3 present wait
> before dri3_get_front_buffer() is not get called, because scrn->flushed
> will never be true, since our presentation flush code is not used by
> this case.
Makes sense, thanks.
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
--
Earthling Michel Dänzer | https://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the mesa-dev
mailing list