diff mbox

[v2] drm/i915: fix the dequeue logic for single_port_submission context

Message ID 1479303176-12682-1-git-send-email-min.he@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

He, Min Nov. 16, 2016, 1:32 p.m. UTC
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.

Signed-off-by: Min He <min.he@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Chris Wilson Nov. 16, 2016, 1:48 p.m. UTC | #1
On Wed, Nov 16, 2016 at 09:32:56PM +0800, Min He wrote:
> 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.
> 
> Signed-off-by: Min He <min.he@intel.com>
> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>

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.

>  drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index f50feaa..4f692a8 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -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
He, Min Nov. 16, 2016, 1:54 p.m. UTC | #2
> -----Original Message-----
> From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> Sent: Wednesday, November 16, 2016 9:48 PM
> To: He, Min <min.he@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: fix the dequeue logic for
> single_port_submission context
> 
> On Wed, Nov 16, 2016 at 09:32:56PM +0800, Min He wrote:
> > 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.
> >
> > Signed-off-by: Min He <min.he@intel.com>
> > Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
> 
> 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.

> 
> >  drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> > index f50feaa..4f692a8 100644
> > --- a/drivers/gpu/drm/i915/intel_lrc.c
> > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > @@ -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.
Ok, will send out another version.

> -Chris
> 
> --
> Chris Wilson, Intel Open Source Technology Centre
Daniel Vetter Nov. 16, 2016, 2:43 p.m. UTC | #3
On Wed, Nov 16, 2016 at 01:54:45PM +0000, He, Min wrote:
> 
> > -----Original Message-----
> > From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> > Sent: Wednesday, November 16, 2016 9:48 PM
> > To: He, Min <min.he@intel.com>
> > Cc: intel-gfx@lists.freedesktop.org
> > Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: fix the dequeue logic for
> > single_port_submission context
> > 
> > On Wed, Nov 16, 2016 at 09:32:56PM +0800, Min He wrote:
> > > 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.
> > >
> > > Signed-off-by: Min He <min.he@intel.com>
> > > Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
> > 
> > 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

> 
> > 
> > >  drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> > > index f50feaa..4f692a8 100644
> > > --- a/drivers/gpu/drm/i915/intel_lrc.c
> > > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > > @@ -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.
> Ok, will send out another version.
> 
> > -Chris
> > 
> > --
> > Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index f50feaa..4f692a8 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -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);