diff mbox series

[2/8] drm/i915/display: move intel_plane_uses_fence to inline.

Message ID 20211007031318.3088987-3-airlied@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/display: refactor plane config + pin out | expand

Commit Message

Dave Airlie Oct. 7, 2021, 3:13 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

Make future refactoring simpler, but also this function is pretty
trivial.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/i915/display/intel_display.c       | 10 ----------
 drivers/gpu/drm/i915/display/intel_display_types.h | 10 ++++++++++
 2 files changed, 10 insertions(+), 10 deletions(-)

Comments

Jani Nikula Oct. 7, 2021, 8:58 a.m. UTC | #1
On Thu, 07 Oct 2021, Dave Airlie <airlied@gmail.com> wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> Make future refactoring simpler, but also this function is pretty
> trivial.

In general, I'm pretty much opposed to adding any new inline functions
without a clear performance rationale. I've been gradually moving such
inlines out of headers instead.

They make it harder to abstract stuff by requiring visibility to all the
guts they're accessing. I'm hoping to remove #include "i915_drv.h" from
this header too, reducing the header interdependencies and the
"everything needs everything" model.

BR,
Jani.

>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c       | 10 ----------
>  drivers/gpu/drm/i915/display/intel_display_types.h | 10 ++++++++++
>  2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index d1fa17929b1f..b26e1989b8d8 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -851,16 +851,6 @@ unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info
>  	return size;
>  }
>  
> -static bool intel_plane_uses_fence(const struct intel_plane_state *plane_state)
> -{
> -	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
> -	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -
> -	return DISPLAY_VER(dev_priv) < 4 ||
> -		(plane->has_fbc &&
> -		 plane_state->view.gtt.type == I915_GGTT_VIEW_NORMAL);
> -}
> -
>  static struct i915_vma *
>  intel_pin_fb_obj_dpt(struct drm_framebuffer *fb,
>  		     const struct i915_ggtt_view *view,
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index a811e13720bf..eebb46d0b0b9 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -2030,6 +2030,16 @@ static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_
>  	return i915_ggtt_offset(plane_state->ggtt_vma);
>  }
>  
> +static inline bool intel_plane_uses_fence(const struct intel_plane_state *plane_state)
> +{
> +	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
> +	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> +
> +	return DISPLAY_VER(dev_priv) < 4 ||
> +		(plane->has_fbc &&
> +		 plane_state->view.gtt.type == I915_GGTT_VIEW_NORMAL);
> +}
> +
>  static inline struct intel_frontbuffer *
>  to_intel_frontbuffer(struct drm_framebuffer *fb)
>  {
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index d1fa17929b1f..b26e1989b8d8 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -851,16 +851,6 @@  unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info
 	return size;
 }
 
-static bool intel_plane_uses_fence(const struct intel_plane_state *plane_state)
-{
-	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
-	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-
-	return DISPLAY_VER(dev_priv) < 4 ||
-		(plane->has_fbc &&
-		 plane_state->view.gtt.type == I915_GGTT_VIEW_NORMAL);
-}
-
 static struct i915_vma *
 intel_pin_fb_obj_dpt(struct drm_framebuffer *fb,
 		     const struct i915_ggtt_view *view,
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index a811e13720bf..eebb46d0b0b9 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -2030,6 +2030,16 @@  static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_
 	return i915_ggtt_offset(plane_state->ggtt_vma);
 }
 
+static inline bool intel_plane_uses_fence(const struct intel_plane_state *plane_state)
+{
+	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
+	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
+
+	return DISPLAY_VER(dev_priv) < 4 ||
+		(plane->has_fbc &&
+		 plane_state->view.gtt.type == I915_GGTT_VIEW_NORMAL);
+}
+
 static inline struct intel_frontbuffer *
 to_intel_frontbuffer(struct drm_framebuffer *fb)
 {