public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-base/xorg-server/files/, x11-base/xorg-server/
Date: Thu,  2 Dec 2021 02:37:05 +0000 (UTC)	[thread overview]
Message-ID: <1638412594.858311492b0112ad227968ba6813cffc1fe85f75.sam@gentoo> (raw)

commit:     858311492b0112ad227968ba6813cffc1fe85f75
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  2 02:36:34 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec  2 02:36:34 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85831149

x11-base/xorg-server: apply DPI revert patch to 21.1.1

Upstream changed their mind post-release given the widespread breakage.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/xorg-server-21.1.1-DPI-revert.patch      | 133 +++++++++++++++++++++
 ...-21.1.1.ebuild => xorg-server-21.1.1-r1.ebuild} |   1 +
 2 files changed, 134 insertions(+)

diff --git a/x11-base/xorg-server/files/xorg-server-21.1.1-DPI-revert.patch b/x11-base/xorg-server/files/xorg-server-21.1.1-DPI-revert.patch
new file mode 100644
index 000000000000..89d8e2653a28
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-21.1.1-DPI-revert.patch
@@ -0,0 +1,133 @@
+https://gitlab.freedesktop.org/xorg/xserver/-/commit/35af1299e73483eaf93d913a960e1d1738bc7de6
+
+From: Povilas Kanapickas <povilas@radix.lt>
+Date: Sat, 13 Nov 2021 17:23:54 +0200
+Subject: [PATCH] Revert "hw/xfree86: Propagate physical dimensions from DRM
+ connector"
+
+Quite a lot of applications currently expect the screen DPI exposed by
+the X server to be 96 even when the real display DPI is different.
+Additionally, currently Xwayland completely ignores any hardware
+information and sets the DPI to 96. Accordingly the new behavior, even
+if it fixes a bug, should not be enabled automatically to all users.
+
+A better solution would be to make the default DPI stay as is and enable
+the correct behavior with a command line option (maybe -dpi auto, or
+similar). For now let's just revert the bug fix.
+
+This reverts commit 05b3c681ea2f478c0cb941c2f8279919cf78de6d.
+
+Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
+--- a/hw/xfree86/common/xf86Helper.c
++++ b/hw/xfree86/common/xf86Helper.c
+@@ -55,7 +55,6 @@
+ #include "xf86Xinput.h"
+ #include "xf86InPriv.h"
+ #include "mivalidate.h"
+-#include "xf86Crtc.h"
+ 
+ /* For xf86GetClocks */
+ #if defined(CSRG_BASED) || defined(__GNU__)
+@@ -852,9 +851,8 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
+ {
+     MessageType from = X_DEFAULT;
+     xf86MonPtr DDC = (xf86MonPtr) (pScrn->monitor->DDC);
+-    int probedWidthmm, probedHeightmm;
++    int ddcWidthmm, ddcHeightmm;
+     int widthErr, heightErr;
+-    xf86OutputPtr compat = xf86CompatOutput(pScrn);
+ 
+     /* XXX Maybe there is no need for widthmm/heightmm in ScrnInfoRec */
+     pScrn->widthmm = pScrn->monitor->widthmm;
+@@ -864,15 +862,11 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
+         /* DDC gives display size in mm for individual modes,
+          * but cm for monitor
+          */
+-        probedWidthmm = DDC->features.hsize * 10;  /* 10mm in 1cm */
+-        probedHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */
+-    }
+-    else if (compat && compat->mm_width > 0 && compat->mm_height > 0) {
+-        probedWidthmm = compat->mm_width;
+-        probedHeightmm = compat->mm_height;
++        ddcWidthmm = DDC->features.hsize * 10;  /* 10mm in 1cm */
++        ddcHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */
+     }
+     else {
+-        probedWidthmm = probedHeightmm = 0;
++        ddcWidthmm = ddcHeightmm = 0;
+     }
+ 
+     if (monitorResolution > 0) {
+@@ -898,15 +892,15 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
+                    pScrn->widthmm, pScrn->heightmm);
+ 
+         /* Warn if config and probe disagree about display size */
+-        if (probedWidthmm && probedHeightmm) {
++        if (ddcWidthmm && ddcHeightmm) {
+             if (pScrn->widthmm > 0) {
+-                widthErr = abs(probedWidthmm - pScrn->widthmm);
++                widthErr = abs(ddcWidthmm - pScrn->widthmm);
+             }
+             else {
+                 widthErr = 0;
+             }
+             if (pScrn->heightmm > 0) {
+-                heightErr = abs(probedHeightmm - pScrn->heightmm);
++                heightErr = abs(ddcHeightmm - pScrn->heightmm);
+             }
+             else {
+                 heightErr = 0;
+@@ -915,17 +909,17 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
+                 /* Should include config file name for monitor here */
+                 xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+                            "Probed monitor is %dx%d mm, using Displaysize %dx%d mm\n",
+-                           probedWidthmm, probedHeightmm, pScrn->widthmm,
++                           ddcWidthmm, ddcHeightmm, pScrn->widthmm,
+                            pScrn->heightmm);
+             }
+         }
+     }
+-    else if (probedWidthmm && probedHeightmm) {
++    else if (ddcWidthmm && ddcHeightmm) {
+         from = X_PROBED;
+         xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n",
+-                   probedWidthmm, probedHeightmm);
+-        pScrn->widthmm = probedWidthmm;
+-        pScrn->heightmm = probedHeightmm;
++                   ddcWidthmm, ddcHeightmm);
++        pScrn->widthmm = ddcWidthmm;
++        pScrn->heightmm = ddcHeightmm;
+         if (pScrn->widthmm > 0) {
+             pScrn->xDpi =
+                 (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+--- a/hw/xfree86/modes/xf86Crtc.c
++++ b/hw/xfree86/modes/xf86Crtc.c
+@@ -3256,10 +3256,8 @@ xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon)
+     free(output->MonInfo);
+ 
+     output->MonInfo = edid_mon;
+-    if (edid_mon) {
+-        output->mm_width = 0;
+-        output->mm_height = 0;
+-    }
++    output->mm_width = 0;
++    output->mm_height = 0;
+ 
+     if (debug_modes) {
+         xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n",
+--- a/hw/xfree86/modes/xf86RandR12.c
++++ b/hw/xfree86/modes/xf86RandR12.c
+@@ -806,12 +806,6 @@ xf86RandR12CreateScreenResources(ScreenPtr pScreen)
+                 mmWidth = output->conf_monitor->mon_width;
+                 mmHeight = output->conf_monitor->mon_height;
+             }
+-            else if (output &&
+-                (output->mm_width > 0 &&
+-                 output->mm_height > 0)) {
+-                mmWidth = output->mm_width;
+-                mmHeight = output->mm_height;
+-            }
+             else {
+                 /*
+                  * Otherwise, just set the screen to DEFAULT_DPI
+GitLab

diff --git a/x11-base/xorg-server/xorg-server-21.1.1.ebuild b/x11-base/xorg-server/xorg-server-21.1.1-r1.ebuild
similarity index 99%
rename from x11-base/xorg-server/xorg-server-21.1.1.ebuild
rename to x11-base/xorg-server/xorg-server-21.1.1-r1.ebuild
index feb237caedaf..0990ccd85bcd 100644
--- a/x11-base/xorg-server/xorg-server-21.1.1.ebuild
+++ b/x11-base/xorg-server/xorg-server-21.1.1-r1.ebuild
@@ -92,6 +92,7 @@ REQUIRED_USE="!minimal? (
 	?? ( elogind systemd )"
 
 UPSTREAMED_PATCHES=(
+	"${FILESDIR}"/${P}-DPI-revert.patch
 )
 
 PATCHES=(


             reply	other threads:[~2021-12-02  2:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  2:37 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-06  1:22 [gentoo-commits] repo/gentoo:master commit in: x11-base/xorg-server/files/, x11-base/xorg-server/ Matt Turner
2023-12-14  4:12 Sam James
2023-11-25 17:31 Matt Turner
2023-10-25 15:41 Matt Turner
2023-07-09  8:13 Sam James
2020-03-19 21:50 Matt Turner
2020-01-26 21:10 Matt Turner
2019-02-28  5:47 Matt Turner
2018-05-05 19:04 Nick Sarnie
2018-03-06 20:25 Matt Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1638412594.858311492b0112ad227968ba6813cffc1fe85f75.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox