Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 18/20] drm/edid: detect color formats and CTA revision in all CTA extensions
Date: Thu, 5 May 2022 01:11:20 +0300	[thread overview]
Message-ID: <YnL6CGr+RqDiLr1A@intel.com> (raw)
In-Reply-To: <a137d2e272ad1eac5b286784008a4baf91bc2799.1651569697.git.jani.nikula@intel.com>

On Tue, May 03, 2022 at 12:24:03PM +0300, Jani Nikula wrote:
> Convert drm_find_cea_extension() to EDID block iterator in color format
> and CTA revision detection. Detect them in all CTA extensions.
> 
> Also parse CTA Data Blocks in DisplayID even if there's no CTA EDID
> extension.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 3b18a6e501df..41f24f4c2d23 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -5447,32 +5447,40 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>  			      const struct edid *edid)
>  {
>  	struct drm_display_info *info = &connector->display_info;
> +	struct drm_edid_iter edid_iter;
>  	const struct cea_db *db;
>  	struct cea_db_iter iter;
>  	const u8 *edid_ext;
>  
> -	edid_ext = drm_find_cea_extension(edid);
> -	if (!edid_ext)
> -		return;
> +	drm_edid_iter_begin(edid, &edid_iter);
> +	drm_edid_iter_for_each(edid_ext, &edid_iter) {
> +		if (edid_ext[0] != CEA_EXT)
> +			continue;
>  
> -	info->cea_rev = edid_ext[1];
> +		if (!info->cea_rev)
> +			info->cea_rev = edid_ext[1];
>  
> -	/* The existence of a CEA block should imply RGB support */
> -	info->color_formats = DRM_COLOR_FORMAT_RGB444;
> +		if (info->cea_rev != edid_ext[1])
> +			DRM_DEBUG_KMS("CEA extension version mismatch %u != %u\n",
> +				      info->cea_rev, edid_ext[1]);
>  
> -	/* CTA DisplayID Data Block does not have byte #3 */
> -	if (edid_ext[0] == CEA_EXT) {
> +		/* The existence of a CTA extension should imply RGB support */
> +		info->color_formats = DRM_COLOR_FORMAT_RGB444;
>  		if (edid_ext[3] & EDID_CEA_YCRCB444)
>  			info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
>  		if (edid_ext[3] & EDID_CEA_YCRCB422)
>  			info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
>  	}
> +	drm_edid_iter_end(&edid_iter);
>  
>  	cea_db_iter_edid_begin(edid, &iter);
>  	cea_db_iter_for_each(db, &iter) {
>  		/* FIXME: convert parsers to use struct cea_db */
>  		const u8 *data = (const u8 *)db;
>  
> +		/* The existence of a CTA block should imply RGB support */
> +		info->color_formats = DRM_COLOR_FORMAT_RGB444;

This part seems a bit iffy. DisplayID has its own way to specify the
supported color depths/encodings. So I think eventually we'll just
want to split this into three logical parts: parse CTA ext block,
parse DispID color stuff, parse CTA data blocks.

> +
>  		if (cea_db_is_hdmi_vsdb(db))
>  			drm_parse_hdmi_vsdb_video(connector, data);
>  		if (cea_db_is_hdmi_forum_vsdb(db) ||
> -- 
> 2.30.2

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-05-04 22:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03  9:23 [Intel-gfx] [PATCH v2 00/20] drm/edid: CEA data block iterators, and more Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 01/20] drm/edid: reset display info in drm_add_edid_modes() for NULL edid Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 02/20] drm/edid: check for HF-SCDB block Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 03/20] drm/edid: rename HDMI Forum VSDB to SCDS Jani Nikula
2022-05-04 21:45   ` Ville Syrjälä
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 04/20] drm/edid: clean up CTA data block tag definitions Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 05/20] drm/edid: add iterator for EDID base and extension blocks Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 06/20] drm/edid: add iterator for CTA data blocks Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 07/20] drm/edid: clean up cea_db_is_*() functions Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 08/20] drm/edid: convert add_cea_modes() to use cea db iter Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 09/20] drm/edid: convert drm_edid_to_speaker_allocation() " Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 10/20] drm/edid: convert drm_edid_to_sad() " Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 11/20] drm/edid: convert drm_detect_hdmi_monitor() " Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 12/20] drm/edid: convert drm_detect_monitor_audio() " Jani Nikula
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 13/20] drm/edid: convert drm_parse_cea_ext() " Jani Nikula
2022-05-04 22:14   ` Ville Syrjälä
2022-05-03  9:23 ` [Intel-gfx] [PATCH v2 14/20] drm/edid: convert drm_edid_to_eld() " Jani Nikula
2022-05-03  9:24 ` [Intel-gfx] [PATCH v2 15/20] drm/edid: sunset the old unused cea data block iterators Jani Nikula
2022-05-03  9:24 ` [Intel-gfx] [PATCH v2 16/20] drm/edid: restore some type safety to cea_db_*() functions Jani Nikula
2022-05-03  9:24 ` [Intel-gfx] [PATCH v2 17/20] drm/edid: detect basic audio in all CEA extensions Jani Nikula
2022-05-03  9:24 ` [Intel-gfx] [PATCH v2 18/20] drm/edid: detect color formats and CTA revision in all CTA extensions Jani Nikula
2022-05-04 22:11   ` Ville Syrjälä [this message]
2022-05-05 10:53     ` Jani Nikula
2022-05-05 10:52   ` [Intel-gfx] [PATCH v3] " Jani Nikula
2022-05-05 14:32     ` Ville Syrjälä
2022-05-03  9:24 ` [Intel-gfx] [PATCH v2 19/20] drm/edid: skip CTA extension scan in drm_edid_to_eld() just for CTA rev Jani Nikula
2022-05-03  9:24 ` [Intel-gfx] [PATCH v2 20/20] drm/edid: sunset drm_find_cea_extension() Jani Nikula
2022-05-03 12:35 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: CEA data block iterators, and more (rev3) Patchwork
2022-05-03 12:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-04  8:10 ` [Intel-gfx] [PATCH v2 00/20] drm/edid: CEA data block iterators, and more Jani Nikula
2022-05-04 10:49 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/edid: CEA data block iterators, and more (rev3) Patchwork
2022-05-04 22:30 ` [Intel-gfx] [PATCH v2 00/20] drm/edid: CEA data block iterators, and more Ville Syrjälä
2022-05-05 17:40   ` Jani Nikula
2022-05-05 12:23 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: CEA data block iterators, and more (rev4) Patchwork
2022-05-05 12:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-05 14:54 ` [Intel-gfx] ✓ 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=YnL6CGr+RqDiLr1A@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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