Commit Graph

145 Commits

Author SHA1 Message Date
Roman Gilg 902429f077 present: Add exported init function of window flip mode
Allow drivers now to initialize window flip mode.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:44 -04:00
Roman Gilg a337949f99 present: Add cleanups for window flip mode
Make sure that vblanks and windows get cleaned up correctly
in window flip mode.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:42 -04:00
Roman Gilg 66a5c0bccb present: In window flip mode report damage on flip to driver
Calculate damage before trying to flip and report it to the driver.
This allows drivers to optimize their rendering.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:39 -04:00
Roman Gilg 029608dd80 present: Add window flip mode
In contrast to screen flip mode this mode:
* supports flips per windows (these windows currently need to have the same
  size as their parent windows with the same pixmap),
* sends pixmap idle signals to the client only after the driver has given
  an additional event notify.

This patch only introduces the new mode as a stub. It additionally needs a
driver hook, such that it can get initialized and appropriate cleanup
functions.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:36 -04:00
Roman Gilg 8d370fcdca present: Add driver facing window flip mode hooks
To enable special functionality of window flips introduce for window flips
a separate set of driver facing function hooks.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:34 -04:00
Roman Gilg 7b071b4e44 present: Adapt flip mode API hooks for window flip mode
Flipping pixmaps per window needs additional arguments in the
flip mode API. Add these as preperation for window flip mode.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:33 -04:00
Roman Gilg 92b91b8cf3 present: Add flip_idler vblank property
Introduce vblank property for flip modes, that demand explicite
allowance by the driver for vblanks to become idle.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:31 -04:00
Roman Gilg 84e47f3fe6 present: Add present_window_priv properties for window flip mode
For window flip mode data about flips needs to be stored per window.
Add properties to 'present_window_priv' and initialize them on creation.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:30 -04:00
Roman Gilg 3aaaac0be5 present: Refactor present_screen_init
To initialize easily different flip modes, refactor
'present_screen_init'.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:28 -04:00
Roman Gilg 6d813bbd5e present: Add more hooks to internal flip mode API
Add hooks to query caps, get crtcs, abort vblanks and destroy
a flip.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:27 -04:00
Roman Gilg 6a338b5959 present: Move timings adjustment in common part of flip mode API
To reduce future code duplication refactor timings adjustment out
as a separate function.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:25 -04:00
Roman Gilg 84112a1d0b present: Add flip mode API hook for present_can_window_flip
Flip modes can now have different implementations of
present_can_window_flip.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:24 -04:00
Roman Gilg 1db7cf0429 present: Add flip mode API hook for present_pixmap
Make present_pixmap a common function callable by any
flip mode.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:22 -04:00
Roman Gilg 679ffbf5f3 present: Refactor execute in separate file
To be shared by multiple flip modes, refactor execute functionality,
such that logical chunks can go in new separate file.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:20 -04:00
Roman Gilg 1e7d8902bf present: Add flip mode API hooks for several functions
Add 'queue_vblank', 'flush' and 're_execute' hooks, that
are supposed to be shared with other flip modes.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:18 -04:00
Roman Gilg 5365ece70a present: Move vblank functionality in seperate file
With the new internal flip mode API move vblank creation
and so on into a seperate file, such that it can be shared
between flip modes.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:16 -04:00
Roman Gilg c5c50c6db1 present: Preliminary internal flip mode API
Add some basic function hooks to our future present-internal flip mode API,
that will allow us to share functionality in between modes and move more code
in separate files.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:14 -04:00
Roman Gilg dda7efec36 present: Move screen flip functionality in separate file
As a preperation for future flip mode alternatives move most of the
functionality from 'present.c' into a separate file.

Leave some functions needed by future other flip modes in 'present.c'.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28 14:36:12 -04:00
Emil Velikov 6a5d51e082 present: cap the version returned to the client
As per the protocol, the server should not return version greater than
the one supported by the client.

Add a spec quote and tweak the numbers accordingly.

Fixes: 5c5c1b7798 ("present: Add Present extension")
Cc: Thierry Reding <treding@nvidia.com>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-19 15:46:41 -04:00
Louis-Francis Ratté-Boulianne cef12efc15 glamor: Implement GetSupportedModifiers
Implement function added in DRI3 v1.1.

A newest version of libepoxy (>= 1.4.4) is required as earlier
versions use a problematic version of Khronos
EXT_image_dma_buf_import_modifiers spec.

