[Intel-gfx] [PATCH] drm/i915: Introduce HAS_64BIT_RELOC

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 2 12:40:30 UTC 2016


On Wed, Nov 02, 2016 at 02:32:54PM +0200, Joonas Lahtinen wrote:
> Unify {use,has}_64bit_reloc into dev_priv->info.
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h              | 3 +++
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c   | 8 +++-----
>  drivers/gpu/drm/i915/i915_gem_render_state.c | 3 +--
>  drivers/gpu/drm/i915/i915_pci.c              | 3 ++-
>  4 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index eaa01da..ae0217d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -670,6 +670,7 @@ struct intel_csr {
>  	func(is_kabylake); \
>  	func(is_preliminary); \
>  	/* Keep has_* in alphabetical order */ \
> +	func(has_64bit_reloc); \
>  	func(has_csr); \
>  	func(has_ddi); \
>  	func(has_dp_mst); \
> @@ -2917,6 +2918,8 @@ struct drm_i915_cmd_table {
>  #define HAS_CSR(dev)	(INTEL_INFO(dev)->has_csr)
>  
>  #define HAS_RUNTIME_PM(dev_priv) ((dev_priv)->info.has_runtime_pm)
> +#define HAS_64BIT_RELOC(dev_priv) ((dev_priv)->info.has_64bit_reloc)
> +
>  /*
>   * For now, anything with a GuC requires uCode loading, and then supports
>   * command submission once loaded. But these are logically independent
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index c35e847..3e73f77 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -322,7 +322,6 @@ struct reloc_cache {
>  	struct drm_mm_node node;
>  	unsigned long vaddr;
>  	unsigned int page;
> -	bool use_64bit_reloc;
>  };
>  
>  static void reloc_cache_init(struct reloc_cache *cache,
> @@ -331,7 +330,6 @@ static void reloc_cache_init(struct reloc_cache *cache,
>  	cache->page = -1;
>  	cache->vaddr = 0;
>  	cache->i915 = i915;
> -	cache->use_64bit_reloc = INTEL_GEN(cache->i915) >= 8;
>  	cache->node.allocated = false;
>  }
>  
> @@ -519,7 +517,7 @@ relocate_entry(struct drm_i915_gem_object *obj,
>  	       u64 target_offset)
>  {
>  	u64 offset = reloc->offset;
> -	bool wide = cache->use_64bit_reloc;
> +	bool wide = HAS_64BIT_RELOC(cache->i915);
Nak.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list