Repository navigation
drm/vc4: hvs6: Fix plane alpha with Pre-multiplied and None blend modes - #7703
Open
popcornmix wants to merge 2 commits into
Open
popcornmix wants to merge 2 commits into
popcornmix wants to merge 2 commits into
Conversation
…alpha On BCM2712 D0, a format with no alpha channel takes its alpha from the plane alpha property (ALPHA_MASK_FIXED). With the default "Pre-multiplied" blend mode the ALPHA_PREMULT flag was still set, so the HVS treated the colour as already multiplied by the plane alpha and added it unscaled on top of the planes below. The KMS blend modes are all equivalent when there is no pixel alpha, so only set ALPHA_PREMULT when the format has an alpha channel, as the other generations already do. Fixes: raspberrypi#7700 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
With the "None" pixel blend mode the HVS takes the plane alpha property as a fixed alpha. For a format with an alpha channel ALPHA_MIX was also set, multiplying the plane alpha in a second time, so a plane alpha of 0.5 blended at 0.25. Seen on both BCM2712 C1 and D0. Don't set ALPHA_MIX when the blend mode is "None". Signed-off-by: Dom Cobley <popcornmix@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two plane alpha bugs on BCM2712:
ALPHA_PREMULT, so the plane was added unfaded on top of the planes below.Tested by capturing through writeback on Pi 500 (D0, 7.3 kernel) and Pi 5 (C1, 6.18.57 kernel): with plane alpha 0.5, every blend mode on XRGB8888 and on ARGB8888 (pixel alpha 0xff, 0x80, 0x00) now matches the formulas in
drm_blend.c.Fixes #7700