mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kalyan Thota <quic_kalyant@quicinc.com>
To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org, devicetree@vger.kernel.org
Cc: Kalyan Thota <quic_kalyant@quicinc.com>,
	linux-kernel@vger.kernel.org, robdclark@chromium.org,
	dianders@chromium.org, swboyd@chromium.org,
	quic_vpolimer@quicinc.com, dmitry.baryshkov@linaro.org,
	quic_abhinavk@quicinc.com, marijn.suijten@somainline.org
Subject: [PATCH v4 4/4] drm/msm/dpu: manage DPU resources if CTM is requested
Date: Mon, 13 Feb 2023 03:11:44 -0800	[thread overview]
Message-ID: <1676286704-818-5-git-send-email-quic_kalyant@quicinc.com> (raw)
In-Reply-To: <1676286704-818-1-git-send-email-quic_kalyant@quicinc.com>

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>
---
 drivers/gpu/drm/msm/msm_atomic.c | 18 ++++++++++++++++++
 drivers/gpu/drm/msm/msm_drv.c    |  2 +-
 drivers/gpu/drm/msm/msm_drv.h    |  1 +
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
index 1686fbb..e3e607c 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;
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 0759e2d..3221284 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -52,7 +52,7 @@
 static const struct drm_mode_config_funcs mode_config_funcs = {
 	.fb_create = msm_framebuffer_create,
 	.output_poll_changed = drm_fb_helper_output_poll_changed,
-	.atomic_check = drm_atomic_helper_check,
+	.atomic_check = msm_atomic_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index ea80846..7d0243a 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -209,6 +209,7 @@ int msm_atomic_init_pending_timer(struct msm_pending_timer *timer,
 		struct msm_kms *kms, int crtc_idx);
 void msm_atomic_destroy_pending_timer(struct msm_pending_timer *timer);
 void msm_atomic_commit_tail(struct drm_atomic_state *state);
+int msm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state);
 struct drm_atomic_state *msm_atomic_state_alloc(struct drm_device *dev);
 void msm_atomic_state_clear(struct drm_atomic_state *state);
 void msm_atomic_state_free(struct drm_atomic_state *state);
-- 
2.7.4


  parent reply	other threads:[~2023-02-13 11:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 11:11 [PATCH v4 0/4] Reserve DSPPs based on user request Kalyan Thota
2023-02-13 11:11 ` [PATCH v4 1/4] drm/msm/dpu: clear DSPP reservations in rm release Kalyan Thota
2023-03-16  2:21   ` (subset) " Abhinav Kumar
2023-02-13 11:11 ` [PATCH v4 2/4] drm/msm/dpu: add DSPPs into reservation upon a CTM request Kalyan Thota
2023-03-01  8:24   ` Marijn Suijten
2023-06-10 10:26     ` Yongqin Liu
2023-06-12  7:25       ` Kalyan Thota
2023-02-13 11:11 ` [PATCH v4 3/4] drm/msm/dpu: avoid unnecessary check in DPU reservations Kalyan Thota
2023-03-01  8:27   ` Marijn Suijten
2023-02-13 11:11 ` Kalyan Thota [this message]
2023-02-17 22:26   ` [PATCH v4 4/4] drm/msm/dpu: manage DPU resources if CTM is requested Dmitry Baryshkov
2023-02-13 18:11 ` [PATCH v4 0/4] Reserve DSPPs based on user request Doug Anderson
2023-02-13 20:25   ` Dmitry Baryshkov
2023-04-05  1:35 ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1676286704-818-5-git-send-email-quic_kalyant@quicinc.com \
    --to=quic_kalyant@quicinc.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_vpolimer@quicinc.com \
    --cc=robdclark@chromium.org \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®