• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/intel-driver


Commit MetaInfo

Revisión8dda0650b55c467200c34ada127b5d9b54edea5c (tree)
Tiempo2015-05-19 02:21:50
AutorZhao Yakui <yakui.zhao@inte...>
CommiterSean V Kelley

Log Message

Decode: Free the allocated internal surface used by JPEG to avoid memory leak

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Sean V Kelley <seanvk@posteo.de>
Tested-by: Sean V Kelley <seanvk@posteo.de>

Cambiar Resumen

Diferencia incremental

--- a/src/gen75_mfd.c
+++ b/src/gen75_mfd.c
@@ -3189,8 +3189,11 @@ out:
31893189 static void
31903190 gen75_mfd_context_destroy(void *hw_context)
31913191 {
3192+ VADriverContextP ctx;
31923193 struct gen7_mfd_context *gen7_mfd_context = (struct gen7_mfd_context *)hw_context;
31933194
3195+ ctx = (VADriverContextP)(gen7_mfd_context->driver_context);
3196+
31943197 dri_bo_unreference(gen7_mfd_context->post_deblocking_output.bo);
31953198 gen7_mfd_context->post_deblocking_output.bo = NULL;
31963199
@@ -3214,6 +3217,13 @@ gen75_mfd_context_destroy(void *hw_context)
32143217
32153218 dri_bo_unreference(gen7_mfd_context->jpeg_wa_slice_data_bo);
32163219
3220+ if (gen7_mfd_context->jpeg_wa_surface_id != VA_INVALID_SURFACE) {
3221+ i965_DestroySurfaces(ctx,
3222+ &gen7_mfd_context->jpeg_wa_surface_id,
3223+ 1);
3224+ gen7_mfd_context->jpeg_wa_surface_object = NULL;
3225+ }
3226+
32173227 intel_batchbuffer_free(gen7_mfd_context->base.batch);
32183228 free(gen7_mfd_context);
32193229 }
@@ -3263,5 +3273,7 @@ gen75_dec_hw_context_init(VADriverContextP ctx, struct object_config *obj_config
32633273 default:
32643274 break;
32653275 }
3276+
3277+ gen7_mfd_context->driver_context = ctx;
32663278 return (struct hw_context *)gen7_mfd_context;
32673279 }
--- a/src/gen7_mfd.c
+++ b/src/gen7_mfd.c
@@ -2668,8 +2668,11 @@ out:
26682668 static void
26692669 gen7_mfd_context_destroy(void *hw_context)
26702670 {
2671+ VADriverContextP ctx;
26712672 struct gen7_mfd_context *gen7_mfd_context = (struct gen7_mfd_context *)hw_context;
26722673
2674+ ctx = (VADriverContextP)(gen7_mfd_context->driver_context);
2675+
26732676 dri_bo_unreference(gen7_mfd_context->post_deblocking_output.bo);
26742677 gen7_mfd_context->post_deblocking_output.bo = NULL;
26752678
@@ -2693,6 +2696,13 @@ gen7_mfd_context_destroy(void *hw_context)
26932696
26942697 dri_bo_unreference(gen7_mfd_context->jpeg_wa_slice_data_bo);
26952698
2699+ if (gen7_mfd_context->jpeg_wa_surface_id != VA_INVALID_SURFACE) {
2700+ i965_DestroySurfaces(ctx,
2701+ &gen7_mfd_context->jpeg_wa_surface_id,
2702+ 1);
2703+ gen7_mfd_context->jpeg_wa_surface_object = NULL;
2704+ }
2705+
26962706 intel_batchbuffer_free(gen7_mfd_context->base.batch);
26972707 free(gen7_mfd_context);
26982708 }
@@ -2741,5 +2751,7 @@ gen7_dec_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
27412751 default:
27422752 break;
27432753 }
2754+
2755+ gen7_mfd_context->driver_context = ctx;
27442756 return (struct hw_context *)gen7_mfd_context;
27452757 }
--- a/src/gen7_mfd.h
+++ b/src/gen7_mfd.h
@@ -93,6 +93,8 @@ struct gen7_mfd_context
9393 dri_bo *jpeg_wa_slice_data_bo;
9494
9595 int wa_mpeg2_slice_vertical_position;
96+
97+ void *driver_context;
9698 };
9799
98100 #endif /* _GEN7_MFD_H_ */