Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Dmitry Baryshkov <lumag@kernel.org>, Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org
Subject: [PATCH 15/19] drm/msm: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
Date: Thu, 10 Apr 2025 19:32:14 +0300	[thread overview]
Message-ID: <20250410163218.15130-16-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20250410163218.15130-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookups.

For the fbdev case a manual drm_get_format_info() lookup
is needed.

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: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/msm/msm_fb.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_fb.c b/drivers/gpu/drm/msm/msm_fb.c
index 0615427e85ce..d7bc4479547d 100644
--- a/drivers/gpu/drm/msm/msm_fb.c
+++ b/drivers/gpu/drm/msm/msm_fb.c
@@ -30,6 +30,7 @@ struct msm_framebuffer {
 #define to_msm_framebuffer(x) container_of(x, struct msm_framebuffer, base)
 
 static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
+		const struct drm_format_info *info,
 		const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos);
 
 static int msm_framebuffer_dirtyfb(struct drm_framebuffer *fb,
@@ -149,7 +150,7 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
 		}
 	}
 
-	fb = msm_framebuffer_init(dev, mode_cmd, bos);
+	fb = msm_framebuffer_init(dev, info, mode_cmd, bos);
 	if (IS_ERR(fb)) {
 		ret = PTR_ERR(fb);
 		goto out_unref;
@@ -164,11 +165,9 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
 }
 
 static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
+		const struct drm_format_info *info,
 		const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos)
 {
-	const struct drm_format_info *info = drm_get_format_info(dev,
-								 mode_cmd->pixel_format,
-								 mode_cmd->modifier[0]);
 	struct msm_drm_private *priv = dev->dev_private;
 	struct msm_kms *kms = priv->kms;
 	struct msm_framebuffer *msm_fb = NULL;
@@ -222,7 +221,7 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
 		msm_fb->base.obj[i] = bos[i];
 	}
 
