[PATCH 2/3] drm/i915/pin: s/dev_priv/i915/ and drop struct drm_device usage

Jani Nikula
2026-04-07T10:04:54Z

Improve consistency within i915_fb_pin.c by replacing dev_priv naming
with i915, and dropping struct drm_device usage.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/i915_fb_pin.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_fb_pin.c b/drivers/gpu/drm/i915/i915_fb_pin.c
index 580acbb14ada..9ef10cb3e3aa 100644
--- a/drivers/gpu/drm/i915/i915_fb_pin.c
+++ b/drivers/gpu/drm/i915/i915_fb_pin.c
@@ -30,9 +30,8 @@ intel_fb_pin_to_dpt(const struct drm_framebuffer *fb,
unsigned long *out_flags,
struct intel_dpt *dpt)
{
- struct drm_device *dev = fb->dev;
- struct intel_display *display = to_intel_display(dev);
- struct drm_i915_private *dev_priv = to_i915(dev);
+ struct intel_display *display = to_intel_display(fb->dev);
+ struct drm_i915_private *i915 = to_i915(fb->dev);
struct drm_gem_object *_obj = intel_fb_bo(fb);
struct drm_i915_gem_object *obj = to_intel_bo(_obj);
struct i915_address_space *vm = i915_dpt_to_vm(dpt);
@@ -44,7 +43,7 @@ intel_fb_pin_to_dpt(const struct drm_framebuffer *fb,
* We are not syncing against the binding (and potential migrations)
* below, so this vm must never be async.
*/
- if (drm_WARN_ON(&dev_priv->drm, vm->bind_async_flags))
+ if (drm_WARN_ON(&i915->drm, vm->bind_async_flags))
return ERR_PTR(-EINVAL);

if (WARN_ON(!i915_gem_object_is_framebuffer(obj)))
@@ -57,7 +56,7 @@ intel_fb_pin_to_dpt(const struct drm_framebuffer *fb,
if (ret)
continue;

- if (HAS_LMEM(dev_priv)) {
+ if (HAS_LMEM(i915)) {
unsigned int flags = obj->flags;

/*
@@ -119,9 +118,8 @@ intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
bool uses_fence,
unsigned long *out_flags)
{
- struct drm_device *dev = fb->dev;
- struct intel_display *display = to_intel_display(dev);
- struct drm_i915_private *dev_priv = to_i915(dev);
+ struct intel_display *display = to_intel_display(fb->dev);
+ struct drm_i915_private *i915 = to_i915(fb->dev);
struct drm_gem_object *_obj = intel_fb_bo(fb);
struct drm_i915_gem_object *obj = to_intel_bo(_obj);
struct ref_tracker *wakeref;
@@ -130,10 +128,10 @@ intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
unsigned int pinctl;
int ret;

- if (drm_WARN_ON(dev, !i915_gem_object_is_framebuffer(obj)))
+ if (drm_WARN_ON(&i915->drm, !i915_gem_object_is_framebuffer(obj)))
return ERR_PTR(-EINVAL);

- if (drm_WARN_ON(dev, alignment && !is_power_of_2(alignment)))
+ if (drm_WARN_ON(&i915->drm, alignment && !is_power_of_2(alignment)))
return ERR_PTR(-EINVAL);

/*
@@ -164,7 +162,7 @@ intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
ret = i915_gem_object_lock(obj, &ww);
if (!ret && phys_alignment)
ret = i915_gem_object_attach_phys(obj, phys_alignment);
- else if (!ret && HAS_LMEM(dev_priv))
+ else if (!ret && HAS_LMEM(i915))
ret = i915_gem_object_migrate(obj, &ww, INTEL_REGION_LMEM_0);
if (!ret)
ret = i915_gem_object_pin_pages(obj);
@@ -265,7 +263,7 @@ intel_plane_fb_vtd_guard(const struct intel_plane_state *plane_state)
int intel_plane_pin_fb(struct intel_plane_state *plane_state,
const struct intel_plane_state *old_plane_state)
{
- struct intel_display *display = to_intel_display(plane_state);
+ struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev);
struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
const struct intel_framebuffer *fb =
to_intel_framebuffer(plane_state->hw.fb);
@@ -309,7 +307,7 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state,
* The DPT object contains only one vma, and there is no VT-d
* guard, so the VMA's offset within the DPT is always 0.
*/
- drm_WARN_ON(display->drm, i915_dpt_offset(plane_state->dpt_vma));
+ drm_WARN_ON(&i915->drm, i915_dpt_offset(plane_state->dpt_vma));
}

/*
--
2.47.3