Quoting Tvrtko Ursulin (2018-12-12 14:36:27) > > On 12/12/2018 13:41, Chris Wilson wrote: > > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c > > index 9289515108c3..408692b88c98 100644 > > --- a/drivers/gpu/drm/i915/intel_uncore.c > > +++ b/drivers/gpu/drm/i915/intel_uncore.c > > @@ -1931,6 +1931,103 @@ static int gen6_reset_engines(struct drm_i915_private *dev_priv, > > return gen6_hw_domain_reset(dev_priv, hw_mask); > > } > > > > +static u32 gen11_lock_sfc(struct drm_i915_private *dev_priv, > > + struct intel_engine_cs *engine) > > +{ > > + u8 vdbox_sfc_access = INTEL_INFO(dev_priv)->vdbox_sfc_access; > > Only a single use site so could get away with a local copy. > > > + i915_reg_t sfc_forced_lock, sfc_forced_lock_ack; > > + u32 sfc_forced_lock_bit, sfc_forced_lock_ack_bit; > > + i915_reg_t sfc_usage; > > + u32 sfc_usage_bit; > > + u32 sfc_reset_bit; > > + > > + switch (engine->class) { > > + case VIDEO_DECODE_CLASS: > > + if ((BIT(engine->instance) & vdbox_sfc_access) == 0) > > + return 0; I presume you meant instead of vdbox_sfc_access here. Doesn't fit nicely without using a local for engine->instance instead (which isn't bad as it is repeated here) but then we lose the symmetry with unlock. I tried a few different ways (though without much imagination) to try and share the definitions between lock_sfc/unlock_sfc but didn't like any of them more than the repetition. So I left this chunk as it is. -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx