From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915/lrc: Remove superfluous WARN_ON
Date: Fri, 26 Jan 2018 12:21:51 +0000 [thread overview]
Message-ID: <79c8ea5c-936e-eb45-e4bc-27e15e56c35e@linux.intel.com> (raw)
In-Reply-To: <20180126121846.12007-1-chris@chris-wilson.co.uk>
On 26/01/2018 12:18, Chris Wilson wrote:
> Remove the WARN_ON(ce->state) inside the static function only called
> when ce->state == NULL and downgrade the w/a batch setup warning into a
> developer only mode (GEM_WARN_ON).
>
> v2: Move the deferred alloc guard into the callee, eliminating the need
> for the WARN_ON:
> add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-1 (-1)
> Function old new delta
> execlists_context_pin 1819 1818 -1
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 1a3174371c8e..c8a11315b357 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1091,11 +1091,9 @@ execlists_context_pin(struct intel_engine_cs *engine,
> goto out;
> GEM_BUG_ON(!ce->pin_count); /* no overflow please! */
>
> - if (!ce->state) {
> - ret = execlists_context_deferred_alloc(ctx, engine);
> - if (ret)
> - goto err;
> - }
> + ret = execlists_context_deferred_alloc(ctx, engine);
> + if (ret)
> + goto err;
> GEM_BUG_ON(!ce->state);
>
> ret = __context_pin(ctx, ce->state);
> @@ -1419,7 +1417,8 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine)
> */
> for (i = 0; i < ARRAY_SIZE(wa_bb_fn); i++) {
> wa_bb[i]->offset = batch_ptr - batch;
> - if (WARN_ON(!IS_ALIGNED(wa_bb[i]->offset, CACHELINE_BYTES))) {
> + if (GEM_WARN_ON(!IS_ALIGNED(wa_bb[i]->offset,
> + CACHELINE_BYTES))) {
> ret = -EINVAL;
> break;
> }
> @@ -2271,7 +2270,8 @@ static int execlists_context_deferred_alloc(struct i915_gem_context *ctx,
> struct intel_ring *ring;
> int ret;
>
> - WARN_ON(ce->state);
> + if (ce->state)
> + return 0;
>
> context_size = round_up(engine->context_size, I915_GTT_PAGE_SIZE);
>
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-01-26 12:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 9:35 [PATCH] drm/i915/lrc: Remove superfluous WARN_ON Chris Wilson
2018-01-26 10:15 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-01-26 11:35 ` ✗ Fi.CI.IGT: warning " Patchwork
2018-01-26 11:49 ` [PATCH] " Tvrtko Ursulin
2018-01-26 12:13 ` Chris Wilson
2018-01-26 12:18 ` [PATCH v2] " Chris Wilson
2018-01-26 12:21 ` Tvrtko Ursulin [this message]
2018-01-26 12:41 ` ✓ Fi.CI.BAT: success for drm/i915/lrc: Remove superfluous WARN_ON (rev2) Patchwork
2018-01-26 13:05 ` Chris Wilson
2018-01-26 13:28 ` ✗ Fi.CI.IGT: failure " 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=79c8ea5c-936e-eb45-e4bc-27e15e56c35e@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