@@ -1753,6 +1753,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
struct msm_drm_private *priv = dev->dev_private;
struct platform_device *pdev = priv->gpu_pdev;
struct adreno_platform_config *config = pdev->dev.platform_data;
+ const struct qcom_ubwc_cfg_data *common_cfg;
struct a5xx_gpu *a5xx_gpu = NULL;
struct adreno_gpu *adreno_gpu;
struct msm_gpu *gpu;
@@ -1789,15 +1790,12 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
/* Set up the preemption specific bits and pieces for each ringbuffer */
a5xx_preempt_init(gpu);
- /* Set the highest bank bit */
- if (adreno_is_a540(adreno_gpu) || adreno_is_a530(adreno_gpu))
- adreno_gpu->ubwc_config->highest_bank_bit = 2;
- else
- adreno_gpu->ubwc_config->highest_bank_bit = 1;
+ /* Inherit the common config and make some necessary fixups */
+ common_cfg = qcom_ubwc_config_get_data();
+ if (IS_ERR(common_cfg))
+ return ERR_PTR(-EINVAL);
- /* a5xx only supports UBWC 1.0, these are not configurable */
- adreno_gpu->ubwc_config->macrotile_mode = 0;
- adreno_gpu->ubwc_config->ubwc_swizzle = 0x7;
+ *adreno_gpu->ubwc_config = *common_cfg;
adreno_gpu->uche_trap_base = 0x0001ffffffff0000ull;