Skip to content

Commit 87cfc79

Browse files
quic-kdybcioRob Clark
authored andcommitted
drm/msm/a6xx: Resolve the meaning of UBWC_MODE
This bit is set iff the UBWC version is 1.0. That notably does not include QCM2290's "no UBWC". This commit is intentionally cross-subsystem to ease review, as the patchset is intended to be merged together, with a maintainer consensus. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Konrad Dybcio <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/660971/ Signed-off-by: Rob Clark <[email protected]>
1 parent 32ef24e commit 87cfc79

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,11 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
687687
*/
688688
BUG_ON(adreno_gpu->ubwc_config.highest_bank_bit < 13);
689689
u32 hbb = adreno_gpu->ubwc_config.highest_bank_bit - 13;
690+
bool ubwc_mode = qcom_ubwc_get_ubwc_mode(cfg);
690691
bool amsbc = cfg->ubwc_enc_version >= UBWC_3_0;
691692
u8 uavflagprd_inv = 0;
692693
u32 hbb_hi = hbb >> 2;
693694
u32 hbb_lo = hbb & 3;
694-
u32 ubwc_mode = adreno_gpu->ubwc_config.ubwc_swizzle & 1;
695695
u32 level2_swizzling_dis = !(adreno_gpu->ubwc_config.ubwc_swizzle & 2);
696696

697697
if (adreno_is_a650_family(adreno_gpu) || adreno_is_a7xx(adreno_gpu))

include/linux/soc/qcom/ubwc.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,14 @@ static inline const struct qcom_ubwc_cfg_data *qcom_ubwc_config_get_data(void)
6262
}
6363
#endif
6464

65+
static inline bool qcom_ubwc_get_ubwc_mode(const struct qcom_ubwc_cfg_data *cfg)
66+
{
67+
bool ret = cfg->ubwc_enc_version == UBWC_1_0;
68+
69+
if (ret && !(cfg->ubwc_swizzle & BIT(0)))
70+
pr_err("UBWC config discrepancy - level 1 swizzling disabled on UBWC 1.0\n");
71+
72+
return ret;
73+
}
74+
6575
#endif /* __QCOM_UBWC_H__ */

0 commit comments

Comments
 (0)