Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Feb 2014 15:27:27 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r261660 - stable/9/sys/dev/drm2
Message-ID:  <201402091527.s19FRRtF083555@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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@samsung.com>
      Reviewed-by: Jean Delvare <jdelvare@suse.de>
      Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: Ville Syrjala <ville.syrjala@linux.intel.com>
      Signed-off-by: Dave Airlie <airlied@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402091527.s19FRRtF083555>