]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: nvmap: force handle wide reserve operations
authorSri Krishna chowdary <schowdary@nvidia.com>
Tue, 26 Apr 2016 09:47:59 +0000 (15:17 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 22 Jun 2016 11:51:52 +0000 (04:51 -0700)
This forces all supported reserve operations to be handle wide
operations. This will allow us to remove all zap and explicit insert
we do in nvmap. This will make us align more towards upstream.

bug 200174682

Change-Id: Id4b83a7bbce9ebeda75e8efaea8d487a5868eb3c
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1141382
(cherry picked from commit effbbdccf90eb22f9fe62e850c9b575e17430101)
Reviewed-on: http://git-master/r/1168479
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
drivers/video/tegra/nvmap/nvmap_mm.c

index ea4abea00f0d57802db142b84b603c9fb4185a84..5f1b7f721d7968b3d53e29c7d675824b47b985be 100644 (file)
@@ -271,14 +271,15 @@ int nvmap_reserve_pages(struct nvmap_handle **handles, u32 *offsets, u32 *sizes,
 {
        int i;
 
-       for (i = (op == NVMAP_PAGES_ZAP_AND_CLEAN) ? nr : 0; i < nr; i++) {
+       for (i = 0; i < nr; i++) {
                u32 size = sizes[i] ? sizes[i] : handles[i]->size;
                u32 offset = sizes[i] ? offsets[i] : 0;
 
-               if ((op == NVMAP_PAGES_RESERVE) || (op == NVMAP_PAGES_UNRESERVE))
-                       if ((offset != 0) || (size != handles[i]->size))
-                               return -EINVAL;
+               if ((offset != 0) || (size != handles[i]->size))
+                       return -EINVAL;
 
+               if (op == NVMAP_PAGES_ZAP_AND_CLEAN)
+                       continue;
                /*
                 * NOTE: This unreserves the handle even when
                 * NVMAP_PAGES_INSERT_ON_UNRESERVE is called on some portion