gpu_write(gpu, REG_A6XX_CP_PROTECT(protect->count_max - 1), protect->regs[i]);
}
-static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
+static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
{
+ /* Inherit the common config and make some necessary fixups */
+ gpu->common_ubwc_cfg = qcom_ubwc_config_get_data();
+ if (IS_ERR(gpu->common_ubwc_cfg))
+ return PTR_ERR(gpu->common_ubwc_cfg);
+
gpu->ubwc_config.rgb565_predicator = 0;
gpu->ubwc_config.uavflagprd_inv = 0;
gpu->ubwc_config.min_acc_len = 0;
gpu->ubwc_config.highest_bank_bit = 14;
gpu->ubwc_config.min_acc_len = 1;
}
+
+ return 0;
}
static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
msm_mmu_set_fault_handler(to_msm_vm(gpu->vm)->mmu, gpu,
a6xx_fault_handler);
- a6xx_calc_ubwc_config(adreno_gpu);
+ ret = a6xx_calc_ubwc_config(adreno_gpu);
+ if (ret) {
+ a6xx_destroy(&(a6xx_gpu->base.base));
+ return ERR_PTR(ret);
+ }
+
/* Set up the preemption specific bits and pieces for each ringbuffer */
a6xx_preempt_init(gpu);
#include <linux/firmware.h>
#include <linux/iopoll.h>
+#include <linux/soc/qcom/ubwc.h>
+
#include "msm_gpu.h"
#include "adreno_common.xml.h"
*/
u32 macrotile_mode;
} ubwc_config;
+ const struct qcom_ubwc_cfg_data *common_ubwc_cfg;
/*
* Register offsets are different between some GPUs.