mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-11 19:35:45 -04:00
drm/atomic-state-helper: set pixel_blend_mode to prop default on reset
In __drm_atomic_helper_plane_state_init(), pixel_blend_mode is always
reset to DRM_MODE_BLEND_PREMULTI. That was consistent while
drm_plane_create_blend_mode_property() required PREMULTI in the
supported modes, but it now falls back to COVERAGE or PIXEL_NONE when
the driver doesn't support PREMULTI. The hardcoded default may therefore
not be a blend mode the hardware can do, nor one the property
advertises.
Initialize pixel_blend_mode from the blend mode property default
instead, keeping DRM_MODE_BLEND_PREMULTI for planes without the
property.
Fixes: 9813e158d1 ("drm/drm_blend: allow blend mode property without PREMULTI")
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
Link: https://patch.msgid.link/20260826104143.39077-2-mwen@igalia.com
This commit is contained in:
@@ -278,7 +278,14 @@ void __drm_atomic_helper_plane_state_init(struct drm_plane_state *plane_state,
|
||||
plane_state->rotation = DRM_MODE_ROTATE_0;
|
||||
|
||||
plane_state->alpha = DRM_BLEND_ALPHA_OPAQUE;
|
||||
|
||||
plane_state->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI;
|
||||
if (plane->blend_mode_property) {
|
||||
if (!drm_object_property_get_default_value(&plane->base,
|
||||
plane->blend_mode_property,
|
||||
&val))
|
||||
plane_state->pixel_blend_mode = val;
|
||||
}
|
||||
|
||||
if (plane->color_encoding_property) {
|
||||
if (!drm_object_property_get_default_value(&plane->base,
|
||||
|
||||
Reference in New Issue
Block a user