* [PATCH] drm/i915/perf: remove user triggerable warn
@ 2017-03-27 20:32 Matthew Auld
2017-03-27 21:42 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-28 11:20 ` [PATCH] " Robert Bragg
0 siblings, 2 replies; 4+ messages in thread
From: Matthew Auld @ 2017-03-27 20:32 UTC (permalink / raw)
To: intel-gfx
Don't throw a warning if we are given an invalid property id. While
here let's also bring back Robert' original idea of catching unhandled
enumeration values at compile time.
Fixes: eec688e1420d ("drm/i915: Add i915 perf infrastructure")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Robert Bragg <robert@sixbynine.org>
---
drivers/gpu/drm/i915/i915_perf.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 8c121187ff39..e52bc6a581e6 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1793,6 +1793,11 @@ static int read_properties_unlocked(struct drm_i915_private *dev_priv,
if (ret)
return ret;
+ if (id == 0 || id >= DRM_I915_PERF_PROP_MAX) {
+ DRM_DEBUG("Unknown i915 perf property ID\n");
+ return -EINVAL;
+ }
+
switch ((enum drm_i915_perf_property_id)id) {
case DRM_I915_PERF_PROP_CTX_HANDLE:
props->single_context = 1;
@@ -1862,9 +1867,8 @@ static int read_properties_unlocked(struct drm_i915_private *dev_priv,
props->oa_periodic = true;
props->oa_period_exponent = value;
break;
- default:
+ case DRM_I915_PERF_PROP_MAX:
MISSING_CASE(id);
- DRM_DEBUG("Unknown i915 perf property ID\n");
return -EINVAL;
}
--
2.9.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915/perf: remove user triggerable warn
2017-03-27 20:32 [PATCH] drm/i915/perf: remove user triggerable warn Matthew Auld
@ 2017-03-27 21:42 ` Patchwork
2017-03-28 11:20 ` [PATCH] " Robert Bragg
1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-03-27 21:42 UTC (permalink / raw)
To: Matthew Auld; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/perf: remove user triggerable warn
URL : https://patchwork.freedesktop.org/series/21953/
State : success
== Summary ==
Series 21953v1 drm/i915/perf: remove user triggerable warn
https://patchwork.freedesktop.org/api/1.0/series/21953/revisions/1/mbox/
fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time: 461s
fi-bdw-gvtdvm total:278 pass:256 dwarn:8 dfail:0 fail:0 skip:14 time: 456s
fi-bsw-n3050 total:278 pass:239 dwarn:0 dfail:0 fail:0 skip:39 time: 594s
fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time: 541s
fi-bxt-t5700 total:278 pass:258 dwarn:0 dfail:0 fail:0 skip:20 time: 569s
fi-byt-j1900 total:278 pass:251 dwarn:0 dfail:0 fail:0 skip:27 time: 509s
fi-byt-n2820 total:278 pass:247 dwarn:0 dfail:0 fail:0 skip:31 time: 509s
fi-hsw-4770 total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 441s
fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 427s
fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time: 433s
fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 521s
fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 495s
fi-kbl-7500u total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 489s
fi-kbl-7560u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 594s
fi-skl-6260u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 491s
fi-skl-6700hq total:278 pass:261 dwarn:0 dfail:0 fail:0 skip:17 time: 608s
fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time: 484s
fi-skl-6770hq total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 514s
fi-skl-gvtdvm total:278 pass:265 dwarn:0 dfail:0 fail:0 skip:13 time: 464s
fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time: 550s
fi-snb-2600 total:278 pass:249 dwarn:0 dfail:0 fail:0 skip:29 time: 427s
c3ca5620be419c7e20c39d07f6cf7d1cb7c3bfc8 drm-tip: 2017y-03m-27d-20h-31m-03s UTC integration manifest
16ed65e drm/i915/perf: remove user triggerable warn
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4317/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915/perf: remove user triggerable warn
2017-03-27 20:32 [PATCH] drm/i915/perf: remove user triggerable warn Matthew Auld
2017-03-27 21:42 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-03-28 11:20 ` Robert Bragg
2017-03-28 11:57 ` Mika Kuoppala
1 sibling, 1 reply; 4+ messages in thread
From: Robert Bragg @ 2017-03-28 11:20 UTC (permalink / raw)
To: Matthew Auld; +Cc: Intel Graphics Development
[-- Attachment #1.1: Type: text/plain, Size: 1872 bytes --]
On Mon, Mar 27, 2017 at 9:32 PM, Matthew Auld <matthew.auld@intel.com>
wrote:
> Don't throw a warning if we are given an invalid property id. While
> here let's also bring back Robert' original idea of catching unhandled
> enumeration values at compile time.
>
> Fixes: eec688e1420d ("drm/i915: Add i915 perf infrastructure")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Robert Bragg <robert@sixbynine.org>
> ---
> drivers/gpu/drm/i915/i915_perf.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_
> perf.c
> index 8c121187ff39..e52bc6a581e6 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -1793,6 +1793,11 @@ static int read_properties_unlocked(struct
> drm_i915_private *dev_priv,
> if (ret)
> return ret;
>
> + if (id == 0 || id >= DRM_I915_PERF_PROP_MAX) {
> + DRM_DEBUG("Unknown i915 perf property ID\n");
> + return -EINVAL;
> + }
> +
> switch ((enum drm_i915_perf_property_id)id) {
> case DRM_I915_PERF_PROP_CTX_HANDLE:
> props->single_context = 1;
> @@ -1862,9 +1867,8 @@ static int read_properties_unlocked(struct
> drm_i915_private *dev_priv,
> props->oa_periodic = true;
> props->oa_period_exponent = value;
> break;
> - default:
> + case DRM_I915_PERF_PROP_MAX:
> MISSING_CASE(id);
> - DRM_DEBUG("Unknown i915 perf property ID\n");
> return -EINVAL;
> }
>
> --
> 2.9.3
>
>
Looks good to me, thanks.
Reviewed-by: Robert Bragg <robert@sixbynine.org>
[-- Attachment #1.2: Type: text/html, Size: 2817 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915/perf: remove user triggerable warn
2017-03-28 11:20 ` [PATCH] " Robert Bragg
@ 2017-03-28 11:57 ` Mika Kuoppala
0 siblings, 0 replies; 4+ messages in thread
From: Mika Kuoppala @ 2017-03-28 11:57 UTC (permalink / raw)
To: Robert Bragg, Matthew Auld; +Cc: Intel Graphics Development
Robert Bragg <robert@sixbynine.org> writes:
> On Mon, Mar 27, 2017 at 9:32 PM, Matthew Auld <matthew.auld@intel.com>
> wrote:
>
>> Don't throw a warning if we are given an invalid property id. While
>> here let's also bring back Robert' original idea of catching unhandled
>> enumeration values at compile time.
>>
>> Fixes: eec688e1420d ("drm/i915: Add i915 perf infrastructure")
>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>> Cc: Robert Bragg <robert@sixbynine.org>
>> ---
>> drivers/gpu/drm/i915/i915_perf.c | 8 ++++++--
>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_
>> perf.c
>> index 8c121187ff39..e52bc6a581e6 100644
>> --- a/drivers/gpu/drm/i915/i915_perf.c
>> +++ b/drivers/gpu/drm/i915/i915_perf.c
>> @@ -1793,6 +1793,11 @@ static int read_properties_unlocked(struct
>> drm_i915_private *dev_priv,
>> if (ret)
>> return ret;
>>
>> + if (id == 0 || id >= DRM_I915_PERF_PROP_MAX) {
>> + DRM_DEBUG("Unknown i915 perf property ID\n");
>> + return -EINVAL;
>> + }
>> +
>> switch ((enum drm_i915_perf_property_id)id) {
>> case DRM_I915_PERF_PROP_CTX_HANDLE:
>> props->single_context = 1;
>> @@ -1862,9 +1867,8 @@ static int read_properties_unlocked(struct
>> drm_i915_private *dev_priv,
>> props->oa_periodic = true;
>> props->oa_period_exponent = value;
>> break;
>> - default:
>> + case DRM_I915_PERF_PROP_MAX:
>> MISSING_CASE(id);
>> - DRM_DEBUG("Unknown i915 perf property ID\n");
>> return -EINVAL;
>> }
>>
>> --
>> 2.9.3
>>
>>
> Looks good to me, thanks.
>
> Reviewed-by: Robert Bragg <robert@sixbynine.org>
Pushed. Thanks for patch and review.
-Mika
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-28 11:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-27 20:32 [PATCH] drm/i915/perf: remove user triggerable warn Matthew Auld
2017-03-27 21:42 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-28 11:20 ` [PATCH] " Robert Bragg
2017-03-28 11:57 ` Mika Kuoppala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox