From 145a7809ea67f78ccdc9714dcc687e7276745a38 Mon Sep 17 00:00:00 2001 From: Jian Wang Date: Tue, 24 Dec 2019 17:39:01 +0800 Subject: [PATCH] codec_mm: fix fastplay can not alloc twice [2/3] PD#SWPL-18391 Problem: codec_mm_extpool_pool_release use mgt->tvp_pool.total_size, not it parm tvp_pool, when extpool is cma_pool not tvp pool will duo to total_size set error. Solution: use codec_mm_extpool_pool_release parm tvp_pool total_size to set Verify: verify on u212 Change-Id: I83a5d988d7701cf6291250bd739c1c5b43143764 Signed-off-by: Jian Wang --- drivers/amlogic/media/common/codec_mm/codec_mm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/amlogic/media/common/codec_mm/codec_mm.c b/drivers/amlogic/media/common/codec_mm/codec_mm.c index 1c8c8d810821..e9078bc89301 100644 --- a/drivers/amlogic/media/common/codec_mm/codec_mm.c +++ b/drivers/amlogic/media/common/codec_mm/codec_mm.c @@ -1236,7 +1236,6 @@ EXPORT_SYMBOL(codec_mm_extpool_pool_alloc); */ static int codec_mm_extpool_pool_release(struct extpool_mgt_s *tvp_pool) { - struct codec_mm_mgt_s *mgt = get_mem_mgt(); int i; int ignored = 0; mutex_lock(&tvp_pool->pool_lock); @@ -1246,7 +1245,7 @@ static int codec_mm_extpool_pool_release(struct extpool_mgt_s *tvp_pool) if (gpool) { if (gen_pool_avail(gpool) != gen_pool_size(gpool)) { - pr_err("ERROR: TVP pool is not free.\n"); + pr_err("ext pool is not free.\n"); ignored++; continue; /*ignore this free now, */ } @@ -1266,7 +1265,7 @@ static int codec_mm_extpool_pool_release(struct extpool_mgt_s *tvp_pool) TVP_POOL_NAME); } } - mgt->tvp_pool.total_size -= slot_mem_size; + tvp_pool->total_size -= slot_mem_size; tvp_pool->gen_pool[i] = NULL; tvp_pool->mm[i] = NULL; } -- 2.20.1