[Intel-gfx] [PATCH v2 1/2] drm/i915/scheduler: add gvt force-single-submission for guc

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 31 14:23:51 UTC 2017


On Tue, Mar 28, 2017 at 05:38:40PM +0800, Chuanxiao Dong wrote:
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index dd0e9d587..951540f 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -377,24 +377,6 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
>  	writel(lower_32_bits(desc[0]), elsp);
>  }
>  
> -static bool ctx_single_port_submission(const struct i915_gem_context *ctx)
> -{
> -	return (IS_ENABLED(CONFIG_DRM_I915_GVT) &&
> -		i915_gem_context_force_single_submission(ctx));
> -}
> -
> -static bool can_merge_ctx(const struct i915_gem_context *prev,
> -			  const struct i915_gem_context *next)
> -{
> -	if (prev != next)
> -		return false;
> -
> -	if (ctx_single_port_submission(prev))
> -		return false;
> -
> -	return true;
> -}
> -
>  static void execlists_dequeue(struct intel_engine_cs *engine)
>  {
>  	struct drm_i915_gem_request *last;
> @@ -462,7 +444,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>  		 * request, and so we never need to tell the hardware about
>  		 * the first.
>  		 */
> -		if (last && !can_merge_ctx(cursor->ctx, last->ctx)) {
> +		if (last && ((last->ctx != cursor->ctx) ||
> +			intel_gvt_context_single_port_submit(last->ctx))) {

Which is easier to understand the original code or the replacement?
Bonus points for sticking to coding style.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list