aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-12-27 23:05:35 -0500
committerDave Airlie <airlied@redhat.com>2018-12-27 23:05:46 -0500
commit4bcd2ffd214c1dad269c8ec40ac935770d208534 (patch)
treef34de59161f2dc10d3c8ed4233f2f9a9483eaf9a
parent221b35fedee1b38b9cee99320f0c60263d229e14 (diff)
parentcb6f4c2c3478b2ff68bd5d0b6020394120075e30 (diff)
Merge tag 'drm-intel-next-fixes-2018-12-27' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
GVT fixes for v4.21-rc1 Signed-off-by: Dave Airlie <airlied@redhat.com> From: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/87imzfwh73.fsf@intel.com
-rw-r--r--drivers/gpu/drm/i915/gvt/cmd_parser.c6
-rw-r--r--drivers/gpu/drm/i915/gvt/gvt.c2
-rw-r--r--drivers/gpu/drm/i915/gvt/gvt.h4
-rw-r--r--drivers/gpu/drm/i915/gvt/handlers.c1
-rw-r--r--drivers/gpu/drm/i915/gvt/interrupt.c2
-rw-r--r--drivers/gpu/drm/i915/gvt/scheduler.c33
6 files changed, 43 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index 77edbfcb0f75..77ae634eb11c 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -1900,11 +1900,11 @@ static struct cmd_info cmd_info[] = {
1900 1900
1901 {"MI_URB_CLEAR", OP_MI_URB_CLEAR, F_LEN_VAR, R_RCS, D_ALL, 0, 8, NULL}, 1901 {"MI_URB_CLEAR", OP_MI_URB_CLEAR, F_LEN_VAR, R_RCS, D_ALL, 0, 8, NULL},
1902 1902
1903 {"ME_SEMAPHORE_SIGNAL", OP_MI_SEMAPHORE_SIGNAL, F_LEN_VAR, R_ALL, 1903 {"MI_SEMAPHORE_SIGNAL", OP_MI_SEMAPHORE_SIGNAL, F_LEN_VAR, R_ALL,
1904 D_BDW_PLUS, 0, 8, NULL}, 1904 D_BDW_PLUS, 0, 8, NULL},
1905 1905
1906 {"ME_SEMAPHORE_WAIT", OP_MI_SEMAPHORE_WAIT, F_LEN_VAR, R_ALL, D_BDW_PLUS, 1906 {"MI_SEMAPHORE_WAIT", OP_MI_SEMAPHORE_WAIT, F_LEN_VAR, R_ALL,
1907 ADDR_FIX_1(2), 8, cmd_handler_mi_semaphore_wait}, 1907 D_BDW_PLUS, ADDR_FIX_1(2), 8, cmd_handler_mi_semaphore_wait},
1908 1908
1909 {"MI_STORE_DATA_IMM", OP_MI_STORE_DATA_IMM, F_LEN_VAR, R_ALL, D_BDW_PLUS, 1909 {"MI_STORE_DATA_IMM", OP_MI_STORE_DATA_IMM, F_LEN_VAR, R_ALL, D_BDW_PLUS,
1910 ADDR_FIX_1(1), 10, cmd_handler_mi_store_data_imm}, 1910 ADDR_FIX_1(1), 10, cmd_handler_mi_store_data_imm},
diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
index 6ef5a7fc70df..733a2a0d0c30 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.c
+++ b/drivers/gpu/drm/i915/gvt/gvt.c
@@ -437,7 +437,7 @@ int intel_gvt_init_device(struct drm_i915_private *dev_priv)
437 437
438 ret = intel_gvt_debugfs_init(gvt); 438 ret = intel_gvt_debugfs_init(gvt);
439 if (ret) 439 if (ret)
440 gvt_err("debugfs registeration failed, go on.\n"); 440 gvt_err("debugfs registration failed, go on.\n");
441 441
442 gvt_dbg_core("gvt device initialization is done\n"); 442 gvt_dbg_core("gvt device initialization is done\n");
443 dev_priv->gvt = gvt; 443 dev_priv->gvt = gvt;
diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index 31f6cdbe5c42..b4ab1dad0143 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -159,6 +159,10 @@ struct intel_vgpu_submission {
159 struct kmem_cache *workloads; 159 struct kmem_cache *workloads;
160 atomic_t running_workload_num; 160 atomic_t running_workload_num;
161 struct i915_gem_context *shadow_ctx; 161 struct i915_gem_context *shadow_ctx;
162 union {
163 u64 i915_context_pml4;
164 u64 i915_context_pdps[GEN8_3LVL_PDPES];
165 };
162 DECLARE_BITMAP(shadow_ctx_desc_updated, I915_NUM_ENGINES); 166 DECLARE_BITMAP(shadow_ctx_desc_updated, I915_NUM_ENGINES);
163 DECLARE_BITMAP(tlb_handle_pending, I915_NUM_ENGINES); 167 DECLARE_BITMAP(tlb_handle_pending, I915_NUM_ENGINES);
164 void *ring_scan_buffer[I915_NUM_ENGINES]; 168 void *ring_scan_buffer[I915_NUM_ENGINES];
diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
index aa280bb07125..b5475c91e2ef 100644
--- a/drivers/gpu/drm/i915/gvt/handlers.c
+++ b/drivers/gpu/drm/i915/gvt/handlers.c
@@ -475,6 +475,7 @@ static i915_reg_t force_nonpriv_white_list[] = {
475 _MMIO(0x7704), 475 _MMIO(0x7704),
476 _MMIO(0x7708), 476 _MMIO(0x7708),
477 _MMIO(0x770c), 477 _MMIO(0x770c),
478 _MMIO(0x83a8),
478 _MMIO(0xb110), 479 _MMIO(0xb110),
479 GEN8_L3SQCREG4,//_MMIO(0xb118) 480 GEN8_L3SQCREG4,//_MMIO(0xb118)
480 _MMIO(0xe100), 481 _MMIO(0xe100),
diff --git a/drivers/gpu/drm/i915/gvt/interrupt.c b/drivers/gpu/drm/i915/gvt/interrupt.c
index 5daa23ae566b..6b9d1354ff29 100644
--- a/drivers/gpu/drm/i915/gvt/interrupt.c
+++ b/drivers/gpu/drm/i915/gvt/interrupt.c
@@ -126,7 +126,7 @@ static const char * const irq_name[INTEL_GVT_EVENT_MAX] = {
126 [FDI_RX_INTERRUPTS_TRANSCODER_C] = "FDI RX Interrupts Combined C", 126 [FDI_RX_INTERRUPTS_TRANSCODER_C] = "FDI RX Interrupts Combined C",
127 [AUDIO_CP_CHANGE_TRANSCODER_C] = "Audio CP Change Transcoder C", 127 [AUDIO_CP_CHANGE_TRANSCODER_C] = "Audio CP Change Transcoder C",
128 [AUDIO_CP_REQUEST_TRANSCODER_C] = "Audio CP Request Transcoder C", 128 [AUDIO_CP_REQUEST_TRANSCODER_C] = "Audio CP Request Transcoder C",
129 [ERR_AND_DBG] = "South Error and Debug Interupts Combined", 129 [ERR_AND_DBG] = "South Error and Debug Interrupts Combined",
130 [GMBUS] = "Gmbus", 130 [GMBUS] = "Gmbus",
131 [SDVO_B_HOTPLUG] = "SDVO B hotplug", 131 [SDVO_B_HOTPLUG] = "SDVO B hotplug",
132 [CRT_HOTPLUG] = "CRT Hotplug", 132 [CRT_HOTPLUG] = "CRT Hotplug",
diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
index b8fbe3fabea3..1ad8c5e1455d 100644
--- a/drivers/gpu/drm/i915/gvt/scheduler.c
+++ b/drivers/gpu/drm/i915/gvt/scheduler.c
@@ -1079,6 +1079,21 @@ err:
1079 return ret; 1079 return ret;
1080} 1080}
1081 1081
1082static void
1083i915_context_ppgtt_root_restore(struct intel_vgpu_submission *s)
1084{
1085 struct i915_hw_ppgtt *i915_ppgtt = s->shadow_ctx->ppgtt;
1086 int i;
1087
1088 if (i915_vm_is_48bit(&i915_ppgtt->vm))
1089 px_dma(&i915_ppgtt->pml4) = s->i915_context_pml4;
1090 else {
1091 for (i = 0; i < GEN8_3LVL_PDPES; i++)
1092 px_dma(i915_ppgtt->pdp.page_directory[i]) =
1093 s->i915_context_pdps[i];
1094 }
1095}
1096
1082/** 1097/**
1083 * intel_vgpu_clean_submission - free submission-related resource for vGPU 1098 * intel_vgpu_clean_submission - free submission-related resource for vGPU
1084 * @vgpu: a vGPU 1099 * @vgpu: a vGPU
@@ -1091,6 +1106,7 @@ void intel_vgpu_clean_submission(struct intel_vgpu *vgpu)
1091 struct intel_vgpu_submission *s = &vgpu->submission; 1106 struct intel_vgpu_submission *s = &vgpu->submission;
1092 1107
1093 intel_vgpu_select_submission_ops(vgpu, ALL_ENGINES, 0); 1108 intel_vgpu_select_submission_ops(vgpu, ALL_ENGINES, 0);
1109 i915_context_ppgtt_root_restore(s);
1094 i915_gem_context_put(s->shadow_ctx); 1110 i915_gem_context_put(s->shadow_ctx);
1095 kmem_cache_destroy(s->workloads); 1111 kmem_cache_destroy(s->workloads);
1096} 1112}
@@ -1116,6 +1132,21 @@ void intel_vgpu_reset_submission(struct intel_vgpu *vgpu,
1116 s->ops->reset(vgpu, engine_mask); 1132 s->ops->reset(vgpu, engine_mask);
1117} 1133}
1118 1134
1135static void
1136i915_context_ppgtt_root_save(struct intel_vgpu_submission *s)
1137{
1138 struct i915_hw_ppgtt *i915_ppgtt = s->shadow_ctx->ppgtt;
1139 int i;
1140
1141 if (i915_vm_is_48bit(&i915_ppgtt->vm))
1142 s->i915_context_pml4 = px_dma(&i915_ppgtt->pml4);
1143 else {
1144 for (i = 0; i < GEN8_3LVL_PDPES; i++)
1145 s->i915_context_pdps[i] =
1146 px_dma(i915_ppgtt->pdp.page_directory[i]);
1147 }
1148}
1149
1119/** 1150/**
1120 * intel_vgpu_setup_submission - setup submission-related resource for vGPU 1151 * intel_vgpu_setup_submission - setup submission-related resource for vGPU
1121 * @vgpu: a vGPU 1152 * @vgpu: a vGPU
@@ -1138,6 +1169,8 @@ int intel_vgpu_setup_submission(struct intel_vgpu *vgpu)
1138 if (IS_ERR(s->shadow_ctx)) 1169 if (IS_ERR(s->shadow_ctx))
1139 return PTR_ERR(s->shadow_ctx); 1170 return PTR_ERR(s->shadow_ctx);
1140 1171
1172 i915_context_ppgtt_root_save(s);
1173
1141 bitmap_zero(s->shadow_ctx_desc_updated, I915_NUM_ENGINES); 1174 bitmap_zero(s->shadow_ctx_desc_updated, I915_NUM_ENGINES);
1142 1175
1143 s->workloads = kmem_cache_create_usercopy("gvt-g_vgpu_workload", 1176 s->workloads = kmem_cache_create_usercopy("gvt-g_vgpu_workload",