drm/ast: astdp: Use struct drm_edid and helpers
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 15 Aug 2024 15:18:46 +0000 (17:18 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 22 Aug 2024 07:12:57 +0000 (09:12 +0200)
commit0e35457eb4b75f2bc9eca58a46d12e200e15e47f
tree0e9125645bb4b66326b8855b05d2346a8504aedb
parentf89001ea41771fe94005920c363dee43e8078bec
drm/ast: astdp: Use struct drm_edid and helpers

Convert ASTDP support to struct drm_edid and its helpers. Simplifies
and modernizes the EDID handling.

The driver reads 4 bytes at once, but the overall read length is now
variable. Therefore update the EDID read loop to never return more than
the requested bytes.

The device does not seem to support EDID extensions, as the driver
actively clears any such information from the main EDID header. As
the new interface allows for reading extension blocks for EDID, make
sure that the block is always 0 (i.e., the main header). A later
update might fix that.

v2:
- fix reading if len is not a multiple of 4

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240815151953.184679-5-tzimmermann@suse.de
drivers/gpu/drm/ast/ast_dp.c