summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-04-18 22:39:46 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-09 21:26:04 -0400
commitdd739fcb039d51606e9a5454ec0aab17bcb01965 (patch)
tree806ba8575d146367ad1be00086ca0cdae35a6b28 /drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
parent7e66f2a63d4855e763fa768047dfc32f6f96b771 (diff)
gpu: nvgpu: Remove gk20a_dbg* functions
Switch all logging to nvgpu_log*(). gk20a_dbg* macros are intentionally left there because of use from other repositories. Because the new functions do not work without a pointer to struct gk20a, and piping it just for logging is excessive, some log messages are deleted. Change-Id: I00e22e75fe4596a330bb0282ab4774b3639ee31e Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1704148 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
index 70707a5c..7bb97369 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
@@ -62,14 +62,14 @@ int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp)
62 struct gk20a_ctrl_priv *priv; 62 struct gk20a_ctrl_priv *priv;
63 int err = 0; 63 int err = 0;
64 64
65 gk20a_dbg_fn("");
66
67 l = container_of(inode->i_cdev, 65 l = container_of(inode->i_cdev,
68 struct nvgpu_os_linux, ctrl.cdev); 66 struct nvgpu_os_linux, ctrl.cdev);
69 g = gk20a_get(&l->g); 67 g = gk20a_get(&l->g);
70 if (!g) 68 if (!g)
71 return -ENODEV; 69 return -ENODEV;
72 70
71 nvgpu_log_fn(g, " ");
72
73 priv = nvgpu_kzalloc(g, sizeof(struct gk20a_ctrl_priv)); 73 priv = nvgpu_kzalloc(g, sizeof(struct gk20a_ctrl_priv));
74 if (!priv) { 74 if (!priv) {
75 err = -ENOMEM; 75 err = -ENOMEM;
@@ -102,7 +102,7 @@ int gk20a_ctrl_dev_release(struct inode *inode, struct file *filp)
102 struct gk20a_ctrl_priv *priv = filp->private_data; 102 struct gk20a_ctrl_priv *priv = filp->private_data;
103 struct gk20a *g = priv->g; 103 struct gk20a *g = priv->g;
104 104
105 gk20a_dbg_fn(""); 105 nvgpu_log_fn(g, " ");
106 106
107 if (priv->clk_session) 107 if (priv->clk_session)
108 nvgpu_clk_arb_release_session(g, priv->clk_session); 108 nvgpu_clk_arb_release_session(g, priv->clk_session);
@@ -684,7 +684,7 @@ static int nvgpu_gpu_ioctl_wait_for_pause(struct gk20a *g,
684 /* Copy to user space - pointed by "args->pwarpstate" */ 684 /* Copy to user space - pointed by "args->pwarpstate" */
685 if (copy_to_user((void __user *)(uintptr_t)args->pwarpstate, 685 if (copy_to_user((void __user *)(uintptr_t)args->pwarpstate,
686 w_state, ioctl_size)) { 686 w_state, ioctl_size)) {
687 gk20a_dbg_fn("copy_to_user failed!"); 687 nvgpu_log_fn(g, "copy_to_user failed!");
688 err = -EFAULT; 688 err = -EFAULT;
689 } 689 }
690 690
@@ -901,7 +901,7 @@ static int nvgpu_gpu_alloc_vidmem(struct gk20a *g,
901 u32 align = args->in.alignment ? args->in.alignment : SZ_4K; 901 u32 align = args->in.alignment ? args->in.alignment : SZ_4K;
902 int fd; 902 int fd;
903 903
904 gk20a_dbg_fn(""); 904 nvgpu_log_fn(g, " ");
905 905
906 /* not yet supported */ 906 /* not yet supported */
907 if (WARN_ON(args->in.flags & NVGPU_GPU_ALLOC_VIDMEM_FLAG_CPU_MASK)) 907 if (WARN_ON(args->in.flags & NVGPU_GPU_ALLOC_VIDMEM_FLAG_CPU_MASK))
@@ -933,7 +933,7 @@ static int nvgpu_gpu_alloc_vidmem(struct gk20a *g,
933 933
934 args->out.dmabuf_fd = fd; 934 args->out.dmabuf_fd = fd;
935 935
936 gk20a_dbg_fn("done, fd=%d", fd); 936 nvgpu_log_fn(g, "done, fd=%d", fd);
937 937
938 return 0; 938 return 0;
939} 939}
@@ -943,7 +943,7 @@ static int nvgpu_gpu_get_memory_state(struct gk20a *g,
943{ 943{
944 int err; 944 int err;
945 945
946 gk20a_dbg_fn(""); 946 nvgpu_log_fn(g, " ");
947 947
948 if (args->reserved[0] || args->reserved[1] || 948 if (args->reserved[0] || args->reserved[1] ||
949 args->reserved[2] || args->reserved[3]) 949 args->reserved[2] || args->reserved[3])
@@ -951,7 +951,7 @@ static int nvgpu_gpu_get_memory_state(struct gk20a *g,
951 951
952 err = nvgpu_vidmem_get_space(g, &args->total_free_bytes); 952 err = nvgpu_vidmem_get_space(g, &args->total_free_bytes);
953 953
954 gk20a_dbg_fn("done, err=%d, bytes=%lld", err, args->total_free_bytes); 954 nvgpu_log_fn(g, "done, err=%d, bytes=%lld", err, args->total_free_bytes);
955 955
956 return err; 956 return err;
957} 957}
@@ -973,7 +973,7 @@ static int nvgpu_gpu_clk_get_vf_points(struct gk20a *g,
973 u16 min_mhz; 973 u16 min_mhz;
974 u16 max_mhz; 974 u16 max_mhz;
975 975
976 gk20a_dbg_fn(""); 976 nvgpu_log_fn(g, " ");
977 977
978 if (!session || args->flags) 978 if (!session || args->flags)
979 return -EINVAL; 979 return -EINVAL;
@@ -1059,7 +1059,7 @@ static int nvgpu_gpu_clk_get_range(struct gk20a *g,
1059 int err; 1059 int err;
1060 u16 min_mhz, max_mhz; 1060 u16 min_mhz, max_mhz;
1061 1061
1062 gk20a_dbg_fn(""); 1062 nvgpu_log_fn(g, " ");
1063 1063
1064 if (!session) 1064 if (!session)
1065 return -EINVAL; 1065 return -EINVAL;
@@ -1138,7 +1138,7 @@ static int nvgpu_gpu_clk_set_info(struct gk20a *g,
1138 int i; 1138 int i;
1139 int ret; 1139 int ret;
1140 1140
1141 gk20a_dbg_fn(""); 1141 nvgpu_log_fn(g, " ");
1142 1142
1143 if (!session || args->flags) 1143 if (!session || args->flags)
1144 return -EINVAL; 1144 return -EINVAL;
@@ -1201,7 +1201,7 @@ static int nvgpu_gpu_clk_get_info(struct gk20a *g,
1201 int err; 1201 int err;
1202 int bit; 1202 int bit;
1203 1203
1204 gk20a_dbg_fn(""); 1204 nvgpu_log_fn(g, " ");
1205 1205
1206 if (!session) 1206 if (!session)
1207 return -EINVAL; 1207 return -EINVAL;
@@ -1287,7 +1287,7 @@ static int nvgpu_gpu_get_event_fd(struct gk20a *g,
1287{ 1287{
1288 struct nvgpu_clk_session *session = priv->clk_session; 1288 struct nvgpu_clk_session *session = priv->clk_session;
1289 1289
1290 gk20a_dbg_fn(""); 1290 nvgpu_log_fn(g, " ");
1291 1291
1292 if (!session) 1292 if (!session)
1293 return -EINVAL; 1293 return -EINVAL;
@@ -1301,7 +1301,7 @@ static int nvgpu_gpu_get_voltage(struct gk20a *g,
1301{ 1301{
1302 int err = -EINVAL; 1302 int err = -EINVAL;
1303 1303
1304 gk20a_dbg_fn(""); 1304 nvgpu_log_fn(g, " ");
1305 1305
1306 if (args->reserved) 1306 if (args->reserved)
1307 return -EINVAL; 1307 return -EINVAL;
@@ -1337,7 +1337,7 @@ static int nvgpu_gpu_get_current(struct gk20a *g,
1337{ 1337{
1338 int err; 1338 int err;
1339 1339
1340 gk20a_dbg_fn(""); 1340 nvgpu_log_fn(g, " ");
1341 1341
1342 if (args->reserved[0] || args->reserved[1] || args->reserved[2]) 1342 if (args->reserved[0] || args->reserved[1] || args->reserved[2])
1343 return -EINVAL; 1343 return -EINVAL;
@@ -1361,7 +1361,7 @@ static int nvgpu_gpu_get_power(struct gk20a *g,
1361{ 1361{
1362 int err; 1362 int err;
1363 1363
1364 gk20a_dbg_fn(""); 1364 nvgpu_log_fn(g, " ");
1365 1365
1366 if (args->reserved[0] || args->reserved[1] || args->reserved[2]) 1366 if (args->reserved[0] || args->reserved[1] || args->reserved[2])
1367 return -EINVAL; 1367 return -EINVAL;
@@ -1386,7 +1386,7 @@ static int nvgpu_gpu_get_temperature(struct gk20a *g,
1386 int err; 1386 int err;
1387 u32 temp_f24_8; 1387 u32 temp_f24_8;
1388 1388
1389 gk20a_dbg_fn(""); 1389 nvgpu_log_fn(g, " ");
1390 1390
1391 if (args->reserved[0] || args->reserved[1] || args->reserved[2]) 1391 if (args->reserved[0] || args->reserved[1] || args->reserved[2])
1392 return -EINVAL; 1392 return -EINVAL;
@@ -1415,7 +1415,7 @@ static int nvgpu_gpu_set_therm_alert_limit(struct gk20a *g,
1415{ 1415{
1416 int err; 1416 int err;
1417 1417
1418 gk20a_dbg_fn(""); 1418 nvgpu_log_fn(g, " ");
1419 1419
1420 if (args->reserved[0] || args->reserved[1] || args->reserved[2]) 1420 if (args->reserved[0] || args->reserved[1] || args->reserved[2])
1421 return -EINVAL; 1421 return -EINVAL;
@@ -1491,7 +1491,7 @@ static int nvgpu_gpu_set_deterministic_opts(struct gk20a *g,
1491 u32 i = 0; 1491 u32 i = 0;
1492 int err = 0; 1492 int err = 0;
1493 1493
1494 gk20a_dbg_fn(""); 1494 nvgpu_log_fn(g, " ");
1495 1495
1496 user_channels = (int __user *)(uintptr_t)args->channels; 1496 user_channels = (int __user *)(uintptr_t)args->channels;
1497 1497
@@ -1556,7 +1556,7 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
1556 struct zbc_query_params *zbc_tbl; 1556 struct zbc_query_params *zbc_tbl;
1557 int i, err = 0; 1557 int i, err = 0;
1558 1558
1559 gk20a_dbg_fn("start %d", _IOC_NR(cmd)); 1559 nvgpu_log_fn(g, "start %d", _IOC_NR(cmd));
1560 1560
1561 if ((_IOC_TYPE(cmd) != NVGPU_GPU_IOCTL_MAGIC) || 1561 if ((_IOC_TYPE(cmd) != NVGPU_GPU_IOCTL_MAGIC) ||
1562 (_IOC_NR(cmd) == 0) || 1562 (_IOC_NR(cmd) == 0) ||
@@ -1855,7 +1855,7 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
1855 break; 1855 break;
1856 1856
1857 default: 1857 default:
1858 gk20a_dbg_info("unrecognized gpu ioctl cmd: 0x%x", cmd); 1858 nvgpu_log_info(g, "unrecognized gpu ioctl cmd: 0x%x", cmd);
1859 err = -ENOTTY; 1859 err = -ENOTTY;
1860 break; 1860 break;
1861 } 1861 }