summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.c20
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c3
3 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
index 9067aae5..47ea8052 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
@@ -144,6 +144,26 @@ void gk20a_cde_destroy(struct gk20a *g)
144 mutex_unlock(&cde_app->mutex); 144 mutex_unlock(&cde_app->mutex);
145} 145}
146 146
147void gk20a_cde_suspend(struct gk20a *g)
148{
149
150 struct gk20a_cde_app *cde_app = &g->cde_app;
151 struct gk20a_cde_ctx *cde_ctx, *cde_ctx_save;
152
153 if (!cde_app->initialised)
154 return;
155
156 list_for_each_entry_safe(cde_ctx, cde_ctx_save,
157 &cde_app->cde_ctx_lru, list) {
158 if (cde_ctx->is_temporary) {
159 mutex_lock(&cde_app->mutex);
160 cancel_delayed_work(&cde_ctx->ctx_deleter_work);
161 mutex_unlock(&cde_app->mutex);
162 }
163 }
164
165}
166
147static int gk20a_cde_allocate_contexts(struct gk20a *g) 167static int gk20a_cde_allocate_contexts(struct gk20a *g)
148{ 168{
149 struct gk20a_cde_app *cde_app = &g->cde_app; 169 struct gk20a_cde_app *cde_app = &g->cde_app;
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.h b/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
index 4120dc94..9d7dbba6 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
@@ -262,6 +262,7 @@ struct gk20a_cde_app {
262}; 262};
263 263
264void gk20a_cde_destroy(struct gk20a *g); 264void gk20a_cde_destroy(struct gk20a *g);
265void gk20a_cde_suspend(struct gk20a *g);
265int gk20a_init_cde_support(struct gk20a *g); 266int gk20a_init_cde_support(struct gk20a *g);
266int gk20a_cde_reload(struct gk20a *g); 267int gk20a_cde_reload(struct gk20a *g);
267int gk20a_cde_convert(struct gk20a *g, struct dma_buf *dst, 268int gk20a_cde_convert(struct gk20a *g, struct dma_buf *dst,
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index c7d40fcd..ad1a940d 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -679,6 +679,9 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
679 if (ret) 679 if (ret)
680 return ret; 680 return ret;
681 681
682 /* cancel any pending cde work */
683 gk20a_cde_suspend(g);
684
682 /* 685 /*
683 * After this point, gk20a interrupts should not get 686 * After this point, gk20a interrupts should not get
684 * serviced. 687 * serviced.