From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43CDF606A325 for ; Fri, 20 Nov 2026 12:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=g5PH9zZb Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 503CC112A0E; Fri, 20 Nov 2026 12:59:18 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2028F10E8D1 for ; Fri, 20 Nov 2026 12:56:59 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 7F8546264F; Fri, 20 Nov 2026 12:56:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5724A1F000D2; Fri, 20 Nov 2026 12:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795179417; bh=l54Ae+K462y5IIm72TRoUVO+9Vk3uQKE+0AWLy0ZIvU=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=g5PH9zZbRlDm9QNfZSTDOxSsjVKgvCVmT8vtXSov4RHnlPos+qiwRZgxdCbTVKyKC pZpLjbN3ckqaCdjpVrnHIWaF4ihXMv0FZD3gsA/db2X3Ks2MkhU1oghlzRJiX1SPMm eoIxVZHOYCFBiKP6l0F/sXlHf57zuCk26OBJblfFkDUf66anhZzv/JS1UCkwUkuvdb NdgrySwpTXPof7uvnMY4/gS0oxp98vj9BMYL1zY8cKRY5eLdDMfW9KnCd3tXIfYNNO 0kDJbOQFvOo1dY7e9P5NW2VMkqnpPNvkO7IFJG0zwLM4vqETzfiz6xaNK0x4JPJpIH OPRzyWBfOAuAw== From: Maxime Ripard Date: Fri, 20 Nov 2026 13:55:20 +0100 Subject: [PATCH v9 28/42] drm/encoder: Create atomic_sro_get_current_crtc hook X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261120-drm-state-readout-v9-28-a67c2b45b8ec@kernel.org> References: <20261120-drm-state-readout-v9-0-a67c2b45b8ec@kernel.org> In-Reply-To: <20261120-drm-state-readout-v9-0-a67c2b45b8ec@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Jyri Sarha , Tomi Valkeinen Cc: Devarsh Thakkar , dri-devel@lists.freedesktop.org, Maxime Ripard X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2070; i=mripard@kernel.org; h=from:subject:message-id; bh=OZJEDMCz9eHw8SfkZcqJQoOJC5Z+ZaexUfbO/Ew/qHQ=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDNkMzvp2y17uZNAubM0XPh6zrPWF5GaVI343X7je0Zp30 sSqQnpux1QWBmFOBlkxRZYnMmGnl7cvrnKwX/kDZg4rE8gQBi5OAZiIhDtjDf82W7dblY/vb2WW spj0oOeB2bGW3JqP9Q/FS6Q+SZ0o/BFU6Oi0TWz+x9myPzad2vFdi7HO7N5Gr0LFe+vmtR1J2FP Rw3bW9C/H07SmvX3vjZc9UlUp0Yi0k5ibu3Pm5r5nlpc3LjsDAA== X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "dri-devel" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 In order for drivers to implement drm_connectors atomic_sro_readout_state 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. Create a new hook for encoders to implement to return the CRTC they are currently connected to. Reviewed-by: Maarten Lankhorst Signed-off-by: Maxime Ripard --- include/drm/drm_encoder.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/drm/drm_encoder.h b/include/drm/drm_encoder.h index eded7c34481a..7f41ec0a68dc 100644 --- a/include/drm/drm_encoder.h +++ b/include/drm/drm_encoder.h @@ -87,10 +87,28 @@ struct drm_encoder_funcs { * @debugfs_init: * * Allows encoders to create encoder-specific debugfs files. */ void (*debugfs_init)(struct drm_encoder *encoder, struct dentry *root); + + /** + * @atomic_sro_get_current_crtc: + * + * This optional hook is called during hardware state readout + * to determine which CRTC is currently driving this encoder. + * + * It is needed by the bridge connector readout code to + * establish the CRTC-encoder-connector association from the + * hardware state, since the relationship between a CRTC and + * an encoder is not a fixed mapping at the framework level. + * + * RETURNS: + * + * The CRTC currently associated with the encoder if enabled, + * NULL otherwise. + */ + struct drm_crtc *(*atomic_sro_get_current_crtc)(struct drm_encoder *encoder); }; /** * struct drm_encoder - central DRM encoder structure * @dev: parent DRM device -- 2.56.1