@@ -636,21 +636,16 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
636
636
637
637
if (adreno_is_a621 (gpu )) {
638
638
gpu -> ubwc_config .highest_bank_bit = 13 ;
639
- gpu -> ubwc_config .amsbc = 1 ;
640
639
gpu -> ubwc_config .uavflagprd_inv = 2 ;
641
640
}
642
641
643
642
if (adreno_is_a623 (gpu )) {
644
643
gpu -> ubwc_config .highest_bank_bit = 16 ;
645
- gpu -> ubwc_config .amsbc = 1 ;
646
644
gpu -> ubwc_config .rgb565_predicator = 1 ;
647
645
gpu -> ubwc_config .uavflagprd_inv = 2 ;
648
646
gpu -> ubwc_config .macrotile_mode = 1 ;
649
647
}
650
648
651
- if (adreno_is_a640_family (gpu ))
652
- gpu -> ubwc_config .amsbc = 1 ;
653
-
654
649
if (adreno_is_a680 (gpu ))
655
650
gpu -> ubwc_config .macrotile_mode = 1 ;
656
651
@@ -661,15 +656,13 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
661
656
adreno_is_a740_family (gpu )) {
662
657
/* TODO: get ddr type from bootloader and use 2 for LPDDR4 */
663
658
gpu -> ubwc_config .highest_bank_bit = 16 ;
664
- gpu -> ubwc_config .amsbc = 1 ;
665
659
gpu -> ubwc_config .rgb565_predicator = 1 ;
666
660
gpu -> ubwc_config .uavflagprd_inv = 2 ;
667
661
gpu -> ubwc_config .macrotile_mode = 1 ;
668
662
}
669
663
670
664
if (adreno_is_a663 (gpu )) {
671
665
gpu -> ubwc_config .highest_bank_bit = 13 ;
672
- gpu -> ubwc_config .amsbc = 1 ;
673
666
gpu -> ubwc_config .rgb565_predicator = 1 ;
674
667
gpu -> ubwc_config .uavflagprd_inv = 2 ;
675
668
gpu -> ubwc_config .macrotile_mode = 1 ;
@@ -678,7 +671,6 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
678
671
679
672
if (adreno_is_7c3 (gpu )) {
680
673
gpu -> ubwc_config .highest_bank_bit = 14 ;
681
- gpu -> ubwc_config .amsbc = 1 ;
682
674
gpu -> ubwc_config .uavflagprd_inv = 2 ;
683
675
gpu -> ubwc_config .macrotile_mode = 1 ;
684
676
}
@@ -694,13 +686,15 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
694
686
static void a6xx_set_ubwc_config (struct msm_gpu * gpu )
695
687
{
696
688
struct adreno_gpu * adreno_gpu = to_adreno_gpu (gpu );
689
+ const struct qcom_ubwc_cfg_data * cfg = adreno_gpu -> common_ubwc_cfg ;
697
690
/*
698
691
* We subtract 13 from the highest bank bit (13 is the minimum value
699
692
* allowed by hw) and write the lowest two bits of the remaining value
700
693
* as hbb_lo and the one above it as hbb_hi to the hardware.
701
694
*/
702
695
BUG_ON (adreno_gpu -> ubwc_config .highest_bank_bit < 13 );
703
696
u32 hbb = adreno_gpu -> ubwc_config .highest_bank_bit - 13 ;
697
+ bool amsbc = cfg -> ubwc_enc_version >= UBWC_3_0 ;
704
698
u32 hbb_hi = hbb >> 2 ;
705
699
u32 hbb_lo = hbb & 3 ;
706
700
u32 ubwc_mode = adreno_gpu -> ubwc_config .ubwc_swizzle & 1 ;
@@ -709,7 +703,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
709
703
gpu_write (gpu , REG_A6XX_RB_NC_MODE_CNTL ,
710
704
level2_swizzling_dis << 12 |
711
705
adreno_gpu -> ubwc_config .rgb565_predicator << 11 |
712
- hbb_hi << 10 | adreno_gpu -> ubwc_config . amsbc << 4 |
706
+ hbb_hi << 10 | amsbc << 4 |
713
707
adreno_gpu -> ubwc_config .min_acc_len << 3 |
714
708
hbb_lo << 1 | ubwc_mode );
715
709
0 commit comments