Skip to content

Commit 8f18e87

Browse files
quic-kdybcioRob Clark
authored andcommitted
drm/msm/a6xx: Simplify min_acc_len calculation
It's only necessary for some lower end parts. Also rename it to min_acc_len_64b to denote that if set, the minimum access length is 64 bits, 32b otherwise. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Konrad Dybcio <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/660977/ Signed-off-by: Rob Clark <[email protected]>
1 parent b6ce504 commit 8f18e87

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -611,14 +611,12 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
611611
if (IS_ERR(gpu->common_ubwc_cfg))
612612
return PTR_ERR(gpu->common_ubwc_cfg);
613613

614-
gpu->ubwc_config.min_acc_len = 0;
615614
gpu->ubwc_config.ubwc_swizzle = 0x6;
616615
gpu->ubwc_config.macrotile_mode = 0;
617616
gpu->ubwc_config.highest_bank_bit = 15;
618617

619618
if (adreno_is_a610(gpu)) {
620619
gpu->ubwc_config.highest_bank_bit = 13;
621-
gpu->ubwc_config.min_acc_len = 1;
622620
gpu->ubwc_config.ubwc_swizzle = 0x7;
623621
}
624622

@@ -664,10 +662,8 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
664662
gpu->ubwc_config.macrotile_mode = 1;
665663
}
666664

667-
if (adreno_is_a702(gpu)) {
665+
if (adreno_is_a702(gpu))
668666
gpu->ubwc_config.highest_bank_bit = 14;
669-
gpu->ubwc_config.min_acc_len = 1;
670-
}
671667

672668
return 0;
673669
}
@@ -687,37 +683,41 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
687683
u32 level2_swizzling_dis = !(cfg->ubwc_swizzle & BIT(1));
688684
bool ubwc_mode = qcom_ubwc_get_ubwc_mode(cfg);
689685
bool amsbc = cfg->ubwc_enc_version >= UBWC_3_0;
686+
bool min_acc_len_64b = false;
690687
u8 uavflagprd_inv = 0;
691688
u32 hbb_hi = hbb >> 2;
692689
u32 hbb_lo = hbb & 3;
693690

694691
if (adreno_is_a650_family(adreno_gpu) || adreno_is_a7xx(adreno_gpu))
695692
uavflagprd_inv = 2;
696693

694+
if (adreno_is_a610(adreno_gpu) || adreno_is_a702(adreno_gpu))
695+
min_acc_len_64b = true;
696+
697697
gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL,
698698
level2_swizzling_dis << 12 |
699699
rgb565_predicator << 11 |
700700
hbb_hi << 10 | amsbc << 4 |
701-
adreno_gpu->ubwc_config.min_acc_len << 3 |
701+
min_acc_len_64b << 3 |
702702
hbb_lo << 1 | ubwc_mode);
703703

704704
gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL,
705705
level2_swizzling_dis << 6 | hbb_hi << 4 |
706-
adreno_gpu->ubwc_config.min_acc_len << 3 |
706+
min_acc_len_64b << 3 |
707707
hbb_lo << 1 | ubwc_mode);
708708

709709
gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL,
710710
level2_swizzling_dis << 12 | hbb_hi << 10 |
711711
uavflagprd_inv << 4 |
712-
adreno_gpu->ubwc_config.min_acc_len << 3 |
712+
min_acc_len_64b << 3 |
713713
hbb_lo << 1 | ubwc_mode);
714714

715715
if (adreno_is_a7xx(adreno_gpu))
716716
gpu_write(gpu, REG_A7XX_GRAS_NC_MODE_CNTL,
717717
FIELD_PREP(GENMASK(8, 5), hbb_lo));
718718

719719
gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL,
720-
adreno_gpu->ubwc_config.min_acc_len << 23 | hbb_lo << 21);
720+
min_acc_len_64b << 23 | hbb_lo << 21);
721721

722722
gpu_write(gpu, REG_A6XX_RBBM_NC_MODE_CNTL,
723723
adreno_gpu->ubwc_config.macrotile_mode);

0 commit comments

Comments
 (0)