The original current_out_surface was never released on exit. Main reason for that is the legacy VPP framework that did not allow the VADriverContextP handle to be passed down to the desired .finalize() hook. Improved that to bring it on par with the VEBOX code path.
Signed-off-by: Gwenole Beauchesne <gwenole.beauche...@intel.com> --- src/gen8_post_processing.c | 3 ++- src/i965_post_processing.c | 18 ++++++++++++++---- src/i965_post_processing.h | 4 +++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c index eb17a86..8a42ad7 100644 --- a/src/gen8_post_processing.c +++ b/src/gen8_post_processing.c @@ -1386,7 +1386,8 @@ gen8_post_processing( } static void -gen8_post_processing_context_finalize(struct i965_post_processing_context *pp_context) +gen8_post_processing_context_finalize(VADriverContextP ctx, + struct i965_post_processing_context *pp_context) { dri_bo_unreference(pp_context->surface_state_binding_table.bo); pp_context->surface_state_binding_table.bo = NULL; diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c index 2344672..d819561 100755 --- a/src/i965_post_processing.c +++ b/src/i965_post_processing.c @@ -5278,7 +5278,8 @@ i965_image_processing(VADriverContextP ctx, } static void -i965_post_processing_context_finalize(struct i965_post_processing_context *pp_context) +i965_post_processing_context_finalize(VADriverContextP ctx, + struct i965_post_processing_context *pp_context) { int i; @@ -5307,6 +5308,13 @@ i965_post_processing_context_finalize(struct i965_post_processing_context *pp_co dri_bo_unreference(pp_context->pp_dndi_context.stmm_bo); pp_context->pp_dndi_context.stmm_bo = NULL; + if (pp_context->pp_dndi_context.current_out_surface != VA_INVALID_ID) { + i965_DestroySurfaces(ctx, + &pp_context->pp_dndi_context.current_out_surface, 1); + pp_context->pp_dndi_context.current_out_surface = VA_INVALID_ID; + pp_context->pp_dndi_context.current_out_obj_surface = NULL; + } + dri_bo_unreference(pp_context->pp_dn_context.stmm_bo); pp_context->pp_dn_context.stmm_bo = NULL; @@ -5330,7 +5338,7 @@ i965_post_processing_terminate(VADriverContextP ctx) struct i965_post_processing_context *pp_context = i965->pp_context; if (pp_context) { - pp_context->finalize(pp_context); + pp_context->finalize(ctx, pp_context); free(pp_context); } @@ -5705,9 +5713,10 @@ error: static void i965_proc_context_destroy(void *hw_context) { - struct i965_proc_context *proc_context = (struct i965_proc_context *)hw_context; + struct i965_proc_context * const proc_context = hw_context; + VADriverContextP const ctx = proc_context->driver_context; - i965_post_processing_context_finalize(&proc_context->pp_context); + i965_post_processing_context_finalize(ctx, &proc_context->pp_context); intel_batchbuffer_free(proc_context->base.batch); free(proc_context); } @@ -5722,6 +5731,7 @@ i965_proc_context_init(VADriverContextP ctx, struct object_config *obj_config) proc_context->base.destroy = i965_proc_context_destroy; proc_context->base.run = i965_proc_picture; proc_context->base.batch = intel_batchbuffer_new(intel, I915_EXEC_RENDER, 0); + proc_context->driver_context = ctx; i965->codec_info->post_processing_context_init(ctx, &proc_context->pp_context, proc_context->base.batch); return (struct hw_context *)proc_context; diff --git a/src/i965_post_processing.h b/src/i965_post_processing.h index 271941e..2d4cc10 100755 --- a/src/i965_post_processing.h +++ b/src/i965_post_processing.h @@ -542,12 +542,14 @@ struct i965_post_processing_context const VARectangle *dst_rect, int pp_index, void * filter_param); - void (*finalize)(struct i965_post_processing_context *pp_context); + void (*finalize)(VADriverContextP ctx, + struct i965_post_processing_context *pp_context); }; struct i965_proc_context { struct hw_context base; + void *driver_context; struct i965_post_processing_context pp_context; }; -- 1.9.1 _______________________________________________ Libva mailing list Libva@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libva