msm: kgsl: Fix direct references to HZ

Make the various timeout values HZ agnostic by using the proper
macros and values instead.

Change-Id: I906b948657c8873518042c7465272c98c5391e59
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
This commit is contained in:
Ajay Dudani 2015-12-10 12:19:16 -08:00 committed by Artem Borisov
parent 8aad725c70
commit 38d48e1127
4 changed files with 8 additions and 13 deletions

View file

@ -63,7 +63,7 @@ Optional Properties:
- qcom,initial-powerlevel: This value indicates which qcom,gpu-pwrlevel should be used at start time
and when coming back out of resume
- qcom,step-pwrlevel: How many qcom,gpu-pwrlevel should be decremented at once
- qcom,idle-timeout: This property represents the time in microseconds for idle timeout.
- qcom,idle-timeout: This property represents the time in milliseconds for idle timeout.
- qcom,chipid: If it exists this property is used to replace
the chip identification read from the GPU hardware.
This is used to override faulty hardware readings.

View file

@ -1439,7 +1439,7 @@ static int adreno_of_get_pdata(struct platform_device *pdev)
if (adreno_of_read_property(pdev->dev.of_node, "qcom,idle-timeout",
&pdata->idle_timeout))
pdata->idle_timeout = HZ/12;
pdata->idle_timeout = 80;
pdata->strtstp_sleepwake = of_property_read_bool(pdev->dev.of_node,
"qcom,strtstp-sleepwake");

View file

@ -30,8 +30,6 @@
#define KGSL_TIMEOUT_PART 50 /* 50 msec */
#define KGSL_TIMEOUT_LONG_IB_DETECTION 2000 /* 2 sec*/
#define FIRST_TIMEOUT (HZ / 2)
/* KGSL device state is initialized to INIT when platform_probe *
* sucessfully initialized the device. Once a device has been opened *

View file

@ -491,7 +491,6 @@ static int kgsl_pwrctrl_idle_timer_store(struct device *dev,
unsigned long val;
struct kgsl_device *device = kgsl_device_from_dev(dev);
struct kgsl_pwrctrl *pwr;
const long div = 1000/HZ;
int rc;
if (device == NULL)
@ -506,9 +505,8 @@ static int kgsl_pwrctrl_idle_timer_store(struct device *dev,
mutex_lock(&device->mutex);
/* Let the timeout be requested in ms, but convert to jiffies. */
val /= div;
pwr->interval_timeout = val;
/* Let the timeout be requested in jiffies */
pwr->interval_timeout = msecs_to_jiffies(val);
mutex_unlock(&device->mutex);
@ -520,12 +518,11 @@ static int kgsl_pwrctrl_idle_timer_show(struct device *dev,
char *buf)
{
struct kgsl_device *device = kgsl_device_from_dev(dev);
int mul = 1000/HZ;
if (device == NULL)
return 0;
/* Show the idle_timeout converted to msec */
/* Show the idle_timeout in msec */
return snprintf(buf, PAGE_SIZE, "%d\n",
device->pwrctrl.interval_timeout * mul);
jiffies_to_msecs(device->pwrctrl.interval_timeout));
}
static int kgsl_pwrctrl_pmqos_latency_store(struct device *dev,
@ -1083,7 +1080,7 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
pwr->power_flags = 0;
pwr->idle_needed = pdata->idle_needed;
pwr->interval_timeout = pdata->idle_timeout;
pwr->interval_timeout = msecs_to_jiffies(pdata->idle_timeout);
pwr->strtstp_sleepwake = pdata->strtstp_sleepwake;
pwr->ebi1_clk = clk_get(&pdev->dev, "bus_clk");
if (IS_ERR(pwr->ebi1_clk))
@ -1634,7 +1631,7 @@ int kgsl_active_count_wait(struct kgsl_device *device, int count)
int ret;
mutex_unlock(&device->mutex);
ret = wait_event_timeout(device->active_cnt_wq,
_check_active_count(device, count), HZ);
_check_active_count(device, count), msecs_to_jiffies(1000));
mutex_lock(&device->mutex);
result = ret == 0 ? -ETIMEDOUT : 0;
}