summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuman Tatiraju <sumant@codeaurora.org>2015-12-15 07:49:41 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:15:24 -0700
commit6a1704d165de9e44a2798c9cb0d9dd51c9f526b5 (patch)
tree4ba1ecc78ac680172f33cee8ad3f134e26dec2f6
parent505dc37e5b43c3a8765909023a7f3245183f902b (diff)
msm: kgsl: Fix direct references to HZ
Make the various timeout values HZ agnostic by using the proper macros and values instead. Change-Id: I708cd491f593782f0172cd7d2cca058cd41044a5 Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
-rw-r--r--Documentation/devicetree/bindings/gpu/adreno.txt4
-rw-r--r--arch/arm/boot/dts/qcom/msm8996-gpu.dtsi4
-rw-r--r--drivers/gpu/msm/adreno.c8
-rw-r--r--drivers/gpu/msm/adreno_dispatch.c3
-rw-r--r--drivers/gpu/msm/adreno_profile.c2
-rw-r--r--drivers/gpu/msm/kgsl_device.h2
-rw-r--r--drivers/gpu/msm/kgsl_pwrctrl.c6
7 files changed, 15 insertions, 14 deletions
diff --git a/Documentation/devicetree/bindings/gpu/adreno.txt b/Documentation/devicetree/bindings/gpu/adreno.txt
index 84cbc21705e9..3bbda5962036 100644
--- a/Documentation/devicetree/bindings/gpu/adreno.txt
+++ b/Documentation/devicetree/bindings/gpu/adreno.txt
@@ -83,8 +83,8 @@ Optional Properties:
bus width and actual bus transactions.
- qcom,gpubw-dev: a phandle to a device representing bus bandwidth requirements
(see devdw.txt)
-- qcom,idle-timeout: This property represents the time in microseconds for idle timeout.
-- qcom,deep-nap-timeout: This property represents the time in microseconds for entering deeper
+- qcom,idle-timeout: This property represents the time in milliseconds for idle timeout.
+- qcom,deep-nap-timeout: This property represents the time in milliseconds for entering deeper
power state.
- qcom,chipid: If it exists this property is used to replace
the chip identification read from the GPU hardware.
diff --git a/arch/arm/boot/dts/qcom/msm8996-gpu.dtsi b/arch/arm/boot/dts/qcom/msm8996-gpu.dtsi
index 19ec95f7338a..6dd62e002240 100644
--- a/arch/arm/boot/dts/qcom/msm8996-gpu.dtsi
+++ b/arch/arm/boot/dts/qcom/msm8996-gpu.dtsi
@@ -67,12 +67,12 @@
qcom,initial-pwrlevel = <2>;
- qcom,idle-timeout = <8>; //<HZ/12>
+ qcom,idle-timeout = <80>; //msecs
/*
* Timeout to enter deeper power saving state
* from NAP.
*/
- qcom,deep-nap-timeout = <2>; //<HZ/50>
+ qcom,deep-nap-timeout = <20>; //msecs
qcom,strtstp-sleepwake;
/* Trace bus */
diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c
index 19ada99c26ed..87c2f24dd317 100644
--- a/drivers/gpu/msm/adreno.c
+++ b/drivers/gpu/msm/adreno.c
@@ -950,6 +950,7 @@ static int adreno_of_get_power(struct adreno_device *adreno_dev,
struct kgsl_pwrctrl *pwr = &device->pwrctrl;
struct device_node *node = pdev->dev.of_node;
int i, init_level;
+ unsigned int timeout;
if (of_property_read_string(node, "label", &pdev->name)) {
KGSL_CORE_ERR("Unable to read 'label'\n");
@@ -987,9 +988,10 @@ static int adreno_of_get_power(struct adreno_device *adreno_dev,
&device->pwrctrl.pm_qos_wakeup_latency))
device->pwrctrl.pm_qos_wakeup_latency = 101;
- if (of_property_read_u32(node, "qcom,idle-timeout",
- (unsigned int *) &device->pwrctrl.interval_timeout))
- device->pwrctrl.interval_timeout = HZ/12;
+ if (of_property_read_u32(node, "qcom,idle-timeout", &timeout))
+ timeout = 80;
+
+ device->pwrctrl.interval_timeout = msecs_to_jiffies(timeout);
device->pwrctrl.strtstp_sleepwake =
of_property_read_bool(node, "qcom,strtstp-sleepwake");
diff --git a/drivers/gpu/msm/adreno_dispatch.c b/drivers/gpu/msm/adreno_dispatch.c
index 6daf6977829e..48d37f4a5651 100644
--- a/drivers/gpu/msm/adreno_dispatch.c
+++ b/drivers/gpu/msm/adreno_dispatch.c
@@ -408,7 +408,8 @@ static struct kgsl_cmdbatch *_get_cmdbatch(struct adreno_context *drawctxt)
* it hasn't already been started
*/
if (!cmdbatch->timeout_jiffies) {
- cmdbatch->timeout_jiffies = jiffies + 5 * HZ;
+ cmdbatch->timeout_jiffies =
+ jiffies + msecs_to_jiffies(5000);
mod_timer(&cmdbatch->timer, cmdbatch->timeout_jiffies);
}
diff --git a/drivers/gpu/msm/adreno_profile.c b/drivers/gpu/msm/adreno_profile.c
index 5476f9892f89..5d5eedcaa798 100644
--- a/drivers/gpu/msm/adreno_profile.c
+++ b/drivers/gpu/msm/adreno_profile.c
@@ -984,7 +984,7 @@ static ssize_t profile_pipe_print(struct file *filep, char __user *ubuf,
mutex_unlock(&device->mutex);
set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(HZ / 10);
+ schedule_timeout(msecs_to_jiffies(100));
mutex_lock(&device->mutex);
if (signal_pending(current)) {
diff --git a/drivers/gpu/msm/kgsl_device.h b/drivers/gpu/msm/kgsl_device.h
index 21735be92b05..71047a727f1b 100644
--- a/drivers/gpu/msm/kgsl_device.h
+++ b/drivers/gpu/msm/kgsl_device.h
@@ -31,8 +31,6 @@
#define KGSL_TIMEOUT_DEFAULT 0xFFFFFFFF
#define KGSL_TIMEOUT_PART 50 /* 50 msec */
-#define FIRST_TIMEOUT (HZ / 2)
-
#define KGSL_IOCTL_FUNC(_cmd, _func) \
[_IOC_NR((_cmd))] = \
{ .cmd = (_cmd), .func = (_func) }
diff --git a/drivers/gpu/msm/kgsl_pwrctrl.c b/drivers/gpu/msm/kgsl_pwrctrl.c
index 8e8e9b2944bf..671639be249a 100644
--- a/drivers/gpu/msm/kgsl_pwrctrl.c
+++ b/drivers/gpu/msm/kgsl_pwrctrl.c
@@ -46,7 +46,7 @@
#define MAX_UDELAY 2000
/* Number of jiffies for a full thermal cycle */
-#define TH_HZ 20
+#define TH_HZ (HZ/5)
#define KGSL_MAX_BUSLEVELS 20
@@ -1659,7 +1659,7 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
if (of_property_read_u32(pdev->dev.of_node, "qcom,deep-nap-timeout",
&pwr->deep_nap_timeout))
- pwr->deep_nap_timeout = HZ/50;
+ pwr->deep_nap_timeout = 20;
pwr->gx_retention = of_property_read_bool(pdev->dev.of_node,
"qcom,gx-retention");
@@ -2149,7 +2149,7 @@ _nap(struct kgsl_device *device)
kgsl_pwrscale_update_stats(device);
mod_timer(&device->pwrctrl.deep_nap_timer, jiffies +
- device->pwrctrl.deep_nap_timeout);
+ msecs_to_jiffies(device->pwrctrl.deep_nap_timeout));
kgsl_pwrctrl_clk(device, KGSL_PWRFLAGS_OFF, KGSL_STATE_NAP);
kgsl_pwrctrl_set_state(device, KGSL_STATE_NAP);