sony-pdx215: new device

For now, the phone generally boots from microsd, although ssh does not work. The only
UIs that manage to stay launched is lomiri and sxmo.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8103>
This commit is contained in:
Jan Paszkowski 2026-02-28 18:10:00 +01:00 committed by The Friendly Meow (merge) Bot
parent 28e8e7e558
commit 1590461e92
No known key found for this signature in database
11 changed files with 10690 additions and 0 deletions

View file

@ -0,0 +1,37 @@
# Reference: <https://postmarketos.org/devicepkg>
maintainer="Jan Paszkowski <janmpaszkowski@proton.me>"
pkgname=device-sony-pdx215
pkgdesc="Sony Xperia 1 III"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-sony-pdx215
mkbootimg
postmarketos-base
soc-qcom
soc-qcom-qbootctl
"
makedepends="devicepkg-dev"
_pmb_recommends="
firmware-sony-pdx215
linux-firmware-qca
linux-firmware-qcom
"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="
9c7bc283666f2d35f0939180e004de70b6b648dbd039d7356f8fb9be86abf12e52dabaebbcb95610b7edf483e4e94d9ea6131650b11584f3371f082e5e279efd deviceinfo
"

View file

@ -0,0 +1,29 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Sony Xperia 1 III"
deviceinfo_manufacturer="Sony"
deviceinfo_codename="sony-pdx215"
deviceinfo_year="2021"
deviceinfo_dtb="qcom/sm8350-sony-xperia-sagami-pdx215"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_external_storage="true"
deviceinfo_drm="true"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_generate_bootimg="true"
deviceinfo_flash_pagesize="4096"
deviceinfo_header_version="1"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_dtb="0x01f00000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00000000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_append_dtb="true"

View file

@ -0,0 +1,28 @@
maintainer="Jan Paszkowski <janmpaszkowski@proton.me>"
pkgname=firmware-sony-pdx215
pkgver=1
pkgrel=0
pkgdesc="Firmware for Sony Xperia 1 III"
url="https://gitlab.com/janmpaszkowski/sony-pdx215-firmware"
_repository="sony-pdx215-firmware"
_commit="2a9eabd337b60ef1209cbb238f20784f676a4c7f"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck !spdx !tracedeps pmb:cross-native"
source="$pkgname-$_commit.tar.gz::https://gitlab.com/janmpaszkowski/$_repository/-/archive/$_commit/$_repository-$_commit.tar.gz
firmware.files"
package() {
cd "$srcdir/$_repository-$_commit"
while IFS="" read -r _i || [ -n "$_i" ]; do
[ ! -d $(dirname $_i) ] && mkdir -p $(dirname $_i)
echo $_i
install -Dm644 $_i "$pkgdir/$_i"
done < "$srcdir/firmware.files"
}
sha512sums="
4028c7e0468df6d6072a6b88e00e0b24f5975b0c42fc37996d137780e24684278597d142f7a50167d8a8835569f3ec3745e81cf2b6cf8abff706efdf2202d189 firmware-sony-pdx215-2a9eabd337b60ef1209cbb238f20784f676a4c7f.tar.gz
ee2530dc90f96ddad464d092dd19c7a5834114d359266d94e5c14942da5a9c28c16f9ac2ac0dbde0cda28ae087b874dc3c96924b266bbb7fe09c7a6f02de8e1a firmware.files
"

View file

@ -0,0 +1,10 @@
./lib/firmware/qcom/sm8350/Sony/sagami/adsp.mbn
./lib/firmware/qcom/sm8350/Sony/sagami/cdsp.mbn
./lib/firmware/qcom/sm8350/Sony/sagami/slpi.mbn
./lib/firmware/qcom/sm8350/Sony/sagami/ipa_fws.mbn
./lib/firmware/qcom/sm8350/Sony/sagami/adspr.jsn
./lib/firmware/qcom/sm8350/Sony/sagami/adspua.jsn
./lib/firmware/qcom/sm8350/Sony/sagami/cdspr.jsn
./lib/firmware/qcom/sm8350/Sony/sagami/slpius.jsn
./lib/firmware/qcom/sm8350/Sony/sagami/slpir.jsn
./lib/firmware/qcom/sm8350/Sony/sagami/a660_zap.mbn

View file

