summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
diff options
context:
space:
mode:
authorSachit Kadle <skadle@nvidia.com>2016-11-04 20:48:59 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-12-19 18:39:47 -0500
commitc1750f45f5239508e7a67db0627552f87943ec9f (patch)
tree638889829e65bc1f51254791da99610beaa538f1 /drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
parent6ea4a81f4da565eb07e4eedbe7f80305b5715cf2 (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/tsg_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c14
1 files changed, 14 insertions, 0 deletions
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
445clean_up:
446 kref_put(&tsg->refcount, gk20a_tsg_release);
447 return err;
434} 448}
435 449
436int gk20a_tsg_dev_open(struct inode *inode, struct file *filp) 450int gk20a_tsg_dev_open(struct inode *inode, struct file *filp)