Re: Does gbm_bo_map() implicitly synchronise?
Chema Casanova <[email protected]>
| Newsgroups | gmane.comp.video.mesa3d.devel |
|---|---|
| Organization | Igalia |
| Message-ID | <[email protected]> |
El 17/6/24 a las 12:29, Pierre Ossman escribió: > >> So if you want to do some rendering with OpenGL and then see the >> result in a buffer memory mapping the correct sequence would be the >> following: >> >> 1. Issue OpenGL rendering commands. >> 2. Call glFlush() to make sure the hw actually starts working on the >> rendering. >> 3. Call select() on the DMA-buf file descriptor to wait for the >> rendering to complete. >> 4. Use DMA_BUF_IOCTL_SYNC to make the rendering result CPU visible. >> > > What I want to do is implement the X server side of DRI3 in just CPU. > It works for every application I've tested except gnome-shell. You can have a look at the Open MR we created two years ago for Xserver [1] "modesetting: Add DRI3 support to modesetting driver with glamor disabled". We are using it downstream for Raspberry Pi OS to enable on RPi1-3 GPU accelerated client applications, while the Xserver is using software composition with pixman. [1] https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/945 We recently identified that it has an issue[2] with synchronization on the server side when after glFlush() in the client side the command list takes too much (several seconds) to finish the rendering. [2] https://gitlab.freedesktop.org/mesa/mesa/-/issues/11228 > > I would assume that 1. and 2. are supposed to be done by the X client, > i.e. gnome-shell? > > What I need to be able to do is access the result of that, once the X > client tries to draw using that GBM backed pixmap (e.g. using > PresentPixmap). > > So far, we've only tested Intel GPUs, but we are setting up Nvidia and > AMD GPUs at the moment. It will be interesting to see if the issue > remains on those or not. > Regards, Chema Casanova