From nobody Thu Oct 2 00:49:20 2025 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADAEA30B516 for ; Wed, 24 Sep 2025 15:08:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758726518; cv=none; b=ewiDieFZoZzpX018ceibYCTY3FfJJExa3SnnBmfaLi044/odBekHtc6u7Xl4NRzHpMk/xGxFxPrfjSbd+pmLB1j+d4ZJr4z7GkHAGVXckRuGHhvtMHVaj3EL2weZ7tUeey1pfKsybKS5brFznXeiO4PzRPsq3YTzyT9Xlstntg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758726518; c=relaxed/simple; bh=PTADnA0LADRWGW6ihK0MzVzHyCbS7FLm6geROUlYFeE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rrlyMfheBNrYKIkhfRIBIxE3asU0xuIAaTNVdzwW9dStdm5jtwD6a29SGGAosO4rwIa6/InDDrPX5BOz80UMIpSbiCsMESoxz3kq751eWIfu3ZbPw9GKGr8kSrFK5EsPtGxyvEbj+5oIN778uSyWm6mQjoFo8qgPm/MB+CQXKts= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Kgt+g+y1; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Kgt+g+y1" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2445806e03cso90837085ad.1 for ; Wed, 24 Sep 2025 08:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1758726515; x=1759331315; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=B+m5vlhNwunXS3NJ6FmDWyfCPUSXUtwy+/7tRflWyDU=; b=Kgt+g+y1ew1nE2FhjHDP1/SbRn52z2SCBYPgmBAl/idMuWXNtS91vt1aw1svT6vpPl oKd4heW0CssB0Fcs3sm+yYg04TvZ5MOl914ewKky46Jl82P0M9+x7O/NHJcxh7R0xZNY 1eComMG8aQaOXvU+5CigCTHKOodXPQbyW/iBbtwGrMO7jhUCYl3GdBUp88bUhLRQxbAg 3tLOhMLCGzgIRrD7GC0BYsa1pKNtNa4Ivk4yZJCULdPkLY5PLUDHs3LYyPq3KH+58qV3 IsWKwu1MyhqzKrFHggiHOPgGQwussiwIaSc9bpTX7ao3LF+D/cKxqDtUuSIjd4S7vjOb kgkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758726515; x=1759331315; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B+m5vlhNwunXS3NJ6FmDWyfCPUSXUtwy+/7tRflWyDU=; b=neZhYaWyxh+qzzblHQ2aMOLT68/zLtZIR0vx6RLvjyyzpupBtTYg2ywkIhx7te3CLh YY483TvtIntAF3A3HelAoyZJzpkRQTW/vbtcaqNKQ3gzFA3CYaHmlJ4gl/CzgdFQdvOf gl/XvGvkOYKOpG/zwCyAv59526S1Y0n2uoS8x9HOV5lIXOzVf/QiQHDfFjN8GajjtOEs bm0WmS/nc4i/4LzF3NiFeoAUz1M6DDV9GphjXyLct0CD0CQlOh1yAXqb73dCs23BXpLo Aaqft+ZkuPXsN8Tnii0SBypY4dhYi7om5po92G3ODbKGA78ni+9KgDuQGesIG6x9XeH6 +ItQ== X-Forwarded-Encrypted: i=1; AJvYcCWTcbf09rX8xlSRkE6qMd6kSNqcSM98tIl8o3hrkcS/qFvtSEepDUQWFQ4nY+H+l3X71fBouubh1+jNqmc=@vger.kernel.org X-Gm-Message-State: AOJu0YwFrms//d79qbPoxJjtyQtazfokK2x2hi2D82os80me0Kk8O0jO Vni0spbNrEYq/Zne4n5eIB3oKS1MseVBryIE/7OeY4DZilS91nokffS+oevxb0lRzBQ= X-Gm-Gg: ASbGncuZot3+rfRdnL/rXhy26Mia1+WCVVIiywK8xz/MUFvu4GTHKExeDcYA8ZcPZdb OWAy/zYN8oFB7zn/zzfx/dZ/hT5kOvAlrfiQ9w3LJshSun29/WndGt9OV3j46OlRW9hxXpq0+Ds 8Ls/EcyuO63j+inIhT0X0rsWyLZR6+5QtOQY8s2vJwuwKQ1Ocf4rH/jhl7GP0G6zRLSANXHydl2 +Mo5eiXNmjGRNhR/FM1DkTjul4B3VxqVrECxK5/Td/UCpTrhfC0RNcEPspT8RYIGZhuZXu/Z2X4 ZruWepUrGduMmnFcZMjOkGBb4kNdPXJAeOFKl7VdMU2D/eF8+c2wpsc8lvAR885C7sCM95xkFSl HWOtFOPlHkG9877S2 X-Google-Smtp-Source: AGHT+IFiyjrTclsNn9tPuvEEVJ9Cj7y7SUK7Sjpx8qt64CmQ70ylZm8IikptBEeoSu7N0IEZVVDOqQ== X-Received: by 2002:a17:903:1a85:b0:273:31fb:a86d with SMTP id d9443c01a7336-27ed4a4929amr602205ad.48.1758726514821; Wed, 24 Sep 2025 08:08:34 -0700 (PDT) Received: from [127.0.1.1] ([112.64.61.5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-26b59d6538bsm158717445ad.82.2025.09.24.08.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Sep 2025 08:08:34 -0700 (PDT) From: Jun Nie Date: Wed, 24 Sep 2025 23:08:10 +0800 Subject: [PATCH v3 1/3] drm/msm/dsi: support DSC configurations with slice_per_pkt > 1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250924-dsi-dual-panel-upstream-v3-1-6927284f1098@linaro.org> References: <20250924-dsi-dual-panel-upstream-v3-0-6927284f1098@linaro.org> In-Reply-To: <20250924-dsi-dual-panel-upstream-v3-0-6927284f1098@linaro.org> To: Rob Clark , Abhinav Kumar , Jessica Zhang , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krishna Manikandan Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jun Nie , Jonathan Marek X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758726499; l=3811; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=PTADnA0LADRWGW6ihK0MzVzHyCbS7FLm6geROUlYFeE=; b=9s1hagBRl2nfojsoIc6t6lqJydaDeozos2jpTYSSwNCUNLBec91ZvR3LGnrNT6lUKs4WYT/LZ a20IkJSHHkVBu8BCcLR3NOHM6tq4Wvzn2IMIkZ+TjdI+cFbNqlSdun+ X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= Some panels support multiple slice to be sent in a single DSC packet. And this feature is a must for specific panels, such as JDI LPM026M648C. Add a dsc_slice_per_pkt member into struct mipi_dsi_device and support the feature in msm mdss driver. Co-developed-by: Jonathan Marek Signed-off-by: Jonathan Marek Signed-off-by: Jun Nie --- drivers/gpu/drm/msm/dsi/dsi_host.c | 25 ++++++++++--------------- include/drm/drm_mipi_dsi.h | 2 ++ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/d= si_host.c index f297e3de8c3dc4e1326e70c78c046b5a19568cef..de51cb02f267205320c5a94fc41= 88413e05907e6 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -157,6 +157,7 @@ struct msm_dsi_host { =20 struct drm_display_mode *mode; struct drm_dsc_config *dsc; + unsigned int dsc_slice_per_pkt; =20 /* connected device info */ unsigned int channel; @@ -849,17 +850,10 @@ static void dsi_update_dsc_timing(struct msm_dsi_host= *msm_host, bool is_cmd_mod slice_per_intf =3D dsc->slice_count; =20 total_bytes_per_intf =3D dsc->slice_chunk_size * slice_per_intf; - bytes_per_pkt =3D dsc->slice_chunk_size; /* * slice_per_pkt; */ + bytes_per_pkt =3D dsc->slice_chunk_size * msm_host->dsc_slice_per_pkt; =20 eol_byte_num =3D total_bytes_per_intf % 3; - - /* - * Typically, pkt_per_line =3D slice_per_intf * slice_per_pkt. - * - * Since the current driver only supports slice_per_pkt =3D 1, - * pkt_per_line will be equal to slice per intf for now. - */ - pkt_per_line =3D slice_per_intf; + pkt_per_line =3D slice_per_intf / msm_host->dsc_slice_per_pkt; =20 if (is_cmd_mode) /* packet data type */ reg =3D DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE(MIPI_DSI_DCS_= LONG_WRITE); @@ -1008,12 +1002,8 @@ static void dsi_timing_setup(struct msm_dsi_host *ms= m_host, bool is_bonded_dsi) else /* * When DSC is enabled, WC =3D slice_chunk_size * slice_per_pkt + 1. - * Currently, the driver only supports default value of slice_per_pkt = =3D 1 - * - * TODO: Expand mipi_dsi_device struct to hold slice_per_pkt info - * and adjust DSC math to account for slice_per_pkt. */ - wc =3D msm_host->dsc->slice_chunk_size + 1; + wc =3D msm_host->dsc->slice_chunk_size * msm_host->dsc_slice_per_pkt + = 1; =20 dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL, DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) | @@ -1623,8 +1613,13 @@ static int dsi_host_attach(struct mipi_dsi_host *hos= t, msm_host->lanes =3D dsi->lanes; msm_host->format =3D dsi->format; msm_host->mode_flags =3D dsi->mode_flags; - if (dsi->dsc) + if (dsi->dsc) { msm_host->dsc =3D dsi->dsc; + msm_host->dsc_slice_per_pkt =3D dsi->dsc_slice_per_pkt; + /* for backwards compatibility, assume 1 if not set */ + if (!msm_host->dsc_slice_per_pkt) + msm_host->dsc_slice_per_pkt =3D 1; + } =20 ret =3D dsi_dev_attach(msm_host->pdev); if (ret) diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 6d2c08e8110151a97620389197f1ef79c058329d..5a85ba01f402a3866b70828391b= b417bb8dd5956 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -182,6 +182,7 @@ struct mipi_dsi_device_info { * be set to the real limits of the hardware, zero is only accepted for * legacy drivers * @dsc: panel/bridge DSC pps payload to be sent + * @dsc_slice_per_pkt: number of DSC slices to be sent as in a single pack= et */ struct mipi_dsi_device { struct mipi_dsi_host *host; @@ -196,6 +197,7 @@ struct mipi_dsi_device { unsigned long hs_rate; unsigned long lp_rate; struct drm_dsc_config *dsc; + unsigned int dsc_slice_per_pkt; }; =20 /** --=20 2.34.1 From nobody Thu Oct 2 00:49:20 2025 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F02E30C34B for ; Wed, 24 Sep 2025 15:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758726524; cv=none; b=rx8ua0xgB+pS+21b6wLZiAnZLk42+8wiD6lqbOjrx/AqNz+qQGH4u9yv99/J7A9nUUQh0NWCrEKzLOiMJE+U1CK7YXJJDwvH20DgIiB1lYXzIrTabswrB3QtcGyFee5pnGuxdoHI8kH4C57lh9mAcM1b6E6R1I+StCaPHl/ZGkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758726524; c=relaxed/simple; bh=aqMS0Jn1TNh3mlyytrjaZuPheLrmPmhjXnM4Dd4ZxXA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TQNv3e0W/gkQGfOVjA7i9GoeHP1fl/HbalX8EN21mByPZXB/uEEBlD49j3d9kXlriApBGSDUbb78W0WfVjpG3UloeLIRcmTuL5Sj1tMBlB32oqVnrzZMyNXIrqUCEcKh+HfbxnQ0cTWB4f/l3EMbZ5EzPJLkO5MQtcI8m5pUFko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=mRylzg0F; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mRylzg0F" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-25669596955so61479935ad.0 for ; Wed, 24 Sep 2025 08:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1758726522; x=1759331322; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=q9im2oqF4utRrC8rBpdrGYdBctIiIANDtE89j7rUJb8=; b=mRylzg0FMzv7mbqyzPNnbYEZMnvhxr9z9vsX5+bKWwcOkzS1dc3x1HkknHWM0dGymB OYtIKUff9ZSvxxqdv02ZOss/KbYN5fEhBcFpL6fZzAwCotA6QzLQ9sIBsqiGohnhVVpA WaQnOI4i87QSVyaONmNKvZr+yYJevjhb0IIvs3DsJ4R+BIy+kP79mlpbQ8wQ/Si+r/EQ r3n1b+qS7SuwBtPr+KcTGo4IpkcuwsAgZ6QoX80CKKSosscFRRw+Wx8UYCZNdrrEL2rE tEroIlEg4CnnFhwcawG7B2UE4jVjzYJ6jbx7iPv5g5SFQg6ueYEKoR3AS+FJ2xt6mu1h tOzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758726522; x=1759331322; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q9im2oqF4utRrC8rBpdrGYdBctIiIANDtE89j7rUJb8=; b=RSx6FXkD2odV7zhlzCzCFiLCEtc1UHHcEzBb0srGUL5Cqv99zF+kfG+ba7ObbWESDL 4/AR/Lb0WIfhaHcHoCqx2rRXjPtDhdr3pz+Brx9zLBQ+OPqro3suDkWTu4CUkqfIHs9B tb6xZpcLjpwaxzPsWG4cJD4ZuUDnfNPJhvRgVU2QrLZ92I1dpqlnAatKJqQZq6fcXyY/ TLjWpfHPUS/SEUD+bbefYy58wgdbZyRty6f0DXyfvQq2AxknCIOuHKyNoEoco30hQp7Q NXvGMCagCvVyMLztEyXUKF/P0wQg6TxRNQA3a+PgUS8rDRl6Eh11Hy3ayyUEud0OHodH 7ZDA== X-Forwarded-Encrypted: i=1; AJvYcCXBYG/JRfj1yVxt5lxktmDcxFA1Xh3efb/fggr6pyuiK45V5MuhdmhkL1gXFMXiSns1qSnOWSkbQPULI2g=@vger.kernel.org X-Gm-Message-State: AOJu0YwED+9ShnQ820cuhB0ESru284rOgiyUrSrd22PKrWywHCVcQgZX U9OoXJYzV0Yl9poidTqaWQPQ9bFISfW5ks+7AvMspiuYLyfszcPWSUZjGiwdExNg1Og= X-Gm-Gg: ASbGncs6PIuj4vf7wXR7BFeBb1ZGFDG6jyO4+uWMC6wA+MGULUT5TEKOzBDxpIoh3Yr TU6rySWTsf1ifmf1E3cbL3MT/t/eKYA1lXByYEaWiTkxzaSM/qhyVem1NkhsqzC55iScEiatYXU SReY54uBNyGFItcdcRiYjU3wI98+hu/g6h5wiXE8vHPdxggsJDPnYVj1LWzLq8BjsWW7cTR51kC yl1BzvX+1fiyD18VcecwY6e563mXg0PfGgrmiK+iqM3ev+oEIQjXXqKBXs+NHwtNACAFOHADehB hzS56DkrGTCrjDomB0WPE1uBdPWvM9jQPjUjPbcjG8yNhgNmOJ2jPZvDd6FUKcYxa4svSSsFDu3 fthh2gqsJtlNPicde X-Google-Smtp-Source: AGHT+IGCHLd3pnmTwxyL4D3bJHLTKcwCMZ56M/ra999jlI6cfFbIZbbFFt5flDomb9K12MnR6LGiYQ== X-Received: by 2002:a17:902:e88d:b0:267:b0e4:314e with SMTP id d9443c01a7336-27ed49df055mr820305ad.23.1758726522301; Wed, 24 Sep 2025 08:08:42 -0700 (PDT) Received: from [127.0.1.1] ([112.64.61.5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-26b59d6538bsm158717445ad.82.2025.09.24.08.08.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Sep 2025 08:08:41 -0700 (PDT) From: Jun Nie Date: Wed, 24 Sep 2025 23:08:11 +0800 Subject: [PATCH v3 2/3] drm/mipi-dsi: Add flag to support dual-panel configurations Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250924-dsi-dual-panel-upstream-v3-2-6927284f1098@linaro.org> References: <20250924-dsi-dual-panel-upstream-v3-0-6927284f1098@linaro.org> In-Reply-To: <20250924-dsi-dual-panel-upstream-v3-0-6927284f1098@linaro.org> To: Rob Clark , Abhinav Kumar , Jessica Zhang , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krishna Manikandan Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jun Nie X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758726499; l=1401; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=aqMS0Jn1TNh3mlyytrjaZuPheLrmPmhjXnM4Dd4ZxXA=; b=6HLYqVGBQbEyuiZQevtXQREU6fOO4xIxqwSNXpTmZaJF78+kLnDym2AXLAFumXiRTuz5lKPBq Bn0Cs8FpfNoAOUh5922IfWiIiiZraGlaBvn+PXp5YEZTERAfDDDR7Ws X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= Some devices treat two independent physical DSI panels as a single logical panel from the CRTC's perspective. However, two separate DSI hosts are still required to drive the panels individually. Introduce a `dual_panel` flag to the `mipi_dsi_device` struct. This allows a panel driver to inform the DSI host that it is part of a dual-panel setup, enabling the host to coordinate both physical displays as one. Signed-off-by: Jun Nie --- include/drm/drm_mipi_dsi.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 5a85ba01f402a3866b70828391bb417bb8dd5956..0faff285d9ffeb19e4523cdc7bf= 21c1ec20e6eff 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -170,6 +170,7 @@ struct mipi_dsi_device_info { * @host: DSI host for this peripheral * @dev: driver model device node for this peripheral * @attached: the DSI device has been successfully attached + * @dual_panel: the DSI device is one instance of dual panel * @name: DSI peripheral chip type * @channel: virtual channel assigned to the peripheral * @format: pixel format for video mode @@ -188,6 +189,7 @@ struct mipi_dsi_device { struct mipi_dsi_host *host; struct device dev; bool attached; + bool dual_panel; =20 char name[DSI_DEV_NAME_SIZE]; unsigned int channel; --=20 2.34.1 From nobody Thu Oct 2 00:49:20 2025 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4684F30C340 for ; Wed, 24 Sep 2025 15:08:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758726531; cv=none; b=r0NiDY6lfMu+h3A6t3kkuo6nMZiV/o5BJuMWUL8hgZDhvVB9FwCWEW09H9kK3czkSO/0XpnX1Cv6d65GE5YN/l5fi5esk7/mEmTdn4hn1xeADsoXWiT9Er4X3l+/FyGTCB49Lc+YfJieGhK3hZtoofKfTlnejIbTX+t31CpG5ek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758726531; c=relaxed/simple; bh=uv//tTQkdWUOMylUjOz31Zc7MGTY0kN4NR2rEqP2pKI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=twAx+9UylW2TwyUz77plV0YmxCbI+vTbmwfQSeEpCA/mVqbtAI5bPvzqCc3BYHIroS7EZRVCIkRXDQXZucDgcbGf1Zsex1Vhx1wz1Hpbm4EEiCMjgUXErY7L8/ufD/ZjwsNhR23k4gQaTZv07ffbPL6oertplK5hWY3flLC34PU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=GzbxCt3M; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GzbxCt3M" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-26c209802c0so53103295ad.0 for ; Wed, 24 Sep 2025 08:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1758726529; x=1759331329; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Mtm7YfP7BSI3RTZ9+FG8XqmZhlh22m357qfVk/qkxE8=; b=GzbxCt3MpAgMygR+L5VBtXpBYr1sfYesrkNK7CMT7+ATGm9uPpekoJRgI2bc2aXECK iEF49JonXfM4Z6mp9bsR1uXg7hEZpq3Z6mwtzViuugoApm5IzK1qKoDup3ihfAlaUipV Xazt44X0DzgCHG4YwRV7Fd7euOj4c+FFqArtw8DETvX0a+3d7VEOOFisNO4hNdO3lJKT l3OwELr/ytLsP56IDuh7TvDfywg+F3WO3ex2Pbk17HtqHWRE9zAfUCMm0hPAojHIRAaU NVSdw+KD67K2o5V1k1rBV+aXnNuhhHUkWK0N3QkAYQsI6ftsmLtSzVrs66IdQImkD0Pn /vXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758726529; x=1759331329; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mtm7YfP7BSI3RTZ9+FG8XqmZhlh22m357qfVk/qkxE8=; b=pRxe/Oyp+2PsDyg7Rmr81ZqeNqfhUI/0nyFNUEO381VieK2v8kKnOAIYewqwzJZr7V Sa0Ayk8PmZv8t3NbC5hz8Q+6udYoFpMdKACIaXJhmPGFDvDur2g3OrkROIZzByq9l0JM HtaUeXLzTgt4ItYSn/qMVGOX8m93hzKk+2Q27W4qHYELNgEurqKCZwNQlen2c4bBj9sL PgQHhFL2gQFV81t9ureIdZly5ncJ2nGRDQC9+uorhM72UwBL7mH9jLn8r5wy7E9jAVjl L0KYpF8QzoeQlC3vgpGhiFY1+KwWMT4f6E5v63dZIWdpwls8WYGAxsb0v2S7UaXKzm9A hpLg== X-Forwarded-Encrypted: i=1; AJvYcCWrWUx5FxdpirB+rqTAxd1rk7FOjwDGC0bC0yw3OBgdeHoV81Zxg2jN4ZRYmTIvW0YkPN/u3I17oArhMIM=@vger.kernel.org X-Gm-Message-State: AOJu0YzpwXX8yqnMWzCD0WK4IiEyxubEQKblpVF/howvZQWywnNI+wZP sQ3F2C2V4hMgP3U3nBYag68rQxg5TIT51ZsmxLt2u1TA/svpVyXOjlHi2nON4YaB+cc= X-Gm-Gg: ASbGncvIw2ftpqjTtk8+AGf11oT8CmHz1w7i4ehY8GFBBSYfaKSCScjDKMiQhYB8S4h 1QyjjcAiQDEw+VWDQYQ/zKNxxvkIVkkgnZzp8s0q5J/m/nunVQxXacMNRjog2tgHCazQXGOSd6l U4uywRuQNetlU79AdNZMRss5GpCJ2wfaKSY8sLoXNjYSBbLUMeAGRVODlyku+O12PAXPTIDiDmj v8TJEvj4itg7XxqprKXgKLp+bzkn/F5psBd+9ez4FXOauSPmWVk5X9sQ4Yy+P7y1gkyY4htSk0a PhMlwkUOK4QuUgSS52JTOBmDViJpIx4+Yd/RpHtIEctRICu3c5Qdo/eyn409wntp+QiqcT9U3AD LpquqjH4bMaNTnUP5 X-Google-Smtp-Source: AGHT+IEEfbkQbo6VyHZL6DNe6uKS5V8miS4VoGJIvm14SbYPZxktKLOnaj7fLoQ1xnJPrs48EB5euw== X-Received: by 2002:a17:902:c409:b0:269:96db:939 with SMTP id d9443c01a7336-27ed4af3882mr21675ad.58.1758726529408; Wed, 24 Sep 2025 08:08:49 -0700 (PDT) Received: from [127.0.1.1] ([112.64.61.5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-26b59d6538bsm158717445ad.82.2025.09.24.08.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Sep 2025 08:08:49 -0700 (PDT) From: Jun Nie Date: Wed, 24 Sep 2025 23:08:12 +0800 Subject: [PATCH v3 3/3] drm/msm/dsi: Support dual panel use case with single CRTC Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250924-dsi-dual-panel-upstream-v3-3-6927284f1098@linaro.org> References: <20250924-dsi-dual-panel-upstream-v3-0-6927284f1098@linaro.org> In-Reply-To: <20250924-dsi-dual-panel-upstream-v3-0-6927284f1098@linaro.org> To: Rob Clark , Abhinav Kumar , Jessica Zhang , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krishna Manikandan Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jun Nie X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758726499; l=3407; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=uv//tTQkdWUOMylUjOz31Zc7MGTY0kN4NR2rEqP2pKI=; b=cbwhi38kXfeCUrP4iZc3vGzSS+7SXsK87SMxbLuZ9SDfEikysPiAQH8mgdl2o1BXHWxilRTI6 p1c+UJbkOexAxVBPSqmtKoMbjP0ZBRrXe9yAPnK5V74UKYdfcPyy0MI X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= Support a hardware configuration where two independent DSI panels are driven by a single, synchronous CRTC. This configuration uses a bonded DSI link to provide a unified vblank for both displays. This allows application software to treat the two displays as a single, wide framebuffer with a synchronized refresh cycle, simplifying rendering logic for side-by-side panel arrangements. At the DSI host level, the frame width for each link must be that of an individual panel. The driver therefore halves the CRTC's horizontal resolution before configuring the DSI host and any DSC encoders, ensuring each panel receives the correct half of the framebuffer. While the DSI panel driver should manage two panels togehter. 1. During probe, the driver finds the sibling dsi host via device tree phandle and register the 2nd panel to get another mipi_dsi_device. 2. Set dual_panel flag on both mipi_dsi_device. 3. Prepare DSC data per requirement from single panel. 4. All DSI commands should be send on every DSI link. 5. Handle power supply for 2 panels in one shot, the same is true to brightness. 6. From the CRTC's perspective, the two panels appear as one wide display. The driver exposes a DRM mode where the horizontal timings (hdisplay, hsync_start, etc.) are doubled, while the vertical timings remain those of a single panel. Because 2 panels are expected to be mounted in left/right position. To maintain synchronization, both DSI links are configured to share a single clock source, with the DSI1 controller using the clock provided to DSI0 as below. &mdss_dsi1 { assigned-clocks =3D <&dispcc DISP_CC_MDSS_BYTE1_CLK_SRC>, <&dispcc DISP_CC_MDSS_PCLK1_CLK_SRC>; assigned-clock-parents =3D <&mdss_dsi0_phy 0>, <&mdss_dsi0_phy 1>; } Signed-off-by: Jun Nie --- drivers/gpu/drm/msm/dsi/dsi_host.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/d= si_host.c index de51cb02f267205320c5a94fc4188413e05907e6..1fddcea7f86547258be18a51a0a= 3e3f96f6c3838 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -177,6 +177,7 @@ struct msm_dsi_host { bool registered; bool power_on; bool enabled; + bool is_dual_panel; int irq; }; =20 @@ -935,7 +936,10 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_= host, bool is_bonded_dsi) return; } =20 - dsc->pic_width =3D mode->hdisplay; + if (msm_host->is_dual_panel) + dsc->pic_width =3D hdisplay; + else + dsc->pic_width =3D mode->hdisplay; dsc->pic_height =3D mode->vdisplay; DBG("Mode %dx%d\n", dsc->pic_width, dsc->pic_height); =20 @@ -1609,6 +1613,7 @@ static int dsi_host_attach(struct mipi_dsi_host *host, if (dsi->lanes > msm_host->num_data_lanes) return -EINVAL; =20 + msm_host->is_dual_panel =3D dsi->dual_panel; msm_host->channel =3D dsi->channel; msm_host->lanes =3D dsi->lanes; msm_host->format =3D dsi->format; @@ -2492,6 +2497,9 @@ enum drm_mode_status msm_dsi_host_check_dsc(struct mi= pi_dsi_host *host, if (!msm_host->dsc) return MODE_OK; =20 + if (msm_host->is_dual_panel) + pic_width =3D mode->hdisplay / 2; + if (pic_width % dsc->slice_width) { pr_err("DSI: pic_width %d has to be multiple of slice %d\n", pic_width, dsc->slice_width); --=20 2.34.1