diff options
author | Sunny He <suhe@nvidia.com> | 2017-08-17 19:11:34 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-24 12:34:43 -0400 |
commit | 4b5b67d6d83430d8d670660b1dfc9cf024d60d88 (patch) | |
tree | 541a421438fe849ee4b1ab9e6bdfa9e8b6ee4485 /drivers/gpu/nvgpu/gp106/gr_gp106.c | |
parent | 82ba1277f3da7379ed6b8288c04bb91db008549c (diff) |
gpu: nvgpu: Reorg gr HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the
gr sub-module of the gpu_ops struct.
Perform HAL function assignments in hal_gxxxx.c through the
population of a chip-specific copy of gpu_ops.
Jira NVGPU-74
Change-Id: Ie37638f442fd68aca8a7ade5f297118447bdc91e
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1542989
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/gr_gp106.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/gr_gp106.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/drivers/gpu/nvgpu/gp106/gr_gp106.c b/drivers/gpu/nvgpu/gp106/gr_gp106.c index 76e5cf89..00d6432f 100644 --- a/drivers/gpu/nvgpu/gp106/gr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/gr_gp106.c | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include <nvgpu/hw/gp106/hw_gr_gp106.h> | 25 | #include <nvgpu/hw/gp106/hw_gr_gp106.h> |
26 | 26 | ||
27 | static bool gr_gp106_is_valid_class(struct gk20a *g, u32 class_num) | 27 | bool gr_gp106_is_valid_class(struct gk20a *g, u32 class_num) |
28 | { | 28 | { |
29 | bool valid = false; | 29 | bool valid = false; |
30 | 30 | ||
@@ -53,7 +53,7 @@ static bool gr_gp106_is_valid_class(struct gk20a *g, u32 class_num) | |||
53 | return valid; | 53 | return valid; |
54 | } | 54 | } |
55 | 55 | ||
56 | static u32 gr_gp106_pagepool_default_size(struct gk20a *g) | 56 | u32 gr_gp106_pagepool_default_size(struct gk20a *g) |
57 | { | 57 | { |
58 | return gr_scc_pagepool_total_pages_hwmax_value_v(); | 58 | return gr_scc_pagepool_total_pages_hwmax_value_v(); |
59 | } | 59 | } |
@@ -63,7 +63,7 @@ static void gr_gp106_set_go_idle_timeout(struct gk20a *g, u32 data) | |||
63 | gk20a_writel(g, gr_fe_go_idle_timeout_r(), data); | 63 | gk20a_writel(g, gr_fe_go_idle_timeout_r(), data); |
64 | } | 64 | } |
65 | 65 | ||
66 | static int gr_gp106_handle_sw_method(struct gk20a *g, u32 addr, | 66 | int gr_gp106_handle_sw_method(struct gk20a *g, u32 addr, |
67 | u32 class_num, u32 offset, u32 data) | 67 | u32 class_num, u32 offset, u32 data) |
68 | { | 68 | { |
69 | gk20a_dbg_fn(""); | 69 | gk20a_dbg_fn(""); |
@@ -111,7 +111,7 @@ fail: | |||
111 | return -EINVAL; | 111 | return -EINVAL; |
112 | } | 112 | } |
113 | 113 | ||
114 | static void gr_gp106_cb_size_default(struct gk20a *g) | 114 | void gr_gp106_cb_size_default(struct gk20a *g) |
115 | { | 115 | { |
116 | struct gr_gk20a *gr = &g->gr; | 116 | struct gr_gk20a *gr = &g->gr; |
117 | 117 | ||
@@ -121,7 +121,7 @@ static void gr_gp106_cb_size_default(struct gk20a *g) | |||
121 | gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v(); | 121 | gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v(); |
122 | } | 122 | } |
123 | 123 | ||
124 | static int gr_gp106_set_ctxsw_preemption_mode(struct gk20a *g, | 124 | int gr_gp106_set_ctxsw_preemption_mode(struct gk20a *g, |
125 | struct gr_ctx_desc *gr_ctx, | 125 | struct gr_ctx_desc *gr_ctx, |
126 | struct vm_gk20a *vm, u32 class, | 126 | struct vm_gk20a *vm, u32 class, |
127 | u32 graphics_preempt_mode, | 127 | u32 graphics_preempt_mode, |
@@ -233,19 +233,3 @@ fail_free_preempt: | |||
233 | fail: | 233 | fail: |
234 | return err; | 234 | return err; |
235 | } | 235 | } |
236 | |||
237 | void gp106_init_gr(struct gk20a *g) | ||
238 | { | ||
239 | struct gpu_ops *gops = &g->ops; | ||
240 | |||
241 | gp10b_init_gr(g); | ||
242 | gops->gr.is_valid_class = gr_gp106_is_valid_class; | ||
243 | gops->gr.pagepool_default_size = gr_gp106_pagepool_default_size; | ||
244 | gops->gr.handle_sw_method = gr_gp106_handle_sw_method; | ||
245 | gops->gr.cb_size_default = gr_gp106_cb_size_default; | ||
246 | gops->gr.init_preemption_state = NULL; | ||
247 | gops->gr.set_ctxsw_preemption_mode = gr_gp106_set_ctxsw_preemption_mode; | ||
248 | gops->gr.create_gr_sysfs = NULL; | ||
249 | gops->gr.set_boosted_ctx = NULL; | ||
250 | gops->gr.update_boosted_ctx = NULL; | ||
251 | } | ||