All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] drm/i915/guc: Precompute GuC shared data offset
@ 2017-10-05  9:13 Michał Winiarski
  2017-10-05  9:13 ` [PATCH 02/10] drm/i915/guc: Initialize GuC before restarting engines Michał Winiarski
                   ` (7 more replies)
  0 siblings, 8 replies; 37+ messages in thread
From: Michał Winiarski @ 2017-10-05  9:13 UTC (permalink / raw)
  To: intel-gfx

We're using first page of kernel context state to share data with GuC,
let's precompute the ggtt offset at GuC initialization time rather than
everytime we're using GuC actions.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jeff Mcgee <jeff.mcgee@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 4 ++--
 drivers/gpu/drm/i915/intel_uc.c            | 4 ++++
 drivers/gpu/drm/i915/intel_uc.h            | 3 +++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index 04f1281d81a5..2c0aeee3143d 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -1234,7 +1234,7 @@ int intel_guc_suspend(struct drm_i915_private *dev_priv)
 	/* any value greater than GUC_POWER_D0 */
 	data[1] = GUC_POWER_D1;
 	/* first page is shared data with GuC */
-	data[2] = guc_ggtt_offset(ctx->engine[RCS].state) + LRC_GUCSHR_PN * PAGE_SIZE;
+	data[2] = guc->shared_data_offset;
 
 	return intel_guc_send(guc, data, ARRAY_SIZE(data));
 }
@@ -1260,7 +1260,7 @@ int intel_guc_resume(struct drm_i915_private *dev_priv)
 	data[0] = INTEL_GUC_ACTION_EXIT_S_STATE;
 	data[1] = GUC_POWER_D0;
 	/* first page is shared data with GuC */
-	data[2] = guc_ggtt_offset(ctx->engine[RCS].state) + LRC_GUCSHR_PN * PAGE_SIZE;
+	data[2] = guc->shared_data_offset;
 
 	return intel_guc_send(guc, data, ARRAY_SIZE(data));
 }
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index e7875277ba97..f4893c85e54a 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -173,6 +173,10 @@ static void guc_free_load_err_log(struct intel_guc *guc)
 static int guc_enable_communication(struct intel_guc *guc)
 {
 	struct drm_i915_private *dev_priv = guc_to_i915(guc);
+	struct i915_gem_context *ctx = dev_priv->kernel_context;
+
+	guc->shared_data_offset = guc_ggtt_offset(ctx->engine[RCS].state) +
+		LRC_GUCSHR_PN * PAGE_SIZE;
 
 	if (HAS_GUC_CT(dev_priv))
 		return intel_guc_enable_ct(guc);
diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
index 4fa091e90b5f..10e8f0ed02e4 100644
--- a/drivers/gpu/drm/i915/intel_uc.h
+++ b/drivers/gpu/drm/i915/intel_uc.h
@@ -121,6 +121,9 @@ struct intel_guc {
 	/* To serialize the intel_guc_send actions */
 	struct mutex send_mutex;
 
+	/* Kernel context state ggtt offset, first page is shared with GuC */
+	u32 shared_data_offset;
+
 	/* GuC's FW specific send function */
 	int (*send)(struct intel_guc *guc, const u32 *data, u32 len);
 
-- 
2.13.5

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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2017-10-26 21:22 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05  9:13 [PATCH 01/10] drm/i915/guc: Precompute GuC shared data offset Michał Winiarski
2017-10-05  9:13 ` [PATCH 02/10] drm/i915/guc: Initialize GuC before restarting engines Michał Winiarski
2017-10-05  9:36   ` Chris Wilson
2017-10-05 11:55     ` Michał Winiarski
2017-10-05  9:13 ` [PATCH 03/10] drm/i915/guc: Add preemption action to GuC firmware interface Michał Winiarski
2017-10-05 14:25   ` Jeff McGee
2017-10-05  9:13 ` [PATCH 04/10] drm/i915/guc: Add a second client, to be used for preemption Michał Winiarski
2017-10-05  9:39   ` Chris Wilson
2017-10-05 13:59   ` Michal Wajdeczko
2017-10-05 14:58   ` Jeff McGee
2017-10-05 15:22   ` Daniele Ceraolo Spurio
2017-10-05 16:00     ` Michał Winiarski
2017-10-05 16:35       ` Daniele Ceraolo Spurio
2017-10-05 18:20         ` Michał Winiarski
2017-10-05  9:13 ` [PATCH 05/10] drm/i915/guc: Split guc_wq_item_append Michał Winiarski
2017-10-05  9:45   ` Chris Wilson
2017-10-05 20:37   ` Jeff McGee
2017-10-05  9:20 ` [PATCH 06/10] drm/i915: Extract "emit write" part of emit breadcrumb functions Michał Winiarski
2017-10-05  9:20   ` [PATCH 07/10] drm/i915: Add information needed to track engine preempt state Michał Winiarski
2017-10-05  9:49     ` Chris Wilson
2017-10-05 20:42     ` Jeff McGee
2017-10-05  9:20   ` [PATCH 08/10] drm/i915/guc: Keep request->priority for its lifetime Michał Winiarski
2017-10-05  9:50     ` Chris Wilson
2017-10-05  9:20   ` [PATCH 09/10] drm/i915/guc: Preemption! With GuC Michał Winiarski
2017-10-05 10:04     ` Chris Wilson
2017-10-05 10:31     ` Chris Wilson
2017-10-05 18:38       ` Michał Winiarski
2017-10-05 15:00     ` Michal Wajdeczko
2017-10-05 15:42       ` Michał Winiarski
2017-10-05  9:20   ` [PATCH 10/10] HAX Enable GuC Submission for CI Michał Winiarski
2017-10-05  9:47   ` [PATCH 06/10] drm/i915: Extract "emit write" part of emit breadcrumb functions Chris Wilson
2017-10-05  9:33 ` [PATCH 01/10] drm/i915/guc: Precompute GuC shared data offset Chris Wilson
2017-10-05 17:02   ` Daniele Ceraolo Spurio
2017-10-06 12:35     ` Michał Winiarski
2017-10-06 16:24       ` Daniele Ceraolo Spurio
2017-10-05 11:30 ` Michal Wajdeczko
2017-10-26 21:22 ` ✗ Fi.CI.BAT: failure for series starting with [01/10] " Patchwork

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.