drm/i915/gvt: cancel virtual vblank timer when no vGPU exists
authorZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 15 Jan 2018 08:36:11 +0000 (16:36 +0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 1 Feb 2018 15:32:08 +0000 (07:32 -0800)
Stop irq timer for virtual vblank timer emulation if no vGPU exists,
otherwise it will keep gvt service thread busy to handle virtual vblank
but no use.

Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/gvt/vgpu.c

index 4688619f6a1cabd86b6e72e2d85960b6e5f8aa35..a8784fa91289c82d442f6b90cb13fb4f837fe7b3 100644 (file)
@@ -258,6 +258,8 @@ void intel_gvt_destroy_vgpu(struct intel_vgpu *vgpu)
 
        intel_gvt_debugfs_remove_vgpu(vgpu);
        idr_remove(&gvt->vgpu_idr, vgpu->id);
+       if (idr_is_empty(&gvt->vgpu_idr))
+               intel_gvt_clean_irq(gvt);
        intel_vgpu_clean_sched_policy(vgpu);
        intel_vgpu_clean_submission(vgpu);
        intel_vgpu_clean_display(vgpu);