summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/gr_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
index 7f5b8d3f..bdb96329 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
@@ -13,6 +13,7 @@
13 * more details. 13 * more details.
14 */ 14 */
15 15
16#include <linux/tegra_gpu_t19x.h>
16#include "gk20a/gk20a.h" /* FERMI and MAXWELL classes defined here */ 17#include "gk20a/gk20a.h" /* FERMI and MAXWELL classes defined here */
17#include <linux/delay.h> 18#include <linux/delay.h>
18#include <linux/tegra-fuse.h> 19#include <linux/tegra-fuse.h>
@@ -24,12 +25,16 @@
24 25
25#include "gm20b/gr_gm20b.h" 26#include "gm20b/gr_gm20b.h"
26#include "gv11b/gr_gv11b.h" 27#include "gv11b/gr_gv11b.h"
28#include "gv11b/mm_gv11b.h"
29#include "gv11b/subctx_gv11b.h"
27#include "hw_gr_gv11b.h" 30#include "hw_gr_gv11b.h"
28#include "hw_fifo_gv11b.h" 31#include "hw_fifo_gv11b.h"
29#include "hw_proj_gv11b.h" 32#include "hw_proj_gv11b.h"
30#include "hw_ctxsw_prog_gv11b.h" 33#include "hw_ctxsw_prog_gv11b.h"
31#include "hw_mc_gv11b.h" 34#include "hw_mc_gv11b.h"
32#include "hw_gr_gv11b.h" 35#include "hw_gr_gv11b.h"
36#include "hw_ram_gv11b.h"
37#include "hw_pbdma_gv11b.h"
33#include <linux/vmalloc.h> 38#include <linux/vmalloc.h>
34#include <linux/tegra_gpu_t19x.h> 39#include <linux/tegra_gpu_t19x.h>
35 40
@@ -1583,7 +1588,6 @@ static int gr_gv11b_setup_rop_mapping(struct gk20a *g, struct gr_gk20a *gr)
1583 return 0; 1588 return 0;
1584} 1589}
1585 1590
1586
1587static void gv11b_write_bundle_veid_state(struct gk20a *g, u32 index) 1591static void gv11b_write_bundle_veid_state(struct gk20a *g, u32 index)
1588{ 1592{
1589 struct av_list_gk20a *sw_veid_bundle_init = 1593 struct av_list_gk20a *sw_veid_bundle_init =
@@ -1766,12 +1770,43 @@ static int gr_gv11b_load_smid_config(struct gk20a *g)
1766 1770
1767 for (i = 0; i < gr_cwd_sm_id__size_1_v(); i++) 1771 for (i = 0; i < gr_cwd_sm_id__size_1_v(); i++)
1768 gk20a_writel(g, gr_cwd_sm_id_r(i), tpc_sm_id[i]); 1772 gk20a_writel(g, gr_cwd_sm_id_r(i), tpc_sm_id[i]);
1769
1770 kfree(tpc_sm_id); 1773 kfree(tpc_sm_id);
1771 1774
1772 return 0; 1775 return 0;
1773} 1776}
1774 1777
1778static int gr_gv11b_commit_inst(struct channel_gk20a *c, u64 gpu_va)
1779{
1780 u32 addr_lo;
1781 u32 addr_hi;
1782 struct ctx_header_desc *ctx;
1783
1784 gk20a_dbg_fn("");
1785
1786 gv11b_alloc_subctx_header(c);
1787
1788 gv11b_update_subctx_header(c, gpu_va);
1789
1790 ctx = &c->ch_ctx.ctx_header;
1791 addr_lo = u64_lo32(ctx->mem.gpu_va) >> ram_in_base_shift_v();
1792 addr_hi = u64_hi32(ctx->mem.gpu_va);
1793
1794 /* point this address to engine_wfi_ptr */
1795 gk20a_mem_wr32(c->g, &c->inst_block, ram_in_engine_wfi_target_w(),
1796 ram_in_engine_cs_wfi_v() |
1797 ram_in_engine_wfi_target_f(
1798 ram_in_engine_wfi_target_sys_mem_ncoh_v()) |
1799 ram_in_engine_wfi_mode_f(ram_in_engine_wfi_mode_virtual_v()) |
1800 ram_in_engine_wfi_ptr_lo_f(addr_lo));
1801
1802 gk20a_mem_wr32(c->g, &c->inst_block, ram_in_engine_wfi_ptr_hi_w(),
1803 ram_in_engine_wfi_ptr_hi_f(addr_hi));
1804
1805 return 0;
1806}
1807
1808
1809
1775static int gr_gv11b_commit_global_timeslice(struct gk20a *g, 1810static int gr_gv11b_commit_global_timeslice(struct gk20a *g,
1776 struct channel_gk20a *c, bool patch) 1811 struct channel_gk20a *c, bool patch)
1777{ 1812{
@@ -1828,6 +1863,7 @@ static int gr_gv11b_commit_global_timeslice(struct gk20a *g,
1828void gv11b_init_gr(struct gpu_ops *gops) 1863void gv11b_init_gr(struct gpu_ops *gops)
1829{ 1864{
1830 gp10b_init_gr(gops); 1865 gp10b_init_gr(gops);
1866 gops->gr.init_preemption_state = NULL;
1831 gops->gr.init_fs_state = gr_gv11b_init_fs_state; 1867 gops->gr.init_fs_state = gr_gv11b_init_fs_state;
1832 gops->gr.detect_sm_arch = gr_gv11b_detect_sm_arch; 1868 gops->gr.detect_sm_arch = gr_gv11b_detect_sm_arch;
1833 gops->gr.is_valid_class = gr_gv11b_is_valid_class; 1869 gops->gr.is_valid_class = gr_gv11b_is_valid_class;
@@ -1872,4 +1908,6 @@ void gv11b_init_gr(struct gpu_ops *gops)
1872 gops->gr.load_smid_config = gr_gv11b_load_smid_config; 1908 gops->gr.load_smid_config = gr_gv11b_load_smid_config;
1873 gops->gr.program_sm_id_numbering = 1909 gops->gr.program_sm_id_numbering =
1874 gr_gv11b_program_sm_id_numbering; 1910 gr_gv11b_program_sm_id_numbering;
1911 gops->gr.commit_inst = gr_gv11b_commit_inst;
1912
1875} 1913}