mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-06 21:23:05 +09:00
change gpu's memory from cache to writecombine
This commit is contained in:
@@ -267,9 +267,12 @@
|
||||
/*
|
||||
gcdENABLE_MEM_CACHE
|
||||
|
||||
<20><><EFBFBD><EFBFBD>GPU<50><55>ʹ<EFBFBD>õ<EFBFBD>memory<72>Ƿ<EFBFBD><C7B7><EFBFBD>ARM Cacheס
|
||||
<20><><EFBFBD><EFBFBD>GPU<50><55>ʹ<EFBFBD>õ<EFBFBD>memory<72>Ƿ<EFBFBD><C7B7><EFBFBD>ARM Cache<EFBFBD><EFBFBD>WriteCombineס
|
||||
1: Cached
|
||||
2: WriteCombine
|
||||
|
||||
*/
|
||||
#define gcdENABLE_MEM_CACHE 1
|
||||
#define gcdENABLE_MEM_CACHE 2
|
||||
|
||||
#endif /* __gc_hal_options_h_ */
|
||||
|
||||
|
||||
@@ -466,7 +466,11 @@ static int drv_mmap(struct file * filp, struct vm_area_struct * vma)
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
#if !gcdENABLE_MEM_CACHE
|
||||
#if (2==gcdENABLE_MEM_CACHE)
|
||||
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
|
||||
#elif (1==gcdENABLE_MEM_CACHE)
|
||||
// NULL
|
||||
#else
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
#endif
|
||||
vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND;
|
||||
|
||||
22
drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_os.c
Executable file → Normal file
22
drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_os.c
Executable file → Normal file
@@ -1023,7 +1023,11 @@ gckOS_MapMemory(
|
||||
}
|
||||
#else
|
||||
|
||||
#if !gcdENABLE_MEM_CACHE
|
||||
#if (2==gcdENABLE_MEM_CACHE)
|
||||
mdlMap->vma->vm_page_prot = pgprot_writecombine(mdlMap->vma->vm_page_prot);
|
||||
#elif (1==gcdENABLE_MEM_CACHE)
|
||||
// NULL
|
||||
#else
|
||||
mdlMap->vma->vm_page_prot = pgprot_noncached(mdlMap->vma->vm_page_prot);
|
||||
#endif
|
||||
mdlMap->vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED;
|
||||
@@ -1394,7 +1398,11 @@ gckOS_AllocateNonPagedMemory(
|
||||
}
|
||||
#else
|
||||
|
||||
#if !gcdENABLE_MEM_CACHE
|
||||
#if (2==gcdENABLE_MEM_CACHE)
|
||||
mdlMap->vma->vm_page_prot = pgprot_writecombine(mdlMap->vma->vm_page_prot);
|
||||
#elif (1==gcdENABLE_MEM_CACHE)
|
||||
// NULL
|
||||
#else
|
||||
mdlMap->vma->vm_page_prot = pgprot_noncached(mdlMap->vma->vm_page_prot);
|
||||
#endif
|
||||
mdlMap->vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED;
|
||||
@@ -3014,7 +3022,11 @@ gceSTATUS gckOS_LockPages(
|
||||
|
||||
mdlMap->vma->vm_flags |= VM_RESERVED;
|
||||
/* Make this mapping non-cached. */
|
||||
#if !gcdENABLE_MEM_CACHE
|
||||
#if (2==gcdENABLE_MEM_CACHE)
|
||||
mdlMap->vma->vm_page_prot = pgprot_writecombine(mdlMap->vma->vm_page_prot);
|
||||
#elif (1==gcdENABLE_MEM_CACHE)
|
||||
// NULL
|
||||
#else
|
||||
mdlMap->vma->vm_page_prot = pgprot_noncached(mdlMap->vma->vm_page_prot);
|
||||
#endif
|
||||
|
||||
@@ -5403,7 +5415,7 @@ gckOS_CacheFlush(
|
||||
IN gctSIZE_T Bytes
|
||||
)
|
||||
{
|
||||
#if gcdENABLE_MEM_CACHE
|
||||
#if (1==gcdENABLE_MEM_CACHE)
|
||||
dmac_clean_range(Logical, Logical+Bytes);
|
||||
#endif
|
||||
return gcvSTATUS_OK;
|
||||
@@ -5439,7 +5451,7 @@ gckOS_CacheInvalidate(
|
||||
IN gctSIZE_T Bytes
|
||||
)
|
||||
{
|
||||
#if gcdENABLE_MEM_CACHE
|
||||
#if (1==gcdENABLE_MEM_CACHE)
|
||||
dmac_flush_range(Logical, Logical+Bytes);
|
||||
#endif
|
||||
return gcvSTATUS_OK;
|
||||
|
||||
Reference in New Issue
Block a user