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 1EEA5427A1A for ; Tue, 28 Jul 2026 14:20:06 +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=1785248408; cv=none; b=GDdudjx6HqAZRnRWWBNSAxaxjqcilBBcGuKRuux9OHl9T9lkHEKAa1ZPUKUV+jODPqX9cEM9AXYS2lHLPh19odRWMxCvrtR1LXX78fIEl+ac52E3mdHJNBqjMQcty8e0B9fbGtD3iZ0KOWRUEmbV2s08UmnjwlNfSsgljWDJVcA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785248408; c=relaxed/simple; bh=sbnPX/wAJLFWJIwEoUOuGu0Ap9icBCwur3M9doPQ6sU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Or6YS9okznoeU5yZmfBja7KTi42GSsDQM7Oi3ogT8V2pAPAdkp8f0v+3tvcv786iXlXKfb30/5vPG0JOJxYmwdY+0Rx03fOZRFQ2cHlpjuuoekuje1t5sEv4P6r5mmEB3tvBCVklv89gs5gvLm/B1eccCWeuhLZz0ts3ycrwC8o= 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=L4HT8VCZ; 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="L4HT8VCZ" 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 336FC1650 for ; Tue, 28 Jul 2026 07:20:02 -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 120BA3F66F for ; Tue, 28 Jul 2026 07:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785248406; bh=sbnPX/wAJLFWJIwEoUOuGu0Ap9icBCwur3M9doPQ6sU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L4HT8VCZ6jI16Ol8yMFalIvrXbpBJ5pNMtnhC0dGPzZ04MwiKymviuY+O00zmE0z1 qLCapXz/Dgd4pJoGrpfnXa3FgJJR577lVshW/Fez9OaoNa7S8ATAUdTklGqlUq/anJ B4XTm5gJcpSswpJEMKcfLUyZQelduAEeyoI7eLUc= Date: Tue, 28 Jul 2026 15:20:03 +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, vincenzo.frascino@arm.com, nayden.kanchev@arm.com, charvi.mehta@arm.com, Asad Malik Subject: Re: [PATCH 2/2] drm/komeda: Initialize encoder possible_clones Message-ID: References: <20260721135227.439413-1-raveendra.talabattula@arm.com> <20260721135227.439413-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: <20260721135227.439413-3-raveendra.talabattula@arm.com> On Tue, Jul 21, 2026 at 02:52:27PM +0100, Raveendra Talabattula wrote: > Komeda leaves encoder->possible_clones unset, so it stays at 0 for every > encoder. When userspace asks for writeback, the DRM atomic checks Can you tell me more about this? What are you trying to do with the writeback? Please note that there is a patch series that changes the way encoders get created for the writeback connectors, so that can potentially affect your use case. > reject the configuration because no encoder is marked as clone-compatible, > leading to errors such as: > > crtc96 failed valid clone check for mask 0x5 The error you're seeing here is due to the encoder having a non-zero "possible_clones" which shows there is an error in your setup earlier and nothing to do with komeda. > > Komeda does not impose per-encoder clone restrictions, [...] Komeda doesn't care about the encoders at all as it is meant to be agnostic to whatever encoder is used. > [...] so initialize > possible_clones for all registered encoders to the full encoder mask > after encoder creation. This fixes writeback validation. > > Signed-off-by: Asad Malik > Signed-off-by: Raveendra Talabattula > --- > .../gpu/drm/arm/display/komeda/komeda_kms.c | 20 +++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c > index 6ed504099188..0dcc8c05e86b 100644 > --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c > @@ -276,7 +276,10 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev) > { > struct komeda_kms_dev *kms; > struct drm_device *drm; > + struct drm_encoder *encoder; > int err; > + /* Bitmap of all encoders, assigned to each encoder's possible_clones. */ > + u32 clone_mask = 0; > > kms = devm_drm_dev_alloc(mdev->dev, &komeda_kms_driver, > struct komeda_kms_dev, base); > @@ -311,6 +314,23 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev) > > drm_mode_config_reset(drm); > > + /* > + * Build the full possible_clones mask once. drm_encoder_index() > + * returns the bit position assigned to each encoder and BIT() converts > + * that index into the corresponding mask value. > + * > + * Komeda does not have per-encoder clone restrictions, so every encoder > + * gets the same mask and is advertised as clone-compatible with all > + * other registered encoders. > + */ > + drm_for_each_encoder(encoder, drm) { > + clone_mask |= BIT(drm_encoder_index(encoder)); > + } > + > + drm_for_each_encoder(encoder, drm) { > + encoder->possible_clones = clone_mask; > + } You're modifying all the encoders in the system here which is not the right thing. Best regards, Liviu > + > err = devm_request_irq(drm->dev, mdev->irq, > komeda_kms_irq_handler, IRQF_SHARED, > drm->driver->name, drm); > -- > 2.43.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