diff --git a/fix-dpi-values.diff b/fix-dpi-values.diff new file mode 100644 index 0000000..30dfb94 --- /dev/null +++ b/fix-dpi-values.diff @@ -0,0 +1,57 @@ +diff -u -p ../../../../xorg-server-1.4.0.90.orig/hw/xfree86/common//xf86Helper.c ./xf86Helper.c +--- ../../../../xorg-server-1.4.0.90.orig/hw/xfree86/common//xf86Helper.c 2008-05-26 16:53:50.000000000 +0000 ++++ hw/xfree86/common/xf86Helper.c 2008-05-26 17:09:52.000000000 +0000 +@@ -1017,12 +1017,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; +@@ -1057,12 +1067,22 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int + pScrn->widthmm = ddcWidthmm; + pScrn->heightmm = ddcHeightmm; + 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; diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 8cab71e..3410854 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 26 19:27:39 CEST 2008 - sndirsch@suse.de + +- fix-dpi-values.diff + * fixes DPI values for RANDR 1.2 capable drivers (bnc #393001) + ------------------------------------------------------------------- Fri May 16 16:52:03 CEST 2008 - sndirsch@suse.de diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index adc5ba9..38f0869 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -22,7 +22,7 @@ BuildRequires: libjpeg-devel Url: http://xorg.freedesktop.org/ %define EXPERIMENTAL 0 Version: 7.3 -Release: 104 +Release: 106 License: X11/MIT BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: System/X11/Servers/XF86_4 @@ -116,6 +116,7 @@ Patch108: xkb_action.diff Patch109: events.diff Patch110: xorg-server-1.4-vnc-disable_render.diff Patch111: xorg-server-1.4-vnc-render_sig11.diff +Patch112: fix-dpi-values.diff %description This package contains the X.Org Server. @@ -262,6 +263,7 @@ popd %patch107 -p0 %patch108 -p1 %patch109 -p1 +%patch112 -p0 %build pushd xorg-docs-* @@ -568,6 +570,9 @@ exit 0 %endif %changelog +* Mon May 26 2008 sndirsch@suse.de +- fix-dpi-values.diff + * fixes DPI values for RANDR 1.2 capable drivers (bnc #393001) * Fri May 16 2008 sndirsch@suse.de - mention ZapWarning also in Xorg manual page (bnc #391352) * Fri May 16 2008 sndirsch@suse.de