From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 04/19] drm: Pass the format info to .fb_create()
Date: Fri, 4 Jul 2025 12:56:07 +0300 [thread overview]
Message-ID: <aGekmsSgxh0VCxt8@intel.com> (raw)
In-Reply-To: <20250701191801.GA17819@pendragon.ideasonboard.com>
On Tue, Jul 01, 2025 at 10:18:01PM +0300, Laurent Pinchart wrote:
> Hi Ville,
>
> Thank you for the patch.
>
> On Tue, Jul 01, 2025 at 12:07:07PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Pass along the format information from the top to .fb_create()
> > so that we can avoid redundant (and somewhat expensive) lookups
> > in the drivers.
> >
> > Done with cocci (with some manual fixups):
> > @@
> > identifier func =~ ".*create.*";
> > identifier dev, file, mode_cmd;
> > @@
> > struct drm_framebuffer *func(
> > struct drm_device *dev,
> > struct drm_file *file,
> > + const struct drm_format_info *info,
> > const struct drm_mode_fb_cmd2 *mode_cmd)
> > {
> > ...
> > (
> > - const struct drm_format_info *info = drm_get_format_info(...);
> > |
> > - const struct drm_format_info *info;
> > ...
> > - info = drm_get_format_info(...);
> > )
> > <...
> > - if (!info)
> > - return ...;
> > ...>
> > }
> >
> > @@
> > identifier func =~ ".*create.*";
> > identifier dev, file, mode_cmd;
> > @@
> > struct drm_framebuffer *func(
> > struct drm_device *dev,
> > struct drm_file *file,
> > + const struct drm_format_info *info,
> > const struct drm_mode_fb_cmd2 *mode_cmd)
> > {
> > ...
> > }
> >
> > @find@
> > identifier fb_create_func =~ ".*create.*";
> > identifier dev, file, mode_cmd;
> > @@
> > struct drm_framebuffer *fb_create_func(
> > struct drm_device *dev,
> > struct drm_file *file,
> > + const struct drm_format_info *info,
> > const struct drm_mode_fb_cmd2 *mode_cmd);
> >
> > @@
> > identifier find.fb_create_func;
> > expression dev, file, mode_cmd;
> > @@
> > fb_create_func(dev, file
> > + ,info
> > ,mode_cmd)
> >
> > @@
> > expression dev, file, mode_cmd;
> > @@
> > drm_gem_fb_create(dev, file
> > + ,info
> > ,mode_cmd)
> >
> > @@
> > expression dev, file, mode_cmd;
> > @@
> > drm_gem_fb_create_with_dirty(dev, file
> > + ,info
> > ,mode_cmd)
> >
> > @@
> > expression dev, file_priv, mode_cmd;
> > identifier info, fb;
> > @@
> > info = drm_get_format_info(...);
> > ...
> > fb = dev->mode_config.funcs->fb_create(dev, file_priv
> > + ,info
> > ,mode_cmd);
> >
> > @@
> > identifier dev, file_priv, mode_cmd;
> > @@
> > struct drm_mode_config_funcs {
> > ...
> > struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
> > struct drm_file *file_priv,
> > + const struct drm_format_info *info,
> > const struct drm_mode_fb_cmd2 *mode_cmd);
> > ...
> > };
> >
> > v2: Fix kernel docs (Laurent)
> > Fix commit msg (Geert)
> >
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: Russell King <linux@armlinux.org.uk>
> > Cc: Inki Dae <inki.dae@samsung.com>
> > Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
> > Cc: Kyungmin Park <kyungmin.park@samsung.com>
> > Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
> > Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> > Cc: Philipp Zabel <p.zabel@pengutronix.de>
> > Cc: Rob Clark <robdclark@gmail.com>
> > Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
> > Cc: Dmitry Baryshkov <lumag@kernel.org>
> > Cc: Sean Paul <sean@poorly.run>
> > Cc: Marijn Suijten <marijn.suijten@somainline.org>
> > Cc: Marek Vasut <marex@denx.de>
> > Cc: Stefan Agner <stefan@agner.ch>
> > Cc: Lyude Paul <lyude@redhat.com>
> > Cc: Danilo Krummrich <dakr@kernel.org>
> > Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> > Cc: Dave Airlie <airlied@redhat.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> > Cc: Biju Das <biju.das.jz@bp.renesas.com>
> > Cc: Sandy Huang <hjc@rock-chips.com>
> > Cc: "Heiko Stübner" <heiko@sntech.de>
> > Cc: Andy Yan <andy.yan@rock-chips.com>
> > Cc: Thierry Reding <thierry.reding@gmail.com>
> > Cc: Mikko Perttunen <mperttunen@nvidia.com>
> > Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
> > Cc: "Maíra Canal" <mcanal@igalia.com>
> > Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
> > Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> > Cc: Gurchetan Singh <gurchetansingh@chromium.org>
> > Cc: Chia-I Wu <olvaffe@gmail.com>
> > Cc: Zack Rusin <zack.rusin@broadcom.com>
> > Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
> > Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> > Cc: amd-gfx@lists.freedesktop.org
> > Cc: linux-arm-msm@vger.kernel.org
> > Cc: freedreno@lists.freedesktop.org
> > Cc: nouveau@lists.freedesktop.org
> > Cc: virtualization@lists.linux.dev
> > Cc: spice-devel@lists.freedesktop.org
> > Cc: linux-renesas-soc@vger.kernel.org
> > Cc: linux-tegra@vger.kernel.org
> > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 +
> > drivers/gpu/drm/amd/amdgpu/amdgpu_display.h | 1 +
> > .../gpu/drm/arm/display/komeda/komeda_framebuffer.c | 1 +
> > .../gpu/drm/arm/display/komeda/komeda_framebuffer.h | 1 +
> > drivers/gpu/drm/arm/malidp_drv.c | 3 ++-
> > drivers/gpu/drm/armada/armada_fb.c | 6 ++----
> > drivers/gpu/drm/armada/armada_fb.h | 3 ++-
> > drivers/gpu/drm/drm_framebuffer.c | 2 +-
> > drivers/gpu/drm/drm_gem_framebuffer_helper.c | 4 ++++
> > drivers/gpu/drm/exynos/exynos_drm_fb.c | 4 +---
> > drivers/gpu/drm/gma500/framebuffer.c | 1 +
> > drivers/gpu/drm/i915/display/intel_fb.c | 1 +
> > drivers/gpu/drm/i915/display/intel_fb.h | 1 +
> > drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 5 +++--
> > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 ++-----
> > drivers/gpu/drm/msm/msm_drv.h | 3 ++-
> > drivers/gpu/drm/msm/msm_fb.c | 6 ++----
> > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 10 ++--------
> > drivers/gpu/drm/nouveau/nouveau_display.c | 1 +
> > drivers/gpu/drm/nouveau/nouveau_display.h | 1 +
> > drivers/gpu/drm/omapdrm/omap_fb.c | 6 ++----
> > drivers/gpu/drm/omapdrm/omap_fb.h | 3 ++-
> > drivers/gpu/drm/qxl/qxl_display.c | 1 +
> > drivers/gpu/drm/radeon/radeon_display.c | 1 +
> > drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 3 ++-
> > drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c | 3 ++-
> > drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.c | 3 ++-
> > drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 7 +------
> > drivers/gpu/drm/tegra/drm.h | 1 +
> > drivers/gpu/drm/tegra/fb.c | 4 +---
> > drivers/gpu/drm/tests/drm_framebuffer_test.c | 1 +
> > drivers/gpu/drm/vc4/vc4_kms.c | 3 ++-
> > drivers/gpu/drm/virtio/virtgpu_display.c | 1 +
> > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 1 +
> > drivers/gpu/drm/xen/xen_drm_front_kms.c | 1 +
> > drivers/gpu/drm/xlnx/zynqmp_kms.c | 3 ++-
> > include/drm/drm_gem_framebuffer_helper.h | 3 +++
> > include/drm/drm_mode_config.h | 1 +
> > 38 files changed, 59 insertions(+), 49 deletions(-)
>
> [snip]
>
> > diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
> > index e971e1b8a850..2e848b816218 100644
> > --- a/include/drm/drm_mode_config.h
> > +++ b/include/drm/drm_mode_config.h
> > @@ -82,6 +82,7 @@ struct drm_mode_config_funcs {
> > */
>
> It would be nice to document the new parameter here. With that
> addressed,
None of the existing parameters are documented (for any of the
mode_config hooks actually), so I think we'd need a separate
patch to deal with this.
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>
> > struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
> > struct drm_file *file_priv,
> > + const struct drm_format_info *info,
> > const struct drm_mode_fb_cmd2 *mode_cmd);
> >
> > /**
>
> --
> Regards,
>
> Laurent Pinchart
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-07-04 9:56 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 9:07 [PATCH v2 00/19] drm: Eliminate redundant drm_format_info lookups Ville Syrjala
2025-07-01 9:07 ` [PATCH v2 01/19] drm: Pass pixel_format+modifier to .get_format_info() Ville Syrjala
2025-07-01 18:49 ` Laurent Pinchart
2025-07-01 9:07 ` [PATCH v2 02/19] drm: Pass pixel_format+modifier directly to drm_get_format_info() Ville Syrjala
2025-07-01 16:31 ` Liviu Dudau
2025-07-01 9:07 ` [PATCH v2 03/19] drm: Look up the format info earlier Ville Syrjala
2025-07-01 9:07 ` [PATCH v2 04/19] drm: Pass the format info to .fb_create() Ville Syrjala
2025-07-01 9:07 ` Ville Syrjala
2025-07-01 11:02 ` Dmitry Baryshkov
2025-07-01 16:39 ` Liviu Dudau
2025-07-01 19:18 ` Laurent Pinchart
2025-07-04 9:56 ` Ville Syrjälä [this message]
2025-07-01 9:07 ` [PATCH v2 05/19] drm: Allow the caller to pass in the format info to drm_helper_mode_fill_fb_struct() Ville Syrjala
2025-07-01 11:05 ` Dmitry Baryshkov
2025-07-01 16:41 ` Liviu Dudau
2025-07-01 9:07 ` [PATCH v2 06/19] drm/malidp: Pass along the format info from .fb_create() malidp_verify_afbc_framebuffer_size() Ville Syrjala
2025-07-01 16:45 ` Liviu Dudau
2025-07-01 9:07 ` [PATCH v2 07/19] drm/gem: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct() Ville Syrjala
2025-07-01 19:20 ` Laurent Pinchart
2025-07-01 9:07 ` [PATCH v2 08/19] drm/gem/afbc: Eliminate redundant drm_get_format_info() Ville Syrjala
2025-07-01 9:07 ` [PATCH v2 09/19] drm/amdgpu: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct() Ville Syrjala
2025-07-15 18:25 ` Deucher, Alexander
2025-07-01 9:07 ` [PATCH v2 10/19] drm/armada: " Ville Syrjala
2025-07-01 9:07 ` [PATCH v2 11/19] drm/exynos: " Ville Syrjala
2025-07-01 9:07 ` [PATCH v2 12/19] drm/gma500: " Ville Syrjala
2025-07-02 5:28 ` Patrik Jakobsson
2025-07-01 9:07 ` [PATCH v2 13/19] drm/i915: " Ville Syrjala
2025-07-15 19:32 ` Rodrigo Vivi
2025-07-01 9:07 ` [PATCH v2 14/19] drm/komeda: " Ville Syrjala
2025-07-01 16:46 ` Liviu Dudau
2025-07-01 9:07 ` [PATCH v2 15/19] drm/msm: " Ville Syrjala
2025-07-01 9:07 ` [PATCH v2 16/19] drm/tegra: " Ville Syrjala
2025-07-01 9:07 ` [PATCH v2 17/19] drm/virtio: " Ville Syrjala
2025-07-01 9:07 ` [PATCH v2 18/19] drm/vmwgfx: " Ville Syrjala
2025-07-01 9:07 ` [PATCH v2 19/19] drm: Make passing of format info to drm_helper_mode_fill_fb_struct() mandatory Ville Syrjala
2025-07-22 13:41 ` Mark Brown
2025-07-25 13:36 ` Mark Brown
2025-07-25 14:23 ` Imre Deak
2025-07-25 17:52 ` Mark Brown
2025-07-28 10:22 ` Imre Deak
2025-08-12 21:33 ` Timur Tabi
2025-08-13 8:05 ` Imre Deak
2025-08-13 19:25 ` Timur Tabi
2025-07-01 10:29 ` ✗ CI.checkpatch: warning for drm: Eliminate redundant drm_format_info lookups (rev7) Patchwork
2025-07-01 10:30 ` ✓ CI.KUnit: success " Patchwork
2025-07-01 10:45 ` ✗ CI.checksparse: warning " Patchwork
2025-07-01 11:11 ` ✓ Xe.CI.BAT: success " Patchwork
2025-07-01 11:41 ` ✗ i915.CI.BAT: failure " Patchwork
2025-07-16 18:22 ` [PATCH v2 00/19] drm: Eliminate redundant drm_format_info lookups Ville Syrjälä
-- strict thread matches above, loose matches on Subject: below --
2025-04-10 16:32 [PATCH 04/19] drm: Pass the format info to .fb_create() Ville Syrjala
2025-04-11 19:29 ` [PATCH v2 " Ville Syrjala
2025-04-11 19:29 ` Ville Syrjala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aGekmsSgxh0VCxt8@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.