1
Description: Report physical DPI when EDID data exists.
3
This reverts git commit fff00df94d7ebd18a8e24537ec96073717375a3f, which
4
made X report 96DPI via the core protocol.
6
We want to make this policy decision higher up the stack than the X server,
7
so revert this and make X report the physical DPI when the EDID contains
9
Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
11
Index: xorg-server/hw/xfree86/modes/xf86RandR12.c
12
===================================================================
13
--- xorg-server.orig/hw/xfree86/modes/xf86RandR12.c 2010-08-03 15:59:57.750272356 +1000
14
+++ xorg-server/hw/xfree86/modes/xf86RandR12.c 2010-08-03 16:00:00.750380508 +1000
18
xf86OutputPtr output = xf86CompatOutput(pScrn);
22
output->conf_monitor &&
24
mmWidth = output->conf_monitor->mon_width;
25
mmHeight = output->conf_monitor->mon_height;
27
+ else if (pScrPriv && pScrPriv->primaryOutput)
29
+ /* Calculate DPI based on primary display size, not the entire display size */
30
+ mmWidth = pScrPriv->primaryOutput->mmWidth * width / pScrPriv->primaryOutput->crtc->mode->mode.width;
31
+ mmHeight = pScrPriv->primaryOutput->mmHeight * height / pScrPriv->primaryOutput->crtc->mode->mode.height;
33
+ else if (output && output->crtc && output->crtc->mode.HDisplay &&
34
+ output->mm_width && output->mm_height)
37
+ * If the output has a mode and a declared size, use that
38
+ * to scale the screen size
40
+ DisplayModePtr mode = &output->crtc->mode;
41
+ mmWidth = output->mm_width * width / mode->HDisplay;
42
+ mmHeight = output->mm_height * height / mode->VDisplay;