summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 57c1c0bc..700dcdf8 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -3044,36 +3044,6 @@ out:
3044 return err; 3044 return err;
3045} 3045}
3046 3046
3047int gk20a_comptag_allocator_init(struct gk20a_comptag_allocator *allocator,
3048 unsigned long size)
3049{
3050 nvgpu_mutex_init(&allocator->lock);
3051 /*
3052 * 0th comptag is special and is never used. The base for this bitmap
3053 * is 1, and its size is one less than the size of comptag store.
3054 */
3055 size--;
3056 allocator->bitmap = vzalloc(BITS_TO_LONGS(size) * sizeof(long));
3057 if (!allocator->bitmap)
3058 return -ENOMEM;
3059 allocator->size = size;
3060 return 0;
3061}
3062
3063void gk20a_comptag_allocator_destroy(struct gk20a_comptag_allocator *allocator)
3064{
3065 struct gr_gk20a *gr = container_of(allocator,
3066 struct gr_gk20a, comp_tags);
3067
3068 /*
3069 * called only when exiting the driver (gk20a_remove, or unwinding the
3070 * init stage); no users should be active, so taking the mutex is
3071 * unnecessary here.
3072 */
3073 allocator->size = 0;
3074 nvgpu_vfree(gr->g, allocator->bitmap);
3075}
3076
3077static void gk20a_remove_gr_support(struct gr_gk20a *gr) 3047static void gk20a_remove_gr_support(struct gr_gk20a *gr)
3078{ 3048{
3079 struct gk20a *g = gr->g; 3049 struct gk20a *g = gr->g;
@@ -3148,7 +3118,7 @@ static void gk20a_remove_gr_support(struct gr_gk20a *gr)
3148 nvgpu_big_free(g, gr->ctx_vars.hwpm_ctxsw_buffer_offset_map); 3118 nvgpu_big_free(g, gr->ctx_vars.hwpm_ctxsw_buffer_offset_map);
3149 gr->ctx_vars.hwpm_ctxsw_buffer_offset_map = NULL; 3119 gr->ctx_vars.hwpm_ctxsw_buffer_offset_map = NULL;
3150 3120
3151 gk20a_comptag_allocator_destroy(&gr->comp_tags); 3121 gk20a_comptag_allocator_destroy(g, &gr->comp_tags);
3152} 3122}
3153 3123
3154static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) 3124static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr)