summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-05-31 09:32:31 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-05-31 09:40:18 +0100
commit7337f558d8bae26e626305fc478d070368bd86cd (patch)
tree8ebe2b5dfbad69b548b11c758a428dc5be03f170 /src
parent000378a801d627687a34906193c9f75b5041c7da (diff)
sna: Use physical output size from the kernel
We have a conflict between Xorg and the kernel, once again, over the meaning of the EDID. Since the kernel supplies us with the physical size of the connector, let's place the burden of trust on the kernel and ignore the quirky behaviour of Xorg. Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=96255 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_display.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 9c1d8fda..3a627a46 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3445,6 +3445,8 @@ sna_output_detect(xf86OutputPtr output)
switch (compat_conn.conn.connection) {
case DRM_MODE_CONNECTED:
sna_output->status = XF86OutputStatusConnected;
+ output->mm_width = compat_conn.conn.mm_width;
+ output->mm_height = compat_conn.conn.mm_height;
break;
case DRM_MODE_DISCONNECTED:
sna_output->status = XF86OutputStatusDisconnected;
@@ -3487,6 +3489,27 @@ sna_output_mode_valid(xf86OutputPtr output, DisplayModePtr mode)
return MODE_OK;
}
+static void sna_output_set_parsed_edid(xf86OutputPtr output, xf86MonPtr mon)
+{
+ unsigned conn_mm_width, conn_mm_height;
+
+ /* We set the output size based on values from the kernel */
+ conn_mm_width = output->mm_width;
+ conn_mm_height = output->mm_height;
+
+ xf86OutputSetEDID(output, mon);
+
+ if (output->mm_width != conn_mm_width || output->mm_height != conn_mm_height) {
+ DBG(("%s)%s): kernel and Xorg disagree over physical size: kernel=%dx%dmm, Xorg=%dx%dmm\n",
+ __FUNCION__, output->name,
+ conn_mm_width, conn_mm_height,
+ output->mm_width, output->mm_height));
+ }
+
+ output->mm_width = conn_mm_width;
+ output->mm_height = conn_mm_height;
+}
+
static void
sna_output_attach_edid(xf86OutputPtr output)
{
@@ -3594,7 +3617,7 @@ skip_read:
}
done:
- xf86OutputSetEDID(output, mon);
+ sna_output_set_parsed_edid(output, mon);
if (raw) {
sna_output->edid_raw = raw;
sna_output->edid_len = blob.length;