diff options
author | vdumpa <vdumpa@nvidia.com> | 2011-01-31 16:54:49 -0800 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-03-16 09:48:58 -0800 |
commit | 53a0bb517d6e14d8cee3a9ee71405da56e8ce8c9 (patch) | |
tree | eaf6936d5982cfdd6141ee0c4f6589ae0ccb971f /drivers | |
parent | 8d8e4e29c22414acc5cd4dce405a3ad3a55cf307 (diff) |
video:tegra:nvmap: Allow mapping uc/wc memory as wb.
Bug 786016
Change-Id: Ic72c57b710a305851dfea3dda3eb217156683b39
Reviewed-on: http://git-master/r/17795
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_ioctl.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_ioctl.c b/drivers/video/tegra/nvmap/nvmap_ioctl.c index 886f0ee252ad..fb8c5ff00bdd 100644 --- a/drivers/video/tegra/nvmap/nvmap_ioctl.c +++ b/drivers/video/tegra/nvmap/nvmap_ioctl.c @@ -292,6 +292,18 @@ int nvmap_map_into_caller_ptr(struct file *filp, void __user *arg) vpriv->handle = h; vpriv->offs = op.offset; + if (op.flags == NVMAP_HANDLE_INNER_CACHEABLE) { + if (h->orig_size & ~PAGE_MASK) { + pr_err("\n%s:attempt to convert a buffer from uc/wc to" + " wb, whose size is not a multiple of page size." + " request ignored.\n", __func__); + } else { + wmb(); + /* override allocation time cache coherency attributes. */ + h->flags &= (~NVMAP_HANDLE_CACHEABLE); + h->flags |= NVMAP_HANDLE_INNER_CACHEABLE; + } + } vma->vm_page_prot = nvmap_pgprot(h, vma->vm_page_prot); out: |