Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/drm_atomic: duplicate colorop states if plane color pipeline in use

For suspend/resume to work correctly, do for colorop state the same we
do for plane/crtc/connector states: duplicate the state of colorops in a
color pipeline if it's in use by a given plane when suspending and
restore cached colorop states when resuming. While at it, prevent
unused-variable warning when using for_each_new_colorop_in_stage here.

Fixes: 2afc3184f3b3 ("drm/plane: Add COLOR PIPELINE property")
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
Link: https://patch.msgid.link/20260318163629.300627-1-mwen@igalia.com
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>

authored by

Melissa Wen and committed by
Melissa Wen
6bf7969a 6597ff1d

+14 -1
+12
drivers/gpu/drm/drm_atomic_helper.c
··· 3751 3751 err = PTR_ERR(plane_state); 3752 3752 goto free; 3753 3753 } 3754 + 3755 + if (plane_state->color_pipeline) { 3756 + err = drm_atomic_add_affected_colorops(state, plane); 3757 + if (err) 3758 + goto free; 3759 + } 3760 + 3754 3761 } 3755 3762 3756 3763 drm_connector_list_iter_begin(dev, &conn_iter); ··· 3863 3856 int i, ret; 3864 3857 struct drm_plane *plane; 3865 3858 struct drm_plane_state *new_plane_state; 3859 + struct drm_colorop *colorop; 3860 + struct drm_colorop_state *new_colorop_state; 3866 3861 struct drm_connector *connector; 3867 3862 struct drm_connector_state *new_conn_state; 3868 3863 struct drm_crtc *crtc; 3869 3864 struct drm_crtc_state *new_crtc_state; 3870 3865 3871 3866 state->acquire_ctx = ctx; 3867 + 3868 + for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) 3869 + state->colorops[i].old_state = colorop->state; 3872 3870 3873 3871 for_each_new_plane_in_state(state, plane, new_plane_state, i) 3874 3872 state->planes[i].old_state = plane->state;
+2 -1
include/drm/drm_atomic.h
··· 1089 1089 for_each_if ((__state)->colorops[__i].ptr && \ 1090 1090 ((colorop) = (__state)->colorops[__i].ptr, \ 1091 1091 (void)(colorop) /* Only to avoid unused-but-set-variable warning */, \ 1092 - (new_colorop_state) = (__state)->colorops[__i].new_state, 1)) 1092 + (new_colorop_state) = (__state)->colorops[__i].new_state,\ 1093 + (void)(new_colorop_state) /* Only to avoid unused-but-set-variable warning */, 1)) 1093 1094 1094 1095 /** 1095 1096 * for_each_oldnew_plane_in_state - iterate over all planes in an atomic update