svn commit: r261660 - stable/9/sys/dev/drm2

Jean-Sebastien Pedron dumbbell at FreeBSD.org
Sun Feb 9 15:27:27 UTC 2014


Author: dumbbell
Date: Sun Feb  9 15:27:26 2014
New Revision: 261660
URL: http://svnweb.freebsd.org/changeset/base/261660

Log:
  MFC r254833:
  
  drm: Import Linux commit cd004b3f4cd4169815c82bf9e424fda06978898a
  
  Author: Shirish S <s.shirish at samsung.com>
  Date:   Thu Aug 30 07:04:06 2012 +0000
  
      drm: edid: add support for E-DDC
  
      The current logic for probing ddc is limited to
      2 blocks (256 bytes), this patch adds support
      for the 4 block (512) data.
  
      To do this, a single 8-bit segment index is
      passed to the display via the I2C address 30h.
      Data from the selected segment is then immediately
      read via the regular DDC2 address using a repeated
      I2C 'START' signal.
  
      Signed-off-by: Shirish S <s.shirish at samsung.com>
      Reviewed-by: Jean Delvare <jdelvare at suse.de>
      Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
      Reviewed-by: Ville Syrjala <ville.syrjala at linux.intel.com>
      Signed-off-by: Dave Airlie <airlied at redhat.com>

Modified:
  stable/9/sys/dev/drm2/drm_edid.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/drm2/drm_edid.c
==============================================================================
--- stable/9/sys/dev/drm2/drm_edid.c	Sun Feb  9 15:17:57 2014	(r261659)
+++ stable/9/sys/dev/drm2/drm_edid.c	Sun Feb  9 15:27:26 2014	(r261660)
@@ -253,6 +253,8 @@ drm_do_probe_ddc_edid(device_t adapter, 
 		      int block, int len)
 {
 	unsigned char start = block * EDID_LENGTH;
+	unsigned char segment = block >> 1;
+	unsigned char xfers = segment ? 3 : 2;
 	int ret, retries = 5;
 
 	/* The core i2c driver will automatically retry the transfer if the
@@ -264,6 +266,11 @@ drm_do_probe_ddc_edid(device_t adapter, 
 	do {
 		struct iic_msg msgs[] = {
 			{
+				.slave  = DDC_SEGMENT_ADDR << 1,
+				.flags  = 0,
+				.len    = 1,
+				.buf    = &segment,
+			}, {
 				.slave	= DDC_ADDR << 1,
 				.flags	= IIC_M_WR,
 				.len	= 1,
@@ -275,7 +282,13 @@ drm_do_probe_ddc_edid(device_t adapter, 
 				.buf	= buf,
 			}
 		};
-		ret = iicbus_transfer(adapter, msgs, 2);
+
+	/*
+	 * Avoid sending the segment addr to not upset non-compliant ddc
+	 * monitors.
+	 */
+		ret = iicbus_transfer(adapter, &msgs[3 - xfers], xfers);
+
 		if (ret != 0)
 			DRM_DEBUG_KMS("iicbus_transfer countdown %d error %d\n",
 			    retries, ret);


More information about the svn-src-stable-9 mailing list