AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Melissa Wen <mwen@igalia.com>, Alex Hung <alex.hung@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Rodrigo Siqueira <siqueira@igalia.com>,
	harry.wentland@amd.com, sunpeng.li@amd.com,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	airlied@gmail.com, simona@ffwll.ch
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	kernel-dev@igalia.com
Subject: Re: [PATCH 03/13] drm/amd/display: parse display name from drm_eld
Date: Mon, 14 Apr 2025 13:10:16 +0300	[thread overview]
Message-ID: <87fribt5o7.fsf@intel.com> (raw)
In-Reply-To: <20250411201333.151335-4-mwen@igalia.com>

On Fri, 11 Apr 2025, Melissa Wen <mwen@igalia.com> wrote:
> We don't need to parse dc_edid to get the display name since it's
> already set in drm_eld which in turn had it values updated when updating
> connector with the opaque drm_edid.
>
> Signed-off-by: Melissa Wen <mwen@igalia.com>
> ---
>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 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 e93adb7e48a5..faea6b7fb3f3 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
> @@ -34,7 +34,7 @@
>  #include <drm/amdgpu_drm.h>
>  #include <drm/drm_edid.h>
>  #include <drm/drm_fixed.h>
> -
> +#include <drm/drm_eld.h>
>  #include "dm_services.h"
>  #include "amdgpu.h"
>  #include "dc.h"
> @@ -90,6 +90,7 @@ static void apply_edid_quirks(struct drm_device *dev, struct edid *edid, struct
>  	}
>  }
>  
> +#define AMDGPU_ELD_DISPLAY_NAME_SIZE_IN_CHARS 13
>  /**
>   * dm_helpers_parse_edid_caps() - Parse edid caps
>   *
> @@ -132,9 +133,10 @@ 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,
> -				  edid_caps->display_name,
> -				  AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS);
> +	memset(edid_caps->display_name, 0, AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS);
> +	memcpy(edid_caps->display_name,
> +	       &connector->eld[DRM_ELD_MONITOR_NAME_STRING],
> +	       AMDGPU_ELD_DISPLAY_NAME_SIZE_IN_CHARS);

It's not that simple. The monitor name in ELD is not fixed length (see
drm_eld_mnl()) and neither is it guaranteed to be NUL terminated.

BR,
Jani.


>  
>  	edid_caps->edid_hdmi = connector->display_info.is_hdmi;

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-04-14 10:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 20:08 [PATCH 00/13] drm/amd/display: more drm_edid to AMD display driver Melissa Wen
2025-04-11 20:08 ` [PATCH 01/13] drm/amd/display: make sure drm_edid stored in aconnector doesn't leak Melissa Wen
2025-04-14 18:24   ` Mario Limonciello
2025-04-11 20:08 ` [PATCH 02/13] drm/amd/display: use drm_edid_product_id for parsing EDID product info Melissa Wen
2025-04-15  9:32   ` Michel Dänzer
2025-04-17 13:27     ` Melissa Wen
2025-04-17 13:57       ` Michel Dänzer
2025-04-11 20:08 ` [PATCH 03/13] drm/amd/display: parse display name from drm_eld Melissa Wen
2025-04-14 10:10   ` Jani Nikula [this message]
2025-04-17 13:46     ` Melissa Wen
2025-04-11 20:08 ` [PATCH 04/13] drm/amd/display: get panel id with drm_edid helper Melissa Wen
2025-04-11 20:08 ` [PATCH 05/13] drm/amd/display: get SAD from drm_eld when parsing EDID caps Melissa Wen
2025-04-11 20:08 ` [PATCH 06/13] drm/amd/display: get SADB " Melissa Wen
2025-04-11 20:08 ` [PATCH 07/13] drm/amd/display: simplify dm_helpers_parse_edid_caps signature Melissa Wen
2025-04-15 10:28   ` kernel test robot
2025-04-11 20:08 ` [PATCH 08/13] drm/amd/display: change DC functions to accept private types for edid Melissa Wen
2025-04-11 20:08 ` [PATCH 09/13] drm/amd/display: add a mid-layer file to handle EDID in DC Melissa Wen
2025-04-11 20:08 ` [PATCH 10/13] drm/amd/display: create a function to fill dc_sink with edid data Melissa Wen
2025-04-11 20:08 ` [PATCH 12/13] drm/amd/display: add drm_edid to dc_sink Melissa Wen
2025-04-11 20:08 ` [PATCH 13/13] drm/amd/display: move dc_sink from dc_edid to drm_edid Melissa Wen
2025-04-14 10:20   ` Jani Nikula

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=87fribt5o7.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=kernel-dev@igalia.com \
    --cc=mario.limonciello@amd.com \
    --cc=mwen@igalia.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox