Lines Matching defs:tui_mem
263 static int get_tui_ion_sglist(tui_ion_mem *tui_mem)
271 struct sg_table *tui_ion_sg_table = tui_mem->tui_sg_table;
284 tmp_tui_sglist->ion_size = (uint64_t)tui_mem->len;
286 tui_mem->info_length = (uint64_t)tui_ion_sg_table->nents;
298 tui_mem->npages = tmp_tui_sglist->page_info[0].npages;
299 tui_mem->tui_ion_virt_addr = phys_to_virt(tmp_tui_sglist->page_info[0].phys_addr);
300 tui_mem->fb_phys_addr = tmp_tui_sglist->page_info[0].phys_addr;
303 tui_mem->tui_ion_phys_addr = mailbox_virt_to_phys((uintptr_t)(void *)tmp_tui_sglist); // sglist phys-addr
304 if (tui_mem->tui_ion_phys_addr == 0) {
306 tui_mem->configid);
310 tui_mem->size = tui_sglist_size;
314 static int alloc_ion_mem(tui_ion_mem *tui_mem)
317 if (tui_mem == NULL) {
322 tui_ion_sg_table = cma_secmem_alloc(SEC_TUI, tui_mem->len);
325 tui_ion_sg_table = mm_secmem_alloc(SEC_TUI, tui_mem->len);
328 tloge("failed to get ion page for tui, configid is %d\n", tui_mem->configid);
331 tui_mem->tui_sg_table = tui_ion_sg_table;
335 static void free_ion_mem(tui_ion_mem *tui_mem)
337 if (tui_mem->tui_sg_table == NULL || tui_mem->tui_ion_phys_addr == 0) {
342 cma_secmem_free(SEC_TUI, tui_mem->tui_sg_table);
345 mm_secmem_free(SEC_TUI, tui_mem->tui_sg_table);
347 tui_mem->tui_ion_phys_addr = 0;