[RFC v2 2/5] video: Add generic HDMI infoframe helpers

Thierry Reding thierry.reding at avionic-design.de
Mon Dec 10 23:58:53 PST 2012


On Fri, Dec 07, 2012 at 12:32:42PM -0200, Paulo Zanoni wrote:
> 2012/12/5 Thierry Reding <thierry.reding at avionic-design.de>:
[...]
> > +ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, void *buffer,
> > +                               size_t size)
> > +{
> > +       u8 *ptr = buffer;
> > +       size_t length, i;
> > +
> > +       if (!frame || !buffer)
> > +               return -EINVAL;
> > +
> > +       length = 4 + frame->length;
> > +
> > +       if (size < length)
> > +               return -ENOSPC;
> > +
> > +       memset(buffer, 0, length);
> > +
> > +       ptr[0] = frame->type;
> > +       ptr[1] = frame->version;
> > +       ptr[2] = frame->length;
> > +       ptr[3] = 0; /* checksum */
> > +
> > +       for (i = 0; i < sizeof(frame->vendor); i++)
> > +               ptr[4 + i] = frame->vendor[i];
> > +
> > +       for (i = 0; i < sizeof(frame->product); i++)
> > +               ptr[12 + i] = frame->product[i];
> > +
> > +       ptr[26] = frame->sdi;
> 
> Shouldn't this be ptr[28] ?

Yes, you're absolutely right.

By the way, I had to scroll through your reply several times before I
found this single line. If you remove unneeded context when replying
your comments are much easier to locate.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20121211/c9bf774f/attachment.pgp>


More information about the dri-devel mailing list