All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915: Fix enable OA report logic
@ 2019-12-25  8:04 Ebrahim Byagowi
  2019-12-25  8:06 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
  2019-12-26 17:03 ` [Intel-gfx] [PATCH] " Lucas De Marchi
  0 siblings, 2 replies; 3+ messages in thread
From: Ebrahim Byagowi @ 2019-12-25  8:04 UTC (permalink / raw)
  To: intel-gfx


Clang raises

  drivers/gpu/drm/i915/i915_perf.c:2474:50: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
                             !(stream->sample_flags & SAMPLE_OA_REPORT) ?
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
  drivers/gpu/drm/i915/i915_perf.c:2474:50: note: place parentheses around the '|' expression to silence this warning
                             !(stream->sample_flags & SAMPLE_OA_REPORT) ?
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
  drivers/gpu/drm/i915/i915_perf.c:2474:50: note: place parentheses around the '?:' expression to evaluate it first
                             !(stream->sample_flags & SAMPLE_OA_REPORT) ?
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

with -Wbitwise-conditional-parentheses and apparently is right
as '|' is evaluated before '?:' which doesn't seem to be the intention
here so let's put parentheses in the right place to fix it.

Signed-off-by: Ebrahim Byagowi <ebrahim@gnu.org>
---
 drivers/gpu/drm/i915/i915_perf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 2ae14bc14931..db963f7c2e2e 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -2471,9 +2471,9 @@ static int gen12_enable_metric_set(struct i915_perf_stream *stream)
 			    * If the user didn't require OA reports, instruct the
 			    * hardware not to emit ctx switch reports.
 			    */
-			   !(stream->sample_flags & SAMPLE_OA_REPORT) ?
-			   _MASKED_BIT_ENABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS) :
-			   _MASKED_BIT_DISABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS));
+			   (!(stream->sample_flags & SAMPLE_OA_REPORT) ?
+			    _MASKED_BIT_ENABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS) :
+			    _MASKED_BIT_DISABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS)));
 
 	intel_uncore_write(uncore, GEN12_OAG_OAGLBCTXCTRL, periodic ?
 			   (GEN12_OAG_OAGLBCTXCTRL_COUNTER_RESUME |
-- 
2.24.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

* [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Fix enable OA report logic
  2019-12-25  8:04 [Intel-gfx] [PATCH] drm/i915: Fix enable OA report logic Ebrahim Byagowi
@ 2019-12-25  8:06 ` Patchwork
  2019-12-26 17:03 ` [Intel-gfx] [PATCH] " Lucas De Marchi
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2019-12-25  8:06 UTC (permalink / raw)
  To: Ebrahim Byagowi; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fix enable OA report logic
URL   : https://patchwork.freedesktop.org/series/71373/
State : failure

== Summary ==

Applying: drm/i915: Fix enable OA report logic
Using index info to reconstruct a base tree...
M	drivers/gpu/drm/i915/i915_perf.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/i915_perf.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_perf.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 drm/i915: Fix enable OA report logic
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
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

* Re: [Intel-gfx] [PATCH] drm/i915: Fix enable OA report logic
  2019-12-25  8:04 [Intel-gfx] [PATCH] drm/i915: Fix enable OA report logic Ebrahim Byagowi
  2019-12-25  8:06 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
@ 2019-12-26 17:03 ` Lucas De Marchi
  1 sibling, 0 replies; 3+ messages in thread
From: Lucas De Marchi @ 2019-12-26 17:03 UTC (permalink / raw)
  To: Ebrahim Byagowi; +Cc: Intel Graphics

On Wed, Dec 25, 2019 at 12:05 AM Ebrahim Byagowi <ebrahim@gnu.org> wrote:
>
>
> Clang raises
>
>   drivers/gpu/drm/i915/i915_perf.c:2474:50: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
>                              !(stream->sample_flags & SAMPLE_OA_REPORT) ?
>                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
>   drivers/gpu/drm/i915/i915_perf.c:2474:50: note: place parentheses around the '|' expression to silence this warning
>                              !(stream->sample_flags & SAMPLE_OA_REPORT) ?
>                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
>   drivers/gpu/drm/i915/i915_perf.c:2474:50: note: place parentheses around the '?:' expression to evaluate it first
>                              !(stream->sample_flags & SAMPLE_OA_REPORT) ?
>                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
>
> with -Wbitwise-conditional-parentheses and apparently is right
> as '|' is evaluated before '?:' which doesn't seem to be the intention
> here so let's put parentheses in the right place to fix it.
>
> Signed-off-by: Ebrahim Byagowi <ebrahim@gnu.org>

This has already been fixed by
9278bbb6e43c ("drm/i915/perf: Reverse a ternary to make sparse happy")

Maybe it missed a "Fixes", reason it was not propagated to stable kernel.

Lucas De Marchi

> ---
>  drivers/gpu/drm/i915/i915_perf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> index 2ae14bc14931..db963f7c2e2e 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -2471,9 +2471,9 @@ static int gen12_enable_metric_set(struct i915_perf_stream *stream)
>                             * If the user didn't require OA reports, instruct the
>                             * hardware not to emit ctx switch reports.
>                             */
> -                          !(stream->sample_flags & SAMPLE_OA_REPORT) ?
> -                          _MASKED_BIT_ENABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS) :
> -                          _MASKED_BIT_DISABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS));
> +                          (!(stream->sample_flags & SAMPLE_OA_REPORT) ?
> +                           _MASKED_BIT_ENABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS) :
> +                           _MASKED_BIT_DISABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS)));
>
>         intel_uncore_write(uncore, GEN12_OAG_OAGLBCTXCTRL, periodic ?
>                            (GEN12_OAG_OAGLBCTXCTRL_COUNTER_RESUME |
> --
> 2.24.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Lucas De Marchi
_______________________________________________
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:[~2019-12-26 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-25  8:04 [Intel-gfx] [PATCH] drm/i915: Fix enable OA report logic Ebrahim Byagowi
2019-12-25  8:06 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
2019-12-26 17:03 ` [Intel-gfx] [PATCH] " Lucas De Marchi

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.