@ -0,0 +1,508 @@
DRM DRIVER FOR SAMSUNG DB7430 PANELS
M: Linus Walleij <linusw@kernel.org>
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 3cca1c580d50..eda808b9d466 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -752,6 +752,22 @@ config DRM_PANEL_SAMSUNG_AMS639RQ08
Say Y or M here if you want to enable support for the
Samsung AMS639RQ08 FHD Plus (2340x1080@60Hz) CMD mode panel.
+config DRM_PANEL_SAMSUNG_ANA6707
+ tristate "Samsung ANA6707 DSI cmd mode panels"
+ depends on GPIOLIB
+ depends on OF
+ depends on DRM_MIPI_DSI
+ depends on BACKLIGHT_CLASS_DEVICE
+ select DRM_DISPLAY_DSC_HELPER
+ select DRM_DISPLAY_HELPER
+ help
+ Say Y here if you want to enable support for the Samsung 4k 6.5" OLED dual-DSI
+ command mode amb650yl01 panel found in the Sony Xperia 1 III, Sony Xperia 1 IV
+ and Sony Xperia V smartphones.
+
+ This Display-IC uses Display Stream Compression 1.1 and features a 1644x3840
+ and 1096x2560 resolution which can both be driven at 60Hz and 120Hz.
+
config DRM_PANEL_SAMSUNG_S6E88A0_AMS427AP24
tristate "Samsung AMS427AP24 panel with S6E88A0 controller"
depends on GPIOLIB && OF && REGULATOR
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index c19429b9e48d..146750b93455 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -74,6 +74,7 @@ obj-$(CONFIG_DRM_PANEL_RENESAS_R69328) += panel-renesas-r69328.o
obj-$(CONFIG_DRM_PANEL_RONBO_RB070D30) += panel-ronbo-rb070d30.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_AMS581VF01) += panel-samsung-ams581vf01.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_AMS639RQ08) += panel-samsung-ams639rq08.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_ANA6707) += panel-samsung-ana6707.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20) += panel-samsung-atna33xc20.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_DB7430) += panel-samsung-db7430.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-ana6707.c b/drivers/gpu/drm/panel/panel-samsung-ana6707.c
new file mode 100644
index 000000000000..83bf954e89d3
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-ana6707.c
@@ -0,0 +1,461 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2023 Marijn Suijten <marijn.suijten@somainline.org>
+ *
+ * Based on the following Sony downstream DTS command sequences:
+ * - Xperia 1 III (sagami pdx215): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/61.2.A.0.xxx/somc/dsi-panel-ana6707_amb650yl01-uhd-pvt.dtsi
+ * - Xperia 1 IV (nagara pdx223): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/64.1.A.0.xxx/display-devicetree/display/dsi-panel-ana6707_amb650yl01-uhd-pdx223.dtsi
+ * - Xperia 1 V (yodo pdx234): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/67.0.A.1.xxx/display-devicetree/display/dsi-panel-ana6707_amb650yl01-uhd.dtsi
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/of_graph.h>
+#include <linux/regulator/consumer.h>
+
+#include <video/mipi_display.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/display/drm_dsc.h>
+#include <drm/display/drm_dsc_helper.h>
+
+#define WRITE_CONTROL_DISPLAY_BACKLIGHT BIT(5)
+
+/*
+ * TODO: This should be communicated via the mode when .prepare
+ * receives atomic commit info
+ */
+static const bool enable_4k = false, enable_120hz = true;
+
+const struct regulator_bulk_data samsung_ana6707_supplies[] = {
+ { .supply = "vddio", /* 1.8 V */ },
+ { .supply = "vci", /* 3.0 V */ },
+};
+
+struct samsung_ana6707 {
+ struct drm_panel panel;
+ struct mipi_dsi_device *dsi[2];
+ struct drm_dsc_config dsc;
+ struct regulator_bulk_data *supplies;
+ struct gpio_desc *reset_gpio;
+};
+
+static inline struct samsung_ana6707 *
+to_samsung_ana6707(struct drm_panel *panel)
+{
+ return container_of(panel, struct samsung_ana6707, panel);
+}
+
+static void samsung_ana6707_reset(struct samsung_ana6707 *ctx)
+{
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ usleep_range(5000, 6000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ usleep_range(1000, 2000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ usleep_range(10000, 11000);
+}
+
+static int samsung_ana6707_program(struct samsung_ana6707 *ctx)
+{
+ const u16 hdisplay = enable_4k ? 1644 : 1096;
+ const u16 vdisplay = enable_4k ? 3840 : 2560;
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+
+ ctx->dsi[0]->mode_flags &= ~MIPI_DSI_MODE_LPM;
+ ctx->dsi[1]->mode_flags |= MIPI_DSI_MODE_LPM;
+
+ mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+ mipi_dsi_msleep(&dsi_ctx, 15);
+
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x16);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe6, 0x44);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x04);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xbd, 0x00, 0xa0);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xed, 0x46, 0x00, 0x0e, 0x90);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x60,
+ enable_4k ? 0x00 : 0x04,
+ enable_120hz ? 0x00 : 0xc0);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+
+ mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, hdisplay - 1);
+ mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, vdisplay - 1);
+ mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+
+ /*
+ * Warning: downstream codes this to 3840 only in 1069x2560@60Hz mode, which causes
+ * tearing and an ugly DSC-corruption-like line at the top of the screen.
+ * enable_4k | enable_120hz ? 0 : 3840
+ */
+ mipi_dsi_dcs_set_tear_scanline_multi(&dsi_ctx, 0);
+
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x09);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb9, 0x09, 0x78);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
+ WRITE_CONTROL_DISPLAY_BACKLIGHT);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x0b);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x92, 0x27, 0x25);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd7, 0x82);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+ mipi_dsi_msleep(&dsi_ctx, 110);
+
+ return 0;
+}
+
+static int samsung_ana6707_prepare(struct drm_panel *panel)
+{
+ struct samsung_ana6707 *ctx = to_samsung_ana6707(panel);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+ struct mipi_dsi_device *dsi = ctx->dsi[0];
+ struct device *dev = &dsi->dev;
+ struct drm_dsc_picture_parameter_set pps;
+ int ret;
+
+ ret = regulator_bulk_enable(ARRAY_SIZE(samsung_ana6707_supplies), ctx->supplies);
+ if (ret < 0) {
+ dev_err(dev, "Failed to enable regulators: %d\n", ret);
+ return ret;
+ }
+
+ samsung_ana6707_reset(ctx);
+
+ msleep(120);
+
+ ret = samsung_ana6707_program(ctx);
+ if (ret < 0) {
+ dev_err(dev, "Failed to initialize panel: %d\n", ret);
+ goto fail;
+ }
+
+ msleep(120);
+
+ drm_dsc_pps_payload_pack(&pps, &ctx->dsc);
+
+ mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps);
+ mipi_dsi_compression_mode_multi(&dsi_ctx, true);
+ mipi_dsi_msleep(&dsi_ctx, 28);
+
+ ret = dsi_ctx.accum_err;
+
+ if (ret < 0)
+ goto fail;
+
+ return 0;
+
+fail:
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ regulator_bulk_disable(ARRAY_SIZE(samsung_ana6707_supplies), ctx->supplies);
+ return ret;
+}
+
+static int samsung_ana6707_enable(struct drm_panel *panel)
+{
+ struct samsung_ana6707 *ctx = to_samsung_ana6707(panel);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+
+ mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+ mipi_dsi_msleep(&dsi_ctx, 10);
+
+ return dsi_ctx.accum_err;
+}
+
+static int samsung_ana6707_disable(struct drm_panel *panel)
+{
+ struct samsung_ana6707 *ctx = to_samsung_ana6707(panel);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+
+ mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+ mipi_dsi_msleep(&dsi_ctx, 20);
+
+ return dsi_ctx.accum_err;
+}
+
+static int samsung_ana6707_unprepare(struct drm_panel *panel)
+{
+ struct samsung_ana6707 *ctx = to_samsung_ana6707(panel);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+
+ mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+ mipi_dsi_msleep(&dsi_ctx, 120);
+
+ ctx->dsi[0]->mode_flags &= ~MIPI_DSI_MODE_LPM;
+ ctx->dsi[1]->mode_flags &= ~MIPI_DSI_MODE_LPM;
+
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ regulator_bulk_disable(ARRAY_SIZE(samsung_ana6707_supplies), ctx->supplies);
+
+ return dsi_ctx.accum_err;
+}
+
+static const int fake_porch_4k = 120;
+
+/*
+ * All of the horizontal values here are x2 of what's specified in the downstream device-tree,
+ * as the information there has already been pre-divided by the number of DSI hosts
+ */
+
+static const struct drm_display_mode samsung_ana6707_mode_4k = {
+ .clock = (1644 + fake_porch_4k) * 3840 * 60 / 1000,
+ .hdisplay = 1644,
+ .hsync_start = 1644,
+ .hsync_end = 1644,
+ .htotal = 1644 + fake_porch_4k,
+ .vdisplay = 3840,
+ .vsync_start = 3840,
+ .vsync_end = 3840,
+ .vtotal = 3840,
+ .width_mm = 65,
+ .height_mm = 152,
+ .type = DRM_MODE_TYPE_DRIVER,
+};
+
+static const int fake_porch_4k_120 = 216;
+
+static const struct drm_display_mode samsung_ana6707_mode_4k_120 = {
+ .clock = (1644 + fake_porch_4k_120) * 3840 * 120 / 1000,
+ .hdisplay = 1644,
+ .hsync_start = 1644,
+ .hsync_end = 1644,
+ .htotal = 1644 + fake_porch_4k_120,
+ .vdisplay = 3840,
+ .vsync_start = 3840,
+ .vsync_end = 3840,
+ .vtotal = 3840,
+ .width_mm = 65,
+ .height_mm = 152,
+ .type = DRM_MODE_TYPE_DRIVER,
+};
+
+static const int fake_porch = 100;
+
+static const struct drm_display_mode samsung_ana6707_mode = {
+ .clock = (1096 + fake_porch) * 2560 * 60 / 1000,
+ .hdisplay = 1096,
+ .hsync_start = 1096,
+ .hsync_end = 1096,
+ .htotal = 1096 + fake_porch,
+ .vdisplay = 2560,
+ .vsync_start = 2560,
+ .vsync_end = 2560,
+ .vtotal = 2560,
+ .width_mm = 65,
+ .height_mm = 152,
+ .type = DRM_MODE_TYPE_DRIVER,
+};
+
+static const int fake_porch_120 = 130;
+
+static const struct drm_display_mode samsung_ana6707_mode_120 = {
+ .clock = (1096 + fake_porch_120) * 2560 * 120 / 1000,
+ .hdisplay = 1096,
+ .hsync_start = 1096,
+ .hsync_end = 1096,
+ .htotal = 1096 + fake_porch_120,
+ .vdisplay = 2560,
+ .vsync_start = 2560,
+ .vsync_end = 2560,
+ .vtotal = 2560,
+ .width_mm = 65,
+ .height_mm = 152,
+ .type = DRM_MODE_TYPE_DRIVER,
+};
+
+static int samsung_ana6707_get_modes(struct drm_panel *panel,
+ struct drm_connector *connector)
+{
+ const struct drm_display_mode *mode;
+
+ /*
+ * TODO: return all 4 modes when drm_bridge/drm_panel get it back in an
+ * atomic_prepare callback
+ */
+ if (enable_4k) {
+ if (enable_120hz)
+ mode = &samsung_ana6707_mode_4k_120;
+ else
+ mode = &samsung_ana6707_mode_4k;
+ } else {
+ if (enable_120hz)
+ mode = &samsung_ana6707_mode_120;
+ else
+ mode = &samsung_ana6707_mode;
+ }
+
+ return drm_connector_helper_get_modes_fixed(connector, mode);
+}
+
+static const struct drm_panel_funcs samsung_ana6707_panel_funcs = {
+ .prepare = samsung_ana6707_prepare,
+ .enable = samsung_ana6707_enable,
+ .disable = samsung_ana6707_disable,
+ .unprepare = samsung_ana6707_unprepare,
+ .get_modes = samsung_ana6707_get_modes,
+};
+
+static int samsung_ana6707_bl_update_status(struct backlight_device *bl)
+{
+ struct mipi_dsi_device *dsi = bl_get_data(bl);
+ u16 brightness = backlight_get_brightness(bl);
+
+ return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
+}
+
+static const struct backlight_ops samsung_ana6707_bl_ops = {
+ .update_status = samsung_ana6707_bl_update_status,
+};
+
+static int samsung_ana6707_probe(struct mipi_dsi_device *dsi)
+{
+ const struct backlight_properties props = {
+ .type = BACKLIGHT_RAW,
+ .brightness = 3000,
+ .max_brightness = 4095,
+ };
+ const u16 hdisplay = enable_4k ? 1644 : 1096;
+ struct mipi_dsi_host *dsi_sec_host;
+ struct samsung_ana6707 *ctx;
+ struct device *dev = &dsi->dev;
+ struct device_node *dsi_sec;
+ int ret, i;
+
+ ctx = devm_drm_panel_alloc(dev, struct samsung_ana6707, panel,
+ &samsung_ana6707_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
+
+ ret = devm_regulator_bulk_get_const(
+ dev,
+ ARRAY_SIZE(samsung_ana6707_supplies),
+ samsung_ana6707_supplies,
+ &ctx->supplies);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Failed to get regulators\n");
+
+ ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+ if (IS_ERR(ctx->reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+ "Failed to get reset-gpios\n");
+
+ dsi_sec = of_graph_get_remote_node(dsi->dev.of_node, 1, -1);
+ if (!dsi_sec)
+ return dev_err_probe(dev, -ENODEV,
+ "Cannot find secondary DSI OF node\n");
+
+ dev_info(dev, "Using Dual-DSI with OF node `%s`\n", dsi_sec->name);
+ const struct mipi_dsi_device_info info = { "ANA6707", 0,
+ dsi_sec };
+
+
+ dsi_sec_host = of_find_mipi_dsi_host_by_node(dsi_sec);
+ of_node_put(dsi_sec);
+ if (!dsi_sec_host)
+ return dev_err_probe(dev, -EPROBE_DEFER,
+ "Cannot get secondary DSI host\n");
+
+ ctx->dsi[1] = devm_mipi_dsi_device_register_full(dev, dsi_sec_host, &info);
+ if (IS_ERR(ctx->dsi[1]))
+ return dev_err_probe(dev, PTR_ERR(ctx->dsi[1]),
+ "Cannot register secondary DSI device\n");
+
+ mipi_dsi_set_drvdata(ctx->dsi[1], ctx);
+
+ ctx->dsi[0] = dsi;
+ mipi_dsi_set_drvdata(dsi, ctx);
+
+ ctx->panel.prepare_prev_first = true;
+
+ ctx->panel.backlight = devm_backlight_device_register(
+ dev, dev_name(dev), dev, dsi,
+ &samsung_ana6707_bl_ops,
+ &props);
+ if (IS_ERR(ctx->panel.backlight))
+ return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
+ "Failed to create backlight\n");
+
+ drm_panel_add(&ctx->panel);
+
+ ctx->dsc.dsc_version_major = 1;
+ ctx->dsc.dsc_version_minor = 1;
+
+ ctx->dsc.slice_height = 32;
+ /* One slice per encoder */
+ ctx->dsc.slice_count = 1;
+ ctx->dsc.slice_width = hdisplay / 2; /* 2 encoders */
+ ctx->dsc.bits_per_component = 8;
+ ctx->dsc.bits_per_pixel = 8 << 4; /* 4 fractional bits */
+ ctx->dsc.block_pred_enable = true;
+
+ for (i = 0; i < ARRAY_SIZE(ctx->dsi); i++) {
+ /* This panel only supports DSC; unconditionally enable it */
+ ctx->dsi[i]->dsc = &ctx->dsc;
+
+ ctx->dsi[i]->lanes = 4;
+ ctx->dsi[i]->format = MIPI_DSI_FMT_RGB888;
+ ctx->dsi[i]->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS;
+
+ ret = devm_mipi_dsi_attach(dev, ctx->dsi[i]);
+ /* TODO: Detach dsi0 if dsi1 failed? */
+ if (ret < 0) {
+ drm_panel_remove(&ctx->panel);
+ return dev_err_probe(dev, ret,
+ "Failed to attach to DSI%d\n", i);
+ }
+ }
+
+ return 0;
+}
+
+static void samsung_ana6707_remove(struct mipi_dsi_device *dsi)
+{
+ struct samsung_ana6707 *ctx = mipi_dsi_get_drvdata(dsi);
+ int ret, i;
+
+ for (i = 0; i < ARRAY_SIZE(ctx->dsi); i++) {
+ ret = mipi_dsi_detach(ctx->dsi[i]);
+ if (ret < 0)
+ dev_err(&ctx->dsi[i]->dev, "Failed to detach from DSI%d host: %d\n",
+ i, ret);
+ }
+
+ drm_panel_remove(&ctx->panel);
+}
+
+static const struct of_device_id samsung_ana6707_of_match[] = {
+ { .compatible = "samsung,ana6707-amb650yl01" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, samsung_ana6707_of_match);
+
+static struct mipi_dsi_driver samsung_ana6707_driver = {
+ .probe = samsung_ana6707_probe,
+ .remove = samsung_ana6707_remove,
+ .driver = {
+ .name = "panel-samsung-ana6707",
+ .of_match_table = samsung_ana6707_of_match,
+ },
+};
+module_mipi_dsi_driver(samsung_ana6707_driver);
+
+MODULE_AUTHOR("Marijn Suijten <marijn.suijten@somainline.org>");
+MODULE_DESCRIPTION("DRM panel driver for Samsung ANA6707 Display-Driver-IC panels");
+MODULE_LICENSE("GPL");

View file

@ -0,0 +1,346 @@
From 7eb61f15ce600cd647b33d28b86cb0e15eca3f3d Mon Sep 17 00:00:00 2001
From: Jan Paszkowski <janmpaszkowski@proton.me>
Date: Fri, 27 Feb 2026 12:53:09 +0100
Subject: [PATCH] Sagami DTS patch with panel
---
.../qcom/sm8350-sony-xperia-sagami-pdx214.dts | 13 +-
.../qcom/sm8350-sony-xperia-sagami-pdx215.dts | 41 +++++
.../dts/qcom/sm8350-sony-xperia-sagami.dtsi | 160 ++++++++++++++++--
3 files changed, 197 insertions(+), 17 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx214.dts b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx214.dts
index e6824c8c2774..d92af88fb4c0 100644
--- a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx214.dts
+++ b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx214.dts
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause
/*
* Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ * Copyright (c) 2025, Marijn Suijten <marijn.suijten@somainline.org>
*/
/dts-v1/;
@@ -12,10 +13,14 @@ / {
compatible = "sony,pdx214-generic", "qcom,sm8350";
};
-&framebuffer {
- width = <1080>;
- height = <2520>;
- stride = <(1080 * 4)>;
+// &framebuffer {
+// width = <1080>;
+// height = <2520>;
+// stride = <(1080 * 4)>;
+// };
+
+&panel {
+ compatible = "samsung,ana6707-amb650yl01";
};
&pm8350b_gpios {
diff --git a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx215.dts b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx215.dts
index c6f402c3ef35..e2d895bb1d0f 100644
--- a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx215.dts
+++ b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx215.dts
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause
/*
* Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ * Copyright (c) 2025, Marijn Suijten <marijn.suijten@somainline.org>
*/
/dts-v1/;
@@ -67,6 +68,46 @@ slg51000_a_ldo7: ldo7 {
};
};
+&mdss_dsi0 {
+ qcom,dual-dsi-mode;
+ qcom,sync-dual-dsi;
+ qcom,master-dsi;
+};
+
+&mdss_dsi1 {
+ /* DSI1 is slave, so use DSI0 clocks */
+ assigned-clock-parents = <&mdss_dsi0_phy 0>,
+ <&mdss_dsi0_phy 1>;
+ vdda-supply = <&pm8350_l6>;
+ qcom,dual-dsi-mode;
+ qcom,sync-dual-dsi;
+ status = "okay";
+};
+
+&mdss_dsi1_out {
+ remote-endpoint = <&panel_in_1>;
+ data-lanes = <0 1 2 3>;
+};
+
+&mdss_dsi1_phy {
+ vdds-supply = <&pm8350_l5>;
+ status = "okay";
+};
+
+&panel {
+ compatible = "samsung,ana6707-amb650yl01";
+};
+
+&panel_ports {
+ port@1 {
+ reg = <1>;
+
+ panel_in_1: endpoint {
+ remote-endpoint = <&mdss_dsi1_out>;
+ };
+ };
+};
+
&pm8350b_gpios {
gpio-line-names = "CAM_PWR_A_CS", /* GPIO_1 */
"NC",
diff --git a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
index 7ae1eb0a7cce..283a3069904d 100644
--- a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause
/*
* Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ * Copyright (c) 2025, Marijn Suijten <marijn.suijten@somainline.org>
*/
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
@@ -38,11 +39,27 @@ framebuffer: framebuffer@e1000000 {
stride = <(1096 * 4)>;
format = "a8r8g8b8";
/*
- * That's (going to be) a lot of clocks, but it's necessary due
+ * That's a lot of clocks, but it's necessary due
* to unused clk cleanup & no panel driver yet
*/
clocks = <&gcc GCC_DISP_HF_AXI_CLK>,
<&gcc GCC_DISP_SF_AXI_CLK>;
+ // clocks =
+ // <&dispcc DISP_CC_MDSS_AHB_CLK>,
+ // <&dispcc DISP_CC_MDSS_BYTE0_CLK>,
+ // <&dispcc DISP_CC_MDSS_BYTE0_INTF_CLK>,
+ // <&dispcc DISP_CC_MDSS_BYTE1_CLK>,
+ // <&dispcc DISP_CC_MDSS_BYTE1_INTF_CLK>,
+ // <&dispcc DISP_CC_MDSS_ESC0_CLK>,
+ // <&dispcc DISP_CC_MDSS_ESC1_CLK>,
+ // <&dispcc DISP_CC_MDSS_MDP_CLK>,
+ // <&dispcc DISP_CC_MDSS_MDP_LUT_CLK>,
+ // <&dispcc DISP_CC_MDSS_PCLK0_CLK>,
+ // <&dispcc DISP_CC_MDSS_PCLK1_CLK>,
+ // <&dispcc DISP_CC_MDSS_VSYNC_CLK>,
+ // <&gcc GCC_DISP_HF_AXI_CLK>,
+ // <&gcc GCC_DISP_SF_AXI_CLK>;
+ // power-domains = <&dispcc MDSS_GDSC>, <&rpmhpd RPMHPD_MMCX>;
};
};
@@ -104,6 +121,20 @@ ramoops@ffc00000 {
};
};
+ vreg_vddr: vddr-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vddr";
+ /* Unknown voltage ranges.. :( */
+ /* Bootloader splash mandates it's on at boot */
+ regulator-boot-on;
+ regulator-always-on;
+ gpio = <&tlmm 154 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&disp_vddr_en>;
+ pinctrl-names = "default";
+ };
+
vph_pwr: vph-pwr-regulator {
compatible = "regulator-fixed";
regulator-name = "vph_pwr";
@@ -115,10 +146,10 @@ vph_pwr: vph-pwr-regulator {
};
};
-&adsp {
- status = "okay";
- firmware-name = "qcom/sm8350/Sony/sagami/adsp.mbn";
-};
+// &adsp {
+// status = "okay";
+// firmware-name = "qcom/sm8350/Sony/sagami/adsp.mbn";
+// };
&apps_rsc {
regulators-0 {
@@ -468,9 +499,25 @@ pmr735a_l7: ldo7 {
};
};
-&cdsp {
+// &cdsp {
+// status = "okay";
+// firmware-name = "qcom/sm8350/Sony/sagami/cdsp.mbn";
+// };
+
+&gpi_dma0 {
status = "okay";
- firmware-name = "qcom/sm8350/Sony/sagami/cdsp.mbn";
+};
+
+&gpi_dma1 {
+ status = "okay";
+};
+
+&gpu {
+ status = "okay";
+
+ zap-shader {
+ firmware-name = "qcom/sm8350/Sony/sagami/a660_zap.mbn";
+ };
};
&i2c1 {
@@ -485,6 +532,18 @@ &i2c4 {
clock-frequency = <400000>;
/* Samsung Touchscreen (needs I2C GPI DMA) @ 48 */
+ touchscreen@48 {
+ compatible = "samsung,s6sy761";
+ reg = <0x48>;
+ interrupt-parent = <&tlmm>;
+ interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
+ // vdd-supply = <&pm8350c_l2>;
+ // avdd-supply = <&pm8350c_l3>;
+
+ pinctrl-names = "default";
+ // pinctrl-0 = <&ts_reset_default &ts_int_default>;
+ pinctrl-0 = <&ts_int_default>;
+ };
};
&i2c11 {
@@ -559,11 +618,63 @@ &ipa {
status = "okay";
};
-&mpss {
+&mdss {
+ status = "okay";
+};
+
+&mdss_dsi0 {
+ vdda-supply = <&pm8350_l6>;
+ status = "okay";
+
+ panel: panel@0 {
+ reg = <0>;
+
+ reset-gpios = <&tlmm 24 GPIO_ACTIVE_LOW>;
+
+ vci-supply = <&pm8350c_l13>;
+ // tsvddh-supply = <&pm8350c_l3>;
+ tsio-supply = <&pm8350c_l2>;
+ vddio-supply = <&pm8350c_l12>;
+ vddr-supply = <&vreg_vddr>;
+ // ab-supply = <&ab>;
+ // ibb-supply = <&ibb>;
+
+ pinctrl-0 = <&disp_reset_n &disp_vsync_active>;
+ pinctrl-names = "default";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ panel_ports: ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ panel_in_0: endpoint {
+ remote-endpoint = <&mdss_dsi0_out>;
+ };
+ };
+ };
+ };
+};
+
+&mdss_dsi0_out {
+ remote-endpoint = <&panel_in_0>;
+ data-lanes = <0 1 2 3>;
+};
+
+&mdss_dsi0_phy {
+ vdds-supply = <&pm8350_l5>;
status = "okay";
- firmware-name = "qcom/sm8350/Sony/sagami/modem.mbn";
};
+// &mpss {
+// status = "okay";
+// firmware-name = "qcom/sm8350/Sony/sagami/modem.mbn";
+// };
+
&pm8350_gpios {
gpio-line-names = "ASSIGN1_THERM", /* GPIO_1 */
"LCD_ID",
@@ -655,10 +766,10 @@ &sdhc_2 {
status = "okay";
};
-&slpi {
- status = "okay";
- firmware-name = "qcom/sm8350/Sony/sagami/slpi.mbn";
-};
+// &slpi {
+// status = "okay";
+// firmware-name = "qcom/sm8350/Sony/sagami/slpi.mbn";
+// };
&spi14 {
status = "okay";
@@ -879,6 +990,21 @@ ts_int_default: ts-int-default-state {
bias-disable;
};
+ disp_reset_n: disp-reset-n-state {
+ pins = "gpio24";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ output-high;
+ };
+
+ disp_vsync_active: disp-vsync-active-state {
+ pins = "gpio82";
+ function = "mdp_vsync";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
sdc2_card_det_active: sd-card-det-active-state {
pins = "gpio92";
function = "gpio";
@@ -892,6 +1018,14 @@ sdc2_card_det_sleep: sd-card-det-sleep-state {
drive-strength = <2>;
bias-disable;
};
+
+ disp_vddr_en: disp-vddr-en-state {
+ pins = "gpio154";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ output-high;
+ };
};
/* BIG WARNING! DO NOT TOUCH UFS, YOUR DEVICE WILL DIE! */
--
2.53.0

View file

@ -0,0 +1,79 @@
From 5fd97f50fa5f1373a1a9a10d37686a8d435e9061 Mon Sep 17 00:00:00 2001
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Date: Sun, 4 Jun 2023 21:44:33 +0300
Subject: [PATCH 04/29] drm/msm/dsi: change sync mode to sync on DSI0 rather
than DSI1
Change MSM DSI's sync-dual-dsi mode to resync on DSI0 rather than DSI1.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/msm/dsi/dsi_manager.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index ca400924d4ee..12708a84cca4 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -495,7 +495,7 @@ int msm_dsi_manager_connector_init(struct msm_dsi *msm_dsi,
int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg)
{
struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
- struct msm_dsi *msm_dsi0 = dsi_mgr_get_dsi(DSI_0);
+ struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1);
struct mipi_dsi_host *host = msm_dsi->host;
bool is_read = (msg->rx_buf && msg->rx_len);
bool need_sync = (IS_SYNC_NEEDED() && !is_read);
@@ -506,14 +506,14 @@ int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg)
/* In bonded master case, panel requires the same commands sent to
* both DSI links. Host issues the command trigger to both links
- * when DSI_1 calls the cmd transfer function, no matter it happens
- * before or after DSI_0 cmd transfer.
+ * when DSI_0 calls the cmd transfer function, no matter it happens
+ * before or after DSI_1 cmd transfer.
*/
- if (need_sync && (id == DSI_0))
+ if (need_sync && (id == DSI_1))
return is_read ? msg->rx_len : msg->tx_len;
- if (need_sync && msm_dsi0) {
- ret = msm_dsi_host_xfer_prepare(msm_dsi0->host, msg);
+ if (need_sync && msm_dsi1) {
+ ret = msm_dsi_host_xfer_prepare(msm_dsi1->host, msg);
if (ret) {
pr_err("%s: failed to prepare non-trigger host, %d\n",
__func__, ret);
@@ -532,8 +532,8 @@ int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg)
msm_dsi_host_xfer_restore(host, msg);
restore_host0:
- if (need_sync && msm_dsi0)
- msm_dsi_host_xfer_restore(msm_dsi0->host, msg);
+ if (need_sync && msm_dsi1)
+ msm_dsi_host_xfer_restore(msm_dsi1->host, msg);
return ret;
}
@@ -541,14 +541,14 @@ int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg)
bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len)
{
struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
- struct msm_dsi *msm_dsi0 = dsi_mgr_get_dsi(DSI_0);
+ struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1);
struct mipi_dsi_host *host = msm_dsi->host;
- if (IS_SYNC_NEEDED() && (id == DSI_0))
+ if (IS_SYNC_NEEDED() && (id == DSI_1))
return false;
- if (IS_SYNC_NEEDED() && msm_dsi0)
- msm_dsi_host_cmd_xfer_commit(msm_dsi0->host, dma_base, len);
+ if (IS_SYNC_NEEDED() && msm_dsi1)
+ msm_dsi_host_cmd_xfer_commit(msm_dsi1->host, dma_base, len);
msm_dsi_host_cmd_xfer_commit(host, dma_base, len);
--
2.53.0

View file

@ -0,0 +1,88 @@
From ad2e377174580a99479fb66c4dbc5c93efd4d8d2 Mon Sep 17 00:00:00 2001
From: Marijn Suijten <marijn.suijten@somainline.org>
Date: Tue, 9 Apr 2024 22:37:57 +0200
Subject: [PATCH 15/29] dual-DSI dual-DSC panel
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 +++++++-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 2 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc_1_2.c | 3 ++-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h | 3 +--
drivers/gpu/drm/msm/dsi/dsi_host.c | 4 ++--
5 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 9b8e57cc286b..301ed0b14bfd 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -2041,8 +2041,13 @@ static void dpu_encoder_prep_dsc(struct dpu_encoder_virt *dpu_enc,
this_frame_slices = pic_width / dsc->slice_width;
intf_ip_w = this_frame_slices * dsc->slice_width;
+ /*
+ * dsc merge case: when using 2 encoders for the same stream,
+ * no. of slices need to be same on both the encoders.
+ */
enc_ip_w = intf_ip_w / num_dsc;
- initial_lines = dpu_encoder_dsc_initial_line_calc(dsc, enc_ip_w);
+ initial_lines = 3;
+ // dpu_encoder_dsc_initial_line_calc(dsc, enc_ip_w);
for (i = 0; i < num_dsc; i++)
dpu_encoder_dsc_pipe_cfg(ctl, hw_dsc[i], hw_pp[i],
@@ -2663,6 +2668,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
DPU_DEBUG("h_tile_instance %d = %d, split_role %d\n",
i, controller_id, phys_params.split_role);
+ // TODO: this is where we need to grab two INTfs?
phys_params.hw_intf = dpu_encoder_get_intf(dpu_kms->catalog, &dpu_kms->rm,
disp_info->intf_type,
controller_id);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
index ac834db2e4c1..2a3c3368d519 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
@@ -580,7 +580,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
* added in SW. Power on reset value is not disable.
*/
if (ctx->mdss_ver->core_major_ver >= 7)
- mode_sel = CTL_DEFAULT_GROUP_ID << 28;
+ mode_sel = CTL_DEFAULT_GROUP_ID << 28;
if (cfg->intf_mode_sel == DPU_CTL_MODE_SEL_CMD)
mode_sel |= BIT(17);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc_1_2.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc_1_2.c
index b3395e9c34a1..97999c5d0803 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc_1_2.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc_1_2.c
@@ -109,9 +109,10 @@ static void dpu_hw_dsc_config_1_2(struct dpu_hw_dsc *hw_dsc,
if (mode & DSC_MODE_MULTIPLEX)
data |= BIT(1);
- num_active_slice_per_enc = dsc->slice_count;
if (mode & DSC_MODE_MULTIPLEX)
num_active_slice_per_enc = dsc->slice_count / 2;
+ else
+ num_active_slice_per_enc = dsc->slice_count;
data |= (num_active_slice_per_enc & 0x3) << 7;
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index e0de545d4077..620b44881ad9 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -996,9 +996,9 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
u32 bytes_per_pclk;
/* update dsc params with timing params */
- if (!dsc || !mode->hdisplay || !mode->vdisplay) {
+ if (!dsc || !hdisplay || !mode->vdisplay) {
pr_err("DSI: invalid input: pic_width: %d pic_height: %d\n",
- mode->hdisplay, mode->vdisplay);
+ hdisplay, mode->vdisplay);
return;
}
--
2.53.0

View file

@ -0,0 +1,25 @@
From 5e68f7253026b6a84918781c5474437dd65bac02 Mon Sep 17 00:00:00 2001
From: Marijn Suijten <marijn.suijten@somainline.org>
Date: Mon, 1 Apr 2024 17:46:25 +0200
Subject: [PATCH 17/29] CONFIRMATION: TE is used
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
index 0ec6d67c7c70..46c29d66ebaf 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
@@ -386,7 +386,7 @@ static void dpu_encoder_phys_cmd_tearcheck_config(
* TE event coming from the display TE pin we won't stall immediately
*/
tc_cfg.hw_vsync_mode = 1;
- tc_cfg.sync_cfg_height = mode->vtotal * 2;
+ tc_cfg.sync_cfg_height = 0xfff0;//mode->vtotal * 2;
tc_cfg.vsync_init_val = mode->vdisplay;
tc_cfg.sync_threshold_start = DEFAULT_TEARCHECK_SYNC_THRESH_START;
tc_cfg.sync_threshold_continue = DEFAULT_TEARCHECK_SYNC_THRESH_CONTINUE;
--
2.53.0

View file

@ -0,0 +1,100 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/defconfig
maintainer="Jan Paszkowski <janmpaszkowski@proton.me>"
_flavor="sony-pdx215"
pkgname=linux-$_flavor
pkgver=7.0_rc1
pkgrel=0
pkgdesc="Mainline kernel fork for Sony Xperia 1 III"
arch="aarch64"
_carch="arm64"
url="https://kernel.org"
license="GPL-2.0-only"
options="
!strip
!check
!tracedeps
pmb:cross-native
pmb:kconfigcheck-nftables
"
makedepends="
bison
clang
clang-libclang
diffutils
elfutils-dev
findutils
flex
linux-headers
lld
llvm
openssl-dev
pahole
perl
postmarketos-installkernel
python3
rust
rust-bindgen
rust-src
rustfmt
sed
zstd
"
_commit="6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f"
_config="config-$_flavor.$arch"
# Source
source="
$pkgname-$_commit.tar.gz::https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-$_commit.tar.gz
$_config
0001-panel-driver-patch.patch
0002-Sagami-DTS-patch-with-panel.patch
0003-drm-msm-dsi-change-sync-mode-to-sync-on-DSI0-rather-.patch
0004-dual-DSI-dual-DSC-panel.patch
0005-CONFIRMATION-TE-is-used.patch
"
builddir="$srcdir/linux-$_commit"
prepare() {
default_prepare
cp "$srcdir/config-$_flavor.$arch" .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" LLVM=1 \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor"
}
package() {
mkdir -p "$pkgdir"/boot
install -Dm644 "$builddir/arch/$_carch/boot/Image.gz" \
"$pkgdir/boot/vmlinuz"
make modules_install dtbs_install \
ARCH="$_carch" \
LLVM=1 \
INSTALL_PATH="$pkgdir"/boot/ \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_MOD_STRIP=1 \
INSTALL_DTBS_PATH="$pkgdir/boot/dtbs"
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
#cp -r "$builddir"/arch/arm64/boot/dts/qcom \
# "$pkgdir"/boot/qcom
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
}
sha512sums="
64b2672445e8cf8bdc927b236eac7ef34f6f11a8615a35636205f3026c64540ffe85afa2b74c4368b83518b56c42f5776fe4f0d57cfdb4df600fd856099c873e linux-sony-pdx215-6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f.tar.gz
6446e5025c31fd99608617c950ef0d153c4a7b1317a3e0a12aeea72918e12b1e4e2cd4d120631ba7156162f23f342099f93c1f89c8f58f49030424c149d26dc7 config-sony-pdx215.aarch64
b48f4867907347680a67dff38597a8952d7e59eb83a9a3197975d752ddc6fbb9dc99d9ecd8d839d8ba08541cb10600282fde41af3fcd257637934303234c9786 0001-panel-driver-patch.patch
2adb1efb6ebf4236c4886d89f130499e5585950671f6f5851e7a663d6b5fd052e3b2440802b733202ec06937b13b7a896efc5d99d201a5d9aceae6f2536f69f4 0002-Sagami-DTS-patch-with-panel.patch
301198eecdba3667dbc5e70f3c0bbed8769b7d652325798a79ca86f9ec60a324d41eced135495939c8eddfa5bb7ccae4e89ed5d56ad24b20064b70d79755e564 0003-drm-msm-dsi-change-sync-mode-to-sync-on-DSI0-rather-.patch
79e6bf34f303a98ba338490ae32bf5670fa9f6151542c93ded5fa287f50026efa11bcb77d72adefe414151423bf7377dda4f605d74ca101118052f763ea9e707 0004-dual-DSI-dual-DSC-panel.patch
4bf952c8345d7edd59ace2a71aa66f71e7c43004c1bd62c1243d1ba7a32efa85270bc869a15133cefa4137168374144f5d42a985db70ce638f519c7fef71b945 0005-CONFIRMATION-TE-is-used.patch
"

File diff suppressed because it is too large Load diff