diff mbox series

[10/19] Move CONTEXT_VALID_BIT check

Message ID 20210830121006.2978297-11-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Short-term pinning and async eviction. | expand

Commit Message

Maarten Lankhorst Aug. 30, 2021, 12:09 p.m. UTC
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_engine_pm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Niranjana Vishwanathapura Sept. 8, 2021, 7:45 p.m. UTC | #1
On Mon, Aug 30, 2021 at 02:09:57PM +0200, Maarten Lankhorst wrote:
>Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>---
> drivers/gpu/drm/i915/gt/intel_engine_pm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/gt/intel_engine_pm.c b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
>index 1f07ac4e0672..df81a0dc481e 100644
>--- a/drivers/gpu/drm/i915/gt/intel_engine_pm.c
>+++ b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
>@@ -52,8 +52,6 @@ static int __engine_unpark(struct intel_wakeref *wf)
> 	/* Discard stale context state from across idling */
> 	ce = engine->kernel_context;
> 	if (ce) {
>-		GEM_BUG_ON(test_bit(CONTEXT_VALID_BIT, &ce->flags));
>-
> 		/* Flush all pending HW writes before we touch the context */
> 		while (unlikely(intel_context_inflight(ce)))
> 			intel_engine_flush_submission(engine);
>@@ -68,6 +66,9 @@ static int __engine_unpark(struct intel_wakeref *wf)
> 			 ce->timeline->seqno,
> 			 READ_ONCE(*ce->timeline->hwsp_seqno),
> 			 ce->ring->emit);
>+
>+		GEM_BUG_ON(test_bit(CONTEXT_VALID_BIT, &ce->flags));
>+

Looks good to me.
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>

> 		GEM_BUG_ON(ce->timeline->seqno !=
> 			   READ_ONCE(*ce->timeline->hwsp_seqno));
> 	}
>-- 
>2.32.0
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_pm.c b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
index 1f07ac4e0672..df81a0dc481e 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
@@ -52,8 +52,6 @@  static int __engine_unpark(struct intel_wakeref *wf)
 	/* Discard stale context state from across idling */
 	ce = engine->kernel_context;
 	if (ce) {
-		GEM_BUG_ON(test_bit(CONTEXT_VALID_BIT, &ce->flags));
-
 		/* Flush all pending HW writes before we touch the context */
 		while (unlikely(intel_context_inflight(ce)))
 			intel_engine_flush_submission(engine);
@@ -68,6 +66,9 @@  static int __engine_unpark(struct intel_wakeref *wf)
 			 ce->timeline->seqno,
 			 READ_ONCE(*ce->timeline->hwsp_seqno),
 			 ce->ring->emit);
+
+		GEM_BUG_ON(test_bit(CONTEXT_VALID_BIT, &ce->flags));
+
 		GEM_BUG_ON(ce->timeline->seqno !=
 			   READ_ONCE(*ce->timeline->hwsp_seqno));
 	}