diff options
author | Matthew Auld <matthew.auld@intel.com> | 2017-03-27 16:32:36 -0400 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2017-03-29 06:52:25 -0400 |
commit | aa62acfd63e7367872291c15290cb9c29d140926 (patch) | |
tree | 7707e63d9473bf730c17366f8251bab877f2806d | |
parent | 4e5f713ffc202c49a4374897cb0d2b218b391ff7 (diff) |
drm/i915/perf: remove user triggerable warn
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>
Reviewed-by: Robert Bragg <robert@sixbynine.org>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170327203236.18276-1-matthew.auld@intel.com
(cherry picked from commit 0a309f9e3dfaa4f5db0bf1b0cab54571744b491a)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/i915_perf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index f8fcb317042e..70964ca9251e 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c | |||
@@ -1794,6 +1794,11 @@ static int read_properties_unlocked(struct drm_i915_private *dev_priv, | |||
1794 | if (ret) | 1794 | if (ret) |
1795 | return ret; | 1795 | return ret; |
1796 | 1796 | ||
1797 | if (id == 0 || id >= DRM_I915_PERF_PROP_MAX) { | ||
1798 | DRM_DEBUG("Unknown i915 perf property ID\n"); | ||
1799 | return -EINVAL; | ||
1800 | } | ||
1801 | |||
1797 | switch ((enum drm_i915_perf_property_id)id) { | 1802 | switch ((enum drm_i915_perf_property_id)id) { |
1798 | case DRM_I915_PERF_PROP_CTX_HANDLE: | 1803 | case DRM_I915_PERF_PROP_CTX_HANDLE: |
1799 | props->single_context = 1; | 1804 | props->single_context = 1; |
@@ -1863,9 +1868,8 @@ static int read_properties_unlocked(struct drm_i915_private *dev_priv, | |||
1863 | props->oa_periodic = true; | 1868 | props->oa_periodic = true; |
1864 | props->oa_period_exponent = value; | 1869 | props->oa_period_exponent = value; |
1865 | break; | 1870 | break; |
1866 | default: | 1871 | case DRM_I915_PERF_PROP_MAX: |
1867 | MISSING_CASE(id); | 1872 | MISSING_CASE(id); |
1868 | DRM_DEBUG("Unknown i915 perf property ID\n"); | ||
1869 | return -EINVAL; | 1873 | return -EINVAL; |
1870 | } | 1874 | } |
1871 | 1875 | ||