Skip to content

Commit b42606b

Browse files
committed
Merge tag 'gvt-fixes-2019-01-24' of https://github.com/intel/gvt-linux into drm-intel-fixes
gvt-fixes-2019-01-24 - Fix destroy of shadow batch and indirect ctx (Weinan) Signed-off-by: Jani Nikula <jani.nikula@intel.com> From: Zhenyu Wang <zhenyuw@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190124054801.GP7203@zhen-hp.sh.intel.com
2 parents 2b24408 + 0f75551 commit b42606b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/gpu/drm/i915/gvt/scheduler.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ static void release_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
332332

333333
i915_gem_object_unpin_map(wa_ctx->indirect_ctx.obj);
334334
i915_gem_object_put(wa_ctx->indirect_ctx.obj);
335+
336+
wa_ctx->indirect_ctx.obj = NULL;
337+
wa_ctx->indirect_ctx.shadow_va = NULL;
335338
}
336339

337340
static int set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload,
@@ -911,11 +914,6 @@ static void complete_current_workload(struct intel_gvt *gvt, int ring_id)
911914

912915
list_del_init(&workload->list);
913916

914-
if (!workload->status) {
915-
release_shadow_batch_buffer(workload);
916-
release_shadow_wa_ctx(&workload->wa_ctx);
917-
}
918-
919917
if (workload->status || (vgpu->resetting_eng & ENGINE_MASK(ring_id))) {
920918
/* if workload->status is not successful means HW GPU
921919
* has occurred GPU hang or something wrong with i915/GVT,
@@ -1283,6 +1281,9 @@ void intel_vgpu_destroy_workload(struct intel_vgpu_workload *workload)
12831281
{
12841282
struct intel_vgpu_submission *s = &workload->vgpu->submission;
12851283

1284+
release_shadow_batch_buffer(workload);
1285+
release_shadow_wa_ctx(&workload->wa_ctx);
1286+
12861287
if (workload->shadow_mm)
12871288
intel_vgpu_mm_put(workload->shadow_mm);
12881289

0 commit comments

Comments
 (0)