[Libva] [PATCH intel-driver 12/13] vebox: fix memory leak of VEBOX state tables.

Gwenole Beauchesne gb.devel at gmail.com
Wed Aug 27 04:50:37 PDT 2014


Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
 src/gen75_vpp_vebox.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/gen75_vpp_vebox.c b/src/gen75_vpp_vebox.c
index 9d400d9..f2d64ac 100644
--- a/src/gen75_vpp_vebox.c
+++ b/src/gen75_vpp_vebox.c
@@ -964,7 +964,6 @@ gen75_vebox_ensure_surfaces_storage(VADriverContextP ctx,
     proc_ctx->dndi_state_table.bo = bo;
     if (!bo)
         return VA_STATUS_ERROR_ALLOCATION_FAILED;
-    drm_intel_bo_reference(proc_ctx->dndi_state_table.bo);
  
     /* Allocate IECP state table  */
     drm_intel_bo_unreference(proc_ctx->iecp_state_table.bo);
@@ -973,7 +972,6 @@ gen75_vebox_ensure_surfaces_storage(VADriverContextP ctx,
     proc_ctx->iecp_state_table.bo = bo;
     if (!bo)
         return VA_STATUS_ERROR_ALLOCATION_FAILED;
-    drm_intel_bo_reference(proc_ctx->iecp_state_table.bo);
 
     /* Allocate Gamut state table  */
     drm_intel_bo_unreference(proc_ctx->gamut_state_table.bo);
@@ -982,7 +980,6 @@ gen75_vebox_ensure_surfaces_storage(VADriverContextP ctx,
     proc_ctx->gamut_state_table.bo = bo;
     if (!bo)
         return VA_STATUS_ERROR_ALLOCATION_FAILED;
-    drm_intel_bo_reference(proc_ctx->gamut_state_table.bo);
 
     /* Allocate vertex state table  */
     drm_intel_bo_unreference(proc_ctx->vertex_state_table.bo);
@@ -991,7 +988,6 @@ gen75_vebox_ensure_surfaces_storage(VADriverContextP ctx,
     proc_ctx->vertex_state_table.bo = bo;
     if (!bo)
         return VA_STATUS_ERROR_ALLOCATION_FAILED;
-    drm_intel_bo_reference(proc_ctx->vertex_state_table.bo);
 
     return VA_STATUS_SUCCESS;
 }
@@ -1460,19 +1456,19 @@ void gen75_vebox_context_destroy(VADriverContextP ctx,
         frame_store_clear(&proc_ctx->frame_store[i], ctx);
 
     /* dndi state table  */
-    dri_bo_unreference(proc_ctx->dndi_state_table.bo);
+    drm_intel_bo_unreference(proc_ctx->dndi_state_table.bo);
     proc_ctx->dndi_state_table.bo = NULL;
 
     /* iecp state table  */
-    dri_bo_unreference(proc_ctx->iecp_state_table.bo);
-    proc_ctx->dndi_state_table.bo = NULL;
+    drm_intel_bo_unreference(proc_ctx->iecp_state_table.bo);
+    proc_ctx->iecp_state_table.bo = NULL;
  
     /* gamut statu table */
-    dri_bo_unreference(proc_ctx->gamut_state_table.bo);
+    drm_intel_bo_unreference(proc_ctx->gamut_state_table.bo);
     proc_ctx->gamut_state_table.bo = NULL;
 
     /* vertex state table  */
-    dri_bo_unreference(proc_ctx->vertex_state_table.bo);
+    drm_intel_bo_unreference(proc_ctx->vertex_state_table.bo);
     proc_ctx->vertex_state_table.bo = NULL;
 
     intel_batchbuffer_free(proc_ctx->batch);
-- 
1.7.9.5



More information about the Libva mailing list