diff mbox series

[06/11] drm/loongson/7a1000: convert to struct drm_edid

Message ID 22c66af62cd5ae1998bbaf6801cda3cc689f9e3f.1715691257.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm: conversions to struct drm_edid | expand

Commit Message

Jani Nikula May 14, 2024, 12:55 p.m. UTC
Prefer the struct drm_edid based functions for reading the EDID and
updating the connector.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

Cc: Sui Jingfeng <suijingfeng@loongson.cn>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/loongson/lsdc_output_7a1000.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

Comments

Sui Jingfeng May 15, 2024, 5:37 p.m. UTC | #1
Hi, Jani


I love your patch, thanks.

On 2024/5/14 20:55, Jani Nikula wrote:
> Prefer the struct drm_edid based functions for reading the EDID and
> updating the connector.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---


Reviewed-by: Sui Jingfeng <sui.jingfeng@linux.dev>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/loongson/lsdc_output_7a1000.c b/drivers/gpu/drm/loongson/lsdc_output_7a1000.c
index 6fc8dd1c7d9a..600ed4fb0884 100644
--- a/drivers/gpu/drm/loongson/lsdc_output_7a1000.c
+++ b/drivers/gpu/drm/loongson/lsdc_output_7a1000.c
@@ -40,16 +40,15 @@ 
 
 static int ls7a1000_dpi_connector_get_modes(struct drm_connector *conn)
 {
-	unsigned int num = 0;
-	struct edid *edid;
+	int num;
 
 	if (conn->ddc) {
-		edid = drm_get_edid(conn, conn->ddc);
-		if (edid) {
-			drm_connector_update_edid_property(conn, edid);
-			num = drm_add_edid_modes(conn, edid);
-			kfree(edid);
-		}
+		const struct drm_edid *drm_edid;
+
+		drm_edid = drm_edid_read(conn);
+		drm_edid_connector_update(conn, drm_edid);
+		num = drm_edid_connector_add_modes(conn);
+		drm_edid_free(drm_edid);
 
 		return num;
 	}