[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1673972488-30140-4-git-send-email-quic_kalyant@quicinc.com>
Date: Tue, 17 Jan 2023 08:21:28 -0800
From: Kalyan Thota <quic_kalyant@...cinc.com>
To: dri-devel@...ts.freedesktop.org, linux-arm-msm@...r.kernel.org,
freedreno@...ts.freedesktop.org, devicetree@...r.kernel.org
Cc: Kalyan Thota <quic_kalyant@...cinc.com>,
linux-kernel@...r.kernel.org, robdclark@...omium.org,
dianders@...omium.org, swboyd@...omium.org,
quic_vpolimer@...cinc.com, dmitry.baryshkov@...aro.org,
quic_abhinavk@...cinc.com
Subject: [PATCH 3/3] drm/msm/disp/dpu1: fail atomic check if color feature is requested with no dspp
Fail atomic check if any color feature is requested with no
dspps allocated in the datapath so that composer can offload those
features.
Signed-off-by: Kalyan Thota <quic_kalyant@...cinc.com>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 4170fbe..de8d799 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1147,6 +1147,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
int left_zpos_cnt = 0, right_zpos_cnt = 0;
struct drm_rect crtc_rect = { 0 };
bool needs_dirtyfb = dpu_crtc_needs_dirtyfb(crtc_state);
+ struct dpu_crtc_mixer *mixer = cstate->mixers;
pstates = kzalloc(sizeof(*pstates) * DPU_STAGE_MAX * 4, GFP_KERNEL);
@@ -1173,6 +1174,16 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
_dpu_crtc_setup_lm_bounds(crtc, crtc_state);
}
+ if (crtc_state->color_mgmt_changed) {
+ for (i = 0; i < cstate->num_mixers; i++) {
+ if (!mixer[i].hw_dspp) {
+ DPU_DEBUG("%s: failed to get dspp for crtc%d state\n",
+ dpu_crtc->name, crtc->base.id);
+ return -EINVAL;
+ }
+ }
+ }
+
crtc_rect.x2 = mode->hdisplay;
crtc_rect.y2 = mode->vdisplay;
--
2.7.4
Powered by blists - more mailing lists