xf86-video-intel: src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Tue May 31 08:41:50 UTC 2016


 src/sna/sna_display.c |   25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 7337f558d8bae26e626305fc478d070368bd86cd
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue May 31 09:32:31 2016 +0100

    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 at linux.intel.com>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=96255
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 9c1d8fd..3a627a4 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;


More information about the xorg-commit mailing list