All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Mario Limonciello <mario.limonciello@amd.com>,
	Alexander Deucher <alexander.deucher@amd.com>,
	Melissa Wen <mwen@igalia.com>
Cc: kernel-dev@igalia.com, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, harry.wentland@amd.com,
	sunpeng.li@amd.com, Mark Pearson <mpearson-lenovo@squebb.ca>,
	"Wheeler, Daniel" <Daniel.Wheeler@amd.com>
Subject: Re: [PATCH v7 09/10] drm/amd/display: remove dc_edid handler from dm_helpers_parse_edid_caps
Date: Wed, 25 Sep 2024 11:06:37 -0600	[thread overview]
Message-ID: <5bbaeac3-7916-4e75-9c92-b93e2cd78ff5@amd.com> (raw)
In-Reply-To: <20240918213845.158293-10-mario.limonciello@amd.com>

Mario and Melissa,

This patch causes a regrerssion on 7900 XTX in an IGT test: 
amd_mem_leak's connector-suspend-resume.

Is this patch necessary on this series or is it independent from other 
patches, i.e. can it be dropped from this series until fixed??

Cheers,
Alex Hung

On 9/18/24 15:38, Mario Limonciello wrote:
> From: Melissa Wen <mwen@igalia.com>
> 
> We can parse edid caps from drm_edid and drm_eld and any calls of
> dm_helpers_parse_edid_caps is made in a state that we have drm_edid set
> to amdgpu connector.
> 
> Signed-off-by: Melissa Wen <mwen@igalia.com>
> Co-developed-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  5 +---
>   .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 30 ++++++++-----------
>   drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  1 -
>   .../drm/amd/display/dc/link/link_detection.c  |  6 ++--
>   4 files changed, 16 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index bd8fb9968c7c..bf847ac55475 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7123,10 +7123,7 @@ static void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
>   		memset(&dc_em_sink->edid_caps, 0, sizeof(struct dc_edid_caps));
>   		memmove(dc_em_sink->dc_edid.raw_edid, edid,
>   			(edid->extensions + 1) * EDID_LENGTH);
> -		dm_helpers_parse_edid_caps(
> -			dc_link,
> -			&dc_em_sink->dc_edid,
> -			&dc_em_sink->edid_caps);
> +		dm_helpers_parse_edid_caps(dc_link, &dc_em_sink->edid_caps);
>   	}
>   }
>   
> 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 d43ed3ea000b..8f4be7a1ec45 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
> @@ -83,32 +83,24 @@ static void apply_edid_quirks(struct drm_edid_product_id *product_id,
>    * dm_helpers_parse_edid_caps() - Parse edid caps
>    *
>    * @link: current detected link
> - * @edid:	[in] pointer to edid
>    * @edid_caps:	[in] pointer to edid caps
>    *
>    * Return: void
>    */
> -enum dc_edid_status dm_helpers_parse_edid_caps(
> -		struct dc_link *link,
> -		const struct dc_edid *edid,
> -		struct dc_edid_caps *edid_caps)
> +enum dc_edid_status dm_helpers_parse_edid_caps(struct dc_link *link,
> +					       struct dc_edid_caps *edid_caps)
>   {
>   	struct amdgpu_dm_connector *aconnector = link->priv;
>   	struct drm_connector *connector = &aconnector->base;
>   	const struct drm_edid *drm_edid = aconnector->drm_edid;
>   	struct drm_edid_product_id product_id;
> -	struct edid *edid_buf = edid ? (struct edid *) edid->raw_edid : NULL;
>   	int sad_count;
>   	int i = 0;
> -
>   	enum dc_edid_status result = EDID_OK;
>   
> -	if (!edid_caps || !edid)
> +	if (!edid_caps || !drm_edid)
>   		return EDID_BAD_INPUT;
>   
> -	if (!drm_edid_is_valid(edid_buf))
> -		result = EDID_BAD_CHECKSUM;
> -
>   	drm_edid_get_product_id(drm_edid, &product_id);
>   
>   	edid_caps->manufacturer_id = le16_to_cpu(product_id.manufacturer_name);
> @@ -920,19 +912,23 @@ enum dc_edid_status dm_helpers_read_local_edid(
>   		if (!drm_edid)
>   			return EDID_NO_RESPONSE;
>   
> -		edid = drm_edid_raw(drm_edid); // FIXME: Get rid of drm_edid_raw()
> +		/* FIXME: Get rid of drm_edid_raw()
> +		 * Raw edid is still needed for dm_helpers_dp_write_dpcd()
> +		 */
> +		edid = drm_edid_raw(drm_edid);
>   		sink->dc_edid.length = EDID_LENGTH * (edid->extensions + 1);
>   		memmove(sink->dc_edid.raw_edid, (uint8_t *)edid, sink->dc_edid.length);
>   
>   		edid_status = dm_helpers_parse_edid_caps(
>   						link,
> -						&sink->dc_edid,
>   						&sink->edid_caps);
>   
> -		/* We don't need the original edid anymore */
> -		drm_edid_free(drm_edid);
> -
> -	} while (edid_status == EDID_BAD_CHECKSUM && --retry > 0);
> +		if (edid_status != EDID_OK) {
> +			/* We can discard the drm_edid and retry */
> +			drm_edid_free(drm_edid);
> +			drm_edid_connector_update(connector, drm_edid);
> +		}
> +	} while (edid_status != EDID_OK && --retry > 0);
>   
>   	if (edid_status != EDID_OK)
>   		DRM_ERROR("EDID err: %d, on connector: %s",
> diff --git a/drivers/gpu/drm/amd/display/dc/dm_helpers.h b/drivers/gpu/drm/amd/display/dc/dm_helpers.h
> index 2e4a46f1b499..4e1776b5f0d4 100644
> --- a/drivers/gpu/drm/amd/display/dc/dm_helpers.h
> +++ b/drivers/gpu/drm/amd/display/dc/dm_helpers.h
> @@ -61,7 +61,6 @@ void dm_helpers_free_gpu_mem(
>   
>   enum dc_edid_status dm_helpers_parse_edid_caps(
>   	struct dc_link *link,
> -	const struct dc_edid *edid,
>   	struct dc_edid_caps *edid_caps);
>   
>   
> diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> index d21ee9d12d26..94c911742dd3 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> @@ -1413,10 +1413,8 @@ struct dc_sink *link_add_remote_sink(
>   			dc_sink))
>   		goto fail_add_sink;
>   
> -	edid_status = dm_helpers_parse_edid_caps(
> -			link,
> -			&dc_sink->dc_edid,
> -			&dc_sink->edid_caps);
> +	edid_status = dm_helpers_parse_edid_caps(link,
> +						 &dc_sink->edid_caps);
>   
>   	/*
>   	 * Treat device as no EDID device if EDID


  reply	other threads:[~2024-09-25 17:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 21:38 [PATCH v7 00/10] drm/amd/display: Use drm_edid for more code Mario Limonciello
2024-09-18 21:38 ` [PATCH v7 01/10] drm/amd/display: switch amdgpu_dm_connector to use struct drm_edid Mario Limonciello
2024-09-18 21:38 ` [PATCH v7 02/10] drm/amd/display: switch to setting physical address directly Mario Limonciello
2024-09-18 21:38 ` [PATCH v7 03/10] drm/amd/display: always call connector_update when parsing freesync_caps Mario Limonciello
2024-09-18 21:38 ` [PATCH v7 04/10] drm/amd/display: remove redundant freesync parser for DP Mario Limonciello
2024-09-18 21:38 ` [PATCH v7 05/10] drm/amd/display: use drm_edid_product_id for parsing EDID product info Mario Limonciello
2024-09-18 21:38 ` [PATCH v7 06/10] drm/amd/display: parse display name from drm_eld Mario Limonciello
2024-09-18 21:38 ` [PATCH v7 07/10] drm/amd/display: get SAD from drm_eld when parsing EDID caps Mario Limonciello
2024-09-26 19:21   ` Alex Hung
2024-09-18 21:38 ` [PATCH v7 08/10] drm/amd/display: get SADB " Mario Limonciello
2024-09-18 21:38 ` [PATCH v7 09/10] drm/amd/display: remove dc_edid handler from dm_helpers_parse_edid_caps Mario Limonciello
2024-09-25 17:06   ` Alex Hung [this message]
2024-09-25 17:55     ` Mario Limonciello
2024-09-26 10:48       ` Melissa Wen
2024-09-18 21:38 ` [PATCH v7 10/10] drm/amd/display: Fetch the EDID from _DDC if available for eDP Mario Limonciello
2024-09-19 16:03   ` Alex Hung
2024-09-19 16:05     ` Mario Limonciello
2024-09-19 17:29       ` Alex Deucher
2024-09-19 17:36         ` Hamza Mahfooz
2024-09-19 18:14           ` Mario Limonciello
2024-09-27 18:48 ` [PATCH v7 00/10] drm/amd/display: Use drm_edid for more code Alex Hung
2024-09-27 20:45   ` Melissa Wen
2024-09-27 21:34     ` Alex Hung

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=5bbaeac3-7916-4e75-9c92-b93e2cd78ff5@amd.com \
    --to=alex.hung@amd.com \
    --cc=Daniel.Wheeler@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=kernel-dev@igalia.com \
    --cc=mario.limonciello@amd.com \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=mwen@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 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.