Author: dumbbell
Date: Sun Aug 25 09:46:03 2013
New Revision: 254833
URL: http://svnweb.freebsd.org/changeset/base/254833

Log:
  drm: Import Linux commit cd004b3f4cd4169815c82bf9e424fda06978898a
  
  Author: Shirish S <s.shir...@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.shir...@samsung.com>
      Reviewed-by: Jean Delvare <jdelv...@suse.de>
      Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch>
      Reviewed-by: Ville Syrjala <ville.syrj...@linux.intel.com>
      Signed-off-by: Dave Airlie <airl...@redhat.com>

Modified:
  head/sys/dev/drm2/drm_edid.c

Modified: head/sys/dev/drm2/drm_edid.c
==============================================================================
--- head/sys/dev/drm2/drm_edid.c        Sun Aug 25 09:45:26 2013        
(r254832)
+++ head/sys/dev/drm2/drm_edid.c        Sun Aug 25 09:46:03 2013        
(r254833)
@@ -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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to