From aec6c912e969a433916d8f40b663fb3bef57cdf3 Mon Sep 17 00:00:00 2001
From: The-going <48602507+The-going@users.noreply.github.com>
Date: Mon, 9 Sep 2024 14:40:49 +0300
Subject: Revert "drm/sun4i: hdmi: switch to struct drm_edid"

This reverts commit bd730c77fa37fe2dda4b6e23f6921ef8a9b1bb97.
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index ab0938ba61f7..22024fd34b2b 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -190,24 +190,20 @@ sun4i_hdmi_connector_clock_valid(const struct drm_connector *connector,
 static int sun4i_hdmi_get_modes(struct drm_connector *connector)
 {
 	struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector);
-	const struct drm_edid *drm_edid;
+	struct edid *edid;
 	int ret;
 
-	drm_edid = drm_edid_read_ddc(connector, hdmi->ddc_i2c ?: hdmi->i2c);
-
-	drm_edid_connector_update(connector, drm_edid);
-	cec_s_phys_addr(hdmi->cec_adap,
-			connector->display_info.source_physical_address, false);
-
-	if (!drm_edid)
+	edid = drm_get_edid(connector, hdmi->ddc_i2c ?: hdmi->i2c);
+	if (!edid)
 		return 0;
 
 	DRM_DEBUG_DRIVER("Monitor is %s monitor\n",
 			 connector->display_info.is_hdmi ? "an HDMI" : "a DVI");
 
-
-	ret = drm_edid_connector_add_modes(connector);
-	drm_edid_free(drm_edid);
+	drm_connector_update_edid_property(connector, edid);
+	cec_s_phys_addr_from_edid(hdmi->cec_adap, edid);
+	ret = drm_add_edid_modes(connector, edid);
+	kfree(edid);
 
 	return ret;
 }
-- 
2.35.3

