]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: gk20a: allow syncpt free at channel_unbind()
authorDeepak Nibade <dnibade@nvidia.com>
Fri, 11 Apr 2014 09:52:58 +0000 (15:22 +0530)
committerSeema Khowala <seemaj@nvidia.com>
Wed, 23 Apr 2014 21:05:08 +0000 (14:05 -0700)
Add infrastructure to allow freeing gpu channels' syncpts at
channel_unbind()

Currently, we free the syncpt at channel_free() only.
But we can free the syncpt when channel becomes idle.

When we do channel_unbind(), channel cannot be scheduled and
hence we can destroy its syncpt.
Channel will request again for new syncpt when it has new work
to do.

This feature will be enabled with boolean flag
syncpt_aggressive_destroy

Bug 1305024

Change-Id: Ib498e2c371e36ffc1430d4f95f2780b4c587e43e
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/395153
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/gpu/nvgpu/gk20a/channel_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h

index b4c1fff2415b40a60011b28f964b3467011c7633..90b7489cb8dd6923cf8f07a8b49f7d5562e5d239 100644 (file)
@@ -351,6 +351,16 @@ static void channel_gk20a_unbind(struct channel_gk20a *ch_gk20a)
                        ccsr_channel_inst_bind_false_f());
 
        ch_gk20a->bound = false;
+
+       /*
+        * if we are agrressive then we can destroy the syncpt
+        * resource at this point
+        * if not, then it will be destroyed at channel_free()
+        */
+       if (ch_gk20a->sync && ch_gk20a->sync->syncpt_aggressive_destroy) {
+               ch_gk20a->sync->destroy(ch_gk20a->sync);
+               ch_gk20a->sync = NULL;
+       }
 }
 
 static int channel_gk20a_alloc_inst(struct gk20a *g,
index 69feb89f0c3ed5c6efe9aa76de1c3b9de423bb5d..80f38b2660892d26bd3d881d42cfb720c9ff4797 100644 (file)
@@ -94,6 +94,9 @@ struct gk20a_channel_sync {
        /* Reset the channel syncpoint/semaphore. */
        void (*set_min_eq_max)(struct gk20a_channel_sync *s);
 
+       /* flag to set syncpt destroy aggressiveness */
+       bool syncpt_aggressive_destroy;
+
        /* Free the resources allocated by gk20a_channel_sync_create. */
        void (*destroy)(struct gk20a_channel_sync *s);
 };