Re: [PATCH 11/12] drm/i915/bdw: Ensure a context is loaded before RC6

Chris Wilson
2014-03-20T07:35:40Z

On Wed, Mar 19, 2014 at 06:31:18PM -0700, Ben Widawsky wrote:
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index ee32759..4de8800 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2436,6 +2436,7 @@ void i915_gem_reset(struct drm_device *dev)
> static void
> i915_gem_retire_requests_ring(struct intel_ring_buffer *ring)
> {
> + struct drm_i915_private *dev_priv = ring->dev->dev_private;
> uint32_t seqno;
>
> if (list_empty(&ring->request_list))
> @@ -2459,6 +2460,15 @@ i915_gem_retire_requests_ring(struct intel_ring_buffer *ring)
> if (!i915_seqno_passed(seqno, obj->last_read_seqno))
> break;
>
> + /* Wa: can't find the w/a name.
> + * This doesn't actually implement the w/a, but it a workaround
> + * for the workaround. It defers using rc6 until we know valid
> + * state exists.
> + */
> + if (IS_BROADWELL(ring->dev) && intel_enable_rc6(ring->dev) &&
> + !dev_priv->rps.enabled && ring->id == RCS)
> + intel_enable_gt_powersave(ring->dev);
> +

This is a big eyesore. I think we will both be happy if you move this to
intel_mark_idle(). You can then check for ring[RCS]->last_context being
set.

> i915_gem_object_move_to_inactive(obj);
> }

--
Chris Wilson, Intel Open Source Technology Centre