Re: [Intel-gfx] [PATCH 02/11] drm/i915/perf: check the value of PROP_SAMPLE_OA uapi parameter

2018-03-26 Thread Matthew Auld
On 26 March 2018 at 10:08, Lionel Landwerlin
 wrote:
> We've been a bit loose about this opening parameter. We should only
> add the flag for writing OA reports when the value of this parameter
> is != 0.
>
> Signed-off-by: Lionel Landwerlin 
> ---
>  drivers/gpu/drm/i915/i915_perf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_perf.c 
> b/drivers/gpu/drm/i915/i915_perf.c
> index 3beb24bc9277..9de935501aad 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -2747,7 +2747,8 @@ static int read_properties_unlocked(struct 
> drm_i915_private *dev_priv,
> props->ctx_handle = value;
> break;
> case DRM_I915_PERF_PROP_SAMPLE_OA:
> -   props->sample_flags |= SAMPLE_OA_REPORT;
> +   if (value)
> +   props->sample_flags |= SAMPLE_OA_REPORT;

Oops.
Reviewed-by: Matthew Auld 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 02/11] drm/i915/perf: check the value of PROP_SAMPLE_OA uapi parameter

2018-03-26 Thread Lionel Landwerlin
We've been a bit loose about this opening parameter. We should only
add the flag for writing OA reports when the value of this parameter
is != 0.

Signed-off-by: Lionel Landwerlin 
---
 drivers/gpu/drm/i915/i915_perf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 3beb24bc9277..9de935501aad 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -2747,7 +2747,8 @@ static int read_properties_unlocked(struct 
drm_i915_private *dev_priv,
props->ctx_handle = value;
break;
case DRM_I915_PERF_PROP_SAMPLE_OA:
-   props->sample_flags |= SAMPLE_OA_REPORT;
+   if (value)
+   props->sample_flags |= SAMPLE_OA_REPORT;
break;
case DRM_I915_PERF_PROP_OA_METRICS_SET:
if (value == 0) {
-- 
2.16.3

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx