|
|
|
@ -2382,6 +2382,7 @@ static int kgsl_setup_anon_useraddr(struct kgsl_pagetable *pagetable, |
|
|
|
|
size_t offset, size_t size) |
|
|
|
|
{ |
|
|
|
|
/* Map an anonymous memory chunk */ |
|
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
if (size == 0 || offset != 0 || |
|
|
|
|
!IS_ALIGNED(size, PAGE_SIZE)) |
|
|
|
@ -2392,8 +2393,6 @@ static int kgsl_setup_anon_useraddr(struct kgsl_pagetable *pagetable, |
|
|
|
|
entry->memdesc.flags |= (uint64_t)KGSL_MEMFLAGS_USERMEM_ADDR; |
|
|
|
|
|
|
|
|
|
if (kgsl_memdesc_use_cpu_map(&entry->memdesc)) { |
|
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
/* Register the address in the database */ |
|
|
|
|
ret = kgsl_mmu_set_svm_region(pagetable, |
|
|
|
|
(uint64_t) hostptr, (uint64_t) size); |
|
|
|
@ -2404,7 +2403,12 @@ static int kgsl_setup_anon_useraddr(struct kgsl_pagetable *pagetable, |
|
|
|
|
entry->memdesc.gpuaddr = (uint64_t) hostptr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return memdesc_sg_virt(&entry->memdesc, hostptr); |
|
|
|
|
ret = memdesc_sg_virt(&entry->memdesc, hostptr); |
|
|
|
|
|
|
|
|
|
if (ret && kgsl_memdesc_use_cpu_map(&entry->memdesc)) |
|
|
|
|
kgsl_mmu_put_gpuaddr(&entry->memdesc); |
|
|
|
|
|
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_DMA_SHARED_BUFFER |
|
|
|
|