1 diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
2 index 6fbf613..88c8a56 100644
3 --- a/hw/xfree86/common/xf86Config.c
4 +++ b/hw/xfree86/common/xf86Config.c
5 @@ -703,7 +703,8 @@ typedef enum {
6 FLAG_AUTO_ENABLE_DEVICES,
15 @@ -767,6 +768,8 @@ static OptionInfoRec FlagOptions[] = {
17 { FLAG_USE_SIGIO, "UseSIGIO", OPTV_BOOLEAN,
19 + { FLAG_DONTLIE, "DontLie", OPTV_BOOLEAN,
21 { -1, NULL, OPTV_NONE,
24 @@ -824,6 +827,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
25 xf86GetOptValBool(FlagOptions, FLAG_DONTVTSWITCH, &xf86Info.dontVTSwitch);
26 xf86GetOptValBool(FlagOptions, FLAG_DONTZAP, &xf86Info.dontZap);
27 xf86GetOptValBool(FlagOptions, FLAG_DONTZOOM, &xf86Info.dontZoom);
28 + xf86GetOptValBool(FlagOptions, FLAG_DONTLIE, &xf86Info.dontLie);
30 xf86GetOptValBool(FlagOptions, FLAG_IGNORE_ABI, &xf86Info.ignoreABI);
31 if (xf86Info.ignoreABI) {
32 diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
33 index 98f8284..c7d03a4 100644
34 --- a/hw/xfree86/common/xf86Globals.c
35 +++ b/hw/xfree86/common/xf86Globals.c
36 @@ -110,6 +110,7 @@ xf86InfoRec xf86Info = {
37 .dontVTSwitch = FALSE,
41 .notrapSignals = FALSE,
42 .caughtSignal = FALSE,
43 .currentScreen = NULL,
44 diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
45 index b2095aa..05166f9 100644
46 --- a/hw/xfree86/common/xf86Privstr.h
47 +++ b/hw/xfree86/common/xf86Privstr.h
48 @@ -68,6 +68,8 @@ typedef struct {
54 Bool notrapSignals; /* don't exit cleanly - die at fault */
57 diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
58 index 942c397..dd1269c 100644
59 --- a/hw/xfree86/doc/man/xorg.conf.man.pre
60 +++ b/hw/xfree86/doc/man/xorg.conf.man.pre
61 @@ -490,6 +490,12 @@ When this option is enabled, those key sequences have no special meaning
62 and are passed to clients.
65 +.BI "Option \*qDontLie\*q \*q" boolean \*q
66 +This option suggests that the server should avoid lying whenever possible.
67 +Currently this means that RandR 1.2 drivers will try to compute the proper DPI
68 +instead of making it up.
71 .BI "Option \*qDisableVidModeExtension\*q \*q" boolean \*q
72 This disables the parts of the VidMode extension used by the xvidtune client
73 that can be used to change the video modes.
74 diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
75 index 1fc63c4..5d8bc29 100644
76 --- a/hw/xfree86/modes/xf86RandR12.c
77 +++ b/hw/xfree86/modes/xf86RandR12.c
78 @@ -806,6 +806,7 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen)
81 xf86OutputPtr output = config->output[config->compat_output];
82 + xf86CrtcPtr crtc = output->crtc;
84 if (output->conf_monitor &&
85 (output->conf_monitor->mon_width > 0 &&
86 @@ -817,6 +818,17 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen)
87 mmWidth = output->conf_monitor->mon_width;
88 mmHeight = output->conf_monitor->mon_height;
90 + else if (xf86Info.dontLie && crtc && crtc->mode.HDisplay &&
91 + output->mm_width && output->mm_height)
94 + * If the output has a mode and a declared size, use that
95 + * to scale the screen size
97 + DisplayModePtr mode = &crtc->mode;
98 + mmWidth = output->mm_width * width / mode->HDisplay;
99 + mmHeight = output->mm_height * height / mode->VDisplay;