v4: Only send scanout-supported modifiers if flipping is possible
v5: Fix memory corruption in XWayland (uninitialized pointer)

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:55 -05:00
Louis-Francis Ratté-Boulianne e2ef3b44fa present: Send PresentCompleteModeSuboptimalCopy appropriately
Add 'check_flip2' hook for driver to let know the core
about why flipping is not possible ('reason').
If it is because of unsupported buffer format/modifier,
a PresentCompleteNotify event is sent to the client with
the PresentCompleteModeSuboptimalCopy mode.

v2: Check for PresentOptionSuboptimal and check driver version
    before using 'check_flip2'.

v3: Only require one of 'check_flip' or 'check_flip2' to be
    implemented by the driver.
    Refactor reasons list to enum

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:32 -05: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
Louis-Francis Ratté-Boulianne c2f2b25ab5 present: Check the whole exec queue on event
Later events are sometimes added in front of the queue (e.g.
if page flipping fails) so we need to check the whole queue
on event.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-10-04 15:22:04 -04:00
Eric Anholt e0f872207a sync: Convert from "CARD64" to int64_t.
The extension was using the name CARD64 to represent 64-bit values,
with a #define from CARD64 to XSyncValue, a struct with a pair of
32-bit values representing a signed 64-bit value.  This interfered
with protocol headers using CARD64 to try to actually store a
uint64_t.  Now that stdint.h exists, let's just use that here,
instead.

v2: Fix alarm delta changes.
v3: Do the potentially overflowing math as uint and convert to int
    afterward, out of C spec paranoia.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-09-20 13:19:27 -04:00
Eric Anholt 1549e30372 Add a Meson build system alongside autotools.
This is a work in progress that builds Xvfb, Xephyr, Xwayland, Xnest,
and Xdmx so far.  The outline of Xquartz/Xwin support is in tree, but
hasn't been built yet.  The unit tests are also not done.

The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools.  meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.

v2: Fix indentation nits, move version declaration to project(), use
    existing meson_options for version-config.h's vendor name/web.

Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-26 15:25:27 -07:00
Adam Jackson dc7ceda90f dispatch: Mark swapped dispatch as _X_COLD
This touches everything that ends up in the Xorg binary; the big missing
part is GLX since that's all generated code. Cuts about 14k from the
binary on amd64.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-01 10:16:20 -05:00
Michel Dänzer 542d9f6807 present: Allow flipping with PRIME slave outputs
Works fine now.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-02-08 12:08:56 -05:00
Qiang Yu bb9128fdc8 present: disable page flip only when a slave crtc is active
This prevents the tearing of moving window in a composite WM
desktop when output slave is attached but none of its crtc is
really active.

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-02-01 17:29:34 +09:00
Michel Dänzer e473b2bc01 present: Only call present_flip_notify if vblank->queued == FALSE
We are no longer using the present_flip_queue list only for presents
which have already been submitted to the driver for page flipping, but
also for those which we are queueing up to be flipped later, marked
with vblank->queued == TRUE. We were incorrectly calling
present_flip_notify for such entries, failing the assertion in
present_flip_notify (or presumably resulting in other undesirable
behaviour with assertions disabled).

Reproduction recipe: Run the JavaFX test case referenced by
https://bugs.freedesktop.org/show_bug.cgi?id=98831#c6 and alt-tab out
of it while it's fullscreen. May take a few attempts to hit the
assertion failure.

Fixes: bab0f450a7 ("present: Fix presentation of flips out of order")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98854
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-10 12:38:50 +09:00
Olivier Fourdan de5291c04b present: Free the fake_present OsTimerPtr
Plug a leak in present_fake_queue_vblank() where the OsTimer would not
be freed.

 492,608 (482,816 direct, 9,792 indirect) bytes in 15,088 blocks
are definitely lost in loss record 3,954 of 3,954
    at 0x4C2ABDE: malloc (in vgpreload_memcheck-amd64-linux.so)
    by 0x586B19: TimerSet (WaitFor.c:433)
    by 0x4F1AA9: present_fake_queue_vblank (present_fake.c:108)
    by 0x4F15E0: present_pixmap (present.c:954)
    by 0x4F23B4: proc_present_pixmap (present_request.c:138)
    by 0x552BCE: Dispatch (dispatch.c:430)
    by 0x556C22: dix_main (main.c:300)
    by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97065
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-08-15 15:16:48 -04:00
Michel Dänzer d21b53673b present: Call set_abort_flip / restore_screen_pixmap in clear_window_flip
We were asserting that these were called before from other places, but
that isn't always the case, e.g. during server shutdown.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96951
Reported-and-Tested-by: Tod Jackson <tod.jackson@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2016-08-15 15:14:53 -04:00
Michel Dänzer 9f04fa3bab present: Make present_restore_screen_pixmap handle screen->root == NULL
Easier than dealing with it in all paths that can end up here during
server shutdown.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-15 15:14:43 -04: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
Michel Dänzer 0924ac014d present: Only call restore_screen_pixmap once from set_abort_flip
present_restore_screen_pixmap's work doesn't need to be done several
times for the same pending flip.

