AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: Melissa Wen <mwen@igalia.com>,
	Harry Wentland <harry.wentland@amd.com>,
	 Alex Hung <alex.hung@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Rodrigo Siqueira	 <siqueira@igalia.com>,
	airlied@gmail.com, alexander.deucher@amd.com,
		andrzej.hajda@intel.com, christian.koenig@amd.com,
	jernej.skrabec@gmail.com, 	jonas@kwiboo.se,
	Laurent.pinchart@ideasonboard.com,
		maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	neil.armstrong@linaro.org, 	rfoss@kernel.org, simona@ffwll.ch,
	sunpeng.li@amd.com, tzimmermann@suse.de
Cc: Michel Daenzer <michel.daenzer@mailbox.org>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	amd-gfx@lists.freedesktop.org,  dri-devel@lists.freedesktop.org,
	kernel-dev@igalia.com
Subject: Re: [PATCH v7 07/15] drm/amd/display: get SAD from drm_eld when parsing EDID caps
Date: Tue, 11 Nov 2025 14:47:15 +0100	[thread overview]
Message-ID: <34b8e7bdc34003cf82c1d660ad949abb8901f99a.camel@gmail.com> (raw)
In-Reply-To: <20251106165536.161662-8-mwen@igalia.com>

On Thu, 2025-11-06 at 13:49 -0300, Melissa Wen wrote:
> drm_edid_connector_update() updates display info, filling ELD with
> audio
> info from Short-Audio Descriptors in the last step of
> update_dislay_info(). Our goal is stopping using raw edid, so we can
> extract SAD from drm_eld instead of access raw edid to get audio
> caps.
> 
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Melissa Wen <mwen@igalia.com>

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>

