Commit 1579ab2d authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Use common mock_engine::advance

Replace the open-coding of advance with a call instead.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190121222117.23305-19-chris@chris-wilson.co.uk
parent e4a8c813
...@@ -67,11 +67,10 @@ static struct mock_request *first_request(struct mock_engine *engine) ...@@ -67,11 +67,10 @@ static struct mock_request *first_request(struct mock_engine *engine)
link); link);
} }
static void advance(struct mock_engine *engine, static void advance(struct mock_request *request)
struct mock_request *request)
{ {
list_del_init(&request->link); list_del_init(&request->link);
mock_seqno_advance(&engine->base, request->base.global_seqno); mock_seqno_advance(request->base.engine, request->base.global_seqno);
} }
static void hw_delay_complete(struct timer_list *t) static void hw_delay_complete(struct timer_list *t)
...@@ -84,7 +83,7 @@ static void hw_delay_complete(struct timer_list *t) ...@@ -84,7 +83,7 @@ static void hw_delay_complete(struct timer_list *t)
/* Timer fired, first request is complete */ /* Timer fired, first request is complete */
request = first_request(engine); request = first_request(engine);
if (request) if (request)
advance(engine, request); advance(request);
/* /*
* Also immediately signal any subsequent 0-delay requests, but * Also immediately signal any subsequent 0-delay requests, but
...@@ -96,7 +95,7 @@ static void hw_delay_complete(struct timer_list *t) ...@@ -96,7 +95,7 @@ static void hw_delay_complete(struct timer_list *t)
break; break;
} }
advance(engine, request); advance(request);
} }
spin_unlock(&engine->hw_lock); spin_unlock(&engine->hw_lock);
...@@ -180,7 +179,7 @@ static void mock_submit_request(struct i915_request *request) ...@@ -180,7 +179,7 @@ static void mock_submit_request(struct i915_request *request)
if (mock->delay) if (mock->delay)
mod_timer(&engine->hw_delay, jiffies + mock->delay); mod_timer(&engine->hw_delay, jiffies + mock->delay);
else else
advance(engine, mock); advance(mock);
} }
spin_unlock_irq(&engine->hw_lock); spin_unlock_irq(&engine->hw_lock);
} }
...@@ -240,10 +239,8 @@ void mock_engine_flush(struct intel_engine_cs *engine) ...@@ -240,10 +239,8 @@ void mock_engine_flush(struct intel_engine_cs *engine)
del_timer_sync(&mock->hw_delay); del_timer_sync(&mock->hw_delay);
spin_lock_irq(&mock->hw_lock); spin_lock_irq(&mock->hw_lock);
list_for_each_entry_safe(request, rn, &mock->hw_queue, link) { list_for_each_entry_safe(request, rn, &mock->hw_queue, link)
list_del_init(&request->link); advance(request);
mock_seqno_advance(&mock->base, request->base.global_seqno);
}
spin_unlock_irq(&mock->hw_lock); spin_unlock_irq(&mock->hw_lock);
} }
......
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