summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2017-06-27 19:50:28 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-30 01:34:37 -0400
commit7346122ae66d35a39ebbdcb423de5bfc4fb66f4e (patch)
tree910785e66f5f0261558c9c70629d0ead02a31961 /drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
parente1655282238b4632c2af4ac809d81b297d5183f2 (diff)
gpu: nvgpu: gv11b: add fifo_gv11b and usermode_regs
- add fifo_gv11b to store usermode_regs - consider channel_base and use usermode_regs when ring channel doorbell It'll make kickoff code re-usable for vgpu. Jira VFND-3796 Change-Id: Ia6974ccac137f201ad8763a7d372de81d5cca56b Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master/r/1510457 Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/fifo_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/fifo_gv11b.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
index dbde2fed..1194663b 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
@@ -48,6 +48,15 @@
48#define CHANNEL_INFO_VEID0 0 48#define CHANNEL_INFO_VEID0 0
49#define PBDMA_SUBDEVICE_ID 1 49#define PBDMA_SUBDEVICE_ID 1
50 50
51static inline void gv11b_usermode_writel(struct gk20a *g, u32 r, u32 v)
52{
53 struct fifo_gk20a *f = &g->fifo;
54 void __iomem *reg = f->t19x.usermode_regs + (r - usermode_cfg0_r());
55
56 writel_relaxed(v, reg);
57 gk20a_dbg(gpu_dbg_reg, "usermode r=0x%x v=0x%x", r, v);
58}
59
51static void gv11b_get_tsg_runlist_entry(struct tsg_gk20a *tsg, u32 *runlist) 60static void gv11b_get_tsg_runlist_entry(struct tsg_gk20a *tsg, u32 *runlist)
52{ 61{
53 62
@@ -192,10 +201,13 @@ static int channel_gv11b_setup_ramfc(struct channel_gk20a *c,
192 201
193static void gv11b_ring_channel_doorbell(struct channel_gk20a *c) 202static void gv11b_ring_channel_doorbell(struct channel_gk20a *c)
194{ 203{
204 struct fifo_gk20a *f = &c->g->fifo;
205 u32 hw_chid = f->channel_base + c->chid;
206
195 gk20a_dbg_info("channel ring door bell %d\n", c->chid); 207 gk20a_dbg_info("channel ring door bell %d\n", c->chid);
196 208
197 gk20a_writel(c->g, usermode_notify_channel_pending_r(), 209 gv11b_usermode_writel(c->g, usermode_notify_channel_pending_r(),
198 usermode_notify_channel_pending_id_f(c->chid)); 210 usermode_notify_channel_pending_id_f(hw_chid));
199} 211}
200 212
201static u32 gv11b_userd_gp_get(struct gk20a *g, struct channel_gk20a *c) 213static u32 gv11b_userd_gp_get(struct gk20a *g, struct channel_gk20a *c)
@@ -1575,11 +1587,19 @@ static u32 gv11b_fifo_get_syncpt_incr_cmd_size(bool wfi_cmd)
1575} 1587}
1576#endif /* CONFIG_TEGRA_GK20A_NVHOST */ 1588#endif /* CONFIG_TEGRA_GK20A_NVHOST */
1577 1589
1590static int gv11b_init_fifo_setup_hw(struct gk20a *g)
1591{
1592 struct fifo_gk20a *f = &g->fifo;
1593
1594 f->t19x.usermode_regs = g->regs + usermode_cfg0_r();
1595 return 0;
1596}
1597
1578void gv11b_init_fifo(struct gpu_ops *gops) 1598void gv11b_init_fifo(struct gpu_ops *gops)
1579{ 1599{
1580 gp10b_init_fifo(gops); 1600 gp10b_init_fifo(gops);
1581 /* for gv11b no need to do any thing special for fifo hw setup */ 1601 /* for gv11b no need to do any thing special for fifo hw setup */
1582 gops->fifo.init_fifo_setup_hw = NULL; 1602 gops->fifo.init_fifo_setup_hw = gv11b_init_fifo_setup_hw;
1583 gops->fifo.runlist_entry_size = ram_rl_entry_size_v; 1603 gops->fifo.runlist_entry_size = ram_rl_entry_size_v;
1584 gops->fifo.get_tsg_runlist_entry = gv11b_get_tsg_runlist_entry; 1604 gops->fifo.get_tsg_runlist_entry = gv11b_get_tsg_runlist_entry;
1585 gops->fifo.get_ch_runlist_entry = gv11b_get_ch_runlist_entry; 1605 gops->fifo.get_ch_runlist_entry = gv11b_get_ch_runlist_entry;