All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: jani.nikula@intel.com, Russell King <linux@armlinux.org.uk>
Subject: [RESEND 4/6] drm/i2c: tda998x: switch to struct drm_edid
Date: Fri, 10 May 2024 16:26:07 +0300	[thread overview]
Message-ID: <485a33bc4eba9daae109d3f4795bc695e026ba0c.1715347488.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1715347488.git.jani.nikula@intel.com>

Prefer struct drm_edid based functions over struct edid.

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

---

Cc: Russell King <linux@armlinux.org.uk>
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index d8d7de18dd65..2160f05bbd16 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -1283,7 +1283,7 @@ static int read_edid_block(void *data, u8 *buf, unsigned int blk, size_t length)
 static int tda998x_connector_get_modes(struct drm_connector *connector)
 {
 	struct tda998x_priv *priv = conn_to_tda998x_priv(connector);
-	struct edid *edid;
+	const struct drm_edid *drm_edid;
 	int n;
 
 	/*
@@ -1297,25 +1297,26 @@ static int tda998x_connector_get_modes(struct drm_connector *connector)
 	if (priv->rev == TDA19988)
 		reg_clear(priv, REG_TX4, TX4_PD_RAM);
 
-	edid = drm_do_get_edid(connector, read_edid_block, priv);
+	drm_edid = drm_edid_read_custom(connector, read_edid_block, priv);
 
 	if (priv->rev == TDA19988)
 		reg_set(priv, REG_TX4, TX4_PD_RAM);
 
-	if (!edid) {
+	drm_edid_connector_update(connector, drm_edid);
+	cec_notifier_set_phys_addr(priv->cec_notify,
+				   connector->display_info.source_physical_address);
+
+	if (!drm_edid) {
 		dev_warn(&priv->hdmi->dev, "failed to read EDID\n");
 		return 0;
 	}
 
-	drm_connector_update_edid_property(connector, edid);
-	cec_notifier_set_phys_addr_from_edid(priv->cec_notify, edid);
-
 	mutex_lock(&priv->audio_mutex);
-	n = drm_add_edid_modes(connector, edid);
-	priv->sink_has_audio = drm_detect_monitor_audio(edid);
+	n = drm_edid_connector_add_modes(connector);
+	priv->sink_has_audio = connector->display_info.has_audio;
 	mutex_unlock(&priv->audio_mutex);
 
-	kfree(edid);
+	drm_edid_free(drm_edid);
 
 	return n;
 }
-- 
2.39.2


  parent reply	other threads:[~2024-05-10 13:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10 13:26 [RESEND 0/6] drm: struct drm_edid conversions Jani Nikula
2024-05-10 13:26 ` [RESEND 1/6] drm/bridge/analogix/anx6345: switch to struct drm_edid Jani Nikula
2024-05-13 17:08   ` Robert Foss
2024-05-10 13:26 ` [RESEND 2/6] drm/bridge/analogix/anx78xx: " Jani Nikula
2024-05-13 17:09   ` Robert Foss
2024-05-10 13:26 ` [RESEND 3/6] drm/bridge: anx7625: use struct drm_edid more Jani Nikula
2024-05-13 17:10   ` Robert Foss
2024-05-10 13:26 ` Jani Nikula [this message]
2024-05-13 17:07   ` [RESEND 4/6] drm/i2c: tda998x: switch to struct drm_edid Robert Foss
2024-05-10 13:26 ` [RESEND 5/6] drm/bochs: " Jani Nikula
2024-05-13 17:04   ` Robert Foss
2024-05-10 13:26 ` [RESEND 6/6] drm/virtio: " Jani Nikula
2024-05-13 17:03   ` Robert Foss
2024-05-13 17:16 ` [RESEND 0/6] drm: struct drm_edid conversions Robert Foss

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=485a33bc4eba9daae109d3f4795bc695e026ba0c.1715347488.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux@armlinux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.