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