From 55cc4b77039f42cd3dab27bde53a103158db9c22 Mon Sep 17 00:00:00 2001 From: snlavaise Date: Sun, 27 Sep 2026 01:50:25 -0300 Subject: [PATCH] linux-postmarketos-qcom-sm8550: nt37705: support 48/90/120/165 Hz Expose the five timings of the vendor CSOT panel (48, 60, 90, 120 and 165 Hz, 60 preferred). All of them share porches, PHY timings and the DSI clock; only the timing-switch commands differ (2f XX and e0 YY on page 08), so prepare() picks them from the refresh rate of the CRTC mode. Changing the rate is a full modeset (panel power cycle). Tested on hardware: all rates selectable from GNOME display settings. Co-Authored-By: Claude Opus 5.5 --- .../linux-postmarketos-qcom-sm8550/APKBUILD | 4 +- .../panel-novatek-nt37705.c | 131 ++++++++++++++---- 2 files changed, 109 insertions(+), 26 deletions(-) diff --git a/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD b/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD index 47e45f32e..e97ad427c 100644 --- a/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD +++ b/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD @@ -5,7 +5,7 @@ maintainer="snlavaise " _flavor="postmarketos-qcom-sm8550" pkgname=linux-$_flavor pkgver=7.2 -pkgrel=48 +pkgrel=49 pkgdesc="Mainline kernel for Qualcomm SM8550 (Snapdragon 8 Gen 2) + Motorola rtwo" arch="aarch64" _carch="arm64" @@ -174,6 +174,6 @@ cf4889c4dca8d3bac7544d71284e6b592d6014d9ad94badfc6d2cbe56a8402c61e4c0811c2f48d33 7673bec5661e692721bce41e72a330180e653d2b1b0a5cb3d36bdc869ad4a32ce23a6048d01c9cf2cf5c78c2a7e33899a0a149c65e9754d9d1c2cd71b542b84c msm-dsi-keep-panel-dsc-config.patch 3268835bcb539a77d16c888d933c856df6bb591861d30c7c61c6e0ab70751bac6248961ec30fedf9a62bebdcd63113cf1dd14e58a1b53262493d5e0e90dbbe3f msm-dp-ignore-invalid-lttpr-caps.patch 4f5ea9bfe01a6df166fdad601f6bd74d4b39049be924e8b4df58a8acbba7e9ebfc568bd81df70354209642f68e113804b9d1b62cbd3c83c319fae5fefcf07595 msm-dp-no-push-idle-when-link-down.patch -e8df16de9b413fedd0d36414311216e68e69363e1bfbba8c7b892120f860d217b58ceeffeb92566a5617177b0f190a64e9e2284d6d4285e72db35cf40770e41a panel-novatek-nt37705.c +f2ec70d834577378c564e8cab51879f14815693a04af5382b3a778a598a1b3c86585ff9dadf004fa526920778d6540cc44db769a4f75c2af883dcf52c2b70af8 panel-novatek-nt37705.c dd95e80f62879d5167e7bfc7d74b4a64669a43dbf5aacb6a13e62d1ed4a88677ef1042f8cecc46e05e3d12ba75f070a5927df308c90fe846af93b78c6b310e80 typec-mux-ps5169.c " diff --git a/device/testing/linux-postmarketos-qcom-sm8550/panel-novatek-nt37705.c b/device/testing/linux-postmarketos-qcom-sm8550/panel-novatek-nt37705.c index b0dd58847..852795eaf 100644 --- a/device/testing/linux-postmarketos-qcom-sm8550/panel-novatek-nt37705.c +++ b/device/testing/linux-postmarketos-qcom-sm8550/panel-novatek-nt37705.c @@ -8,10 +8,11 @@ * Sequences transcribed byte-by-byte from the vendor device tree node * "qcom,mdss_dsi_mot_csot_nt37705_667_curve_1080x2400_dsc_cmd_v1" * (panel name mipi_mot_cmd_csot_1080p_dsc_667, panel supplier "csot"), - * see pmos/panel-nt37705-v1-dump.md. Only the 60 Hz timing (timing@0, 2f01 + - * e000) is exposed for the first bring-up. The other rates only differ in - * their timing-switch-command: 120 Hz 2f02/e041, 90 Hz 2f04/e000, - * 48 Hz 2f05/e000, 165 Hz 2f03/e041 (same porches and DSI clock). + * see pmos/panel-nt37705-v1-dump.md. The stock node has five timings + * (48/60/90/120/165 Hz) with the same porches, PHY timings and DSI clock; + * their on-commands only differ in two bytes, the frame rate select (0x2f) + * and the first 0xe0 parameter of CMD page 8. All five are exposed; 60 Hz + * stays the preferred mode. * * DSC: besides the Novatek MCS setup in the on command (0x90 enable, 0x91 * parameters), the standard PPS and compression-mode packets are sent after @@ -30,6 +31,9 @@ #include