diff options
author | Richard Zhao <rizhao@nvidia.com> | 2016-07-25 18:12:08 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-08-15 14:41:23 -0400 |
commit | 843bbc726c7283666a18d9ff899350e0cef18330 (patch) | |
tree | 5811b36c7aa7ec7e2b24dcae83e08cb513d27e13 /drivers/gpu/nvgpu/vgpu/gk20a | |
parent | 233862859a759b14353d743c0bce7d0df18e49ca (diff) |
gpu: nvgpu: vgpu: add getting sm version constants
move below attributes to constants:
TEGRA_VGPU_ATTRIB_GPC0_TPC0_SM_ARCH
JIRA VFND-2103
Change-Id: I5d6aa8f4a49e65307989ef02d223c3ee31fcdeed
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/1190481
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vladislav Buzov <vbuzov@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c b/drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c index a8526457..0ba8db56 100644 --- a/drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c +++ b/drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c | |||
@@ -13,37 +13,9 @@ | |||
13 | 13 | ||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | 15 | ||
16 | #include "gk20a/hw_gr_gk20a.h" | ||
17 | #include "gk20a/gk20a.h" | 16 | #include "gk20a/gk20a.h" |
18 | #include "vgpu/vgpu.h" | ||
19 | #include "vgpu_gr_gk20a.h" | 17 | #include "vgpu_gr_gk20a.h" |
20 | 18 | ||
21 | static void vgpu_gk20a_detect_sm_arch(struct gk20a *g) | ||
22 | { | ||
23 | u32 v = 0, raw_version, version = 0; | ||
24 | |||
25 | gk20a_dbg_fn(""); | ||
26 | |||
27 | if (vgpu_get_attribute(vgpu_get_handle(g), | ||
28 | TEGRA_VGPU_ATTRIB_GPC0_TPC0_SM_ARCH, &v)) | ||
29 | gk20a_err(dev_from_gk20a(g), "failed to retrieve SM arch"); | ||
30 | |||
31 | raw_version = gr_gpc0_tpc0_sm_arch_spa_version_v(v); | ||
32 | |||
33 | if (raw_version == gr_gpc0_tpc0_sm_arch_spa_version_smkepler_lp_v()) | ||
34 | version = 0x320; /* SM 3.2 */ | ||
35 | else | ||
36 | gk20a_err(dev_from_gk20a(g), "Unknown SM version 0x%x", | ||
37 | raw_version); | ||
38 | |||
39 | /* on Kepler, SM version == SPA version */ | ||
40 | g->gpu_characteristics.sm_arch_spa_version = version; | ||
41 | g->gpu_characteristics.sm_arch_sm_version = version; | ||
42 | |||
43 | g->gpu_characteristics.sm_arch_warp_count = | ||
44 | gr_gpc0_tpc0_sm_arch_warp_count_v(v); | ||
45 | } | ||
46 | |||
47 | static int vgpu_gk20a_init_fs_state(struct gk20a *g) | 19 | static int vgpu_gk20a_init_fs_state(struct gk20a *g) |
48 | { | 20 | { |
49 | struct gr_gk20a *gr = &g->gr; | 21 | struct gr_gk20a *gr = &g->gr; |
@@ -73,6 +45,5 @@ static int vgpu_gk20a_init_fs_state(struct gk20a *g) | |||
73 | 45 | ||
74 | void vgpu_gk20a_init_gr_ops(struct gpu_ops *gops) | 46 | void vgpu_gk20a_init_gr_ops(struct gpu_ops *gops) |
75 | { | 47 | { |
76 | gops->gr.detect_sm_arch = vgpu_gk20a_detect_sm_arch; | ||
77 | gops->gr.init_fs_state = vgpu_gk20a_init_fs_state; | 48 | gops->gr.init_fs_state = vgpu_gk20a_init_fs_state; |
78 | } | 49 | } |