drm/i915/gvt: dec vgpu->running_workload_num after the workload is really done
authorChangbin Du <changbin.du@intel.com>
Thu, 5 Jan 2017 08:49:03 +0000 (16:49 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 9 Jan 2017 03:10:43 +0000 (11:10 +0800)
commit440a9b9fae37dfd7e4c7d76db34fada57f9afd92
tree7679b1dd789545fe8ab5c33e68bc0014bc43c3fc
parent2e51ef32b0d66fcd5fe45c437cf7c6aef8350746
drm/i915/gvt: dec vgpu->running_workload_num after the workload is really done

The vgpu->running_workload_num is used to determine whether a vgpu has
any workload running or not. So we should make sure the workload is
really done before we dec running_workload_num. Function
complete_current_workload is not the right place to do it, since this
function is still processing the workload. This patch move the dec op
afterward.

v2: move dec op before wake_up(&scheduler->workload_complete_wq) (Min He)

Signed-off-by: Changbin Du <changbin.du@intel.com>
Reviewed-by: Min He <min.he@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/scheduler.c