codec_mm: fixed scatter cached bug
authorHui Zhang <hui.zhang@amlogic.com>
Thu, 3 May 2018 09:43:44 +0000 (17:43 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Thu, 3 May 2018 09:44:14 +0000 (17:44 +0800)
PD#159652: it may occur in tvp mode, no tvp may a lost less.
some free slot not insert free list after first alloc.
this leads to a lot of wasted memory

Change-Id: Ia62d7f661ee5bc1563cac0980da604e5d8356113
Signed-off-by: Hui Zhang <hui.zhang@amlogic.com>
drivers/amlogic/media/common/codec_mm/codec_mm_scatter.c

index e60aadb..b17e3d1 100644 (file)
@@ -919,7 +919,7 @@ static int codec_mm_page_alloc_from_slot(
                        codec_mm_list_lock(smgt);
                        slot->on_alloc_free--;  /*alloc use end */
                        if (slot->alloced_page_num < slot->page_num &&
-                               list_empty(&smgt->free_list)) {
+                               list_empty(&slot->free_list)) {
                                DBG_LOG("slot have free: %p, t:%d,a:%d,%d\n",
                                        slot, slot->page_num,
                                        slot->alloced_page_num, alloced);