diff options
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/scale.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/scale.c b/drivers/gpu/nvgpu/os/linux/scale.c index 84ac1cfd..72ed94bd 100644 --- a/drivers/gpu/nvgpu/os/linux/scale.c +++ b/drivers/gpu/nvgpu/os/linux/scale.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * gk20a clock scaling profile | 2 | * gk20a clock scaling profile |
3 | * | 3 | * |
4 | * Copyright (c) 2013-2017, NVIDIA Corporation. All rights reserved. | 4 | * Copyright (c) 2013-2018, NVIDIA Corporation. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -38,7 +38,7 @@ | |||
38 | * has changed. The function calls postscaling callback if it is defined. | 38 | * has changed. The function calls postscaling callback if it is defined. |
39 | */ | 39 | */ |
40 | 40 | ||
41 | #if defined(CONFIG_COMMON_CLK) | 41 | #if defined(CONFIG_GK20A_PM_QOS) && defined(CONFIG_COMMON_CLK) |
42 | int gk20a_scale_qos_notify(struct notifier_block *nb, | 42 | int gk20a_scale_qos_notify(struct notifier_block *nb, |
43 | unsigned long n, void *p) | 43 | unsigned long n, void *p) |
44 | { | 44 | { |
@@ -71,7 +71,7 @@ int gk20a_scale_qos_notify(struct notifier_block *nb, | |||
71 | 71 | ||
72 | return NOTIFY_OK; | 72 | return NOTIFY_OK; |
73 | } | 73 | } |
74 | #else | 74 | #elif defined(CONFIG_GK20A_PM_QOS) |
75 | int gk20a_scale_qos_notify(struct notifier_block *nb, | 75 | int gk20a_scale_qos_notify(struct notifier_block *nb, |
76 | unsigned long n, void *p) | 76 | unsigned long n, void *p) |
77 | { | 77 | { |
@@ -100,6 +100,12 @@ int gk20a_scale_qos_notify(struct notifier_block *nb, | |||
100 | 100 | ||
101 | return NOTIFY_OK; | 101 | return NOTIFY_OK; |
102 | } | 102 | } |
103 | #else | ||
104 | int gk20a_scale_qos_notify(struct notifier_block *nb, | ||
105 | unsigned long n, void *p) | ||
106 | { | ||
107 | return 0; | ||
108 | } | ||
103 | #endif | 109 | #endif |
104 | 110 | ||
105 | /* | 111 | /* |
@@ -368,6 +374,7 @@ void gk20a_scale_init(struct device *dev) | |||
368 | l->devfreq = devfreq; | 374 | l->devfreq = devfreq; |
369 | } | 375 | } |
370 | 376 | ||
377 | #ifdef CONFIG_GK20A_PM_QOS | ||
371 | /* Should we register QoS callback for this device? */ | 378 | /* Should we register QoS callback for this device? */ |
372 | if (platform->qos_notify) { | 379 | if (platform->qos_notify) { |
373 | profile->qos_notify_block.notifier_call = | 380 | profile->qos_notify_block.notifier_call = |
@@ -378,6 +385,7 @@ void gk20a_scale_init(struct device *dev) | |||
378 | pm_qos_add_max_notifier(PM_QOS_GPU_FREQ_BOUNDS, | 385 | pm_qos_add_max_notifier(PM_QOS_GPU_FREQ_BOUNDS, |
379 | &profile->qos_notify_block); | 386 | &profile->qos_notify_block); |
380 | } | 387 | } |
388 | #endif | ||
381 | 389 | ||
382 | return; | 390 | return; |
383 | 391 | ||
@@ -392,12 +400,14 @@ void gk20a_scale_exit(struct device *dev) | |||
392 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | 400 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); |
393 | int err; | 401 | int err; |
394 | 402 | ||
403 | #ifdef CONFIG_GK20A_PM_QOS | ||
395 | if (platform->qos_notify) { | 404 | if (platform->qos_notify) { |
396 | pm_qos_remove_min_notifier(PM_QOS_GPU_FREQ_BOUNDS, | 405 | pm_qos_remove_min_notifier(PM_QOS_GPU_FREQ_BOUNDS, |
397 | &g->scale_profile->qos_notify_block); | 406 | &g->scale_profile->qos_notify_block); |
398 | pm_qos_remove_max_notifier(PM_QOS_GPU_FREQ_BOUNDS, | 407 | pm_qos_remove_max_notifier(PM_QOS_GPU_FREQ_BOUNDS, |
399 | &g->scale_profile->qos_notify_block); | 408 | &g->scale_profile->qos_notify_block); |
400 | } | 409 | } |
410 | #endif | ||
401 | 411 | ||
402 | if (platform->devfreq_governor) { | 412 | if (platform->devfreq_governor) { |
403 | err = devfreq_remove_device(l->devfreq); | 413 | err = devfreq_remove_device(l->devfreq); |