@@ -604,8 +604,13 @@ static void a6xx_set_cp_protect(struct msm_gpu *gpu)
604
604
gpu_write (gpu , REG_A6XX_CP_PROTECT (protect -> count_max - 1 ), protect -> regs [i ]);
605
605
}
606
606
607
- static void a6xx_calc_ubwc_config (struct adreno_gpu * gpu )
607
+ static int a6xx_calc_ubwc_config (struct adreno_gpu * gpu )
608
608
{
609
+ /* Inherit the common config and make some necessary fixups */
610
+ gpu -> common_ubwc_cfg = qcom_ubwc_config_get_data ();
611
+ if (IS_ERR (gpu -> common_ubwc_cfg ))
612
+ return PTR_ERR (gpu -> common_ubwc_cfg );
613
+
609
614
gpu -> ubwc_config .rgb565_predicator = 0 ;
610
615
gpu -> ubwc_config .uavflagprd_inv = 0 ;
611
616
gpu -> ubwc_config .min_acc_len = 0 ;
@@ -682,6 +687,8 @@ static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
682
687
gpu -> ubwc_config .highest_bank_bit = 14 ;
683
688
gpu -> ubwc_config .min_acc_len = 1 ;
684
689
}
690
+
691
+ return 0 ;
685
692
}
686
693
687
694
static void a6xx_set_ubwc_config (struct msm_gpu * gpu )
@@ -2563,7 +2570,12 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
2563
2570
msm_mmu_set_fault_handler (to_msm_vm (gpu -> vm )-> mmu , gpu ,
2564
2571
a6xx_fault_handler );
2565
2572
2566
- a6xx_calc_ubwc_config (adreno_gpu );
2573
+ ret = a6xx_calc_ubwc_config (adreno_gpu );
2574
+ if (ret ) {
2575
+ a6xx_destroy (& (a6xx_gpu -> base .base ));
2576
+ return ERR_PTR (ret );
2577
+ }
2578
+
2567
2579
/* Set up the preemption specific bits and pieces for each ringbuffer */
2568
2580
a6xx_preempt_init (gpu );
2569
2581
0 commit comments