]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: Reconfigure instance block with syncpt
authorTerje Bergstrom <tbergstrom@nvidia.com>
Tue, 24 Feb 2015 04:51:18 +0000 (20:51 -0800)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Wed, 29 Apr 2015 17:25:47 +0000 (10:25 -0700)
Resetup RAMFC once sync point id is allocated for a channel.

Change-Id: Idbac406bea1c94c89ef587dda08fddc740c1fadb
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/711302

drivers/gpu/nvgpu/gk20a/channel_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
drivers/gpu/nvgpu/gk20a/gk20a.h

index 2eb2e2a4e70028d1b6733a340a185ce3edd62594..ab0f0b8cd7e06e809ef8330b69f328014de7a5fe 100644 (file)
@@ -1233,7 +1233,7 @@ static int gk20a_channel_submit_wfi(struct channel_gk20a *c)
        struct priv_cmd_entry *cmd = NULL;
        struct gk20a *g = c->g;
        u32 free_count;
-       int err;
+       int err = 0;
 
        if (c->has_timedout)
                return -ETIMEDOUT;
@@ -1254,6 +1254,10 @@ static int gk20a_channel_submit_wfi(struct channel_gk20a *c)
                        mutex_unlock(&c->submit_lock);
                        return -ENOMEM;
                }
+               if (g->ops.fifo.resetup_ramfc)
+                       err = g->ops.fifo.resetup_ramfc(c);
+               if (err)
+                       return err;
        }
 
        gk20a_fence_put(c->last_submit.pre_fence);
@@ -1548,6 +1552,10 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
                        mutex_unlock(&c->submit_lock);
                        goto clean_up;
                }
+               if (g->ops.fifo.resetup_ramfc)
+                       err = g->ops.fifo.resetup_ramfc(c);
+               if (err)
+                       return err;
        }
 
        /*
index cff697f15272d2982163fbbf1738077928ddd49e..3a0b9e4a14a7c84995e0f7ab9dc5a6f7e4874486 100644 (file)
@@ -270,6 +270,13 @@ static void gk20a_channel_syncpt_signal_timeline(
        /* Nothing to do. */
 }
 
+static int gk20a_channel_syncpt_id(struct gk20a_channel_sync *s)
+{
+       struct gk20a_channel_syncpt *sp =
+               container_of(s, struct gk20a_channel_syncpt, ops);
+       return sp->id;
+}
+
 static void gk20a_channel_syncpt_destroy(struct gk20a_channel_sync *s)
 {
        struct gk20a_channel_syncpt *sp =
@@ -305,6 +312,7 @@ gk20a_channel_syncpt_create(struct channel_gk20a *c)
        sp->ops.incr_user               = gk20a_channel_syncpt_incr_user;
        sp->ops.set_min_eq_max          = gk20a_channel_syncpt_set_min_eq_max;
        sp->ops.signal_timeline         = gk20a_channel_syncpt_signal_timeline;
+       sp->ops.syncpt_id               = gk20a_channel_syncpt_id;
        sp->ops.destroy                 = gk20a_channel_syncpt_destroy;
 
        sp->ops.aggressive_destroy      = true;
@@ -586,6 +594,11 @@ static void gk20a_channel_semaphore_signal_timeline(
        gk20a_sync_timeline_signal(sp->timeline);
 }
 
+static int gk20a_channel_semaphore_syncpt_id(struct gk20a_channel_sync *s)
+{
+       return -EINVAL;
+}
+
 static void gk20a_channel_semaphore_destroy(struct gk20a_channel_sync *s)
 {
        struct gk20a_channel_semaphore *sema =
@@ -644,6 +657,7 @@ gk20a_channel_semaphore_create(struct channel_gk20a *c)
        sema->ops.incr_user     = gk20a_channel_semaphore_incr_user;
        sema->ops.set_min_eq_max = gk20a_channel_semaphore_set_min_eq_max;
        sema->ops.signal_timeline = gk20a_channel_semaphore_signal_timeline;
+       sema->ops.syncpt_id     = gk20a_channel_semaphore_syncpt_id;
        sema->ops.destroy       = gk20a_channel_semaphore_destroy;
 
        /* Aggressively destroying the semaphore sync would cause overhead
index a3cd82081dadba2d5c324d6c558b9923af3f959f..a347cbab68f295ff31ad4397d13fd9f0b5c20cd3 100644 (file)
@@ -86,6 +86,9 @@ struct gk20a_channel_sync {
         * expired. */
        void (*signal_timeline)(struct gk20a_channel_sync *s);
 
+       /* Returns the sync point id or negative number if no syncpt*/
+       int (*syncpt_id)(struct gk20a_channel_sync *s);
+
        /* flag to set sync destroy aggressiveness */
        bool aggressive_destroy;
 
index e16cee2ab4d518758a9860d1dd2d1f6895577eab..c310d73c9eb2cbd04283a067abdc310a4d89e969 100644 (file)
@@ -217,6 +217,7 @@ struct gpu_ops {
                void (*free_inst)(struct gk20a *g, struct channel_gk20a *ch);
                int (*setup_ramfc)(struct channel_gk20a *c, u64 gpfifo_base,
                                u32 gpfifo_entries);
+               int (*resetup_ramfc)(struct channel_gk20a *c);
                int (*preempt_channel)(struct gk20a *g, u32 hw_chid);
                int (*update_runlist)(struct gk20a *g, u32 runlist_id,
                                u32 hw_chid, bool add,