[Intel-gfx] [PATCH v2] drm/i915/bdw: Check for slice, subslice and EU count for BDW

Chris Wilson chris at chris-wilson.co.uk
Wed Sep 2 07:03:03 PDT 2015


On Wed, Sep 02, 2015 at 05:47:58PM +0200, Ɓukasz Daniluk wrote:
> +static void broadwell_sseu_device_status(struct drm_device *dev,

Why pass in dev if you only use dev_priv (and commit the sin of
repeatedly retrieving dev->dev_priv)?

> +					 struct sseu_dev_status *stat)
> +{
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	int s;
> +	u32 slice_info = I915_READ(GEN8_GT_SLICE_INFO);
> +
> +	stat->slice_total =
> +		hweight32(slice_info & GEN8_LSLICESTAT_MASK);
> +
> +	if (stat->slice_total)
> +	{
Missed.

> +		stat->subslice_per_slice = INTEL_INFO(dev)->subslice_per_slice;
> +		stat->eu_per_subslice = INTEL_INFO(dev)->eu_per_subslice;
> +		stat->subslice_total = stat->slice_total * stat->subslice_per_slice;
> +		stat->eu_total = stat->eu_per_subslice * stat->subslice_total;
> +
> +		/* subtract fused off EU(s) from enabled slice(s) */
> +		for (s = 0; s < stat->slice_total; s++) {
> +			u8 subslice_7eu = INTEL_INFO(dev)->subslice_7eu[s];
> +			stat->eu_total -= hweight8(subslice_7eu);
> +		}

So why are we computing this twice? Is the debugfs to show the hw
registers or the sw tracking? Where do I see what we actually report? If
it is for the hw registers, report them. A perfect function here would
report the actual register values (possibly decoding them) and show what
the internal values are.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list