From patchwork Sun Nov 1 20:34:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain TISSERAND X-Patchwork-Id: 3802 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id AAD601C3117 for ; Sun, 1 Nov 2026 21:34:31 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27036-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-27036-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 84E922813A for ; Sun, 1 Nov 2026 20:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793565250; b=a3MgP1WVCVdHjq2A4s9cVbP1HJw+LisMpHF+gTEn/twLOzVplnN1xBhxj1GdqYgCMWhA LZ8mc15YvBmOrLxMpYXg87Af/BqZ4bmcekrzeuJ/lLFKfD+xmy1fveKx6VJctPt85fQJy nUbhqBsIRUiM2aN6v9ElafFR+/Skwsga0yUnswjUOtotwQiYaSHCLcUBH9VZY/sYQ3R4n 1/yv09Wcm4Kbt95ZFbDI8caPkmsE8quukiY0Y+Ia1mIP/99pL9CVRDfSTueG0EPyxkWJR h4/guzpJKmOXJ8mBg4KHyW2eqGBj/m7aJXeB5YlS0ynl7u6+Y13IKXx0sd6y6rd2iiw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793565250; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=F89725KkjE+kUI5LXBxmdgLNt89Tfm7tC84mMjTHCkI=; b=ozd1iaCr7EDutzB1GZ4cyltNHFE7NH4HaoVL3UC7mz/Zqq4ZK/YJw1aRwv1kGI7RjkW0 zFJxXJ0HZWmlMDMTlbnqHXJ3F0hdCGwJniyC+LMl1YJgdAIXRp/NKgQUKwQtVa/znKb9Y Yw479gjywr0sJrRkgeAbLVgPtmU+/ksJJOXIAeNhe7YtHvoEbLICHYKZq35/qTierXhxR 1IpuLG2hYDJsqJwmA81Ldea/deqpHsxvOrVCINhyOnV9mEuQL/SE6OytTpgHJ4jJTkqGK 9FD8jdPExcr0ifwrjU+jUt3lblezkMsF6uXWEcaFicVFnj+MhHJRn7W2piRxYBDdVUA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FSR6XuCr; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 217D2606A332; Sun, 1 Nov 2026 20:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FSR6XuCr X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793565250; b=xzF5BpLejamHPbgtNaFtidVF9o6WtQ7WXEBz7z7dR/Y3GJjub6gFtaC521aLIL+ZhmKd i8dvhi2N4DYk5jUX0yOjQKBlEpEvuFZRtP9bEK7px4uVVAfASpDIz6lTkOLbagNdatzLL B+ntVOu3U00tCEHyyWIPDmljeBjbHKwtVF/2ns+GDQkqLMx7gckmO0DeTf+5XK2FDIq6g V7JD4oOJUk4p1yz5d6wu0f0TtHg4/fO6lNXHRzpJiQ6BkzUDW5Ub2oj+J/ElOVCZX1EPH CI5do/zRuAjgqliQhB3mo8Un/ptJnXpwht1fs6df7xRmtJV3iAfwo4hci/HXyx6O8yQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793565250; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=F89725KkjE+kUI5LXBxmdgLNt89Tfm7tC84mMjTHCkI=; b=Klgr2ZYaqBXqe8ngY42T1992Ig3pGoj7sVBgHC86136/w/VGJ4LEjX+l1tBa4C3MAqYe 0HgwAGKxAqUSExNh6tgFVC0VA30/KV9BuCC4T7V9jdzcmRK7M2Qi7cBsnA9rNJFHaDbKz 3L7CORMEqtLbi3K1Tvp5f3hbljF/+66bWJc6SfTC59g6y9SzFaLYPGkgGCmyCvHKZxrAu +UwxPG1YeXwUsexcHyr0MS8wGPkEe9BIk1L2EzeEPTs+j/vq7/Kx00i5OJh6xmRDU1R0Y sbhnMQMKq754gRwJrzLDny+J2tsjmvquTWTZkb3w9n+pEc1SXipMpHt4/2gtp2EIJ/Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FSR6XuCr; arc=none smtp.remote-ip=209.85.128.54 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7ECB606A326 for ; Sun, 1 Nov 2026 20:34:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A7ECB606A326 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4a210470b49so18506155e9.2 for ; Sun, 01 Nov 2026 12:34:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793565248; x=1794170048; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=F89725KkjE+kUI5LXBxmdgLNt89Tfm7tC84mMjTHCkI=; b=FSR6XuCrgDAmTHoBkoFAyYnqM78RNwGIRz0nHlzqWBqSsnlbvADPFrXEY0yN6j/MgX Xh2ksvEvIS0nHsaZx0ZWPDhhdgJr2ElGkELY1M+w1uHvWEz8pD1SFCW7ShjTQwvj+ga7 M+shJ2o+PvT1meEzBK0nSluNRchp8FDedte76TbYZ4JXD+5132pwWOPw4kDnX5AK7eHF AtsvZr+0dSIx3Li6WyGDL9ttPdRH23iTmsWAZjuFYiqDsKWFhBtoZd4Nrq4RBbpTpWPE Z8iP3o9UAHWv33AMO7QsSLjfkT62jRzaPeFgbHRcng+276P5sHu334x4xDV2NG9MPKgz /iQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793565248; x=1794170048; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=F89725KkjE+kUI5LXBxmdgLNt89Tfm7tC84mMjTHCkI=; b=pLIdW64ZhSsjMPZgdcMZNPSkNFSnaW7MALakXv2WRK31SoPZRChph6HG/6h+Wc3xjr hVKhN5Ip3Bms0ZPMvvp+FxrQizOy3Y6Qu57/fhXocsK0eb/pwv0nrF4Yo/Ri6DibOr3K HI29dzUz8B8er41LHS8dR8gI9l8JdsvSzU8mcErPnOvhxzJBeXy52WcEqE7AFSQeKyAX tbitjzV7R+NGoA5M2Lgflgalz8AOtFtQa3ggzmdV2mARm1kWimd0cFrdJ6Ebul3HyOo9 kM3z/aZIrOumqlKNz2p6h7gpDJV30xs6lKm4OZnpkWJ5sGGLZuVUq96Z/DvtdJbCTIOV Wljw== X-Forwarded-Encrypted: i=1; AKwUvBynyzhQ5F/SLeM07EpV/AbBJ7LzZu7b1294Sw8LLtMARbPYF7zijTFq5pCY5So4UBXw8tHXpXOPQjEO2g==@lists.linux.dev X-Gm-Message-State: AFq9FYLddJXp1qEvQn4ILkRjtYwLt8TAdRdQ8Y/v/ovPJcIvvyMzyKsR 0d0BTDIUIjuSDCKwbaSxciUiPWl27ArlhKg0EI5NzT2AYRrGFtoSdmLr X-Gm-Gg: AYBFou3PyKVP+lo+BGU5IZDAuDD2KCODBx34gyuDOLWEJ/FmOe2g0n2ylKd50NvdrXc pf8iCuOFIlFO3jsa+IEdzyxIt8akmNaznL+virglL6PJ13UtxhXLCkqKPwPCarMTGljQyepC3pO HhOah7VdJb+biEowaW1nYYkEVoifJDKey5gLjkJ3YvfWFRu6rLXZ3lOqwzvbiG9g7t0g0biEBiy LqHCC+7GxWqxR9CpEjoq381/sy+rw2EmXXzPZ64fWJOjxisye2GGMEnyuwJcXzkeHkfOYWdY+tH 5Qxx3KzQdQgO9WncbD6QrJMdvS+ViIgPXtwvqTdw50oDNxis0JA5p+stm9PTCk9CtM5UtSoXm/5 fLzNEjU1pDOcc4ye5pj/alIXgP63yNjQs9AozAjA11e4X5iBx6y4e5CotSBCDQ0PxCTsn0S0VjU Af4AOAALsCoRASywtAyJ9ltXBKzZwdB3HYw1OQdaZTc9+8QbyqFGUOmDyDsu52qH//zggrGMy+x 7xUwctp/T7dkmbONbAF0JLbrkCTN62hWgwHrft736cJyYPGeLDTaB28yKm4i/hffeTX6kWv2xbS 7H/VGNVTM30IyEcAllv1lha5JlELlohwsuFGvvWwbPTs75DHXANT4xJVb6ATFSPgscI61/OB9+9 2ExYZ2GLeiKAbOE9WoFjQ4iDVx1DkOZYLo3yhP+4scmsc/A== X-Received: by 2002:a05:600c:1d07:b0:4a2:18d4:f9e0 with SMTP id 5b1f17b1804b1-4ac18c735b3mr192334605e9.25.1793565247854; Sun, 01 Nov 2026 12:34:07 -0800 (PST) Received: from romain-ThinkPad-P14s-Gen-5-AMD.tail433d9c.ts.net ([2001:861:39c2:e340:849f:a468:4121:a85]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ab61d8b9f4sm263946675e9.12.2026.11.01.12.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Nov 2026 12:34:07 -0800 (PST) From: Romain TISSERAND To: Chen-Yu Tsai , Maxime Ripard , Jernej Skrabec , Samuel Holland Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sashiko-reviews@lists.linux.dev Subject: [PATCH] drm/sun4i: dsi: set the connector orientation from the panel node Date: Sun, 1 Nov 2026 21:34:06 +0100 Message-ID: <20261101203406.1360656-1-romain.tisserand@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.69 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; R_MISSING_CHARSET(0.50)[]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:helo,sea.lore.kernel.org:rdns]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; RCPT_COUNT_TWELVE(0.00)[13]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[linux.intel.com,suse.de,gmail.com,ffwll.ch,lists.freedesktop.org,lists.linux.dev,lists.infradead.org,vger.kernel.org]; TAGGED_RCPT(0.00)[]; FROM_NEQ_ENVFROM(0.00)[romaintisserand@gmail.com,linux-sunxi@lists.linux.dev]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2001:861:39c2:e340:849f:a468:4121:a85:received,209.85.128.54:received,100.77.114.92:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.234.253.10:from]; TAGGED_FROM(0.00)[bounces-27036-noreply=patchwork.local]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; FREEMAIL_TO(0.00)[kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: AAD601C3117 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX sun6i_dsi_attach() only accepts the panel once the DRM device is registered, and returns -EPROBE_DEFER until then. By that time the connector can no longer get a "panel orientation" property: it has to be attached before registration. The fbdev emulation is also set up from the hotplug event of the attach, so it gets no rotation hint either. As a result the rotation property of a DSI panel on these SoCs is ignored: on the PocketGo S30 (A33, 320x480 panel mounted for landscape use, rotation = <270>) the console and the boot splash stay in portrait. The panel is a child node of the DSI host, so read its orientation from the device tree when binding, before the device is registered, and set it on the connector then. Signed-off-by: Romain TISSERAND --- Notes: - Testing: built with W=1 for arm (multi_v7_defconfig, DRM_SUN6I_DSI=y and =m) and arm64 (defconfig, =m), no warnings. Tested on a PocketGo S30 (A33, ILI9488 DSI panel, rotation = <270>): on 6.18.54 with the same change (6.18 still calls the helper of_drm_get_panel_orientation()) the console and plymouth come up in landscape, where they were in portrait; on 7.3.1 with this patch the DSI connector reports "panel orientation" = "Left Side Up". Not tested on other boards; boards without a rotation property keep the current behaviour (no property is attached). - Tool disclosure: this patch was prepared with Claude Opus 5.5 (Anthropic) as a coding assistant, in an interactive session where I asked it to fix the console orientation on the PocketGo S30. It traced why the connector never got the orientation, wrote the change and the message. I reviewed and understand it, and tested it as described. drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) base-commit: a1e63ab695ad76850ab9787b9eb6aab695dc2965 diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index d504ae5832..1eb8a4cde0 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1055,6 +1056,31 @@ static const struct regmap_config sun6i_dsi_regmap_config = { .name = "mipi-dsi", }; +/* + * The panel only attaches once the DRM device is registered, too late to + * give the connector its orientation (the property cannot be added after + * registration), so fbcon and the boot splash would not rotate. Read the + * orientation from the panel node, a child of the DSI node, at bind time. + */ +static void sun6i_dsi_set_panel_orientation(struct sun6i_dsi *dsi) +{ + enum drm_panel_orientation orientation; + struct device_node *np; + + for_each_available_child_of_node(dsi->dev->of_node, np) { + if (of_node_name_eq(np, "port") || of_node_name_eq(np, "ports")) + continue; + + if (!drm_of_get_panel_orientation(np, &orientation) && + orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) { + drm_connector_set_panel_orientation(&dsi->connector, + orientation); + of_node_put(np); + return; + } + } +} + static int sun6i_dsi_bind(struct device *dev, struct device *master, void *data) { @@ -1085,6 +1111,8 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); + sun6i_dsi_set_panel_orientation(dsi); + dsi->drm = drm; return 0;