From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 5/5] drm/i915: Simplify intel_engine_wakeup()
Date: Mon, 27 Feb 2017 10:34:12 +0000 [thread overview]
Message-ID: <9f3ac7ca-671a-e7db-fbe4-ec49458a1d14@linux.intel.com> (raw)
In-Reply-To: <20170224180149.8737-5-chris@chris-wilson.co.uk>
On 24/02/2017 18:01, Chris Wilson wrote:
> Now the only use of the return value is ask whether or not we actually
> woke a process up. With a single condition to report, we can go back to
> using a boolean.
Argh! :) I guess it depends on whether you keep or not the open coded
intel_engine_wakeup's in the previous patch.
Regards,
Tvrtko
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_breadcrumbs.c | 13 +++++--------
> drivers/gpu/drm/i915/intel_ringbuffer.h | 4 +---
> 2 files changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> index 8e83be343057..84034ee827af 100644
> --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> @@ -26,19 +26,16 @@
>
> #include "i915_drv.h"
>
> -unsigned int intel_engine_wakeup(struct intel_engine_cs *engine)
> +bool intel_engine_wakeup(struct intel_engine_cs *engine)
> {
> struct intel_wait *wait;
> unsigned long flags;
> - unsigned int ret = 0;
> + bool ret = false;
>
> spin_lock_irqsave(&engine->breadcrumbs.lock, flags);
> wait = engine->breadcrumbs.first_wait;
> - if (wait) {
> - ret = ENGINE_WAKEUP_WAITER;
> - if (wake_up_process(wait->tsk))
> - ret |= ENGINE_WAKEUP_ASLEEP;
> - }
> + if (wait && wake_up_process(wait->tsk))
> + ret = true;
> spin_unlock_irqrestore(&engine->breadcrumbs.lock, flags);
>
> return ret;
> @@ -67,7 +64,7 @@ static void intel_breadcrumbs_hangcheck(unsigned long data)
> * to process the pending interrupt (e.g, low priority task on a loaded
> * system) and wait until it sleeps before declaring a missed interrupt.
> */
> - if (!(intel_engine_wakeup(engine) & ENGINE_WAKEUP_ASLEEP)) {
> + if (!intel_engine_wakeup(engine)) {
> mod_timer(&b->hangcheck, wait_timeout());
> return;
> }
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index 3dd6eee4a08b..007628231ec3 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -642,9 +642,7 @@ static inline bool intel_engine_has_waiter(const struct intel_engine_cs *engine)
> return READ_ONCE(engine->breadcrumbs.first_wait);
> }
>
> -unsigned int intel_engine_wakeup(struct intel_engine_cs *engine);
> -#define ENGINE_WAKEUP_WAITER BIT(0)
> -#define ENGINE_WAKEUP_ASLEEP BIT(1)
> +bool intel_engine_wakeup(struct intel_engine_cs *engine);
>
> void __intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine);
> void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine);
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-02-27 10:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-24 18:01 [PATCH v3 1/5] drm/i915: Report both waiters and success from intel_engine_wakeup() Chris Wilson
2017-02-24 18:01 ` [PATCH v3 2/5] drm/i915: Signal first fence from irq handler if complete Chris Wilson
2017-02-25 10:05 ` [PATCH v4] " Chris Wilson
2017-02-27 10:04 ` Tvrtko Ursulin
2017-02-24 18:01 ` [PATCH v3 3/5] drm/i915: Defer enabling hangcheck to the first fake breadcrumb interrupt Chris Wilson
2017-02-27 10:15 ` Tvrtko Ursulin
2017-02-24 18:01 ` [PATCH v3 4/5] drm/i915: Delay disabling the user interrupt for breadcrumbs Chris Wilson
2017-02-27 10:31 ` Tvrtko Ursulin
2017-02-27 11:02 ` Chris Wilson
2017-02-24 18:01 ` [PATCH v3 5/5] drm/i915: Simplify intel_engine_wakeup() Chris Wilson
2017-02-27 10:34 ` Tvrtko Ursulin [this message]
2017-02-24 18:52 ` ✗ Fi.CI.BAT: warning for series starting with [v3,1/5] drm/i915: Report both waiters and success from intel_engine_wakeup() Patchwork
2017-02-25 10:52 ` ✓ Fi.CI.BAT: success for series starting with [v3,1/5] drm/i915: Report both waiters and success from intel_engine_wakeup() (rev2) Patchwork
2017-02-27 10:03 ` [PATCH v3 1/5] drm/i915: Report both waiters and success from intel_engine_wakeup() Tvrtko Ursulin
2017-02-27 10:35 ` Chris Wilson
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=9f3ac7ca-671a-e7db-fbe4-ec49458a1d14@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox