From a1d8bb11847cd163c5d8c7a8b186542d957967ee Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Tue, 25 Oct 2016 09:03:06 +0800 Subject: [PATCH] vdenc: force to use BSD0 ring This can avoid GPU hang in https://bugs.freedesktop.org/show_bug.cgi?id=97872 Signed-off-by: Xiang, Haihao --- src/gen9_vdenc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gen9_vdenc.c b/src/gen9_vdenc.c index 46da334..9d1d2f8 100644 --- a/src/gen9_vdenc.c +++ b/src/gen9_vdenc.c @@ -3552,6 +3552,7 @@ gen9_vdenc_avc_encode_picture(VADriverContextP ctx, struct encode_state *encode_state, struct intel_encoder_context *encoder_context) { + struct i965_driver_data *i965 = i965_driver_data(ctx); VAStatus va_status; struct gen9_vdenc_context *vdenc_context = encoder_context->mfc_context; struct intel_batchbuffer *batch = encoder_context->base.batch; @@ -3567,7 +3568,11 @@ gen9_vdenc_avc_encode_picture(VADriverContextP ctx, vdenc_context->is_first_pass = (vdenc_context->current_pass == 0); vdenc_context->is_last_pass = (vdenc_context->current_pass == (vdenc_context->num_passes - 1)); - intel_batchbuffer_start_atomic_bcs(batch, 0x1000); + if (i965->intel.has_bsd2) + intel_batchbuffer_start_atomic_bcs_override(batch, 0x1000, BSD_RING0); + else + intel_batchbuffer_start_atomic_bcs(batch, 0x1000); + intel_batchbuffer_emit_mi_flush(batch); if (vdenc_context->brc_enabled) { -- 1.9.1