Re: [PATCH v4 00/16] drm/msm/dp: perform misc cleanups

2024-12-21 Thread Dmitry Baryshkov
On Mon, 16 Dec 2024 00:44:05 +0200, Dmitry Baryshkov wrote: > - Fix register programming in the dp_audio module > - Rework most of the register programming functions to be local to the > calling module rather than accessing everything through huge > dp_catalog monster. > > Applied, thanks!

[PATCH 6/6] drm/msm/dpu: don't set crtc_state->mode_changed from atomic_check()

2024-12-21 Thread Dmitry Baryshkov
The MSM driver uses drm_atomic_helper_check() which mandates that none of the atomic_check() callbacks toggles crtc_state->mode_changed. Perform corresponding check before calling the drm_atomic_helper_check() function. Fixes: 8b45a26f2ba9 ("drm/msm/dpu: reserve cdm blocks for writeback in case of

[PATCH 5/6] drm/msm/dpu: simplify dpu_encoder_get_topology() interface

2024-12-21 Thread Dmitry Baryshkov
As a preparation for calling dpu_encoder_get_topology() from different code paths, simplify its calling interface, obtaining some data pointers internally instead passing them via arguments. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 12 1 file

[PATCH 3/6] drm/msm/dpu: don't use active in atomic_check()

2024-12-21 Thread Dmitry Baryshkov
The driver isn't supposed to consult crtc_state->active/active_check for resource allocation. Instead all resources should be allocated if crtc_state->enabled is set. Stop consulting active / active_changed in order to determine whether the hardware resources should be (re)allocated. Fixes: 25fdd5

[PATCH 4/6] drm/msm/dpu: move needs_cdm setting to dpu_encoder_get_topology()

2024-12-21 Thread Dmitry Baryshkov
As a preparation for calling dpu_encoder_get_topology() from different places, move the code setting topology->needs_cdm to that function (instead of patching topology separately). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 41 -

[PATCH 2/6] drm/atomic: prepare to check that drivers follow restrictions for needs_modeset

2024-12-21 Thread Dmitry Baryshkov
Some drivers might fail to follow the restrictions documented for drm_atomic_helper_check_modesets(). In order to catch such an issues, add the drm_atomic_state->dirty_needs_modeset field and check it in drm_atomic_check_only(). Make sure that neither of atomic_check() callbacks can set that field

[PATCH 0/6] drm: enforce rules for drm_atomic_helper_check_modeset()

2024-12-21 Thread Dmitry Baryshkov
As pointed out by Simona, the drm_atomic_helper_check_modeset() and drm_atomic_helper_check() require the former function is rerun if the driver's callbacks modify crtc_state->mode_changed. MSM is one of the drivers which failed to follow this requirement. As suggested by Simona, implement generic

[PATCH 1/6] drm/atomic-helper: document drm_atomic_helper_check() restrictions

2024-12-21 Thread Dmitry Baryshkov
The drm_atomic_helper_check() calls drm_atomic_helper_check_modeset() insternally. Document that corresponding restrictions also apply to the drivers that call the former function (as it's easy to miss the documentation for the latter function). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/dr