loongson2f: add video acceleration support
cover loongson2f: add video acceleration support
This patchset add video acceleration support for loongson2f family machines via uncached accelerated TLB mapping.
We add a new option CPU_SUPPORT_VIDEO_ACC for loongson2f and it's successors, so all of them can share this souce code via selecting this option.
Thanks!
Wu Zhangjin
Wu Zhangjin (2):
[loongson] 2f: Add CPU_SUPPORT_VIDEO_ACC
[loongson] 2f: Improve video performance via uncached accelerated TLB
map
arch/mips/Kconfig | 4 +++ arch/mips/include/asm/pgtable.h | 13 +++++++++ arch/mips/loongson/common/mem.c | 58 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 0 deletions(-)
PATCH 1/2 2f: Add CPU_SUPPORT_VIDEO_ACC
Loongson2f support video acceleration.
--- arch/mips/Kconfig | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
arch/mips/Kconfig +4 -0
@@ -1318,6 +1318,9 @@ config CPU_LOONGSON2 config SYS_HAS_CPU_LOONGSON2E bool +config CPU_SUPPORT_VIDEO_ACC + bool + config CPU_SUPPORT_CPUFREQ bool
@@ -1328,6 +1331,7 @@ config SYS_HAS_CPU_LOONGSON2F bool select CPU_SUPPORT_CPUFREQ select CPU_SUPPORT_ADDRWINCFG if 64BIT + select CPU_SUPPORT_VIDEO_ACC config SYS_HAS_CPU_MIPS32_R1 bool
Signature · 1 line
1.6.2.1
PATCH 2/2 2f: Improve video performance via uncached accelerated TLB map
Loongson2F support video acceleration, and need to enable Uncached Accelerated TLB map.
Uncached Accelerated TLB map can greatly improve video performance. Normally the Video memory can be accessed in Uncached Accelerated mode, other peripheral spaces not.
--- arch/mips/include/asm/pgtable.h | 13 +++++++++ arch/mips/loongson/common/mem.c | 58 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 0 deletions(-)
arch/mips/include/asm/pgtable.h +13 -0
@@ -390,6 +390,19 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma,#include <asm-generic/pgtable.h> /* +* uncached accelerated TLB map for video memory access +*/ +#ifdef CONFIG_CPU_SUPPORT_VIDEO_ACC +#define __HAVE_PHYS_MEM_ACCESS_PROT + +struct file ; +pgprot_t phys_mem_access_prot (struct file *file,unsigned long pfn, +unsigned long size,pgprot_t vma_prot); +int phys_mem_access_prot_allowed (struct file *file,unsigned long pfn, +unsigned long size,pgprot_t *vma_prot); +#endif + +/* * We provide our own get_unmapped area to cope with the virtual aliasing * constraints placed on us by the cache architecture. */
arch/mips/loongson/common/mem.c +58 -0
61 lines not on this page · raw message
Signature · 1 line
1.6.2.1