[Intel-gfx] [PATCH] drm/i915: move i915_gem_object_needs_bit17_swizzle() to intel_ggtt_fencing.[ch]
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Mon Feb 14 13:51:45 UTC 2022
On 14/02/2022 13:24, Jani Nikula wrote:
> Move i915_gem_object_needs_bit17_swizzle() next to the other
> bit_17_swizzle functions. Also un-inline while at it; does not seem like
> this is a function needed in hot paths.
>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c | 8 ++++++++
> drivers/gpu/drm/i915/gt/intel_ggtt_fencing.h | 1 +
> drivers/gpu/drm/i915/i915_drv.h | 9 ---------
> 3 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
> index ee4049ee1fc9..55d525c562df 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
> @@ -755,6 +755,14 @@ static void swizzle_page(struct page *page)
> kunmap(page);
> }
>
> +bool i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj)
> +{
> + struct drm_i915_private *i915 = to_i915(obj->base.dev);
> +
> + return to_gt(i915)->ggtt->bit_6_swizzle_x == I915_BIT_6_SWIZZLE_9_10_17 &&
> + i915_gem_object_is_tiled(obj);
> +}
> +
> /**
> * i915_gem_object_do_bit_17_swizzle - fixup bit 17 swizzling
> * @obj: i915 GEM buffer object
> diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.h b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.h
> index 25340be5ecf0..fa0734fd4749 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.h
> +++ b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.h
> @@ -46,6 +46,7 @@ void i915_unreserve_fence(struct i915_fence_reg *fence);
>
> void intel_ggtt_restore_fences(struct i915_ggtt *ggtt);
>
> +bool i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj);
> void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj,
> struct sg_table *pages);
> void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj,
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 418091484e02..395c53d4955e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1495,15 +1495,6 @@ void i915_gem_driver_release(struct drm_i915_private *dev_priv);
>
> int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file);
>
> -/* i915_gem_tiling.c */
> -static inline bool i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj)
> -{
> - struct drm_i915_private *i915 = to_i915(obj->base.dev);
> -
> - return to_gt(i915)->ggtt->bit_6_swizzle_x == I915_BIT_6_SWIZZLE_9_10_17 &&
> - i915_gem_object_is_tiled(obj);
> -}
> -
> /* intel_device_info.c */
> static inline struct intel_device_info *
> mkwrite_device_info(struct drm_i915_private *dev_priv)
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Regards,
Tvrtko
More information about the Intel-gfx
mailing list