diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 29 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.h | 3 |
2 files changed, 23 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index dee3b760..808cf19f 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c | |||
@@ -56,7 +56,7 @@ | |||
56 | #include <nvgpu/hw/gv11b/hw_therm_gv11b.h> | 56 | #include <nvgpu/hw/gv11b/hw_therm_gv11b.h> |
57 | #include <nvgpu/hw/gv11b/hw_fb_gv11b.h> | 57 | #include <nvgpu/hw/gv11b/hw_fb_gv11b.h> |
58 | 58 | ||
59 | #define GFXP_WFI_TIMEOUT_COUNT_IN_USEC_DEFAULT 1000 | 59 | #define GFXP_WFI_TIMEOUT_COUNT_IN_USEC_DEFAULT 100 |
60 | 60 | ||
61 | /* ecc scrubbing will done in 1 pri read cycle,but for safety used 10 retries */ | 61 | /* ecc scrubbing will done in 1 pri read cycle,but for safety used 10 retries */ |
62 | #define ECC_SCRUBBING_TIMEOUT_MAX 1000 | 62 | #define ECC_SCRUBBING_TIMEOUT_MAX 1000 |
@@ -1663,6 +1663,11 @@ void gr_gv11b_update_ctxsw_preemption_mode(struct gk20a *g, | |||
1663 | cbes_reserve), | 1663 | cbes_reserve), |
1664 | true); | 1664 | true); |
1665 | 1665 | ||
1666 | gr_gk20a_ctx_patch_write(g, gr_ctx, | ||
1667 | gr_fe_gfxp_wfi_timeout_r(), | ||
1668 | g->gr.gfxp_wfi_timeout_count, | ||
1669 | true); | ||
1670 | |||
1666 | gr_gk20a_ctx_patch_write_end(g, gr_ctx, true); | 1671 | gr_gk20a_ctx_patch_write_end(g, gr_ctx, true); |
1667 | } | 1672 | } |
1668 | 1673 | ||
@@ -4099,17 +4104,19 @@ int gr_gv11b_init_preemption_state(struct gk20a *g) | |||
4099 | { | 4104 | { |
4100 | u32 debug_2; | 4105 | u32 debug_2; |
4101 | struct gr_gk20a *gr = &g->gr; | 4106 | struct gr_gk20a *gr = &g->gr; |
4107 | u32 unit; | ||
4102 | 4108 | ||
4103 | nvgpu_log_fn(g, " "); | 4109 | nvgpu_log_fn(g, " "); |
4104 | 4110 | ||
4105 | gk20a_writel(g, gr_fe_gfxp_wfi_timeout_r(), | 4111 | if (gr->gfxp_wfi_timeout_unit == GFXP_WFI_TIMEOUT_UNIT_USEC) |
4106 | gr_fe_gfxp_wfi_timeout_count_f( | 4112 | unit = gr_debug_2_gfxp_wfi_timeout_unit_usec_f(); |
4107 | gr->gfxp_wfi_timeout_count)); | 4113 | else |
4114 | unit = gr_debug_2_gfxp_wfi_timeout_unit_sysclk_f(); | ||
4108 | 4115 | ||
4109 | debug_2 = gk20a_readl(g, gr_debug_2_r()); | 4116 | debug_2 = gk20a_readl(g, gr_debug_2_r()); |
4110 | debug_2 = set_field(debug_2, | 4117 | debug_2 = set_field(debug_2, |
4111 | gr_debug_2_gfxp_wfi_timeout_unit_m(), | 4118 | gr_debug_2_gfxp_wfi_timeout_unit_m(), |
4112 | gr_debug_2_gfxp_wfi_timeout_unit_usec_f()); | 4119 | unit); |
4113 | gk20a_writel(g, gr_debug_2_r(), debug_2); | 4120 | gk20a_writel(g, gr_debug_2_r(), debug_2); |
4114 | 4121 | ||
4115 | return 0; | 4122 | return 0; |
@@ -4117,14 +4124,18 @@ int gr_gv11b_init_preemption_state(struct gk20a *g) | |||
4117 | void gr_gv11b_init_gfxp_wfi_timeout_count(struct gk20a *g) | 4124 | void gr_gv11b_init_gfxp_wfi_timeout_count(struct gk20a *g) |
4118 | { | 4125 | { |
4119 | struct gr_gk20a *gr = &g->gr; | 4126 | struct gr_gk20a *gr = &g->gr; |
4120 | 4127 | gr->gfxp_wfi_timeout_unit = GFXP_WFI_TIMEOUT_UNIT_USEC; | |
4121 | gr->gfxp_wfi_timeout_count = GFXP_WFI_TIMEOUT_COUNT_IN_USEC_DEFAULT; | 4128 | gr->gfxp_wfi_timeout_count = GFXP_WFI_TIMEOUT_COUNT_IN_USEC_DEFAULT; |
4122 | } | 4129 | } |
4123 | 4130 | ||
4124 | unsigned long gr_gv11b_get_max_gfxp_wfi_timeout_count(struct gk20a *g) | 4131 | unsigned long gr_gv11b_get_max_gfxp_wfi_timeout_count(struct gk20a *g) |
4125 | { | 4132 | { |
4126 | /* 100 msec in usec count */ | 4133 | if (g->gr.gfxp_wfi_timeout_unit == GFXP_WFI_TIMEOUT_UNIT_USEC) |
4127 | return (100 * 1000UL); | 4134 | /* 100 msec in usec count */ |
4135 | return (100UL * 1000UL); | ||
4136 | else | ||
4137 | /* 100 msec for 1GHz clock */ | ||
4138 | return (100UL * 1000UL * 1000UL); | ||
4128 | } | 4139 | } |
4129 | 4140 | ||
4130 | static int gr_gv11b_ecc_scrub_is_done(struct gk20a *g, | 4141 | static int gr_gv11b_ecc_scrub_is_done(struct gk20a *g, |
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h index 2f8d2e17..0f42e795 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h | |||
@@ -34,6 +34,9 @@ | |||
34 | #define ZBC_STENCIL_CLEAR_FMT_INVAILD 0 | 34 | #define ZBC_STENCIL_CLEAR_FMT_INVAILD 0 |
35 | #define ZBC_STENCIL_CLEAR_FMT_U8 1 | 35 | #define ZBC_STENCIL_CLEAR_FMT_U8 1 |
36 | 36 | ||
37 | #define GFXP_WFI_TIMEOUT_UNIT_SYSCLK 0 | ||
38 | #define GFXP_WFI_TIMEOUT_UNIT_USEC 1 | ||
39 | |||
37 | struct gk20a; | 40 | struct gk20a; |
38 | struct gr_gk20a; | 41 | struct gr_gk20a; |
39 | struct zbc_entry; | 42 | struct zbc_entry; |