> ---
>  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 22 ++++++++++-------
> --
>  1 file changed, 12 insertions(+), 10 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 c055841c3a8f..4333b02dc552 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,6 +34,7 @@
>  #include <drm/drm_probe_helper.h>
>  #include <drm/amdgpu_drm.h>
>  #include <drm/drm_edid.h>
> +#include <drm/drm_eld.h>
>  #include <drm/drm_fixed.h>
>  
>  #include "dm_services.h"
> @@ -107,9 +108,7 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
>  	struct edid *edid_buf = edid ? (struct edid *) edid-
> >raw_edid : NULL;
>  	const struct drm_edid *drm_edid;
>  	struct drm_edid_product_id product_id;
> -	struct cea_sad *sads;
> -	int sad_count = -1;
> -	int sadb_count = -1;
> +	int sad_count, sadb_count;
>  	int i = 0;
>  	uint8_t *sadb = NULL;
>  	enum dc_edid_status result = EDID_OK;
> @@ -123,6 +122,7 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
>  	if (!drm_edid_valid(drm_edid))
>  		result = EDID_BAD_CHECKSUM;
>  
> +	drm_edid_connector_update(connector, drm_edid);
>  	drm_edid_get_product_id(drm_edid, &product_id);
>  
>  	edid_caps->manufacturer_id = product_id.manufacturer_name;
> @@ -140,7 +140,7 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
>  
>  	apply_edid_quirks(dev, drm_edid, edid_caps);
>  
> -	sad_count = drm_edid_to_sad((struct edid *) edid->raw_edid,
> &sads);
> +	sad_count = drm_eld_sad_count(connector->eld);
>  	if (sad_count <= 0) {
>  		drm_edid_free(drm_edid);
>  		return result;
> @@ -148,12 +148,15 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
>  
>  	edid_caps->audio_mode_count = min(sad_count,
> DC_MAX_AUDIO_DESC_COUNT);
>  	for (i = 0; i < edid_caps->audio_mode_count; ++i) {
> -		struct cea_sad *sad = &sads[i];
> +		struct cea_sad sad;
>  
> -		edid_caps->audio_modes[i].format_code = sad->format;
> -		edid_caps->audio_modes[i].channel_count = sad-
> >channels + 1;
> -		edid_caps->audio_modes[i].sample_rate = sad->freq;
> -		edid_caps->audio_modes[i].sample_size = sad->byte2;
> +		if (drm_eld_sad_get(connector->eld, i, &sad) < 0)
> +			continue;
> +
> +		edid_caps->audio_modes[i].format_code = sad.format;
> +		edid_caps->audio_modes[i].channel_count =
> sad.channels + 1;
> +		edid_caps->audio_modes[i].sample_rate = sad.freq;
> +		edid_caps->audio_modes[i].sample_size = sad.byte2;
>  	}
>  
>  	sadb_count = drm_edid_to_speaker_allocation((struct edid *)
> edid->raw_edid, &sadb);
> @@ -168,7 +171,6 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
>  	else
>  		edid_caps->speaker_flags = DEFAULT_SPEAKER_LOCATION;
>  
> -	kfree(sads);
>  	kfree(sadb);
>  	drm_edid_free(drm_edid);
>  

  reply	other threads:[~2025-11-11 13:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06 16:49 [PATCH v7 00/15] drm/amd/display: more drm_edid to AMD display driver Melissa Wen
2025-11-06 16:49 ` [PATCH v7 01/15] drm/amd/display: make sure drm_edid stored in aconnector doesn't leak Melissa Wen
2025-11-06 16:49 ` [PATCH v7 02/15] drm/amd/display: start using drm_edid helpers to parse EDID caps Melissa Wen
2025-11-11 13:40   ` Timur Kristóf
2025-11-06 16:49 ` [PATCH v7 03/15] drm/amd/display: use drm_edid_product_id for parsing EDID product info Melissa Wen
2025-11-12 15:45   ` Mario Limonciello
2025-11-06 16:49 ` [PATCH v7 04/15] drm/amd/display: use drm_edid helper to set analog EDID caps Melissa Wen
2025-11-11 13:38   ` Timur Kristóf
2025-11-12 15:46   ` Mario Limonciello
2025-11-06 16:49 ` [PATCH v7 05/15] drm/edid: introduce a helper that gets monitor name from drm_edid Melissa Wen
2025-11-06 16:49 ` [PATCH v7 06/15] drm/amd/display: get panel id with drm_edid helper Melissa Wen
2025-11-11 13:46   ` Timur Kristóf
2025-11-06 16:49 ` [PATCH v7 07/15] drm/amd/display: get SAD from drm_eld when parsing EDID caps Melissa Wen
2025-11-11 13:47   ` Timur Kristóf [this message]
2025-11-06 16:49 ` [PATCH v7 08/15] drm/amd/display: get SADB " Melissa Wen
2025-11-06 16:49 ` [PATCH v7 09/15] drm/amd/display: simplify dm_helpers_parse_edid_caps signature Melissa Wen
2025-11-06 16:49 ` [PATCH v7 10/15] drm/amd/display: change DC functions to accept private types for edid Melissa Wen
2025-11-06 16:49 ` [PATCH v7 11/15] drm/amd/display: add DM helpers to handle EDID in DC via drm_edid helpers Melissa Wen
2025-11-06 16:49 ` [PATCH v7 12/15] drm/amd/display: create a function to fill dc_sink with edid data Melissa Wen
2025-11-06 16:49 ` [PATCH v7 13/15] drm/edid: introduce a helper that compares edid data from two drm_edid Melissa Wen
2025-11-06 16:49 ` [PATCH v7 14/15] drm/amd/display: add drm_edid to dc_sink Melissa Wen
2025-11-11 13:44   ` Timur Kristóf
2025-11-06 16:49 ` [PATCH v7 15/15] 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=34b8e7bdc34003cf82c1d660ad949abb8901f99a.camel@gmail.com \
    --to=timur.kristof@gmail.com \
    --cc=Laurent.pinchart@ideasonboard.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=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --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=mwen@igalia.com \
    --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