Re: Does gbm_bo_map() implicitly synchronise?

Pierre Ossman <[email protected]>
Newsgroups gmane.comp.video.mesa3d.devel
Organization Cendio AB
Message-ID <[email protected]>
On 17/06/2024 16:50, Michel Dänzer wrote:
> On 2024-06-17 12:29, Pierre Ossman wrote:
>>
>> Just to avoid any uncertainty, are both of these things done implicitly by gbm_bo_map()/gbm_bo_unmap()?
>>
>> I did test adding those steps just in case, but unfortunately did not see an improvement. My order was:
>>
>> 1. gbm_bo_import(GBM_BO_USE_RENDERING)
>> 2. gbm_bo_get_fd()
>> 3. Wait for client to request displaying the buffer
>> 4. gbm_bo_map(GBM_BO_TRANSFER_READ)
>> 5. select(fd+1, &fds, NULL, NULL, NULL)
> 
> *If* select() is needed, it needs to be before gbm_bo_map(), because the latter may perform a blit from the real BO to a staging one for CPU access.
> 

Can I know whether it is needed or not? Or should I be cautious and 
always do it?

I also assumed I should do select() with readfds set when I want to 
read, and writefds set when I want to write?

Still, after moving it before the map the issue unfortunately remains. :/

A recording of the issue is available here, in case the behaviour rings 
a bell for anyone:

http://www.cendio.com/~ossman/dri3/Screencast%20from%202024-06-17%2017-06-50.webm

(tried to include it as an attachment, but that email was filtered out 
somewhere)

Regards,
-- 
Pierre Ossman           Software Development
Cendio AB               https://cendio.com
Teknikringen 8          https://twitter.com/ThinLinc
583 30 Linköping        https://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?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.