All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Joe van Tunen <joevt@shaw.ca>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 05/10] edid-decode: output timings for YCbCr 4:2:0 cmdb
Date: Mon, 25 Nov 2019 09:20:03 +0100	[thread overview]
Message-ID: <080daa8d-53e7-4d16-2a62-04fbbfedaf99@xs4all.nl> (raw)
In-Reply-To: <7C871732-2189-421D-A4E1-CA6F1F972AC8@shaw.ca>

On 11/25/19 7:32 AM, Joe van Tunen wrote:
> Right. The code will have to iterate EDID extension blocks, find CTA extension blocks, then find VDB blocks.
> In the case where Y420CMDB length = 0, I would maybe output "All VDB SVDs"?

Yes,

> Also, shouldn't "VSD Index" be "SVD Index" to match the abbreviations in the spec (or "VDB SVD Index" since it doesn't include SVDs from other sources such as Y420VDB)?

I think 'VBD SVDs' is correct.

>  
> Can we assume that an EDID can't use more than one Y420CMDB to get beyond VDB SVD Index 240? Each Y420CMDB will use the same set of SVDs (starting at VDB SVD index 1). The spec explicitly says that bit 0 is the first SVD of the VDBs.

I agree with that assumption.

Regards,

	Hans

>  
> On 2019-11-24, 2:26 AM, "Hans Verkuil" <hverkuil@xs4all.nl> wrote:
> 
>     On 11/23/19 5:45 PM, joevt wrote:
>     > - "YCbCr 4:2:0 capability map data block" now outputs the modes that support YCbCr 4:2:0 instead of just indexes of the modes. Indexes refer to timings in "Video Data Block".
>     > - Warnings are included in the output if "Video Data Block" doesn't appear before "YCbCr 4:2:0 Capability Map Data Block" or if the index is outside the range defined in the "Video Data Block".
>     > - Moved inner loop of cta_svd into a new function cta_svd_one so that it can be reused by cta_y420cmdb.
>     
>     This isn't sufficient. There may be multiple SVD blocks in the EDID, and that's not taken
>     into account.
>     
>     Also, I can't find any requirement in the CTA-861 spec that the YCbCr 4:2:0 Capability
>     Map Data Block has to appear after all SVD blocks. So the final check if the Y420CMDB
>     block references invalid SVDs should be postponed to the end of the CTA block.
>     
>     I also found a pre-existing bug: if length == 0 in cta_y420cmdb() then that means that
>     all SVDs support 4:2:0. That should be added to cta_y420cmdb().
>     
>     Regards,
>     
>                 Hans
>     
>     > 
>     > Signed-off-by: Joe van Tunen <joevt@shaw.ca>
>     > ---
>     >  edid-decode.c | 44 +++++++++++++++++++++++++++++++++++---------
>     >  1 file changed, 35 insertions(+), 9 deletions(-)
>     > 
>     > diff --git a/edid-decode.c b/edid-decode.c
>     > index b833178..4d6fe29 100644
>     > --- a/edid-decode.c
>     > +++ b/edid-decode.c
>     > @@ -1454,13 +1454,10 @@ static const struct edid_cta_mode *vic_to_mode(unsigned char vic)
>     >         return NULL;
>     >  }
>     >  
>     > -static void cta_svd(const unsigned char *x, unsigned n, int for_ycbcr420)
>     > +static void cta_svd_one(const unsigned char *x, int for_ycbcr420)
>     >  {
>     > -       unsigned i;
>     > -
>     > -       for (i = 0; i < n; i++)  {
>     >                         const struct edid_cta_mode *vicmode = NULL;
>     > -                       unsigned char svd = x[i];
>     > +                      unsigned char svd = x[0];
>     >                         unsigned char native;
>     >                         unsigned char vic;
>     >                         const char *mode;
>     > @@ -1468,7 +1465,7 @@ static void cta_svd(const unsigned char *x, unsigned n, int for_ycbcr420)
>     >                         unsigned clock_khz = 0;
>     >  
>     >                         if ((svd & 0x7f) == 0)
>     > -                                       continue;
>     > +                                      return;
>     >  
>     >                         if ((svd - 1) & 0x40) {
>     >                                         vic = svd;
>     > @@ -1511,10 +1508,23 @@ static void cta_svd(const unsigned char *x, unsigned n, int for_ycbcr420)
>     >                         if (vic == 1)
>     >                                         has_cta861_vic_1 = 1;
>     >         }
>     > +
>     > +static void cta_svd(const unsigned char *x, int n, int for_ycbcr420)
>     > +{
>     > +      for (unsigned i = 0; i < n; i++)  {
>     > +                      printf("    ");
>     > +                      cta_svd_one(x+i, for_ycbcr420);
>     > +                      printf("\n");
>     > +      }
>     >  }
>     >  
>     > +unsigned const char *last_cta_video_block_start = NULL;
>     > +unsigned last_cta_video_block_length = 0;
>     > +
>     >  static void cta_video_block(const unsigned char *x, unsigned length)
>     >  {
>     > +      last_cta_video_block_start = x;
>     > +      last_cta_video_block_length = length;
>     >         cta_svd(x, length, 0);
>     >  }
>     >  
>     > @@ -1531,9 +1541,25 @@ static void cta_y420cmdb(const unsigned char *x, unsigned length)
>     >                         uint8_t v = x[0 + i];
>     >                         unsigned j;
>     >  
>     > -                       for (j = 0; j < 8; j++)
>     > -                                       if (v & (1 << j))
>     > -                                                       printf("    VSD Index %u\n", i * 8 + j);
>     > +                      for (j = 0; j < 8; j++) {
>     > +                                      if (v & (1 << j)) {
>     > +                                                      unsigned k = i * 8 + j;
>     > +                                                      printf("    VSD Index %u", k + 1);
>     > +                                                      if (k >= last_cta_video_block_length) {
>     > +                                                                      if (last_cta_video_block_start) {
>     > +                                                                                      printf(" (out of range)");
>     > +                                                                      } else {
>     > +                                                                                      printf(" (missing CTA video block)");
>    > +                                                                      }
>     > +                                                      }
>     > +                                                      else
>     > +                                                      {
>     > +                                                                      printf(" ");
>     > +                                                                      cta_svd_one(last_cta_video_block_start+k, 0);
>     > +                                                      }
>     > +                                                      printf("\n");
>     > +                                      }
>     > +                      }
>     >         }
>     >  }
>     >  
>     > 
>     
>     
> 
> 


  reply	other threads:[~2019-11-25  8:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 16:45 [PATCH 00/10] edid-decode: bug fixes, additions, changes joevt
2019-11-23 16:45 ` [PATCH 01/10] edid-decode: change horizontal refresh rates to kHz joevt
2019-11-23 16:45 ` [PATCH 02/10] edid-decode: correct horizontal range in Monitor Ranges joevt
2019-11-23 16:45 ` [PATCH 03/10] edid-decode: correct calculation of DisplayID type 1 timings joevt
2019-11-23 16:45 ` [PATCH 04/10] edid-decode: add front porch, pulse width, and back porch joevt
2019-11-23 16:45 ` [PATCH 05/10] edid-decode: output timings for YCbCr 4:2:0 cmdb joevt
2019-11-24 10:26   ` Hans Verkuil
2019-11-25  6:32     ` Joe van Tunen
2019-11-25  8:20       ` Hans Verkuil [this message]
2019-11-23 16:46 ` [PATCH 06/10] edid-decode: Dump hex of unknown CTA Vendor-Specific blocks joevt
2019-11-23 16:46 ` [PATCH 07/10] edid-decode: cleanup printf format string compiler warnings joevt
2019-11-23 16:46 ` [PATCH 08/10] edid-decode: Dump hex of non-decoded extension blocks joevt
2019-11-23 16:46 ` [PATCH 09/10] edid-decode: DisplayID additions joevt
2019-11-24 10:03   ` Hans Verkuil
2019-11-25  6:30     ` Joe van Tunen
2019-11-25  9:15       ` Hans Verkuil
2019-11-23 16:46 ` [PATCH 10/10] edid-decode: add example EDIDs joevt
2019-11-24 11:10   ` Hans Verkuil
2019-11-24 11:12 ` [PATCH 00/10] edid-decode: bug fixes, additions, changes Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=080daa8d-53e7-4d16-2a62-04fbbfedaf99@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=joevt@shaw.ca \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.