[Intel-gfx] [PATCH 05/14] drm/i915: Sort forcewake mapping tables

Chris Wilson chris at chris-wilson.co.uk
Fri Sep 30 18:05:18 UTC 2016


On Fri, Sep 30, 2016 at 06:48:40PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> Sorting the tables (verified at runtime to help during
> development) is another prerequisite for interesting
> work which will follow.
> 
> v2:
>  * Remove const away cast and improve comments. (Chris Wilson)
>  * Check tables only when debug option is enabled.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++---------
>  1 file changed, 43 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index e21e65ab2a16..5ca65de340b7 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -605,16 +605,35 @@ find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges,
>  	return -1;
>  }
>  
> +static void
> +intel_fw_table_check(const struct intel_forcewake_range *ranges,
> +		     unsigned int num_ranges)
> +{
> +#ifdef CONFIG_DRM_I915_DEBUG
> +	unsigned int i;
> +	const struct intel_forcewake_range *entry = ranges;
> +	s32 prev = -1;
> +

	if (!IS_ENABLED(CONFIG_DRM_I915_DEBUG))
		return;

for compiler checking always.

or
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG) 
...
#endif
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list