[PATCH v2 2/5] drm/{i915, xe}/fbdev: drop drm device parameter from intel_fbdev_fb_fill_info()

Jani Nikula
2026-03-31T09:49:36Z

The struct drm_device *drm parameter of intel_fbdev_fb_fill_info() is
redundant, as you can obtain the same information via obj->dev. Drop the
drm parameter, and move obj as first (or the context) parameter.

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +-
drivers/gpu/drm/i915/display/intel_fbdev_fb.c | 8 ++++----
drivers/gpu/drm/i915/display/intel_fbdev_fb.h | 4 ++--
drivers/gpu/drm/xe/display/intel_fbdev_fb.c | 6 +++---
4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index bdaaf3edba0c..6401aaaba199 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -327,7 +327,7 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,

obj = intel_fb_bo(&fb->base);

- ret = intel_fbdev_fb_fill_info(display->drm, info, obj, vma);
+ ret = intel_fbdev_fb_fill_info(obj, info, vma);
if (ret)
goto out_unpin;

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev_fb.c b/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
index 6f84eb6355de..a696ce42d10b 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
@@ -66,10 +66,10 @@ void intel_fbdev_fb_bo_destroy(struct drm_gem_object *obj)
drm_gem_object_put(obj);
}

-int intel_fbdev_fb_fill_info(struct drm_device *drm, struct fb_info *info,
- struct drm_gem_object *_obj, struct i915_vma *vma)
+int intel_fbdev_fb_fill_info(struct drm_gem_object *_obj, struct fb_info *info,
+ struct i915_vma *vma)
{
- struct drm_i915_private *i915 = to_i915(drm);
+ struct drm_i915_private *i915 = to_i915(_obj->dev);
struct drm_i915_gem_object *obj = to_intel_bo(_obj);
struct i915_gem_ww_ctx ww;
void __iomem *vaddr;
@@ -101,7 +101,7 @@ int intel_fbdev_fb_fill_info(struct drm_device *drm, struct fb_info *info,

vaddr = i915_vma_pin_iomap(vma);
if (IS_ERR(vaddr)) {
- drm_err(drm,
+ drm_err(&i915->drm,
"Failed to remap framebuffer into virtual memory (%pe)\n", vaddr);
ret = PTR_ERR(vaddr);
continue;
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev_fb.h b/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
index 34ed2b9c2b4f..ddba45e9839d 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
+++ b/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
@@ -17,8 +17,8 @@ struct i915_vma;
u32 intel_fbdev_fb_pitch_align(u32 stride);
struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size);
void intel_fbdev_fb_bo_destroy(struct drm_gem_object *obj);
-int intel_fbdev_fb_fill_info(struct drm_device *drm, struct fb_info *info,
- struct drm_gem_object *obj, struct i915_vma *vma);
+int intel_fbdev_fb_fill_info(struct drm_gem_object *obj, struct fb_info *info,
+ struct i915_vma *vma);
bool intel_fbdev_fb_prefer_stolen(struct drm_device *drm, unsigned int size);

#endif
diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
index d7030e4d814c..23fa54ee781e 100644
--- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
+++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
@@ -91,11 +91,11 @@ void intel_fbdev_fb_bo_destroy(struct drm_gem_object *obj)
xe_bo_unpin_map_no_vm(gem_to_xe_bo(obj));
}

-int intel_fbdev_fb_fill_info(struct drm_device *drm, struct fb_info *info,
- struct drm_gem_object *_obj, struct i915_vma *vma)
+int intel_fbdev_fb_fill_info(struct drm_gem_object *_obj, struct fb_info *info,
+ struct i915_vma *vma)
{
struct xe_bo *obj = gem_to_xe_bo(_obj);
- struct pci_dev *pdev = to_pci_dev(drm->dev);
+ struct pci_dev *pdev = to_pci_dev(_obj->dev->dev);

if (!(obj->flags & XE_BO_FLAG_SYSTEM)) {
if (obj->flags & XE_BO_FLAG_STOLEN)
--
2.47.3