On Tue, 06 May 2025, Melissa Wen <m...@igalia.com> wrote:
> From: Rodrigo Siqueira <sique...@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 <sique...@igalia.com>
> Co-developer--by: Melissa Wen <m...@igalia.com>
> Signed-off-by: Melissa Wen <m...@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

Reply via email to