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 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 E1C13C8303F for ; Tue, 1 Jul 2025 16:46:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A2AA910E5D9; Tue, 1 Jul 2025 16:46:01 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 6875F10E5D9 for ; Tue, 1 Jul 2025 16:46:00 +0000 (UTC) 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 AFEE82B for ; Tue, 1 Jul 2025 09:45:44 -0700 (PDT) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BDB053F58B for ; Tue, 1 Jul 2025 09:45:59 -0700 (PDT) Date: Tue, 1 Jul 2025 17:45:55 +0100 From: Liviu Dudau To: Ville Syrjala Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Thomas Zimmermann Subject: Re: [PATCH v2 06/19] drm/malidp: Pass along the format info from .fb_create() malidp_verify_afbc_framebuffer_size() Message-ID: References: <20250701090722.13645-1-ville.syrjala@linux.intel.com> <20250701090722.13645-7-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250701090722.13645-7-ville.syrjala@linux.intel.com> X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Tue, Jul 01, 2025 at 12:07:09PM +0300, Ville Syrjala wrote: > From: Ville Syrjälä > > Plumb the format info from .fb_create() all the way to > malidp_verify_afbc_framebuffer_size() to avoid the > redundant lookup. > > Cc: Liviu Dudau > Reviewed-by: Thomas Zimmermann > Signed-off-by: Ville Syrjälä Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/arm/malidp_drv.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c > index 8b920566f2e8..bc5f5e9798c3 100644 > --- a/drivers/gpu/drm/arm/malidp_drv.c > +++ b/drivers/gpu/drm/arm/malidp_drv.c > @@ -306,10 +306,10 @@ malidp_verify_afbc_framebuffer_caps(struct drm_device *dev, > static bool > malidp_verify_afbc_framebuffer_size(struct drm_device *dev, > struct drm_file *file, > + const struct drm_format_info *info, > const struct drm_mode_fb_cmd2 *mode_cmd) > { > int n_superblocks = 0; > - const struct drm_format_info *info; > struct drm_gem_object *objs = NULL; > u32 afbc_superblock_size = 0, afbc_superblock_height = 0; > u32 afbc_superblock_width = 0, afbc_size = 0; > @@ -325,9 +325,6 @@ malidp_verify_afbc_framebuffer_size(struct drm_device *dev, > return false; > } > > - info = drm_get_format_info(dev, mode_cmd->pixel_format, > - mode_cmd->modifier[0]); > - > n_superblocks = (mode_cmd->width / afbc_superblock_width) * > (mode_cmd->height / afbc_superblock_height); > > @@ -367,10 +364,11 @@ malidp_verify_afbc_framebuffer_size(struct drm_device *dev, > > static bool > malidp_verify_afbc_framebuffer(struct drm_device *dev, struct drm_file *file, > + const struct drm_format_info *info, > const struct drm_mode_fb_cmd2 *mode_cmd) > { > if (malidp_verify_afbc_framebuffer_caps(dev, mode_cmd)) > - return malidp_verify_afbc_framebuffer_size(dev, file, mode_cmd); > + return malidp_verify_afbc_framebuffer_size(dev, file, info, mode_cmd); > > return false; > } > @@ -381,7 +379,7 @@ malidp_fb_create(struct drm_device *dev, struct drm_file *file, > const struct drm_mode_fb_cmd2 *mode_cmd) > { > if (mode_cmd->modifier[0]) { > - if (!malidp_verify_afbc_framebuffer(dev, file, mode_cmd)) > + if (!malidp_verify_afbc_framebuffer(dev, file, info, mode_cmd)) > return ERR_PTR(-EINVAL); > } > > -- > 2.49.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