codec_mm: fix serial port prints "memory allocate failure" message.
authorPeng Yixin <yixin.peng@amlogic.com>
Thu, 30 Aug 2018 02:03:30 +0000 (10:03 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 11 Sep 2018 14:41:00 +0000 (07:41 -0700)
PD#172077

Change-Id: Id89a4b3e26ae928a3be0f098592ce42cdaead49b
Signed-off-by: Peng Yixin <yixin.peng@amlogic.com>
drivers/amlogic/media/common/codec_mm/codec_mm_scatter.c

index 439c1d4..a5f64fc 100644 (file)
@@ -926,12 +926,18 @@ static int codec_mm_page_alloc_from_slot(
                                /*
                                   *ERR_LOG("can't alloc slot from system\n");
                                 */
-                               pr_info("alloc default cma size fail, try %d pages\n",
-                                               alloc_pages);
+                               if (codec_mm_get_sc_debug_mode() &
+                                               0x01) {
+                                       pr_info("alloc default cma size fail, try %d pages\n",
+                                                       alloc_pages);
+                               }
                                slot = codec_mm_slot_alloc(smgt,
                                         alloc_pages * PAGE_SIZE, 0);
                                if (!slot) {
-                                       pr_info("slot alloc 4M fail!\n");
+                                       if (codec_mm_get_sc_debug_mode() &
+                                               0x01) {
+                                               pr_info("slot alloc 4M fail!\n");
+                                       }
                                        break;
                                }
                        }