summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2015-12-01 04:55:27 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-01-19 20:44:27 -0500
commitdb7095ce5180552d1a70fdea779e5987d55cce7b (patch)
tree35b9125f86efbfca657910f33a49b1c08ddc6acc /drivers/gpu/nvgpu/gk20a/gr_gk20a.h
parent7095a72e563b5d7969c5f09053e469906362428f (diff)
gpu: nvgpu: bitmap allocator for comptags
Restore comptags to be bitmap-allocated, like they were before we had the buddy allocator. The new buddy allocator introduced by e99aa2485f8992eabe3556f3ebcb57bdc8ad91ff (originally 6ab2e0c49cb79ca68d2f83f1d4610783d2eaa79b) is fine for the big VAs, but unsuitable for the small compbit store. This commit reverts partially the combination of the above commit and also one after it, 86fc7ec9a05999bea8de320840b962db3ee11410, that fixed a bug which is not present when using a bitmap. With a bitmap allocator, pruning the extra allocation necessary for user-mapped mode is possible, so that is also restored. The original generic bitmap allocator is not restored; instead, a comptag-only allocator is introduced. Bug 200145635 Change-Id: I87f3a911826a801124cfd21e44857dfab1c3f378 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/837180 (cherry picked from commit 5a504aeb54f3e89e6561932971158a397157b3f2) Reviewed-on: http://git-master/r/839742 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
index 94d7c811..c7100182 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
@@ -281,7 +281,13 @@ struct gr_gk20a {
281 281
282 u32 max_comptag_mem; /* max memory size (MB) for comptag */ 282 u32 max_comptag_mem; /* max memory size (MB) for comptag */
283 struct compbit_store_desc compbit_store; 283 struct compbit_store_desc compbit_store;
284 struct gk20a_allocator comp_tags; 284 struct gk20a_comptag_allocator {
285 struct mutex lock;
286 /* this bitmap starts at ctag 1. 0th cannot be taken */
287 unsigned long *bitmap;
288 /* size of bitmap, not max ctags, so one less */
289 unsigned long size;
290 } comp_tags;
285 291
286 struct gr_zcull_gk20a zcull; 292 struct gr_zcull_gk20a zcull;
287 293
@@ -400,6 +406,10 @@ int gk20a_init_gr_support(struct gk20a *g);
400int gk20a_enable_gr_hw(struct gk20a *g); 406int gk20a_enable_gr_hw(struct gk20a *g);
401int gk20a_gr_reset(struct gk20a *g); 407int gk20a_gr_reset(struct gk20a *g);
402void gk20a_gr_wait_initialized(struct gk20a *g); 408void gk20a_gr_wait_initialized(struct gk20a *g);
409/* real size here, but first (ctag 0) isn't used */
410int gk20a_comptag_allocator_init(struct gk20a_comptag_allocator *allocator,
411 unsigned long size);
412void gk20a_comptag_allocator_destroy(struct gk20a_comptag_allocator *allocator);
403 413
404int gk20a_init_gr_channel(struct channel_gk20a *ch_gk20a); 414int gk20a_init_gr_channel(struct channel_gk20a *ch_gk20a);
405 415