diff options
author | sujeet baranwal <sbaranwal@nvidia.com> | 2015-03-06 14:55:36 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 21:58:05 -0400 |
commit | 2155dfeaba1714bb00cb86af090aa056aec3acfd (patch) | |
tree | 545b791cbf1271750f8728e1e5ec30d107a4ef7b /drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | |
parent | 895675e1d5790e2361b22edb50d702f7dd9a8edd (diff) |
gpu: nvgpu: Gpu characterstics enhancement
New members are added in nvgpu_gpu_characterstics to export more
information required specially from CUDA tools.
Change-Id: I907f3bcbd272405a13f47ef6236bc2cff01c6c80
Signed-off-by: Sujeet Baranwal <sbaranwal@nvidia.com>
Reviewed-on: http://git-master/r/679202
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c index 5df420ff..7c4ec108 100644 --- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | |||
@@ -496,6 +496,28 @@ static int nvgpu_gpu_ioctl_has_any_exception( | |||
496 | return err; | 496 | return err; |
497 | } | 497 | } |
498 | 498 | ||
499 | static int gk20a_ctrl_get_num_vsms(struct gk20a *g, | ||
500 | struct nvgpu_gpu_num_vsms *args) | ||
501 | { | ||
502 | struct gr_gk20a *gr = &g->gr; | ||
503 | args->num_vsms = gr->no_of_sm; | ||
504 | return 0; | ||
505 | } | ||
506 | |||
507 | static int gk20a_ctrl_vsm_mapping(struct gk20a *g, | ||
508 | struct nvgpu_gpu_vsms_mapping *args) | ||
509 | { | ||
510 | int err = 0; | ||
511 | struct gr_gk20a *gr = &g->gr; | ||
512 | size_t write_size = gr->no_of_sm * sizeof(struct sm_info); | ||
513 | |||
514 | err = copy_to_user((void __user *)(uintptr_t) | ||
515 | args->vsms_map_buf_addr, | ||
516 | gr->sm_to_cluster, write_size); | ||
517 | |||
518 | return err; | ||
519 | } | ||
520 | |||
499 | long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 521 | long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
500 | { | 522 | { |
501 | struct platform_device *dev = filp->private_data; | 523 | struct platform_device *dev = filp->private_data; |
@@ -705,6 +727,16 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg | |||
705 | (struct nvgpu_gpu_tpc_exception_en_status_args *)buf); | 727 | (struct nvgpu_gpu_tpc_exception_en_status_args *)buf); |
706 | break; | 728 | break; |
707 | 729 | ||
730 | case NVGPU_GPU_IOCTL_NUM_VSMS: | ||
731 | err = gk20a_ctrl_get_num_vsms(g, | ||
732 | (struct nvgpu_gpu_num_vsms *)buf); | ||
733 | break; | ||
734 | case NVGPU_GPU_IOCTL_VSMS_MAPPING: | ||
735 | err = gk20a_ctrl_vsm_mapping(g, | ||
736 | (struct nvgpu_gpu_vsms_mapping *)buf); | ||
737 | break; | ||
738 | |||
739 | |||
708 | default: | 740 | default: |
709 | dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", cmd); | 741 | dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", cmd); |
710 | err = -ENOTTY; | 742 | err = -ENOTTY; |