From 9b00f352423d4bd90d10cf598e6ce8a750cdd869 Mon Sep 17 00:00:00 2001 From: Arto Merilainen Date: Mon, 21 Jul 2014 10:16:24 +0300 Subject: gpu: nvgpu: Allow reloading the golden context In cases where a kernel channel dies, we can reload the context by just reloading the golden context buffer. This patch makes necessary infrastructural changes to support this behaviour. Bug 1409151 Change-Id: Ibe6a88bf7acea2d3aced2b86a7a687279075c386 Signed-off-by: Arto Merilainen Reviewed-on: http://git-master/r/440262 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Lauri Peltonen GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 6 ++---- drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index b06ed9e6..e783f8d0 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -76,8 +76,6 @@ static void gr_gk20a_free_channel_patch_ctx(struct channel_gk20a *c); /* golden ctx image */ static int gr_gk20a_init_golden_ctx_image(struct gk20a *g, struct channel_gk20a *c); -static int gr_gk20a_load_golden_ctx_image(struct gk20a *g, - struct channel_gk20a *c); void gk20a_fecs_dump_falcon_stats(struct gk20a *g) { @@ -1656,7 +1654,7 @@ int gr_gk20a_update_smpc_ctxsw_mode(struct gk20a *g, } /* load saved fresh copy of gloden image into channel gr_ctx */ -static int gr_gk20a_load_golden_ctx_image(struct gk20a *g, +int gr_gk20a_load_golden_ctx_image(struct gk20a *g, struct channel_gk20a *c) { struct gr_gk20a *gr = &g->gr; @@ -2786,7 +2784,7 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c, gk20a_dbg_fn(""); /* an address space needs to have been bound at this point.*/ - if (!gk20a_channel_as_bound(c)) { + if (!gk20a_channel_as_bound(c) && !c->vm) { gk20a_err(dev_from_gk20a(g), "not bound to address space at time" " of grctx allocation"); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 3376747b..dadcbca2 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -316,6 +316,8 @@ struct gk20a_ctxsw_bootloader_desc { }; struct gpu_ops; +int gr_gk20a_load_golden_ctx_image(struct gk20a *g, + struct channel_gk20a *c); void gk20a_init_gr(struct gk20a *g); void gk20a_init_gr_ops(struct gpu_ops *gops); int gk20a_init_gr_support(struct gk20a *g); -- cgit v1.2.2