[PATCH edid-decode 7/9] Print video format preference data block
Arnaud Vrac
rawoul at gmail.com
Fri Jul 8 17:41:25 UTC 2016
On Fri, Jul 8, 2016 at 7:17 PM, walter harms <wharms at bfs.de> wrote:
>
>
> Am 08.07.2016 16:09, schrieb Arnaud Vrac:
> > From: Arnaud Vrac <avrac at freebox.fr>
> >
> > This only prints VIC codes, not DTD.
> > ---
> > edid-decode.c | 31 +++++++++++++++++++++++++++++++
> > 1 file changed, 31 insertions(+)
> >
> > diff --git a/edid-decode.c b/edid-decode.c
> > index cd5a257..2e367b3 100644
> > --- a/edid-decode.c
> > +++ b/edid-decode.c
> > @@ -795,6 +795,36 @@ cea_y420vdb(unsigned char *x)
> > cea_svd(x + 2, length - 1);
> > }
> >
> > +static void
> > +cea_vfpdb(unsigned char *x)
> > +{
> > + int length = x[0] & 0x1f;
> > + int i;
> > +
> > + for (i = 2; i <= length; i++) {
> > + unsigned char svr = x[i];
> > +
> > + if ((svr > 0 && svr < 128) || (svr > 192 && svr < 254)) {
> > + unsigned char vic;
> > + const char *mode;
> > + int index;
> > +
> > + vic = svr;
> > + index = vic - 1;
>
>
> why do you need vic ? i could be dropped for srv
> btw you are checking index and use vic.
>
This is just for clarity, I can remove it.
>
> > +
> > + if (index < ARRAY_SIZE(edid_cea_modes))
> > + mode = edid_cea_modes[vic];
> > + else
> > + mode = "Unknown mode";
> > +
> > + printf(" VIC %02d %s\n", vic, mode);
> > +
> > + } else if (svr > 128 && svr < 145) {
> > + printf(" DTD number %02d\n", svr - 128);
> > + }
> > + }
> > +}
>
>
> when I see the ranges i am wondering ...
> [1-127] edid_cea_modes [01-7F]
> [129-144] DTD number [81-91]
> [193-253] edid_cea_modes [C0-FD]
>
> I would expect to see some pattern in the bits.
> Are you sure about the ranges ?
>
I'm sure about the ranges (they are in decimal in CEA 681-F), but I could
not find a pattern in the bits like I did in patch 2. So I preferred to
keep the same numbers that are in the spec.
>
> re,
> wh
>
> > +
> > static const char *edid_cea_hdmi_modes[] = {
> > "3840x2160 at 30Hz",
> > "3840x2160 at 25Hz",
> > @@ -1128,6 +1158,7 @@ cea_block(unsigned char *x)
> > break;
> > case 0x0d:
> > printf("Video format preference data block\n");
> > + cea_vfpdb(x);
> > break;
> > case 0x0e:
> > printf("YCbCr 4:2:0 video data block\n");
Thanks,
--
Arnaud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160708/de50805e/attachment.html>
More information about the xorg-devel
mailing list