[Intel-gfx] [PATCH v3] drm/i915/skl: Add support for the SAGV, fix underrun hangs

Chris Wilson chris at chris-wilson.co.uk
Wed Jul 13 18:28:50 UTC 2016


On Wed, Jul 13, 2016 at 11:17:52AM -0700, Matt Roper wrote:
> On Wed, Jul 13, 2016 at 09:12:09PM +0300, Ville Syrjälä wrote:
> > We have wait_for()/_wait_for() for polling stuff.
> 
> Those just block until a condition becomes true, right?  In this case my
> understanding from the bspec is that we need to keep re-writing the SAGV
> disable until it sticks.

the condition is an arbitrary expression such as

static inline bool sagv_disabled(struct drm_i915_private (dev_priv)
{
	u32 tmp;

	if (sandybridge_pcode_write(dev_priv,
				    GEN9_PCODE_SAGV_CONTROL,
				    GEN9_SAGV_DISABLE))
		goto error;

	if (sandybridge_pcode_read(dev_priv,
				   GEN9_PCODE_SAGV_CONTROL,
				   &tmp))
		goto error;
	
	return tmp & 1;

error:
	DRM_ERROR("Failed to disable the SAGV\n");
	return true;
}


ret = wait_for(sagv_disabled(dev_priv), 1);
if (ret)
	DRM_ERROR("Timed out waiting for SAGV to be disabled\n");

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list