amvecm: malloc local contrast to enable lc function [1/1]
authorBencheng Jing <bencheng.jing@amlogic.com>
Thu, 20 Dec 2018 06:52:26 +0000 (14:52 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 24 Dec 2018 02:18:27 +0000 (18:18 -0800)
PD#SWPL-3419

Problem:
enable local contrast function

Solution:
enable local contrast function

Verify:
x301

Change-Id: I6a1daa7c82224956614b4da46078efdd66424b82
Signed-off-by: Bencheng Jing <bencheng.jing@amlogic.com>
drivers/amlogic/media/enhancement/amvecm/local_contrast.c

index b923d8a..4697a3d 100644 (file)
@@ -1098,9 +1098,6 @@ void lc_init(void)
        h_num = 12;
        v_num = 8;
 
-       if (!lc_en)
-               return;
-
        lc_szcurve = kzalloc(580 * sizeof(int), GFP_KERNEL);
        if (!lc_szcurve)
                return;
@@ -1123,6 +1120,8 @@ void lc_init(void)
                return;
        }
        lc_malloc_ok = 1;
+       if (!lc_en)
+               return;
        lc_top_config(0, h_num, v_num, height, width);
        lc_mtx_set(INP_MTX, LC_MTX_YUV709L_RGB, 1);
        lc_mtx_set(OUTP_MTX, LC_MTX_RGB_YUV709L, 1);