Fixes a crash if the X server quits while a flip is pending, in which
case present_set_abort_flip may be called several times, including when
screen->root is already cleared to NULL.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-28 10:12:44 +09:00
Hans de Goede 5c7af02b10 xrandrprovider: Do not use separate lists for unbound / source / offload slaves
A single provider can be both a offload and source slave at the same time,
the use of seperate lists breaks in this case e.g. :

xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting

xrandr --setprovideroutputsource 1 0x7b
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting

xrandr --setprovideroffloadsink 1 0x7b
xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting

Not good. The problem is that the provider with id 0x46 now is on both
the output_slave_list and the offload_slave_list of the master screen.

This commit fixes this by unifying all 3 lists into a single slaves list.

Note that this does change the struct _Screen definition, so this is an ABI
break. I do not expect any of the drivers to actually use the removed / changed
fields so a recompile should suffice.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-06-17 11:35:58 +02:00
Chris Wilson bab0f450a7 present: Fix presentation of flips out of order
The flip queue currently only holds events submitted to the driver for
flipping, awaiting the completion notifier. It is short. We therefore
can speed up interrupt processing by keeping the small number of events
ready to be flipped on the end of the flip queue. By appending the
events to the flip_queue in the order that they become ready, we also
resolve one issue causing Present to display frames out of order.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-06-17 11:21:30 +02:00
Chris Wilson fbe660b765 present: Improve scaling of vblank handler
With large numbers of queued vblank, the list iteration on every
interupt dominates processing time. If we reorder the list to be in
ascending event order, then not only is also likely to be in order for
notification queries (i.e. the notification will be near the start of
the list), we can also stop iterating when past the target event_id.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-06-17 11:21:30 +02:00
Michel Dänzer 3b385105b2 present: Only requeue for next MSC after flip failure
This code was added to deal with the driver present hook failing, in
which case we need to wait for the next MSC before executing the
presentation.

However, it could also take effect in cases where the driver incorrectly
thinks the current MSC matches the target one (e.g. due to the kernel
interface only supporting 32-bit MSC values), in which case it could
result in the presentation getting requeued over and over.

To prevent such issues, check specifically for the target MSC
immediately following the current MSC.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94596
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-03-24 15:47:33 -04:00
Dave Airlie 47bc7fcaa5 present: fail flipping if we have any slave outputs
Due to the way present currently works, we don't ever check with the
secondary adapters if we can flip at all.

