msm: kgsl: make cffdump work with the MMU enabled
The tools that process cff dumps expect a linear
memory region, but the start address of that region can
be configured. As long as there is only a single
pagetable (so that there aren't duplicate virtual
addresses in the dump), dumps captured with the
mmu on are easier to deal with than reconfiguring
to turn the mmu off.
Change-Id: If4070e60de50387dd12454b98e982b6713eeac42
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl_cffdump.c b/drivers/gpu/msm/kgsl_cffdump.c
index aa33152..437d6f5 100644
--- a/drivers/gpu/msm/kgsl_cffdump.c
+++ b/drivers/gpu/msm/kgsl_cffdump.c
@@ -231,8 +231,6 @@
spin_lock(&cffdump_lock);
if (opcode == CFF_OP_WRITE_MEM) {
- if (op1 < 0x40000000 || op1 >= 0x60000000)
- KGSL_CORE_ERR("addr out-of-range: op1=%08x", op1);
if ((cff_op_write_membuf.addr != op1 &&
cff_op_write_membuf.count)
|| (cff_op_write_membuf.count == MEMBUF_SIZE))
@@ -360,15 +358,7 @@
void kgsl_cffdump_open(enum kgsl_deviceid device_id)
{
- /*TODO: move this to where we can report correct gmemsize*/
- unsigned int va_base;
-
- if (cpu_is_msm8x60() || cpu_is_msm8960() || cpu_is_msm8930())
- va_base = 0x40000000;
- else
- va_base = 0x20000000;
-
- kgsl_cffdump_memory_base(device_id, va_base,
+ kgsl_cffdump_memory_base(device_id, KGSL_PAGETABLE_BASE,
CONFIG_MSM_KGSL_PAGE_TABLE_SIZE, SZ_256K);
}
@@ -402,7 +392,6 @@
{
const void *src;
uint host_size;
- uint physaddr;
if (!kgsl_cff_dump_enable)
return;
@@ -424,7 +413,6 @@
}
BUG_ON(memdesc->gpuaddr == 0);
BUG_ON(gpuaddr == 0);
- physaddr = kgsl_get_realaddr(memdesc) + (gpuaddr - memdesc->gpuaddr);
src = kgsl_gpuaddr_to_vaddr(memdesc, gpuaddr, &host_size);
if (src == NULL || host_size < sizebytes) {
@@ -444,7 +432,6 @@
KGSL_CACHE_OP_INV);
}
- BUG_ON(physaddr > 0x66000000 && physaddr < 0x66ffffff);
while (sizebytes > 3) {
cffdump_printline(-1, CFF_OP_WRITE_MEM, gpuaddr, *(uint *)src,
0, 0, 0);
@@ -462,7 +449,6 @@
if (!kgsl_cff_dump_enable)
return;
- BUG_ON(addr > 0x66000000 && addr < 0x66ffffff);
while (sizebytes > 3) {
/* Use 32bit memory writes as long as there's at least
* 4 bytes left */
@@ -608,14 +594,9 @@
level++;
- if (!memdesc->physaddr) {
- KGSL_CORE_ERR("no physaddr");
- } else {
- mb();
- kgsl_cache_range_op((struct kgsl_memdesc *)memdesc,
+ mb();
+ kgsl_cache_range_op((struct kgsl_memdesc *)memdesc,
KGSL_CACHE_OP_INV);
- }
-
#ifdef DEBUG
pr_info("kgsl: cffdump: ib: gpuaddr:0x%08x, wc:%d, hptr:%p\n",
gpuaddr, sizedwords, hostaddr);