[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220421170725.903361-3-jose.exposito89@gmail.com>
Date: Thu, 21 Apr 2022 19:07:22 +0200
From: José Expósito <jose.exposito89@...il.com>
To: inki.dae@...sung.com
Cc: jy0922.shim@...sung.com, sw0312.kim@...sung.com,
kyungmin.park@...sung.com, airlied@...ux.ie, daniel@...ll.ch,
krzk@...nel.org, alim.akhtar@...sung.com, lgirdwood@...il.com,
broonie@...nel.org, dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
hjc@...k-chips.com, heiko@...ech.de,
linux-rockchip@...ts.infradead.org, alain.volmat@...s.st.com,
p.zabel@...gutronix.de, mripard@...nel.org, wens@...e.org,
jernej.skrabec@...il.com, samuel@...lland.org,
linux-sunxi@...ts.linux.dev, laurent.pinchart@...asonboard.com,
José Expósito <jose.exposito89@...il.com>
Subject: [PATCH 2/5] drm/rockchip: inno_hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi
Once EDID is parsed, the monitor HDMI support information is available
through drm_display_info.is_hdmi.
This driver calls drm_detect_hdmi_monitor() to receive the same
information and stores its own cached value, which is less efficient.
Avoid calling drm_detect_hdmi_monitor() and use drm_display_info.is_hdmi
instead and also remove hdmi_data_info.sink_is_hdmi as it is no longer
necessary.
Signed-off-by: José Expósito <jose.exposito89@...il.com>
---
drivers/gpu/drm/rockchip/inno_hdmi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
index 046e8ec2a71c..aa8b704d44a2 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -30,7 +30,6 @@
struct hdmi_data_info {
int vic;
- bool sink_is_hdmi;
bool sink_has_audio;
unsigned int enc_in_format;
unsigned int enc_out_format;
@@ -433,6 +432,8 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi,
static int inno_hdmi_setup(struct inno_hdmi *hdmi,
struct drm_display_mode *mode)
{
+ struct drm_display_info *display = &hdmi->connector.display_info;
+
hdmi->hdmi_data.vic = drm_match_cea_mode(mode);
hdmi->hdmi_data.enc_in_format = HDMI_COLORSPACE_RGB;
@@ -452,13 +453,13 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi,
/* Set HDMI Mode */
hdmi_writeb(hdmi, HDMI_HDCP_CTRL,
- v_HDMI_DVI(hdmi->hdmi_data.sink_is_hdmi));
+ v_HDMI_DVI(display->is_hdmi));
inno_hdmi_config_video_timing(hdmi, mode);
inno_hdmi_config_video_csc(hdmi);
- if (hdmi->hdmi_data.sink_is_hdmi) {
+ if (display->is_hdmi) {
inno_hdmi_config_video_avi(hdmi, mode);
inno_hdmi_config_video_vsi(hdmi, mode);
}
@@ -553,7 +554,6 @@ static int inno_hdmi_connector_get_modes(struct drm_connector *connector)
edid = drm_get_edid(connector, hdmi->ddc);
if (edid) {
- hdmi->hdmi_data.sink_is_hdmi = drm_detect_hdmi_monitor(edid);
hdmi->hdmi_data.sink_has_audio = drm_detect_monitor_audio(edid);
drm_connector_update_edid_property(connector, edid);
ret = drm_add_edid_modes(connector, edid);
--
2.25.1
Powered by blists - more mailing lists