[Libva] [LIBVA-INTEL-DRIVER][PATCH 1/3] Encoding: Encoding reuses aux_batchbuffer instead of allocate new buffer
Xiang, Haihao
haihao.xiang at intel.com
Mon Jun 13 13:22:51 UTC 2016
Thanks for your patch series, applied.
Best Regards
Haihao
>-----Original Message-----
>From: Libva [mailto:libva-bounces at lists.freedesktop.org] On Behalf Of Zhao
>Yakui
>Sent: Monday, May 30, 2016 9:56 PM
>To: libva at lists.freedesktop.org
>Subject: [Libva] [LIBVA-INTEL-DRIVER][PATCH 1/3] Encoding: Encoding reuses
>aux_batchbuffer instead of allocate new buffer
>
>Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
>---
> src/gen8_mfc.c | 23 +++++++----------------
> 1 file changed, 7 insertions(+), 16 deletions(-)
>
>diff --git a/src/gen8_mfc.c b/src/gen8_mfc.c index c30bad6..60e6362 100644
>--- a/src/gen8_mfc.c
>+++ b/src/gen8_mfc.c
>@@ -1244,23 +1244,12 @@ static void
> gen8_mfc_batchbuffer_surfaces_output(VADriverContextP ctx,
> struct encode_state *encode_state,
> struct intel_encoder_context *encoder_context)
>-
> {
>- struct i965_driver_data *i965 = i965_driver_data(ctx);
> struct gen6_mfc_context *mfc_context = encoder_context->mfc_context;
>- VAEncSequenceParameterBufferH264 *pSequenceParameter =
>(VAEncSequenceParameterBufferH264 *)encode_state->seq_param_ext-
>>buffer;
>- int width_in_mbs = pSequenceParameter->picture_width_in_mbs;
>- int height_in_mbs = pSequenceParameter->picture_height_in_mbs;
>- mfc_context->mfc_batchbuffer_surface.num_blocks = width_in_mbs *
>height_in_mbs + encode_state->num_slice_params_ext * 8 + 1;
>- mfc_context->mfc_batchbuffer_surface.size_block = 16 *
>CMD_LEN_IN_OWORD; /* 3 OWORDs */
>- mfc_context->mfc_batchbuffer_surface.pitch = 16;
>- mfc_context->mfc_batchbuffer_surface.bo = dri_bo_alloc(i965-
>>intel.bufmgr,
>- "MFC batchbuffer",
>- mfc_context-
>>mfc_batchbuffer_surface.num_blocks * mfc_context-
>>mfc_batchbuffer_surface.size_block,
>- 0x1000);
>+ assert(mfc_context->aux_batchbuffer_surface.bo);
> mfc_context->buffer_suface_setup(ctx,
> &mfc_context->gpe_context,
>- &mfc_context->mfc_batchbuffer_surface,
>+
>+ &mfc_context->aux_batchbuffer_surface,
> BINDING_TABLE_OFFSET(BIND_IDX_MFC_BATCHBUFFER),
> SURFACE_STATE_OFFSET(BIND_IDX_MFC_BATCHBUFFER));
> }
>@@ -1602,10 +1591,10 @@
>gen8_mfc_avc_hardware_batchbuffer(VADriverContextP ctx, {
> struct gen6_mfc_context *mfc_context = encoder_context->mfc_context;
>
>+ dri_bo_reference(mfc_context->aux_batchbuffer_surface.bo);
> gen8_mfc_build_avc_batchbuffer(ctx, encode_state, encoder_context);
>- dri_bo_reference(mfc_context->mfc_batchbuffer_surface.bo);
>
>- return mfc_context->mfc_batchbuffer_surface.bo;
>+ return mfc_context->aux_batchbuffer_surface.bo;
> }
>
> #endif
>@@ -3712,8 +3701,10 @@ static void gen8_mfc_vp8_init(VADriverContextP
>ctx,
> dri_bo_unreference(mfc_context->aux_batchbuffer_surface.bo);
> mfc_context->aux_batchbuffer_surface.bo = NULL;
>
>- if (mfc_context->aux_batchbuffer)
>+ if (mfc_context->aux_batchbuffer) {
> intel_batchbuffer_free(mfc_context->aux_batchbuffer);
>+ mfc_context->aux_batchbuffer = NULL;
>+ }
>
> mfc_context->aux_batchbuffer = intel_batchbuffer_new(&i965->intel,
>I915_EXEC_BSD, slice_batchbuffer_size);
> mfc_context->aux_batchbuffer_surface.bo = mfc_context-
>>aux_batchbuffer->buffer;
>--
>1.8.2.1
>
>_______________________________________________
>Libva mailing list
>Libva at lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libva
More information about the Libva
mailing list