mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
tvafe: vbi: optimize vbi data parse [1/1]
PD#SWPL-10532 Problem: teletext sometimes display abnormal Solution: optimize vbi data parse Verify: x301 Change-Id: I879208fd05dd188dc84fde7dd32a1c64504c57f8 Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
This commit is contained in:
@@ -232,7 +232,7 @@ void cvd_vbi_mem_set(unsigned int offset, unsigned int size)
|
||||
W_VBI_APB_BIT(ACD_REG_42, size, 0, 24);
|
||||
W_VBI_APB_BIT(ACD_REG_42, 1, 31, 1);
|
||||
} else
|
||||
W_APB_BIT(ACD_REG_21, size,
|
||||
W_APB_BIT(ACD_REG_21, (size - 1),
|
||||
AML_VBI_SIZE_BIT, AML_VBI_SIZE_WID);
|
||||
W_APB_BIT(ACD_REG_21, DECODER_VBI_START_ADDR,
|
||||
AML_VBI_START_ADDR_BIT, AML_VBI_START_ADDR_WID);
|
||||
@@ -240,6 +240,8 @@ void cvd_vbi_mem_set(unsigned int offset, unsigned int size)
|
||||
|
||||
void cvd_vbi_config(void)
|
||||
{
|
||||
/* 20190719: teletext slicer mode 1 to avoid error data */
|
||||
W_APB_BIT(CVD2_VBI_SLIER_MODE_SEL, 1, 2, 2);
|
||||
W_APB_REG(CVD2_VBI_CC_START, VBI_START_CC);
|
||||
W_APB_REG(CVD2_VBI_WSS_START, 0x54);
|
||||
W_VBI_APB_REG(CVD2_VBI_TT_START, VBI_START_TT);
|
||||
@@ -271,9 +273,8 @@ static void tvafe_cvd2_memory_init(struct tvafe_cvd2_mem_s *mem,
|
||||
return;
|
||||
}
|
||||
|
||||
if (tvafe_cpu_type() >= CPU_TYPE_GXTVBB) {
|
||||
cvd2_addr = mem->start >> 4;
|
||||
motion_offset = motion_offset >> 4;
|
||||
cvd2_addr = mem->start >> 4;
|
||||
motion_offset = motion_offset >> 4;
|
||||
#if defined(CONFIG_AMLOGIC_MEDIA_TVIN_VBI)
|
||||
if (vbi_mem_start != 0)
|
||||
vbi_start = vbi_mem_start >> 4;
|
||||
@@ -282,20 +283,8 @@ static void tvafe_cvd2_memory_init(struct tvafe_cvd2_mem_s *mem,
|
||||
#else
|
||||
vbi_start = cvd2_addr + (vbi_offset >> 4);
|
||||
#endif
|
||||
vbi_size = (DECODER_VBI_SIZE/2) >> 4;
|
||||
} else {
|
||||
cvd2_addr = mem->start >> 3;
|
||||
motion_offset = motion_offset >> 3;
|
||||
#if defined(CONFIG_AMLOGIC_MEDIA_TVIN_VBI)
|
||||
if (vbi_mem_start != 0)
|
||||
vbi_start = vbi_mem_start >> 3;
|
||||
else
|
||||
vbi_start = cvd2_addr + (vbi_offset >> 3);
|
||||
#else
|
||||
vbi_start = cvd2_addr + (vbi_offset >> 3);
|
||||
#endif
|
||||
vbi_size = (DECODER_VBI_SIZE/2) >> 3;
|
||||
}
|
||||
vbi_size = (DECODER_VBI_SIZE/2) >> 4;
|
||||
|
||||
/* CVD2 mem addr is based on 64bit, system mem is based on 8bit*/
|
||||
W_APB_REG(CVD2_REG_96, cvd2_addr);
|
||||
W_APB_REG(ACD_REG_30, (cvd2_addr + motion_offset));
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#define DECODER_MOTION_BUFFER_4F_LENGTH 0x15a60
|
||||
/*motion is not use,only 3d-com need mem:1135x625x10bit/8 * 4 = 0x361ef8*/
|
||||
#define DECODER_VBI_ADDR_OFFSET 0x400000/*0x86000*/
|
||||
#define DECODER_VBI_SIZE 0x80000/*0x1000*/
|
||||
#define DECODER_VBI_SIZE 0x80000/*0x1000*/
|
||||
#define DECODER_VBI_START_ADDR 0x0
|
||||
|
||||
/* vbi start line: unit is hcount value */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,8 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
#define VBI_DRV_VER "Ref.20190715"
|
||||
|
||||
/* *************************************************** */
|
||||
/* *** macro definitions ***************************** */
|
||||
/* *************************************************** */
|
||||
@@ -252,6 +254,7 @@ struct vbi_slicer_s {
|
||||
struct mutex mutex;
|
||||
struct mutex task_mutex;
|
||||
unsigned int busy;
|
||||
unsigned int slicer_cnt;
|
||||
|
||||
unsigned int reserve;
|
||||
};
|
||||
@@ -270,13 +273,15 @@ struct vbi_dev_s {
|
||||
unsigned int irq_free_status;
|
||||
spinlock_t vbi_isr_lock;
|
||||
|
||||
/* vbi memory */
|
||||
/* vbi memory */
|
||||
unsigned int mem_start;
|
||||
unsigned int mem_size;
|
||||
|
||||
unsigned char *pac_addr;
|
||||
unsigned char *pac_addr_start;
|
||||
unsigned char *pac_addr_end;
|
||||
unsigned char *temp_addr_start;
|
||||
unsigned char *temp_addr_end;
|
||||
unsigned int current_pac_wptr;
|
||||
unsigned int vs_delay;
|
||||
/* skip start frame vs for the vbi data is not ready so quickly */
|
||||
@@ -291,7 +296,9 @@ struct vbi_dev_s {
|
||||
struct mutex mutex;
|
||||
spinlock_t lock;
|
||||
struct timer_list timer;
|
||||
bool tasklet_enable;
|
||||
bool slicer_enable;
|
||||
|
||||
unsigned int isr_cnt;
|
||||
};
|
||||
|
||||
/*1: tvafe clk enable;*/
|
||||
|
||||
Reference in New Issue
Block a user