msm: kgsl: Enable GPU POPP feature based on target

Disable POPP feature by default for all targets
and enable for a specific target by adding the
entry in its dtsi file.

Conflicts:
	Documentation/devicetree/bindings/gpu/adreno.txt

Change-Id: I1c2ed1af9e94470ef734b75bb2af3e093517b35d
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
This commit is contained in:
Sunil Khatri 2015-07-24 15:58:23 +05:30
parent dea45bfcbd
commit 562540687b
4 changed files with 15 additions and 1 deletions

View file

@ -107,6 +107,8 @@ Optional Properties:
- qcom,pm-qos-wakeup-latency:
Similar to the above. Driver votes against deep low
power modes right before GPU wakes up from sleep.
- qcom,popp-enable:
Boolean. Enables the POPP feature in the gpu kernel driver.
The following properties are optional as collecting data via coresight might
not be supported for every chipset. The documentation for coresight

View file

@ -974,6 +974,9 @@ static int adreno_of_get_pdata(struct platform_device *pdev)
pdata->bus_control = of_property_read_bool(pdev->dev.of_node,
"qcom,bus-control");
pdata->popp_enable = of_property_read_bool(pdev->dev.of_node,
"qcom,popp-enable");
if (adreno_of_read_property(pdev->dev.of_node, "qcom,clk-map",
&pdata->clk_map))
goto err;

View file

@ -743,6 +743,7 @@ int kgsl_pwrscale_init(struct device *dev, const char *governor)
{
struct kgsl_device *device;
struct kgsl_pwrscale *pwrscale;
struct kgsl_device_platform_data *pdata;
struct kgsl_pwrctrl *pwr;
struct devfreq *devfreq;
struct devfreq *bus_devfreq;
@ -756,6 +757,7 @@ int kgsl_pwrscale_init(struct device *dev, const char *governor)
if (device == NULL)
return -ENODEV;
pdata = dev_get_platdata(&device->pdev->dev);
pwrscale = &device->pwrscale;
pwr = &device->pwrctrl;
gpu_profile = &pwrscale->gpu_profile;
@ -845,7 +847,12 @@ int kgsl_pwrscale_init(struct device *dev, const char *governor)
sizeof(struct kgsl_pwr_event), GFP_KERNEL);
pwrscale->history[i].type = i;
}
set_bit(POPP_ON, &pwrscale->popp_state);
/*
* Enable POPP feature if target supports it, by default
* it is disabled.
*/
if (pdata->popp_enable)
set_bit(POPP_ON, &pwrscale->popp_state);
return 0;
}

View file

@ -47,6 +47,7 @@ struct kgsl_pwrlevel {
* @idle_timeout: Timeout for GPU to turn its resources off
* @strtstp_sleepwake: Flag to decide b/w SLEEP and SLUMBER
* @bus_control: Flag if independent bus voting is supported
* @popp_enable: Flag to enable POPP feature
* @clk_map: Clocks map per platform
* @bus_scale_table: Bus table with different b/w votes
* @iommu_data: Struct holding iommu context data
@ -64,6 +65,7 @@ struct kgsl_device_platform_data {
unsigned int idle_timeout;
bool strtstp_sleepwake;
bool bus_control;
bool popp_enable;
unsigned int clk_map;
unsigned int step_mul;
struct msm_bus_scale_pdata *bus_scale_table;