From: Chris Wilson <chris@chris-wilson.co.uk>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 8/8] drm/i915: Keep track of reserved execlist ports
Date: Tue, 12 Sep 2017 11:51:44 +0100 [thread overview]
Message-ID: <150521350420.22039.8067737388464419317@mail.alporthouse.com> (raw)
In-Reply-To: <87k2142ouu.fsf@gaia.fi.intel.com>
Quoting Mika Kuoppala (2017-09-12 11:27:53)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
>
> > Quoting Mika Kuoppala (2017-09-12 09:36:18)
> >> +execlist_request_port(struct intel_engine_execlist * const el)
> >> +{
> >> + GEM_DEBUG_BUG_ON(el->port_count == el->port_mask + 1);
> >> +
> >> + el->port_count++;
> >> +
> >> + GEM_DEBUG_BUG_ON(port_isset(execlist_port_tail(el)));
> >> +
> >> + return execlist_port_tail(el);
> >> +}
> >>
> >> diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
> >> index 0dfb03a0cee4..fdda3a1835ad 100644
> >> --- a/drivers/gpu/drm/i915/i915_guc_submission.c
> >> +++ b/drivers/gpu/drm/i915/i915_guc_submission.c
> >> @@ -662,12 +662,19 @@ static void port_assign(struct execlist_port *port,
> >> static bool i915_guc_dequeue(struct intel_engine_cs *engine)
> >> {
> >> struct intel_engine_execlist * const el = &engine->execlist;
> >> - struct execlist_port *port = execlist_port_head(el);
> >> - const struct execlist_port * const last_port = execlist_port_tail(el);
> >> - struct drm_i915_gem_request *last = port_request(port);
> >> + struct execlist_port *port;
> >> + struct drm_i915_gem_request *last;
> >> struct rb_node *rb;
> >> bool submit = false;
> >>
> >> + if (execlist_active_ports(el)) {
> >> + port = execlist_port_tail(el);
> >> + last = port_request(port);
> >> + } else {
> >> + port = NULL;
> >> + last = NULL;
> >> + }
> >> +
> >> spin_lock_irq(&engine->timeline->lock);
> >> rb = el->first;
> >> GEM_BUG_ON(rb_first(&el->queue) != rb);
> >> @@ -675,9 +682,12 @@ static bool i915_guc_dequeue(struct intel_engine_cs *engine)
> >> struct i915_priolist *p = rb_entry(rb, typeof(*p), node);
> >> struct drm_i915_gem_request *rq, *rn;
> >>
> >> + if (!port)
> >> + port = execlist_request_port(el);
> >> +
> >
> > I can't see port becoming NULL inside the loop, so why can't we do it
> > during the init above? What did I miss?
>
> Hmm this might have warranted a comment. I wanted to avoid requesting
> a port if there is nothing to dequeue, that is why it inside while (rb).
> We could allocate early and let the port linger if nothing to dequeue,
> but then the GEM_DEBUG's need to be relaxed more.
Ah, that's where only advancing at the end comes into play. Would also
help not to call it request_port... Or just not hiding the mechanics.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-09-12 10:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-12 8:36 [PATCH 0/8] Support for more than two execlist ports Mika Kuoppala
2017-09-12 8:36 ` [PATCH 1/8] drm/i915: Make own struct for execlist items Mika Kuoppala
2017-09-12 10:14 ` Chris Wilson
2017-09-12 8:36 ` [PATCH 2/8] drm/i915: Wrap port cancellation into a function Mika Kuoppala
2017-09-12 10:15 ` Chris Wilson
2017-09-12 8:36 ` [PATCH 3/8] drm/i915: Add execlist_port_complete Mika Kuoppala
2017-09-12 10:19 ` Chris Wilson
2017-09-12 8:36 ` [PATCH 4/8] drm/i915: Make execlist port count variable Mika Kuoppala
2017-09-12 8:55 ` Chris Wilson
2017-09-12 10:24 ` Chris Wilson
2017-09-12 8:36 ` [PATCH 5/8] drm/i915: Introduce iterators for execlist ports Mika Kuoppala
2017-09-12 10:30 ` Chris Wilson
2017-09-12 10:36 ` Mika Kuoppala
2017-09-12 8:36 ` [PATCH 6/8] drm/i915: Introduce execlist_port_* accessors Mika Kuoppala
2017-09-12 10:37 ` Chris Wilson
2017-09-12 8:36 ` [PATCH 7/8] drm/i915: Move execlist initialization into intel_engine_cs.c Mika Kuoppala
2017-09-12 10:41 ` Chris Wilson
2017-09-12 8:36 ` [PATCH 8/8] drm/i915: Keep track of reserved execlist ports Mika Kuoppala
2017-09-12 9:15 ` Chris Wilson
2017-09-12 10:27 ` Mika Kuoppala
2017-09-12 10:51 ` Chris Wilson [this message]
2017-09-12 9:17 ` Chris Wilson
2017-09-12 9:19 ` Chris Wilson
2017-09-12 9:23 ` Chris Wilson
2017-09-12 10:29 ` Mika Kuoppala
2017-09-12 10:53 ` Chris Wilson
2017-09-12 9:35 ` Chris Wilson
2017-09-12 10:45 ` Chris Wilson
2017-09-12 8:59 ` ✓ Fi.CI.BAT: success for Support for more than two " Patchwork
2017-09-12 10:48 ` ✓ Fi.CI.IGT: " 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=150521350420.22039.8067737388464419317@mail.alporthouse.com \
--to=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kuoppala@linux.intel.com \
/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.