public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Simon Ser <simon.ser@intel.com>
Cc: igt-dev@lists.freedesktop.org, martin.peres@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t 3/5] lib/igt_edid: add support for native DTDs in CEA extension blocks
Date: Tue, 2 Jul 2019 18:38:52 +0300	[thread overview]
Message-ID: <20190702153852.GS5942@intel.com> (raw)
In-Reply-To: <20190702125038.21621-3-simon.ser@intel.com>

On Tue, Jul 02, 2019 at 03:50:36PM +0300, Simon Ser wrote:
> Native Detailed Timing Descriptors follow the Data Block Collection in the CEA
> extension.
> 
> Signed-off-by: Simon Ser <simon.ser@intel.com>
> ---
>  lib/igt_edid.c | 6 ++++--
>  lib/igt_edid.h | 2 +-
>  lib/igt_kms.c  | 3 +--
>  3 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/igt_edid.c b/lib/igt_edid.c
> index c93d8fa8bca0..93202c138161 100644
> --- a/lib/igt_edid.c
> +++ b/lib/igt_edid.c
> @@ -408,15 +408,17 @@ size_t edid_cea_data_block_set_speaker_alloc(struct edid_cea_data_block *block,
>  }
>  
>  void edid_ext_set_cea(struct edid_ext *ext, size_t data_blocks_size,
> -		      uint8_t flags)
> +		      size_t native_dtds_len, uint8_t flags)

size_t is a an odd choice for something that is not a size.
I would have also called it num_native_dtds or something.

>  {
>  	struct edid_cea *cea = &ext->data.cea;
>  
>  	ext->tag = EDID_EXT_CEA;
>  
> +	assert(native_dtds_len <= 0x0F);

The CEA extension can contain up to six DTDs and the base block
can have up to four. So we could make this assert even tighter:

assert(num_native_dtds <= (127 - 4 - data_block_size) / 18 + 4);

or something. But since that wouldn't check against the actual
number of dtds present maybe a bit pointless to do that.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> +	assert((flags & 0x0F) == 0);
>  	cea->revision = 3;
>  	cea->dtd_start = 4 + data_blocks_size;
> -	cea->misc = flags; /* just flags, no DTD */
> +	cea->misc = flags | native_dtds_len;
>  }
>  
>  void edid_ext_update_cea_checksum(struct edid_ext *ext)
> diff --git a/lib/igt_edid.h b/lib/igt_edid.h
> index 0ac851c0d74a..702c14c54b5e 100644
> --- a/lib/igt_edid.h
> +++ b/lib/igt_edid.h
> @@ -359,6 +359,6 @@ size_t edid_cea_data_block_set_hdmi_vsd(struct edid_cea_data_block *block,
>  size_t edid_cea_data_block_set_speaker_alloc(struct edid_cea_data_block *block,
>  					     const struct cea_speaker_alloc *speakers);
>  void edid_ext_set_cea(struct edid_ext *ext, size_t data_blocks_size,
> -		      uint8_t flags);
> +		      size_t native_dtds_len, uint8_t flags);
>  
>  #endif
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index f8185edf6e8b..45c79a380daf 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -226,8 +226,7 @@ generate_audio_edid(unsigned char raw_edid[static AUDIO_EDID_LENGTH],
>  
>  	assert(cea_data_size <= sizeof(edid_cea->data));
>  
> -	edid_ext_set_cea(edid_ext, cea_data_size,
> -			 EDID_CEA_BASIC_AUDIO);
> +	edid_ext_set_cea(edid_ext, cea_data_size, 0, EDID_CEA_BASIC_AUDIO);
>  
>  	edid_update_checksum(edid);
>  	edid_ext_update_cea_checksum(edid_ext);
> -- 
> 2.22.0
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-07-02 15:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 12:50 [igt-dev] [PATCH i-g-t 1/5] lib/igt_kms: remove length parameter from kmstest_force_edid Simon Ser
2019-07-02 12:50 ` [igt-dev] [PATCH i-g-t 2/5] lib/igt_edid: add hdmi_vsd Simon Ser
2019-07-02 14:05   ` Ville Syrjälä
2019-07-03 12:10     ` Ser, Simon
2019-07-02 12:50 ` [igt-dev] [PATCH i-g-t 3/5] lib/igt_edid: add support for native DTDs in CEA extension blocks Simon Ser
2019-07-02 15:38   ` Ville Syrjälä [this message]
2019-07-02 12:50 ` [igt-dev] [PATCH i-g-t 4/5] lib/igt_edid: add support for Short Video Descriptors Simon Ser
2019-07-02 15:41   ` Ville Syrjälä
2019-07-02 12:50 ` [igt-dev] [PATCH i-g-t 5/5] lib/igt_kms: use igt_edid to generate a 4K EDID Simon Ser
2019-07-02 15:51   ` Ville Syrjälä
2019-07-03  8:24     ` Ser, Simon
2019-07-03 12:58       ` Ville Syrjälä
2019-07-03 17:00         ` Ser, Simon
2019-07-02 13:46 ` [igt-dev] [PATCH i-g-t 1/5] lib/igt_kms: remove length parameter from kmstest_force_edid Ville Syrjälä
2019-07-02 14:12 ` [igt-dev] ✗ GitLab.Pipeline: warning for series starting with [i-g-t,1/5] " Patchwork
2019-07-02 14:28 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-07-03 10:50 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20190702153852.GS5942@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=martin.peres@intel.com \
    --cc=simon.ser@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox