Date: Sun, 25 Aug 2013 09:46:03 +0000 (UTC) From: Jean-Sebastien Pedron <dumbbell@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254833 - head/sys/dev/drm2 Message-ID: <201308250946.r7P9k3iQ081660@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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.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: 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308250946.r7P9k3iQ081660>