[PATCH edid-decode 7/9] Print video format preference data block

walter harms wharms at bfs.de
Fri Jul 8 17:17:50 UTC 2016



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.

> +
> +	    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 ?

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");


More information about the xorg-devel mailing list