From: Nathan Chancellor <natechancellor@gmail.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, swboyd@chromium.org,
ndesaulniers@google.com
Subject: Re: [PATCH 2/2] drm/i915: Ensure intel_engine_init_execlist() builds with Clang
Date: Tue, 16 Oct 2018 08:11:00 -0700 [thread overview]
Message-ID: <20181016151100.GB22841@flashbox> (raw)
In-Reply-To: <20181016122938.18757-2-jani.nikula@intel.com>
On Tue, Oct 16, 2018 at 03:29:38PM +0300, Jani Nikula wrote:
> Clang build with UBSAN enabled leads to the following build error:
>
> drivers/gpu/drm/i915/intel_engine_cs.o: In function `intel_engine_init_execlist':
> drivers/gpu/drm/i915/intel_engine_cs.c:411: undefined reference to `__compiletime_assert_411'
>
> Again, for this to work the code would first need to be inlined and then
> constant folded, which doesn't work for Clang because semantic analysis
> happens before optimization/inlining.
>
> Use GEM_BUG_ON() instead of BUILD_BUG_ON().
>
> v2: Use is_power_of_2() from log2.h (Chris)
>
> References: http://mid.mail-archive.com/20181015203410.155997-1-swboyd@chromium.org
> Reported-by: Stephen Boyd <swboyd@chromium.org>
> Cc: Stephen Boyd <swboyd@chromium.org>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
> drivers/gpu/drm/i915/intel_engine_cs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index f27dbe26bcc1..bc793b0c8806 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -466,7 +466,7 @@ static void intel_engine_init_execlist(struct intel_engine_cs *engine)
> struct intel_engine_execlists * const execlists = &engine->execlists;
>
> execlists->port_mask = 1;
> - BUILD_BUG_ON_NOT_POWER_OF_2(execlists_num_ports(execlists));
> + GEM_BUG_ON(!is_power_of_2(execlists_num_ports(execlists)));
> GEM_BUG_ON(execlists_num_ports(execlists) > EXECLIST_MAX_PORTS);
>
> execlists->queue_priority = INT_MIN;
> --
> 2.11.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-10-16 15:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 12:29 [PATCH 1/2] drm/i915: Ensure _print_param() builds with Clang Jani Nikula
2018-10-16 12:29 ` [PATCH 2/2] drm/i915: Ensure intel_engine_init_execlist() " Jani Nikula
2018-10-16 15:11 ` Nathan Chancellor [this message]
2018-10-16 15:18 ` Chris Wilson
2018-10-16 15:35 ` Stephen Boyd
2018-10-16 18:33 ` Nick Desaulniers
2018-10-17 7:24 ` Jani Nikula
2018-10-22 21:10 ` Nick Desaulniers
2018-10-22 21:19 ` Nick Desaulniers
2018-10-16 12:35 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915: Ensure _print_param() " Patchwork
2018-10-16 13:00 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-16 14:14 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-10-16 15:10 ` [PATCH 1/2] " Nathan Chancellor
2018-10-16 15:16 ` Chris Wilson
2018-10-16 18:38 ` Nick Desaulniers
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=20181016151100.GB22841@flashbox \
--to=natechancellor@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=ndesaulniers@google.com \
--cc=swboyd@chromium.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 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.