summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
diff options
context:
space:
mode:
authorSami Kiminki <skiminki@nvidia.com>2014-10-24 13:40:57 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:12:07 -0400
commitd11fbfe7b1b68b3aab93f7703896d95d40b79a58 (patch)
treea4b8574c9181284523efa5105878c2e3ef2e05fa /drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
parent2c5fdd1c8a76ef9ca21abcf894f2c9525d57fd49 (diff)
gpu: nvgpu: GPU characteristics additions
Add the following info into GPU characteristics: available big page sizes, support indicators for sync fence fds and cycle stats, gpc mask, SM version, SM SPA version and warp count, and IOCTL interface levels. Also, add new IOCTL to fetch TPC masks. Bug 1551769 Bug 1558186 Change-Id: I8a47d882645f29c7bf0c8f74334ebf47240e41de Signed-off-by: Sami Kiminki <skiminki@nvidia.com> Reviewed-on: http://git-master/r/562904 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-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.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
index 93831844..3bcbdfd9 100644
--- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
@@ -221,6 +221,30 @@ clean_up:
221 return err; 221 return err;
222} 222}
223 223
224static int gk20a_ctrl_get_tpc_masks(struct gk20a *g,
225 struct nvgpu_gpu_get_tpc_masks_args *args)
226{
227 struct gr_gk20a *gr = &g->gr;
228 int err = 0;
229 const u32 gpc_tpc_mask_size = sizeof(u32) * gr->gpc_count;
230
231 if (args->mask_buf_size > 0) {
232 size_t write_size = gpc_tpc_mask_size;
233
234 if (write_size > args->mask_buf_size)
235 write_size = args->mask_buf_size;
236
237 err = copy_to_user((void __user *)(uintptr_t)
238 args->mask_buf_addr,
239 gr->gpc_tpc_mask, write_size);
240 }
241
242 if (err == 0)
243 args->mask_buf_size = gpc_tpc_mask_size;
244
245 return err;
246}
247
224long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 248long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
225{ 249{
226 struct platform_device *dev = filp->private_data; 250 struct platform_device *dev = filp->private_data;
@@ -390,6 +414,10 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
390 err = gk20a_ctrl_open_tsg(g, 414 err = gk20a_ctrl_open_tsg(g,
391 (struct nvgpu_gpu_open_tsg_args *)buf); 415 (struct nvgpu_gpu_open_tsg_args *)buf);
392 break; 416 break;
417 case NVGPU_GPU_IOCTL_GET_TPC_MASKS:
418 err = gk20a_ctrl_get_tpc_masks(g,
419 (struct nvgpu_gpu_get_tpc_masks_args *)buf);
420 break;
393 default: 421 default:
394 dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", cmd); 422 dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", cmd);
395 err = -ENOTTY; 423 err = -ENOTTY;