[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250902-drm-state-readout-v1-16-14ad5315da3f@kernel.org>
Date: Tue, 02 Sep 2025 10:32:44 +0200
From: Maxime Ripard <mripard@...nel.org>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>, Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>, Jernej Skrabec <jernej.skrabec@...il.com>,
Jyri Sarha <jyri.sarha@....fi>,
Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
Cc: Devarsh Thakkar <devarsht@...com>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, Maxime Ripard <mripard@...nel.org>
Subject: [PATCH 16/29] drm/encoder: Create get_current_crtc hook
In order for drivers to implement drm_connectors atomic_state_readout
hooks, they need to query the hardware and lookup the CRTC to set
drm_connector_state.crtc.
It should be easy enough for drivers that are tightly integrated from
the CRTC to the connectors, but if the driver uses bridges, there's no
coupling between the CRTC and encoder, and the bridge driver.
The only thing the bridge has access to is the encoder, but the
relationship between a CRTC and an encoder isn't a fixed mapping at the
framework level, and thus the bridge can't deduce which CRTC is feeding
its encoder.
Thus, let's create a new hook for encoders to implement to return the
CRTC they are currently connected to.
Signed-off-by: Maxime Ripard <mripard@...nel.org>
---
include/drm/drm_encoder.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/drm/drm_encoder.h b/include/drm/drm_encoder.h
index 977a9381c8ba943b4d3e021635ea14856df8a17d..7abb5e35ac950c941b56fc311a52789bbc427df6 100644
--- a/include/drm/drm_encoder.h
+++ b/include/drm/drm_encoder.h
@@ -86,10 +86,23 @@ struct drm_encoder_funcs {
* @debugfs_init:
*
* Allows encoders to create encoder-specific debugfs files.
*/
void (*debugfs_init)(struct drm_encoder *encoder, struct dentry *root);
+
+ /**
+ * @get_current_crtc:
+ *
+ * This optional hook is used during initialization to read out
+ * the initial state by connectors that support atomic state
+ * hardware readout.
+ *
+ * Returns:
+ *
+ * The CRTC currently associated with the encoder if enabled, NULL otherwise.
+ */
+ struct drm_crtc *(*get_current_crtc)(struct drm_encoder *encoder);
};
/**
* struct drm_encoder - central DRM encoder structure
* @dev: parent DRM device
--
2.50.1
Powered by blists - more mailing lists