mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
fix rga mmu buf cause system crash when use ion mmu buf
Signed-off-by: Shengqin.Zhang <zsq@rock-chips.com>
This commit is contained in:
@@ -358,6 +358,7 @@ static int rga2_MapION(struct sg_table *sg,
|
||||
uint32_t len;
|
||||
struct scatterlist *sgl = sg->sgl;
|
||||
uint32_t sg_num = 0;
|
||||
uint32_t break_flag = 0;
|
||||
|
||||
status = 0;
|
||||
Address = 0;
|
||||
@@ -366,9 +367,14 @@ static int rga2_MapION(struct sg_table *sg,
|
||||
Address = sg_phys(sgl);
|
||||
|
||||
for(i=0; i<len; i++) {
|
||||
if (mapped_size + i >= pageCount) {
|
||||
break_flag = 1;
|
||||
break;
|
||||
}
|
||||
Memory[mapped_size + i] = (uint32_t)(Address + (i << PAGE_SHIFT));
|
||||
}
|
||||
|
||||
if (break_flag)
|
||||
break;
|
||||
mapped_size += len;
|
||||
sg_num += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user