diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/cde.c | 18 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/cde.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/cde.c b/drivers/gpu/nvgpu/common/linux/cde.c index f6b43113..1cb531fb 100644 --- a/drivers/gpu/nvgpu/common/linux/cde.c +++ b/drivers/gpu/nvgpu/common/linux/cde.c | |||
@@ -107,6 +107,10 @@ __must_hold(&cde_app->mutex) | |||
107 | cde_ctx->backing_store_vaddr); | 107 | cde_ctx->backing_store_vaddr); |
108 | 108 | ||
109 | /* free the channel */ | 109 | /* free the channel */ |
110 | if (cde_ctx->tsg && ch) { | ||
111 | gk20a_tsg_unbind_channel(cde_ctx->ch); | ||
112 | } | ||
113 | |||
110 | gk20a_channel_close(ch); | 114 | gk20a_channel_close(ch); |
111 | 115 | ||
112 | /* housekeeping on app */ | 116 | /* housekeeping on app */ |
@@ -1266,6 +1270,7 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx) | |||
1266 | struct gk20a *g = &l->g; | 1270 | struct gk20a *g = &l->g; |
1267 | struct nvgpu_firmware *img; | 1271 | struct nvgpu_firmware *img; |
1268 | struct channel_gk20a *ch; | 1272 | struct channel_gk20a *ch; |
1273 | struct tsg_gk20a *tsg; | ||
1269 | struct gr_gk20a *gr = &g->gr; | 1274 | struct gr_gk20a *gr = &g->gr; |
1270 | int err = 0; | 1275 | int err = 0; |
1271 | u64 vaddr; | 1276 | u64 vaddr; |
@@ -1276,6 +1281,12 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx) | |||
1276 | return -ENOSYS; | 1281 | return -ENOSYS; |
1277 | } | 1282 | } |
1278 | 1283 | ||
1284 | tsg = gk20a_tsg_open(g); | ||
1285 | if (!tsg) { | ||
1286 | nvgpu_err(g, "cde: could not create TSG"); | ||
1287 | goto err_get_gk20a_channel; | ||
1288 | } | ||
1289 | |||
1279 | ch = gk20a_open_new_channel_with_cb(g, gk20a_cde_finished_ctx_cb, | 1290 | ch = gk20a_open_new_channel_with_cb(g, gk20a_cde_finished_ctx_cb, |
1280 | cde_ctx, | 1291 | cde_ctx, |
1281 | -1, | 1292 | -1, |
@@ -1293,6 +1304,12 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx) | |||
1293 | goto err_commit_va; | 1304 | goto err_commit_va; |
1294 | } | 1305 | } |
1295 | 1306 | ||
1307 | err = gk20a_tsg_bind_channel(tsg, ch); | ||
1308 | if (err) { | ||
1309 | nvgpu_err(g, "cde: unable to bind to tsg"); | ||
1310 | goto err_alloc_gpfifo; | ||
1311 | } | ||
1312 | |||
1296 | /* allocate gpfifo (1024 should be more than enough) */ | 1313 | /* allocate gpfifo (1024 should be more than enough) */ |
1297 | err = gk20a_channel_alloc_gpfifo(ch, 1024, 0, | 1314 | err = gk20a_channel_alloc_gpfifo(ch, 1024, 0, |
1298 | NVGPU_GPFIFO_FLAGS_ALLOW_BARE_CHANNEL); | 1315 | NVGPU_GPFIFO_FLAGS_ALLOW_BARE_CHANNEL); |
@@ -1317,6 +1334,7 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx) | |||
1317 | 1334 | ||
1318 | /* store initialisation data */ | 1335 | /* store initialisation data */ |
1319 | cde_ctx->ch = ch; | 1336 | cde_ctx->ch = ch; |
1337 | cde_ctx->tsg = tsg; | ||
1320 | cde_ctx->vm = ch->vm; | 1338 | cde_ctx->vm = ch->vm; |
1321 | cde_ctx->backing_store_vaddr = vaddr; | 1339 | cde_ctx->backing_store_vaddr = vaddr; |
1322 | 1340 | ||
diff --git a/drivers/gpu/nvgpu/common/linux/cde.h b/drivers/gpu/nvgpu/common/linux/cde.h index fe206401..91ea9b88 100644 --- a/drivers/gpu/nvgpu/common/linux/cde.h +++ b/drivers/gpu/nvgpu/common/linux/cde.h | |||
@@ -232,6 +232,7 @@ struct gk20a_cde_ctx { | |||
232 | 232 | ||
233 | /* channel related data */ | 233 | /* channel related data */ |
234 | struct channel_gk20a *ch; | 234 | struct channel_gk20a *ch; |
235 | struct tsg_gk20a *tsg; | ||
235 | struct vm_gk20a *vm; | 236 | struct vm_gk20a *vm; |
236 | 237 | ||
237 | /* buf converter configuration */ | 238 | /* buf converter configuration */ |