Re: [PATCH v2] drm/i915: set initialised only when init_context callback is NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Chris! Have a nice weekend. :)

> -----Original Message-----
> From: Chris Wilson [mailto:chris@xxxxxxxxxxxxxxxxxx]
> Sent: Friday, May 12, 2017 6:12 PM
> To: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Dong, Chuanxiao <chuanxiao.dong@xxxxxxxxx>; Chris Wilson
> <chris@xxxxxxxxxxxxxxxxxx>
> Subject: [PATCH v2] drm/i915: set initialised only when init_context callback
> is NULL
> 
> From: Chuanxiao Dong <chuanxiao.dong@xxxxxxxxx>
> 
> During execlist_context_deferred_alloc() we presumed that the context is
> uninitialised (we only just allocated the state object for it!) and chose to
> optimise away the later call to engine->init_context() if
> engine->init_context were NULL. This breaks with GVT's contexts that are
> marked as pre-initialised to avoid us annoyingly calling
> engine->init_context(). The fix is to not override ce->initialised if it
> is already true.
> 
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@xxxxxxxxx>
> Link: http://patchwork.freedesktop.org/patch/msgid/1494497262-24855-1-
> git-send-email-chuanxiao.dong@xxxxxxxxx
> Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_lrc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c
> b/drivers/gpu/drm/i915/intel_lrc.c
> index 319d9a8f37ca..9a1192d61538 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1956,7 +1956,7 @@ static int execlists_context_deferred_alloc(struct
> i915_gem_context *ctx,
> 
>  	ce->ring = ring;
>  	ce->state = vma;
> -	ce->initialised = engine->init_context == NULL;
> +	ce->initialised |= engine->init_context == NULL;
> 
>  	return 0;
> 
> --
> 2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux