diff options
author | Sunny He <suhe@nvidia.com> | 2017-07-05 18:20:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-24 02:35:05 -0400 |
commit | 3b7d50ee12b7ed93f908338dc321bf71023d4b49 (patch) | |
tree | 0e8e5a8cd5a46c0f6cf1d209e14bb6568db8f578 /drivers/gpu | |
parent | 8b571de4563b83352097474c5f7157ea6623a97f (diff) |
gpu: nvgpu: gv11b: Reorg css HAL init
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.
Change-Id: I04177d6c9eb4f3c433d493c815ad15cf7b755910
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514206
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')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 18cd686e..4f993494 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |||
@@ -235,6 +235,16 @@ static const struct gpu_ops gv11b_ops = { | |||
235 | .perfbuffer_enable = gk20a_perfbuf_enable_locked, | 235 | .perfbuffer_enable = gk20a_perfbuf_enable_locked, |
236 | .perfbuffer_disable = gk20a_perfbuf_disable_locked, | 236 | .perfbuffer_disable = gk20a_perfbuf_disable_locked, |
237 | }, | 237 | }, |
238 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
239 | .css = { | ||
240 | .enable_snapshot = css_hw_enable_snapshot, | ||
241 | .disable_snapshot = css_hw_disable_snapshot, | ||
242 | .check_data_available = css_hw_check_data_available, | ||
243 | .set_handled_snapshots = css_hw_set_handled_snapshots, | ||
244 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, | ||
245 | .release_perfmon_ids = css_gr_release_perfmon_ids, | ||
246 | }, | ||
247 | #endif | ||
238 | .falcon = { | 248 | .falcon = { |
239 | .falcon_hal_sw_init = gk20a_falcon_hal_sw_init, | 249 | .falcon_hal_sw_init = gk20a_falcon_hal_sw_init, |
240 | }, | 250 | }, |
@@ -252,6 +262,9 @@ int gv11b_init_hal(struct gk20a *g) | |||
252 | gops->mc = gv11b_ops.mc; | 262 | gops->mc = gv11b_ops.mc; |
253 | gops->debug = gv11b_ops.debug; | 263 | gops->debug = gv11b_ops.debug; |
254 | gops->dbg_session_ops = gv11b_ops.dbg_session_ops; | 264 | gops->dbg_session_ops = gv11b_ops.dbg_session_ops; |
265 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
266 | gops->css = gv11b_ops.css; | ||
267 | #endif | ||
255 | gops->falcon = gv11b_ops.falcon; | 268 | gops->falcon = gv11b_ops.falcon; |
256 | 269 | ||
257 | /* Lone functions */ | 270 | /* Lone functions */ |
@@ -276,9 +289,7 @@ int gv11b_init_hal(struct gk20a *g) | |||
276 | gv11b_init_regops(gops); | 289 | gv11b_init_regops(gops); |
277 | gv11b_init_therm_ops(gops); | 290 | gv11b_init_therm_ops(gops); |
278 | gk20a_init_tsg_ops(gops); | 291 | gk20a_init_tsg_ops(gops); |
279 | #if defined(CONFIG_GK20A_CYCLE_STATS) | 292 | |
280 | gk20a_init_css_ops(gops); | ||
281 | #endif | ||
282 | g->name = "gv11b"; | 293 | g->name = "gv11b"; |
283 | 294 | ||
284 | c->twod_class = FERMI_TWOD_A; | 295 | c->twod_class = FERMI_TWOD_A; |