drm/i915: Add the display switch logic for vGPU in i915 driver
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / i915 / i915_dma.c
index 1a46787129e7a2c5022a0ecf7ced69418afa8320..5804aa5f9df074c007782fa89963dba47b3f5cc4 100644 (file)
@@ -36,6 +36,7 @@
 #include "intel_drv.h"
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
+#include "i915_vgpu.h"
 #include "i915_trace.h"
 #include <linux/pci.h>
 #include <linux/console.h>
@@ -842,6 +843,13 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
                }
        }
 
+       /*
+        * Notify a valid surface after modesetting,
+        * when running inside a VM.
+        */
+       if (intel_vgpu_active(dev))
+               I915_WRITE(vgtif_reg(display_ready), VGT_DRV_DISPLAY_READY);
+
        i915_setup_sysfs(dev);
 
        if (INTEL_INFO(dev)->num_pipes) {