-	drm_helper_mode_fill_fb_struct(dev, fb, NULL, mode_cmd);
+	drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd);
 
 	ret = drm_framebuffer_init(dev, fb, &msm_framebuffer_funcs);
 	if (ret) {
@@ -271,7 +270,10 @@ msm_alloc_stolen_fb(struct drm_device *dev, int w, int h, int p, uint32_t format
 
 	msm_gem_object_set_name(bo, "stolenfb");
 
-	fb = msm_framebuffer_init(dev, &mode_cmd, &bo);
+	fb = msm_framebuffer_init(dev,
+				  drm_get_format_info(dev, mode_cmd.pixel_format,
+						      mode_cmd.modifier[0]),
+				  &mode_cmd, &bo);
 	if (IS_ERR(fb)) {
 		DRM_DEV_ERROR(dev->dev, "failed to allocate fb\n");
 		/* note: if fb creation failed, we can't rely on fb destroy
-- 
2.49.0


  parent reply	other threads:[~2025-04-10 16:33 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 16:31 [PATCH 00/19] drm: Eliminate redundant drm_format_info lookups Ville Syrjala
2025-04-10 16:32 ` [PATCH 01/19] drm: Pass pixel_format+modifier to .get_format_info() Ville Syrjala
2025-04-10 19:27   ` Laurent Pinchart
2025-04-11  6:47     ` Ville Syrjälä
2025-04-11 19:19   ` [PATCH v2 " Ville Syrjala
2025-04-10 16:32 ` [PATCH 02/19] drm: Pass pixel_format+modifier directly to drm_get_format_info() Ville Syrjala
2025-04-10 19:31   ` Laurent Pinchart
2025-04-10 19:43   ` kernel test robot
2025-04-11  7:23   ` Thomas Zimmermann
2025-04-11 19:27   ` [PATCH v2 " Ville Syrjala
2025-04-10 16:32 ` [PATCH 03/19] drm: Look up the format info earlier Ville Syrjala
2025-04-10 19:33   ` Laurent Pinchart
2025-04-11  7:01     ` Ville Syrjälä
2025-04-11  7:18   ` Thomas Zimmermann
2025-04-11 19:27   ` [PATCH v2 " Ville Syrjala
2025-04-10 16:32 ` [PATCH 04/19] drm: Pass the format info to .fb_create() Ville Syrjala
2025-04-10 19:37   ` Laurent Pinchart
2025-04-10 21:26   ` kernel test robot
2025-04-11  6:36   ` Geert Uytterhoeven
2025-04-11 19:29   ` [PATCH v2 " Ville Syrjala
2025-04-10 16:32 ` [PATCH 05/19] drm: Allow the caller to pass in the format info to drm_helper_mode_fill_fb_struct() Ville Syrjala
2025-04-10 19:38   ` Laurent Pinchart
2025-04-10 16:32 ` [PATCH 06/19] drm/malidp: Pass along the format info from .fb_create() malidp_verify_afbc_framebuffer_size() Ville Syrjala
2025-04-10 16:32 ` [PATCH 07/19] drm/gem: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct() Ville Syrjala
2025-04-10 19:39   ` Laurent Pinchart
2025-04-10 22:58   ` kernel test robot
2025-04-11 19:31   ` [PATCH v2 " Ville Syrjala
2025-04-10 16:32 ` [PATCH 08/19] drm/gem/afbc: Eliminate redundant drm_get_format_info() Ville Syrjala
2025-04-10 16:32 ` [PATCH 09/19] drm/amdgpu: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct() Ville Syrjala
2025-04-10 16:32 ` [PATCH 10/19] drm/armada: " Ville Syrjala
2025-04-10 16:32 ` [PATCH 11/19] drm/exynos: " Ville Syrjala
2025-04-10 16:32 ` [PATCH 12/19] drm/gma500: " Ville Syrjala
2025-04-10 16:32 ` [PATCH 13/19] drm/i915: " Ville Syrjala
2025-04-10 16:32 ` [PATCH 14/19] drm/komeda: " Ville Syrjala
2025-04-10 16:32 ` Ville Syrjala [this message]
2025-04-10 19:28   ` [PATCH 15/19] drm/msm: " Dmitry Baryshkov
2025-04-10 16:32 ` [PATCH 16/19] drm/tegra: " Ville Syrjala
2025-04-10 16:32 ` [PATCH 17/19] drm/virtio: " Ville Syrjala
2025-04-16  6:44   ` Dmitry Osipenko
2025-04-10 16:32 ` [PATCH 18/19] drm/vmwgfx: " Ville Syrjala
2025-04-10 16:32 ` [PATCH 19/19] drm: Make passing of format info to drm_helper_mode_fill_fb_struct() mandatory Ville Syrjala
2025-04-10 19:40   ` Laurent Pinchart
2025-04-10 18:46 ` ✓ CI.Patch_applied: success for drm: Eliminate redundant drm_format_info lookups Patchwork
2025-04-10 18:47 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-10 18:48 ` ✓ CI.KUnit: success " Patchwork
2025-04-10 19:03 ` ✓ CI.Build: " Patchwork
2025-04-10 19:05 ` ✓ CI.Hooks: " Patchwork
2025-04-10 19:06 ` ✗ CI.checksparse: warning " Patchwork
2025-04-10 19:51 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-04-11  0:20 ` ✗ Xe.CI.Full: " Patchwork
2025-04-11  7:30 ` [PATCH 00/19] " Thomas Zimmermann
2025-04-11 19:54 ` ✓ CI.Patch_applied: success for drm: Eliminate redundant drm_format_info lookups (rev2) Patchwork
2025-04-11 19:54 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-11 19:56 ` ✓ CI.KUnit: success " Patchwork
2025-04-11 20:04 ` ✓ CI.Build: " Patchwork
2025-04-11 20:06 ` ✓ CI.Hooks: " Patchwork
2025-04-11 20:08 ` ✗ CI.checksparse: warning " Patchwork
2025-04-11 20:58 ` ✓ Xe.CI.BAT: success " Patchwork
2025-04-11 22:07 ` ✓ CI.Patch_applied: success for drm: Eliminate redundant drm_format_info lookups (rev6) Patchwork
2025-04-11 22:08 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-11 22:09 ` ✓ CI.KUnit: success " Patchwork
2025-04-11 22:18 ` ✓ CI.Build: " Patchwork
2025-04-11 22:20 ` ✓ CI.Hooks: " Patchwork
2025-04-11 22:22 ` ✗ CI.checksparse: warning " Patchwork
2025-04-11 22:48 ` ✓ Xe.CI.BAT: success " Patchwork
2025-04-11 23:03 ` ✗ Xe.CI.Full: failure for drm: Eliminate redundant drm_format_info lookups (rev2) Patchwork
2025-04-12  0:56 ` ✗ Xe.CI.Full: failure for drm: Eliminate redundant drm_format_info lookups (rev6) Patchwork
2025-07-15 18:21 ` [PATCH 00/19] drm: Eliminate redundant drm_format_info lookups Alex Deucher
2025-07-15 18:22   ` Alex Deucher

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=20250410163218.15130-16-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox