[PATCH 3/4] xfree86: Use physical dimensions provided by output
Thierry Reding
thierry.reding at avionic-design.de
Thu Nov 8 05:50:31 PST 2012
If an output provides its physical dimensions, they should be used in
preference to computing them on the assumption that the display has a
default DPI setting.
Signed-off-by: Thierry Reding <thierry.reding at avionic-design.de>
---
hw/xfree86/modes/xf86RandR12.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 6f487bb..e18f357 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -806,10 +806,16 @@ xf86RandR12CreateScreenResources(ScreenPtr pScreen)
}
else {
/*
- * Otherwise, just set the screen to DEFAULT_DPI
+ * Otherwise, just set the screen to DEFAULT_DPI unless the
+ * output knows its physical dimensions.
*/
- mmWidth = width * 25.4 / DEFAULT_DPI;
- mmHeight = height * 25.4 / DEFAULT_DPI;
+ if (output->mm_width == 0 || output->mm_height == 0) {
+ mmWidth = width * 25.4 / DEFAULT_DPI;
+ mmHeight = height * 25.4 / DEFAULT_DPI;
+ } else {
+ mmWidth = output->mm_width;
+ mmHeight = output->mm_height;
+ }
}
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
--
1.8.0
More information about the xorg-devel
mailing list