All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: kedar.j.karanje@intel.com, intel-gfx@lists.freedesktop.org
Cc: Praveen Diwakar <praveen.diwakar@intel.com>,
	Yogesh Marathe <yogesh.marathe@intel.com>,
	Ankit Navik <ankit.p.navik@intel.com>,
	Aravindan Muthukumar <aravindan.muthukumar@intel.com>
Subject: Re: [PATCH 1/4] drm/i915: Get active pending request for given context
Date: Tue, 25 Sep 2018 11:04:21 +0300	[thread overview]
Message-ID: <87d0t2vw8q.fsf@intel.com> (raw)
In-Reply-To: <1537521230-22904-2-git-send-email-kedar.j.karanje@intel.com>

On Fri, 21 Sep 2018, kedar.j.karanje@intel.com wrote:
> From: Praveen Diwakar <praveen.diwakar@intel.com>
>
> This patch gives us the active pending request count which is yet
> to be submitted to the GPU
>
> Change-Id: I10c2828ad0f1a0b7af147835737134e07a2d5b6d

Please remove these.

> Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com>
> Signed-off-by: Yogesh Marathe <yogesh.marathe@intel.com>
> Signed-off-by: Aravindan Muthukumar <aravindan.muthukumar@intel.com>
> Signed-off-by: Kedar J Karanje <kedar.j.karanje@intel.com>
> Signed-off-by: Ankit Navik <ankit.p.navik@intel.com>

What are you trying to convey with the five signoffs?

BR,
Jani.


> ---
>  drivers/gpu/drm/i915/i915_drv.c            | 1 +
>  drivers/gpu/drm/i915/i915_drv.h            | 5 +++++
>  drivers/gpu/drm/i915/i915_gem_context.c    | 1 +
>  drivers/gpu/drm/i915/i915_gem_context.h    | 6 ++++++
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 5 +++++
>  drivers/gpu/drm/i915/intel_lrc.c           | 6 ++++++
>  6 files changed, 24 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index f8cfd16..d37c46e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -903,6 +903,7 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
>  	mutex_init(&dev_priv->av_mutex);
>  	mutex_init(&dev_priv->wm.wm_mutex);
>  	mutex_init(&dev_priv->pps_mutex);
> +	mutex_init(&dev_priv->pred_mutex);
>  
>  	i915_memcpy_init_early(dev_priv);
>  
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 4aca534..137ec33 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1609,6 +1609,11 @@ struct drm_i915_private {
>  	 * controller on different i2c buses. */
>  	struct mutex gmbus_mutex;
>  
> +	/** pred_mutex protects against councurrent usage of pending
> +	 * request counter for multiple contexts
> +	 */
> +	struct mutex pred_mutex;
> +
>  	/**
>  	 * Base address of the gmbus and gpio block.
>  	 */
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index b10770c..30932d9 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -387,6 +387,7 @@ i915_gem_create_context(struct drm_i915_private *dev_priv,
>  	}
>  
>  	trace_i915_context_create(ctx);
> +	ctx->req_cnt = 0;
>  
>  	return ctx;
>  }
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.h b/drivers/gpu/drm/i915/i915_gem_context.h
> index b116e49..243ea22 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.h
> +++ b/drivers/gpu/drm/i915/i915_gem_context.h
> @@ -194,6 +194,12 @@ struct i915_gem_context {
>  	 * context close.
>  	 */
>  	struct list_head handles_list;
> +
> +	/** req_cnt: tracks the pending commands, based on which we decide to
> +	 * go for low/medium/high load configuration of the GPU, this is
> +	 * controlled via a mutex
> +	 */
> +	u64 req_cnt;
>  };
>  
>  static inline bool i915_gem_context_is_closed(const struct i915_gem_context *ctx)
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 3f0c612..f799ff9 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -2178,6 +2178,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
>  		       struct drm_syncobj **fences)
>  {
>  	struct i915_execbuffer eb;
> +	struct drm_i915_private *dev_priv = to_i915(dev);
>  	struct dma_fence *in_fence = NULL;
>  	struct sync_file *out_fence = NULL;
>  	int out_fence_fd = -1;
> @@ -2390,6 +2391,10 @@ i915_gem_do_execbuffer(struct drm_device *dev,
>  	 */
>  	eb.request->batch = eb.batch;
>  
> +	mutex_lock(&dev_priv->pred_mutex);
> +	eb.ctx->req_cnt++;
> +	mutex_unlock(&dev_priv->pred_mutex);
> +
>  	trace_i915_request_queue(eb.request, eb.batch_flags);
>  	err = eb_submit(&eb);
>  err_request:
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 1744792..039fbdb 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -728,6 +728,12 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>  			trace_i915_request_in(rq, port_index(port, execlists));
>  			last = rq;
>  			submit = true;
> +
> +			mutex_lock(&rq->i915->pred_mutex);
> +			if (rq->gem_context->req_cnt > 0) {
> +				rq->gem_context->req_cnt--;
> +			}
> +			mutex_unlock(&rq->i915->pred_mutex);
>  		}
>  
>  		rb_erase_cached(&p->node, &execlists->queue);

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-09-25  8:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21  9:13 [PATCH 0/4][RFC] Dynamic EU configuration of Slice/Subslice/EU kedar.j.karanje
2018-09-21  9:13 ` [PATCH 1/4] drm/i915: Get active pending request for given context kedar.j.karanje
2018-09-21 12:39   ` Tvrtko Ursulin
2018-11-06  4:18     ` Navik, Ankit P
2018-09-25  8:04   ` Jani Nikula [this message]
2018-09-25  7:41     ` Kedar J. Karanje
2018-09-21  9:13 ` [PATCH 2/4] drm/i915: Update render power clock state configuration " kedar.j.karanje
2018-09-21 12:51   ` Tvrtko Ursulin
2018-11-06  4:23     ` Navik, Ankit P
2018-09-22 19:13   ` kbuild test robot
2018-09-21  9:13 ` [PATCH 3/4] drm/i915: set optimum eu/slice/sub-slice configuration based on load type kedar.j.karanje
2018-09-21 13:05   ` Tvrtko Ursulin
2018-11-06  4:25     ` Navik, Ankit P
2018-09-22 18:09   ` kbuild test robot
2018-09-21  9:13 ` [PATCH 4/4] drm/i915: Predictive governor to control eu/slice/subslice based on workload kedar.j.karanje
2018-09-21 13:24   ` Tvrtko Ursulin
2018-09-25  6:12     ` Navik, Ankit P
2018-09-25  8:25       ` Tvrtko Ursulin
2018-11-06  4:46         ` Navik, Ankit P
2018-09-22 18:31   ` kbuild test robot
2018-09-21 11:16 ` ✗ Fi.CI.BAT: failure for Dynamic EU configuration of Slice/Subslice/EU Patchwork
2018-09-21 12:31 ` [PATCH 0/4][RFC] " Tvrtko Ursulin
2018-09-27 14:02 ` Joonas Lahtinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0t2vw8q.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=ankit.p.navik@intel.com \
    --cc=aravindan.muthukumar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kedar.j.karanje@intel.com \
    --cc=praveen.diwakar@intel.com \
    --cc=yogesh.marathe@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.