diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2014-10-27 05:06:59 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:11:54 -0400 |
commit | 2d5ff668cbc6a932df2c9cf79627d1d340e5c2c0 (patch) | |
tree | 1d9bc4b774a9c2cea339891eaef3af5b87ee354d /drivers/gpu/nvgpu/gk20a/gk20a.h | |
parent | 23a182aaa61d120c965f1bce09609cc14d4e14eb (diff) |
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 <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/590371
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 114 |
1 files changed, 27 insertions, 87 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 5669e1c5..2c3fb400 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -33,7 +33,7 @@ struct acr_gm20b; | |||
33 | #include <linux/tegra-soc.h> | 33 | #include <linux/tegra-soc.h> |
34 | 34 | ||
35 | #include "../../../arch/arm/mach-tegra/iomap.h" | 35 | #include "../../../arch/arm/mach-tegra/iomap.h" |
36 | 36 | #include "nvgpu_gpuid.h" | |
37 | #include "as_gk20a.h" | 37 | #include "as_gk20a.h" |
38 | #include "clk_gk20a.h" | 38 | #include "clk_gk20a.h" |
39 | #include "fifo_gk20a.h" | 39 | #include "fifo_gk20a.h" |
@@ -60,81 +60,33 @@ enum gk20a_cbc_op { | |||
60 | gk20a_cbc_op_invalidate, | 60 | gk20a_cbc_op_invalidate, |
61 | }; | 61 | }; |
62 | 62 | ||
63 | struct gpu_ltc_ops { | ||
64 | int (*determine_L2_size_bytes)(struct gk20a *gk20a); | ||
65 | void (*set_max_ways_evict_last)(struct gk20a *g, u32 max_ways); | ||
66 | int (*init_comptags)(struct gk20a *g, struct gr_gk20a *gr); | ||
67 | int (*cbc_ctrl)(struct gk20a *g, enum gk20a_cbc_op op, | ||
68 | u32 min, u32 max); | ||
69 | void (*set_zbc_color_entry)(struct gk20a *g, | ||
70 | struct zbc_entry *color_val, | ||
71 | u32 index); | ||
72 | void (*set_zbc_depth_entry)(struct gk20a *g, | ||
73 | struct zbc_entry *depth_val, | ||
74 | u32 index); | ||
75 | void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr); | ||
76 | void (*sync_debugfs)(struct gk20a *g); | ||
77 | void (*init_fs_state)(struct gk20a *g); | ||
78 | void (*elpg_flush)(struct gk20a *g); | ||
79 | void (*isr)(struct gk20a *g); | ||
80 | u32 (*cbc_fix_config)(struct gk20a *g, int base); | ||
81 | void (*flush)(struct gk20a *g); | ||
82 | }; | ||
83 | |||
84 | struct gpu_ltc_ops; | ||
85 | struct gpu_gr_ops; | ||
86 | |||
63 | struct gpu_ops { | 87 | struct gpu_ops { |
64 | struct { | 88 | const struct gpu_ltc_ops *ltc; |
65 | int (*determine_L2_size_bytes)(struct gk20a *gk20a); | 89 | const struct gpu_gr_ops *gr; |
66 | void (*set_max_ways_evict_last)(struct gk20a *g, u32 max_ways); | ||
67 | int (*init_comptags)(struct gk20a *g, struct gr_gk20a *gr); | ||
68 | int (*cbc_ctrl)(struct gk20a *g, enum gk20a_cbc_op op, | ||
69 | u32 min, u32 max); | ||
70 | void (*set_zbc_color_entry)(struct gk20a *g, | ||
71 | struct zbc_entry *color_val, | ||
72 | u32 index); | ||
73 | void (*set_zbc_depth_entry)(struct gk20a *g, | ||
74 | struct zbc_entry *depth_val, | ||
75 | u32 index); | ||
76 | void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr); | ||
77 | void (*sync_debugfs)(struct gk20a *g); | ||
78 | void (*init_fs_state)(struct gk20a *g); | ||
79 | void (*elpg_flush)(struct gk20a *g); | ||
80 | void (*isr)(struct gk20a *g); | ||
81 | u32 (*cbc_fix_config)(struct gk20a *g, int base); | ||
82 | void (*flush)(struct gk20a *g); | ||
83 | } ltc; | ||
84 | struct { | ||
85 | int (*init_fs_state)(struct gk20a *g); | ||
86 | void (*access_smpc_reg)(struct gk20a *g, u32 quad, u32 offset); | ||
87 | void (*bundle_cb_defaults)(struct gk20a *g); | ||
88 | void (*cb_size_default)(struct gk20a *g); | ||
89 | int (*calc_global_ctx_buffer_size)(struct gk20a *g); | ||
90 | void (*commit_global_attrib_cb)(struct gk20a *g, | ||
91 | struct channel_ctx_gk20a *ch_ctx, | ||
92 | u64 addr, bool patch); | ||
93 | void (*commit_global_bundle_cb)(struct gk20a *g, | ||
94 | struct channel_ctx_gk20a *ch_ctx, | ||
95 | u64 addr, u64 size, bool patch); | ||
96 | int (*commit_global_cb_manager)(struct gk20a *g, | ||
97 | struct channel_gk20a *ch, | ||
98 | bool patch); | ||
99 | void (*commit_global_pagepool)(struct gk20a *g, | ||
100 | struct channel_ctx_gk20a *ch_ctx, | ||
101 | u64 addr, u32 size, bool patch); | ||
102 | void (*init_gpc_mmu)(struct gk20a *g); | ||
103 | int (*handle_sw_method)(struct gk20a *g, u32 addr, | ||
104 | u32 class_num, u32 offset, u32 data); | ||
105 | void (*set_alpha_circular_buffer_size)(struct gk20a *g, | ||
106 | u32 data); | ||
107 | void (*set_circular_buffer_size)(struct gk20a *g, u32 data); | ||
108 | void (*enable_hww_exceptions)(struct gk20a *g); | ||
109 | bool (*is_valid_class)(struct gk20a *g, u32 class_num); | ||
110 | void (*get_sm_dsm_perf_regs)(struct gk20a *g, | ||
111 | u32 *num_sm_dsm_perf_regs, | ||
112 | u32 **sm_dsm_perf_regs, | ||
113 | u32 *perf_register_stride); | ||
114 | void (*get_sm_dsm_perf_ctrl_regs)(struct gk20a *g, | ||
115 | u32 *num_sm_dsm_perf_regs, | ||
116 | u32 **sm_dsm_perf_regs, | ||
117 | u32 *perf_register_stride); | ||
118 | void (*set_hww_esr_report_mask)(struct gk20a *g); | ||
119 | int (*setup_alpha_beta_tables)(struct gk20a *g, | ||
120 | struct gr_gk20a *gr); | ||
121 | int (*falcon_load_ucode)(struct gk20a *g, | ||
122 | u64 addr_base, | ||
123 | struct gk20a_ctxsw_ucode_segments *segments, | ||
124 | u32 reg_offset); | ||
125 | int (*load_ctxsw_ucode)(struct gk20a *g); | ||
126 | u32 (*get_gpc_tpc_mask)(struct gk20a *g, u32 gpc_index); | ||
127 | void (*free_channel_ctx)(struct channel_gk20a *c); | ||
128 | int (*alloc_obj_ctx)(struct channel_gk20a *c, | ||
129 | struct nvgpu_alloc_obj_ctx_args *args); | ||
130 | int (*free_obj_ctx)(struct channel_gk20a *c, | ||
131 | struct nvgpu_free_obj_ctx_args *args); | ||
132 | int (*bind_ctxsw_zcull)(struct gk20a *g, struct gr_gk20a *gr, | ||
133 | struct channel_gk20a *c, u64 zcull_va, | ||
134 | u32 mode); | ||
135 | int (*get_zcull_info)(struct gk20a *g, struct gr_gk20a *gr, | ||
136 | struct gr_zcull_info *zcull_params); | ||
137 | } gr; | ||
138 | const char *name; | 90 | const char *name; |
139 | struct { | 91 | struct { |
140 | void (*init_fs_state)(struct gk20a *g); | 92 | void (*init_fs_state)(struct gk20a *g); |
@@ -720,18 +672,6 @@ int __gk20a_do_unidle(struct platform_device *pdev); | |||
720 | const struct firmware * | 672 | const struct firmware * |
721 | gk20a_request_firmware(struct gk20a *g, const char *fw_name); | 673 | gk20a_request_firmware(struct gk20a *g, const char *fw_name); |
722 | 674 | ||
723 | #define NVGPU_GPU_ARCHITECTURE_SHIFT 4 | ||
724 | |||
725 | /* constructs unique and compact GPUID from nvgpu_gpu_characteristics | ||
726 | * arch/impl fields */ | ||
727 | #define GK20A_GPUID(arch, impl) ((u32) ((arch) | (impl))) | ||
728 | |||
729 | #define GK20A_GPUID_GK20A \ | ||
730 | GK20A_GPUID(NVGPU_GPU_ARCH_GK100, NVGPU_GPU_IMPL_GK20A) | ||
731 | |||
732 | #define GK20A_GPUID_GM20B \ | ||
733 | GK20A_GPUID(NVGPU_GPU_ARCH_GM200, NVGPU_GPU_IMPL_GM20B) | ||
734 | |||
735 | int gk20a_init_gpu_characteristics(struct gk20a *g); | 675 | int gk20a_init_gpu_characteristics(struct gk20a *g); |
736 | 676 | ||
737 | int gk20a_user_init(struct platform_device *dev); | 677 | int gk20a_user_init(struct platform_device *dev); |