Commit 5a15550e authored by Chris Wilson's avatar Chris Wilson

drm/i915/gt: Initialise rps timestamp

Smatch warns that we may iterate over an empty array of gt->engines[].
One hopes that this is impossible, but nevertheless we can simply
appease smatch by initialising the timestamp to zero before we starting
probing the busy-time from the engines.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200619151938.21740-1-chris@chris-wilson.co.uk
parent bf3c5083
...@@ -51,10 +51,11 @@ static void rps_timer(struct timer_list *t) ...@@ -51,10 +51,11 @@ static void rps_timer(struct timer_list *t)
{ {
struct intel_rps *rps = from_timer(rps, t, timer); struct intel_rps *rps = from_timer(rps, t, timer);
struct intel_engine_cs *engine; struct intel_engine_cs *engine;
ktime_t dt, last, timestamp;
enum intel_engine_id id; enum intel_engine_id id;
s64 max_busy[3] = {}; s64 max_busy[3] = {};
ktime_t dt, timestamp, last;
timestamp = 0;
for_each_engine(engine, rps_to_gt(rps), id) { for_each_engine(engine, rps_to_gt(rps), id) {
s64 busy; s64 busy;
int i; int i;
...@@ -69,7 +70,6 @@ static void rps_timer(struct timer_list *t) ...@@ -69,7 +70,6 @@ static void rps_timer(struct timer_list *t)
swap(busy, max_busy[i]); swap(busy, max_busy[i]);
} }
} }
last = rps->pm_timestamp; last = rps->pm_timestamp;
rps->pm_timestamp = timestamp; rps->pm_timestamp = timestamp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment