[PATCH v2 11/14] drm/amd/display: create a function to fill dc_sink with edid data
Jani Nikula
jani.nikula at linux.intel.com
Thu May 8 11:41:27 UTC 2025
On Tue, 06 May 2025, Melissa Wen <mwen at igalia.com> wrote:
> From: Rodrigo Siqueira <siqueira at igalia.com>
>
> As part of the effort of stopping using raw edid, this commit move the
> copy of the edid in DC to a dedicated function that will allow the usage
> of drm_edid in the next steps.
>
> Signed-off-by: Rodrigo Siqueira <siqueira at igalia.com>
> Co-developer--by: Melissa Wen <mwen at igalia.com>
> Signed-off-by: Melissa Wen <mwen at igalia.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.c | 8 ++++++++
> drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.h | 2 ++
> drivers/gpu/drm/amd/display/dc/link/link_detection.c | 3 +--
> 3 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.c b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.c
> index fab873b091f5..39fcaa16a14a 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.c
> @@ -17,3 +17,11 @@ bool dc_edid_is_same_edid(struct dc_sink *prev_sink,
> return (memcmp(old_edid->raw_edid,
> new_edid->raw_edid, new_edid->length) == 0);
> }
> +
> +void dc_edid_copy_edid_to_dc(struct dc_sink *dc_sink,
> + const void *edid,
> + int len)
> +{
> + memmove(dc_sink->dc_edid.raw_edid, (const uint8_t *) edid, len);
Superfluous cast.
> + dc_sink->dc_edid.length = len;
> +}
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.h b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.h
> index 7e3b1177bc8a..f42cd5bbc730 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.h
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_edid.h
> @@ -7,5 +7,7 @@
>
> bool dc_edid_is_same_edid(struct dc_sink *prev_sink,
> struct dc_sink *current_sink);
> +void dc_edid_copy_edid_to_dc(struct dc_sink *dc_sink,
> + const void *edid, int len);
>
> #endif /* __DC_EDID_H__ */
> 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 e748721f31e4..978d2b4a4d29 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> @@ -1410,8 +1410,7 @@ struct dc_sink *link_add_remote_sink(
> if (!dc_sink)
> return NULL;
>
> - memmove(dc_sink->dc_edid.raw_edid, (const uint8_t *) edid, len);
> - dc_sink->dc_edid.length = len;
> + dc_edid_copy_edid_to_dc(dc_sink, edid, len);
>
> if (!link_add_remote_sink_helper(
> link,
--
Jani Nikula, Intel
More information about the dri-devel
mailing list