All of lore.kernel.org
 help / color / mirror / Atom feed
From: sourab.gupta@intel.com
To: intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Sourab Gupta <sourab.gupta@intel.com>,
	Deepak S <deepak.s@intel.com>
Subject: [PATCH 02/16] drm/i915: Constrain intel_context::global_id to 20 bits
Date: Fri, 22 Apr 2016 17:03:51 +0530	[thread overview]
Message-ID: <1461324845-25755-3-git-send-email-sourab.gupta@intel.com> (raw)
In-Reply-To: <1461324845-25755-1-git-send-email-sourab.gupta@intel.com>

From: Robert Bragg <robert@sixbynine.org>

This will allow the ID to be given to the HW as the unique context
identifier that's written, for example, to the context status buffer
on preemption and included in reports written by the OA unit.

Cc: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Robert Bragg <robert@sixbynine.org>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 9cb124e..6db5e3a 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -90,6 +90,10 @@
 #include "i915_drv.h"
 #include "i915_trace.h"
 
+/* With execlist scheduling we can program our own HW context ID but we we
+ * are limited to 20bits */
+#define I915_MAX_HW_CTX_ID ((1<<20)-1)
+
 /* This is a HW constraint. The value below is the largest known requirement
  * I've seen in a spec to date, and that was a workaround for a non-shipping
  * part. It should be safe to decrease this, but it's more future proof as is.
@@ -264,13 +268,8 @@ __create_hw_context(struct drm_device *dev,
 	ctx->file_priv = file_priv;
 	ctx->user_handle = ret;
 
-	/* TODO: If required, this global id can be used for programming the hw
-	 * fields too. In that case, we'll have take care of hw restrictions
-	 * while allocating idr. e.g. for some hw, we may not have full 32 bits
-	 * available.
-	 */
 	ret = idr_alloc_cyclic(&dev_priv->global_ctx_idr,
-				ctx, 0, 0, GFP_KERNEL);
+				ctx, 0, I915_MAX_HW_CTX_ID, GFP_KERNEL);
 	if (ret < 0)
 		goto err_out;
 
-- 
1.9.1

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

  parent reply	other threads:[~2016-04-22 11:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 11:33 [PATCH 00/16] Framework to collect command stream gpu metrics using i915 perf sourab.gupta
2016-04-22 11:33 ` [PATCH 01/16] drm/i915: Introduce global id for contexts sourab.gupta
2016-04-22 11:33 ` sourab.gupta [this message]
2016-04-22 11:33 ` [PATCH 03/16] drm/i915: return ctx->global_id from intel_execlists_ctx_id() sourab.gupta
2016-04-22 11:33 ` [PATCH 04/16] drm/i915: Add ctx getparam ioctl parameter to retrieve ctx global id sourab.gupta
2016-04-22 11:33 ` [PATCH 05/16] drm/i915: Expose OA sample source to userspace sourab.gupta
2016-04-22 11:33 ` [PATCH 06/16] drm/i915: Framework for capturing command stream based OA reports sourab.gupta
2016-04-22 11:33 ` [PATCH 07/16] drm/i915: flush periodic samples, in case of no pending CS sample requests sourab.gupta
2016-04-22 11:33 ` [PATCH 08/16] drm/i915: Handle the overflow condition for command stream buf sourab.gupta
2016-04-22 11:33 ` [PATCH 09/16] drm/i915: Populate ctx ID for periodic OA reports sourab.gupta
2016-04-22 11:33 ` [PATCH 10/16] drm/i915: Add support for having pid output with OA report sourab.gupta
2016-04-22 11:34 ` [PATCH 11/16] drm/i915: Add support for emitting execbuffer tags through OA counter reports sourab.gupta
2016-04-22 11:34 ` [PATCH 12/16] drm/i915: Extend i915 perf framework for collecting timestamps on all gpu engines sourab.gupta
2016-04-22 11:34 ` [PATCH 13/16] drm/i915: Extract raw GPU timestamps from OA reports to forward in perf samples sourab.gupta
2016-04-22 11:34 ` [PATCH 14/16] drm/i915: Support opening multiple concurrent perf streams sourab.gupta
2016-04-22 11:34 ` [PATCH 15/16] drm/i915: Mechanism to forward clock monotonic time in perf samples sourab.gupta
2016-04-22 19:49   ` Chris Wilson
2016-05-09  5:59     ` sourab gupta
2016-05-09  8:06       ` Chris Wilson
2016-04-22 11:34 ` [PATCH 16/16] drm/i915: Support for capturing MMIO register values sourab.gupta
2016-04-22 22:18   ` Chris Wilson

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=1461324845-25755-3-git-send-email-sourab.gupta@intel.com \
    --to=sourab.gupta@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=deepak.s@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.