* [Intel-gfx] [PATCH] drm/i915/gt: Rearrange code to silence compiler @ 2020-02-17 9:58 Chris Wilson 2020-02-17 10:08 ` Matthew Auld 2020-02-17 15:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork 0 siblings, 2 replies; 3+ messages in thread From: Chris Wilson @ 2020-02-17 9:58 UTC (permalink / raw) To: intel-gfx; +Cc: matthew.auld Without selftests enabled, I915_SELFTEST_ONLY becomes a dummy, generating a bare '0'. This causes the compiler to complain about a useless line, and while we could use I915_SELFTEST_DECLARE instead, it is a bit messier. Move the selftest-only code to a helper and make that conditional on having selftests enabled. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- drivers/gpu/drm/i915/gt/intel_lrc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c index 78e854440949..ba31cbe8c68e 100644 --- a/drivers/gpu/drm/i915/gt/intel_lrc.c +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c @@ -1206,6 +1206,14 @@ static u32 intel_context_get_runtime(const struct intel_context *ce) return READ_ONCE(ce->lrc_reg_state[CTX_TIMESTAMP]); } +static void st_update_runtime_underflow(struct intel_context *ce, s32 dt) +{ +#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) + ce->runtime.num_underflow += dt < 0; + ce->runtime.max_underflow = max_t(u32, ce->runtime.max_underflow, -dt); +#endif +} + static void intel_context_update_runtime(struct intel_context *ce) { u32 old; @@ -1221,9 +1229,7 @@ static void intel_context_update_runtime(struct intel_context *ce) if (unlikely(dt <= 0)) { CE_TRACE(ce, "runtime underflow: last=%u, new=%u, delta=%d\n", old, ce->runtime.last, dt); - I915_SELFTEST_ONLY(ce->runtime.num_underflow += dt < 0); - I915_SELFTEST_ONLY(ce->runtime.max_underflow = - max_t(u32, ce->runtime.max_underflow, -dt)); + st_update_runtime_underflow(ce, dt); return; } -- 2.25.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915/gt: Rearrange code to silence compiler 2020-02-17 9:58 [Intel-gfx] [PATCH] drm/i915/gt: Rearrange code to silence compiler Chris Wilson @ 2020-02-17 10:08 ` Matthew Auld 2020-02-17 15:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork 1 sibling, 0 replies; 3+ messages in thread From: Matthew Auld @ 2020-02-17 10:08 UTC (permalink / raw) To: Chris Wilson, intel-gfx On 17/02/2020 09:58, Chris Wilson wrote: > Without selftests enabled, I915_SELFTEST_ONLY becomes a dummy, > generating a bare '0'. This causes the compiler to complain about a > useless line, and while we could use I915_SELFTEST_DECLARE instead, it > is a bit messier. Move the selftest-only code to a helper and make that > conditional on having selftests enabled. > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Auld <matthew.auld@intel.com> _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gt: Rearrange code to silence compiler 2020-02-17 9:58 [Intel-gfx] [PATCH] drm/i915/gt: Rearrange code to silence compiler Chris Wilson 2020-02-17 10:08 ` Matthew Auld @ 2020-02-17 15:11 ` Patchwork 1 sibling, 0 replies; 3+ messages in thread From: Patchwork @ 2020-02-17 15:11 UTC (permalink / raw) To: Chris Wilson; +Cc: intel-gfx == Series Details == Series: drm/i915/gt: Rearrange code to silence compiler URL : https://patchwork.freedesktop.org/series/73533/ State : success == Summary == CI Bug Log - changes from CI_DRM_7954 -> Patchwork_16593 ==================================================== Summary ------- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16593/index.html Known issues ------------ Here are the changes found in Patchwork_16593 that come from known issues: ### IGT changes ### #### Possible fixes #### * igt@gem_close_race@basic-threads: - fi-hsw-peppy: [TIMEOUT][1] ([fdo#112271] / [i915#1084]) -> [PASS][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7954/fi-hsw-peppy/igt@gem_close_race@basic-threads.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16593/fi-hsw-peppy/igt@gem_close_race@basic-threads.html [fdo#112271]: https://bugs.freedesktop.org/show_bug.cgi?id=112271 [i915#1084]: https://gitlab.freedesktop.org/drm/intel/issues/1084 Participating hosts (50 -> 43) ------------------------------ Additional (1): fi-ehl-1 Missing (8): fi-hsw-4200u fi-bsw-n3050 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-7560u fi-byt-n2820 fi-byt-clapper Build changes ------------- * CI: CI-20190529 -> None * Linux: CI_DRM_7954 -> Patchwork_16593 CI-20190529: 20190529 CI_DRM_7954: d7c1791394faaa869d3442705413dac8c0ecd677 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_5444: c46bae259d427f53fcfcd5f05de0181a9e82d6fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools Patchwork_16593: 4806975145b511fb2842dd572b7bba3c2d344e66 @ git://anongit.freedesktop.org/gfx-ci/linux == Linux commits == 4806975145b5 drm/i915/gt: Rearrange code to silence compiler == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16593/index.html _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-17 15:11 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-02-17 9:58 [Intel-gfx] [PATCH] drm/i915/gt: Rearrange code to silence compiler Chris Wilson 2020-02-17 10:08 ` Matthew Auld 2020-02-17 15:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
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.