diff options
author | Sachit Kadle <skadle@nvidia.com> | 2016-11-04 20:48:59 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-12-19 18:39:47 -0500 |
commit | c1750f45f5239508e7a67db0627552f87943ec9f (patch) | |
tree | 638889829e65bc1f51254791da99610beaa538f1 /drivers/gpu/nvgpu/gk20a | |
parent | 6ea4a81f4da565eb07e4eedbe7f80305b5715cf2 (diff) |
gpu: nvgpu: add tsg_open HAL interface
Add HAL interface for TSG open, which is intended to
be called from the exisiting gk20a_tsg_open function.
The tsg_open entryoint is only implemented for vgpu,
as the server needs to clear metadata when a tsg is opened.
Bug 200215060
Change-Id: Icc8fd602f31e52d9fa9b2e7786b665b9e7b9294e
Signed-off-by: Sachit Kadle <skadle@nvidia.com>
Reviewed-on: http://git-master/r/1249218
(cherry picked from commit 35c86f7c796c6574d3dc336e20012ea5c16d7cb4)
Reviewed-on: http://git-master/r/1256468
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index ed3a1d2d..f492801e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -392,6 +392,7 @@ struct gpu_ops { | |||
392 | int (*tsg_bind_channel)(struct tsg_gk20a *tsg, | 392 | int (*tsg_bind_channel)(struct tsg_gk20a *tsg, |
393 | struct channel_gk20a *ch); | 393 | struct channel_gk20a *ch); |
394 | int (*tsg_unbind_channel)(struct channel_gk20a *ch); | 394 | int (*tsg_unbind_channel)(struct channel_gk20a *ch); |
395 | int (*tsg_open)(struct tsg_gk20a *tsg); | ||
395 | u32 (*eng_runlist_base_size)(void); | 396 | u32 (*eng_runlist_base_size)(void); |
396 | int (*init_engine_info)(struct fifo_gk20a *f); | 397 | int (*init_engine_info)(struct fifo_gk20a *f); |
397 | u32 (*runlist_entry_size)(void); | 398 | u32 (*runlist_entry_size)(void); |
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c index 43ee79cd..fc36c0c7 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | |||
@@ -402,6 +402,7 @@ int gk20a_tsg_open(struct gk20a *g, struct file *filp) | |||
402 | { | 402 | { |
403 | struct tsg_gk20a *tsg; | 403 | struct tsg_gk20a *tsg; |
404 | struct device *dev; | 404 | struct device *dev; |
405 | int err; | ||
405 | 406 | ||
406 | dev = dev_from_gk20a(g); | 407 | dev = dev_from_gk20a(g); |
407 | 408 | ||
@@ -426,11 +427,24 @@ int gk20a_tsg_open(struct gk20a *g, struct file *filp) | |||
426 | 427 | ||
427 | filp->private_data = tsg; | 428 | filp->private_data = tsg; |
428 | 429 | ||
430 | if (g->ops.fifo.tsg_open) { | ||
431 | err = g->ops.fifo.tsg_open(tsg); | ||
432 | if (err) { | ||
433 | gk20a_err(dev, "tsg %d fifo open failed %d", | ||
434 | tsg->tsgid, err); | ||
435 | goto clean_up; | ||
436 | } | ||
437 | } | ||
438 | |||
429 | gk20a_dbg(gpu_dbg_fn, "tsg opened %d\n", tsg->tsgid); | 439 | gk20a_dbg(gpu_dbg_fn, "tsg opened %d\n", tsg->tsgid); |
430 | 440 | ||
431 | gk20a_sched_ctrl_tsg_added(g, tsg); | 441 | gk20a_sched_ctrl_tsg_added(g, tsg); |
432 | 442 | ||
433 | return 0; | 443 | return 0; |
444 | |||
445 | clean_up: | ||
446 | kref_put(&tsg->refcount, gk20a_tsg_release); | ||
447 | return err; | ||
434 | } | 448 | } |
435 | 449 | ||
436 | int gk20a_tsg_dev_open(struct inode *inode, struct file *filp) | 450 | int gk20a_tsg_dev_open(struct inode *inode, struct file *filp) |