We shouldn't flip if the secondary adapters are attached to the pixmap
currently, however using the current check_flip callback isn't possible
as it passes the Window to the driver (something we shouldn't be doing),
so the slave driver can never get it's own screen ptr back.

For now to fix the problem just block flips if we have any slaves
configured. We can fix the ABI up later, but this fix can be backported
to stable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-03-11 11:38:37 -05:00
Michel Dänzer 1bee4e254c present: Call present_restore_screen_pixmap from present_set_abort_flip
After present_set_abort_flip, the screen pixmap will be used for all
screen drawing, so we need to restore the current flip pixmap contents
to the screen pixmap here as well.

Improves flashing / stutter e.g. when something like a popup menu appears
on top of a flipping fullscreen window or when switching out of
fullscreen.

Note that this means present_set_abort_flip now relies on screen->root
being non-NULL, but that's already the case in other present code.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01 11:59:51 +09:00
Michel Dänzer 4611e902c2 present: Factor code for restoring screen pixmap out of present_unflip (v2)
The following fix will use the refactored function.

The logic in the refactored function is slightly simplified, exploiting
the fact that this function is only ever called with a valid flip
pixmap.

v2: Assert that flip_pixmap is non-NULL instead of testing and bailing
    on NULL, preserve test for flip_window being non-NULL before calling
    present_set_tree_pixmap for it (Keith Packard)

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-03-01 11:59:51 +09:00
Michel Dänzer 72328e5eb9 present: Only update screen pixmap from flip pixmap once per unflip
present_unflip may be called several times from present_check_flip_window
during the same unflip. We can only copy to the screen pixmap the first
time, otherwise we may scribble over other windows. The flip pixmap
contents don't get updated after the first time anyway.

Fixes at least the following problems, which were introduced by commit
806470b9 ("present: Copy unflip contents back to the Screen Pixmap"):

On xfwm4 without compositing, run glxgears and put its window into
fullscreen mode to start flipping. While in fullscreen, open the xfwm4
window menu by pressing Alt-Space. The window menu was invisible most
of the time because it was getting scribbled over by a repeated unflip
copy.

When switching a flipping window out of fullscreen, a repeated unflip
copy could leave artifacts of the flip pixmap on the desktop.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94325

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01 11:59:51 +09:00
Michel Dänzer b4ac7b142f present: Only requeue if target MSC is not reached after an unflip
While present_pixmap decrements target_msc by 1 for present_queue_vblank,
it leaves the original vblank->target_msc intact. So incrementing the
latter for requeueing resulted in the requeued presentation being
executed too late.

Also, no need to requeue if the target MSC is already reached.

This further reduces stutter when a popup menu appears on top of a
flipping fullscreen window.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2016-02-25 10:18:04 -05:00
Michel Dänzer e7a35b9e16 present: Requeue if flip driver hook fails and target MSC not reached
For flipping, we wait for the MSC before the target MSC and then call
the driver flip hook. If the latter fails, we have to wait for the
target MSC before falling back to a copy, or else it's executed too
early.

Fixes glxgears running at unbounded framerate (not synchronized to the
refresh rate) in fullscreen if the driver flip hook fails.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2016-02-25 10:18:00 -05:00
Michel Dänzer 1a9f8c4623 present: Move msc_is_(equal_or_)after to the top of present.c
To make them usable from any other function in the file. No functional
change.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2016-02-25 10:17:47 -05:00
Michel Dänzer 25eca80265 present: Handle wraparound when comparing MSC values
When a window moves from one CRTC to another, present_window_to_crtc_msc
updates window_priv->msc_offset according to the delta between the
current MSC values of the old and new CRTC:

            window_priv->msc_offset += new_msc - old_msc;

window_priv->msc_offset is initially 0, so if new_msc < old_msc,
window_priv->msc_offset wraps around and becomes a large number. If the
window_msc parameter passed in is small (in particular if it's 0, such as
is the case when the client just wants to know the current window MSC
value), the returned CRTC MSC value may still be a large number. In that
case, the existing MSC comparisons in pixmap_present weren't working as
intended, resulting in scheduling a wait far into the future when the
target MSC had actually already passed. This would result in the client
(e.g. the Chromium browser) hanging when moving its window between CRTCs.

In order to fix this, introduce msc_is_(equal_or_)after helper functions
which take the wraparound into account for comparing two MSC values.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2016-01-19 18:03:26 -08:00
Chris Wilson 72f0724cdc present: Do not replace Pixmaps on redirected Window on unflip
When unflipping, we may find that our flip window has been redirected.
If we replace the redirected Window with the Screen Pixmap we then have
mutliple fullscreen Windows believing that their own the Screen Pixmap -
multiple fullscreen Windows that are being flipped by Clients, and so
continue to flip causing popping between e.g. the compositor and the
game.

[ajax: Fix up present_execute() hunk to account for changes introduced
in fe07ec19e2]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-12-07 14:37:13 -05:00
Chris Wilson 180b09912c present: When cancelling a pending synchronous flip, requeue it
The vblank event request for a synchronous flip is scheduled for the
vblank before the target flip msc (so that the flip itself appears at
the right frame). If we cancel that flip and so wish to schedule a
copy instead, that copy needs to be postponed by a frame in order for it
be performed at the requested time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-12-07 14:25:43 -05:00
Chris Wilson b2d55338f6 present: Requery pending flips with the right sync_flip mode
When verifying whether a pending flip is still valid, we need to pass
down the orignal sync_flip mode (e.g. if the driver only supports sync
flips, verifying a async flip will falsely fail).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-12-07 14:25:42 -05:00
Axel Davy 2203735887 present: Fix Async swap logic
According to the spec, PresentOptionAsync should only
trigger a different behaviour when the target msc has been reached.

In this case if the driver is able to do async swaps, we use
them to avoid a screen copy.

When the target msc hasn't been reached yet, we want to use sync swaps.

v2: Fix indentation and simplify checks for Async flips

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-11-09 15:47:01 -05:00
Jammy Zhou 3f35909acb present: Execute right away if target_msc equals current_msc
It is according to the protocol:

"If 'options' contains PresentOptionAsync, and the 'target-msc'
is less than or equal to the current msc for 'window', then
the operation will be performed as soon as possible, not
necessarily waiting for the next vertical blank interval."

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
2015-11-09 15:46:48 -05:00
Chris Wilson 413cb2ff1d present: Fix missed notify MSC computation
Only treat divisor==0 as async to immediately report the actual vblank.
If the user species a non-zero divisor, we should compute the missed
vblank properly or else we report too early.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2015-10-21 15:13:41 -04:00
Fredrik Höglund f6ce23fbfc present: Don't stash the MSC value when present_get_ust_msc fails
Otherwise we stash an uninitalized value, and later use it to compute
the msc_offset for the window.  Also initialize ust and crtc_msc so we
never use uninitalized values when present_get_ust_msc fails.

This fixes clients getting stuck waiting indefinitely for an idle
event when a CRTC is turned off.

Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-09-30 16:06:26 -04: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
Chris Wilson 806470b9f6 present: Copy unflip contents back to the Screen Pixmap
As we unflip after the flip Window no longer passes the pixel ownership
test for the full Screen Pixmap, we can no longer utilize that Window to
copy the contents back to the backing pixmap. To first flip means that
the Window was originally backed by the Screen Pixmap and wholly covered
the Pixmap, thus we need to copy the last frame contents to the Screen
Pixmap when the flip chain is complete.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2015-05-26 15:09:32 -07:00
Kenneth Graunke b51f804b1c present: If present_queue_vblank() fails, do present_execute().
Previously, if present_queue_vblank() failed, we simply dropped the
present request on the floor, and returned an error.  This was rather
mean to clients - after presenting, they wait for a PresentComplete
event to come back.  But since the present never happens, they end up
waiting forever, and lock up in poll().

This patch falls back to present_execute if present_queue_vblank fails.
We still print a debugging message to warn when queueing fails, which
allows us to continue debugging problems, but makes Present robust
enough to not lock up people's compositing manager when vblank bugs
happen.

v2: Don't do present_queue_vblank() /and/ present_execute() (a bug that
    snuck in during last minute tidying).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-12-25 13:39:04 -08:00
