codec_mm: fix fastplay can not alloc twice [2/3]
authorJian Wang <jian.wang@amlogic.com>
Tue, 24 Dec 2019 09:39:01 +0000 (17:39 +0800)
committerJian Wang <jian.wang@amlogic.com>
Thu, 26 Dec 2019 13:55:33 +0000 (21:55 +0800)
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 <jian.wang@amlogic.com>
drivers/amlogic/media/common/codec_mm/codec_mm.c

index 1c8c8d810821c0c643271d04a1c340286ca87f06..e9078bc89301f49f5e54dbc361a0aadd4eefd478 100644 (file)
@@ -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;
        }