From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D67391FAC4F; Thu, 13 Mar 2025 11:57:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741867034; cv=none; b=gI5aP+W/izf1edfY5n+G/oR2h10B4sZ3aFbWmIVrPX3GYRK+cKVRIhZoD8dxyJOF5u4YZWXR9H2yGzFShU/rodCNEXQ10hh58lVbbfd5Ej4BtDkPja/xpe9UkzonxP5IkOTr9YoSoGzgzerqe3bzUoC/bF1eS4ZBzLUydhD+YvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741867034; c=relaxed/simple; bh=53YcTyDwozZqDBiuAPqxAPd1+CWXw4l9v3J6ztvfbWA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=azkI8ffcrf/JmU761fYTt4T8Q6HoZ1F7Yhcy+USjL5XBkYbjs/GlsqMA8EZLDxOn6mvO7HPbi1YlGV69vCYMUl8uvDPYKoDIF/qUxQVqfowG+EO3qQeDLItBdYbuqdls6uq2J4jtwI8Eoe/t509uQyvahGnzkkFHXLQMau6gwXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=QwnyFTZY; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QwnyFTZY" Received: by mail.gandi.net (Postfix) with ESMTPSA id EA15B43290; Thu, 13 Mar 2025 11:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1741867023; 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=JhXUy51c9HOiF2dM0ShdmXt1Njr+UGlAd/NPatt3K0Q=; b=QwnyFTZYHlEK0gM8ijiyd15oLuWJmqqgsBCfTj5dOwO8Ny2Zx0aUjpStJFhwkMDmaPvmo0 Qk5FqkGvQlzKhqGEUhWczOpYH6r86aXQxq8KCQ69Kst4cIgUREiVQdPyh3JNUoFAtUzEdL oKBoPnqi4f8o+vBx3ceJ1my6wLrWoqSi7EGg9P9cvzKphYMEMGc2C79bpBU7P1aeyzGVky DCXwUhNvJFJmGTnswNa1DLdZWbdRwwbhMiKnrSAkj1ypGAcr3qs+sgFGzBZMXQIYI0jMaG GiT7iStHOIXg9NqorQxWoG/e1Fh95b4KKxXc4/BNXFp25JWtuZoVtP1q9dlmdQ== Date: Thu, 13 Mar 2025 12:56:56 +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: <20250313125656.70448d09@booty> In-Reply-To: <20250207-ingenious-daffodil-dugong-51be57@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> Organization: Bootlin X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdejkeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfgjfhhoofggtgfgsehtjeertdertddvnecuhfhrohhmpefnuhgtrgcuvegvrhgvshholhhiuceolhhutggrrdgtvghrvghsohhlihessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnheptdeljeejuddvudetffdtudelfedugfduledtueffuedufefgudegkeegtdeihedunecuffhomhgrihhnpehkvghrnhgvlhdrohhrghdpsghoohhtlhhinhdrtghomhenucfkphepvdgrtddvmeeijedtmedvtddvtdemvggrtddumegrtddtvdemudgsrgejmeegkehfjeemudeltgehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddvmeeijedtmedvtddvtdemvggrtddumegrtddtvdemudgsrgejmeegkehfjeemudeltgehpdhhvghlohepsghoohhthidpmhgrihhlfhhrohhmpehluhgtrgdrtggvrhgvshholhhisegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopeefjedprhgtphhtthhopehmrhhiphgrrhgusehkvghrnhgvlhdrohhrghdprhgtphhtthhopehsihhmohhnrgesfhhffihllhdrtghhpdhrtghpthhtohepihhnkhhirdgurggvsehsrghmshhun hhgrdgtohhmpdhrtghpthhtohepjhgrghgrnhesrghmrghruhhlrghsohhluhhtihhonhhsrdgtohhmpdhrtghpthhtohepmhdrshiihihprhhofihskhhisehsrghmshhunhhgrdgtohhmpdhrtghpthhtoheptggrthgrlhhinhdrmhgrrhhinhgrshesrghrmhdrtghomhdprhgtphhtthhopeifihhllheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhhrgifnhhguhhosehkvghrnhgvlhdrohhrgh X-GND-Sasl: luca.ceresoli@bootlin.com Hello Maxime, On Fri, 7 Feb 2025 12:47:51 +0100 Maxime Ripard wrote: > Hi, > > 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). Luca [0] https://lore.kernel.org/all/20250312-drm-panel-v1-0-e99cd69f6136@redhat.com/ -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com