summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_atomic.c
diff options
context:
space:
mode:
authorKalyan Thota <quic_kalyant@quicinc.com>2023-02-13 12:11:44 +0100
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2023-04-06 19:29:43 +0200
commit82836692d5d7424660f8fb5f52432cfe2d9e633c (patch)
tree501e38762302e5a082b5dd04a0a50c387d29156d /drivers/gpu/drm/msm/msm_atomic.c
parentdrm/msm/dpu: avoid unnecessary check in DPU reservations (diff)
downloadlinux-82836692d5d7424660f8fb5f52432cfe2d9e633c.tar.xz
linux-82836692d5d7424660f8fb5f52432cfe2d9e633c.zip
drm/msm/dpu: manage DPU resources if CTM is requested
Allow modeset to be triggered during CTM enable/disable. In the modeset callbacks, DPU resources required for the CTM feature are managed appropriately. Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/522448/ Link: https://lore.kernel.org/r/1676286704-818-5-git-send-email-quic_kalyant@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_atomic.c')
-rw-r--r--drivers/gpu/drm/msm/msm_atomic.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
index 608a969efea2..d77fa9793c54 100644
--- a/drivers/gpu/drm/msm/msm_atomic.c
+++ b/drivers/gpu/drm/msm/msm_atomic.c
@@ -179,6 +179,24 @@ static unsigned get_crtc_mask(struct drm_atomic_state *state)
return mask;
}
+int msm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state)
+{
+ struct drm_crtc_state *old_crtc_state, *new_crtc_state;
+ struct drm_crtc *crtc;
+ int i;
+
+ for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state,
+ new_crtc_state, i) {
+ if ((old_crtc_state->ctm && !new_crtc_state->ctm) ||
+ (!old_crtc_state->ctm && new_crtc_state->ctm)) {
+ new_crtc_state->mode_changed = true;
+ state->allow_modeset = true;
+ }
+ }
+
+ return drm_atomic_helper_check(dev, state);
+}
+
void msm_atomic_commit_tail(struct drm_atomic_state *state)
{
struct drm_device *dev = state->dev;