diff --git a/Documentation/devicetree/bindings/gpu/adreno.txt b/Documentation/devicetree/bindings/gpu/adreno.txt index 335df8f7fb96..5f8e58789e71 100644 --- a/Documentation/devicetree/bindings/gpu/adreno.txt +++ b/Documentation/devicetree/bindings/gpu/adreno.txt @@ -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 diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c index 01256ed738e9..68afea123c57 100644 --- a/drivers/gpu/msm/adreno.c +++ b/drivers/gpu/msm/adreno.c @@ -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; diff --git a/drivers/gpu/msm/kgsl_pwrscale.c b/drivers/gpu/msm/kgsl_pwrscale.c index e9f190974ac4..d93e67caf3fa 100644 --- a/drivers/gpu/msm/kgsl_pwrscale.c +++ b/drivers/gpu/msm/kgsl_pwrscale.c @@ -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; } diff --git a/include/linux/msm_kgsl.h b/include/linux/msm_kgsl.h index f67da6fed529..8391c685f82f 100644 --- a/include/linux/msm_kgsl.h +++ b/include/linux/msm_kgsl.h @@ -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;