Message ID | 20250402172240.9275-3-ville.syrjala@linux.intel.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | drm/i915: Precompute plane SURF address/etc. | expand |
On Wed, 02 Apr 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > We don't really need the extra intel_plane_ggtt_offset() wrapper > anymore. Get rid of it. > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/i915/display/intel_atomic_plane.c | 5 ----- > drivers/gpu/drm/i915/display/intel_atomic_plane.h | 2 -- > drivers/gpu/drm/i915/display/intel_fb_pin.c | 2 +- > drivers/gpu/drm/i915/display/intel_plane_initial.c | 2 +- > drivers/gpu/drm/xe/display/xe_fb_pin.c | 2 +- > drivers/gpu/drm/xe/display/xe_plane_initial.c | 2 +- > 6 files changed, 4 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > index 7276179df878..264a50b29c16 100644 > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > @@ -1565,8 +1565,3 @@ int intel_atomic_check_planes(struct intel_atomic_state *state) > > return 0; > } > - > -u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state) > -{ > - return i915_ggtt_offset(plane_state->ggtt_vma); > -} > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h > index 6efac923dcbc..65edd88d28a9 100644 > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h > @@ -88,6 +88,4 @@ int intel_atomic_add_affected_planes(struct intel_atomic_state *state, > struct intel_crtc *crtc); > int intel_atomic_check_planes(struct intel_atomic_state *state); > > -u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state); > - > #endif /* __INTEL_ATOMIC_PLANE_H__ */ > diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.c b/drivers/gpu/drm/i915/display/intel_fb_pin.c > index fb7d0c8b9302..f2d8675dd98a 100644 > --- a/drivers/gpu/drm/i915/display/intel_fb_pin.c > +++ b/drivers/gpu/drm/i915/display/intel_fb_pin.c > @@ -311,7 +311,7 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state, > plane_state->surf = i915_gem_object_get_dma_address(obj, 0) + > plane->surf_offset(plane_state); > } else { > - plane_state->surf = intel_plane_ggtt_offset(plane_state) + > + plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma) + > plane->surf_offset(plane_state); > } > > diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c > index 1c49610eb42f..3afff528a7bd 100644 > --- a/drivers/gpu/drm/i915/display/intel_plane_initial.c > +++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c > @@ -356,7 +356,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc, > i915_vma_pin_fence(vma) == 0 && vma->fence) > plane_state->flags |= PLANE_HAS_FENCE; > > - plane_state->surf = intel_plane_ggtt_offset(plane_state); > + plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma); > > plane_state->uapi.src_x = 0; > plane_state->uapi.src_y = 0; > diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c b/drivers/gpu/drm/xe/display/xe_fb_pin.c > index b9c45a5a3d82..b2e979805455 100644 > --- a/drivers/gpu/drm/xe/display/xe_fb_pin.c > +++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c > @@ -438,7 +438,7 @@ int intel_plane_pin_fb(struct intel_plane_state *new_plane_state, > > new_plane_state->ggtt_vma = vma; > > - new_plane_state->surf = intel_plane_ggtt_offset(new_plane_state) + > + new_plane_state->surf = i915_ggtt_offset(new_plane_state->ggtt_vma) + > plane->surf_offset(new_plane_state); I don't think xe specific code should be calling i915 compat functions directly. > > return 0; > diff --git a/drivers/gpu/drm/xe/display/xe_plane_initial.c b/drivers/gpu/drm/xe/display/xe_plane_initial.c > index a15f60835239..c563edf14b1a 100644 > --- a/drivers/gpu/drm/xe/display/xe_plane_initial.c > +++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c > @@ -239,7 +239,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc, > > plane_state->ggtt_vma = vma; > > - plane_state->surf = intel_plane_ggtt_offset(plane_state); > + plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma); Ditto. > > plane_state->uapi.src_x = 0; > plane_state->uapi.src_y = 0;
On Thu, Apr 03, 2025 at 11:29:04AM +0300, Jani Nikula wrote: > On Wed, 02 Apr 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote: > > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > > > We don't really need the extra intel_plane_ggtt_offset() wrapper > > anymore. Get rid of it. > > > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > > --- > > drivers/gpu/drm/i915/display/intel_atomic_plane.c | 5 ----- > > drivers/gpu/drm/i915/display/intel_atomic_plane.h | 2 -- > > drivers/gpu/drm/i915/display/intel_fb_pin.c | 2 +- > > drivers/gpu/drm/i915/display/intel_plane_initial.c | 2 +- > > drivers/gpu/drm/xe/display/xe_fb_pin.c | 2 +- > > drivers/gpu/drm/xe/display/xe_plane_initial.c | 2 +- > > 6 files changed, 4 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > > index 7276179df878..264a50b29c16 100644 > > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > > @@ -1565,8 +1565,3 @@ int intel_atomic_check_planes(struct intel_atomic_state *state) > > > > return 0; > > } > > - > > -u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state) > > -{ > > - return i915_ggtt_offset(plane_state->ggtt_vma); > > -} > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h > > index 6efac923dcbc..65edd88d28a9 100644 > > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h > > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h > > @@ -88,6 +88,4 @@ int intel_atomic_add_affected_planes(struct intel_atomic_state *state, > > struct intel_crtc *crtc); > > int intel_atomic_check_planes(struct intel_atomic_state *state); > > > > -u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state); > > - > > #endif /* __INTEL_ATOMIC_PLANE_H__ */ > > diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.c b/drivers/gpu/drm/i915/display/intel_fb_pin.c > > index fb7d0c8b9302..f2d8675dd98a 100644 > > --- a/drivers/gpu/drm/i915/display/intel_fb_pin.c > > +++ b/drivers/gpu/drm/i915/display/intel_fb_pin.c > > @@ -311,7 +311,7 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state, > > plane_state->surf = i915_gem_object_get_dma_address(obj, 0) + > > plane->surf_offset(plane_state); > > } else { > > - plane_state->surf = intel_plane_ggtt_offset(plane_state) + > > + plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma) + > > plane->surf_offset(plane_state); > > } > > > > diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c > > index 1c49610eb42f..3afff528a7bd 100644 > > --- a/drivers/gpu/drm/i915/display/intel_plane_initial.c > > +++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c > > @@ -356,7 +356,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc, > > i915_vma_pin_fence(vma) == 0 && vma->fence) > > plane_state->flags |= PLANE_HAS_FENCE; > > > > - plane_state->surf = intel_plane_ggtt_offset(plane_state); > > + plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma); > > > > plane_state->uapi.src_x = 0; > > plane_state->uapi.src_y = 0; > > diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c b/drivers/gpu/drm/xe/display/xe_fb_pin.c > > index b9c45a5a3d82..b2e979805455 100644 > > --- a/drivers/gpu/drm/xe/display/xe_fb_pin.c > > +++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c > > @@ -438,7 +438,7 @@ int intel_plane_pin_fb(struct intel_plane_state *new_plane_state, > > > > new_plane_state->ggtt_vma = vma; > > > > - new_plane_state->surf = intel_plane_ggtt_offset(new_plane_state) + > > + new_plane_state->surf = i915_ggtt_offset(new_plane_state->ggtt_vma) + > > plane->surf_offset(new_plane_state); > > I don't think xe specific code should be calling i915 compat functions > directly. xe doesn't seem to have anything native to call here either. I'll leave it to someone else to fix that mess. > > > > > return 0; > > diff --git a/drivers/gpu/drm/xe/display/xe_plane_initial.c b/drivers/gpu/drm/xe/display/xe_plane_initial.c > > index a15f60835239..c563edf14b1a 100644 > > --- a/drivers/gpu/drm/xe/display/xe_plane_initial.c > > +++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c > > @@ -239,7 +239,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc, > > > > plane_state->ggtt_vma = vma; > > > > - plane_state->surf = intel_plane_ggtt_offset(plane_state); > > + plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma); > > Ditto. > > > > > plane_state->uapi.src_x = 0; > > plane_state->uapi.src_y = 0; > > -- > Jani Nikula, Intel
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 7276179df878..264a50b29c16 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -1565,8 +1565,3 @@ int intel_atomic_check_planes(struct intel_atomic_state *state) return 0; } - -u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state) -{ - return i915_ggtt_offset(plane_state->ggtt_vma); -} diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index 6efac923dcbc..65edd88d28a9 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -88,6 +88,4 @@ int intel_atomic_add_affected_planes(struct intel_atomic_state *state, struct intel_crtc *crtc); int intel_atomic_check_planes(struct intel_atomic_state *state); -u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state); - #endif /* __INTEL_ATOMIC_PLANE_H__ */ diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.c b/drivers/gpu/drm/i915/display/intel_fb_pin.c index fb7d0c8b9302..f2d8675dd98a 100644 --- a/drivers/gpu/drm/i915/display/intel_fb_pin.c +++ b/drivers/gpu/drm/i915/display/intel_fb_pin.c @@ -311,7 +311,7 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state, plane_state->surf = i915_gem_object_get_dma_address(obj, 0) + plane->surf_offset(plane_state); } else { - plane_state->surf = intel_plane_ggtt_offset(plane_state) + + plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma) + plane->surf_offset(plane_state); } diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c index 1c49610eb42f..3afff528a7bd 100644 --- a/drivers/gpu/drm/i915/display/intel_plane_initial.c +++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c @@ -356,7 +356,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc, i915_vma_pin_fence(vma) == 0 && vma->fence) plane_state->flags |= PLANE_HAS_FENCE; - plane_state->surf = intel_plane_ggtt_offset(plane_state); + plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma); plane_state->uapi.src_x = 0; plane_state->uapi.src_y = 0; diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c b/drivers/gpu/drm/xe/display/xe_fb_pin.c index b9c45a5a3d82..b2e979805455 100644 --- a/drivers/gpu/drm/xe/display/xe_fb_pin.c +++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c @@ -438,7 +438,7 @@ int intel_plane_pin_fb(struct intel_plane_state *new_plane_state, new_plane_state->ggtt_vma = vma; - new_plane_state->surf = intel_plane_ggtt_offset(new_plane_state) + + new_plane_state->surf = i915_ggtt_offset(new_plane_state->ggtt_vma) + plane->surf_offset(new_plane_state); return 0; diff --git a/drivers/gpu/drm/xe/display/xe_plane_initial.c b/drivers/gpu/drm/xe/display/xe_plane_initial.c index a15f60835239..c563edf14b1a 100644 --- a/drivers/gpu/drm/xe/display/xe_plane_initial.c +++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c @@ -239,7 +239,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc, plane_state->ggtt_vma = vma; - plane_state->surf = intel_plane_ggtt_offset(plane_state); + plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma); plane_state->uapi.src_x = 0; plane_state->uapi.src_y = 0;