Commit Graph

22 Commits

Author SHA1 Message Date
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
2eb9915eea present: Set complete notify mode to Skip as needed
Skipped present pixmap calls were not setting the mode to
PresentCompleteModeSkip for skipped operations.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-20 12:28:00 -08:00
Keith Packard
e487babd52 present: Don't abandon presents which are already queued for flip
Presents which are not marked 'queued' and are in the window present
list are waiting for the flip event; discarding those won't work very
well (it'll end up trashing displayed content for the next frame), so
skip over those when looking for duplicate frame presents

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-20 12:28:00 -08:00
Keith Packard
ca3a5b2a8f present: Handle PresentOptionAsync for copy mode
Check for Async flag and execute immediately if set, otherwise wait
for the next appropriate vblank before copying.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-20 12:28:00 -08:00
Adam Jackson
128449dd64 present: Don't use the major/minor version from the protocol headers
We want to advertise the version we implement, not the version the
protocol headers happen to describe.

Reviewed-by: Jasper St. Pierre <<jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-13 14:59:04 -05:00
Keith Packard
fe07ec19e2 present: recursively set window pixmaps on flip
Newly created windows inherit the pixmap of their parent, similarly,
reparenting a tree inherits the pixmap of the destination tree.

Making present preserve the invariant that unredirected windows always
have the same pixmap as their parent ensures that the above cases work
correctly.

v2: name the recursive function to 'set_tree_pixmap' instead of 'set_window_pixmap'

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-10 14:16:42 -08:00
Adam Jackson
2bf9210829 present: Disable when Xinerama is active
Among much else Present depends on RANDR types, and RANDR isn't properly
Xinerama-aware yet anyway.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Keith Packard
653d33941b present: Report damage when flipping
Limit damage to the 'update' region.

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
5cf12c9569 present: Also set the root window pixmap when flipping
This makes sure that things like software cursors continue to work
while the screen is flipped.

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
4aa77378de present: Clear target_crtc if driver lacks Present support
If the driver doesn't have the necessary hooks for Present, then the
target_crtc needs to be set to NULL to make sure the extension uses
the present_fake code.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-05 09:51:00 -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
cde86e68fc present: Set window pixmap to flipped pixmap
This makes other drawing to the window appear on the screen.

Note that no child windows can be affected because only full-screen
windows are eligible for flipping, and so we only need to set pixmap
for the window itself.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-05 09:48:38 -08:00
Keith Packard
04e138846e present: Leave vblank on window list until flip complete
If the window is destroyed, then we've got cleanup work to do, even if
the vblank has already been executed -- we need to clear the window
pointer so that we don't try to deliver events to it.

Leaving it on the window list meant that when walking that list, we
need to know whether the vblank is waiting to be executed or waiting
for the flip to complete, so a new 'queued' flag was added to the
vblank to distinguish between the two states.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-05 09:48:36 -08:00
Keith Packard
b121d62acc present: Add a debug output line when skipping a pending present
When an application provides two pixmaps for the same MSC, the
previous one is skipped. This just dumps out some information at that point

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-05 09:48:02 -08:00
Keith Packard
6403cbb143 present: When unflipping, copy to flip window rather than screen
unflip happens after the clip lists have been updated, so instead of
smashing the whole screen and drawing over other windows, just draw to
the original flip window; it'll have the right clip list and so the
copy will work just fine.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-20 13:12:33 -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
e5a188cb91 present: Signal destroyed flip window with vblank->window == NULL
This eliminates dereferencing freed window pointers when there is a
flip for that window in progress. The flip will complete, and then
immediately get undone (as we can't stop an in-progress flip).

Remove the vblank->window_destroyed field as we can signal this with
vblank->window == NULL instead.

Change check to vblank->window == NULL in:

	present_flip_notify

Add check for vblank->window == NULL in:
	present_vblank_notify
	present_execute

present_flip_notify was also using vblank->window->drawable.pScreen,
so stop doing that and use vblank->screen instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-20 13:12:27 -08:00
Keith Packard
a5bcc4f7b9 present: Ignore event_id 0 from driver vblank notify
We use event_id 0 to mean 'no such event'; if a driver sends us that
event_id, make sure we don't accidentally match it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-20 13:12:25 -08:00
Keith Packard
4f3c37a1f1 present: Round fake MSC computations intead of truncating
If the timer fired too early, we'd sometimes mis-compute the MSC for
fake vblanks. Rounding the computation to the nearest MSC fixes this nicely.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-20 13:12:22 -08:00
Keith Packard
0822a23e04 present: Change debug output a bit to help diagnose missing vblank signals
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-11 15:16:38 -08:00
Keith Packard
20bb49ae9b Present: Check for window/fence destroyed when idling pixmaps
A client destroying objects in the middle of an unflip can end up
having the screen flip window or fence set to NULL in the unflip
notify path. Check for these and don't try to use those objects.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-11 15:16:15 -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