Bug 27962 - BufferSwapComplete delivered when not selected for (direct rendering)
Summary: BufferSwapComplete delivered when not selected for (direct rendering)
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-04 08:36 UTC by Owen Taylor
Modified: 2010-07-14 10:24 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
track event mask in client code (2.28 KB, patch)
2010-05-04 08:44 UTC, Jesse Barnes
Details | Splinter Review
track event mask in client code, v2 (2.00 KB, patch)
2010-07-14 08:08 UTC, Nick Bowler
Details | Splinter Review

Description Owen Taylor 2010-05-04 08:36:41 UTC
The X server implementation of GLX checks the drawables event mask before sending GLX_BufferSwapComplete events, but when direct rendering, we convert DRI2_BufferSwapComplete events into the GLX events, and the DRI2 events are sent unconditionally. So application always receives events even when it hasn't asked for them.

This certainly violates the expectations of the extension spec and could confuse applications.

Probably DRI2EventToWire should silently consume the events without delivering them (this would mean saving the event mask client side.)
Comment 1 Jesse Barnes 2010-05-04 08:44:09 UTC
Created attachment 35414 [details] [review]
track event mask in client code

Totally untested (not even compiled) patch to track the event mask on the client side and ignore DRI2 events we're not looking for.
Comment 2 Nick Bowler 2010-07-14 08:08:23 UTC
Created attachment 37042 [details] [review]
track event mask in client code, v2

This affects every application using freeglut, causing them to spew messages
of the form

  freeglut (./gears): Unknown X event type: 104

to standard error.  The result after applying the patch didn't compile, so I
fixed it up a bit and changed 'return True' to 'return False' so that it
actually works.  With the new patch, the freeglut messages are gone.
Comment 3 Jesse Barnes 2010-07-14 08:26:13 UTC
Nick, can you post the patch to mesa-dev@lists.freedesktop.org?  Once we get some review I can commit it.
Comment 4 Nick Bowler 2010-07-14 10:02:16 UTC
(In reply to comment #3)
> Nick, can you post the patch to mesa-dev@lists.freedesktop.org?  Once we get
> some review I can commit it.

Patch is sent and should reach the list when a moderator gets around to
approving it.
Comment 5 Jesse Barnes 2010-07-14 10:24:31 UTC
Commit: f8d81c31cee30821da3aab331a57f484f6a07a5d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8d81c31cee30821da3aab331a57f484f6a07a5d

Author: Nick Bowler <nbowler@draconx.ca>
Date:   Wed Jul 14 12:01:49 2010 -0400

dri2: Track event mask in client code.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.