[Mesa-dev] [Bug 54372] GLX_INTEL_swap_event crashes driver when swapping window buffers

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jun 7 21:07:33 PDT 2014


--- Comment #13 from Tapani Pälli <lemody at gmail.com> ---
(In reply to comment #12)

> Prior to GLX 1.3 there was the glxMakeCurrent() function that took a single
> drawable handle. The Drawable could be either a bare XID for a Window or an
> XID for a glxpixmap.
> GLX 1.3 added glxMakeContextCurrent that takes 2 handles: one for reading,
> one for writing. Nowadays the old glxMakeCurrent call is implemented as a
> call to glxMakeContextCurrent with the single handle duplicated.
> Because of this it is allowed to use a plain-old Window ID as an argument to
> glxMakeContextCurrent, although nobody really documents this sort of thing.
> The manpage for the NEW call specifies the arguments as GLXPixmaps, but the
> actual code accepts Window XIDs too, and handles them correctly.

Can you pinpoint to such documentation? I can't find historical API reference
where glxMakeCurrent would take XID as parameter (for example GLX 1.2 does not,
it requires a GLXDrawable handle).

I think in theory you should be getting GLXBadDrawable error here.

("GLXBadDrawable is generated if drawable is not a valid GLX drawable.")

> The "piglit" tests all use GLXWindows and/or GLXPixmaps. You never tested
> swap events with a bare Window XID. That is what my app was doing.

We could add such a test but it should probably fail in the above way. I don't
know enough of X server to be 100% sure though, I would imagine it has unique
handles for every resource but this starts to look like it does not.

> I can work around this bug by creating glxpixmaps instead of using a raw
> Window XID for my main window. But you're still stuck having to handle this
> case. I've thought deeply about your options, and my patch is the least
> painful.

I would consider this not a workaround but a fix to your application as you
need to use today's API documentation and specs. I do agree that there might be
a problem with the API too to detect this situation.

You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140608/5bafee44/attachment.html>

More information about the mesa-dev mailing list