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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 A3657C0015E for ; Sun, 25 Jun 2023 16:57:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AB7B10E08D; Sun, 25 Jun 2023 16:56:57 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id B22E810E08D for ; Sun, 25 Jun 2023 16:56:55 +0000 (UTC) Received: from pendragon.ideasonboard.com (85-160-50-14.reb.o2.cz [85.160.50.14]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 34A2B4DB; Sun, 25 Jun 2023 18:56:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687712175; bh=A3AnVnOFjJh6d289gsuCnuuSpnAbQwPDVvq/TgXBLpU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X9W6i3tIHqxN6v1VSP4xm25Qb5Q1kjths2hfrZ8s/qsvH7acskBJlTmWj9hJ9U0lp vQDSBTaJgBNJcDSbnJyiqS3H45vn1Cs8D5On6q4V/G387yOtzZU4jH+gDU2DABxKTA rMMsD0MIbGKBHfhOrP9WPgxkBYpMJdSlbyjaRSOE= Date: Sun, 25 Jun 2023 19:56:51 +0300 From: Laurent Pinchart To: Geert Uytterhoeven Subject: Re: [PATCH 24/39] drm: renesas: shmobile: Unify plane allocation Message-ID: <20230625165651.GA13886@pendragon.ideasonboard.com> References: <95c2af42a89c65ca603126e56c0423407dfc873f.1687423204.git.geert+renesas@glider.be> <20230623165038.GB2112@pendragon.ideasonboard.com> <20230623185052.GR2112@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Magnus Damm , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Kieran Bingham , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Sun, Jun 25, 2023 at 10:58:17AM +0200, Geert Uytterhoeven wrote: > On Fri, Jun 23, 2023 at 8:50 PM Laurent Pinchart wrote: > > On Fri, Jun 23, 2023 at 07:55:22PM +0200, Geert Uytterhoeven wrote: > > > On Fri, Jun 23, 2023 at 6:50 PM Laurent Pinchart wrote: > > > > On Thu, Jun 22, 2023 at 11:21:36AM +0200, Geert Uytterhoeven wrote: > > > > > Unify primary and overlay plane allocation: > > > > > - Enhance shmob_drm_plane_create() so it can be used to create the > > > > > primary plane, too, > > > > > - Move overlay plane creation next to primary plane creation. > > > > > > > > > > As overlay plane index zero now means the primary plane, this requires > > > > > shifting all overlay plane indices by one. > > > > > > > > Do you use index zero to identify the primary plane just for > > > > shmob_drm_plane_create(), or somewhere else too ? If it's just to create > > > > the plane, you could instead pass the plane type to the function. > > > > > > Index zero is just used for the creation. > > > I guess this sort of goes together with my question below... > > > > > > > > Signed-off-by: Geert Uytterhoeven > > > > > --- > > > > > Perhaps it would be better to not use dynamic allocation, but store > > > > > "struct drm_plane primary" and "struct shmob_drm_plane planes[5]" in > > > > > struct drm_shmob_device instead, like is done for the crtc and encoder? > > > > > > ... as embedding separate primary and planes[] would also get rid of > > > the need to adjust the plane indices when converting from logical to physical > > > overlay plane indices. > > > > Do they need to be embedded for that, or could you simple keep the index > > as it is ? > > If the plane type would be passed explicitly, they would not need to be > embedded for that. > > Then the question becomes: does it make sense to unify primary and > overlay plane handling? Good point. I don't mind much either way, it depends on how much code duplication it would remove I suppose. -- Regards, Laurent Pinchart