diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-12-12 18:35:52 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-12-13 20:21:35 -0500 |
commit | b92a6bdbf51da0d071fc11146258ca6a80e2b9d7 (patch) | |
tree | 2a23caef817bb98974775057c0662354f0fd5cdb | |
parent | 6e3f9112eaf351276b10391f020d203d87314172 (diff) |
gpu: nvgpu: Use TSG for CDE channels
All channels should be wrapped in TSGs so that bare channel support
can be dropped. Bind all CDE channels to TSGs.
Bug 1842197
Change-Id: I20b68c81b47e0d742e5922e7b85ac5cba75984b0
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1616698
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-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 */ |