From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lee Shawn C <shawn.c.lee@intel.com>
Cc: jani.nikula@intel.com, ankit.k.nautiyal@intel.com,
dri-devel@lists.freedesktop.org
Subject: Re: [v4 5/5] drm/edid: check for HF-SCDB block
Date: Thu, 10 Mar 2022 12:49:58 +0200 [thread overview]
Message-ID: <YinX1pX56kZTJp4L@intel.com> (raw)
In-Reply-To: <20220302093511.30299-6-shawn.c.lee@intel.com>
On Wed, Mar 02, 2022 at 05:35:11PM +0800, Lee Shawn C wrote:
> Find HF-SCDB information in CEA extensions block. And retrieve
> Max_TMDS_Character_Rate that support by sink device.
>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 2b8ddc956ce2..d6b48c543c23 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3350,6 +3350,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> #define EXT_VIDEO_DATA_BLOCK_420 0x0E
> #define EXT_VIDEO_CAP_BLOCK_Y420CMDB 0x0F
> #define EXT_VIDEO_HF_EEODB_DATA_BLOCK 0x78
> +#define EXT_VIDEO_HF_SCDB_DATA_BLOCK 0x79
> #define EDID_BASIC_AUDIO (1 << 6)
> #define EDID_CEA_YCRCB444 (1 << 5)
> #define EDID_CEA_YCRCB422 (1 << 4)
> @@ -4277,6 +4278,20 @@ static bool cea_db_is_vcdb(const u8 *db)
> return true;
> }
>
> +static bool cea_db_is_hf_scdb(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (cea_db_payload_len(db) < 7)
> + return false;
> +
> + if (cea_db_extended_tag(db) != EXT_VIDEO_HF_SCDB_DATA_BLOCK)
> + return false;
> +
> + return true;
> +}
> +
> static bool cea_db_is_y420cmdb(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -4987,6 +5002,25 @@ static void drm_parse_vcdb(struct drm_connector *connector, const u8 *db)
> info->rgb_quant_range_selectable = true;
> }
>
> +static void drm_parse_hf_scdb(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_display_info *info = &connector->display_info;
> + u32 max_tmds_clock;
> +
> + DRM_DEBUG_KMS("HF-SCDB version 0x%02x\n", db[4]);
> +
> + max_tmds_clock = db[5] * 5000;
> + if (info->max_tmds_clock < max_tmds_clock) {
> + info->max_tmds_clock = max_tmds_clock;
> + DRM_DEBUG_KMS("HF-SCDB: max TMDS clock %d kHz\n",
> + info->max_tmds_clock);
> + }
> +
> + /*
> + * ToDo: Parse the remaining SCDB data if needed
> + */
If I'm reading the spec right this block should contain the exact same
stuff as the HF-VSDB. We should reuse the same code for parsing both.
> +}
> +
> static
> void drm_get_max_frl_rate(int max_frl_rate, u8 *max_lanes, u8 *max_rate_per_lane)
> {
> @@ -5282,6 +5316,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_y420cmdb_bitmap(connector, db);
> if (cea_db_is_vcdb(db))
> drm_parse_vcdb(connector, db);
> + if (cea_db_is_hf_scdb(db))
> + drm_parse_hf_scdb(connector, db);
> if (cea_db_is_hdmi_hdr_metadata_block(db))
> drm_parse_hdr_metadata_block(connector, db);
> }
> --
> 2.17.1
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2022-03-10 10:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 9:35 [v4 0/5] enhanced edid driver compatibility Lee Shawn C
2022-03-02 9:35 ` [v4 1/5] drm/edid: seek for available CEA block from specific EDID block index Lee Shawn C
2022-03-02 9:35 ` [v4 2/5] drm/edid: parse multiple CEA extension block Lee Shawn C
2022-03-10 10:49 ` Ville Syrjälä
2022-03-02 9:35 ` [v4 3/5] drm/edid: read HF-EEODB ext block Lee Shawn C
2022-03-02 9:35 ` [v4 4/5] drm/edid: parse HF-EEODB CEA extension block Lee Shawn C
2022-03-02 9:35 ` [v4 5/5] drm/edid: check for HF-SCDB block Lee Shawn C
2022-03-10 10:49 ` Ville Syrjälä [this message]
2022-03-10 14:32 ` Lee, Shawn C
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=YinX1pX56kZTJp4L@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=shawn.c.lee@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 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.