summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_perf.c
diff options
context:
space:
mode:
authorDeepak R Varma <mh12gx2825@gmail.com>2020-11-04 18:03:39 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2020-11-29 01:43:10 +0300
commit8d989f4448947c866b47cb6789b88b31d5f79fe3 (patch)
tree40dcc413743bb038f58780b05fb5b335948ff1aa /drivers/gpu/drm/i915/i915_perf.c
parenta9d71f76ccfd309f3bd5f7c9b60e91a4decae792 (diff)
downloadlinux-8d989f4448947c866b47cb6789b88b31d5f79fe3.tar.xz
drm/i915/perf: replace idr_init() by idr_init_base()
idr_init() uses base 0 which is an invalid identifier. The new function idr_init_base allows IDR to set the ID lookup from base 1. This avoids all lookups that otherwise starts from 0 since 0 is always unused. References: commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient") Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20201104150339.GA68663@localhost
Diffstat (limited to 'drivers/gpu/drm/i915/i915_perf.c')
-rw-r--r--drivers/gpu/drm/i915/i915_perf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index e94976976571..2d033255b7cf 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -4367,7 +4367,7 @@ void i915_perf_init(struct drm_i915_private *i915)
RUNTIME_INFO(i915)->cs_timestamp_frequency_hz / 2;
mutex_init(&perf->metrics_lock);
- idr_init(&perf->metrics_idr);
+ idr_init_base(&perf->metrics_idr, 1);
/* We set up some ratelimit state to potentially throttle any
* _NOTES about spurious, invalid OA reports which we don't