Commit Graph

11 Commits

Author SHA1 Message Date
Michel Dänzer 62d8c1cc69 present: Include dix-config.h instead of xorg-config.h
This is DIX code.
2020-09-15 11:41:34 +02:00
Adam Jackson b9f415cbad present: Fix swapping of PresentCompleteNotify events
The code would fall through to the PresentIdleNotify case, and nothing
good would come of it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-05-08 12:15:29 -04:00
Michel Dänzer 76732f498f Revert "present: Only send PresentCompleteNotify events to the presenting client"
This reverts commit 5c00e69363.

It broke the Gallium nine state tracker, which makes PresentPixmap
requests on one display connection and processes the corresponding
events on another one.

The issue that motivated this change is prevented on the client side by
https://cgit.freedesktop.org/mesa/mesa/commit/?id=7b0e8264dd21ae05521d08d41fecd84139401fef

Bugzilla: https://bugs.freedesktop.org/104678
2018-01-24 11:40:50 +01:00
Michel Dänzer 559954aaa8 present: Only send PresentCompleteNotify events to the presenting client
We were sending the events to all clients listening for them on the
window. But clients can get confused by events from another client, and
I can't imagine any case where receiving events from other clients would
be required.

v2:
* Also restrict events sent to additional windows to the presenting
  client
* Don't shorten line lengths

Reviewed-by: Keith Packard <keithp@keithp.com>
2017-11-23 10:28:06 +01:00
Michel Dänzer c833c0866f present: Handle event mask updates as specified v2
From the Present extension specification:

 An event context is associated with a specific window; using
 an existing event context with a different window generates
 a Match error.

 If eventContext specifies an existing event context, then if
 eventMask is empty, PresentSelectInput deletes the specified
 context, otherwise the specified event context is changed to
 select a different set of events.

 If eventContext is an unused XID, then if eventMask is empty
 no operation is performed. Otherwise, a new event context is
 created selecting the specified events.

Without this change, there's no way for a client to explicitly change
or destroy an existing event mask entry. Trying to do so as specified
above would just result in a protocol error.

v2: (Keith Packard)
* Use dixLookupResourceByType instead of walking window_priv->events
* Return BadMatch if the existing event context is associated with a
  different window or client
* Call LEGAL_NEW_RESOURCE again when creating a new event context
* Drop invalid "leak fix"

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-07-30 15:43:54 -07:00
Adam Jackson c732bb2799 present: static cleanup
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08 16:40:57 -04:00
Keith Packard bf338efc67 glx/present: Only send GLX_BufferSwapComplete for PresentCompleteKindPixmap
Present didn't provide the 'kind' argument to the
present_complete_notify hook that GLX uses to construct
GLX_BufferSwapComplete events, so GLX was reporting events for
PresentCompleteKindMSC notifications, which resulted in duplicate
GLX_BufferSwapComplete events and crashes in clutter.

See the gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=733282

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-11 18:19:41 -07:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Keith Packard 3dd5bfe540 present: Send GLX_BufferSwapComplete events from present extension
This allows GL to support the GLX_INTEL_swap_event extension.

v2: Return GLX_BLIT_COMPLETE_INTEL for unknown swap types

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-05 09:51:00 -08:00
Keith Packard 8bdd2ccc77 present: Block for wait_fence in present_execute
Pend presentation until wait_fence is also triggered by having the
SyncFence trigger invoke present_execute once triggered.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-20 13:12:30 -08:00
Keith Packard 5c5c1b7798 present: Add Present extension
Provides both a software implementation using timers and driver hooks
to base everything on vblank intervals.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:59:18 -07:00