[PATCH xserver 6/7] glx: Push internal glF{lus, inis}h calls into the backend

Adam Jackson ajax at redhat.com
Tue May 10 22:47:36 UTC 2016

On Tue, 2016-05-10 at 13:57 -0700, Eric Anholt wrote:
> Adam Jackson <ajax at redhat.com> writes:
> > These calls are appropriate for indirect contexts; when we're building
> > without indirect support we don't want to reference libGL at all.
> It seems to me like a lot the code blocks calling these flushes ought to
> be only in the iglx build anyway.  How would a glx/-implemented
> SwapBuffers() or CopySubBufferMesa() do the right thing on a direct
> context?

Oh, it's worse than that. SwapBuffers is _explicitly_ legal to call
without a context at all, just naming the drawable. Some peoples'
drivers even implement that. What's meant to happen in that situation
is that the thread doing the rendering has done its own glFinish to get
the bits into the back, and then the direct rendering implementation
knows how to find the back buffer for the drawable because it told the
server about it already.

It stands a chance of working in DRI1 due to the giant shared back
buffer. DRI2/3 don't bother to try, which I consider something of a
failing, but if the client gave us enough information we could keep
track of what kind of direct context we were dealing with.

- ajax

More information about the xorg-devel mailing list