[PATCH] xfree86/modes: Use per-screen monitor for all outputs

Olivier Certner ocert.dev at free.fr
Thu Apr 2 13:05:46 UTC 2020


>From 05d49ec096cd89209c454c48ff2bc34158d5ed33 Mon Sep 17 00:00:00 2001
From: Olivier Certner <ocert.dev at free.fr>
Date: Fri, 20 Mar 2020 18:58:11 +0100
Subject: [PATCH] xfree86/modes: Use per-screen monitor for all outputs

Instead of just the first one.

This allows to specify a monitor section for the screen without
bothering with which actual card output is connected to the
monitor (single-monitor setup).

Had the idea of this change after noticing that an actual Monitor
section with DisplaySize was not taken, because indeed the monitor was
not connected to the first output.

Rationale:
1. Desktop/server graphic cards commonly have several outputs, even
for a single output type (DP, HDMI, etc.). This would ease configuring
for single-monitor cases. Multi-monitor setups require per-output
monitor sections anyway (or see 2.).
2. The change preserves compatibility with single-output setups and
autoconfiguration.
3. Seems a priori that applying the per-screen monitor to the first
output is rather arbitrary (to be checked by someone more
experienced).

If merged in, at least 'xf86-video-intel' may need to be updated
accordingly (see 'src/sna/sna_display.c', function 'sna_output_add',
call to 'xf86OutputUseScreenMonitor'). Didn't check drivers besides
'xf86-video-intel', 'xf86-video-amdgpu', 'xf86-video-nouveau',
'xf86-video-nv', 'xf86-video-vesa'.

Signed-off-by: Olivier Certner <ocert.dev at free.fr>
---
 hw/xfree86/man/xorg.conf.man | 2 +-
 hw/xfree86/modes/xf86Crtc.c  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index dac9fa53f..8d5ea49a2 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -1583,7 +1583,7 @@ following format:
 for a VGA output)
 .PP
 In the absence of specific association of monitor sections to outputs, if a
-monitor section is present the server will associate it with an output to
+monitor section is present the server will associate it with all outputs to
 preserve compatibility for previous single-head configurations.
 .PP
 Specifying video modes is optional because the server will use the DDC or other
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 21daf9a01..f99ac39f5 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -651,9 +651,10 @@ xf86OutputCreate(ScrnInfoPtr scrn,
     }
     output->subpixel_order = SubPixelUnknown;
     /*
-     * Use the old per-screen monitor section for the first output
+     * Use the old per-screen monitor section for all outputs that are
+     * not explicitly associated to a given monitor.
      */
-    output->use_screen_monitor = (xf86_config->num_output == 0);
+    output->use_screen_monitor = 1;
 #ifdef RANDR_12_INTERFACE
     output->randr_output = NULL;
 #endif
-- 
2.24.1

Olivier Certner




More information about the xorg-devel mailing list