Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/msm/a6xx: missing UBWC L2/L3 swizzle disable in
  a6xx_set_ubwc_config()
--

commit 0728c6891f9936a41b152874415dd989fc9326a8
Author: Shivam Rawat <[email protected]>

drm/msm/a6xx: Add Adreno 753 support

This commit adds an A7xx catalog entry, an adreno_is_a753() helper, and
hardware initialization adjustments for the Adreno 753 GPU in the Qualcomm
Nord SoC.

> diff --git a/drivers/gpu/drm/msm/adreno/a7xx_catalog.c 
> b/drivers/gpu/drm/msm/adreno/a7xx_catalog.c
> index 6f704898cea6e..9465ffa3dd12e 100644
> --- a/drivers/gpu/drm/msm/adreno/a7xx_catalog.c
> +++ b/drivers/gpu/drm/msm/adreno/a7xx_catalog.c
> @@ -451,6 +451,41 @@ static const struct adreno_info a7xx_gpus[] = {
>                       },
>               },
>               .preempt_record_size = 3572 * SZ_1K,
> +     }, {
> +             .chip_ids = ADRENO_CHIP_IDS(0x43051701), /* "C523v2" */
> +             .family = ADRENO_7XX_GEN3,
> +             .fw = {
> +                     [ADRENO_FW_SQE] = "gen71300_sqe.fw",
> +                     [ADRENO_FW_GMU] = "gen71300_gmu.bin",
> +             },
> +             .gmem = 3 * SZ_1M,
> +             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
> +             .quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT |
> +                       ADRENO_QUIRK_HAS_HW_APRIV |
> +                       ADRENO_QUIRK_PREEMPTION |
> +                       ADRENO_QUIRK_IFPC,
> +             .funcs = &a7xx_gpu_funcs,

[Severity: High]
Does a6xx_set_ubwc_config() need to disable level 3 UBWC bank swizzling
and program the swizzle disable bits into REG_A7XX_GRAS_NC_MODE_CNTL for
Adreno 753 on Nord?

In drivers/soc/qcom/ubwc_config.c, "qcom,nord" maps to glymur_data, which
sets both UBWC_FLAG_DISABLE_SWIZZLE_LVL2 and
UBWC_FLAG_DISABLE_SWIZZLE_LVL3.  That configuration is exposed to
userspace via MSM_PARAM_UBWC_SWIZZLE and programmed into MDSS and Iris,
and a8xx_set_ubwc_config() writes both level2_swizzling_dis and
level3_swizzling_dis for other glymur_data platforms.

Adreno 753 uses a7xx_gpu_funcs -> hw_init() -> a6xx_set_ubwc_config(),
which only checks UBWC_SWIZZLE_ENABLE_LVL2 and omits level 3 swizzle
disable from REG_A6XX_RB_NC_MODE_CNTL, REG_A6XX_TPL1_NC_MODE_CNTL and
REG_A6XX_SP_NC_MODE_CNTL, and writes neither level2_swizzling_dis nor
level3_swizzling_dis to REG_A7XX_GRAS_NC_MODE_CNTL:

drivers/gpu/drm/msm/adreno/a6xx_gpu.c:a6xx_set_ubwc_config() {
        ...
        u32 level2_swizzling_dis = !(qcom_ubwc_swizzle(cfg) & 
UBWC_SWIZZLE_ENABLE_LVL2);
        ...
        if (adreno_is_a7xx(adreno_gpu)) {
                for (u32 pipe_id = PIPE_BR; pipe_id <= PIPE_BV; pipe_id++) {
                        gpu_write(gpu, REG_A7XX_CP_APERTURE_CNTL_HOST,
                                  A7XX_CP_APERTURE_CNTL_HOST_PIPE(pipe_id));
                        gpu_write(gpu, REG_A7XX_GRAS_NC_MODE_CNTL,
                                  FIELD_PREP(GENMASK(8, 5), hbb_lo));
                }
        ...
}

Leaving level 3 swizzling enabled in RB/TPL1/SP and both level 2 and
level 3 swizzling enabled in GRAS mismatches the rest of the SoC and
userspace, corrupting UBWC surfaces during rendering and buffer sharing.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to