Skip to contentSkip to conversation

drm/i915: fix the dequeue logic for single_port_submission context

PATCH Superseded Min He 3 participants 4 messages Nov 16, 2016

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Min He

author
#0 lore raw

PATCH v2 1/1 drm/i915: fix the dequeue logic for single_port_submission context

For a singl_port_submission context, it can only be submitted to port 0, and there shouldn't be any other context in port 1 at the same time. This is required by GVT-g context to have an opportunity to save/restore some non-hw context render registers.
This patch is to implement the correct logic in execlists_dequeue.

V2: optimized code by following Chris's advice, and added more comments to explain the patch.

---
 drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +2 -1
index f50feaa..4f692a8 100644
@@ -499,7 +499,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
 			 * context (even though a different request) to
 			 * the second port.
 			 */
-			if (ctx_single_port_submission(cursor->ctx))
+			if (ctx_single_port_submission(cursor->ctx)
+				|| ctx_single_port_submission(last->ctx))
 				break;
 
 			GEM_BUG_ON(last->ctx == cursor->ctx);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 11 lines · Min He

For a singl_port_submission context, it can only be submitted to port 0, and there shouldn't be any other context in port 1 at the same time. This is required by GVT-g context to have an opportunity to save/restore some non-hw context render registers.
This patch is to implement the correct logic in execlists_dequeue.

V2: optimized code by following Chris's advice, and added more comments to explain the patch.

If you wrote it, and sent it to the list, at what point did Zhenyu Wang handle it?

That would be more valuable to us if that was either a reviewed-by or a tested-by.

Quoted 8 lines
 drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index f50feaa..4f692a8 100644

drivers/gpu/drm/i915/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs *engine) · line 503

Quoted 6 lines
drivers/gpu/drm/i915/intel_lrc.c +2 -1
@@ -499,7 +499,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
 			 * context (even though a different request) to
 			 * the second port.
 			 */
-			if (ctx_single_port_submission(cursor->ctx))
+			if (ctx_single_port_submission(cursor->ctx)
+				|| ctx_single_port_submission(last->ctx))

if (ctx_single_port_submission(last->ctx) ||

    ctx_single_port_submission(cursor->ctx))

CodingStyle: || goes at the end of the line, new line aligned to bracket.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#2 lore raw
Quoted 19 lines

-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: Wednesday, November 16, 2016 9:48 PM
To: He, Min <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: fix the dequeue logic for single_port_submission context

Quoted 9 lines · Min He

For a singl_port_submission context, it can only be submitted to port 0, and there shouldn't be any other context in port 1 at the same time. This is required by GVT-g context to have an opportunity to save/restore some non-hw context render registers.
This patch is to implement the correct logic in execlists_dequeue.

V2: optimized code by following Chris's advice, and added more comments to explain the patch.

Quoted 8 lines
Quoted 2 lines

If you wrote it, and sent it to the list, at what point did Zhenyu Wang handle it?

That would be more valuable to us if that was either a reviewed-by or a tested-by.

Zhenyu and I discussed about the solution for this issue and we reached the first version of this patch. That's why I added his name.

Quoted 18 lines

drivers/gpu/drm/i915/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs

Quoted 9 lines
 drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index f50feaa..4f692a8 100644
@@ -499,7 +499,8 @@ static void execlists_dequeue(struct intel_engine_cs

*engine)

drivers/gpu/drm/i915/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs *engine) · line 503

Quoted 6 lines
drivers/gpu/drm/i915/intel_lrc.c +2 -1
 			 * context (even though a different request) to
 			 * the second port.
 			 */
-			if (ctx_single_port_submission(cursor->ctx))
+			if (ctx_single_port_submission(cursor->ctx)
+				|| ctx_single_port_submission(last->ctx))

if (ctx_single_port_submission(last->ctx) ||

Quoted 4 lines
    ctx_single_port_submission(cursor->ctx))

CodingStyle: || goes at the end of the line, new line aligned to bracket.

Ok, will send out another version.

Quoted 4 lines

-Chris

--
Chris Wilson, Intel Open Source Technology Centre

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 22 lines · Min
Quoted 22 lines

-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: Wednesday, November 16, 2016 9:48 PM
To: He, Min <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: fix the dequeue logic for single_port_submission context

Quoted 11 lines · Min He

For a singl_port_submission context, it can only be submitted to port 0, and there shouldn't be any other context in port 1 at the same time. This is required by GVT-g context to have an opportunity to save/restore some non-hw context render registers.
This patch is to implement the correct logic in execlists_dequeue.

V2: optimized code by following Chris's advice, and added more comments to explain the patch.

Quoted 7 lines
Quoted 5 lines

If you wrote it, and sent it to the list, at what point did Zhenyu Wang handle it?

That would be more valuable to us if that was either a reviewed-by or a tested-by.

Zhenyu and I discussed about the solution for this issue and we reached the first version of this patch. That's why I added his name.

suggested-by or reviewed-by seems more appropriate in this case. s-o-b means you've handled the patch somehow (forwarded, edited, whatever). -Daniel

Quoted 33 lines
Quoted 19 lines

drivers/gpu/drm/i915/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs

Quoted 10 lines

 drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index f50feaa..4f692a8 100644
@@ -499,7 +499,8 @@ static void execlists_dequeue(struct intel_engine_cs

*engine)

drivers/gpu/drm/i915/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs *engine) · line 503

Quoted 6 lines
drivers/gpu/drm/i915/intel_lrc.c +2 -1
 			 * context (even though a different request) to
 			 * the second port.
 			 */
-			if (ctx_single_port_submission(cursor->ctx))
+			if (ctx_single_port_submission(cursor->ctx)
+				|| ctx_single_port_submission(last->ctx))

if (ctx_single_port_submission(last->ctx) ||

Quoted 4 lines
    ctx_single_port_submission(cursor->ctx))

CodingStyle: || goes at the end of the line, new line aligned to bracket.

Ok, will send out another version.

Quoted 4 lines

-Chris

--
Chris Wilson, Intel Open Source Technology Centre

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx