Overlay plane alpha channel blending is incorrect
Brief summary of the problem:
Setup KMS to scanout a solid green buffer on the primary plane and the following image on the overlay plane:
Expected result:
Actual output:
Even if the alpha in the gradient is linear, the hw has some sort of cut-out value: below a certain threshold pixels are completely transparent even though they have alpha != 0.
Hardware description:
- CPU: Zen 2
- GPU: 04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] VanGogh (rev ae)
- System Memory: N/A
- Display(s): N/A
- Type of Display Connection: eDP
System information:
- Distro name and Version: ArchLinux
- Kernel version: 5.13.0
- Custom kernel: agd5f/amd-staging-drm-next
- AMD package version: N/A
How to reproduce the issue:
Run tentative with the following config (may need to tweak the CRTC/plane IDs for your system):
# primary
plane 55 {
CRTC_ID crtc 68
CRTC_X value 0
CRTC_Y value 0
FB_ID fb {
size 800x1280
fill_color "#00FF00"
}
}
# overlay
plane 60 {
CRTC_ID crtc 68
CRTC_X value 100
CRTC_Y value 200
CRTC_W value 256
CRTC_H value 256
SRC_X value 0
SRC_Y value 0
SRC_W value 256
SRC_H value 256
FB_ID fb {
size 256x256
fill_file gradient.ARGB8888-256x256.raw
format ARGB8888
}
}
Raw buffer used for the overlay: gradient.ARGB8888-256x256.raw (obtained with: contrib/drm-convert /path/to//gradient.png ARGB8888
run in the tentative source dir)