[Intel-gfx] [RFC PATCH 2/4] drm/i915: extract per-ctx/indirect bb programming

Chris Wilson chris at chris-wilson.co.uk
Wed Aug 30 18:59:53 UTC 2017


Quoting Lionel Landwerlin (2017-08-30 19:20:04)
> Let's put this in its own function to reuse it later.
> 
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_lrc.c | 33 +++++++++++++++++++--------------
>  1 file changed, 19 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 5b96b1e2353d..6da2b4f0c5a5 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1906,6 +1906,23 @@ static u32 intel_lr_indirect_ctx_offset(struct intel_engine_cs *engine)
>         return indirect_ctx_offset;
>  }
>  
> +static void execlists_init_reg_state_wa_bb(u32 *regs,
> +                                          struct intel_engine_cs *engine)
> +{
> +       struct i915_ctx_workarounds *wa_ctx = &engine->wa_ctx;
> +       u32 ggtt_offset = i915_ggtt_offset(wa_ctx->vma);

You are going to repeat the !wa_ctx->vma so you might as well pull it
in.
-Chris


More information about the Intel-gfx mailing list