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

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