dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/edid: fixed the bug that hdr metadata was not cleared
       [not found] <CGME20250416093607epcms5p344bcffd7430fe5e30ef9b73db73f7388@epcms5p3>
@ 2025-04-16  9:36 ` 李飞娟
  2025-04-17  8:17   ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: 李飞娟 @ 2025-04-16  9:36 UTC (permalink / raw)
  To: jingoohan1@gmail.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	simona@ffwll.ch, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
  Cc: 唐红飞, 严明贵

From a34a1e2dd7aacd45f18775564fce12b03ae4009c Mon Sep 17 00:00:00 2001
From: "feijuan.li" <feijuan.li@samsung.com>
Date: Wed, 16 Apr 2025 11:07:39 +0000
Subject: [PATCH] drm/edid: fixed the bug that hdr metadata was not cleared

When DP connected to a device with HDR capability,
the hdr structure was filled.Then connected to another
sink device without hdr capability, but the hdr info
still exist.

Signed-off-by: feijuan.li <feijuan.li@samsung.com>
---
 drivers/gpu/drm/drm_edid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 13bc4c290b17..5cf5d30321b6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -5607,6 +5607,7 @@ static void clear_eld(struct drm_connector *connector)
 {
 	mutex_lock(&connector->eld_mutex);
 	memset(connector->eld, 0, sizeof(connector->eld));
+	memset(&connector->hdr_sink_metadata, 0, sizeof(connector->hdr_sink_metadata));
 	mutex_unlock(&connector->eld_mutex);
 
 	connector->latency_present[0] = false;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/edid: fixed the bug that hdr metadata was not cleared
  2025-04-16  9:36 ` [PATCH] drm/edid: fixed the bug that hdr metadata was not cleared 李飞娟
@ 2025-04-17  8:17   ` Jani Nikula
  2025-04-21  6:49     ` 李飞娟
  0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2025-04-17  8:17 UTC (permalink / raw)
  To: feijuan.li, jingoohan1@gmail.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
  Cc: 唐红飞, 严明贵

On Wed, 16 Apr 2025, 李飞娟 <feijuan.li@samsung.com> wrote:
> From a34a1e2dd7aacd45f18775564fce12b03ae4009c Mon Sep 17 00:00:00 2001
> From: "feijuan.li" <feijuan.li@samsung.com>
> Date: Wed, 16 Apr 2025 11:07:39 +0000
> Subject: [PATCH] drm/edid: fixed the bug that hdr metadata was not cleared
>
> When DP connected to a device with HDR capability,
> the hdr structure was filled.Then connected to another
> sink device without hdr capability, but the hdr info
> still exist.
>
> Signed-off-by: feijuan.li <feijuan.li@samsung.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 13bc4c290b17..5cf5d30321b6 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -5607,6 +5607,7 @@ static void clear_eld(struct drm_connector *connector)
>  {
>  	mutex_lock(&connector->eld_mutex);
>  	memset(connector->eld, 0, sizeof(connector->eld));
> +	memset(&connector->hdr_sink_metadata, 0, sizeof(connector->hdr_sink_metadata));

hdr_sink_metadata is not related to ELD, and should not be cleared
within clear_eld().

I think this should be cleared in drm_reset_display_info(), and
long-term fields like this should be moved within display info.

BR,
Jani.

>  	mutex_unlock(&connector->eld_mutex);
>  
>  	connector->latency_present[0] = false;

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Re: [PATCH] drm/edid: fixed the bug that hdr metadata was not cleared
  2025-04-17  8:17   ` Jani Nikula
@ 2025-04-21  6:49     ` 李飞娟
  0 siblings, 0 replies; 3+ messages in thread
From: 李飞娟 @ 2025-04-21  6:49 UTC (permalink / raw)
  To: Jani Nikula, 李飞娟, jingoohan1@gmail.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
  Cc: 唐红飞, 严明贵,
	王琪琳

From 7da04ef9ba0c201e7817a21f8c4a1bf88973c8b9 Mon Sep 17 00:00:00 2001
From: "feijuan.li" <feijuan.li@samsung.com>
Date: Fri, 18 Apr 2025 14:56:49 +0000
Subject: [PATCH] drm/edid: fixed the bug that hdr metadata was not reset

When DP connected to a device with HDR capability,
the hdr structure was filled.Then connected to another
sink device without hdr capability, but the hdr info
still exist.

Signed-off-by: feijuan.li <feijuan.li@samsung.com>
---
 drivers/gpu/drm/drm_edid.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 13bc4c290b17..cd0e4148f6b0 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -6576,6 +6576,11 @@ static void drm_update_mso(struct drm_connector *connector,
 	displayid_iter_end(&iter);
 }
 
+static void drm_reset_hdr_sink_metadata(struct drm_connector *connector)
+{
+	memset(&connector->hdr_sink_metadata, 0, sizeof(connector->hdr_sink_metadata));
+}
+
 /* A connector has no EDID information, so we've got no EDID to compute quirks from. Reset
  * all of the values which would have been set from EDID
  */
@@ -6651,6 +6656,7 @@ static void update_display_info(struct drm_connector *connector,
 	struct drm_display_info *info = &connector->display_info;
 	const struct edid *edid;
 
+	drm_reset_hdr_sink_metadata(connector);
 	drm_reset_display_info(connector);
 	clear_eld(connector);
 
-- 
2.25.1


I changed the patch, not to avoid other functions.pls check.

BR~
feijuan

 
--------- Original Message ---------
Sender : Jani Nikula <jani.nikula@linux.intel.com>
Date : 2025-04-17 17:17 (GMT+9)
Title : Re: [PATCH] drm/edid: fixed the bug that hdr metadata was not cleared
 
On Wed, 16 Apr 2025, 李飞娟 <feijuan.li@samsung.com> wrote:
> From a34a1e2dd7aacd45f18775564fce12b03ae4009c Mon Sep 17 00:00:00 2001
> From: "feijuan.li" <feijuan.li@samsung.com>
> Date: Wed, 16 Apr 2025 11:07:39 +0000
> Subject: [PATCH] drm/edid: fixed the bug that hdr metadata was not cleared
>
> When DP connected to a device with HDR capability,
> the hdr structure was filled.Then connected to another
> sink device without hdr capability, but the hdr info
> still exist.
>
> Signed-off-by: feijuan.li <feijuan.li@samsung.com>
> ---
>  drivers/gpu/drm/drm_edid.c 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 13bc4c290b17..5cf5d30321b6 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -5607,6 +5607,7 @@ static void clear_eld(struct drm_connector *connector)
>  {
>         mutex_lock(&connector->eld_mutex);
>         memset(connector->eld, 0, sizeof(connector->eld));
> +        memset(&connector->hdr_sink_metadata, 0, sizeof(connector->hdr_sink_metadata));

hdr_sink_metadata is not related to ELD, and should not be cleared
within clear_eld().

I think this should be cleared in drm_reset_display_info(), and
long-term fields like this should be moved within display info.

BR,
Jani.

>         mutex_unlock(&connector->eld_mutex);
> 
>         connector->latency_present[0] = false;

--
Jani Nikula, Intel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-21  7:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20250416093607epcms5p344bcffd7430fe5e30ef9b73db73f7388@epcms5p3>
2025-04-16  9:36 ` [PATCH] drm/edid: fixed the bug that hdr metadata was not cleared 李飞娟
2025-04-17  8:17   ` Jani Nikula
2025-04-21  6:49     ` 李飞娟

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).