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:
Shengqin.Zhang
2015-05-25 15:30:20 +08:00
parent 9b27f65bf6
commit bfecf47813

View File

@@ -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;
}