From 858311492b0112ad227968ba6813cffc1fe85f75 Mon Sep 17 00:00:00 2001 From: Sam James Date: Thu, 2 Dec 2021 02:36:34 +0000 Subject: 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 --- .../files/xorg-server-21.1.1-DPI-revert.patch | 133 +++++++++++++++ x11-base/xorg-server/xorg-server-21.1.1-r1.ebuild | 180 +++++++++++++++++++++ x11-base/xorg-server/xorg-server-21.1.1.ebuild | 179 -------------------- 3 files changed, 313 insertions(+), 179 deletions(-) create mode 100644 x11-base/xorg-server/files/xorg-server-21.1.1-DPI-revert.patch create mode 100644 x11-base/xorg-server/xorg-server-21.1.1-r1.ebuild delete mode 100644 x11-base/xorg-server/xorg-server-21.1.1.ebuild (limited to 'x11-base') 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 +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 +--- 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-r1.ebuild b/x11-base/xorg-server/xorg-server-21.1.1-r1.ebuild new file mode 100644 index 000000000000..0990ccd85bcd --- /dev/null +++ b/x11-base/xorg-server/xorg-server-21.1.1-r1.ebuild @@ -0,0 +1,180 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +XORG_DOC=doc +XORG_TARBALL_SUFFIX="xz" +XORG_EAUTORECONF="no" +inherit xorg-3 meson +EGIT_REPO_URI="https://gitlab.freedesktop.org/xorg/xserver.git" + +DESCRIPTION="X.Org X servers" +SLOT="0/${PV}" +if [[ ${PV} != 9999* ]]; then + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" +fi + +IUSE_SERVERS="xephyr xnest xorg xvfb" +IUSE="${IUSE_SERVERS} debug +elogind minimal selinux suid systemd test +udev unwind xcsecurity" +RESTRICT="!test? ( test )" + +CDEPEND=" + media-libs/libglvnd[X] + dev-libs/openssl:0= + >=x11-apps/iceauth-1.0.2 + >=x11-apps/rgb-1.0.3 + >=x11-apps/xauth-1.0.3 + x11-apps/xkbcomp + >=x11-libs/libdrm-2.4.89 + >=x11-libs/libpciaccess-0.12.901 + >=x11-libs/libXau-1.0.4 + >=x11-libs/libXdmcp-1.0.2 + >=x11-libs/libXfont2-2.0.1 + >=x11-libs/libxcvt-0.1.0 + >=x11-libs/libxkbfile-1.0.4 + >=x11-libs/libxshmfence-1.1 + >=x11-libs/pixman-0.27.2 + >=x11-misc/xbitmaps-1.0.1 + >=x11-misc/xkeyboard-config-2.4.1-r3 + >=x11-libs/libXext-1.0.5 + x11-libs/libXv + xephyr? ( + x11-libs/libxcb[xkb] + x11-libs/xcb-util + x11-libs/xcb-util-image + x11-libs/xcb-util-keysyms + x11-libs/xcb-util-renderutil + x11-libs/xcb-util-wm + ) + !minimal? ( + >=x11-libs/libX11-1.1.5 + >=x11-libs/libXext-1.0.5 + >=media-libs/mesa-18[X(+),egl(+),gbm(+)] + >=media-libs/libepoxy-1.5.4[X,egl(+)] + ) + udev? ( virtual/libudev:= ) + unwind? ( sys-libs/libunwind ) + >=x11-apps/xinit-1.3.3-r1 + selinux? ( sys-libs/libselinux ) + systemd? ( + sys-apps/dbus + sys-apps/systemd + ) + elogind? ( + sys-apps/dbus + sys-auth/elogind[pam] + sys-auth/pambase[elogind] + ) + doc? ( + x11-base/xorg-sgml-doctools + ) + !!x11-drivers/nvidia-drivers[-libglvnd(+)] +" +DEPEND="${CDEPEND} + >=x11-base/xorg-proto-2021.4.99.2 + >=x11-libs/xtrans-1.3.5 +" +RDEPEND="${CDEPEND} + !systemd? ( gui-libs/display-manager-init ) + selinux? ( sec-policy/selinux-xserver ) +" +BDEPEND=" + sys-devel/flex +" +PDEPEND=" + xorg? ( >=x11-base/xorg-drivers-$(ver_cut 1-2) )" + +REQUIRED_USE="!minimal? ( + || ( ${IUSE_SERVERS} ) + ) + elogind? ( udev ) + ?? ( elogind systemd )" + +UPSTREAMED_PATCHES=( + "${FILESDIR}"/${P}-DPI-revert.patch +) + +PATCHES=( + "${UPSTREAMED_PATCHES[@]}" + "${FILESDIR}"/${PN}-1.12-unloadsubmodule.patch + # needed for new eselect-opengl, bug #541232 + "${FILESDIR}"/${PN}-1.18-support-multiple-Files-sections.patch +) + +src_configure() { + # localstatedir is used for the log location; we need to override the default + # from ebuild.sh + # sysconfdir is used for the xorg.conf location; same applies + # NOTE: fop is used for doc generating; and I have no idea if Gentoo + # package it somewhere + + local emesonargs=( + --localstatedir "${EPREFIX}/var" + --sysconfdir "${EPREFIX}/etc/X11" + --buildtype $(usex debug debug plain) + -Db_ndebug=$(usex debug false true) + $(meson_use doc docs) + $(meson_use !minimal dri1) + $(meson_use !minimal dri2) + $(meson_use !minimal dri3) + $(meson_use !minimal glamor) + $(meson_use !minimal glx) + $(meson_use udev) + $(meson_use udev udev_kms) + $(meson_use unwind libunwind) + $(meson_use xcsecurity) + $(meson_use xephyr) + $(meson_use xnest) + $(meson_use xorg) + $(meson_use xvfb) + -Ddefault_font_path="${EPREFIX}"/usr/share/fonts + -Ddrm=true + -Ddtrace=false + -Dipv6=true + -Dhal=false + -Dlinux_acpi=false + -Dlinux_apm=false + -Dsha1=libcrypto + -Dxkb_output_dir="${EPREFIX}/var/lib/xkb" + ) + + if use systemd || use elogind; then + emesonargs+=( + -Dsystemd_logind=true + $(meson_use suid suid_wrapper) + ) + else + emesonargs+=( + -Dsystemd_logind=false + $(meson_use suid suid_wrapper) + ) + fi + + meson_src_configure +} + +src_install() { + meson_src_install + + #The new meson build system do not leave X symlink + ln -s Xorg "${ED}"/usr/bin/X + + if ! use xorg; then + rm -f "${ED}"/usr/share/man/man1/Xserver.1x \ + "${ED}"/usr/$(get_libdir)/xserver/SecurityPolicy \ + "${ED}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \ + "${ED}"/usr/share/man/man1/Xserver.1x || die + fi + + # install the @x11-module-rebuild set for Portage + insinto /usr/share/portage/config/sets + newins "${FILESDIR}"/xorg-sets.conf xorg.conf +} + +pkg_postrm() { + # Get rid of module dir to ensure opengl-update works properly + if [[ -z ${REPLACED_BY_VERSION} && -e ${EROOT}/usr/$(get_libdir)/xorg/modules ]]; then + rm -rf "${EROOT}"/usr/$(get_libdir)/xorg/modules + fi +} diff --git a/x11-base/xorg-server/xorg-server-21.1.1.ebuild b/x11-base/xorg-server/xorg-server-21.1.1.ebuild deleted file mode 100644 index feb237caedaf..000000000000 --- a/x11-base/xorg-server/xorg-server-21.1.1.ebuild +++ /dev/null @@ -1,179 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -XORG_DOC=doc -XORG_TARBALL_SUFFIX="xz" -XORG_EAUTORECONF="no" -inherit xorg-3 meson -EGIT_REPO_URI="https://gitlab.freedesktop.org/xorg/xserver.git" - -DESCRIPTION="X.Org X servers" -SLOT="0/${PV}" -if [[ ${PV} != 9999* ]]; then - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" -fi - -IUSE_SERVERS="xephyr xnest xorg xvfb" -IUSE="${IUSE_SERVERS} debug +elogind minimal selinux suid systemd test +udev unwind xcsecurity" -RESTRICT="!test? ( test )" - -CDEPEND=" - media-libs/libglvnd[X] - dev-libs/openssl:0= - >=x11-apps/iceauth-1.0.2 - >=x11-apps/rgb-1.0.3 - >=x11-apps/xauth-1.0.3 - x11-apps/xkbcomp - >=x11-libs/libdrm-2.4.89 - >=x11-libs/libpciaccess-0.12.901 - >=x11-libs/libXau-1.0.4 - >=x11-libs/libXdmcp-1.0.2 - >=x11-libs/libXfont2-2.0.1 - >=x11-libs/libxcvt-0.1.0 - >=x11-libs/libxkbfile-1.0.4 - >=x11-libs/libxshmfence-1.1 - >=x11-libs/pixman-0.27.2 - >=x11-misc/xbitmaps-1.0.1 - >=x11-misc/xkeyboard-config-2.4.1-r3 - >=x11-libs/libXext-1.0.5 - x11-libs/libXv - xephyr? ( - x11-libs/libxcb[xkb] - x11-libs/xcb-util - x11-libs/xcb-util-image - x11-libs/xcb-util-keysyms - x11-libs/xcb-util-renderutil - x11-libs/xcb-util-wm - ) - !minimal? ( - >=x11-libs/libX11-1.1.5 - >=x11-libs/libXext-1.0.5 - >=media-libs/mesa-18[X(+),egl(+),gbm(+)] - >=media-libs/libepoxy-1.5.4[X,egl(+)] - ) - udev? ( virtual/libudev:= ) - unwind? ( sys-libs/libunwind ) - >=x11-apps/xinit-1.3.3-r1 - selinux? ( sys-libs/libselinux ) - systemd? ( - sys-apps/dbus - sys-apps/systemd - ) - elogind? ( - sys-apps/dbus - sys-auth/elogind[pam] - sys-auth/pambase[elogind] - ) - doc? ( - x11-base/xorg-sgml-doctools - ) - !!x11-drivers/nvidia-drivers[-libglvnd(+)] -" -DEPEND="${CDEPEND} - >=x11-base/xorg-proto-2021.4.99.2 - >=x11-libs/xtrans-1.3.5 -" -RDEPEND="${CDEPEND} - !systemd? ( gui-libs/display-manager-init ) - selinux? ( sec-policy/selinux-xserver ) -" -BDEPEND=" - sys-devel/flex -" -PDEPEND=" - xorg? ( >=x11-base/xorg-drivers-$(ver_cut 1-2) )" - -REQUIRED_USE="!minimal? ( - || ( ${IUSE_SERVERS} ) - ) - elogind? ( udev ) - ?? ( elogind systemd )" - -UPSTREAMED_PATCHES=( -) - -PATCHES=( - "${UPSTREAMED_PATCHES[@]}" - "${FILESDIR}"/${PN}-1.12-unloadsubmodule.patch - # needed for new eselect-opengl, bug #541232 - "${FILESDIR}"/${PN}-1.18-support-multiple-Files-sections.patch -) - -src_configure() { - # localstatedir is used for the log location; we need to override the default - # from ebuild.sh - # sysconfdir is used for the xorg.conf location; same applies - # NOTE: fop is used for doc generating; and I have no idea if Gentoo - # package it somewhere - - local emesonargs=( - --localstatedir "${EPREFIX}/var" - --sysconfdir "${EPREFIX}/etc/X11" - --buildtype $(usex debug debug plain) - -Db_ndebug=$(usex debug false true) - $(meson_use doc docs) - $(meson_use !minimal dri1) - $(meson_use !minimal dri2) - $(meson_use !minimal dri3) - $(meson_use !minimal glamor) - $(meson_use !minimal glx) - $(meson_use udev) - $(meson_use udev udev_kms) - $(meson_use unwind libunwind) - $(meson_use xcsecurity) - $(meson_use xephyr) - $(meson_use xnest) - $(meson_use xorg) - $(meson_use xvfb) - -Ddefault_font_path="${EPREFIX}"/usr/share/fonts - -Ddrm=true - -Ddtrace=false - -Dipv6=true - -Dhal=false - -Dlinux_acpi=false - -Dlinux_apm=false - -Dsha1=libcrypto - -Dxkb_output_dir="${EPREFIX}/var/lib/xkb" - ) - - if use systemd || use elogind; then - emesonargs+=( - -Dsystemd_logind=true - $(meson_use suid suid_wrapper) - ) - else - emesonargs+=( - -Dsystemd_logind=false - $(meson_use suid suid_wrapper) - ) - fi - - meson_src_configure -} - -src_install() { - meson_src_install - - #The new meson build system do not leave X symlink - ln -s Xorg "${ED}"/usr/bin/X - - if ! use xorg; then - rm -f "${ED}"/usr/share/man/man1/Xserver.1x \ - "${ED}"/usr/$(get_libdir)/xserver/SecurityPolicy \ - "${ED}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \ - "${ED}"/usr/share/man/man1/Xserver.1x || die - fi - - # install the @x11-module-rebuild set for Portage - insinto /usr/share/portage/config/sets - newins "${FILESDIR}"/xorg-sets.conf xorg.conf -} - -pkg_postrm() { - # Get rid of module dir to ensure opengl-update works properly - if [[ -z ${REPLACED_BY_VERSION} && -e ${EROOT}/usr/$(get_libdir)/xorg/modules ]]; then - rm -rf "${EROOT}"/usr/$(get_libdir)/xorg/modules - fi -} -- cgit v1.2.3-65-gdbad