tvin: vdin: vdin afbce fix header size bug [1/1]
authorXuhua Zhang <xuhua.zhang@amlogic.com>
Thu, 13 Dec 2018 09:16:31 +0000 (17:16 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 14 Dec 2018 08:50:35 +0000 (00:50 -0800)
PD#SWPL-3208

Problem:
vdin afbce scaler, display abnormal.

Solution:
fix afbce header size problem.

Verify:
TL1 X301

Change-Id: I461b4aa809ceddbe18cf7f6f49e8152b43b86076
Signed-off-by: Xuhua Zhang <xuhua.zhang@amlogic.com>
drivers/amlogic/media/vin/tvin/vdin/vdin_afbce.c

index 074b052..ef34995 100644 (file)
@@ -72,8 +72,8 @@ unsigned int vdin_afbce_cma_alloc(struct vdin_dev_s *devp)
                CODEC_MM_FLAGS_CPU;
        unsigned int max_buffer_num = min_buf_num;
        unsigned int i;
-       /*afbce head need 1036800 byte at most*/
-       unsigned int afbce_head_size_byte = PAGE_SIZE * 576;
+       /*head_size:3840*2160*3*9/32*/
+       unsigned int afbce_head_size_byte = PAGE_SIZE * 1712;
        /*afbce map_table need 218700 byte at most*/
        unsigned int afbce_table_size_byte = PAGE_SIZE * 60;/*0.3M*/
        unsigned int afbce_mem_used;
@@ -281,7 +281,7 @@ unsigned int vdin_afbce_cma_alloc(struct vdin_dev_s *devp)
        /* 1 block = 32 * 4 pixle = 128 pixel */
        /* there is a header in one block, a header has 4 bytes */
        /* set fm_head_paddr start */
-       frame_head_size = (int)roundup(devp->h_active * devp->v_active, 128);
+       frame_head_size = (int)roundup(devp->vfmem_size, 128);
        /*h_active * v_active / 128 * 4 = frame_head_size*/
        frame_head_size = PAGE_ALIGN(frame_head_size / 32);