Browse Source

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>
Ping Gao 8 years ago
parent
commit
87e919d741
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/gpu/drm/i915/gvt/scheduler.c

+ 2 - 0
drivers/gpu/drm/i915/gvt/scheduler.c

@@ -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;