diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-10-29 23:14:12 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-01 12:36:22 -0400 |
commit | b8bfcd4358275be4a11405641defee46d4b33b6b (patch) | |
tree | 528497c2a78c67224a1f526d184ae52dd5b0b3fa /drivers/gpu/nvgpu | |
parent | 68dbfedd4f837d1bf2bab128500140f5d8cfadac (diff) |
gpu: nvgpu: Add GPU arch and impl to common structure
Add GPU architecture and implentation to a new struct nvgpu_gpu_params
which is defined in common header file gk20a/gk20.h.
JIRA NVGPU-259
Change-Id: I9113d188037c9ad7bfc2200e0e41b39cac576985
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1588032
GVS: Gerrit_Virtual_Submit
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/hal.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/acr_gp106.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/vgpu.c | 16 |
9 files changed, 36 insertions, 21 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index 1e5a9d59..1442c19a 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | |||
@@ -202,6 +202,9 @@ gk20a_ctrl_ioctl_gpu_characteristics( | |||
202 | #ifdef CONFIG_TEGRA_19x_GPU | 202 | #ifdef CONFIG_TEGRA_19x_GPU |
203 | pgpu->flags |= nvgpu_ctrl_ioctl_gpu_characteristics_flags_t19x(g); | 203 | pgpu->flags |= nvgpu_ctrl_ioctl_gpu_characteristics_flags_t19x(g); |
204 | #endif | 204 | #endif |
205 | pgpu->arch = g->params.gpu_arch; | ||
206 | pgpu->impl = g->params.gpu_impl; | ||
207 | pgpu->rev = g->params.gpu_rev; | ||
205 | 208 | ||
206 | if (request->gpu_characteristics_buf_size > 0) { | 209 | if (request->gpu_characteristics_buf_size > 0) { |
207 | size_t write_size = sizeof(*pgpu); | 210 | size_t write_size = sizeof(*pgpu); |
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index fb5d3614..4f66fc67 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -156,9 +156,10 @@ static int gk20a_restore_registers(struct gk20a *g) | |||
156 | return 0; | 156 | return 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | static int nvgpu_init_os_linux_ops(struct nvgpu_os_linux *l) { | 159 | static int nvgpu_init_os_linux_ops(struct nvgpu_os_linux *l) |
160 | { | ||
160 | struct gk20a *g = &l->g; | 161 | struct gk20a *g = &l->g; |
161 | u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl; | 162 | u32 ver = g->params.gpu_arch + g->params.gpu_impl; |
162 | 163 | ||
163 | switch (ver) { | 164 | switch (ver) { |
164 | case GK20A_GPUID_GM20B: | 165 | case GK20A_GPUID_GM20B: |
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c b/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c index f0307d96..2b952868 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c | |||
@@ -35,7 +35,7 @@ | |||
35 | static u8 get_perfmon_id(struct nvgpu_pmu *pmu) | 35 | static u8 get_perfmon_id(struct nvgpu_pmu *pmu) |
36 | { | 36 | { |
37 | struct gk20a *g = gk20a_from_pmu(pmu); | 37 | struct gk20a *g = gk20a_from_pmu(pmu); |
38 | u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl; | 38 | u32 ver = g->params.gpu_arch + g->params.gpu_impl; |
39 | u8 unit_id; | 39 | u8 unit_id; |
40 | 40 | ||
41 | switch (ver) { | 41 | switch (ver) { |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 703a7c0c..e4bfce7f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -74,18 +74,18 @@ void __gk20a_warn_on_no_regs(void) | |||
74 | 74 | ||
75 | static int gk20a_detect_chip(struct gk20a *g) | 75 | static int gk20a_detect_chip(struct gk20a *g) |
76 | { | 76 | { |
77 | struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics; | 77 | struct nvgpu_gpu_params *p = &g->params; |
78 | u32 val; | 78 | u32 val; |
79 | 79 | ||
80 | if (gpu->arch) | 80 | if (p->gpu_arch) |
81 | return 0; | 81 | return 0; |
82 | 82 | ||
83 | val = gk20a_mc_boot_0(g, &gpu->arch, &gpu->impl, &gpu->rev); | 83 | val = gk20a_mc_boot_0(g, &p->gpu_arch, &p->gpu_impl, &p->gpu_rev); |
84 | 84 | ||
85 | gk20a_dbg_info("arch: %x, impl: %x, rev: %x\n", | 85 | gk20a_dbg_info("arch: %x, impl: %x, rev: %x\n", |
86 | g->gpu_characteristics.arch, | 86 | g->params.gpu_arch, |
87 | g->gpu_characteristics.impl, | 87 | g->params.gpu_impl, |
88 | g->gpu_characteristics.rev); | 88 | g->params.gpu_rev); |
89 | 89 | ||
90 | return gpu_init_hal(g); | 90 | return gpu_init_hal(g); |
91 | } | 91 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index dca27887..550e8a0c 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -1060,6 +1060,15 @@ struct nvgpu_bios { | |||
1060 | u32 expansion_rom_offset; | 1060 | u32 expansion_rom_offset; |
1061 | }; | 1061 | }; |
1062 | 1062 | ||
1063 | struct nvgpu_gpu_params { | ||
1064 | /* GPU architecture ID */ | ||
1065 | u32 gpu_arch; | ||
1066 | /* GPU implementation ID */ | ||
1067 | u32 gpu_impl; | ||
1068 | /* GPU revision ID */ | ||
1069 | u32 gpu_rev; | ||
1070 | }; | ||
1071 | |||
1063 | struct gk20a { | 1072 | struct gk20a { |
1064 | struct nvgpu_nvhost_dev *nvhost_dev; | 1073 | struct nvgpu_nvhost_dev *nvhost_dev; |
1065 | 1074 | ||
@@ -1081,6 +1090,8 @@ struct gk20a { | |||
1081 | u32 log_mask; | 1090 | u32 log_mask; |
1082 | u32 log_trace; | 1091 | u32 log_trace; |
1083 | 1092 | ||
1093 | struct nvgpu_gpu_params params; | ||
1094 | |||
1084 | /* | 1095 | /* |
1085 | * Guards access to hardware when usual gk20a_{busy,idle} are skipped | 1096 | * Guards access to hardware when usual gk20a_{busy,idle} are skipped |
1086 | * for submits and held for channel lifetime but dropped for an ongoing | 1097 | * for submits and held for channel lifetime but dropped for an ongoing |
diff --git a/drivers/gpu/nvgpu/gk20a/hal.c b/drivers/gpu/nvgpu/gk20a/hal.c index 3535fedd..13e6f374 100644 --- a/drivers/gpu/nvgpu/gk20a/hal.c +++ b/drivers/gpu/nvgpu/gk20a/hal.c | |||
@@ -36,7 +36,7 @@ | |||
36 | 36 | ||
37 | int gpu_init_hal(struct gk20a *g) | 37 | int gpu_init_hal(struct gk20a *g) |
38 | { | 38 | { |
39 | u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl; | 39 | u32 ver = g->params.gpu_arch + g->params.gpu_impl; |
40 | switch (ver) { | 40 | switch (ver) { |
41 | case GK20A_GPUID_GM20B: | 41 | case GK20A_GPUID_GM20B: |
42 | case GK20A_GPUID_GM20B_B: | 42 | case GK20A_GPUID_GM20B_B: |
diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c index c16c058e..d17d5751 100644 --- a/drivers/gpu/nvgpu/gp106/acr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c | |||
@@ -182,7 +182,7 @@ release_img_fw: | |||
182 | 182 | ||
183 | int fecs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) | 183 | int fecs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) |
184 | { | 184 | { |
185 | u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl; | 185 | u32 ver = g->params.gpu_arch + g->params.gpu_impl; |
186 | struct lsf_ucode_desc_v1 *lsf_desc; | 186 | struct lsf_ucode_desc_v1 *lsf_desc; |
187 | struct nvgpu_firmware *fecs_sig = NULL; | 187 | struct nvgpu_firmware *fecs_sig = NULL; |
188 | int err; | 188 | int err; |
@@ -276,7 +276,7 @@ rel_sig: | |||
276 | 276 | ||
277 | int gpccs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) | 277 | int gpccs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) |
278 | { | 278 | { |
279 | u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl; | 279 | u32 ver = g->params.gpu_arch + g->params.gpu_impl; |
280 | struct lsf_ucode_desc_v1 *lsf_desc; | 280 | struct lsf_ucode_desc_v1 *lsf_desc; |
281 | struct nvgpu_firmware *gpccs_sig = NULL; | 281 | struct nvgpu_firmware *gpccs_sig = NULL; |
282 | int err; | 282 | int err; |
diff --git a/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c b/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c index 571f99b7..5dc0f591 100644 --- a/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c +++ b/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | int gr_gp106_get_netlist_name(struct gk20a *g, int index, char *name) | 28 | int gr_gp106_get_netlist_name(struct gk20a *g, int index, char *name) |
29 | { | 29 | { |
30 | u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl; | 30 | u32 ver = g->params.gpu_arch + g->params.gpu_impl; |
31 | 31 | ||
32 | switch (ver) { | 32 | switch (ver) { |
33 | case NVGPU_GPUID_GP104: | 33 | case NVGPU_GPUID_GP104: |
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index f0f05637..14a19f56 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c | |||
@@ -342,17 +342,17 @@ int vgpu_pm_prepare_poweroff(struct device *dev) | |||
342 | 342 | ||
343 | static void vgpu_detect_chip(struct gk20a *g) | 343 | static void vgpu_detect_chip(struct gk20a *g) |
344 | { | 344 | { |
345 | struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics; | 345 | struct nvgpu_gpu_params *p = &g->params; |
346 | struct vgpu_priv_data *priv = vgpu_get_priv_data(g); | 346 | struct vgpu_priv_data *priv = vgpu_get_priv_data(g); |
347 | 347 | ||
348 | gpu->arch = priv->constants.arch; | 348 | p->gpu_arch = priv->constants.arch; |
349 | gpu->impl = priv->constants.impl; | 349 | p->gpu_impl = priv->constants.impl; |
350 | gpu->rev = priv->constants.rev; | 350 | p->gpu_rev = priv->constants.rev; |
351 | 351 | ||
352 | gk20a_dbg_info("arch: %x, impl: %x, rev: %x\n", | 352 | gk20a_dbg_info("arch: %x, impl: %x, rev: %x\n", |
353 | g->gpu_characteristics.arch, | 353 | p->gpu_arch, |
354 | g->gpu_characteristics.impl, | 354 | p->gpu_impl, |
355 | g->gpu_characteristics.rev); | 355 | p->gpu_rev); |
356 | } | 356 | } |
357 | 357 | ||
358 | int vgpu_init_gpu_characteristics(struct gk20a *g) | 358 | int vgpu_init_gpu_characteristics(struct gk20a *g) |
@@ -436,7 +436,7 @@ int vgpu_get_timestamps_zipper(struct gk20a *g, | |||
436 | 436 | ||
437 | static int vgpu_init_hal(struct gk20a *g) | 437 | static int vgpu_init_hal(struct gk20a *g) |
438 | { | 438 | { |
439 | u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl; | 439 | u32 ver = g->params.gpu_arch + g->params.gpu_impl; |
440 | int err; | 440 | int err; |
441 | 441 | ||
442 | switch (ver) { | 442 | switch (ver) { |