summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVijayakumar <vsubbu@nvidia.com>2016-09-06 07:41:39 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-07 04:36:04 -0400
commit8de7ea2543823b6035e52fe06e7747f49393b01d (patch)
tree2e9010a6d2411ca6e7494577cecaef5f420a3a7f /drivers
parent61f26b68f6e2c9245861ed6d1dc7311282549667 (diff)
gpu: nvgpu: fix init msg param handing
bug 1809509 latest pmu now returns information about 3 queues only. nvgpu pmu driver still support 5 queues to be compatible with older firmware. handling this properly Change-Id: I4bc166712465f4b52537c97e6d254760c59e0d16 Signed-off-by: Vijayakumar <vsubbu@nvidia.com> Reviewed-on: http://git-master/r/1215533 (cherry picked from commit c7428c031a095b2d42512b7a8a0a9d818290e376) Reviewed-on: http://git-master/r/1231040 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c21
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.h3
2 files changed, 18 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
index 70871572..ca9f2e15 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -1150,11 +1150,21 @@ static void get_pmu_init_msg_pmu_queue_params_v3(struct pmu_queue *queue,
1150 (struct pmu_init_msg_pmu_v3 *)pmu_init_msg; 1150 (struct pmu_init_msg_pmu_v3 *)pmu_init_msg;
1151 u32 current_ptr = 0; 1151 u32 current_ptr = 0;
1152 u8 i; 1152 u8 i;
1153 queue->index = init->queue_index[id]; 1153 u8 tmp_id = id;
1154 queue->size = init->queue_size[id]; 1154
1155 if (id != 0) { 1155 if (tmp_id == PMU_COMMAND_QUEUE_HPQ)
1156 for ( i = 0 ; i < id; i++) 1156 tmp_id = PMU_QUEUE_HPQ_IDX_FOR_V3;
1157 current_ptr += init->queue_size[i]; 1157 else if (tmp_id == PMU_COMMAND_QUEUE_LPQ)
1158 tmp_id = PMU_QUEUE_LPQ_IDX_FOR_V3;
1159 else if (tmp_id == PMU_MESSAGE_QUEUE)
1160 tmp_id = PMU_QUEUE_MSG_IDX_FOR_V3;
1161 else
1162 return;
1163 queue->index = init->queue_index[tmp_id];
1164 queue->size = init->queue_size[tmp_id];
1165 if (tmp_id != 0) {
1166 for (i = 0 ; i < tmp_id; i++)
1167 current_ptr += init->queue_size[i];
1158 } 1168 }
1159 queue->offset = init->queue_offset + current_ptr; 1169 queue->offset = init->queue_offset + current_ptr;
1160} 1170}
@@ -2435,7 +2445,6 @@ static int pmu_queue_init(struct pmu_gk20a *pmu,
2435 struct pmu_queue *queue = &pmu->queue[id]; 2445 struct pmu_queue *queue = &pmu->queue[id];
2436 queue->id = id; 2446 queue->id = id;
2437 g->ops.pmu_ver.get_pmu_init_msg_pmu_queue_params(queue, id, init); 2447 g->ops.pmu_ver.get_pmu_init_msg_pmu_queue_params(queue, id, init);
2438
2439 queue->mutex_id = id; 2448 queue->mutex_id = id;
2440 mutex_init(&queue->mutex); 2449 mutex_init(&queue->mutex);
2441 2450
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
index 78a37436..fe82eca4 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
@@ -256,6 +256,9 @@ struct pmu_init_msg_pmu_v2 {
256}; 256};
257 257
258#define PMU_QUEUE_COUNT_FOR_V3 3 258#define PMU_QUEUE_COUNT_FOR_V3 3
259#define PMU_QUEUE_HPQ_IDX_FOR_V3 0
260#define PMU_QUEUE_LPQ_IDX_FOR_V3 1
261#define PMU_QUEUE_MSG_IDX_FOR_V3 2
259struct pmu_init_msg_pmu_v3 { 262struct pmu_init_msg_pmu_v3 {
260 u8 msg_type; 263 u8 msg_type;
261 u8 queue_index[PMU_QUEUE_COUNT_FOR_V3]; 264 u8 queue_index[PMU_QUEUE_COUNT_FOR_V3];