From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 761D9416852 for ; Mon, 3 Aug 2026 14:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785768373; cv=none; b=nczUlAZbTSN4/lS8/SnnHW3xdeN3408izRgZv8VrLW6Iv2kJvdzUBBsIsUAhgxvG0zBpBYVAl6Q2b9IiijtFyu5Vu2mq6hgUgdBB8sNb2Ax0hVJwpYs9qpqivPTE3tWRT4JsGG0BGxE5XgA9LcL4AePCgrPacAvcUIypNyCLVIE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785768373; c=relaxed/simple; bh=mz6aAeIuV7986MdQORfvb8r3YaWmRBedWi/6Z3TXQdQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oLVaJ+4Tg9STO87j/NGywhUtNAYiburj2p13yVAH4lPqVw/a1P0eEblgnV2XvO8g2uqh1AW0atL2cipWofeqjp0JqK5D2UBm2PS4P233Kkym+ipYvoLfTGcZsCAvvPafTDLu9sNdo2cOWU366jMUzumSUOLgsbMbwv5UTsBsqF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=s/Xc/4fa; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="s/Xc/4fa" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D456C143D for ; Mon, 3 Aug 2026 07:46:06 -0700 (PDT) Received: from [10.2.11.34] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A57253F632 for ; Mon, 3 Aug 2026 07:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785768370; bh=mz6aAeIuV7986MdQORfvb8r3YaWmRBedWi/6Z3TXQdQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s/Xc/4faZDsW5N8b28guRlXICnfwaT90rl2xYgPZrXsCUgEsw9BXcr1MNDbjlCZYL Mq9a/SrJaexsvpTl2BlTaSb8nJJX9Pj/M4F6El5rd+9SFnpMZMU9pntWcQVm/txMTv RgX6p4FE5LxiffWJRrBaEHFdm2ZGLueXue8/w1qc= Date: Mon, 3 Aug 2026 15:46:08 +0100 From: Liviu Dudau To: Raveendra Talabattula Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, 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: Re: [PATCH v2 2/2] drm/komeda: Set display/writeback clone masks Message-ID: References: <20260803142122.4127851-1-raveendra.talabattula@arm.com> <20260803142122.4127851-3-raveendra.talabattula@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260803142122.4127851-3-raveendra.talabattula@arm.com> On Mon, Aug 03, 2026 at 03:21:22PM +0100, Raveendra Talabattula wrote: > From: Vincenzo Frascino > > 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. If you don't mind I will drop the paragraph above when I commit the patch as it makes reference to code that has not been merged so likely to create confusion. I think the comment in the code is sufficient. With that, Reviewed-by: Liviu Dudau Will push this to drm-misc-next in the next couple of days. Best regards, Liviu > > Signed-off-by: Asad Malik > Signed-off-by: Vincenzo Frascino > Co-developed-by: Raveendra Talabattula > Signed-off-by: Raveendra Talabattula > --- > .../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 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