summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h
diff options
context:
space:
mode:
authorMayank Kaushik <mkaushik@nvidia.com>2014-09-17 21:11:45 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:57 -0400
commit3d313d06570dcb28bba73247a2c0fc52bec56af0 (patch)
tree69c98965a8f5833c791069d6bd1442075e8e6a2e /drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h
parent50d76e9b91a4b4b03bea5f92a7a1af452ce7c6f9 (diff)
gpu: nvgpu: gm20b: halify tpc lookup
Since the number of TPCs is different between GM20B and GK20a, the function to look up the number of TPCs needs to be halified. Change-Id: I19dab9a7105814f86c08c92283a0bb70abb6aa00 Signed-off-by: Mayank Kaushik <mkaushik@nvidia.com> Reviewed-on: http://git-master/r/500064 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h
index 9e1a1cb8..0f70e8aa 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Graphics Context Pri Register Addressing 2 * GK20A Graphics Context Pri Register Addressing
3 * 3 *
4 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -85,26 +85,6 @@ static inline bool pri_is_tpc_addr_shared(u32 addr)
85 (addr < (proj_tpc_in_gpc_shared_base_v() + 85 (addr < (proj_tpc_in_gpc_shared_base_v() +
86 proj_tpc_in_gpc_stride_v())); 86 proj_tpc_in_gpc_stride_v()));
87} 87}
88static inline bool pri_is_tpc_addr(u32 addr)
89{
90 return ((addr >= proj_tpc_in_gpc_base_v()) &&
91 (addr < proj_tpc_in_gpc_base_v() + (proj_scal_litter_num_tpc_per_gpc_v() *
92 proj_tpc_in_gpc_stride_v())))
93 ||
94 pri_is_tpc_addr_shared(addr);
95}
96static inline u32 pri_get_tpc_num(u32 addr)
97{
98 u32 i, start;
99 u32 num_tpcs = proj_scal_litter_num_tpc_per_gpc_v();
100
101 for (i = 0; i < num_tpcs; i++) {
102 start = proj_tpc_in_gpc_base_v() + (i * proj_tpc_in_gpc_stride_v());
103 if ((addr >= start) && (addr < (start + proj_tpc_in_gpc_stride_v())))
104 return i;
105 }
106 return 0;
107}
108 88
109/* 89/*
110 * BE pri addressing 90 * BE pri addressing