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>,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, kernel-dev@igalia.com
Subject: Re: [PATCH 11/13] drm/edid: introduce a helper that compares edid data from two drm_edid
Date: Mon, 14 Apr 2025 13:06:25 +0300 [thread overview]
Message-ID: <87ikn7t5um.fsf@intel.com> (raw)
In-Reply-To: <20250411201333.151335-12-mwen@igalia.com>
On Fri, 11 Apr 2025, Melissa Wen <mwen@igalia.com> wrote:
> AMD driver has a function used to compare if two edid are the same; this
> is useful to some of the link detection algorithms implemented by
> amdgpu. Since the amdgpu function can be helpful for other drivers, this
> commit abstracts the AMD function to make it available at the DRM level
> by wrapping existent drm_edid_eq().
>
> Co-developed-by: Rodrigo Siqueira <siqueira@igalia.com>
> Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
> Signed-off-by: Melissa Wen <mwen@igalia.com>
> ---
> drivers/gpu/drm/drm_edid.c | 18 ++++++++++++++++++
> include/drm/drm_edid.h | 2 ++
> 2 files changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 855beafb76ff..328a25d198e5 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -7502,3 +7502,21 @@ bool drm_edid_is_digital(const struct drm_edid *drm_edid)
> drm_edid->edid->input & DRM_EDID_INPUT_DIGITAL;
> }
> EXPORT_SYMBOL(drm_edid_is_digital);
> +
> +/**
> + * drm_edid_is_edid_eq - Check if it the EDID is equal
I think drm_edid_eq() is the better name. Please rename the static one
to make room. Maybe make it drm_edid_eq_buf() or something, because
that's what it really does.
"Check if the EDIDs are equal"
> + *
> + * @drm_edid_old: old drm_edid to compare edid
> + * @drm_edid_new: new drm_edid to compare edid
Old and new are meaningless here. It's supposed to be a generic
function. Just a/b or edid1/edid2 or something.
> + *
> + * Return true if the EDID is equal
"Return true if the EDIDs are equal."
> + */
> +bool drm_edid_is_edid_eq(const struct drm_edid *drm_edid_old,
> + const struct drm_edid *drm_edid_new)
> +{
> + const void *old_edid = drm_edid_old->edid;
> + size_t old_edid_size = drm_edid_old->size;
The existing drm_edid_eq() function supports the use case of either or
both EDIDs being NULL, and returning true for two NULL EDIDs. This one
oopses if the "old" EDID is NULL.
I'm not sure you can trivially replicate that behaviour by reusing the
existing function, though.
> +
> + return drm_edid_eq(drm_edid_new, old_edid, old_edid_size);
> +}
> +EXPORT_SYMBOL(drm_edid_is_edid_eq);
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index eaac5e665892..0e062761296c 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -469,6 +469,8 @@ int drm_edid_connector_update(struct drm_connector *connector,
> const struct drm_edid *edid);
> int drm_edid_connector_add_modes(struct drm_connector *connector);
> bool drm_edid_is_digital(const struct drm_edid *drm_edid);
> +bool drm_edid_is_edid_eq(const struct drm_edid *drm_edid_first,
> + const struct drm_edid *drm_edid_second);
> void drm_edid_get_product_id(const struct drm_edid *drm_edid,
> struct drm_edid_product_id *id);
> void drm_edid_print_product_id(struct drm_printer *p,
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-04-14 10:06 UTC|newest]
Thread overview: 24+ 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
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 11/13] drm/edid: introduce a helper that compares edid data from two drm_edid Melissa Wen
2025-04-14 10:06 ` Jani Nikula [this message]
2025-04-17 13:44 ` 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=87ikn7t5um.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mario.limonciello@amd.com \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=simona@ffwll.ch \
--cc=siqueira@igalia.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