Alan Coopersmith d155b7a8e3 present: unvalidated lengths in Present extension procs [CVE-2014-8103 2/2]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2014-12-08 18:09:48 -08:00
Mario Kleiner aae6460694 present: Fix use of vsynced pageflips and honor PresentOptionAsync. (v4)
Pageflips for Pixmap presents were not synchronized to vblank on
drivers with support for PresentCapabilityAsync, due to some
missing init for vblank->sync_flips. The PresentOptionAsync
flag was completely ignored for pageflipped presents.

Vsynced flips only worked by accident on the intel-ddx, as that
driver doesn't have PresentCapabilityAsync support.

On nouveau-ddx, which supports PresentCapabilityAsync, this
always caused non-vsynced pageflips with pretty ugly tearing.

This patch fixes the problem, as tested on top of XOrg 1.16.2
on nouveau and intel.

v4: Add additional PresentCapabilityAsync caps check, as
suggested by Eric Anholt.

Please also apply to XOrg 1.17 and XOrg 1.16.2 stable.

Applying on top of XOrg 1.16.2 requires cherry-picking
commit 2051514652
which trivially fixes lack of support for protocol option
PresentOptionCopy - get two bug fixes for the price of one!

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-12-08 16:38:17 -08:00
Mario Kleiner 32d3100bd7 present: Avoid crashes in DebugPresent(), a bit more info.
DebugPresent() crashed the server when a dri3 drawable
was closed while a pageflipped present was still pending,
due to vblank->window-> Null-Ptr deref, so debug builds
caused new problems to debug.

E.g.,

glXSwapBuffers(...);
glXDestroyWindow(...);
-> Pageflip for non-existent window completes -> boom.

Also often happens when switching desktop compositor on/off
due to Present unflips, or when logging out of session.

