summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
diff options
context:
space:
mode:
authorLakshmanan M <lm@nvidia.com>2016-06-02 00:04:46 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-06-07 15:31:34 -0400
commit6299b00beb9dabdd53c211b02658d022827b3232 (patch)
tree941d8dd8aae8f7f8c73329e182984c36a5a9bf88 /drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
parent3d7263d3cafdcfc57a6d6b9f829562845d116294 (diff)
gpu: nvgpu: Add multiple engine and runlist support
This CL covers the following modification, 1) Added multiple engine_info support 2) Added multiple runlist_info support 3) Initial changes for ASYNC CE support 4) Added ASYNC CE interrupt handling support for gm206 GPU family 5) Added generic mechanism to identify the CE engine pri_base address for gm206 (CE0, CE1 and CE2) 6) Removed hard coded engine_id logic and made generic way 7) Code cleanup for readability JIRA DNVGPU-26 Change-Id: I2c3846c40bcc8d10c2dfb225caa4105fc9123b65 Signed-off-by: Lakshmanan M <lm@nvidia.com> Reviewed-on: http://git-master/r/1155963 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/fifo_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/fifo_gm20b.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
index bb873bcc..031c5bae 100644
--- a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
@@ -49,12 +49,14 @@ static void channel_gm20b_bind(struct channel_gk20a *c)
49static inline u32 gm20b_engine_id_to_mmu_id(struct gk20a *g, u32 engine_id) 49static inline u32 gm20b_engine_id_to_mmu_id(struct gk20a *g, u32 engine_id)
50{ 50{
51 u32 fault_id = ~0; 51 u32 fault_id = ~0;
52 struct fifo_engine_info_gk20a *engine_info;
52 53
53 if (engine_id < ENGINE_INVAL_GK20A) { 54 engine_info = gk20a_fifo_get_engine_info(g, engine_id);
54 struct fifo_engine_info_gk20a *info =
55 &g->fifo.engine_info[engine_id];
56 55
57 fault_id = info->fault_id; 56 if (engine_info) {
57 fault_id = engine_info->fault_id;
58 } else {
59 gk20a_err(g->dev, "engine_id is not in active list/invalid %d", engine_id);
58 } 60 }
59 return fault_id; 61 return fault_id;
60} 62}
@@ -72,7 +74,7 @@ static void gm20b_fifo_trigger_mmu_fault(struct gk20a *g,
72 for_each_set_bit(engine_id, &engine_ids, 32) { 74 for_each_set_bit(engine_id, &engine_ids, 32) {
73 u32 engine_mmu_fault_id; 75 u32 engine_mmu_fault_id;
74 76
75 if (engine_id > g->fifo.max_engines) { 77 if (!gk20a_fifo_is_valid_engine_id(g, engine_id)) {
76 gk20a_err(dev_from_gk20a(g), 78 gk20a_err(dev_from_gk20a(g),
77 "faulting unknown engine %ld", engine_id); 79 "faulting unknown engine %ld", engine_id);
78 } else { 80 } else {
@@ -109,7 +111,7 @@ static u32 gm20b_fifo_get_num_fifos(struct gk20a *g)
109 return ccsr_channel__size_1_v(); 111 return ccsr_channel__size_1_v();
110} 112}
111 113
112void gm20b_device_info_data_parse(struct gk20a *g, 114static void gm20b_device_info_data_parse(struct gk20a *g,
113 u32 table_entry, u32 *inst_id, 115 u32 table_entry, u32 *inst_id,
114 u32 *pri_base, u32 *fault_id) 116 u32 *pri_base, u32 *fault_id)
115{ 117{
@@ -152,4 +154,5 @@ void gm20b_init_fifo(struct gpu_ops *gops)
152 gops->fifo.force_reset_ch = gk20a_fifo_force_reset_ch; 154 gops->fifo.force_reset_ch = gk20a_fifo_force_reset_ch;
153 gops->fifo.engine_enum_from_type = gk20a_fifo_engine_enum_from_type; 155 gops->fifo.engine_enum_from_type = gk20a_fifo_engine_enum_from_type;
154 gops->fifo.device_info_data_parse = gm20b_device_info_data_parse; 156 gops->fifo.device_info_data_parse = gm20b_device_info_data_parse;
157 gops->fifo.eng_runlist_base_size = fifo_eng_runlist_base__size_1_v;
155} 158}