summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorKyle Guo <kyleg@nvidia.com>2018-07-12 20:51:42 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-15 00:24:53 -0400
commit2a25d03f2b7ad0700f14640282abd72ff587d800 (patch)
tree990b2f40d4625df7d5a9106d3c98dc0ccddf90ac /drivers/gpu/nvgpu/include
parent91390d857f6302f9c2923ec4188ea7e24ee537a2 (diff)
gpu: nvgpu: vgpu: ecc sysfs support for vgpu
- fetch ecc info from RM server and create sysfs nodes - new file ecc_vgpu.c for platform-independent code - add 2 new commands: GET_ECC_INFO and GET_ECC_COUNTER_VALUE JIRA EVLR-2590 Change-Id: I040a9fcd23326e432ca93e9a028319f9c1c570f0 Signed-off-by: Kyle Guo <kyleg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1777428 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h19
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h3
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h
index 1eb26303..39d68dd1 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h
@@ -26,6 +26,7 @@
26#define __TEGRA_VGPU_H 26#define __TEGRA_VGPU_H
27 27
28#include <nvgpu/types.h> 28#include <nvgpu/types.h>
29#include <nvgpu/ecc.h> /* For NVGPU_ECC_STAT_NAME_MAX_SIZE */
29 30
30enum { 31enum {
31 TEGRA_VGPU_MODULE_GPU = 0, 32 TEGRA_VGPU_MODULE_GPU = 0,
@@ -120,6 +121,8 @@ enum {
120 TEGRA_VGPU_CMD_UPDATE_PC_SAMPLING = 81, 121 TEGRA_VGPU_CMD_UPDATE_PC_SAMPLING = 81,
121 TEGRA_VGPU_CMD_SUSPEND = 82, 122 TEGRA_VGPU_CMD_SUSPEND = 82,
122 TEGRA_VGPU_CMD_RESUME = 83, 123 TEGRA_VGPU_CMD_RESUME = 83,
124 TEGRA_VGPU_CMD_GET_ECC_INFO = 84,
125 TEGRA_VGPU_CMD_GET_ECC_COUNTER_VALUE = 85,
123}; 126};
124 127
125struct tegra_vgpu_connect_params { 128struct tegra_vgpu_connect_params {
@@ -378,6 +381,20 @@ struct tegra_vgpu_channel_free_hwpm_ctx {
378 u64 handle; 381 u64 handle;
379}; 382};
380 383
384struct tegra_vgpu_ecc_info_params {
385 u32 ecc_stats_count;
386};
387
388struct tegra_vgpu_ecc_info_entry {
389 u32 ecc_id;
390 char name[NVGPU_ECC_STAT_NAME_MAX_SIZE];
391};
392
393struct tegra_vgpu_ecc_counter_params {
394 u32 ecc_id;
395 u32 value;
396};
397
381struct tegra_vgpu_gr_ctx_params { 398struct tegra_vgpu_gr_ctx_params {
382 u64 gr_ctx_handle; 399 u64 gr_ctx_handle;
383 u64 as_handle; 400 u64 as_handle;
@@ -659,6 +676,8 @@ struct tegra_vgpu_cmd_msg {
659 struct tegra_vgpu_map_syncpt_params map_syncpt; 676 struct tegra_vgpu_map_syncpt_params map_syncpt;
660 struct tegra_vgpu_tsg_bind_channel_ex_params tsg_bind_channel_ex; 677 struct tegra_vgpu_tsg_bind_channel_ex_params tsg_bind_channel_ex;
661 struct tegra_vgpu_channel_update_pc_sampling update_pc_sampling; 678 struct tegra_vgpu_channel_update_pc_sampling update_pc_sampling;
679 struct tegra_vgpu_ecc_info_params ecc_info;
680 struct tegra_vgpu_ecc_counter_params ecc_counter;
662 char padding[192]; 681 char padding[192];
663 } params; 682 } params;
664}; 683};
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h
index 1e851b8e..762bc229 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/vgpu/vgpu.h
@@ -37,11 +37,14 @@ struct gk20a;
37struct vm_gk20a; 37struct vm_gk20a;
38struct nvgpu_gr_ctx; 38struct nvgpu_gr_ctx;
39struct nvgpu_cpu_time_correlation_sample; 39struct nvgpu_cpu_time_correlation_sample;
40struct vgpu_ecc_stat;
40 41
41struct vgpu_priv_data { 42struct vgpu_priv_data {
42 u64 virt_handle; 43 u64 virt_handle;
43 struct nvgpu_thread intr_handler; 44 struct nvgpu_thread intr_handler;
44 struct tegra_vgpu_constants_params constants; 45 struct tegra_vgpu_constants_params constants;
46 struct vgpu_ecc_stat *ecc_stats;
47 int ecc_stats_count;
45}; 48};
46 49
47struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g); 50struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g);