From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08D8CC282EC for ; Fri, 14 Mar 2025 08:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=shPwwGXfHVuV1VEQPB00+dQj+dOnHg7agqnzcuOae+g=; b=oK48ANglArud3Q8PqEvOm9q16M CaFwLWl2Wh/2zks+2MfweB0GkARbOzcQqCMDe9SrIzrWUhHA/aQERmcFjlMNM+qLxhGSzYE0STuA0 RAhJWaaSGBbWwly1JpYDs4hyOShDBJ/s05DDK0fngBBjSloNbMiUXAC8uNymi8+yo2y2RKZ2m6m1+ ydeUrmEHT4WI0Wjv7YlLmw4xRewviU/PThV50wVP8vQ5It++aI2COxr4//oFA4StafFDLVVn45Ysg T4/P8SUZ3/AbHmQ/SzArd2Q5uNRS/iEyte1PX9F5DAtKe94PSEcOD8nW9DmJTgBqlM6CHDyPpFKUe f8KHxxQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tt0Fv-0000000DQh5-1hoT; Fri, 14 Mar 2025 08:18:59 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tt08h-0000000DPKM-0cVG for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2025 08:11:32 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 39CB844166; Fri, 14 Mar 2025 08:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1741939888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=shPwwGXfHVuV1VEQPB00+dQj+dOnHg7agqnzcuOae+g=; b=fIoKFoKELP4821UfIVCOJ7r0oRx+ErLefYKp9XTh7WSH4cEVUWJiedNkCtFuxYms4hSMxu eERv4eaCRm7eD7vTzxbo2Yd5bpPbOXvkc8n7yoNaqR/GDSYlOh3ZY0Mx8ebCY7BAlbndwl nqqshu+8ScypJK0eDaRsnNPkAlXHe+LRax8aMccBkZiJXYcf78fa/sf3HpuSxb/Q36bK43 EeepcpWqgGZZL1WGsf5AjGG+Xv2hXIhFvMlEdcdRP8Sb3c9HVSYIJgg7a/dMsNkABQaI8j pNdL7J5N3VFrE0/URRC9+BNzsRU1UslrHOsivGUh+9vbsKwQ8UbRq5kvRIBpeg== Date: Fri, 14 Mar 2025 09:11:20 +0100 From: Luca Ceresoli To: Maxime Ripard Cc: Simona Vetter , Inki Dae , Jagan Teki , Marek Szyprowski , Catalin Marinas , Will Deacon , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Daniel Thompson , Andrzej Hajda , Jonathan Corbet , Sam Ravnborg , Boris Brezillon , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Jessica Zhang , Paul Kocialkowski , Dmitry Baryshkov , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Thomas Zimmermann , David Airlie , =?UTF-8?B?SGVy?= =?UTF-8?B?dsOp?= Codina , Thomas Petazzoni , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paul Kocialkowski Subject: Re: [PATCH v6 14/26] drm/bridge: add support for refcounted DRM bridges Message-ID: <20250314091120.366b5fd7@booty> In-Reply-To: <20250313-flying-crab-of-diversity-fa1db0@houat> References: <20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3058@bootlin.com> <20250206-hotplug-drm-bridge-v6-14-9d6f2c9c3058@bootlin.com> <20250207-ingenious-daffodil-dugong-51be57@houat> <20250313125656.70448d09@booty> <20250313-flying-crab-of-diversity-fa1db0@houat> Organization: Bootlin X-Mailer: Claws Mail 4.3.1 (GTK 3.24.43; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddufedtfedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfgjfhhoofggtgfgsehtjeertdertddvnecuhfhrohhmpefnuhgtrgcuvegvrhgvshholhhiuceolhhutggrrdgtvghrvghsohhlihessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeelffefgfehhfdtvdefueefieevkefggfelkeeiudetkeektedvhedukefgvddvnecuffhomhgrihhnpegsohhothhlihhnrdgtohhmnecukfhppedvrgdtvdemieejtdemvddtvddtmegvrgdtudemrgdttddvmedusggrjeemgeekfhejmedulegtheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtvdemieejtdemvddtvddtmegvrgdtudemrgdttddvmedusggrjeemgeekfhejmedulegthedphhgvlhhopegsohhothihpdhmrghilhhfrhhomheplhhutggrrdgtvghrvghsohhlihessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepfeejpdhrtghpthhtohepmhhrihhprghrugeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhimhhonhgrsehffhiflhhlrdgthhdprhgtphhtthhopehinhhkihdruggrvgesshgrmhhsuhhnghdrtghomhdprhgtphhtt hhopehjrghgrghnsegrmhgrrhhulhgrshholhhuthhiohhnshdrtghomhdprhgtphhtthhopehmrdhsiiihphhrohifshhkihesshgrmhhsuhhnghdrtghomhdprhgtphhtthhopegtrghtrghlihhnrdhmrghrihhnrghssegrrhhmrdgtohhmpdhrtghpthhtohepfihilhhlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehshhgrfihnghhuoheskhgvrhhnvghlrdhorhhg X-GND-Sasl: luca.ceresoli@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250314_011131_500065_F7479FEF X-CRM114-Status: GOOD ( 38.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Maxime, On Thu, 13 Mar 2025 19:07:17 +0100 Maxime Ripard wrote: > On Thu, Mar 13, 2025 at 12:56:56PM +0100, Luca Ceresoli wrote: > > Hello Maxime, > > > > On Fri, 7 Feb 2025 12:47:51 +0100 > > Maxime Ripard wrote: > > > On Thu, Feb 06, 2025 at 07:14:29PM +0100, Luca Ceresoli wrote: > > > > DRM bridges are currently considered as a fixed element of a DRM card, and > > > > thus their lifetime is assumed to extend for as long as the card > > > > exists. New use cases, such as hot-pluggable hardware with video bridges, > > > > require DRM bridges to be added and removed to a DRM card without tearing > > > > the card down. This is possible for connectors already (used by DP MST), so > > > > add this possibility to DRM bridges as well. > > > > > > > > Implementation is based on drm_connector_init() as far as it makes sense, > > > > and differs when it doesn't. A difference is that bridges are not exposed > > > > to userspace, hence struct drm_bridge does not embed a struct > > > > drm_mode_object which would provide the refcount. Instead we add to struct > > > > drm_bridge a refcount field (we don't need other struct drm_mode_object > > > > fields here) and instead of using the drm_mode_object_*() functions we > > > > reimplement from those functions the few lines that drm_bridge needs for > > > > refcounting. > > > > > > > > Also add a new devm_drm_bridge_alloc() macro to allocate a new refcounted > > > > bridge. > > > > > > > > Signed-off-by: Luca Ceresoli > > > > > > So, a couple of general comments: > > > > > > - I've said it a couple of times already, but I really think you're > > > making it harder than necessary for you here. This (and only this!) > > > should be the very first series you should be pushing. The rest can > > > only ever work if that work goes through, and it's already hard enough > > > as it is. So, split that patch into a series of its own, get that > > > merged, and then we will be able to deal with panels conversion and > > > whatever. That's even more true with panels since there's ongoing work > > > that will make it easier for you too. So the best thing here is > > > probably to wait. > > > > > > - This patch really needs to be split into several patches, something > > > along the lines of: > > > > > > + Creating devm_drm_bridge_alloc() > > > + Adding refcounting > > > + Taking the references in all the needed places > > > + Converting a bunch of drivers > > > > After reading Anusha's "[PATCH RFC 0/2] drm/panel: Refcounted panel > > allocation" [0] I think I need a clarification about the 4 steps you had > > outlined in the above quoted text. Are you suggesting those are four > > _series_, and you'd want to see a series only creating > > devm_drm_bridge_alloc() as a first step, similarly to Anusha's work? > > > > That was not my understanding so far, and so I've been working on a > > series containing all 4 items, and it's growing very long due to item 3 > > needing to touch many dozen drivers which need to put a bridge (many > > are identical oneliner patches though). > > I believe I've clarified it already in Anusha's series, but I think a Yes, you have... > reasonable series for *early* work would be the bullet points 1, 2, a > bit of 3 and a bit of 4. ...but thanks for the extra clarification. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com