diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-03-30 10:44:03 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-10 22:04:19 -0400 |
commit | 3ba374a5d94f8c2067731155afaf79f03e6c390c (patch) | |
tree | d8a2bd0d52b1e8862510aedeb7529944c0b7e28e /drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | |
parent | 2be51206af88aba6662cdd9de5bd6c18989bbcbd (diff) |
gpu: nvgpu: gk20a: Use new error macro
gk20a_err() and gk20a_warn() require a struct device pointer,
which is not portable across operating systems. The new nvgpu_err()
and nvgpu_warn() macros take struct gk20a pointer. Convert code
to use the more portable macros.
JIRA NVGPU-16
Change-Id: Ia51f36d94c5ce57a5a0ab83b3c83a6bce09e2d5c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1331694
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index cda9fb8d..ce9a4176 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include "gk20a/gk20a.h" | 28 | #include "gk20a/gk20a.h" |
29 | #include "gk20a/fence_gk20a.h" | 29 | #include "gk20a/fence_gk20a.h" |
30 | 30 | ||
31 | #include <nvgpu/log.h> | ||
32 | |||
31 | #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7) ? 0xffff : (a >> 32) ? \ | 33 | #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7) ? 0xffff : (a >> 32) ? \ |
32 | (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) | 34 | (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) |
33 | #define MHZ_TO_HZ(a) ((u64)a * MHZ) | 35 | #define MHZ_TO_HZ(a) ((u64)a * MHZ) |
@@ -352,7 +354,7 @@ static int nvgpu_gpu_ioctl_set_mmu_debug_mode( | |||
352 | struct nvgpu_gpu_mmu_debug_mode_args *args) | 354 | struct nvgpu_gpu_mmu_debug_mode_args *args) |
353 | { | 355 | { |
354 | if (gk20a_busy(g)) { | 356 | if (gk20a_busy(g)) { |
355 | gk20a_err(dev_from_gk20a(g), "failed to power on gpu\n"); | 357 | nvgpu_err(g, "failed to power on gpu\n"); |
356 | return -EINVAL; | 358 | return -EINVAL; |
357 | } | 359 | } |
358 | 360 | ||
@@ -521,7 +523,7 @@ static inline int get_timestamps_zipper(struct gk20a *g, | |||
521 | unsigned int i = 0; | 523 | unsigned int i = 0; |
522 | 524 | ||
523 | if (gk20a_busy(g)) { | 525 | if (gk20a_busy(g)) { |
524 | gk20a_err(dev_from_gk20a(g), "GPU not powered on\n"); | 526 | nvgpu_err(g, "GPU not powered on\n"); |
525 | err = -EINVAL; | 527 | err = -EINVAL; |
526 | goto end; | 528 | goto end; |
527 | } | 529 | } |
@@ -560,7 +562,7 @@ static int nvgpu_gpu_get_cpu_time_correlation_info( | |||
560 | get_cpu_timestamp = get_cpu_timestamp_timeofday; | 562 | get_cpu_timestamp = get_cpu_timestamp_timeofday; |
561 | break; | 563 | break; |
562 | default: | 564 | default: |
563 | gk20a_err(dev_from_gk20a(g), "invalid cpu clock source id\n"); | 565 | nvgpu_err(g, "invalid cpu clock source id\n"); |
564 | return -EINVAL; | 566 | return -EINVAL; |
565 | } | 567 | } |
566 | 568 | ||
@@ -625,7 +627,7 @@ static int nvgpu_gpu_get_engine_info( | |||
625 | break; | 627 | break; |
626 | 628 | ||
627 | default: | 629 | default: |
628 | gk20a_err(dev_from_gk20a(g), "Unmapped engine enum %u\n", | 630 | nvgpu_err(g, "Unmapped engine enum %u\n", |
629 | engine_enum); | 631 | engine_enum); |
630 | continue; | 632 | continue; |
631 | } | 633 | } |
@@ -677,7 +679,7 @@ static int nvgpu_gpu_alloc_vidmem(struct gk20a *g, | |||
677 | 679 | ||
678 | if (align > roundup_pow_of_two(args->in.size)) { | 680 | if (align > roundup_pow_of_two(args->in.size)) { |
679 | /* log this special case, buddy allocator detail */ | 681 | /* log this special case, buddy allocator detail */ |
680 | gk20a_warn(dev_from_gk20a(g), | 682 | nvgpu_warn(g, |
681 | "alignment larger than buffer size rounded up to power of 2 is not supported"); | 683 | "alignment larger than buffer size rounded up to power of 2 is not supported"); |
682 | return -EINVAL; | 684 | return -EINVAL; |
683 | } | 685 | } |
@@ -1510,7 +1512,7 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg | |||
1510 | break; | 1512 | break; |
1511 | 1513 | ||
1512 | default: | 1514 | default: |
1513 | dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", cmd); | 1515 | gk20a_dbg_info("unrecognized gpu ioctl cmd: 0x%x", cmd); |
1514 | err = -ENOTTY; | 1516 | err = -ENOTTY; |
1515 | break; | 1517 | break; |
1516 | } | 1518 | } |