summaryrefslogtreecommitdiff
path: root/present/present.h
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2018-02-28 01:19:36 +0000
committerAdam Jackson <ajax@redhat.com>2018-03-05 13:27:32 -0500
commite2ef3b44fa697f2ed453767e98da72ea56d4046f (patch)
tree81c12224fc3def129f3aa708a5d1fa76ac3ab820 /present/present.h
parent6e7c40f62db66f5b59b2cf59f1e6a26e4fd21bda (diff)
downloadxserver-e2ef3b44fa697f2ed453767e98da72ea56d4046f.tar.gz
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>
Diffstat (limited to 'present/present.h')
-rw-r--r--present/present.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/present/present.h b/present/present.h
index aab2e168a..6542dc385 100644
--- a/present/present.h
+++ b/present/present.h
@@ -27,6 +27,11 @@
#include "randrstr.h"
#include "presentext.h"
+typedef enum {
+ PRESENT_FLIP_REASON_UNKNOWN,
+ PRESENT_FLIP_REASON_BUFFER_FORMAT
+} PresentFlipReason;
+
typedef struct present_vblank present_vblank_rec, *present_vblank_ptr;
/* Return the current CRTC for 'window'.
@@ -59,6 +64,10 @@ typedef void (*present_flush_ptr) (WindowPtr window);
*/
typedef Bool (*present_check_flip_ptr) (RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, Bool sync_flip);
+/* Same as 'check_flip' but it can return a 'reason' why the flip would fail.
+ */
+typedef Bool (*present_check_flip2_ptr) (RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, Bool sync_flip, PresentFlipReason *reason);
+
/* Flip pixmap, return false if it didn't happen.
*
* 'crtc' is to be used for any necessary synchronization.
@@ -83,7 +92,7 @@ typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc,
typedef void (*present_unflip_ptr) (ScreenPtr screen,
uint64_t event_id);
-#define PRESENT_SCREEN_INFO_VERSION 0
+#define PRESENT_SCREEN_INFO_VERSION 1
typedef struct present_screen_info {
uint32_t version;
@@ -97,6 +106,7 @@ typedef struct present_screen_info {
present_check_flip_ptr check_flip;
present_flip_ptr flip;
present_unflip_ptr unflip;
+ present_check_flip2_ptr check_flip2;
} present_screen_info_rec, *present_screen_info_ptr;