From e98e83c8de265a407d0a5a6c51f8cc3188512b89 Mon Sep 17 00:00:00 2001 From: Olivier Certner 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 to which actual card output the monitor is connected to (in a 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). 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' and 'xf86-video-vesa'. Signed-off-by: Olivier Certner --- 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 ac88d7e7a..448abad50 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 c6e89e66f..5843afdd7 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