diff options
author | Ping Gao <ping.a.gao@intel.com> | 2017-05-24 14:30:17 +0200 |
---|---|---|
committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2017-06-08 07:59:16 +0200 |
commit | c713cb2f9b7e1e9ffa8a379cecb13bc6eacd49b6 (patch) | |
tree | f32339ea16083a9c68508e535451e1d84896459a /drivers/gpu/drm/i915/gvt/sched_policy.c | |
parent | drm/i915/gvt: Delete gvt_dbg_cmd() in cmd_parser_exec() (diff) | |
download | linux-c713cb2f9b7e1e9ffa8a379cecb13bc6eacd49b6.tar.xz linux-c713cb2f9b7e1e9ffa8a379cecb13bc6eacd49b6.zip |
drm/i915/gvt: Support event based scheduling
This patch decouple the time slice calculation and scheduler, let
other event be able to trigger scheduling without impact the
calculation for QoS.
v2: add only one new enum definition.
v3: fix typo.
Signed-off-by: Ping Gao <ping.a.gao@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/sched_policy.c')
-rw-r--r-- | drivers/gpu/drm/i915/gvt/sched_policy.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c index f642a3f0cfa0..6f2073d74de2 100644 --- a/drivers/gpu/drm/i915/gvt/sched_policy.c +++ b/drivers/gpu/drm/i915/gvt/sched_policy.c @@ -198,11 +198,6 @@ static void tbs_sched_func(struct gvt_sched_data *sched_data) struct intel_gvt_workload_scheduler *scheduler = &gvt->scheduler; struct vgpu_sched_data *vgpu_data; struct intel_vgpu *vgpu = NULL; - static uint64_t timer_check; - - if (!(timer_check++ % GVT_TS_BALANCE_PERIOD_MS)) - gvt_balance_timeslice(sched_data); - /* no active vgpu or has already had a target */ if (list_empty(&sched_data->lru_runq_head) || scheduler->next_vgpu) goto out; @@ -227,9 +222,19 @@ out: void intel_gvt_schedule(struct intel_gvt *gvt) { struct gvt_sched_data *sched_data = gvt->scheduler.sched_data; + static uint64_t timer_check; mutex_lock(&gvt->lock); + + if (test_and_clear_bit(INTEL_GVT_REQUEST_SCHED, + (void *)&gvt->service_request)) { + if (!(timer_check++ % GVT_TS_BALANCE_PERIOD_MS)) + gvt_balance_timeslice(sched_data); + } + clear_bit(INTEL_GVT_REQUEST_EVENT_SCHED, (void *)&gvt->service_request); + tbs_sched_func(sched_data); + mutex_unlock(&gvt->lock); } |