mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-16 03:18:54 +00:00
v1.0.3
This commit is contained in:
@@ -13,6 +13,12 @@
|
||||
#include "mpp_mem.h"
|
||||
#include "aic_core.h"
|
||||
|
||||
#ifdef AIC_VE_DRV_V10
|
||||
#define USE_IRQ (0)
|
||||
#else
|
||||
#define USE_IRQ (1)
|
||||
#endif
|
||||
|
||||
static int get_gzip_header(unsigned char* src)
|
||||
{
|
||||
return 2;
|
||||
@@ -23,11 +29,11 @@ static void config_ve_top(unsigned long reg_base)
|
||||
write_reg_u32(reg_base + VE_CLK_REG, 1);
|
||||
write_reg_u32(reg_base + VE_RST_REG, 0);
|
||||
|
||||
while( (read_reg_u32(reg_base + VE_RST_REG) >> 16)) {
|
||||
while ((read_reg_u32(reg_base + VE_RST_REG) >> 16)) {
|
||||
}
|
||||
|
||||
write_reg_u32(reg_base + VE_INIT_REG, 1);
|
||||
write_reg_u32(reg_base + VE_IRQ_REG, 1);
|
||||
write_reg_u32(reg_base + VE_IRQ_REG, USE_IRQ);
|
||||
write_reg_u32(reg_base + VE_PNG_EN_REG, 1);
|
||||
}
|
||||
|
||||
@@ -47,8 +53,8 @@ static void config_ve_top(unsigned long reg_base)
|
||||
|
||||
if (compressed_data == NULL
|
||||
|| compressed_len ==0
|
||||
|| uncompressed_data== NULL
|
||||
|| uncompressed_len==0 ) {
|
||||
|| uncompressed_data == NULL
|
||||
|| uncompressed_len == 0 ) {
|
||||
loge("param error!!!\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -58,7 +64,7 @@ static void config_ve_top(unsigned long reg_base)
|
||||
return -1;
|
||||
}
|
||||
|
||||
lz77_buf = (unsigned long)aicos_malloc(MEM_CMA,(32*1024+7));
|
||||
lz77_buf = (unsigned long)aicos_malloc(MEM_CMA, (32*1024+7));
|
||||
|
||||
if (lz77_buf == 0) {
|
||||
loge("mpp_alloc error!!!\n");
|
||||
@@ -67,7 +73,7 @@ static void config_ve_top(unsigned long reg_base)
|
||||
}
|
||||
|
||||
lz77_buf_align_8 = ((lz77_buf+7)&(~7));
|
||||
logd("lz77_buf:0x%lx,lz77_buf_align_8:0x%lx\n",lz77_buf,lz77_buf_align_8);
|
||||
logd("lz77_buf:0x%lx,lz77_buf_align_8:0x%lx\n", lz77_buf, lz77_buf_align_8);
|
||||
|
||||
offset = get_gzip_header(compressed_data);
|
||||
logd("offset:%d\n",offset);
|
||||
@@ -76,7 +82,7 @@ static void config_ve_top(unsigned long reg_base)
|
||||
config_ve_top(reg_base);
|
||||
write_reg_u32(reg_base+PNG_CTRL_REG, 0);
|
||||
write_reg_u32(reg_base+OUTPUT_BUFFER_ADDR_REG, (unsigned long)uncompressed_data);
|
||||
write_reg_u32(reg_base+OUTPUT_BUFFER_LENGTH_REG,(unsigned long)uncompressed_data + uncompressed_len -1);
|
||||
write_reg_u32(reg_base+OUTPUT_BUFFER_LENGTH_REG, (unsigned long)uncompressed_data + uncompressed_len -1);
|
||||
write_reg_u32(reg_base+INFLATE_WINDOW_BUFFER_ADDR_REG, lz77_buf_align_8);
|
||||
write_reg_u32(reg_base+INFLATE_INTERRUPT_REG, 15);
|
||||
write_reg_u32(reg_base+INFLATE_STATUS_REG, 15);
|
||||
@@ -87,11 +93,11 @@ static void config_ve_top(unsigned long reg_base)
|
||||
write_reg_u32(reg_base+INPUT_BS_LENGTH_REG, (compressed_len-offset)*8);
|
||||
write_reg_u32(reg_base+INPUT_BS_DATA_VALID_REG, 0x80000003);
|
||||
|
||||
#if USE_IRQ
|
||||
if (ve_wait(&status) < 0) {
|
||||
loge("timeout");
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
if (status & PNG_ERROR) {
|
||||
loge("decode error, status: %08x", status);
|
||||
goto _exit;
|
||||
@@ -101,6 +107,17 @@ static void config_ve_top(unsigned long reg_base)
|
||||
loge("decode error, status: %08x", status);
|
||||
goto _exit;
|
||||
}
|
||||
#else
|
||||
while ((read_reg_u32(reg_base + OUTPUT_COUNT_REG) != uncompressed_len)
|
||||
&& ((read_reg_u32(reg_base + INFLATE_STATE_REG) & 0x7800) != 0x800)) {
|
||||
status = read_reg_u32(reg_base + INFLATE_STATUS_REG);
|
||||
if (status & PNG_ERROR) {
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
usleep(1000);
|
||||
}
|
||||
#endif
|
||||
|
||||
real_uncompress_len = read_reg_u32(reg_base+OUTPUT_COUNT_REG);
|
||||
logd("real_uncompress_len:%d\n",real_uncompress_len);
|
||||
|
||||
Reference in New Issue
Block a user