From 87d67d8a20538aba8669d6d3f13ce4dbfd4b5664 Mon Sep 17 00:00:00 2001 From: Xuhua Zhang Date: Thu, 13 Dec 2018 17:16:31 +0800 Subject: [PATCH] tvin: vdin: vdin afbce fix header size bug [1/1] 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 --- drivers/amlogic/media/vin/tvin/vdin/vdin_afbce.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/amlogic/media/vin/tvin/vdin/vdin_afbce.c b/drivers/amlogic/media/vin/tvin/vdin/vdin_afbce.c index 074b052..ef34995 100644 --- a/drivers/amlogic/media/vin/tvin/vdin/vdin_afbce.c +++ b/drivers/amlogic/media/vin/tvin/vdin/vdin_afbce.c @@ -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); -- 2.7.4