diff options
author | Richard Zhao <rizhao@nvidia.com> | 2017-08-17 13:32:17 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-28 22:34:23 -0400 |
commit | 0130c7ba43253790ef7e6e79c86c14223715f572 (patch) | |
tree | 55d12877e0d8eaff7ab0774e2bad4d982c6742f3 | |
parent | 0e0767672ae7e66d0ec249b8847f36c685fe995e (diff) |
gpu: nvgpu: vgpu: add num_pce to constants
Implement hal gops->ce2.get_num_pce.
Jira VFND-3797
Change-Id: Ie4fd3f170f2961ab5ebd1867b83bfda40e57aa2b
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1543020
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/ce2_vgpu.c | 14 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/vgpu.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/vgpu.h | 4 | ||||
-rw-r--r-- | include/linux/tegra_vgpu.h | 1 |
4 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c b/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c index f7b06f3b..81035d71 100644 --- a/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Virtualized GPU CE2 | 2 | * Virtualized GPU CE2 |
3 | * | 3 | * |
4 | * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2015-2017, 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, |
@@ -33,3 +33,15 @@ int vgpu_ce2_nonstall_isr(struct gk20a *g, | |||
33 | 33 | ||
34 | return 0; | 34 | return 0; |
35 | } | 35 | } |
36 | |||
37 | static u32 vgpu_ce_get_num_pce(struct gk20a *g) | ||
38 | { | ||
39 | struct vgpu_priv_data *priv = vgpu_get_priv_data(g); | ||
40 | |||
41 | return priv->constants.num_pce; | ||
42 | } | ||
43 | |||
44 | void vgpu_init_ce2_ops(struct gpu_ops *gops) | ||
45 | { | ||
46 | gops->ce2.get_num_pce = vgpu_ce_get_num_pce; | ||
47 | } | ||
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index 8f401ec6..06971bb0 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c | |||
@@ -440,6 +440,7 @@ void vgpu_init_hal_common(struct gk20a *g) | |||
440 | #if defined(CONFIG_GK20A_CYCLE_STATS) | 440 | #if defined(CONFIG_GK20A_CYCLE_STATS) |
441 | vgpu_init_css_ops(gops); | 441 | vgpu_init_css_ops(gops); |
442 | #endif | 442 | #endif |
443 | vgpu_init_ce2_ops(gops); | ||
443 | gops->chip_init_gpu_characteristics = vgpu_init_gpu_characteristics; | 444 | gops->chip_init_gpu_characteristics = vgpu_init_gpu_characteristics; |
444 | gops->bus.read_ptimer = vgpu_read_ptimer; | 445 | gops->bus.read_ptimer = vgpu_read_ptimer; |
445 | gops->bus.get_timestamps_zipper = vgpu_get_timestamps_zipper; | 446 | gops->bus.get_timestamps_zipper = vgpu_get_timestamps_zipper; |
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/vgpu/vgpu.h index cee81bb1..c5e57efa 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.h +++ b/drivers/gpu/nvgpu/vgpu/vgpu.h | |||
@@ -94,6 +94,7 @@ void vgpu_init_tsg_ops(struct gpu_ops *gops); | |||
94 | #if defined(CONFIG_GK20A_CYCLE_STATS) | 94 | #if defined(CONFIG_GK20A_CYCLE_STATS) |
95 | void vgpu_init_css_ops(struct gpu_ops *gops); | 95 | void vgpu_init_css_ops(struct gpu_ops *gops); |
96 | #endif | 96 | #endif |
97 | void vgpu_init_ce2_ops(struct gpu_ops *gops); | ||
97 | int vgpu_init_mm_support(struct gk20a *g); | 98 | int vgpu_init_mm_support(struct gk20a *g); |
98 | int vgpu_init_gr_support(struct gk20a *g); | 99 | int vgpu_init_gr_support(struct gk20a *g); |
99 | int vgpu_init_fifo_support(struct gk20a *g); | 100 | int vgpu_init_fifo_support(struct gk20a *g); |
@@ -178,6 +179,9 @@ static inline void vgpu_init_css_ops(struct gpu_ops *gops) | |||
178 | { | 179 | { |
179 | } | 180 | } |
180 | #endif | 181 | #endif |
182 | static inline void vgpu_init_ce2_ops(struct gpu_ops *gops) | ||
183 | { | ||
184 | } | ||
181 | static inline int vgpu_init_mm_support(struct gk20a *g) | 185 | static inline int vgpu_init_mm_support(struct gk20a *g) |
182 | { | 186 | { |
183 | return -ENOSYS; | 187 | return -ENOSYS; |
diff --git a/include/linux/tegra_vgpu.h b/include/linux/tegra_vgpu.h index 1c486f5c..bfa5862b 100644 --- a/include/linux/tegra_vgpu.h +++ b/include/linux/tegra_vgpu.h | |||
@@ -477,6 +477,7 @@ struct tegra_vgpu_constants_params { | |||
477 | u32 preempt_ctx_size; | 477 | u32 preempt_ctx_size; |
478 | u32 channel_base; | 478 | u32 channel_base; |
479 | struct tegra_vgpu_engines_info engines_info; | 479 | struct tegra_vgpu_engines_info engines_info; |
480 | u32 num_pce; | ||
480 | }; | 481 | }; |
481 | 482 | ||
482 | struct tegra_vgpu_channel_cyclestats_snapshot_params { | 483 | struct tegra_vgpu_channel_cyclestats_snapshot_params { |