diff options
Diffstat (limited to 'drivers/gpu/drm/msm/adreno/a3xx_gpu.c')
| -rw-r--r-- | drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 21 | 
1 files changed, 19 insertions, 2 deletions
| diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c index f29c77d9cd42..93da6683a866 100644 --- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c @@ -519,6 +519,8 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)  	struct msm_gpu *gpu;  	struct msm_drm_private *priv = dev->dev_private;  	struct platform_device *pdev = priv->gpu_pdev; +	struct icc_path *ocmem_icc_path; +	struct icc_path *icc_path;  	int ret;  	if (!pdev) { @@ -566,13 +568,28 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)  		goto fail;  	} +	icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem"); +	ret = IS_ERR(icc_path); +	if (ret) +		goto fail; + +	ocmem_icc_path = devm_of_icc_get(&pdev->dev, "ocmem"); +	ret = IS_ERR(ocmem_icc_path); +	if (ret) { +		/* allow -ENODATA, ocmem icc is optional */ +		if (ret != -ENODATA) +			goto fail; +		ocmem_icc_path = NULL; +	} + +  	/*  	 * Set the ICC path to maximum speed for now by multiplying the fastest  	 * frequency by the bus width (8). We'll want to scale this later on to  	 * improve battery life.  	 */ -	icc_set_bw(gpu->icc_path, 0, Bps_to_icc(gpu->fast_rate) * 8); -	icc_set_bw(gpu->ocmem_icc_path, 0, Bps_to_icc(gpu->fast_rate) * 8); +	icc_set_bw(icc_path, 0, Bps_to_icc(gpu->fast_rate) * 8); +	icc_set_bw(ocmem_icc_path, 0, Bps_to_icc(gpu->fast_rate) * 8);  	return gpu; | 
