Does gbm_bo_map() implicitly synchronise?

2024-06-14 Thread Pierre Ossman
I'm experimenting with DRI3 and its use of GBM to share buffers. It 
mostly works fine, but I'm seeing some issues that have me concerned 
there might be a synchronisation issue.


The documentation isn't entirely clear, so my question is if 
gbm_bo_map() handles all the implicit synchronisation for me, or if 
there is something more I can do?


I tried doing gbm_bo_get_fd() followed by a select() and 
ioctl(DMA_BUF_IOCTL_SYNC), but my issue did not go away. Now I'm unsure 
if I'm doing it wrong, or if I'm chasing the wrong theory.


Anyone with insight on what's needed for stable synchronisation?

Regards,
--
Pierre Ossman   Software Development
Cendio AB   https://cendio.com
Teknikringen 8  https://twitter.com/ThinLinc
583 30 Linköpinghttps://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


Re: Does gbm_bo_map() implicitly synchronise?

2024-06-14 Thread Marek Olšák
gbm_bo_map synchronizes if it needs to move memory to make the buffer
readable by the CPU or if the buffer is being used/written by the GPU.

Marek

On Sat, Jun 15, 2024 at 1:12 AM Pierre Ossman  wrote:
>
> I'm experimenting with DRI3 and its use of GBM to share buffers. It
> mostly works fine, but I'm seeing some issues that have me concerned
> there might be a synchronisation issue.
>
> The documentation isn't entirely clear, so my question is if
> gbm_bo_map() handles all the implicit synchronisation for me, or if
> there is something more I can do?
>
> I tried doing gbm_bo_get_fd() followed by a select() and
> ioctl(DMA_BUF_IOCTL_SYNC), but my issue did not go away. Now I'm unsure
> if I'm doing it wrong, or if I'm chasing the wrong theory.
>
> Anyone with insight on what's needed for stable synchronisation?
>
> Regards,
> --
> Pierre Ossman   Software Development
> Cendio AB   https://cendio.com
> Teknikringen 8  https://twitter.com/ThinLinc
> 583 30 Linköpinghttps://facebook.com/ThinLinc
> Phone: +46-13-214600
>
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?