From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: amd-gfx@lists.freedesktop.org, Chenyu Chen <chen-yu.chen@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>,
Leo Li <sunpeng.li@amd.com>,
Aurabindo Pillai <aurabindo.pillai@amd.com>,
Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
Tom Chung <chiahsuan.chung@amd.com>,
Fangzhi Zuo <jerry.zuo@amd.com>,
Dan Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
Ivan Lipski <ivan.lipski@amd.com>, Alex Hung <alex.hung@amd.com>,
James Lin <PingLei.Lin@amd.com>,
Chenyu Chen <Chen-Yu.Chen@amd.com>,
Fangzhi Zuo <Jerry.Zuo@amd.com>,
Chenyu Chen <chen-yu.chen@amd.com>
Subject: Re: [PATCH 16/32] drm/amd/display: Add Support for HDMI Compliance Automation
Date: Wed, 10 Jun 2026 16:43:37 +0200 [thread overview]
Message-ID: <nGLVvJOTS8eSI7IusBrUxw@collabora.com> (raw)
In-Reply-To: <20260610094639.1965367-17-chen-yu.chen@amd.com>
On Wednesday, 10 June 2026 11:45:00 Central European Summer Time Chenyu Chen wrote:
> From: Fangzhi Zuo <Jerry.Zuo@amd.com>
>
> Add support to get DUT trained at FRL link rate when working with
> Teledyne M41h compliance automation.
>
> Reviewed-by: Alex Hung <alex.hung@amd.com>
> Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com>
> Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
> ---
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 +
> .../display/amdgpu_dm/amdgpu_dm_connector.c | 5 ++
> .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 67 ++++++++++++++++++-
> .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 6 ++
> 4 files changed, 80 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> index 2940dd5b7348..ba1e11e144f2 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> @@ -877,6 +877,9 @@ struct amdgpu_dm_connector {
> unsigned int hdmi_hpd_debounce_delay_ms;
> struct delayed_work hdmi_hpd_debounce_work;
> struct dc_sink *hdmi_prev_sink;
> +
> + /* HDMI compliance automation */
> + bool hdmi_comp_auto;
> };
>
> static inline void amdgpu_dm_set_mst_status(uint8_t *status,
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> index 6ef257622f1a..59091ee32099 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> @@ -573,6 +573,11 @@ void amdgpu_dm_update_connector_after_detect(
> amdgpu_dm_update_freesync_caps(connector, aconnector->drm_edid, true);
> amdgpu_dm_update_connector_ext_caps(aconnector);
> dm_set_panel_type(aconnector);
> +
> + if (aconnector->hdmi_comp_auto) {
> + if (sink->sink_signal != SIGNAL_TYPE_HDMI_FRL)
> + sink->sink_signal = SIGNAL_TYPE_HDMI_FRL;
> + }
> } else {
> hdmi_cec_unset_edid(aconnector);
> drm_dp_cec_unset_edid(&aconnector->dm_dp_aux.aux);
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index 096a855a7304..95a56e39f452 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -2982,6 +2982,64 @@ static ssize_t hdmi_cec_state_write(struct file *f, const char __user *buf,
> return size;
> }
>
> +/**
> + * hdmi_automation_enable - Enable/Disable HDMI automation feature
> + * @f: file structure.
> + * @buf: userspace buffer. set to '1' to enable; '0' to disable automation feature.
> + * @size: size of buffer from userpsace.
> + * @pos: unused.
> + *
> + * Return size on success, error code on failure
> + */
> +static ssize_t hdmi_automation_enable(struct file *f, const char __user *buf,
> + size_t size, loff_t *pos)
> +{
> + struct amdgpu_dm_connector *aconnector = file_inode(f)->i_private;
> + char *wr_buf = NULL;
> + const uint32_t wr_buf_size = 40;
> + int max_param_num = 1;
> + uint8_t param_nums = 0;
> + long param[2];
> + bool hdmi_comp_auto;
> +
> + if (size == 0)
> + return -EINVAL;
> +
> + wr_buf = kcalloc(wr_buf_size, sizeof(char), GFP_KERNEL);
> + if (!wr_buf)
> + return -ENOSPC;
> +
> + if (parse_write_buffer_into_params(wr_buf, wr_buf_size,
> + (long *)param, buf,
> + max_param_num,
> + ¶m_nums)) {
> + kfree(wr_buf);
> + return -EINVAL;
> + }
> +
> + if (param_nums <= 0) {
> + kfree(wr_buf);
> + DRM_DEBUG_DRIVER("user data not be read\n");
> + return -EINVAL;
> + }
> +
> + switch (param[0]) {
> + case 0:
> + hdmi_comp_auto = false;
> + break;
> + case 1:
> + default:
> + hdmi_comp_auto = true;
> + break;
> + }
> +
> + /* Persist setting across sink re-detection/hotplug. */
> + aconnector->hdmi_comp_auto = hdmi_comp_auto;
> +
> + kfree(wr_buf);
> + return size;
> +}
> +
> DEFINE_SHOW_ATTRIBUTE(dp_dsc_fec_support);
> DEFINE_SHOW_ATTRIBUTE(dmub_fw_state);
> DEFINE_SHOW_ATTRIBUTE(dmub_tracebuffer);
> @@ -3099,6 +3157,12 @@ static const struct file_operations dp_mst_link_settings_debugfs_fops = {
> .llseek = default_llseek
> };
>
> +static const struct file_operations hdmi_automation_debugfs_fops = {
> + .owner = THIS_MODULE,
> + .write = hdmi_automation_enable,
> + .llseek = default_llseek
> +};
> +
I really don't understand why this can't just be a DEFINE_DEBUGFS_ATTRIBUTE,
and then you can replace the overcomplicated hdmi_automation_enable() with
just simple setter and getter functions that already receive the parameter
of the right type.
> static const struct {
> char *name;
> const struct file_operations *fops;
> @@ -3131,7 +3195,8 @@ static const struct {
> const struct file_operations *fops;
> } hdmi_debugfs_entries[] = {
> {"hdcp_sink_capability", &hdcp_sink_capability_fops},
> - {"hdmi_cec_state", &hdmi_cec_state_fops}
> + {"hdmi_cec_state", &hdmi_cec_state_fops},
> + {"hdmi_automation", &hdmi_automation_debugfs_fops}
> };
>
> /*
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index a2d0bb34e639..6350212b9a66 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> @@ -193,6 +193,12 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
> __func__, connector->name, edid_caps->frl_dsc_10bpc, edid_caps->frl_dsc_12bpc, \
> edid_caps->frl_dsc_all_bpp, edid_caps->frl_dsc_native_420, edid_caps->frl_dsc_max_slices, \
> edid_caps->frl_dsc_max_frl_rate, edid_caps->frl_dsc_total_chunk_kbytes);
> + if (aconnector->hdmi_comp_auto) {
> + edid_caps->panel_patch.hdmi_comp_auto = true;
> + link->ctx->dc->debug.force_frl_max = true;
> + link->ctx->dc->debug.force_frl_dsc = true;
> + drm_dbg_driver(connector->dev, "%s: HDMI_FRL [%s] hdmi_comp_auto --> enabled\n", __func__, connector->name);
> + }
> }
>
> apply_edid_quirks(link, edid_buf, edid_caps);
>
next prev parent reply other threads:[~2026-06-11 10:49 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 9:44 [PATCH 00/32] DC Patches Jun 15 2026 Chenyu Chen
2026-06-10 9:44 ` [PATCH 01/32] drm/amd/display: Increase dcn42b uclk value Chenyu Chen
2026-06-10 9:44 ` [PATCH 02/32] drm/amd/display: Add a new interface to set idle opts in clock manager Chenyu Chen
2026-06-10 9:44 ` [PATCH 03/32] drm/amd/display: Add utm_qos_model pointer to clk_bw_params Chenyu Chen
2026-06-10 9:44 ` [PATCH 04/32] drm/amd/display: Remove get_utm_qos_model from soc_and_ip_translator Chenyu Chen
2026-06-10 9:44 ` [PATCH 05/32] drm/amd/display: Remove unused project_id from DML2 core instance Chenyu Chen
2026-06-10 9:44 ` [PATCH 06/32] drm/amd/display: Introduce dc_plane_cm and migrate surface update color path Chenyu Chen
2026-06-10 9:44 ` [PATCH 07/32] drm/amd/display: Extract backlight code to amdgpu_dm_backlight Chenyu Chen
2026-06-10 9:44 ` [PATCH 08/32] drm/amd/display: Extract audio code to amdgpu_dm_audio Chenyu Chen
2026-06-10 9:44 ` [PATCH 09/32] drm/amd/display: Extract DMUB code to amdgpu_dm_dmub Chenyu Chen
2026-06-10 9:44 ` [PATCH 10/32] drm/amd/display: Move HPD and IRQ handler code to amdgpu_dm_irq Chenyu Chen
2026-06-10 9:44 ` [PATCH 11/32] drm/amd/display: Extract connector and encoder code to amdgpu_dm_connector Chenyu Chen
2026-06-10 9:44 ` [PATCH 12/32] drm/amd/display: Fix conflicting types for dc_plane_cm functions Chenyu Chen
2026-06-10 9:44 ` [PATCH 13/32] drm/amd/display: Add PSR Active VTotal Control capability Chenyu Chen
2026-06-10 9:44 ` [PATCH 14/32] drm/amd/display: Enable pstate for DCN4 non-emulation builds Chenyu Chen
2026-06-10 9:44 ` [PATCH 15/32] drm/amd/display: Refactor surface_update_flags to flat struct with helpers Chenyu Chen
2026-06-10 9:45 ` [PATCH 16/32] drm/amd/display: Add Support for HDMI Compliance Automation Chenyu Chen
2026-06-10 14:43 ` Nicolas Frattaroli [this message]
2026-07-20 13:14 ` Nicolas Frattaroli
2026-07-21 2:27 ` Chen, Chen-Yu
2026-07-21 2:09 ` Chen, Chen-Yu
2026-06-10 9:45 ` [PATCH 17/32] drm/amd/display: Add KUnit tests for amdgpu_dm Chenyu Chen
2026-06-10 9:45 ` [PATCH 18/32] drm/amd/display: Add KUnit tests for amdgpu_dm_backlight Chenyu Chen
2026-06-10 9:45 ` [PATCH 19/32] drm/amd/display: Add KUnit tests for amdgpu_dm_audio Chenyu Chen
2026-06-10 9:45 ` [PATCH 20/32] drm/amd/display: Add KUnit tests for amdgpu_dm_dmub Chenyu Chen
2026-06-10 9:45 ` [PATCH 21/32] drm/amd/display: Add KUnit tests for amdgpu_dm_connector Chenyu Chen
2026-06-10 9:45 ` [PATCH 22/32] drm/amd/display: Add KUnit tests for amdgpu_dm_irq Chenyu Chen
2026-06-10 9:45 ` [PATCH 23/32] drm/amd/display: Add KUnit tests for amdgpu_dm_crtc Chenyu Chen
2026-06-10 9:45 ` [PATCH 24/32] drm/amd/display: Add KUnit tests for amdgpu_dm_services Chenyu Chen
2026-06-10 9:45 ` [PATCH 25/32] drm/amd/display: Add KUnit tests for amdgpu_dm_helpers Chenyu Chen
2026-06-10 9:45 ` [PATCH 26/32] drm/amd/display: Add KUnit tests for amdgpu_dm_quirks Chenyu Chen
2026-06-10 9:45 ` [PATCH 27/32] drm/amd/display: Add more KUnit tests for amdgpu_dm_pp_smu Chenyu Chen
2026-06-10 9:45 ` [PATCH 28/32] drm/amd/display: Add more KUnit tests for amdgpu_dm_mst_types Chenyu Chen
2026-06-10 9:45 ` [PATCH 29/32] drm/amd/display: Set default backlight without ACPI support Chenyu Chen
2026-06-10 9:45 ` [PATCH 30/32] drm/amd/display: Move backlight macros to backlight header Chenyu Chen
2026-06-10 9:45 ` [PATCH 31/32] drm/amd/display: [FW Promotion] Release 0.1.63.0 Chenyu Chen
2026-06-10 9:45 ` [PATCH 32/32] drm/amd/display: Promote DC to 3.2.386 Chenyu Chen
2026-06-15 13:11 ` [PATCH 00/32] DC Patches Jun 15 2026 Wheeler, Daniel
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=nGLVvJOTS8eSI7IusBrUxw@collabora.com \
--to=nicolas.frattaroli@collabora.com \
--cc=PingLei.Lin@amd.com \
--cc=Ray.Wu@amd.com \
--cc=alex.hung@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=chen-yu.chen@amd.com \
--cc=chiahsuan.chung@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=harry.wentland@amd.com \
--cc=ivan.lipski@amd.com \
--cc=jerry.zuo@amd.com \
--cc=roman.li@amd.com \
--cc=sunpeng.li@amd.com \
--cc=wayne.lin@amd.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.