]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/msm/dpu: simplify bg_alpha selection
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Mon, 12 Jan 2026 03:23:30 +0000 (05:23 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Wed, 25 Mar 2026 01:54:40 +0000 (03:54 +0200)
In order to be more obvious in fg_alpha / bg_alpha handling during the
blending programming drop the default setting for background alpha value
and set it explicitly in all cases.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/697896/
Link: https://lore.kernel.org/r/20260112-dpu-rework-alpha-v2-1-d168785911d5@oss.qualcomm.com
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c

index 6bf7c46379aed1e94555555289043987a7469ab5..ff4a8312dec6cb3e95205d0bf5f5878d45bd24ff 100644 (file)
@@ -335,13 +335,13 @@ static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer,
                max_alpha = 0x3ff;
                fg_alpha = pstate->base.alpha >> 6;
        }
-       bg_alpha = max_alpha - fg_alpha;
 
        /* default to opaque blending */
        if (pstate->base.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE ||
            !format->alpha_enable) {
                blend_op = DPU_BLEND_FG_ALPHA_FG_CONST |
                        DPU_BLEND_BG_ALPHA_BG_CONST;
+               bg_alpha = max_alpha - fg_alpha;
        } else if (pstate->base.pixel_blend_mode == DRM_MODE_BLEND_PREMULTI) {
                blend_op = DPU_BLEND_FG_ALPHA_FG_CONST |
                        DPU_BLEND_BG_ALPHA_FG_PIXEL;
@@ -350,6 +350,7 @@ static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer,
                        blend_op |= DPU_BLEND_BG_MOD_ALPHA |
                                    DPU_BLEND_BG_INV_MOD_ALPHA;
                } else {
+                       bg_alpha = 0;
                        blend_op |= DPU_BLEND_BG_INV_ALPHA;
                }
        } else {
@@ -363,6 +364,7 @@ static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer,
                                    DPU_BLEND_BG_MOD_ALPHA |
                                    DPU_BLEND_BG_INV_MOD_ALPHA;
                } else {
+                       bg_alpha = 0;
                        blend_op |= DPU_BLEND_BG_INV_ALPHA;
                }
        }