This commit is contained in:
刘可亮
2024-01-27 08:47:24 +08:00
parent d3bd993b5f
commit 9f7ba67007
2345 changed files with 74421 additions and 76616 deletions

View File

@@ -149,7 +149,7 @@ static graphic_buffer_t* graphic_buffer_aic_create(uint32_t w, uint32_t h,
memset(buffer->data_head, 0x00, size);
buffer->w = w;
buffer->h = h;
buffer->data = (unsigned int*)buffer->cma_buff.phy_addr;
buffer->data = (unsigned char*)buffer->cma_buff.phy_addr;
buffer->graphic_buffer.vt = &s_graphic_buffer_aic_vtable;
buffer->graphic_buffer.vt->get_line_length(&buffer->graphic_buffer);
@@ -175,9 +175,9 @@ graphic_buffer_t* graphic_buffer_aic_create_with_data(void* data) {
return_value_if_fail(buffer != NULL, NULL);
buffer->cma_buff.data = dec_asset;
buffer->cma_buff.size = dec_asset->frame.buf.size.height * dec_asset->frame.buf.stride[0];
buffer->cma_buff.size = dec_asset->frame_asset->cma_buf[0].size;
buffer->cma_buff.phy_addr = (unsigned int)dec_asset->frame_asset->cma_buf[0].phy_addr;
buffer->cma_buff.type = CTX_ASSET_TYPE;
buffer->cma_buff.phy_addr = (unsigned int)dec_asset->frame.buf.phy_addr[0];
buffer->cma_buff.buf = (void *)buffer->cma_buff.phy_addr;
aic_cma_buf_add_ge(&buffer->cma_buff);

View File

@@ -146,34 +146,36 @@ static void cma_buf_hash_destroy(cma_buffer_hash_map *map) {
int aic_cma_buf_malloc(cma_buffer *back, int size, int align_size) {
void *cma_buf = NULL;
int malloc_size = 0;
int cache_align_size = 0;
if (align_size <= 0)
malloc_size = size + CACHE_LINE_SIZE;
else
malloc_size = size + align_size;
if (align_size <= 0) {
malloc_size = size + CACHE_LINE_SIZE * 2;
cache_align_size = BYTE_ALIGN(size, CACHE_LINE_SIZE);
} else {
malloc_size = size + align_size * 2;
cache_align_size = BYTE_ALIGN(size, align_size);
}
cma_buf = aicos_malloc(MEM_CMA, malloc_size);
if (!cma_buf) {
log_error("aic_cma_buf_malloc fail, size = %d, malloc size = %d\n",
size, malloc_size);
log_error("aic_cma_buf_malloc fail, malloc size = %d\n", malloc_size);
return -1;
}
back->type = PHY_TYPE;
back->phy_addr = (unsigned int)BYTE_ALIGN(((uintptr_t)cma_buf), CACHE_LINE_SIZE);
back->buf_head = cma_buf;
back->size = size;
back->size = cache_align_size;
if (align_size <= 0) {
back->phy_addr = (unsigned int)BYTE_ALIGN(((uintptr_t)cma_buf), CACHE_LINE_SIZE);
} else {
back->phy_addr = (unsigned int)BYTE_ALIGN(((uintptr_t)cma_buf), align_size);
}
back->buf = (void *)back->phy_addr;
if (align_size <= 0)
back->phy_addr = (unsigned int)BYTE_ALIGN(((uintptr_t)cma_buf), CACHE_LINE_SIZE);
else
back->phy_addr = (unsigned int)BYTE_ALIGN(((uintptr_t)cma_buf), align_size);
aicos_dcache_clean_invalid_range((unsigned long *)back->phy_addr, (long long)cache_align_size);
memset((void *)back->phy_addr, 0, size);
aicos_dcache_clean_invalid_range((unsigned long *)back->phy_addr, (long long)size);
g_hash_map->cma_size += size;
g_hash_map->cma_size += cache_align_size;
return 0;
}

View File

@@ -29,8 +29,6 @@ static void awtk_start_ui_thread(void) {
TK_UI_THREAD_PRIORITY,
TK_UI_THREAD_TICK);
rt_thread_startup(ui_thread);
return 0;
}
int awtk_init(int argc, char **argv) {