static int tb_buffer_init(void)
{
int i;
- int flags = CODEC_MM_FLAGS_DMA_CPU | CODEC_MM_FLAGS_CMA_CLEAR;
+ //int flags = CODEC_MM_FLAGS_DMA_CPU | CODEC_MM_FLAGS_CMA_CLEAR;
+ int flags = 0;
if (tb_buffer_status)
return tb_buffer_status;
detect_buf[i].paddr = tb_buffer_start +
TB_DETECT_H * TB_DETECT_W * i;
detect_buf[i].vaddr =
- (ulong)phys_to_virt(detect_buf[i].paddr);
+ (ulong)codec_mm_vmap(detect_buf[i].paddr,
+ TB_DETECT_H * TB_DETECT_W);
if (ppmgr_device.tb_detect & 0xc) {
PPMGRVPP_INFO(
"detect buff(%d) paddr: %lx, vaddr: %lx\n",
static int tb_buffer_uninit(void)
{
+ int i;
if (tb_src_canvas) {
if (tb_src_canvas & 0xff)
canvas_pool_map_free_canvas(
PPMGRVPP_INFO("tb cma free addr is %x, size is %x\n",
(unsigned int)tb_buffer_start,
(unsigned int)tb_buffer_size);
+ for (i = 0; i < tb_buffer_len; i++) {
+ if (detect_buf[i].vaddr) {
+ codec_mm_unmap_phyaddr(
+ (u8 *)detect_buf[i].vaddr);
+ detect_buf[i].vaddr = 0;
+ }
+ }
codec_mm_free_for_dma(
"tb_detect",
tb_buffer_start);