#include "rga_mmu_info.h"\r
#include "RGA_API.h"\r
\r
-//#include "bug_320x240_swap0_ABGR8888.h"\r
-\r
\r
#define RGA_TEST 0\r
#define RGA_TEST_TIME 0\r
static void rga_try_set_reg(uint32_t num)\r
{\r
unsigned long flag;\r
+ uint32_t offset;\r
\r
- // first get reg from reg list\r
-\r
if (!num)\r
{\r
#if RGA_TEST \r
do\r
{ \r
struct rga_reg *reg = list_entry(rga_service.waiting.next, struct rga_reg, status_link);\r
+ offset = atomic_read(&rga_service.cmd_num);\r
if((rga_read(RGA_STATUS) & 0x1)) \r
{ \r
#if RGA_TEST\r
#endif\r
\r
if((atomic_read(&rga_service.cmd_num) <= 0xf) && (atomic_read(&rga_service.int_disable) == 0)) \r
- {\r
- uint32_t offset;\r
-\r
- offset = atomic_read(&rga_service.cmd_num);\r
+ { \r
rga_copy_reg(reg, offset); \r
rga_reg_from_wait_to_run(reg);\r
\r
{\r
/* check value if legal */ \r
ret = rga_check_param(req);\r
- if(ret == -EINVAL) \r
- {\r
+ if(ret == -EINVAL) {\r
return -EFAULT;\r
}\r
\r
reg = rga_reg_init(session, req);\r
- if(reg == NULL) \r
- { \r
+ if(reg == NULL) { \r
return -EFAULT;\r
}\r
num = 1; \r
rga_end = ktime_sub(rga_end, rga_start);\r
printk("one cmd end time %d\n", (int)ktime_to_us(rga_end));\r
#endif\r
+\r
+ return 0;\r
}\r
while(0);\r
\r
uint32_t i;\r
uint32_t status;\r
uint32_t Address;\r
+ uint32_t t_mem;\r
status = 0;\r
\r
do\r
\r
for(i=0; i<pageCount; i++)\r
{\r
- vma = find_vma(current->mm, (Memory + i) << PAGE_SHIFT);\r
+ t_mem = Memory + i;\r
+ \r
+ vma = find_vma(current->mm, (t_mem) << PAGE_SHIFT);\r
\r
if (vma && (vma->vm_flags & VM_PFNMAP) )\r
{\r
{\r
pte_t * pte;\r
spinlock_t * ptl;\r
- unsigned long pfn;\r
+ unsigned long pfn; \r
\r
- pgd_t * pgd = pgd_offset(current->mm, ((Memory + i)<< PAGE_SHIFT));\r
- pud_t * pud = pud_offset(pgd, ((Memory + i) << PAGE_SHIFT));\r
+ pgd_t * pgd = pgd_offset(current->mm, ((t_mem)<< PAGE_SHIFT));\r
+ pud_t * pud = pud_offset(pgd, ((t_mem) << PAGE_SHIFT));\r
if (pud)\r
{\r
- pmd_t * pmd = pmd_offset(pud, ((Memory + i) << PAGE_SHIFT));\r
+ pmd_t * pmd = pmd_offset(pud, ((t_mem) << PAGE_SHIFT));\r
if (pmd)\r
{\r
- pte = pte_offset_map_lock(current->mm, pmd, ((Memory + i)<< PAGE_SHIFT), &ptl);\r
+ pte = pte_offset_map_lock(current->mm, pmd, ((t_mem)<< PAGE_SHIFT), &ptl);\r
if (!pte)\r
{\r
break;\r
}\r
\r
pfn = pte_pfn(*pte);\r
- Address = ((pfn << PAGE_SHIFT) | (((unsigned long)((Memory + i) << PAGE_SHIFT)) & ~PAGE_MASK)); \r
+ Address = ((pfn << PAGE_SHIFT) | (((unsigned long)((t_mem) << PAGE_SHIFT)) & ~PAGE_MASK)); \r
pte_unmap_unlock(pte, ptl);\r
\r
#if 0\r
{ \r
/* cal src buf mmu info */ \r
SrcMemSize = rga_buf_size_cal(req->src.yrgb_addr, req->src.uv_addr, req->src.v_addr,\r
- req->src.format, req->src.vir_w, req->src.vir_h,\r
+ req->src.format, req->src.vir_w, (req->src.act_h + req->src.y_offset),\r
&SrcStart);\r
if(SrcMemSize == 0) {\r
return -EINVAL; \r