Blame SOURCES/0001-modesetting-Hide-atomic-behind-Option-Atomic-boolean.patch

5766b0
From a22a81a0de76b96b01f32f59fd2a4b4af675d9b1 Mon Sep 17 00:00:00 2001
5766b0
From: Adam Jackson <ajax@redhat.com>
5766b0
Date: Fri, 5 Oct 2018 15:12:18 -0400
5766b0
Subject: [PATCH] modesetting: Hide atomic behind Option "Atomic" "[boolean]"
5766b0
5766b0
You can turn it on if the kernel driver supports it and you ask for it
5766b0
explicitly, but right now it's too fragile.
5766b0
5766b0
Signed-off-by: Adam Jackson <ajax@redhat.com>
5766b0
---
5766b0
 hw/xfree86/drivers/modesetting/driver.c | 5 ++++-
5766b0
 hw/xfree86/drivers/modesetting/driver.h | 1 +
5766b0
 2 files changed, 5 insertions(+), 1 deletion(-)
5766b0
5766b0
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
5766b0
index 24311c1..4fc62e4 100644
5766b0
--- a/hw/xfree86/drivers/modesetting/driver.c
5766b0
+++ b/hw/xfree86/drivers/modesetting/driver.c
5766b0
@@ -131,6 +131,7 @@ static const OptionInfoRec Options[] = {
5766b0
     {OPTION_PAGEFLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE},
5766b0
     {OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE},
5766b0
     {OPTION_DOUBLE_SHADOW, "DoubleShadow", OPTV_BOOLEAN, {0}, FALSE},
5766b0
+    {OPTION_ATOMIC, "Atomic", OPTV_BOOLEAN, {0}, FALSE},
5766b0
     {-1, NULL, OPTV_NONE, {0}, FALSE}
5766b0
 };
5766b0
 
5766b0
@@ -1061,7 +1062,9 @@ PreInit(ScrnInfoPtr pScrn, int flags)
5766b0
     }
5766b0
 
5766b0
     ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1);
5766b0
-    ms->atomic_modeset = (ret == 0);
5766b0
+    if ((ms->atomic_modeset = (ret == 0)))
5766b0
+        ms->atomic_modeset = xf86ReturnOptValBool(ms->drmmode.Options,
5766b0
+                                                  OPTION_ATOMIC, FALSE);
5766b0
 
5766b0
     ms->kms_has_modifiers = FALSE;
5766b0
     ret = drmGetCap(ms->fd, DRM_CAP_ADDFB2_MODIFIERS, &value);
5766b0
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
5766b0
index c8db4b8..46ba78a 100644
5766b0
--- a/hw/xfree86/drivers/modesetting/driver.h
5766b0
+++ b/hw/xfree86/drivers/modesetting/driver.h
5766b0
@@ -51,6 +51,7 @@ typedef enum {
5766b0
     OPTION_PAGEFLIP,
5766b0
     OPTION_ZAPHOD_HEADS,
5766b0
     OPTION_DOUBLE_SHADOW,
5766b0
+    OPTION_ATOMIC,
5766b0
 } modesettingOpts;
5766b0
 
5766b0
 typedef struct
5766b0
-- 
5766b0
2.19.0
5766b0