[Intel-gfx] [RFC PATCH 3/5] drm/i915/flat-CCS: move GET_CCS_SIZE macro into driver-wide header

Jani Nikula jani.nikula at linux.intel.com
Mon Jan 24 16:00:37 UTC 2022


On Fri, 21 Jan 2022, Adrian Larumbe <adrian.larumbe at collabora.com> wrote:
> It has to be used by other files other than low-level migration code.

Maybe, but i915_drv.h is not the dumping ground for this
stuff. Especially you shouldn't add anything in i915_drv.h that requires
you to pull in other headers. The goal is to go in the completely
opposite direction.

BR,
Jani.

>
> Signed-off-by: Adrian Larumbe <adrian.larumbe at collabora.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_migrate.c | 1 -
>  drivers/gpu/drm/i915/i915_drv.h         | 5 +++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c
> index a210c911905e..716f2f51c7f9 100644
> --- a/drivers/gpu/drm/i915/gt/intel_migrate.c
> +++ b/drivers/gpu/drm/i915/gt/intel_migrate.c
> @@ -16,7 +16,6 @@ struct insert_pte_data {
>  };
>  
>  #define CHUNK_SZ SZ_8M /* ~1ms at 8GiB/s preemption delay */
> -#define GET_CCS_SIZE(i915, size)	(HAS_FLAT_CCS(i915) ? (size) >> 8 : 0)
>  
>  static bool engine_supports_migration(struct intel_engine_cs *engine)
>  {
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 5623892ceab9..6b890a6674e4 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -105,6 +105,7 @@
>  #include "i915_request.h"
>  #include "i915_scheduler.h"
>  #include "gt/intel_timeline.h"
> +#include "gt/intel_gpu_commands.h"
>  #include "i915_vma.h"
>  
>  
> @@ -1526,6 +1527,10 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
>  
>  #define HAS_FLAT_CCS(dev_priv)   (INTEL_INFO(dev_priv)->has_flat_ccs)
>  
> +#define GET_CCS_SIZE(i915, size) (HAS_FLAT_CCS(i915) ? \
> +				  DIV_ROUND_UP(size, NUM_CCS_BYTES_PER_BLOCK) \
> +				  0)
> +
>  #define HAS_GT_UC(dev_priv)	(INTEL_INFO(dev_priv)->has_gt_uc)
>  
>  #define HAS_POOLED_EU(dev_priv)	(INTEL_INFO(dev_priv)->has_pooled_eu)

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list