mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
6e3f9112ea
commit
b92a6bdbf5
@@ -107,6 +107,10 @@ __must_hold(&cde_app->mutex)
|
||||
cde_ctx->backing_store_vaddr);
|
||||
|
||||
/* free the channel */
|
||||
if (cde_ctx->tsg && ch) {
|
||||
gk20a_tsg_unbind_channel(cde_ctx->ch);
|
||||
}
|
||||
|
||||
gk20a_channel_close(ch);
|
||||
|
||||
/* housekeeping on app */
|
||||
@@ -1266,6 +1270,7 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx)
|
||||
struct gk20a *g = &l->g;
|
||||
struct nvgpu_firmware *img;
|
||||
struct channel_gk20a *ch;
|
||||
struct tsg_gk20a *tsg;
|
||||
struct gr_gk20a *gr = &g->gr;
|
||||
int err = 0;
|
||||
u64 vaddr;
|
||||
@@ -1276,6 +1281,12 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx)
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
tsg = gk20a_tsg_open(g);
|
||||
if (!tsg) {
|
||||
nvgpu_err(g, "cde: could not create TSG");
|
||||
goto err_get_gk20a_channel;
|
||||
}
|
||||
|
||||
ch = gk20a_open_new_channel_with_cb(g, gk20a_cde_finished_ctx_cb,
|
||||
cde_ctx,
|
||||
-1,
|
||||
@@ -1293,6 +1304,12 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx)
|
||||
goto err_commit_va;
|
||||
}
|
||||
|
||||
err = gk20a_tsg_bind_channel(tsg, ch);
|
||||
if (err) {
|
||||
nvgpu_err(g, "cde: unable to bind to tsg");
|
||||
goto err_alloc_gpfifo;
|
||||
}
|
||||
|
||||
/* allocate gpfifo (1024 should be more than enough) */
|
||||
err = gk20a_channel_alloc_gpfifo(ch, 1024, 0,
|
||||
NVGPU_GPFIFO_FLAGS_ALLOW_BARE_CHANNEL);
|
||||
@@ -1317,6 +1334,7 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx)
|
||||
|
||||
/* store initialisation data */
|
||||
cde_ctx->ch = ch;
|
||||
cde_ctx->tsg = tsg;
|
||||
cde_ctx->vm = ch->vm;
|
||||
cde_ctx->backing_store_vaddr = vaddr;
|
||||
|
||||
|
||||
@@ -232,6 +232,7 @@ struct gk20a_cde_ctx {
|
||||
|
||||
/* channel related data */
|
||||
struct channel_gk20a *ch;
|
||||
struct tsg_gk20a *tsg;
|
||||
struct vm_gk20a *vm;
|
||||
|
||||
/* buf converter configuration */
|
||||
|
||||
Reference in New Issue
Block a user