All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/2] drm/i915/gt: Defer mocs setup until after the initial context is loaded
Date: Tue, 22 Oct 2019 08:51:51 +0100	[thread overview]
Message-ID: <20191022075151.5781-2-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20191022075151.5781-1-chris@chris-wilson.co.uk>

On my kbl gt4e, there is a distinction between the power context and the
normal contexts. We must delay the mocs setup until after we have primed
the kernel context to record the mocs register settings within the
context image.

Fixes: eca0b7208969 ("drm/i915: Do initial mocs configuration directly")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Prathap Kumar Valsan <prathap.kumar.valsan@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm.c | 6 +++++-
 drivers/gpu/drm/i915/gt/intel_lrc.c   | 3 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index 06e73d56cfcf..0f9be5722c24 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -12,6 +12,7 @@
 #include "intel_gt.h"
 #include "intel_gt_pm.h"
 #include "intel_gt_requests.h"
+#include "intel_mocs.h"
 #include "intel_pm.h"
 #include "intel_rc6.h"
 #include "intel_wakeref.h"
@@ -182,13 +183,16 @@ int intel_gt_resume(struct intel_gt *gt)
 		engine->serial++; /* kernel context lost */
 		err = engine->resume(engine);
 
-		intel_engine_pm_put(engine);
+		intel_engine_pm_put(engine); /* primes kernel context */
 		if (err) {
 			dev_err(gt->i915->drm.dev,
 				"Failed to restart %s (%d)\n",
 				engine->name, err);
 			break;
 		}
+		intel_engine_flush_submission(engine);
+
+		intel_mocs_init_engine(engine);
 	}
 
 	intel_rc6_enable(&gt->rc6);
diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index f9f3e985bb79..53ee389453d5 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -143,7 +143,6 @@
 #include "intel_gt.h"
 #include "intel_gt_pm.h"
 #include "intel_lrc_reg.h"
-#include "intel_mocs.h"
 #include "intel_reset.h"
 #include "intel_workarounds.h"
 
@@ -2639,8 +2638,6 @@ static int execlists_resume(struct intel_engine_cs *engine)
 	intel_engine_apply_workarounds(engine);
 	intel_engine_apply_whitelist(engine);
 
-	intel_mocs_init_engine(engine);
-
 	intel_engine_reset_breadcrumbs(engine);
 
 	if (GEM_SHOW_DEBUG() && unexpected_starting_state(engine)) {
-- 
2.24.0.rc0

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

  reply	other threads:[~2019-10-22  7:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22  7:51 [PATCH 1/2] drm/i915/selftests: Add coverage of mocs registers Chris Wilson
2019-10-22  7:51 ` Chris Wilson [this message]
2019-10-22  7:56   ` [PATCH 2/2] drm/i915/gt: Defer mocs setup until after the initial context is loaded Chris Wilson
2019-10-22  8:18     ` Chris Wilson
2019-10-22  8:14 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/selftests: Add coverage of mocs registers Patchwork
2019-10-22  8:35 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-22 14:41 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20191022075151.5781-2-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --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.