diff options
author | Youngjin Kim <nkim@nvidia.com> | 2010-12-09 15:20:10 +0900 |
---|---|---|
committer | Niket Sirsi <nsirsi@nvidia.com> | 2010-12-13 19:34:15 -0800 |
commit | a16216bd61a6200bef7f1bb3852c749eac6c4688 (patch) | |
tree | 1ef6511a2bb6eb930bdd0fceacf802ffed705dbf /drivers | |
parent | 5cea6270cdac231fe9efbbd898bf8883418d65dd (diff) |
Revert "video: tegra: nvmap: Clean whole L1 instead of VA cleaning"
This reverts commit 6469f378a596f0572035cd27a17851ea86b763c9.
Bug 758628
Bug 748669
Original commit attmpted to have a smarter cache cleaning code.
But that work didn't work out well and just resulted in display
corruption.
Reviewed-on: http://git-master/r/11817
(cherry picked from commit 60207394cc16689f06ccbac993eefd2928565031)
Change-Id: I92bd95154f372eb0a081a4c3919b87d576ea4cb5
Reviewed-on: http://git-master/r/12449
Reviewed-by: Youngjin Kim <nkim@nvidia.com>
Tested-by: Youngjin Kim <nkim@nvidia.com>
Reviewed-by: Markus Holtmanns <mholtmanns@nvidia.com>
Tested-by: Markus Holtmanns <mholtmanns@nvidia.com>
Reviewed-by: Niket Sirsi <nsirsi@nvidia.com>
Tested-by: Niket Sirsi <nsirsi@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/nvmap.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/video/tegra/nvmap.c b/drivers/video/tegra/nvmap.c index ce0da9904afe..f260e1cb9573 100644 --- a/drivers/video/tegra/nvmap.c +++ b/drivers/video/tegra/nvmap.c @@ -149,9 +149,6 @@ static struct rb_root nvmap_handles = RB_ROOT; static struct tegra_iovmm_client *nvmap_vm_client = NULL; -extern void v7_flush_kern_cache_all(void); -extern void v7_clean_kern_cache_all(void); - /* default heap order policy */ static unsigned int _nvmap_heap_policy (unsigned int heaps, int numpages) { @@ -2834,16 +2831,6 @@ static int _nvmap_do_cache_maint(struct nvmap_handle *h, outer_maint = NULL; } - if (end - start > PAGE_SIZE * 3) { - if (op == NVMEM_CACHE_OP_WB) { - v7_clean_kern_cache_all(); - inner_maint = NULL; - } else if (op == NVMEM_CACHE_OP_WB_INV) { - v7_flush_kern_cache_all(); - inner_maint = NULL; - } - } - prot = _nvmap_flag_to_pgprot(h->flags, pgprot_kernel); if (h->alloc && !h->heap_pgalloc) { @@ -2852,7 +2839,7 @@ static int _nvmap_do_cache_maint(struct nvmap_handle *h, spin_unlock(&h->carveout.co_heap->lock); } - while (start < end && (inner_maint || outer_maint)) { + while (start < end) { struct page *page = NULL; unsigned long phys; void *src; @@ -2881,7 +2868,7 @@ static int _nvmap_do_cache_maint(struct nvmap_handle *h, src = addr + (phys & ~PAGE_MASK); count = min_t(size_t, end-start, PAGE_SIZE-(phys&~PAGE_MASK)); - if (inner_maint) inner_maint(src, src+count); + inner_maint(src, src+count); if (outer_maint) outer_maint(phys, phys+count); start += count; if (page) put_page(page); @@ -3026,12 +3013,19 @@ static ssize_t _nvmap_do_rw_handle(struct nvmap_handle *h, int is_read, } while (count--) { - size_t ret = _nvmap_do_one_rw_handle(h, is_read, + size_t ret; + if (is_read) + _nvmap_do_cache_maint(h, h_offs, h_offs + elem_size, + NVMEM_CACHE_OP_INV, false); + ret = _nvmap_do_one_rw_handle(h, is_read, is_user, h_offs, sys_addr, elem_size, &addr); if (ret < 0) { if (!bytes_copied) bytes_copied = ret; break; } + if (!is_read) + _nvmap_do_cache_maint(h, h_offs, h_offs + ret, + NVMEM_CACHE_OP_WB, false); bytes_copied += ret; if (ret < elem_size) break; sys_addr += sys_stride; |