Questions about XPresent

Michel Dänzer michel.daenzer at mailbox.org
Tue Oct 18 15:33:14 UTC 2022


On 2022-10-18 16:14, Po Lu wrote:
> Michel Dänzer <michel.daenzer at mailbox.org> writes:
> 
>> The problem with this is that there's no explicit transfer of
>> ownership of the window pixmap between the compositor and other
>> entities. So the compositor may end up reading from a stale window
>> pixmap after another presentation has already flipped in a new pixmap,
>> and the client may already be drawing a new frame to the pixmap used
>> by the compositor, resulting in visual artifacts.
> 
> If the compositor issues a Composite request, then by the time the
> request arrives on the X server, won't the pixmap resource point to the
> data of the pixmap that is currently busy?  Or are you saying that the X
> server keeps references to pixmap data that it has sent IdleNotify
> events for, and may use those pixmaps in response to a future request
> from the compositor?

I'm thinking of this kind of scenario with a direct rendering compositor:

1. Compositor retrieves window pixmap, creates OpenGL texture object for it.
2. Client sends PresentPixmap request, which results in replacing the window pixmap.
3. Client starts drawing new frame to the old window pixmap buffer.
4. Compositor samples from texture object created in step 1.


I did actually try this a while ago, and saw artifacts due to this issue.


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer



More information about the xorg-devel mailing list