Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 03/10] drm/{i915,xe}/fbdev: pass struct drm_device to intel_fbdev_fb_alloc()
Date: Thu, 18 Sep 2025 20:39:10 +0300	[thread overview]
Message-ID: <aMxDvgl6yx7bFGaj@intel.com> (raw)
In-Reply-To: <16360584f80cdc5ee35fd94cfd92fd3955588dfd.1758184771.git.jani.nikula@intel.com>

On Thu, Sep 18, 2025 at 11:40:53AM +0300, Jani Nikula wrote:
> The function doesn't actually need struct drm_fb_helper for anything,
> just pass struct drm_device.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_fbdev.c    |  2 +-
>  drivers/gpu/drm/i915/display/intel_fbdev_fb.c | 10 +++++-----
>  drivers/gpu/drm/i915/display/intel_fbdev_fb.h |  4 ++--
>  drivers/gpu/drm/xe/display/intel_fbdev_fb.c   |  7 +++----
>  4 files changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index 7c4709d58aa3..46c6de5f6088 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -237,7 +237,7 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
>  	if (!fb || drm_WARN_ON(display->drm, !intel_fb_bo(&fb->base))) {
>  		drm_dbg_kms(display->drm,
>  			    "no BIOS fb, allocating a new one\n");
> -		fb = intel_fbdev_fb_alloc(helper, sizes);
> +		fb = intel_fbdev_fb_alloc(display->drm, sizes);
>  		if (IS_ERR(fb))
>  			return PTR_ERR(fb);
>  	} else {
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev_fb.c b/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
> index b9dfd00a7d05..4de13d1a4c7a 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
> @@ -13,11 +13,11 @@
>  #include "intel_fb.h"
>  #include "intel_fbdev_fb.h"
>  
> -struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
> +struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_device *drm,
>  					       struct drm_fb_helper_surface_size *sizes)
>  {
> -	struct intel_display *display = to_intel_display(helper->dev);
> -	struct drm_i915_private *dev_priv = to_i915(display->drm);
> +	struct intel_display *display = to_intel_display(drm);
> +	struct drm_i915_private *dev_priv = to_i915(drm);
>  	struct drm_framebuffer *fb;
>  	struct drm_mode_fb_cmd2 mode_cmd = {};
>  	struct drm_i915_gem_object *obj;
> @@ -58,12 +58,12 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
>  	}
>  
>  	if (IS_ERR(obj)) {
> -		drm_err(display->drm, "failed to allocate framebuffer (%pe)\n", obj);
> +		drm_err(drm, "failed to allocate framebuffer (%pe)\n", obj);
>  		return ERR_PTR(-ENOMEM);
>  	}
>  
>  	fb = intel_framebuffer_create(intel_bo_to_drm_bo(obj),
> -				      drm_get_format_info(display->drm,
> +				      drm_get_format_info(drm,
>  							  mode_cmd.pixel_format,
>  							  mode_cmd.modifier[0]),
>  				      &mode_cmd);
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev_fb.h b/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
> index cb7957272715..668ae355f5e5 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
> @@ -6,14 +6,14 @@
>  #ifndef __INTEL_FBDEV_FB_H__
>  #define __INTEL_FBDEV_FB_H__
>  
> -struct drm_fb_helper;
> +struct drm_device;
>  struct drm_fb_helper_surface_size;
>  struct drm_gem_object;
>  struct fb_info;
>  struct i915_vma;
>  struct intel_display;
>  
> -struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
> +struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_device *drm,
>  					       struct drm_fb_helper_surface_size *sizes);
>  int intel_fbdev_fb_fill_info(struct intel_display *display, struct fb_info *info,
>  			     struct drm_gem_object *obj, struct i915_vma *vma);
> diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> index bce4cb16f682..5c0874bfa6ab 100644
> --- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> +++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> @@ -15,12 +15,11 @@
>  
>  #include <generated/xe_wa_oob.h>
>  
> -struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
> +struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_device *drm,
>  					       struct drm_fb_helper_surface_size *sizes)
>  {
>  	struct drm_framebuffer *fb;
> -	struct drm_device *dev = helper->dev;
> -	struct xe_device *xe = to_xe_device(dev);
> +	struct xe_device *xe = to_xe_device(drm);
>  	struct drm_mode_fb_cmd2 mode_cmd = {};
>  	struct xe_bo *obj;
>  	int size;
> @@ -67,7 +66,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
>  	}
>  
>  	fb = intel_framebuffer_create(&obj->ttm.base,
> -				      drm_get_format_info(dev,
> +				      drm_get_format_info(drm,
>  							  mode_cmd.pixel_format,
>  							  mode_cmd.modifier[0]),
>  				      &mode_cmd);
> -- 
> 2.47.3

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-09-18 17:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18  8:40 [PATCH v2 00/10] drm/{i915,xe}/fbdev: refactor Jani Nikula
2025-09-18  8:40 ` [PATCH v2 01/10] drm/xe/fbdev: use the same 64-byte stride alignment as i915 Jani Nikula
2025-09-18 17:38   ` Ville Syrjälä
2025-09-18  8:40 ` [PATCH v2 02/10] drm/i915/fbdev: make intel_framebuffer_create() error return handling explicit Jani Nikula
2025-09-18 17:38   ` Ville Syrjälä
2025-09-18  8:40 ` [PATCH v2 03/10] drm/{i915, xe}/fbdev: pass struct drm_device to intel_fbdev_fb_alloc() Jani Nikula
2025-09-18 17:39   ` Ville Syrjälä [this message]
2025-09-18  8:40 ` [PATCH v2 04/10] drm/{i915, xe}/fbdev: deduplicate struct drm_mode_fb_cmd2 init Jani Nikula
2025-09-18 17:40   ` [PATCH v2 04/10] drm/{i915,xe}/fbdev: " Ville Syrjälä
2025-09-18  8:40 ` [PATCH v2 05/10] drm/i915/fbdev: abstract bo creation Jani Nikula
2025-09-18 17:42   ` Ville Syrjälä
2025-09-18  8:40 ` [PATCH v2 06/10] drm/xe/fbdev: " Jani Nikula
2025-09-18 17:42   ` Ville Syrjälä
2025-09-18  8:40 ` [PATCH v2 07/10] drm/{i915, xe}/fbdev: add intel_fbdev_fb_bo_destroy() Jani Nikula
2025-09-18 17:43   ` [PATCH v2 07/10] drm/{i915,xe}/fbdev: " Ville Syrjälä
2025-09-18  8:40 ` [PATCH v2 08/10] drm/{i915,xe}/fbdev: deduplicate fbdev creation Jani Nikula
2025-09-18 17:44   ` Ville Syrjälä
2025-09-18  8:40 ` [PATCH v2 09/10] drm/{i915, xe}/fbdev: pass struct drm_device to intel_fbdev_fb_fill_info() Jani Nikula
2025-09-18 17:45   ` [PATCH v2 09/10] drm/{i915,xe}/fbdev: " Ville Syrjälä
2025-09-18  8:41 ` [PATCH v2 10/10] drm/i915/fbdev: drop dependency on display in i915 specific code Jani Nikula
2025-09-18 17:50   ` Ville Syrjälä
2025-09-19  7:00     ` Jani Nikula
2025-09-18  8:59 ` ✓ CI.KUnit: success for drm/{i915,xe}/fbdev: refactor (rev2) Patchwork
2025-09-18  9:33 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-18 15:54 ` ✓ Xe.CI.Full: " Patchwork

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=aMxDvgl6yx7bFGaj@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox