From: Raveendra Talabattula <raveendra.talabattula@arm.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org,
Raveendra Talabattula <raveendra.talabattula@arm.com>,
liviu.dudau@arm.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
simona@ffwll.ch, james.qian.wang@arm.com, asad.malik@arm.com,
vincenzo.frascino@arm.com, nayden.kanchev@arm.com,
charvi.mehta@arm.com
Subject: [PATCH v2 2/2] drm/komeda: Set display/writeback clone masks
Date: Mon, 3 Aug 2026 15:21:22 +0100 [thread overview]
Message-ID: <20260803142122.4127851-3-raveendra.talabattula@arm.com> (raw)
In-Reply-To: <20260803142122.4127851-1-raveendra.talabattula@arm.com>
From: Vincenzo Frascino <vincenzo.frascino@arm.com>
Since commit 41b4b11da0215 ("drm: Add valid clones check"),
all encoders attached to the same CRTC must advertise
each other through possible_clones.
Komeda creates one writeback connector per CRTC. Allow the writeback
encoder to be cloned only with encoders that can drive the same CRTC,
and update those encoders reciprocally.
Do this when the writeback connector is created rather than modifying
every encoder registered with the DRM device from komeda_kms_attach().
This leaves encoders associated with other CRTCs untouched.
Signed-off-by: Asad Malik <asad.malik@arm.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Co-developed-by: Raveendra Talabattula <raveendra.talabattula@arm.com>
Signed-off-by: Raveendra Talabattula <raveendra.talabattula@arm.com>
---
.../arm/display/komeda/komeda_wb_connector.c | 33 +++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
index 41cc3e080dc9..4872253a2449 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
@@ -143,12 +143,17 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
struct komeda_wb_connector *kwb_conn;
struct drm_writeback_connector *wb_conn;
struct drm_display_info *info;
+ struct drm_encoder *encoder;
+ struct drm_encoder *wb_encoder;
u32 *formats, n_formats = 0;
+ u32 crtc_mask;
int err;
if (!kcrtc->master->wb_layer)
return 0;
+ crtc_mask = drm_crtc_mask(&kcrtc->base);
+
kwb_conn = kzalloc_obj(*kwb_conn);
if (!kwb_conn)
return -ENOMEM;
@@ -176,6 +181,34 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
return err;
}
+ wb_encoder = &wb_conn->encoder;
+
+ /*
+ * The writeback connector is associated with a single CRTC. Make its
+ * encoder clone-compatible only with encoders that can drive that CRTC.
+ *
+ * possible_clones must contain the encoder's own bit whenever it is
+ * non-zero. Add both the encoder itself and the writeback encoder when
+ * updating the reciprocal clone relationship.
+ */
+ wb_encoder->possible_clones = drm_encoder_mask(wb_encoder);
+
+ drm_for_each_encoder(encoder, &kms->base) {
+ u32 encoder_mask;
+
+ if (encoder == wb_encoder)
+ continue;
+
+ if (!(encoder->possible_crtcs & crtc_mask))
+ continue;
+
+ encoder_mask = drm_encoder_mask(encoder);
+
+ wb_encoder->possible_clones |= encoder_mask;
+ encoder->possible_clones |= encoder_mask |
+ drm_encoder_mask(wb_encoder);
+ }
+
drm_connector_helper_add(&wb_conn->base, &komeda_wb_conn_helper_funcs);
info = &kwb_conn->base.base.display_info;
--
2.43.0
next prev parent reply other threads:[~2026-08-03 14:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 14:21 [PATCH v2 0/2] drm/komeda: Fix GLB_CORE_ID parsing and initialize encoder " Raveendra Talabattula
2026-08-03 14:21 ` [PATCH v2 1/2] drm/komeda: Fix bits parsing of GLB_CORE_ID Raveendra Talabattula
2026-08-03 14:21 ` Raveendra Talabattula [this message]
2026-08-03 14:46 ` [PATCH v2 2/2] drm/komeda: Set display/writeback clone masks Liviu Dudau
2026-08-03 14:50 ` Vincenzo Frascino
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=20260803142122.4127851-3-raveendra.talabattula@arm.com \
--to=raveendra.talabattula@arm.com \
--cc=airlied@gmail.com \
--cc=asad.malik@arm.com \
--cc=charvi.mehta@arm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=james.qian.wang@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nayden.kanchev@arm.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=vincenzo.frascino@arm.com \
/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
all inboxes | Powered by JetHome®