ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: "José Expósito" <jose.exposito89@gmail.com>
To: inki.dae@samsung.com
Cc: jy0922.shim@samsung.com, sw0312.kim@samsung.com,
	kyungmin.park@samsung.com, airlied@linux.ie, daniel@ffwll.ch,
	krzk@kernel.org, alim.akhtar@samsung.com, lgirdwood@gmail.com,
	broonie@kernel.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	hjc@rock-chips.com, heiko@sntech.de,
	linux-rockchip@lists.infradead.org, alain.volmat@foss.st.com,
	p.zabel@pengutronix.de, mripard@kernel.org, wens@csie.org,
	jernej.skrabec@gmail.com, samuel@sholland.org,
	linux-sunxi@lists.linux.dev, laurent.pinchart@ideasonboard.com,
	"José Expósito" <jose.exposito89@gmail.com>
Subject: [PATCH 5/5] drm/sun4i: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi
Date: Thu, 21 Apr 2022 19:07:25 +0200	[thread overview]
Message-ID: <20220421170725.903361-6-jose.exposito89@gmail.com> (raw)
In-Reply-To: <20220421170725.903361-1-jose.exposito89@gmail.com>

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 sun4i_hdmi.hdmi_monitor as it is no longer
necessary.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi.h     | 1 -
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi.h b/drivers/gpu/drm/sun4i/sun4i_hdmi.h
index 00ca35f07ba5..65c801cd6f35 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi.h
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi.h
@@ -285,7 +285,6 @@ struct sun4i_hdmi {
 
 	struct sun4i_drv	*drv;
 
-	bool			hdmi_monitor;
 	struct cec_adapter	*cec_adap;
 
 	const struct sun4i_hdmi_variant	*variant;
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index 3799a745b7dd..d8b71710e8f6 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -99,6 +99,7 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder)
 {
 	struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
 	struct sun4i_hdmi *hdmi = drm_encoder_to_sun4i_hdmi(encoder);
+	struct drm_display_info *display = &hdmi->connector.display_info;
 	u32 val = 0;
 
 	DRM_DEBUG_DRIVER("Enabling the HDMI Output\n");
@@ -111,7 +112,7 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder)
 	writel(val, hdmi->base + SUN4I_HDMI_PKT_CTRL_REG(0));
 
 	val = SUN4I_HDMI_VID_CTRL_ENABLE;
-	if (hdmi->hdmi_monitor)
+	if (display->is_hdmi)
 		val |= SUN4I_HDMI_VID_CTRL_HDMI_MODE;
 
 	writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
@@ -215,9 +216,8 @@ static int sun4i_hdmi_get_modes(struct drm_connector *connector)
 	if (!edid)
 		return 0;
 
-	hdmi->hdmi_monitor = drm_detect_hdmi_monitor(edid);
 	DRM_DEBUG_DRIVER("Monitor is %s monitor\n",
-			 hdmi->hdmi_monitor ? "an HDMI" : "a DVI");
+			 connector->display_info.is_hdmi ? "an HDMI" : "a DVI");
 
 	drm_connector_update_edid_property(connector, edid);
 	cec_s_phys_addr_from_edid(hdmi->cec_adap, edid);
-- 
2.25.1


  parent reply	other threads:[~2022-04-21 17:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 17:07 [PATCH 0/5] Replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi José Expósito
2022-04-21 17:07 ` [PATCH 1/5] drm/exynos: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi José Expósito
2022-04-21 17:07 ` [PATCH 2/5] drm/rockchip: inno_hdmi: " José Expósito
2022-04-21 17:07 ` [PATCH 3/5] drm/rockchip: rk3066_hdmi: " José Expósito
2022-04-21 17:07 ` [PATCH 4/5] drm/sti/sti_hdmi: " José Expósito
2022-04-21 17:07 ` José Expósito [this message]
2022-04-22 10:35   ` (subset) [PATCH 5/5] drm/sun4i: hdmi: " Maxime Ripard
2022-05-02 22:24 ` (subset) [PATCH 0/5] Replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220421170725.903361-6-jose.exposito89@gmail.com \
    --to=jose.exposito89@gmail.com \
    --cc=airlied@linux.ie \
    --cc=alain.volmat@foss.st.com \
    --cc=alim.akhtar@samsung.com \
    --cc=broonie@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=inki.dae@samsung.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jy0922.shim@samsung.com \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mripard@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=samuel@sholland.org \
    --cc=sw0312.kim@samsung.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox