<p dir="ltr"><br>
On Oct 30, 2013 3:59 AM, "Tomeu Vizoso" <<a href="mailto:tomeu@tomeuvizoso.net">tomeu@tomeuvizoso.net</a>> wrote:<br>
><br>
> On 30 October 2013 09:44, Neil Roberts <<a href="mailto:neil@linux.intel.com">neil@linux.intel.com</a>> wrote:<br>
> > Tomeu Vizoso <<a href="mailto:tomeu@tomeuvizoso.net">tomeu@tomeuvizoso.net</a>> writes:<br>
> ><br>
> >> What I fail to see is why a single sync should be enough, as we don't<br>
> >> know when the GPU will signal that it's done with the buffer that we<br>
> >> are waiting to be released.<br>
> ><br>
> > You are right that we don't know when the GPU will release the buffer.<br>
> > However we are not waiting for that.<br>
><br>
> Oh, sure, was saying that in the context of the RPi, there we don't<br>
> want the client to have to create more than 2 buffers per surface.<br>
><br>
> In that EGL, SwapBuffers blocks waiting for the GPU to signal that<br>
> it's done rendering with the buffer that is to become the back buffer.<br>
> With your patch for not queueing if no frame callbacks are installed,<br>
> we don't need to send any sync requests. Without it, we would need to<br>
> keep syncing until we get the release.</p>
<p dir="ltr">I think I see what you mean (haven't looked at the code yet though).  I'll try and look at it tonight and maybe send out a patch to better demonstrate what I'm thinking.<br>
--Jason</p>
<p dir="ltr">> I know that you have dealt with it in Mesa already but wanted to reply<br>
> to Jason's comment, sorry for hijacking your thread :)<br>
><br>
> This is the relevant part of the code:<br>
><br>
> <a href="https://github.com/tomeuv/userland/commit/a4a7cb233af5e5b167a1cb6f928b7a6381380a56#diff-b1115e30ce4f2940df2cd98a85009ccaR2339">https://github.com/tomeuv/userland/commit/a4a7cb233af5e5b167a1cb6f928b7a6381380a56#diff-b1115e30ce4f2940df2cd98a85009ccaR2339</a><br>

><br>
> Regards,<br>
><br>
> Tomeu<br>
><br>
> > We are assuming that the GPU is<br>
> > only going to hold on to at most 2 buffers. In the DRM / Mesa case it<br>
> > needs to hold on to these because one will be used for scanout and one<br>
> > will be queued for the page flip. If we attach a third buffer then it<br>
> > will be held by the compositor as a queue for the next flip. We are<br>
> > assuming it won't have given this buffer to the GPU. Therefore if we<br>
> > attach a fourth buffer it is easy for the compositor to immediately<br>
> > release its lock on the third buffer and replace it with the fourth. So<br>
> > we can assume that the fourth attach will always generate an immediate<br>
> > release event. Sending a sync request will ensure that we always get<br>
> > this release event. So if we have four buffer slots we can assume that<br>
> > one of the attaches will always generate an immediate release event.<br>
> ><br>
> > In the non-fullscreen case where we don't really need to wait for the<br>
> > GPU, we only need 2 slots because the compositor will only lock one<br>
> > buffer.<br>
> ><br>
> > Regards,<br>
> > - Neil<br>
</p>