summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2016-09-24 14:20:37 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-11 12:16:04 -0400
commit1a36091fb9e31578c2e01c60cbe0a9b01b64bc9e (patch)
treece92efb31177049668411929a93ad0ab0016f9cb /drivers
parent507081b2eae666f9c3e713fd7d9d97fdc8b6c56f (diff)
gpu: nvgpu: gv11b: sysmem userd support
For gv11b, userd is allocated from sysmem. Updated gp_get and gp_put functions to read or write from sysmem instead of bar1 memory. In gv11b, after updating gp_put, it is required to notify pending work to host through channel doorbell. JIRA GV11B-1 Change-Id: Iebc52e6ccfc8b9ca0c57b227190e0ce1161076f1 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/1226613 GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gv11b/fifo_gv11b.c47
-rw-r--r--drivers/gpu/nvgpu/gv11b/mm_gv11b.c8
2 files changed, 53 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
index 35b36ec5..c6e0f0a2 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
@@ -12,17 +12,17 @@
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details. 13 * more details.
14 */ 14 */
15
16#include <linux/delay.h> 15#include <linux/delay.h>
17#include <linux/types.h> 16#include <linux/types.h>
18
19#include "gk20a/gk20a.h" 17#include "gk20a/gk20a.h"
18#include "gk20a/fifo_gk20a.h"
20#include "gp10b/fifo_gp10b.h" 19#include "gp10b/fifo_gp10b.h"
21#include "hw_pbdma_gv11b.h" 20#include "hw_pbdma_gv11b.h"
22#include "fifo_gv11b.h" 21#include "fifo_gv11b.h"
23#include "hw_fifo_gv11b.h" 22#include "hw_fifo_gv11b.h"
24#include "hw_ram_gv11b.h" 23#include "hw_ram_gv11b.h"
25#include "hw_ccsr_gv11b.h" 24#include "hw_ccsr_gv11b.h"
25#include "hw_usermode_gv11b.h"
26 26
27static void gv11b_get_tsg_runlist_entry(struct tsg_gk20a *tsg, u32 *runlist) 27static void gv11b_get_tsg_runlist_entry(struct tsg_gk20a *tsg, u32 *runlist)
28{ 28{
@@ -82,10 +82,53 @@ static void gv11b_get_ch_runlist_entry(struct channel_gk20a *c, u32 *runlist)
82 runlist[0], runlist[1], runlist[2], runlist[3]); 82 runlist[0], runlist[1], runlist[2], runlist[3]);
83} 83}
84 84
85static void gv11b_ring_channel_doorbell(struct channel_gk20a *c)
86{
87 gk20a_dbg_info("channel ring door bell %d\n", c->hw_chid);
88
89 gk20a_writel(c->g, usermode_notify_channel_pending_r(),
90 usermode_notify_channel_pending_id_f(c->hw_chid));
91}
92
93static u32 gv11b_userd_gp_get(struct gk20a *g, struct channel_gk20a *c)
94{
95 struct mem_desc *userd_mem = &g->fifo.userd;
96 u32 offset = c->hw_chid * (g->fifo.userd_entry_size / sizeof(u32));
97
98 return gk20a_mem_rd32(g, userd_mem,
99 offset + ram_userd_gp_get_w());
100
101}
102
103static void gv11b_userd_gp_put(struct gk20a *g, struct channel_gk20a *c)
104{
105 struct mem_desc *userd_mem = &g->fifo.userd;
106 u32 offset = c->hw_chid * (g->fifo.userd_entry_size / sizeof(u32));
107
108 gk20a_mem_wr32(g, userd_mem, offset + ram_userd_gp_put_w(),
109 c->gpfifo.put);
110 /* commit everything to cpu */
111 smp_mb();
112
113 gv11b_ring_channel_doorbell(c);
114
115}
116
117
118static u32 gv11b_fifo_get_num_fifos(struct gk20a *g)
119{
120 return ccsr_channel__size_1_v();
121}
122
85void gv11b_init_fifo(struct gpu_ops *gops) 123void gv11b_init_fifo(struct gpu_ops *gops)
86{ 124{
87 gp10b_init_fifo(gops); 125 gp10b_init_fifo(gops);
126 /* for gv11b no need to do any thing special for fifo hw setup */
127 gops->fifo.init_fifo_setup_hw = NULL;
88 gops->fifo.runlist_entry_size = ram_rl_entry_size_v; 128 gops->fifo.runlist_entry_size = ram_rl_entry_size_v;
89 gops->fifo.get_tsg_runlist_entry = gv11b_get_tsg_runlist_entry; 129 gops->fifo.get_tsg_runlist_entry = gv11b_get_tsg_runlist_entry;
90 gops->fifo.get_ch_runlist_entry = gv11b_get_ch_runlist_entry; 130 gops->fifo.get_ch_runlist_entry = gv11b_get_ch_runlist_entry;
131 gops->fifo.get_num_fifos = gv11b_fifo_get_num_fifos;
132 gops->fifo.userd_gp_get = gv11b_userd_gp_get;
133 gops->fifo.userd_gp_put = gv11b_userd_gp_put;
91} 134}
diff --git a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c
index 0ac18a91..54df6745 100644
--- a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c
@@ -18,8 +18,16 @@
18#include "gk20a/gk20a.h" 18#include "gk20a/gk20a.h"
19#include "gp10b/mm_gp10b.h" 19#include "gp10b/mm_gp10b.h"
20#include "mm_gv11b.h" 20#include "mm_gv11b.h"
21#include "hw_fb_gv11b.h"
22
23bool gv11b_mm_is_bar1_supported(struct gk20a *g)
24{
25 return false;
26}
21 27
22void gv11b_init_mm(struct gpu_ops *gops) 28void gv11b_init_mm(struct gpu_ops *gops)
23{ 29{
24 gp10b_init_mm(gops); 30 gp10b_init_mm(gops);
31 gops->mm.bar1_bind = NULL;
32 gops->mm.is_bar1_supported = gv11b_mm_is_bar1_supported;
25} 33}