Skip to content

Commit

Permalink
sunxi-6.10: Revert "drm/sun4i: hdmi: switch to struct drm_edid"
Browse files Browse the repository at this point in the history
To make our patch work, we will return to the edid structure
while it is safe.
  • Loading branch information
The-going authored and igorpecovnik committed Sep 10, 2024
1 parent 661b365 commit 9e52e52
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From 1107808968f2ebbd7067998177637a7c03f78c6b Mon Sep 17 00:00:00 2001
From: The-going <[email protected]>
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 245b34adca5a..2d1880c61b50 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -214,24 +214,20 @@ sun4i_hdmi_connector_mode_valid(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

Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,8 @@ index 245b34adca5a..b5c014691b59 100644
}

static const struct drm_encoder_helper_funcs sun4i_hdmi_helper_funcs = {
@@ -226,6 +238,10 @@ static int sun4i_hdmi_get_modes(struct drm_connector *connector)
if (!drm_edid)
@@ -221,6 +233,10 @@ static int sun4i_hdmi_get_modes(struct drm_connector *connector)
if (!edid)
return 0;

+#ifdef CONFIG_DRM_SUN4I_HDMI_AUDIO
Expand Down
1 change: 1 addition & 0 deletions patch/kernel/archive/sunxi-6.10/series.armbian
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
patches.armbian/drv-rtc-sun6i-support-RTCs-without-external-LOSCs.patch
patches.armbian/drv-gpu-drm-gem-dma-Export-with-handle-allocator.patch
patches.armbian/drv-gpu-drm-sun4i-Add-GEM-allocator.patch
patches.armbian/Revert-drm-sun4i-hdmi-switch-to-struct-drm_edid.patch
patches.armbian/drv-gpu-drm-sun4i-Add-HDMI-audio-sun4i-hdmi-encoder.patch
patches.armbian/drv-net-stmmac-dwmac-sun8i-second-EMAC-clock-register.patch
patches.armbian/drv-phy-sun4i-usb-Allow-reset-line-to-be-shared.patch
Expand Down
3 changes: 2 additions & 1 deletion patch/kernel/archive/sunxi-6.10/series.conf
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@
patches.armbian/drv-rtc-sun6i-support-RTCs-without-external-LOSCs.patch
patches.armbian/drv-gpu-drm-gem-dma-Export-with-handle-allocator.patch
patches.armbian/drv-gpu-drm-sun4i-Add-GEM-allocator.patch
- patches.armbian/drv-gpu-drm-sun4i-Add-HDMI-audio-sun4i-hdmi-encoder.patch
patches.armbian/Revert-drm-sun4i-hdmi-switch-to-struct-drm_edid.patch
patches.armbian/drv-gpu-drm-sun4i-Add-HDMI-audio-sun4i-hdmi-encoder.patch
patches.armbian/drv-net-stmmac-dwmac-sun8i-second-EMAC-clock-register.patch
patches.armbian/drv-phy-sun4i-usb-Allow-reset-line-to-be-shared.patch
patches.armbian/drv-staging-media-sunxi-cedrus-add-H616-variant.patch
Expand Down

0 comments on commit 9e52e52

Please sign in to comment.