Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15125127rwd; Sun, 25 Jun 2023 10:39:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7VfEkmqD+RGp8R4MPpZZsggCtpadX36DDmp15EshyZIDww1znQsR/sm1lwU2uMfYB7aYru X-Received: by 2002:a17:907:6289:b0:987:1df4:f32e with SMTP id nd9-20020a170907628900b009871df4f32emr20439988ejc.28.1687714793885; Sun, 25 Jun 2023 10:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687714793; cv=none; d=google.com; s=arc-20160816; b=PkaomWI7Lgu75MNGQEqRRYLMlCFmA/M5H2VTMWuHF1LWtpJ8TgwAZ2eCHw/jj9K/rQ gPOk29QPSRHtQSrWhyMzsYv1K0rrdIBRfxMwd5g1MlFYUNjvg080aSfTYDaaq+AVVdQ1 eGqAkl2S/TZ0JbC32SGKjfvj4bHl/FzIt8+VE6TrQqRmVMFAEkz+hvQxSbw4a0KTsZ77 WrhavtqzCPoauKDAKm6rG2M7MJXoHC4uGqEcRShOZLlUAhUgjTRRjGb73dP5A0z0L/jW DxDYfbVuEvsE2UkcsdVhnZLThGEWBa1hG6l6RmPOPh6Nt2PmUXEOA6yOrD3k0XhjkxAX rfgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9PIOfQTTwvxGwEoFDvze7IR7k3SuCml6NYx5RSCHcNc=; fh=AWoMoh5idy/FHgeAz7YSte/xnllPGJfrwmSwrK5ttFc=; b=gQPVkgun8cpmWZ0lHux8xMKa1h2v/+frajbLrmucOgPMPI/xZKGBQt/KvyM47UQFJY U6uDwPGHw4Ik+kCL+puAAcoKxdB7LrPbJyGOOt/oyhVdliGuPBasE7zysU3rdwVen1Jh wvvC83ynsUcyA266AuySLu7PF7n6FyKfRu3mz3j6Ld+htmUVVt8+rBc+0hxfrBtRtl5/ XQ8gs5gGtnj3rLSIOveN9TgVl96HHdiWzmxMGzPlZd4MXD5VuH0tYTsIjKSCFVKAKP8S Bn2LSC3BUmiPzQnrbvLOsn7VUvREcVBva4za17vbIjAbBTY9Vqd6ezOGmaF3A9ira+VO zyXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=X9W6i3tI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020a1709064d0700b00988aaf63eb7si1925085eju.354.2023.06.25.10.39.29; Sun, 25 Jun 2023 10:39:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=X9W6i3tI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbjFYQ46 (ORCPT + 99 others); Sun, 25 Jun 2023 12:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjFYQ44 (ORCPT ); Sun, 25 Jun 2023 12:56:56 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B073100; Sun, 25 Jun 2023 09:56:55 -0700 (PDT) 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 Cc: Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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