[PATCH] drm: edid: add support for E-DDC

Shirish S shirish.s12 at gmail.com
Tue Aug 21 06:52:28 PDT 2012


Hello Daniel,

On Tue, Aug 21, 2012 at 4:18 AM, Daniel Vetter <daniel at ffwll.ch> wrote:

> On Tue, Aug 21, 2012 at 9:10 AM, Shirish S <s.shirish at samsung.com> wrote:
> > 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>
> > ---
> >  drivers/gpu/drm/drm_edid.c |   17 ++++++++++++-----
> >  1 files changed, 12 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > index a8743c3..2c2996e 100644
> > --- a/drivers/gpu/drm/drm_edid.c
> > +++ b/drivers/gpu/drm/drm_edid.c
> > @@ -254,6 +254,8 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter,
> unsigned char *buf,
> >                       int block, int len)
> >  {
> >         unsigned char start = block * EDID_LENGTH;
> > +       unsigned char segment = block >> 1;
> > +       unsigned short segFlags = segment ? 0 : I2C_M_IGNORE_NAK;
>
> Have you tested this on i915 with gmbus enabled? I'm asking since we
> don't implement the IGNORE_NAK flag and hence I'd expect spurious
> failures on displays that don't support E-DDC ...
>
> I have verified this on samsung exynos5 platform, and it passed the HDMI
compliance test for the same.
I also verified this on HDMI analyser-  Agilent N5988A , this analyser
 does not support 4 block EDID data(EDDC),
it passed in this analyser as well.
Is there any specific reason why you dont implement IGNORE_NAK?
Infact if i think for EDDC, if one does not pass IGNORE_NAK flag it might
give errors.


> Cheers, Daniel
>
> >         int ret, retries = 5;
> >
> >         /* The core i2c driver will automatically retry the transfer if
> the
> > @@ -264,27 +266,32 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter,
> unsigned char *buf,
> >          */
> >         do {
> >                 struct i2c_msg msgs[] = {
> > -                       {
> > +                       { /*set segment pointer */
> > +                               .addr   = DDC_SEGMENT_ADDR,
> > +                               .flags  = segFlags,
> > +                               .len    = 1,
> > +                               .buf    = &start,
> > +                       }, { /*set offset */
> >                                 .addr   = DDC_ADDR,
> >                                 .flags  = 0,
> >                                 .len    = 1,
> >                                 .buf    = &start,
> > -                       }, {
> > +                       }, { /*set data */
> >                                 .addr   = DDC_ADDR,
> >                                 .flags  = I2C_M_RD,
> >                                 .len    = len,
> >                                 .buf    = buf,
> >                         }
> >                 };
> > -               ret = i2c_transfer(adapter, msgs, 2);
> > +               ret = i2c_transfer(adapter, msgs, 3);
> >                 if (ret == -ENXIO) {
> >                         DRM_DEBUG_KMS("drm: skipping non-existent
> adapter %s\n",
> >                                         adapter->name);
> >                         break;
> >                 }
> > -       } while (ret != 2 && --retries);
> > +       } while (ret != 3 && --retries);
> >
> > -       return ret == 2 ? 0 : -1;
> > +       return ret == 3 ? 0 : -1;
> >  }
> >
> >  static bool drm_edid_is_zero(u8 *in_edid, int length)
> > --
> > 1.7.0.4
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
>
> --
> Daniel Vetter
> daniel.vetter at ffwll.ch - +41 (0) 79 364 57 48 - http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Regards,
Shirish S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20120821/4dff7d91/attachment-0001.html>


More information about the dri-devel mailing list