diff options
author | Sunny He <suhe@nvidia.com> | 2017-06-30 17:40:33 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-24 02:35:03 -0400 |
commit | d717c69d2b1992688589ae389380fedf0b06c720 (patch) | |
tree | 5d7596070d8ab7ca53bcd8506135d99789c9b7bb /drivers/gpu/nvgpu/gm20b/hal_gm20b.c | |
parent | 882a5be5a45702cd94c4eddf9d01e76fd8e039a1 (diff) |
gpu: nvgpu: Reorg css HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the
css 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: I3bf696e13d359982c964c7bc470500a30555c034
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514205
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/hal_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 2d8ed9ec..300f0872 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c | |||
@@ -234,6 +234,16 @@ static const struct gpu_ops gm20b_ops = { | |||
234 | .cde = { | 234 | .cde = { |
235 | .get_program_numbers = gm20b_cde_get_program_numbers, | 235 | .get_program_numbers = gm20b_cde_get_program_numbers, |
236 | }, | 236 | }, |
237 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
238 | .css = { | ||
239 | .enable_snapshot = css_hw_enable_snapshot, | ||
240 | .disable_snapshot = css_hw_disable_snapshot, | ||
241 | .check_data_available = css_hw_check_data_available, | ||
242 | .set_handled_snapshots = css_hw_set_handled_snapshots, | ||
243 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, | ||
244 | .release_perfmon_ids = css_gr_release_perfmon_ids, | ||
245 | }, | ||
246 | #endif | ||
237 | .falcon = { | 247 | .falcon = { |
238 | .falcon_hal_sw_init = gk20a_falcon_hal_sw_init, | 248 | .falcon_hal_sw_init = gk20a_falcon_hal_sw_init, |
239 | }, | 249 | }, |
@@ -253,6 +263,9 @@ int gm20b_init_hal(struct gk20a *g) | |||
253 | gops->dbg_session_ops = gm20b_ops.dbg_session_ops; | 263 | gops->dbg_session_ops = gm20b_ops.dbg_session_ops; |
254 | gops->debug = gm20b_ops.debug; | 264 | gops->debug = gm20b_ops.debug; |
255 | gops->cde = gm20b_ops.cde; | 265 | gops->cde = gm20b_ops.cde; |
266 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
267 | gops->css = gm20b_ops.css; | ||
268 | #endif | ||
256 | gops->falcon = gm20b_ops.falcon; | 269 | gops->falcon = gm20b_ops.falcon; |
257 | 270 | ||
258 | /* Lone functions */ | 271 | /* Lone functions */ |
@@ -303,9 +316,6 @@ int gm20b_init_hal(struct gk20a *g) | |||
303 | gm20b_init_regops(gops); | 316 | gm20b_init_regops(gops); |
304 | gm20b_init_therm_ops(gops); | 317 | gm20b_init_therm_ops(gops); |
305 | gk20a_init_tsg_ops(gops); | 318 | gk20a_init_tsg_ops(gops); |
306 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
307 | gk20a_init_css_ops(gops); | ||
308 | #endif | ||
309 | g->name = "gm20b"; | 319 | g->name = "gm20b"; |
310 | 320 | ||
311 | c->twod_class = FERMI_TWOD_A; | 321 | c->twod_class = FERMI_TWOD_A; |