Skip to content

Commit 367380d

Browse files
quic-kdybcioRob Clark
authored andcommitted
drm/msm/a6xx: Resolve the meaning of AMSBC
The bit must be set to 1 if the UBWC encoder version is >= 3.0, drop it as a separate field. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Konrad Dybcio <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/660967/ Signed-off-by: Rob Clark <[email protected]>
1 parent 560c98b commit 367380d

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -636,21 +636,16 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
636636

637637
if (adreno_is_a621(gpu)) {
638638
gpu->ubwc_config.highest_bank_bit = 13;
639-
gpu->ubwc_config.amsbc = 1;
640639
gpu->ubwc_config.uavflagprd_inv = 2;
641640
}
642641

643642
if (adreno_is_a623(gpu)) {
644643
gpu->ubwc_config.highest_bank_bit = 16;
645-
gpu->ubwc_config.amsbc = 1;
646644
gpu->ubwc_config.rgb565_predicator = 1;
647645
gpu->ubwc_config.uavflagprd_inv = 2;
648646
gpu->ubwc_config.macrotile_mode = 1;
649647
}
650648

651-
if (adreno_is_a640_family(gpu))
652-
gpu->ubwc_config.amsbc = 1;
653-
654649
if (adreno_is_a680(gpu))
655650
gpu->ubwc_config.macrotile_mode = 1;
656651

@@ -661,15 +656,13 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
661656
adreno_is_a740_family(gpu)) {
662657
/* TODO: get ddr type from bootloader and use 2 for LPDDR4 */
663658
gpu->ubwc_config.highest_bank_bit = 16;
664-
gpu->ubwc_config.amsbc = 1;
665659
gpu->ubwc_config.rgb565_predicator = 1;
666660
gpu->ubwc_config.uavflagprd_inv = 2;
667661
gpu->ubwc_config.macrotile_mode = 1;
668662
}
669663

670664
if (adreno_is_a663(gpu)) {
671665
gpu->ubwc_config.highest_bank_bit = 13;
672-
gpu->ubwc_config.amsbc = 1;
673666
gpu->ubwc_config.rgb565_predicator = 1;
674667
gpu->ubwc_config.uavflagprd_inv = 2;
675668
gpu->ubwc_config.macrotile_mode = 1;
@@ -678,7 +671,6 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
678671

679672
if (adreno_is_7c3(gpu)) {
680673
gpu->ubwc_config.highest_bank_bit = 14;
681-
gpu->ubwc_config.amsbc = 1;
682674
gpu->ubwc_config.uavflagprd_inv = 2;
683675
gpu->ubwc_config.macrotile_mode = 1;
684676
}
@@ -694,13 +686,15 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
694686
static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
695687
{
696688
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
689+
const struct qcom_ubwc_cfg_data *cfg = adreno_gpu->common_ubwc_cfg;
697690
/*
698691
* We subtract 13 from the highest bank bit (13 is the minimum value
699692
* allowed by hw) and write the lowest two bits of the remaining value
700693
* as hbb_lo and the one above it as hbb_hi to the hardware.
701694
*/
702695
BUG_ON(adreno_gpu->ubwc_config.highest_bank_bit < 13);
703696
u32 hbb = adreno_gpu->ubwc_config.highest_bank_bit - 13;
697+
bool amsbc = cfg->ubwc_enc_version >= UBWC_3_0;
704698
u32 hbb_hi = hbb >> 2;
705699
u32 hbb_lo = hbb & 3;
706700
u32 ubwc_mode = adreno_gpu->ubwc_config.ubwc_swizzle & 1;
@@ -709,7 +703,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
709703
gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL,
710704
level2_swizzling_dis << 12 |
711705
adreno_gpu->ubwc_config.rgb565_predicator << 11 |
712-
hbb_hi << 10 | adreno_gpu->ubwc_config.amsbc << 4 |
706+
hbb_hi << 10 | amsbc << 4 |
713707
adreno_gpu->ubwc_config.min_acc_len << 3 |
714708
hbb_lo << 1 | ubwc_mode);
715709

0 commit comments

Comments
 (0)