On 1/19/26 1:16 PM, Dmitry Baryshkov wrote:
> Code in dpu_hw_sspp_setup_format() doesn't handle UBWC versions bigger
> than 4.0. Replace switch-case with if-else checks, making sure that the
> register is initialized on UBWC 5.x (and later) hosts.
> 
> Fixes: c2577fc1740d ("drm/msm/dpu: Add support for SM8750")
> Tested-by: Val Packett <[email protected]> # x1e80100-dell-latitude-7455
> Signed-off-by: Dmitry Baryshkov <[email protected]>
> ---

[...]

> +             if (ctx->ubwc->ubwc_enc_version == UBWC_1_0) {
>                       fast_clear = fmt->alpha_enable ? BIT(31) : 0;
> -                     DPU_REG_WRITE(c, ubwc_ctrl_off,
> -                                     fast_clear | (ctx->ubwc->ubwc_swizzle & 
> 0x1) |
> -                                     BIT(8) |
> -                                     (hbb << 4));
> -                     break;
> -             case UBWC_2_0:
> +                     ctrl_val = fast_clear | (ctx->ubwc->ubwc_swizzle & 0x1) 
> |
> +                             BIT(8) | (hbb << 4);
> +             } else if (ctx->ubwc->ubwc_enc_version == UBWC_2_0) {
>                       fast_clear = fmt->alpha_enable ? BIT(31) : 0;
> -                     DPU_REG_WRITE(c, ubwc_ctrl_off,
> -                                     fast_clear | (ctx->ubwc->ubwc_swizzle) |
> -                                     (hbb << 4));
> -                     break;
> -             case UBWC_3_0:
> -                     DPU_REG_WRITE(c, ubwc_ctrl_off,
> -                                     BIT(30) | (ctx->ubwc->ubwc_swizzle) |
> -                                     (hbb << 4));
> -                     break;
> -             case UBWC_4_0:
> -                     DPU_REG_WRITE(c, ubwc_ctrl_off,
> -                                     MSM_FORMAT_IS_YUV(fmt) ? 0 : BIT(30));
> -                     break;
> +                     ctrl_val = fast_clear | ctx->ubwc->ubwc_swizzle | (hbb 
> << 4);
> +             } else if (ctx->ubwc->ubwc_enc_version == UBWC_3_0) {
> +                     ctrl_val = BIT(30) | (ctx->ubwc->ubwc_swizzle) | (hbb 
> << 4);

This is pre-existing, but BIT(30) is not unconditional in SDE for v3

For this patch

Reviewed-by: Konrad Dybcio <[email protected]>

Konrad

Reply via email to