summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-27 12:58:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-27 12:58:58 +0100
commit2f2f439c9cfdd394ad2b9a125db51e2dba7d3ff7 (patch)
treec053b5626e327d7161a3352610c4e9015ff37e2c /src
parent5124f35168c0cc162cf5e8bcaafdf756945f6ca9 (diff)
sna: Fake the output physical width/height from the CRTC size
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_display.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index aafde157..e1199d97 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -54,6 +54,10 @@
#define KNOWN_MODE_FLAGS ((1<<14)-1)
+#ifndef DEFAULT_DPI
+#define DEFAULT_DPI 96
+#endif
+
#if 0
#define __DBG DBG
#else
@@ -3079,6 +3083,12 @@ static bool sna_probe_initial_configuration(struct sna *sna)
output->crtc = crtc;
crtc->enabled = TRUE;
+
+ if (output->mm_width == 0 ||
+ output->mm_height == 0) {
+ output->mm_height = (crtc->desiredMode.VDisplay * 254) / (10*DEFAULT_DPI);
+ output->mm_width = (crtc->desiredMode.HDisplay * 254) / (10*DEFAULT_DPI);
+ }
}
break;
}