From patchwork Mon Nov 16 10:30:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 4134 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 0084F1C58EE for ; Mon, 16 Nov 2026 11:33:48 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=kernel.org; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27731-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-27731-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 440233A945 for ; Mon, 16 Nov 2026 10:32:55 +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=1794825173; b=D6bJvVcfioCEPewzXsbYeeB/Lg86T44ncszDpdvMtgs+CsEfzdR3s5tNNFC2sp6I6QFZ 23u+L767bCdEyuS1N/cHbHGFkiTckptGGCtQzv6xjW2bZLWOhxwpbBB1e/kBFlNIIUHhG ro759muoLG48W6r78RTpzt2UkrrNlUXGhKKutqHHM3751Vc6DZMgdzrrcdS1okJdOLs07 4R9jCa4OBc8RAwaq8K18dsPQttuETxD6BqTLFpjWMM8Siu6zHc8nucj7Md8vxJfYe9c4D acveehz8ubk/1UnC5lJHQtIRutI2X/1k2/q0WwFFOaKmx0Hr8gb5lp2Gq63H6YhDglQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794825173; h=X-Original-To:Received:Received:DKIM-Signature:From:Date:Subject: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer:X-Developer-Signature:X-Developer-Key; bh=y7a0q8HOy+VPr1+g1ItZvGgTc1pYGBVyQJvrrdqK62c=; b=sLhpjfmm+a5u8LQmh+W2MpM3BYiWjH/S4caKopMBImL7lYgclOvgAxaLvqLvrQLWaRcf b/YnekJlpnthkzJg0SpL0UiyBjMkoP7x5Fty/PaDugHLxb02m6tUHF9Y9MxXHwa6mrMgB Fep2CVdNQ2VOvr//xagQlmChvEBsyA0xxbU88+CCJAIaNB/Td1+3WdncPUT6pDKPqjWFZ SnEGSM+5/emcmZVsqUlC5ycQzlToiCI50DlM4M5WLIsG4XGJASRKjjouxa3P+z/33xTkS JfYS2+LOMdI9xPvD/1A1CzF5s6Y8trGfrVvSPlqn8f/yXfCbROb5Zo54oolenLVzvuQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AwjuTy90; 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 69ECE606A880; Mon, 16 Nov 2026 10:32:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AwjuTy90 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794825173; b=t2sSMRmFO9RBdqS/POC5ADxbQsuCER3SHwy3uE5e4QgXFlnzjpG18B6VY9eAfWFNJJbx LJ1TEE8zrYA7pwJnbU+VP9Yh+gycTV6YVNwmxPK67dAt0norjHSSPcl/Q168PiLBfxhGi v7uxkhR5DDVqHduqoBhsQwCrOJpsmUcRlxA9lWgE89mk/fqdwOVPO74l2+3OG8hHn632o ZkvCSpYe2dTIBHL//PKqxhHn4ZmRywhEBj+/RKLzy3VXvGS/uykPGvMs57Z/a+CaNWiBf /cHhtzQjtg09APJ/Dc0wQU7psYMFWSYFBYro/axp4zSJzYSSbixnfo+rbLy/3hCGeFg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794825173; h=Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer:X-Developer-Signature:X-Developer-Key; bh=y7a0q8HOy+VPr1+g1ItZvGgTc1pYGBVyQJvrrdqK62c=; b=5hG0AJeQ/Gp0gbEX5DRtrMU/I0DgmjhyQNGCPrFVJ0A3l24e7mR9rEUJPzjLoXkTifJo YtGPFzfZdXLwOtkukd497A3cs8Wokpo93nSsfyLcZSqLA7fs6I3X2y7C3OsAvMcRl2108 45ENhWH9PGSAk7fGy89MH2NDtQPr68g7RSW83XpqIdoj9FsAHeUDxnAZxQM9ykcwfV2TP n7hFKCi1wZ0q0Cdb84YaZ4Iz2Ak2ua6pmRs8D26VVbKmzCTz4pLEaKk0kfHAiVCuuN+sJ MjUfF9zfLlMbaly8jzHJzg2/66pvclkP//OfuEwad4TLS0QluGCGlVQ+NjtUSM+ddDw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AwjuTy90; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48A38606A338 for ; Mon, 16 Nov 2026 10:32:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 501701F000CB; Mon, 16 Nov 2026 10:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794825172; bh=y7a0q8HOy+VPr1+g1ItZvGgTc1pYGBVyQJvrrdqK62c=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=AwjuTy90Aa6n7TE18ENYiuyDNqxsZy0nTAd4fKEN8pFHemP781GXVXsbttXNX+31r +Y3wwg2RYgQ45WIO5NDQy90d0/46ecRCaCrJY0x3a/WHxdieJY2w12d83rCsTL8clW jdYyO6G9CHcZgaNJCt3dX2eqImTxyoecGMzkymX8aqUqRGTGW2zZr4AGK3sk/TQFxF UOszkpocaM6NqhVo3UIv/iX+BZDH6vqhBVSZxQglnYl8ueKhIDegPFYnl78VpR+FIN L+iFvrQ5oUFg4vcqMinchIlPjk5q6YPh2LhDgXU1svvFVP1X1y/gEsdrxZNAn0S1Ta RfFhNoTNlVPGw== From: Maxime Ripard Date: Mon, 16 Nov 2026 11:30:52 +0100 Subject: [PATCH v2 36/64] drm/sun4i: Switch to drm_mode_config_create_initial_state 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 Message-Id: <20261116-drm-no-more-config-reset-v2-36-0bb471f4d1e0@kernel.org> References: <20261116-drm-no-more-config-reset-v2-0-0bb471f4d1e0@kernel.org> In-Reply-To: <20261116-drm-no-more-config-reset-v2-0-0bb471f4d1e0@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, Maxime Ripard , Chen-Yu Tsai , Samuel Holland , linux-sunxi@lists.linux.dev X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2973; i=mripard@kernel.org; h=from:subject:message-id; bh=xBKcJJXsKHEM1DlBgopNkNdLp7kgFpZeKdje7oKzFOs=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDFm/bvv/7rp9tjR7x7QX1koPzPwyKjYZrQ1hOTTfyP+Qp ioHz7r+jqksDMKcDLJiiixPZMJOL29fXOVgv/IHzBxWJpAhDFycAjARtRTGOgO7Lar/eeuviTZO 12WY17k20GVTzsqCdac7lUscdxc4JxzYLSWeevd+wsJtk5VPbn+szthwvyi1otj7LduZ7fxeRw+ 9tmT6v+Rkhla11lq39+pTFp3YfzbjqUp81l+Fpad6ZB4ZLRYGAA== X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [1.82 / 15.00]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; R_DKIM_ALLOW(0.00)[kernel.org:s=k20260515]; FROM_NEQ_ENVFROM(0.00)[mripard@kernel.org,linux-sunxi@lists.linux.dev]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_VIA_SMTP_AUTH(0.00)[]; TAGGED_FROM(0.00)[bounces-27731-noreply=patchwork.local]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[linux.dev:email,sea.lore.kernel.org:helo,sea.lore.kernel.org:rdns]; FORGED_SENDER_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_SPF_DNSFAIL(0.00)[~any]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.103.45.18:received,100.77.114.92:received]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; DKIM_TRACE(0.00)[kernel.org:+]; FREEMAIL_TO(0.00)[linux.intel.com,suse.de,gmail.com,ffwll.ch]; RCPT_COUNT_SEVEN(0.00)[9]; MIME_TRACE(0.00)[0:+]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.234.253.10:from] X-Rspamd-Queue-Id: 0084F1C58EE X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX drm_mode_config_reset() has a dual role: it creates the initial KMS state at probe time, and resets hardware and software state during suspend/resume cycles. Since the two roles need different behaviors (notably for objects like drm_private_obj that must persist across suspend/resume), drm_mode_config_create_initial_state() was introduced to handle only the initial state creation at probe time. Switch to drm_mode_config_create_initial_state(). Acked-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- Cc: Chen-Yu Tsai Cc: Samuel Holland Cc: linux-sunxi@lists.linux.dev --- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 +++- drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 6 +++--- drivers/gpu/drm/sun4i/sun4i_framebuffer.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index f8bbca6eb49c..248be5ff4f36 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -102,11 +102,13 @@ static int sun4i_drv_bind(struct device *dev) /* Remove early framebuffers (ie. simplefb) */ ret = aperture_remove_all_conflicting_devices(sun4i_drv_driver.name); if (ret) goto unbind_all; - sun4i_framebuffer_init(drm); + ret = sun4i_framebuffer_init(drm); + if (ret) + goto unbind_all; /* Enable connectors polling */ drm_kms_helper_poll_init(drm); ret = drm_dev_register(drm, 0); diff --git a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c index fc822bc2c62b..d7e5cdf76c16 100644 --- a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c +++ b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c @@ -22,16 +22,16 @@ static const struct drm_mode_config_funcs sun4i_de_mode_config_funcs = { static const struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers = { .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, }; -void sun4i_framebuffer_init(struct drm_device *drm) +int sun4i_framebuffer_init(struct drm_device *drm) { - drm_mode_config_reset(drm); - drm->mode_config.max_width = 8192; drm->mode_config.max_height = 8192; drm->mode_config.normalize_zpos = true; drm->mode_config.funcs = &sun4i_de_mode_config_funcs; drm->mode_config.helper_private = &sun4i_de_mode_config_helpers; + + return drm_mode_config_create_initial_state(drm); } diff --git a/drivers/gpu/drm/sun4i/sun4i_framebuffer.h b/drivers/gpu/drm/sun4i/sun4i_framebuffer.h index 06901fb3a186..378f0de343d7 100644 --- a/drivers/gpu/drm/sun4i/sun4i_framebuffer.h +++ b/drivers/gpu/drm/sun4i/sun4i_framebuffer.h @@ -7,8 +7,8 @@ */ #ifndef _SUN4I_FRAMEBUFFER_H_ #define _SUN4I_FRAMEBUFFER_H_ -void sun4i_framebuffer_init(struct drm_device *drm); +int sun4i_framebuffer_init(struct drm_device *drm); #endif /* _SUN4I_FRAMEBUFFER_H_ */