summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2014-11-04 08:14:28 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:12:01 -0400
commitb3f575074b66e8af1a9943874f9782b793fa7edc (patch)
treec4aaa1defc512cf5a896edc25445f169de184ece /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parent797e4dd319bd2b9e13ce0e44a3bbbb75e4820330 (diff)
gpu: nvgpu: fix sparse warnings
Fix below sparse warnings : warning: Using plain integer as NULL pointer warning: symbol <variable/funcion> was not declared. Should it be static? warning: Initializer entry defined twice Also, remove dead functions Bug 1573254 Change-Id: I29d71ecc01c841233cf6b26c9088ca8874773469 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/593363 Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index f48ef35f..7f179d14 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -603,9 +603,9 @@ static void gk20a_free_error_notifiers(struct channel_gk20a *ch)
603 if (ch->error_notifier_ref) { 603 if (ch->error_notifier_ref) {
604 dma_buf_vunmap(ch->error_notifier_ref, ch->error_notifier_va); 604 dma_buf_vunmap(ch->error_notifier_ref, ch->error_notifier_va);
605 dma_buf_put(ch->error_notifier_ref); 605 dma_buf_put(ch->error_notifier_ref);
606 ch->error_notifier_ref = 0; 606 ch->error_notifier_ref = NULL;
607 ch->error_notifier = 0; 607 ch->error_notifier = NULL;
608 ch->error_notifier_va = 0; 608 ch->error_notifier_va = NULL;
609 } 609 }
610} 610}
611 611
@@ -785,7 +785,7 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g)
785 if (ch == NULL) { 785 if (ch == NULL) {
786 /* TBD: we want to make this virtualizable */ 786 /* TBD: we want to make this virtualizable */
787 gk20a_err(dev_from_gk20a(g), "out of hw chids"); 787 gk20a_err(dev_from_gk20a(g), "out of hw chids");
788 return 0; 788 return NULL;
789 } 789 }
790 790
791 ch->g = g; 791 ch->g = g;
@@ -795,7 +795,7 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g)
795 gk20a_err(dev_from_gk20a(g), 795 gk20a_err(dev_from_gk20a(g),
796 "failed to open gk20a channel, out of inst mem"); 796 "failed to open gk20a channel, out of inst mem");
797 797
798 return 0; 798 return NULL;
799 } 799 }
800 g->ops.fifo.bind_channel(ch); 800 g->ops.fifo.bind_channel(ch);
801 ch->pid = current->pid; 801 ch->pid = current->pid;
@@ -1265,18 +1265,6 @@ clean_up:
1265 return err; 1265 return err;
1266} 1266}
1267 1267
1268static inline int wfi_cmd_size(void)
1269{
1270 return 2;
1271}
1272void add_wfi_cmd(struct priv_cmd_entry *cmd, int *i)
1273{
1274 /* wfi */
1275 cmd->ptr[(*i)++] = 0x2001001E;
1276 /* handle, ignored */
1277 cmd->ptr[(*i)++] = 0x00000000;
1278}
1279
1280static inline bool check_gp_put(struct gk20a *g, 1268static inline bool check_gp_put(struct gk20a *g,
1281 struct channel_gk20a *c) 1269 struct channel_gk20a *c)
1282{ 1270{
@@ -1529,18 +1517,6 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed)
1529 schedule_work(&c->update_fn_work); 1517 schedule_work(&c->update_fn_work);
1530} 1518}
1531 1519
1532void add_wait_cmd(u32 *ptr, u32 id, u32 thresh)
1533{
1534 /* syncpoint_a */
1535 ptr[0] = 0x2001001C;
1536 /* payload */
1537 ptr[1] = thresh;
1538 /* syncpoint_b */
1539 ptr[2] = 0x2001001D;
1540 /* syncpt_id, switch_en, wait */
1541 ptr[3] = (id << 8) | 0x10;
1542}
1543
1544int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, 1520int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
1545 struct nvgpu_gpfifo *gpfifo, 1521 struct nvgpu_gpfifo *gpfifo,
1546 u32 num_entries, 1522 u32 num_entries,
@@ -1760,11 +1736,6 @@ clean_up:
1760 return err; 1736 return err;
1761} 1737}
1762 1738
1763void gk20a_remove_channel_support(struct channel_gk20a *c)
1764{
1765
1766}
1767
1768int gk20a_init_channel_support(struct gk20a *g, u32 chid) 1739int gk20a_init_channel_support(struct gk20a *g, u32 chid)
1769{ 1740{
1770 struct channel_gk20a *c = g->fifo.channel+chid; 1741 struct channel_gk20a *c = g->fifo.channel+chid;
@@ -1772,7 +1743,6 @@ int gk20a_init_channel_support(struct gk20a *g, u32 chid)
1772 c->in_use = false; 1743 c->in_use = false;
1773 c->hw_chid = chid; 1744 c->hw_chid = chid;
1774 c->bound = false; 1745 c->bound = false;
1775 c->remove_support = gk20a_remove_channel_support;
1776 mutex_init(&c->jobs_lock); 1746 mutex_init(&c->jobs_lock);
1777 mutex_init(&c->submit_lock); 1747 mutex_init(&c->submit_lock);
1778 INIT_LIST_HEAD(&c->jobs); 1748 INIT_LIST_HEAD(&c->jobs);