drm/i915/gvt: Handle values of EDP_PSR_IMR and EDP_PSR_IIR

Submitted by Longhe Zheng on Oct. 30, 2018, 8:12 a.m.

Details

Message ID 20181030081210.3927-1-longhe.zheng@intel.com
State New
Series "drm/i915/gvt: Handle values of EDP_PSR_IMR and EDP_PSR_IIR"
Headers show

Commit Message

Longhe Zheng Oct. 30, 2018, 8:12 a.m.
GVT-g only simulates DP port for guest and leaves EDP_PSR_IMR
and EDP_PSR_IIR registers as default MMIO read/write.
So guest won't get expected initial values of these registers when
initializing the gpu driver, which results in following warning and logs.

--------
Interrupt register 0x64838 is not zero: 0xffffffff
WARNING: CPU: 1 PID: 157 at drivers/gpu/drm/i915/i915_irq.c:177
gen3_assert_iir_is_zero+0x38/0xa0

Call Trace:
gen8_de_irq_postinstall+0xa7/0x400
gen8_irq_postinstall+0x27/0x80
drm_irq_install+0xbc/0x140
i915_driver_load+0xa9d/0xd50
--------
Because GVT-g does not handle EDP(embedded DP) simulation for guests,
always set EDP_PSR_IMR and EDP_PSR_IIR to value 0.

Signed-off-by: Longhe Zheng <longhe.zheng@intel.com>
---
 drivers/gpu/drm/i915/gvt/handlers.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
index 9692d2a0c678..b5475c91e2ef 100644
--- a/drivers/gpu/drm/i915/gvt/handlers.c
+++ b/drivers/gpu/drm/i915/gvt/handlers.c
@@ -1610,7 +1610,7 @@  static int bxt_gt_disp_pwron_write(struct intel_vgpu *vgpu,
 	return 0;
 }
 
-static int bxt_edp_psr_imr_iir_write(struct intel_vgpu *vgpu,
+static int edp_psr_imr_iir_write(struct intel_vgpu *vgpu,
 		unsigned int offset, void *p_data, unsigned int bytes)
 {
 	vgpu_vreg(vgpu, offset) = 0;
@@ -2608,6 +2608,9 @@  static int init_generic_mmio_info(struct intel_gvt *gvt)
 	MMIO_DFH(_MMIO(0x1a178), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
 	MMIO_DFH(_MMIO(0x1a17c), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
 	MMIO_DFH(_MMIO(0x2217c), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
+
+	MMIO_DH(EDP_PSR_IMR, D_BDW_PLUS, NULL, edp_psr_imr_iir_write);
+	MMIO_DH(EDP_PSR_IIR, D_BDW_PLUS, NULL, edp_psr_imr_iir_write);
 	return 0;
 }
 
@@ -3206,9 +3209,6 @@  static int init_bxt_mmio_info(struct intel_gvt *gvt)
 	MMIO_D(HSW_TVIDEO_DIP_GCP(TRANSCODER_B), D_BXT);
 	MMIO_D(HSW_TVIDEO_DIP_GCP(TRANSCODER_C), D_BXT);
 
-	MMIO_DH(EDP_PSR_IMR, D_BXT, NULL, bxt_edp_psr_imr_iir_write);
-	MMIO_DH(EDP_PSR_IIR, D_BXT, NULL, bxt_edp_psr_imr_iir_write);
-
 	MMIO_D(RC6_CTX_BASE, D_BXT);
 
 	MMIO_D(GEN8_PUSHBUS_CONTROL, D_BXT);

Comments

gvt@intel.com Oct. 30, 2018, 10:57 a.m.

Zhenyu Wang Oct. 31, 2018, 9:27 a.m.
On 2018.10.30 16:12:10 +0800, Longhe Zheng wrote:
> GVT-g only simulates DP port for guest and leaves EDP_PSR_IMR
> and EDP_PSR_IIR registers as default MMIO read/write.
> So guest won't get expected initial values of these registers when
> initializing the gpu driver, which results in following warning and logs.
> 
> --------
> Interrupt register 0x64838 is not zero: 0xffffffff
> WARNING: CPU: 1 PID: 157 at drivers/gpu/drm/i915/i915_irq.c:177
> gen3_assert_iir_is_zero+0x38/0xa0
> 
> Call Trace:
> gen8_de_irq_postinstall+0xa7/0x400
> gen8_irq_postinstall+0x27/0x80
> drm_irq_install+0xbc/0x140
> i915_driver_load+0xa9d/0xd50
> --------
> Because GVT-g does not handle EDP(embedded DP) simulation for guests,
> always set EDP_PSR_IMR and EDP_PSR_IIR to value 0.
> 
> Signed-off-by: Longhe Zheng <longhe.zheng@intel.com>
> ---

Applied, thanks!