From 2d5ff668cbc6a932df2c9cf79627d1d340e5c2c0 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 27 Oct 2014 11:06:59 +0200 Subject: gpu: nvgpu: GR and LTC HAL to use const structs Convert GR and LTC HALs to use const structs, and initialize them with macros. Bug 1567274 Change-Id: Ia3f24a5eccb27578d9cba69755f636818d11275c Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/590371 --- drivers/gpu/nvgpu/gk20a/ltc_gk20a.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/ltc_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c index aa094dc7..92dac449 100644 --- a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c @@ -265,19 +265,24 @@ static int gk20a_determine_L2_size_bytes(struct gk20a *g) return cache_size; } -void gk20a_init_ltc(struct gpu_ops *gops) -{ - gops->ltc.determine_L2_size_bytes = gk20a_determine_L2_size_bytes; - gops->ltc.set_max_ways_evict_last = gk20a_ltc_set_max_ways_evict_last; - gops->ltc.init_comptags = gk20a_ltc_init_comptags; - gops->ltc.cbc_ctrl = gk20a_ltc_cbc_ctrl; - gops->ltc.set_zbc_color_entry = gk20a_ltc_set_zbc_color_entry; - gops->ltc.set_zbc_depth_entry = gk20a_ltc_set_zbc_depth_entry; - gops->ltc.init_cbc = gk20a_ltc_init_cbc; +static const struct gpu_ltc_ops gk20a_ltc_ops = { + .determine_L2_size_bytes = gk20a_determine_L2_size_bytes, + .set_max_ways_evict_last = gk20a_ltc_set_max_ways_evict_last, + .init_comptags = gk20a_ltc_init_comptags, + .cbc_ctrl = gk20a_ltc_cbc_ctrl, + .set_zbc_color_entry = gk20a_ltc_set_zbc_color_entry, + .set_zbc_depth_entry = gk20a_ltc_set_zbc_depth_entry, + .init_cbc = gk20a_ltc_init_cbc, #ifdef CONFIG_DEBUG_FS - gops->ltc.sync_debugfs = gk20a_ltc_sync_debugfs; + .sync_debugfs = gk20a_ltc_sync_debugfs, #endif - gops->ltc.elpg_flush = gk20a_mm_g_elpg_flush_locked; - gops->ltc.init_fs_state = gk20a_ltc_init_fs_state; - gops->ltc.isr = gk20a_ltc_isr; + .elpg_flush = gk20a_mm_g_elpg_flush_locked, + .init_fs_state = gk20a_ltc_init_fs_state, + .isr = gk20a_ltc_isr + +}; + +void gk20a_init_ltc(struct gpu_ops *gops) +{ + gops->ltc = &gk20a_ltc_ops; } -- cgit v1.2.2