diff options
author | Edgardo Handal <ehandal@nvidia.com> | 2014-07-31 17:59:16 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:10:43 -0400 |
commit | 8bd11ae3b0981480021e20221a4abd33c1253716 (patch) | |
tree | 0546fffa715119a3af2913f2a398a0c19e6dacbf | |
parent | cf69b50f960f4392dac6d2c169494ce7c8074ac6 (diff) |
gpu: nvgpu: fix compbit_store page allocation
Allocate enough pages in the case that compbit_backing_size is not a
power of two.
Change-Id: Iaa2da66a3d1bd86ac746ed619a7f37e9379904db
Signed-off-by: Edgardo Handal <ehandal@nvidia.com>
Reviewed-on: http://git-master/r/449460
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ltc_common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ltc_common.c b/drivers/gpu/nvgpu/gk20a/ltc_common.c index 55e822f6..2d611d48 100644 --- a/drivers/gpu/nvgpu/gk20a/ltc_common.c +++ b/drivers/gpu/nvgpu/gk20a/ltc_common.c | |||
@@ -136,12 +136,12 @@ static int gk20a_ltc_alloc_phys_cbc(struct gk20a *g, | |||
136 | size_t compbit_backing_size) | 136 | size_t compbit_backing_size) |
137 | { | 137 | { |
138 | struct gr_gk20a *gr = &g->gr; | 138 | struct gr_gk20a *gr = &g->gr; |
139 | int order = ffs(compbit_backing_size >> PAGE_SHIFT); | 139 | int order = order_base_2(compbit_backing_size >> PAGE_SHIFT); |
140 | struct page *pages; | 140 | struct page *pages; |
141 | struct sg_table *sgt; | 141 | struct sg_table *sgt; |
142 | int err = 0; | 142 | int err = 0; |
143 | 143 | ||
144 | /* allocate few pages */ | 144 | /* allocate pages */ |
145 | pages = alloc_pages(GFP_KERNEL, order); | 145 | pages = alloc_pages(GFP_KERNEL, order); |
146 | if (!pages) { | 146 | if (!pages) { |
147 | gk20a_dbg(gpu_dbg_pte, "alloc_pages failed\n"); | 147 | gk20a_dbg(gpu_dbg_pte, "alloc_pages failed\n"); |