The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Xiangxu Yin <quic_xiangxuy@quicinc.com>,
	Sasha Levin <sashal@kernel.org>,
	robdclark@gmail.com, airlied@gmail.com, simona@ffwll.ch,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.13 13/34] drm/msm/dpu: filter out too wide modes if no 3dmux is present
Date: Sun, 26 Jan 2025 09:52:49 -0500	[thread overview]
Message-ID: <20250126145310.926311-13-sashal@kernel.org> (raw)
In-Reply-To: <20250126145310.926311-1-sashal@kernel.org>

From: Abhinav Kumar <quic_abhinavk@quicinc.com>

[ Upstream commit dbc7bb1a93f41c533fe31ddc97bdf777d7a61faa ]

On chipsets such as QCS615, there is no 3dmux present. In such
a case, a layer exceeding the max_mixer_width cannot be split,
hence cannot be supported.

Filter out the modes which exceed the max_mixer_width when there
is no 3dmux present. Also, add a check in the dpu_crtc_atomic_check()
to return failure for such modes.

Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Xiangxu Yin <quic_xiangxuy@quicinc.com> # QCS615
Patchwork: https://patchwork.freedesktop.org/patch/627974/
Link: https://lore.kernel.org/r/20241209-no_3dmux-v3-1-48aaa555b0d3@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 9f6ffd344693e..ad3462476a143 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -732,6 +732,13 @@ static int _dpu_crtc_check_and_setup_lm_bounds(struct drm_crtc *crtc,
 	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc);
 	int i;
 
+	/* if we cannot merge 2 LMs (no 3d mux) better to fail earlier
+	 * before even checking the width after the split
+	 */
+	if (!dpu_kms->catalog->caps->has_3d_merge &&
+	    adj_mode->hdisplay > dpu_kms->catalog->caps->max_mixer_width)
+		return -E2BIG;
+
 	for (i = 0; i < cstate->num_mixers; i++) {
 		struct drm_rect *r = &cstate->lm_bounds[i];
 		r->x1 = crtc_split_width * i;
@@ -1251,6 +1258,12 @@ static enum drm_mode_status dpu_crtc_mode_valid(struct drm_crtc *crtc,
 {
 	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc);
 
+	/* if there is no 3d_mux block we cannot merge LMs so we cannot
+	 * split the large layer into 2 LMs, filter out such modes
+	 */
+	if (!dpu_kms->catalog->caps->has_3d_merge &&
+	    mode->hdisplay > dpu_kms->catalog->caps->max_mixer_width)
+		return MODE_BAD_HVALUE;
 	/*
 	 * max crtc width is equal to the max mixer width * 2 and max height is 4K
 	 */
-- 
2.39.5


  parent reply	other threads:[~2025-01-26 14:53 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-26 14:52 [PATCH AUTOSEL 6.13 01/34] drm/virtio: New fence for every plane update Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 02/34] drm: Add panel backlight quirks Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 03/34] drm/amd/display: Add support for minimum backlight quirk Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 04/34] drm: panel-backlight-quirks: Add Framework 13 matte panel Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 05/34] drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 06/34] nvkm/gsp: correctly advance the read pointer of GSP message queue Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 07/34] nvkm: correctly calculate the available space of the GSP cmdq buffer Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 08/34] drm/tests: hdmi: handle empty modes in find_preferred_mode() Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 09/34] drm/tests: hdmi: return meaningful value from set_connector_edid() Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 10/34] drm/amd/display: Populate chroma prefetch parameters, DET buffer fix Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 11/34] drm/amd/display: Overwriting dualDPP UBF values before usage Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 12/34] printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX Sasha Levin
2025-01-26 14:52 ` Sasha Levin [this message]
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 14/34] drm/connector: add mutex to protect ELD from concurrent access Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 15/34] drm/bridge: anx7625: use eld_mutex to protect access to connector->eld Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 16/34] drm/bridge: ite-it66121: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 17/34] drm/amd/display: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 18/34] drm/exynos: hdmi: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 19/34] drm/msm/dp: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 20/34] drm/radeon: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 21/34] drm/sti: hdmi: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 22/34] drm/vc4: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 23/34] drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 24/34] drm/amdgpu: Don't enable sdma 4.4.5 CTXEMPTY interrupt Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 25/34] drm/amdkfd: Queue interrupt work to different CPU Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 26/34] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 27/34] drm/bridge: it6505: fix HDCP Bstatus check Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 28/34] drm/bridge: it6505: fix HDCP encryption when R0 ready Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 29/34] drm/bridge: it6505: fix HDCP CTS compare V matching Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 30/34] drm/bridge: it6505: fix HDCP CTS KSV list wait timer Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 31/34] safesetid: check size of policy writes Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 32/34] drm/amd/display: Increase sanitizer frame larger than limit when compile testing with clang Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 33/34] drm/amd/display: Limit Scaling Ratio on DCN3.01 Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 34/34] ring-buffer: Make reading page consistent with the code logic Sasha Levin

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=20250126145310.926311-13-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=airlied@gmail.com \
    --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=quic_abhinavk@quicinc.com \
    --cc=quic_xiangxuy@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.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