[PATCH] drm/i915/gvt: Fix DPLL warning in booting guest VM

Zhao Xinda xinda.zhao at intel.com
Tue Nov 7 08:47:40 UTC 2017


From: "Zhao, Xinda" <xinda.zhao at intel.com>

The warning is occurred in guest VM when trying to get clock in encoder
initialization.

intel_modeset_init()
  ->intel_modeset_setup_hw_state()
    ->intel_ddi_get_config()
      ->intel_ddi_clock_get()
        ->skl_ddi_clock_get()
          ->intel_get_shared_dpll_id()
            ->WARN_ON(pll < dev_priv->shared_dplls||
                pll > &dev_priv->shared_dplls[dev_priv->num_shared_dpll])

In encoder initialization, shared DPLL is used for calculating clock for
DDI ports, but it is not set when crtc is not active.

When the host is booted without display device connected, the crtc status
in host is inactive. In GVT-g, the encoder status is emulated, but crtc
status is not. In this situation, encoder is active, but crtc is inactive,
thus warning occurred in guest VM. Emulate crtc status can fix the issue.

Signed-off-by: Zhao, Xinda <xinda.zhao at intel.com>
---
 drivers/gpu/drm/i915/gvt/display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/display.c
index 3c31843..5b14ba6 100644
--- a/drivers/gpu/drm/i915/gvt/display.c
+++ b/drivers/gpu/drm/i915/gvt/display.c
@@ -263,6 +263,9 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu)
 		vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_A)) |= DDI_INIT_DISPLAY_DETECTED;
 	}
 
+	/* Enable PIPE_A as default*/
+	vgpu_vreg(vgpu, PIPECONF(PIPE_A)) |= PIPECONF_ENABLE;
+
 	/* Clear host CRT status, so guest couldn't detect this host CRT. */
 	if (IS_BROADWELL(dev_priv))
 		vgpu_vreg(vgpu, PCH_ADPA) &= ~ADPA_CRT_HOTPLUG_MONITOR_MASK;
-- 
2.7.4



More information about the intel-gvt-dev mailing list