diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 58 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.h | 3 |
2 files changed, 61 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index 3488a03a..d8b251c6 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c | |||
@@ -1565,6 +1565,63 @@ int gr_gv11b_setup_rop_mapping(struct gk20a *g, struct gr_gk20a *gr) | |||
1565 | } | 1565 | } |
1566 | 1566 | ||
1567 | 1567 | ||
1568 | static void gv11b_write_bundle_veid_state(struct gk20a *g, u32 index) | ||
1569 | { | ||
1570 | struct av_list_gk20a *sw_veid_bundle_init = | ||
1571 | &g->gr.ctx_vars.sw_veid_bundle_init; | ||
1572 | u32 j; | ||
1573 | u32 num_subctx = nvgpu_get_litter_value(g, GPU_LIT_NUM_SUBCTX); | ||
1574 | u32 err = 0; | ||
1575 | unsigned long end_jiffies = jiffies + | ||
1576 | msecs_to_jiffies(gk20a_get_gr_idle_timeout(g)); | ||
1577 | |||
1578 | for (j = 0; j < num_subctx; j++) { | ||
1579 | |||
1580 | gk20a_writel(g, gr_pipe_bundle_address_r(), | ||
1581 | sw_veid_bundle_init->l[index].addr | | ||
1582 | gr_pipe_bundle_address_veid_f(j)); | ||
1583 | |||
1584 | err = gr_gk20a_wait_fe_idle(g, end_jiffies, | ||
1585 | GR_IDLE_CHECK_DEFAULT); | ||
1586 | } | ||
1587 | } | ||
1588 | |||
1589 | static int gr_gv11b_init_sw_veid_bundle(struct gk20a *g) | ||
1590 | { | ||
1591 | struct av_list_gk20a *sw_veid_bundle_init = | ||
1592 | &g->gr.ctx_vars.sw_veid_bundle_init; | ||
1593 | u32 i; | ||
1594 | u32 last_bundle_data = 0; | ||
1595 | u32 err = 0; | ||
1596 | unsigned long end_jiffies = jiffies + | ||
1597 | msecs_to_jiffies(gk20a_get_gr_idle_timeout(g)); | ||
1598 | |||
1599 | gk20a_dbg_fn(""); | ||
1600 | for (i = 0; i < sw_veid_bundle_init->count; i++) { | ||
1601 | |||
1602 | if (i == 0 || last_bundle_data != | ||
1603 | sw_veid_bundle_init->l[i].value) { | ||
1604 | gk20a_writel(g, gr_pipe_bundle_data_r(), | ||
1605 | sw_veid_bundle_init->l[i].value); | ||
1606 | last_bundle_data = sw_veid_bundle_init->l[i].value; | ||
1607 | } | ||
1608 | |||
1609 | if (gr_pipe_bundle_address_value_v( | ||
1610 | sw_veid_bundle_init->l[i].addr) == GR_GO_IDLE_BUNDLE) { | ||
1611 | gk20a_writel(g, gr_pipe_bundle_address_r(), | ||
1612 | sw_veid_bundle_init->l[i].addr); | ||
1613 | err |= gr_gk20a_wait_idle(g, end_jiffies, | ||
1614 | GR_IDLE_CHECK_DEFAULT); | ||
1615 | } else | ||
1616 | gv11b_write_bundle_veid_state(g, i); | ||
1617 | |||
1618 | if (err) | ||
1619 | break; | ||
1620 | } | ||
1621 | gk20a_dbg_fn("done"); | ||
1622 | return err; | ||
1623 | } | ||
1624 | |||
1568 | void gv11b_init_gr(struct gpu_ops *gops) | 1625 | void gv11b_init_gr(struct gpu_ops *gops) |
1569 | { | 1626 | { |
1570 | gp10b_init_gr(gops); | 1627 | gp10b_init_gr(gops); |
@@ -1602,4 +1659,5 @@ void gv11b_init_gr(struct gpu_ops *gops) | |||
1602 | gr_gv11b_pre_process_sm_exception; | 1659 | gr_gv11b_pre_process_sm_exception; |
1603 | gops->gr.handle_fecs_error = gr_gv11b_handle_fecs_error; | 1660 | gops->gr.handle_fecs_error = gr_gv11b_handle_fecs_error; |
1604 | gops->gr.setup_rop_mapping = gr_gv11b_setup_rop_mapping; | 1661 | gops->gr.setup_rop_mapping = gr_gv11b_setup_rop_mapping; |
1662 | gops->gr.init_sw_veid_bundle = gr_gv11b_init_sw_veid_bundle; | ||
1605 | } | 1663 | } |
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h index 11f5fb47..5f13aa5c 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h | |||
@@ -25,6 +25,9 @@ enum { | |||
25 | VOLTA_DMA_COPY_A = 0xC3B5, | 25 | VOLTA_DMA_COPY_A = 0xC3B5, |
26 | }; | 26 | }; |
27 | 27 | ||
28 | /* use magic number 99 for subctx litter value */ | ||
29 | #define GPU_LIT_NUM_SUBCTX 99 | ||
30 | |||
28 | void gv11b_init_gr(struct gpu_ops *ops); | 31 | void gv11b_init_gr(struct gpu_ops *ops); |
29 | int gr_gv11b_alloc_buffer(struct vm_gk20a *vm, size_t size, | 32 | int gr_gv11b_alloc_buffer(struct vm_gk20a *vm, size_t size, |
30 | struct mem_desc *mem); | 33 | struct mem_desc *mem); |