[Intel-gfx] [PATCH 2/2] drm/i915: Test all fw tables during mock selftests

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Thu Dec 8 13:11:12 UTC 2016


On ke, 2016-12-07 at 18:52 +0000, Chris Wilson wrote:
> In addition to just testing the fw table we load, during the initial
> mock testing we can test that all tables are valid (so the testing is
> not limited to just the platforms that load that particular table).
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

<SNIP>

> +static int intel_fw_table_check(const struct intel_forcewake_range *ranges,
> +				unsigned int num_ranges,
> +				int gen)
>  {
> -	const struct intel_forcewake_range *ranges;
> -	unsigned int num_ranges, i;
> +	unsigned int i;
>  	s32 prev;
>  
> -	ranges = i915->uncore.fw_domains_table;
> -	if (!ranges)
> -		return 0;
> -
> -	num_ranges = i915->uncore.fw_domains_table_entries;
>  	for (i = 0, prev = -1; i < num_ranges; i++, ranges++) {
>  		/* Check that the tabke is watertight */

s/tabke/table/

>  int intel_uncore_late_selftests(struct drm_i915_private *i915)
>  {
>  	int err;
>  
> -	err = intel_fw_table_check(i915);
> +	/* Confirm the table we load is still valid */
> +	err = intel_fw_table_check(i915->uncore.fw_domains_table,
> +				   i915->uncore.fw_domains_table_entries,
> +				   INTEL_GEN(i915));
>  	if (err)
>  		return err;

Maybe the mock test should skip .gen == INTEL_GEN(i915) to avoid
duplicate coverage on full run.
 
Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list