[PATCH edid-decode 8/9] Print HDR static metadata block

Arnaud Vrac rawoul at gmail.com
Fri Jul 8 16:39:09 UTC 2016


 On Fri, Jul 8, 2016 at 4:56 PM, walter harms <wharms at bfs.de> wrote:
>
>
> Am 08.07.2016 16:09, schrieb Arnaud Vrac:
> > From: Arnaud Vrac <avrac at freebox.fr>
> >
> > ---
> >  edid-decode.c | 38 ++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 38 insertions(+)
> >
> > diff --git a/edid-decode.c b/edid-decode.c
> > index 2e367b3..c18697f 100644
> > --- a/edid-decode.c
> > +++ b/edid-decode.c
> > @@ -1100,6 +1100,43 @@ cea_colorimetry_block(unsigned char *x)
> >      }
> >  }
> >
> > +static const char *eotf_map[] = {
> > +    "Traditional gamma - SDR luminance range",
> > +    "Traditional gamma - HDR luminance range",
> > +    "SMPTE ST2084",
> > +};
> > +
> > +static void
> > +cea_hdr_metadata_block(unsigned char *x)
> > +{
> > +    int length = x[0] & 0x1f;
> > +    int i;
> > +
> > +    if (length >= 3) {
> > +     printf("    Electro optical transfer functions:\n");
> > +     for (i = 0; i < 6; i++) {
> > +         if (x[2] >> i) {
> > +             printf("      %s\n", i < ARRAY_SIZE(eotf_map) ?
> > +                    eotf_map[i] : "Unknown");
> > +         }
> > +     }
>
> i would move "Unknown" into eotf_map[], that make later changes more easy.
>

That would add "Unknown" 3 times in the array, which I thought was
redundant. Bits 3 to 5 are reserved for future use.


> I assume that x[2] is a bitfield, so is (x[2] >> i) & 1 intended ?

as in "[PATCH edid-decode 3/9] Print speaker allocation data block"
>

Ah right, nice catch. I'll update the patch.


> re,
>  wh
>
> > +     printf("    Supported static metadata descriptors:\n");
> > +     for (i = 0; i < 8; i++) {
> > +         if (x[3] >> i)
> > +             printf("      Static metadata type %d\n", i + 1);
> > +     }
> > +    }
> > +
> > +    if (length >= 4)
> > +     printf("    Desired content max luminance: %d\n", x[4]);
> > +
> > +    if (length >= 5)
> > +     printf("    Desired content max frame-average luminance: %d\n",
> x[5]);
> > +
> > +    if (length >= 6)
> > +     printf("    Desired content min luminance: %d\n", x[6]);
> > +}
> > +
> >  static void
> >  cea_block(unsigned char *x)
> >  {
> > @@ -1155,6 +1192,7 @@ cea_block(unsigned char *x)
> >                   break;
> >               case 0x06:
> >                   printf("HDR static metadata data block\n");
> > +                 cea_hdr_metadata_block(x);
> >                   break;
> >               case 0x0d:
> >                   printf("Video format preference data block\n");
>

-- 
Arnaud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160708/06fc9452/attachment.html>


More information about the xorg-devel mailing list