diff options
author | Sunny He <suhe@nvidia.com> | 2017-06-30 18:53:08 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-24 02:35:06 -0400 |
commit | 66ec347db401affd8bcd425dc123e7162b9ae3bb (patch) | |
tree | cbeb24e465208c6ab3b9527a86ba35003837f176 /drivers/gpu/nvgpu/gp10b/fifo_gp10b.c | |
parent | 2b582c5141752ff272c5d059b56433155bc3985a (diff) |
gpu: nvgpu: Reorg fifo HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the fifo
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: I43d94067a1d7eafba4cdb28311e0ce25812013a7
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1522553
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/gp10b/fifo_gp10b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/fifo_gp10b.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c index 633fbfb7..99d9d744 100644 --- a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c | |||
@@ -80,7 +80,7 @@ int channel_gp10b_commit_userd(struct channel_gk20a *c) | |||
80 | return 0; | 80 | return 0; |
81 | } | 81 | } |
82 | 82 | ||
83 | static int channel_gp10b_setup_ramfc(struct channel_gk20a *c, | 83 | int channel_gp10b_setup_ramfc(struct channel_gk20a *c, |
84 | u64 gpfifo_base, u32 gpfifo_entries, | 84 | u64 gpfifo_base, u32 gpfifo_entries, |
85 | unsigned long acquire_timeout, u32 flags) | 85 | unsigned long acquire_timeout, u32 flags) |
86 | { | 86 | { |
@@ -147,13 +147,13 @@ static int channel_gp10b_setup_ramfc(struct channel_gk20a *c, | |||
147 | return channel_gp10b_commit_userd(c); | 147 | return channel_gp10b_commit_userd(c); |
148 | } | 148 | } |
149 | 149 | ||
150 | static u32 gp10b_fifo_get_pbdma_signature(struct gk20a *g) | 150 | u32 gp10b_fifo_get_pbdma_signature(struct gk20a *g) |
151 | { | 151 | { |
152 | return g->gpu_characteristics.gpfifo_class | 152 | return g->gpu_characteristics.gpfifo_class |
153 | | pbdma_signature_sw_zero_f(); | 153 | | pbdma_signature_sw_zero_f(); |
154 | } | 154 | } |
155 | 155 | ||
156 | static int gp10b_fifo_resetup_ramfc(struct channel_gk20a *c) | 156 | int gp10b_fifo_resetup_ramfc(struct channel_gk20a *c) |
157 | { | 157 | { |
158 | u32 new_syncpt = 0, old_syncpt; | 158 | u32 new_syncpt = 0, old_syncpt; |
159 | u32 v; | 159 | u32 v; |
@@ -192,7 +192,7 @@ static int gp10b_fifo_resetup_ramfc(struct channel_gk20a *c) | |||
192 | return 0; | 192 | return 0; |
193 | } | 193 | } |
194 | 194 | ||
195 | static int gp10b_fifo_engine_enum_from_type(struct gk20a *g, u32 engine_type, | 195 | int gp10b_fifo_engine_enum_from_type(struct gk20a *g, u32 engine_type, |
196 | u32 *inst_id) | 196 | u32 *inst_id) |
197 | { | 197 | { |
198 | int ret = ENGINE_INVAL_GK20A; | 198 | int ret = ENGINE_INVAL_GK20A; |
@@ -208,7 +208,7 @@ static int gp10b_fifo_engine_enum_from_type(struct gk20a *g, u32 engine_type, | |||
208 | return ret; | 208 | return ret; |
209 | } | 209 | } |
210 | 210 | ||
211 | static void gp10b_device_info_data_parse(struct gk20a *g, u32 table_entry, | 211 | void gp10b_device_info_data_parse(struct gk20a *g, u32 table_entry, |
212 | u32 *inst_id, u32 *pri_base, u32 *fault_id) | 212 | u32 *inst_id, u32 *pri_base, u32 *fault_id) |
213 | { | 213 | { |
214 | if (top_device_info_data_type_v(table_entry) == | 214 | if (top_device_info_data_type_v(table_entry) == |
@@ -232,7 +232,7 @@ static void gp10b_device_info_data_parse(struct gk20a *g, u32 table_entry, | |||
232 | top_device_info_data_type_v(table_entry)); | 232 | top_device_info_data_type_v(table_entry)); |
233 | } | 233 | } |
234 | 234 | ||
235 | static void gp10b_fifo_init_pbdma_intr_descs(struct fifo_gk20a *f) | 235 | void gp10b_fifo_init_pbdma_intr_descs(struct fifo_gk20a *f) |
236 | { | 236 | { |
237 | /* | 237 | /* |
238 | * These are all errors which indicate something really wrong | 238 | * These are all errors which indicate something really wrong |
@@ -277,7 +277,7 @@ static void gp10b_fifo_init_pbdma_intr_descs(struct fifo_gk20a *f) | |||
277 | pbdma_intr_0_device_pending_f(); | 277 | pbdma_intr_0_device_pending_f(); |
278 | } | 278 | } |
279 | 279 | ||
280 | static void gp10b_fifo_get_mmu_fault_info(struct gk20a *g, u32 mmu_fault_id, | 280 | void gp10b_fifo_get_mmu_fault_info(struct gk20a *g, u32 mmu_fault_id, |
281 | struct mmu_fault_info *mmfault) | 281 | struct mmu_fault_info *mmfault) |
282 | { | 282 | { |
283 | u32 fault_info; | 283 | u32 fault_info; |
@@ -307,17 +307,3 @@ static void gp10b_fifo_get_mmu_fault_info(struct gk20a *g, u32 mmu_fault_id, | |||
307 | /* note: inst_ptr is a 40b phys addr. */ | 307 | /* note: inst_ptr is a 40b phys addr. */ |
308 | mmfault->inst_ptr <<= fifo_intr_mmu_fault_inst_ptr_align_shift_v(); | 308 | mmfault->inst_ptr <<= fifo_intr_mmu_fault_inst_ptr_align_shift_v(); |
309 | } | 309 | } |
310 | |||
311 | void gp10b_init_fifo(struct gpu_ops *gops) | ||
312 | { | ||
313 | gm20b_init_fifo(gops); | ||
314 | gops->fifo.get_mmu_fault_info = gp10b_fifo_get_mmu_fault_info; | ||
315 | gops->fifo.setup_ramfc = channel_gp10b_setup_ramfc; | ||
316 | gops->fifo.get_pbdma_signature = gp10b_fifo_get_pbdma_signature; | ||
317 | gops->fifo.resetup_ramfc = gp10b_fifo_resetup_ramfc; | ||
318 | gops->fifo.engine_enum_from_type = gp10b_fifo_engine_enum_from_type; | ||
319 | gops->fifo.device_info_data_parse = gp10b_device_info_data_parse; | ||
320 | gops->fifo.eng_runlist_base_size = fifo_eng_runlist_base__size_1_v; | ||
321 | gops->fifo.device_info_fault_id = top_device_info_data_fault_id_enum_v; | ||
322 | gops->fifo.init_pbdma_intr_descs = gp10b_fifo_init_pbdma_intr_descs; | ||
323 | } | ||