forked from rubenslte/android_kernel_samsung_msm8226
msm: kgsl: don't clear gpuaddr when unmapping global mappings
Memory mapped through kgsl_mmu_map_global() is supposed to have the same gpu address in all pagetables. And the memdesc will persist beyond the lifetime of any single pagetable. Therefore, memdesc->gpuaddr should not be zeroed for these memdescs. Change-Id: I0f46aaee2b9e87f839e78b7978cdf1bb4239d6f5 Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
This commit is contained in:
@@ -605,7 +605,12 @@ kgsl_mmu_unmap(struct kgsl_pagetable *pagetable,
|
||||
memdesc->gpuaddr & KGSL_MMU_ALIGN_MASK,
|
||||
memdesc->size);
|
||||
|
||||
memdesc->gpuaddr = 0;
|
||||
/*
|
||||
* Don't clear the gpuaddr on global mappings because they
|
||||
* may be in use by other pagetables
|
||||
*/
|
||||
if (!(memdesc->priv & KGSL_MEMFLAGS_GLOBAL))
|
||||
memdesc->gpuaddr = 0;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(kgsl_mmu_unmap);
|
||||
@@ -637,6 +642,7 @@ int kgsl_mmu_map_global(struct kgsl_pagetable *pagetable,
|
||||
gpuaddr, memdesc->gpuaddr);
|
||||
goto error_unmap;
|
||||
}
|
||||
memdesc->priv |= KGSL_MEMFLAGS_GLOBAL;
|
||||
return result;
|
||||
error_unmap:
|
||||
kgsl_mmu_unmap(pagetable, memdesc);
|
||||
|
||||
@@ -29,6 +29,8 @@ struct kgsl_process_private;
|
||||
|
||||
/** Set if the memdesc describes cached memory */
|
||||
#define KGSL_MEMFLAGS_CACHED 0x00000001
|
||||
/** Set if the memdesc is mapped into all pagetables */
|
||||
#define KGSL_MEMFLAGS_GLOBAL 0x00000002
|
||||
|
||||
struct kgsl_memdesc_ops {
|
||||
int (*vmflags)(struct kgsl_memdesc *);
|
||||
|
||||
Reference in New Issue
Block a user