drm/i915/gvt: To check whether workload scan and shadow has mutex hold

The function workload scan and shadow have to hold the drm.struct_mutex
before called. To avoid misusing of this function, add a lockdep assert
in it.

Signed-off-by: Ping Gao <ping.a.gao@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
This commit is contained in:
Ping Gao 2017-07-04 14:53:03 +08:00 committed by Zhenyu Wang
parent d0302e7400
commit 87e919d741
1 changed files with 2 additions and 0 deletions

View File

@ -201,6 +201,8 @@ int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload)
struct intel_vgpu *vgpu = workload->vgpu;
int ret;
lockdep_assert_held(&dev_priv->drm.struct_mutex);
if (workload->shadowed)
return 0;