diff options
author | Xiong Zhang <xiong.y.zhang@intel.com> | 2017-06-19 23:37:22 -0400 |
---|---|---|
committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2017-06-27 05:29:19 -0400 |
commit | 295a0d0b55269fce2290a7aebfcc8c2525866c33 (patch) | |
tree | 47229eb339a023c45a78cb4bf2ac8ded50337c3f | |
parent | f16bd3dda2c8bf6699e808cd9cc540cfab10e60e (diff) |
drm/i915/gvt: Set initial PORT_CLK_SEL vreg for BDW
On BDW, when host physical screen and guest virtual screen aren't on
the same DDI port, guest i915 driver prints the following error and
stop running.
[ 6.775873] BUG: unable to handle kernel NULL pointer dereference
at 0000000000000068
[ 6.775928] IP: intel_ddi_clock_get+0x81/0x430 [i915]
[ 6.776206] Call Trace:
[ 6.776233] ? vgpu_read32+0x4f/0x100 [i915]
[ 6.776264] intel_ddi_get_config+0x11c/0x230 [i915]
[ 6.776298] intel_modeset_setup_hw_state+0x313/0xd40 [i915]
[ 6.776334] intel_modeset_init+0xe49/0x18d0 [i915]
[ 6.776368] ? vgpu_write32+0x53/0x100 [i915]
[ 6.776731] ? intel_i2c_reset+0x42/0x50 [i915]
[ 6.777085] ? intel_setup_gmbus+0x32a/0x350 [i915]
[ 6.777427] i915_driver_load+0xabc/0x14d0 [i915]
[ 6.777768] i915_pci_probe+0x4f/0x70 [i915]
The null pointer is guest intel_crtc_state->shared_dpll which is
setted in haswell_get_ddi_pll(). When guest and host screen are
on different DDI port, host driver won't set PORT_CLK_SET(guest_port),
so haswell_get_ddi_pll() will return null and don't set
pipe_config->shared_dpll, once the following program refernce this
structure, it will print the above error.
This patch set the initial val of guest PORT_CLK_SEL(guest_port) to
LCPLL_810. And guest i915 driver will reset this value according to
guest screen mode.
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/gvt/display.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/display.c index e0261fcc5b50..818e94907c3b 100644 --- a/drivers/gpu/drm/i915/gvt/display.c +++ b/drivers/gpu/drm/i915/gvt/display.c | |||
@@ -197,6 +197,12 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) | |||
197 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | | 197 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | |
198 | (PORT_B << TRANS_DDI_PORT_SHIFT) | | 198 | (PORT_B << TRANS_DDI_PORT_SHIFT) | |
199 | TRANS_DDI_FUNC_ENABLE); | 199 | TRANS_DDI_FUNC_ENABLE); |
200 | if (IS_BROADWELL(dev_priv)) { | ||
201 | vgpu_vreg(vgpu, PORT_CLK_SEL(PORT_B)) &= | ||
202 | ~PORT_CLK_SEL_MASK; | ||
203 | vgpu_vreg(vgpu, PORT_CLK_SEL(PORT_B)) |= | ||
204 | PORT_CLK_SEL_LCPLL_810; | ||
205 | } | ||
200 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_B)) |= DDI_BUF_CTL_ENABLE; | 206 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_B)) |= DDI_BUF_CTL_ENABLE; |
201 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_B)) &= ~DDI_BUF_IS_IDLE; | 207 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_B)) &= ~DDI_BUF_IS_IDLE; |
202 | vgpu_vreg(vgpu, SDEISR) |= SDE_PORTB_HOTPLUG_CPT; | 208 | vgpu_vreg(vgpu, SDEISR) |= SDE_PORTB_HOTPLUG_CPT; |
@@ -211,6 +217,12 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) | |||
211 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | | 217 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | |
212 | (PORT_C << TRANS_DDI_PORT_SHIFT) | | 218 | (PORT_C << TRANS_DDI_PORT_SHIFT) | |
213 | TRANS_DDI_FUNC_ENABLE); | 219 | TRANS_DDI_FUNC_ENABLE); |
220 | if (IS_BROADWELL(dev_priv)) { | ||
221 | vgpu_vreg(vgpu, PORT_CLK_SEL(PORT_C)) &= | ||
222 | ~PORT_CLK_SEL_MASK; | ||
223 | vgpu_vreg(vgpu, PORT_CLK_SEL(PORT_C)) |= | ||
224 | PORT_CLK_SEL_LCPLL_810; | ||
225 | } | ||
214 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_C)) |= DDI_BUF_CTL_ENABLE; | 226 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_C)) |= DDI_BUF_CTL_ENABLE; |
215 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_C)) &= ~DDI_BUF_IS_IDLE; | 227 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_C)) &= ~DDI_BUF_IS_IDLE; |
216 | vgpu_vreg(vgpu, SFUSE_STRAP) |= SFUSE_STRAP_DDIC_DETECTED; | 228 | vgpu_vreg(vgpu, SFUSE_STRAP) |= SFUSE_STRAP_DDIC_DETECTED; |
@@ -225,6 +237,12 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) | |||
225 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | | 237 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | |
226 | (PORT_D << TRANS_DDI_PORT_SHIFT) | | 238 | (PORT_D << TRANS_DDI_PORT_SHIFT) | |
227 | TRANS_DDI_FUNC_ENABLE); | 239 | TRANS_DDI_FUNC_ENABLE); |
240 | if (IS_BROADWELL(dev_priv)) { | ||
241 | vgpu_vreg(vgpu, PORT_CLK_SEL(PORT_D)) &= | ||
242 | ~PORT_CLK_SEL_MASK; | ||
243 | vgpu_vreg(vgpu, PORT_CLK_SEL(PORT_D)) |= | ||
244 | PORT_CLK_SEL_LCPLL_810; | ||
245 | } | ||
228 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_D)) |= DDI_BUF_CTL_ENABLE; | 246 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_D)) |= DDI_BUF_CTL_ENABLE; |
229 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_D)) &= ~DDI_BUF_IS_IDLE; | 247 | vgpu_vreg(vgpu, DDI_BUF_CTL(PORT_D)) &= ~DDI_BUF_IS_IDLE; |
230 | vgpu_vreg(vgpu, SFUSE_STRAP) |= SFUSE_STRAP_DDID_DETECTED; | 248 | vgpu_vreg(vgpu, SFUSE_STRAP) |= SFUSE_STRAP_DDID_DETECTED; |