1
0
xorg-x11-server/N_fix-dpi-values.diff
Stefan Dirsch 540300e204 - Update to version 21.1.0
* The meson support is now fully mature. While autotools support
    will still be kept for this release series, it will be dropped
    afterwards.
  * Glamor support for Xvfb.
  * Variable refresh rate support in the modesetting driver.
  * XInput 2.4 support which adds touchpad gestures.
  * DMX DDX has been removed.
  * X server now correctly reports display DPI in more cases. This
    may affect rendering of client applications that have their own
    workarounds for hi-DPI screens.
  * A large number of small features and various bug fixes.
- updated xorg-server-provides
- supersedes patches
  * U_Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch
  * U_dix-window-Use-ConfigureWindow-instead-of-MoveWindow.patch
  * U_glamor_egl-Reject-OpenGL-2.1-early-on.patch
  * u_render-Cast-color-masks-to-unsigned-long-before-shifting-them.patch
- refreshed patches
  * N_fix-dpi-values.diff
  * N_zap_warning_xserver.diff
  * u_modesetting-Fix-dirty-updates-for-sw-rotation.patch
  * u_randr-Do-not-crash-if-slave-screen-does-not-have-pro.patch
  * u_vesa-Add-VBEDPMSGetCapabilities-VBEDPMSGet.patch
- disabled n_xserver-optimus-autoconfig-hack.patch, which I believe is 
  superseded by:
  commit 078277e4d92f05a90c4715d61b89b9d9d38d68ea
  Author: Dave Airlie <airlied@redhat.com>
  Date:   Fri Aug 17 09:49:24 2012 +1000
    xf86: autobind GPUs to the screen
- added pkgconfig(libxcvt)
- cvt binary moved to libxcvt0 package

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=804
2021-10-27 16:05:03 +00:00

63 lines
2.4 KiB
Diff

From: Egbert Eich <eich@suse.de>
Fix calculation of DPI using mode data if present.
Index: hw/xfree86/common/xf86Helper.c
===================================================================
--- hw/xfree86/common/xf86Helper.c.orig
+++ hw/xfree86/common/xf86Helper.c
@@ -883,12 +883,22 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int
else if (pScrn->widthmm > 0 || pScrn->heightmm > 0) {
from = X_CONFIG;
if (pScrn->widthmm > 0) {
- pScrn->xDpi =
- (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ if (pScrn->modes && pScrn->modes->HDisplay > 0) {
+ pScrn->xDpi =
+ (int)((double) pScrn->modes->HDisplay * MMPERINCH / pScrn->widthmm);
+ } else {
+ pScrn->xDpi =
+ (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ }
}
if (pScrn->heightmm > 0) {
- pScrn->yDpi =
- (int) ((double) pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ if (pScrn->modes && pScrn->modes->VDisplay > 0) {
+ pScrn->yDpi =
+ (int)((double)pScrn->modes->VDisplay * MMPERINCH / pScrn->heightmm);
+ } else {
+ pScrn->yDpi =
+ (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ }
}
if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
pScrn->yDpi = pScrn->xDpi;
@@ -927,12 +937,22 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int
pScrn->widthmm = probedWidthmm;
pScrn->heightmm = probedHeightmm;
if (pScrn->widthmm > 0) {
- pScrn->xDpi =
- (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ if (pScrn->modes && pScrn->modes->HDisplay > 0) {
+ pScrn->xDpi =
+ (int)((double) pScrn->modes->HDisplay * MMPERINCH / pScrn->widthmm);
+ } else {
+ pScrn->xDpi =
+ (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ }
}
if (pScrn->heightmm > 0) {
- pScrn->yDpi =
- (int) ((double) pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ if (pScrn->modes && pScrn->modes->VDisplay > 0) {
+ pScrn->yDpi =
+ (int)((double)pScrn->modes->VDisplay * MMPERINCH / pScrn->heightmm);
+ } else {
+ pScrn->yDpi =
+ (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ }
}
if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
pScrn->yDpi = pScrn->xDpi;