gpu: nvgpu: Reconfigure instance block with syncpt

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
Reviewed-on: http://git-master/r/737526
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Tested-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
This commit is contained in:
Terje Bergstrom
2015-02-23 20:51:18 -08:00
committed by Alexander Van Brunt
parent 6e1dfd0131
commit 9bbffa11de
4 changed files with 27 additions and 1 deletions

View 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);
@@ -1547,6 +1551,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;
}
/*

View File

@@ -271,6 +271,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 =
@@ -306,6 +313,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;
@@ -587,6 +595,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 =
@@ -645,6 +658,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

View 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;

View 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,