Blame SOURCES/0001-xf86-set-status-to-connected-for-monitors-enabled-in.patch

5766b0
From 8ab80fd5057f3d954ac6dc310cc8773e9694a0b1 Mon Sep 17 00:00:00 2001
5766b0
From: Dave Airlie <airlied@redhat.com>
5766b0
Date: Fri, 29 Mar 2019 08:44:07 +1000
5766b0
Subject: [PATCH] xf86: set status to connected for monitors enabled in conf
5766b0
5766b0
If the user sets Option "Enable" "TRUE" for a monitor, the X
5766b0
server will connect the connector a crtc but tell the user it
5766b0
is disconnected.
5766b0
5766b0
However the user in this case is mutter, when it gets it's view
5766b0
of the output configuration it sees the output is disconnected
5766b0
and never sets it up again, which seems like the right thing to do.
5766b0
5766b0
If we let the user enable a monitor, lets just set it as always
5766b0
connected.
5766b0
5766b0
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
5766b0
Signed-off-by: Dave Airlie <airlied@redhat.com>
5766b0
---
5766b0
 hw/xfree86/modes/xf86Crtc.c    | 10 ++++++++++
5766b0
 hw/xfree86/modes/xf86Crtc.h    |  1 +
5766b0
 hw/xfree86/modes/xf86RandR12.c |  5 ++++-
5766b0
 3 files changed, 15 insertions(+), 1 deletion(-)
5766b0
5766b0
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
5766b0
index b3b84cc13..21daf9a01 100644
5766b0
--- a/hw/xfree86/modes/xf86Crtc.c
5766b0
+++ b/hw/xfree86/modes/xf86Crtc.c
5766b0
@@ -552,6 +552,16 @@ xf86OutputSetMonitor(xf86OutputPtr output)
5766b0
                    "Output %s has no monitor section\n", output->name);
5766b0
 }
5766b0
 
5766b0
+Bool
5766b0
+xf86OutputForceEnabled(xf86OutputPtr output)
5766b0
+{
5766b0
+    Bool enable;
5766b0
+
5766b0
+    if (xf86GetOptValBool(output->options, OPTION_ENABLE, &enable) && enable)
5766b0
+        return TRUE;
5766b0
+    return FALSE;
5766b0
+}
5766b0
+
5766b0
 static Bool
5766b0
 xf86OutputEnabled(xf86OutputPtr output, Bool strict)
5766b0
 {
5766b0
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
5766b0
index 427c6bff4..bf3e808bc 100644
5766b0
--- a/hw/xfree86/modes/xf86Crtc.h
5766b0
+++ b/hw/xfree86/modes/xf86Crtc.h
5766b0
@@ -1144,4 +1144,5 @@ xf86ProviderSetup(ScrnInfoPtr scrn,
5766b0
 extern _X_EXPORT void
5766b0
 xf86DetachAllCrtc(ScrnInfoPtr scrn);
5766b0
 
5766b0
+Bool xf86OutputForceEnabled(xf86OutputPtr output);
5766b0
 #endif                          /* _XF86CRTC_H_ */
5766b0
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
5766b0
index 0838dbf82..b476c07ce 100644
5766b0
--- a/hw/xfree86/modes/xf86RandR12.c
5766b0
+++ b/hw/xfree86/modes/xf86RandR12.c
5766b0
@@ -1647,7 +1647,10 @@ xf86RandR12SetInfo12(ScreenPtr pScreen)
5766b0
             RROutputSetConnection(output->randr_output, RR_Connected);
5766b0
             break;
5766b0
         case XF86OutputStatusDisconnected:
5766b0
-            RROutputSetConnection(output->randr_output, RR_Disconnected);
5766b0
+	    if (xf86OutputForceEnabled(output))
5766b0
+                RROutputSetConnection(output->randr_output, RR_Connected);
5766b0
+	    else
5766b0
+                RROutputSetConnection(output->randr_output, RR_Disconnected);
5766b0
             break;
5766b0
         case XF86OutputStatusUnknown:
5766b0
             RROutputSetConnection(output->randr_output, RR_UnknownConnection);
5766b0
-- 
5766b0
2.20.1
5766b0