diff options
author | Sam Payne <spayne@nvidia.com> | 2014-10-31 17:27:33 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:11:56 -0400 |
commit | 8c6a9fd1151299697037d58f33cfa306d8ac5d87 (patch) | |
tree | 9bb909474f12565e7f61251b8b80f300030bde52 /drivers/gpu/nvgpu/gk20a/gk20a.h | |
parent | 4f6dddcf78233b9939ee32c6f09519f27c3b8fb4 (diff) |
Revert "gpu: nvgpu: GR and LTC HAL to use const structs"
This reverts commit 41b82e97164138f45fbdaef6ab6939d82ca9419e.
Change-Id: Iabd01fcb124e0d22cd9be62151a6552cbb27fc94
Signed-off-by: Sam Payne <spayne@nvidia.com>
Reviewed-on: http://git-master/r/592221
Tested-by: Hoang Pham <hopham@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 114 |
1 files changed, 87 insertions, 27 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 2c3fb400..5669e1c5 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 | #include "nvgpu_gpuid.h" | 36 | |
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,33 +60,81 @@ 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 | |||
87 | struct gpu_ops { | 63 | struct gpu_ops { |
88 | const struct gpu_ltc_ops *ltc; | 64 | struct { |
89 | const struct gpu_gr_ops *gr; | 65 | int (*determine_L2_size_bytes)(struct gk20a *gk20a); |
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; | ||
90 | const char *name; | 138 | const char *name; |
91 | struct { | 139 | struct { |
92 | void (*init_fs_state)(struct gk20a *g); | 140 | void (*init_fs_state)(struct gk20a *g); |
@@ -672,6 +720,18 @@ int __gk20a_do_unidle(struct platform_device *pdev); | |||
672 | const struct firmware * | 720 | const struct firmware * |
673 | gk20a_request_firmware(struct gk20a *g, const char *fw_name); | 721 | gk20a_request_firmware(struct gk20a *g, const char *fw_name); |
674 | 722 | ||
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 | |||
675 | int gk20a_init_gpu_characteristics(struct gk20a *g); | 735 | int gk20a_init_gpu_characteristics(struct gk20a *g); |
676 | 736 | ||
677 | int gk20a_user_init(struct platform_device *dev); | 737 | int gk20a_user_init(struct platform_device *dev); |