AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Melissa Wen <mwen@igalia.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	harry.wentland@amd.com, sunpeng.li@amd.com,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	airlied@gmail.com, simona@ffwll.ch, andrzej.hajda@intel.com,
	neil.armstrong@linaro.org, rfoss@kernel.org,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de
Cc: amd-gfx@lists.freedesktop.org, Alex Hung <alex.hung@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Rodrigo Siqueira <siqueira@igalia.com>,
	Michel Daenzer <michel.daenzer@mailbox.org>,
	dri-devel@lists.freedesktop.org, kernel-dev@igalia.com
Subject: Re: [PATCH v2 04/14] drm/edid: introduce a helper that gets monitor name from drm_edid
Date: Tue, 13 May 2025 18:42:25 -0300	[thread overview]
Message-ID: <40878305-ca14-41e1-a00a-7952560d6912@igalia.com> (raw)
In-Reply-To: <87selftjq2.fsf@intel.com>



On 08/05/2025 08:39, Jani Nikula wrote:
> On Tue, 06 May 2025, Melissa Wen <mwen@igalia.com> wrote:
>> Original drm_edid_get_monitor_name encapsulates raw edid in drm_edid and
>> then call get_monitor_name. AMD still stores the display name for
>> debugging, but it is migrating to drm_edid, on the other hand,
>> drm_dp_mst_topology and sil-sii8620 still use the raw edid version.
>>
>> Split drm_edid_get_monitor_name into two helpers, one that gets monitor
>> name from raw edid and another from drm_edid.
> Should mention that this is just a temporary thing, and should be
> removed later.
ok
>
>> Signed-off-by: Melissa Wen <mwen@igalia.com>
>> ---
>>   .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  2 +-
>>   drivers/gpu/drm/bridge/sil-sii8620.c          |  2 +-
>>   drivers/gpu/drm/display/drm_dp_mst_topology.c |  2 +-
>>   drivers/gpu/drm/drm_edid.c                    | 33 ++++++++++++++-----
>>   include/drm/drm_edid.h                        |  7 ++--
>>   5 files changed, 32 insertions(+), 14 deletions(-)
>>
>> 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 b1085f1195f7..514da4d5d300 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
>> @@ -134,7 +134,7 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
>>   	edid_caps->manufacture_week = product_id.week_of_manufacture;
>>   	edid_caps->manufacture_year = product_id.year_of_manufacture;
>>   
>> -	drm_edid_get_monitor_name(edid_buf,
>> +	drm_edid_get_monitor_name(drm_edid,
>>   				  edid_caps->display_name,
>>   				  AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS);
>>   
>> diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c
>> index 28a2e1ee04b2..c2d60b9c28fd 100644
>> --- a/drivers/gpu/drm/bridge/sil-sii8620.c
>> +++ b/drivers/gpu/drm/bridge/sil-sii8620.c
>> @@ -505,7 +505,7 @@ static void sii8620_identify_sink(struct sii8620 *ctx)
>>   	else
>>   		ctx->sink_type = SINK_DVI;
>>   
>> -	drm_edid_get_monitor_name(ctx->edid, sink_name, ARRAY_SIZE(sink_name));
>> +	drm_edid_raw_get_monitor_name(ctx->edid, sink_name, ARRAY_SIZE(sink_name));
>>   
>>   	dev_info(dev, "detected sink(type: %s): %s\n",
>>   		 sink_str[ctx->sink_type], sink_name);
>> diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
>> index 3a1f1ffc7b55..b17a602516ee 100644
>> --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
>> +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
>> @@ -4896,7 +4896,7 @@ static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr,
>>   	struct edid *mst_edid;
>>   
>>   	mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port);
>> -	drm_edid_get_monitor_name(mst_edid, name, namelen);
>> +	drm_edid_raw_get_monitor_name(mst_edid, name, namelen);
>>   	kfree(mst_edid);
>>   }
>>   
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 13bc4c290b17..6e4cffd467f1 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -5575,27 +5575,23 @@ static int get_monitor_name(const struct drm_edid *drm_edid, char name[13])
>>   }
>>   
>>   /**
>> - * drm_edid_get_monitor_name - fetch the monitor name from the edid
>> - * @edid: monitor EDID information
>> + * drm_edid_get_monitor_name - fetch the monitor name from the drm_edid
>> + * @drm_edid: EDID
>>    * @name: pointer to a character array to hold the name of the monitor
>>    * @bufsize: The size of the name buffer (should be at least 14 chars.)
>>    *
>>    */
>> -void drm_edid_get_monitor_name(const struct edid *edid, char *name, int bufsize)
>> +void drm_edid_get_monitor_name(const struct drm_edid *drm_edid, char *name, int bufsize)
>>   {
>>   	int name_length = 0;
>>   
>>   	if (bufsize <= 0)
>>   		return;
>>   
>> -	if (edid) {
>> +	if (drm_edid->edid) {
>>   		char buf[13];
>> -		struct drm_edid drm_edid = {
>> -			.edid = edid,
>> -			.size = edid_size(edid),
>> -		};
>>   
>> -		name_length = min(get_monitor_name(&drm_edid, buf), bufsize - 1);
>> +		name_length = min(get_monitor_name(drm_edid, buf), bufsize - 1);
>>   		memcpy(name, buf, name_length);
>>   	}
>>   
>> @@ -5603,6 +5599,25 @@ void drm_edid_get_monitor_name(const struct edid *edid, char *name, int bufsize)
>>   }
>>   EXPORT_SYMBOL(drm_edid_get_monitor_name);
>>   
>> +/**
>> + * drm_edid_raw_get_monitor_name - fetch the monitor name from raw edid
>> + * @edid: monitor EDID information
>> + * @name: pointer to a character array to hold the name of the monitor
>> + * @bufsize: The size of the name buffer (should be at least 14 chars.)
>> + *
> This should mention it's deprecated and all users should switch to
> drm_edid_get_monitor_name(). Nobody should be using this.
ok
>> + */
>> +void drm_edid_raw_get_monitor_name(const struct edid *edid, char *name, int bufsize)
>> +{
>> +	struct drm_edid drm_edid = {
>> +		.edid = edid,
>> +		.size = edid ? edid_size(edid) : 0,
>> +	};
>> +
> See drm_edid_legacy_init() and its use in this file. Should switch to
> that.
ack. thanks for point it out.
>
>> +	drm_edid_get_monitor_name(&drm_edid, name, bufsize);
>> +}
>> +EXPORT_SYMBOL(drm_edid_raw_get_monitor_name);
>> +
>> +
>>   static void clear_eld(struct drm_connector *connector)
>>   {
>>   	mutex_lock(&connector->eld_mutex);
>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>> index eaac5e665892..ceb522c4f4c2 100644
>> --- a/include/drm/drm_edid.h
>> +++ b/include/drm/drm_edid.h
>> @@ -441,8 +441,11 @@ int drm_add_modes_noedid(struct drm_connector *connector,
>>   
>>   int drm_edid_header_is_valid(const void *edid);
>>   bool drm_edid_is_valid(struct edid *edid);
>> -void drm_edid_get_monitor_name(const struct edid *edid, char *name,
>> -			       int buflen);
>> +void drm_edid_get_monitor_name(const struct drm_edid *drm_edid,
>> +			       char *name,
>> +			       int bufsize);
> Please move this under the section:
>
> /* Interface based on struct drm_edid */
>
> further down.
right.

Thanks for reviewing
>
>> +void drm_edid_raw_get_monitor_name(const struct edid *edid, char *name,
>> +				   int bufsize);
>>   struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
>>   					   int hsize, int vsize, int fresh,
>>   					   bool rb);


  reply	other threads:[~2025-05-13 21:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07  0:03 [PATCH v2 00/14] drm/amd/display: more drm_edid to AMD display driver Melissa Wen
2025-05-07  0:03 ` [PATCH v2 01/14] drm/amd/display: make sure drm_edid stored in aconnector doesn't leak Melissa Wen
2025-05-07  0:03 ` [PATCH v2 02/14] drm/amd/display: start using drm_edid helpers to parse EDID caps Melissa Wen
2025-05-07  0:03 ` [PATCH v2 03/14] drm/amd/display: use drm_edid_product_id for parsing EDID product info Melissa Wen
2025-05-07  0:03 ` [PATCH v2 04/14] drm/edid: introduce a helper that gets monitor name from drm_edid Melissa Wen
2025-05-08 11:39   ` Jani Nikula
2025-05-13 21:42     ` Melissa Wen [this message]
2025-05-07  0:03 ` [PATCH v2 05/14] drm/amd/display: get panel id with drm_edid helper Melissa Wen
2025-05-07  0:04 ` [PATCH v2 06/14] drm/amd/display: get SAD from drm_eld when parsing EDID caps Melissa Wen
2025-05-07  0:04 ` [PATCH v2 07/14] drm/amd/display: get SADB " Melissa Wen
2025-05-07  0:04 ` [PATCH v2 08/14] drm/amd/display: simplify dm_helpers_parse_edid_caps signature Melissa Wen
2025-05-07  0:04 ` [PATCH v2 09/14] drm/amd/display: change DC functions to accept private types for edid Melissa Wen
2025-05-07  0:04 ` [PATCH v2 10/14] drm/amd/display: add a mid-layer file to handle EDID in DC Melissa Wen
2025-05-07  0:04 ` [PATCH v2 11/14] drm/amd/display: create a function to fill dc_sink with edid data Melissa Wen
2025-05-08 11:41   ` Jani Nikula
2025-05-07  0:04 ` [PATCH v2 12/14] drm/edid: introduce a helper that compares edid data from two drm_edid Melissa Wen
2025-05-08 11:47   ` Jani Nikula
2025-05-13 21:45     ` Melissa Wen
2025-05-07  0:04 ` [PATCH v2 13/14] drm/amd/display: add drm_edid to dc_sink Melissa Wen
2025-05-08 11:50   ` Jani Nikula
2025-05-07  0:04 ` [PATCH v2 14/14] drm/amd/display: move dc_sink from dc_edid to drm_edid Melissa Wen

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=40878305-ca14-41e1-a00a-7952560d6912@igalia.com \
    --to=mwen@igalia.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrzej.hajda@intel.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=kernel-dev@igalia.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mario.limonciello@amd.com \
    --cc=michel.daenzer@mailbox.org \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=tzimmermann@suse.de \
    /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