Also add info if a Present is queued for copyswap or pageflip,
if the present is vsynced, and the serial no of the Present
request, to aid debugging of pageflip and vsync issues. The
serial number is useful as Mesa's dri3/present backend encodes
its sendSBC in the serial number, so one can easily correlate
server debug output with Mesa and with the SBC values returned
to actual OpenGL client applications via OML_sync_control and
INTEL_swap_events extension, makes debugging quite a bit more
easy.

Please also cherry-pick this for a 1.16.x stable update.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-12-08 16:38:15 -08:00
Keith Packard ec0ac8970b Merge remote-tracking branch 'whot/for-keith' 2014-11-24 15:39:51 -08:00
Peter Hutterer 732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

happy reviewing...
git diff -w is an empty diff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Axel Davy 882f2d10d9 Fix present_notify to return right away when querying current or past msc.
When the target msc is past or is the current one, we want to get immediate
feedback. This patch fixes this behaviour.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-30 14:37:15 -07:00
Axel Davy 9bc01dfc70 Fix present_pixmap when using present_notify_msc
Calling present_notify_msc could cancel a pending pixmap presentation.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-02 10:22:46 -07:00
Keith Packard ea7357de90 present: Clear pending flip pixmaps at CloseScreen
If a flip is active at server reset time, the associated window will
get destroyed which will queue an unflip operation. If that isn't
synchronous, then it won't have finished by the time CloseScreen is
called.

Calling present_flip_idle will signal the fence and remove the
reference to the fence and pixmap, freeing these in the X server and
allowing a DRM client to clean up as well.

This also rewords other comments in present_flip_destroy, removing
scary words about needing synchronous operation (everything in this
function is synchronous now) and describing what effect we actually
need from present_set_abort_flip.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-09-18 15:32:56 -07:00
Keith Packard 2051514652 present: Support PresentOptionCopy
We added this option to the present protocol before 1.0 but somehow
never implemented it in the server. It's pretty simple; just don't
ever do flips if the application specifies Copy.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-09-18 15:31:37 -07: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 40dc81154a present: Avoid crash at server shutdown
When a present flip operation is still in process during server reset,
the call to present_set_abort_flip may not happen until the screen is
being closed, at which point there is no root window to set pixmaps
for. Check to make sure there's a window before resetting window pixmaps.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-07-31 00:03:55 -07:00
Keith Packard 627bce8089 present: Make window MSC offset 0 initially
The MSC offset used by a window is adjusted as the window moves
between screens, and between shown/unshown. The value shouldn't
matter, but it's helpful for debugging to have window MSC values be
the same as the CRTC MSC at first.

This patch introduces a unique CRTC value so that Present can detect
the first time a window is a PresentPixmap destination and set the MSC
offset to zero, rather than using the fake MSC value as the previous
window MSC.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-07-31 00:03:53 -07:00
Axel Davy ce581ac3fa present: fix bad logic in cancelling scheduled operations.
If we present several pixmaps in advance for different msc, the later one
shouldn't cancel the previous ones.

This reverts a change made by commit
e6f5d9d7b7

Without this fix, vblank_mode=0 glxgears doesn't update
with the present fallback.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-23 14:15:48 -07:00
Frank Binns 334faabe68 present: restore screen pixmap when aborting a flip
If a 2D application is started on top of a fullscreen 3D application, which
is flipping, then we need to stop flipping and restore the root window, and
possibly the flip window, to using the screen pixmap. Normally this would
be done as part of an unflip. However, in the case that there is a pending
flip there is no mechanism to abort so the unflip is deferred until the
pending flip completes. This provides a window of opportunity for the 2D
application to draw to the wrong pixmap.

Restore the screen pixmap at the point a pending flip is marked as aborted,
thus avoiding this issue.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-23 13:48:20 -07:00
Keith Packard 382ff4a306 present: Remove executing vblank from window list. Bug# 79709.
Once the vblank is actually getting executed, it's lifetime is no
longer tied to the window, and so it shouldn't be controlled by window
destruction. In particular, if the vblank is queued for flip, it will
get stored in the flip_pending field, and will be correctly destroyed
when the flip completes.

Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-17 15:53:41 -07:00
Keith Packard e6f5d9d7b7 present: Queue flips for later execution
When a flip (or unflip) is pending and a flip request comes in, leave
it queued until the pending flip completes and then execute it.

This fixes a bug where an application submitting back-to-back
present_pixmap requests for sequential frames would alternate between
flipping and copying as the pending flip would cause the new
present_pixmap request to not use a flip.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Frank Binns <frank.binns@imgtec.com>
2014-06-04 22:03:35 -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 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