[PATCH v4 07/14] drm/amd/display: get SADB from drm_eld when parsing EDID caps

Mario Limonciello mario.limonciello at amd.com
Fri Jun 13 18:50:07 UTC 2025


On 6/13/2025 9:58 AM, Melissa Wen wrote:
> drm_edid_connector_update() updates display info, filling ELD with
> speaker allocation data in the last step of update_dislay_info(). Our
> goal is stopping using raw edid, so we can extract SADB from drm_eld
> instead of access raw edid to get audio caps.
> 
> Signed-off-by: Melissa Wen <mwen at igalia.com>
Reviewed-by: Mario Limonciello <mario.limonciello at amd.com>
> ---
>   .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 15 +++------------
>   1 file changed, 3 insertions(+), 12 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 10af9db47c39..e7cfbee6c67f 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
> @@ -106,9 +106,8 @@ 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;
> -	int sad_count, sadb_count;
> +	int sad_count;
>   	int i = 0;
> -	uint8_t *sadb = NULL;
>   	enum dc_edid_status result = EDID_OK;
>   
>   
> @@ -156,19 +155,11 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
>   		edid_caps->audio_modes[i].sample_size = sad.byte2;
>   	}
>   
> -	sadb_count = drm_edid_to_speaker_allocation((struct edid *) edid->raw_edid, &sadb);
> -
> -	if (sadb_count < 0) {
> -		DRM_ERROR("Couldn't read Speaker Allocation Data Block: %d\n", sadb_count);
> -		sadb_count = 0;
> -	}
> -
> -	if (sadb_count)
> -		edid_caps->speaker_flags = sadb[0];
> +	if (connector->eld[DRM_ELD_SPEAKER])
> +		edid_caps->speaker_flags = connector->eld[DRM_ELD_SPEAKER];
>   	else
>   		edid_caps->speaker_flags = DEFAULT_SPEAKER_LOCATION;
>   
> -	kfree(sadb);
>   	drm_edid_free(drm_edid);
>   
>   	return result;



More information about the dri-devel mailing list