From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02E4ECD8C9F for ; Mon, 8 Jun 2026 12:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sC1oRsVv5oyixEcPV4XYf/GGRIm/yfwYr18ih12crko=; b=Gls4xQGUhXKAkP Hd2oq7yKPbka54z+tIvlg2FKFRNmWbORr/byvl6JpJ7ne2DC0nq6YIvGExIPFOlUgDEKk0Kdijbk2 +sVIkchFO438BJ4MAotyd5Ev1m4e5ew+vfRJtjyoNmPOaxlKwo/FyRTF+I0ListDoxJGolIEd0Alv HErQZQgiWL+irGZd2x4cagWqPmvGXTPNxupwp7lS2uMzzmhbIwPrzUgI8TYtqq/9PV5FAde65LxT0 jG+apnDE3XbwVGqe113gHChzoDIiLFPK3Ze9ueIcUgmVNw8rrcie8b6q2r48+zWcpzAz5qt4OuiQc mY+BnDlnbV7Xl9Rh66Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wWZIl-00000003Wuq-1aGZ; Mon, 08 Jun 2026 12:41:59 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wWZIi-00000003Wu5-1Lm4 for linux-rockchip@lists.infradead.org; Mon, 08 Jun 2026 12:41:57 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4903d730b1fso48584135e9.2 for ; Mon, 08 Jun 2026 05:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780922514; x=1781527314; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0Gdc6e3FdyeiLVZE3O+te4B1yIyOlEE2X2Wof8kU0zk=; b=SUmXl6Nu4/Yr2A9q6uEdJXDuteasdkJob+w2xdCkPWr8OsXUv6Cx85ojG7q7ppU7hp w8MFjJ/7dwjN0mAkxjhG+P9E2BzwMEUDdy41VIKYrEvlX7AxhgtuHkj8Q1NaPmZ1oUyJ wgbxu4tkg5h4Y1uPeW2m6f6GZWFunQ2i1kcrlgCZnJ7RE/ztNYEatXfMIsE4WG7hYs83 UvRYBlX16G1z76xK2pH0lnHZh5CW1GtZ/D+AwehXb89NslbUDICQgMRm/ab8VVK7Gjl0 wMecSE+HLkOS0zkclrQ5ljwUZDyYUyJu+woSqPOpvrzOf7KjKKjR1EA6pnpiglP2YqxH 3Lbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780922514; x=1781527314; 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; bh=0Gdc6e3FdyeiLVZE3O+te4B1yIyOlEE2X2Wof8kU0zk=; b=hFfnzJ9VMFEJuwATTB7ImbGTRL9gPXuJAuXZsQJQQffuIPWk34wW1l8V5Tm8ks9iz+ YEFkZtuRbffGkaimtPNzmXlaH/t8QPW6ihIv6ZEKYIthSRhKslh/MrtAtmv2en0u+S8y FXNg3plau+yJNX/Mh7ohhS/48qtaHbDDICqXikKpEffaLkCXnU7Sw+fpqkSbRTE6jsAy UhWPqbJ9CBLLT5fJNSn9aeJ/W7xK6X3C+Ij4OkxI4lGiFW18TYIotDgeRTerck3qM/II ZB11XpIWzn1Zl1ssYDY7tr0t02nnZRc6Pqf00Pb1pZPMyrLbwS4i4GmLQKrI+P9w8gq0 b97Q== X-Forwarded-Encrypted: i=1; AFNElJ+DXstpo4mres8i4JBaRrmC2oaHwrsmtO0h0qFtXp+KkFvVP2yJupkzjkKvds6poSBA69QvBVuKz/Pn8EFLtQ==@lists.infradead.org X-Gm-Message-State: AOJu0Yyyerk4T7tBcabGO3BdmSLbPaGCWeC6yLBJYRoWyBqREDtLWdXG WE3cS9EpFutcbS7pH7+AROGmpAORPQcS83LLqFfCyyjDKlv09Tvlk7Vk X-Gm-Gg: Acq92OHNeT2HaRnBRk1quIcMGKbyBTZXhmo+nFuJdSXLc4Vj7NUWkUcTSpF/T5F2MNI vsvLRLyBgxqUT+DYAyUH6GOs/18MVzatn2GH6fxK8LI+tgP+7npcltemSMs3u8kADhKvbX8jCIE FXtfHKOEengHUllGOo7DiTF0g+nWo6VbamKC0VVR8XuiddB7dVkeB6xZ9XVnGxyYt9VqbRPlIu5 8WLHiP42UOEKUsGb9aUy9xGHnVxsYWRJtdXSGHAUaG0lIw5c4b75i0pJoFPen4rjPmhbhc7JTVB 0vfh+2zQTzQEVKouOxSdNiK0hMPu/JU2Sd+iUyt+QEeSZRhkmgsZfnNSjkCwpjNtoOovCjMwYvO pGQ9fmakOliWBCgwp+sIGfa1v+sW784UIO5U1r4bs6Shfj8XXBCX9LoTdOT8rtgV3iIbBUA1QFj nnivAKi43rx3intoAMYznJvXBUV74pZiMFkcbku4PnKoHPG1S32WSM7/ud6YHOQPy89FJOm4hnh iNJDfiHwDVYncNORd7TtwONc5WBPqYY8tBDd04FhMK1xOoPVmtpfYO4Yk3EP1BB X-Received: by 2002:a05:600c:4e13:b0:490:bd1d:4732 with SMTP id 5b1f17b1804b1-490c25eea3bmr291647535e9.23.1780922513967; Mon, 08 Jun 2026 05:41:53 -0700 (PDT) Received: from tiolaptop.telekom.ip (2a02-8388-013f-3800-2646-3d3e-bfee-9cee.cable.dynamic.v6.surfer.at. [2a02:8388:13f:3800:2646:3d3e:bfee:9cee]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490bc40716bsm414322615e9.12.2026.06.08.05.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 05:41:53 -0700 (PDT) From: Diogo Silva To: Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Andy Yan Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Diogo Silva Subject: [PATCH v3] drm/rockchip: Remove dependency on DRM simple helpers Date: Mon, 8 Jun 2026 14:40:19 +0200 Message-ID: <20260608124018.480365-2-diogompaissilva@gmail.com> X-Mailer: git-send-email 2.51.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260608_054156_421956_0E093FB3 X-CRM114-Status: GOOD ( 14.79 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Simple KMS helper are deprecated since they only add an intermediate layer between drivers and the atomic modesetting. This patch removes the dependency on drm simple helpers from rockchip DRM drivers. Signed-off-by: Diogo Silva --- v3: - rebase on drm-tip tree drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 9 ++++++--- drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 ++++++--- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 9 +++++++-- drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c | 8 ++++++-- drivers/gpu/drm/rockchip/dw_dp-rockchip.c | 1 - drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 1 - drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 1 - drivers/gpu/drm/rockchip/rk3066_hdmi.c | 8 ++++++-- drivers/gpu/drm/rockchip/rockchip_lvds.c | 9 +++++++-- drivers/gpu/drm/rockchip/rockchip_rgb.c | 8 ++++++-- 10 files changed, 44 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index 776954c7d052..46c245e35d21 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -30,7 +30,6 @@ #include #include #include -#include #include "rockchip_drm_drv.h" @@ -303,6 +302,10 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder, return 0; } +static const struct drm_encoder_funcs rockchip_dp_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static const struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = { .mode_fixup = rockchip_dp_drm_encoder_mode_fixup, .mode_set = rockchip_dp_drm_encoder_mode_set, @@ -361,8 +364,8 @@ static int rockchip_dp_drm_create_encoder(struct rockchip_dp_device *dp) dev->of_node); DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs); - ret = drm_simple_encoder_init(drm_dev, encoder, - DRM_MODE_ENCODER_TMDS); + ret = drm_encoder_init(drm_dev, encoder, &rockchip_dp_encoder_funcs, + DRM_MODE_ENCODER_TMDS, NULL); if (ret) { DRM_ERROR("failed to initialize encoder with drm\n"); return ret; diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index 190cce9530c8..c3f41a4449f5 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "cdn-dp-core.h" #include "cdn-dp-reg.h" @@ -671,6 +670,10 @@ static int cdn_dp_encoder_atomic_check(struct drm_encoder *encoder, return 0; } +static const struct drm_encoder_funcs cdn_dp_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static const struct drm_encoder_helper_funcs cdn_dp_encoder_helper_funcs = { .atomic_check = cdn_dp_encoder_atomic_check, }; @@ -988,8 +991,8 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) dev->of_node); DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs); - ret = drm_simple_encoder_init(drm_dev, encoder, - DRM_MODE_ENCODER_TMDS); + ret = drm_encoder_init(drm_dev, encoder, &cdn_dp_encoder_funcs, + DRM_MODE_ENCODER_TMDS, NULL); if (ret) { DRM_ERROR("failed to initialize encoder with drm\n"); return ret; diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c index 3547d91b25d3..a09b382d208e 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "rockchip_drm_drv.h" @@ -825,6 +824,10 @@ static void dw_mipi_dsi_encoder_enable(struct drm_encoder *encoder) clk_disable_unprepare(dsi->grf_clk); } +static const struct drm_encoder_funcs dw_mipi_dsi_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static const struct drm_encoder_helper_funcs dw_mipi_dsi_encoder_helper_funcs = { .atomic_check = dw_mipi_dsi_encoder_atomic_check, @@ -840,7 +843,9 @@ static int rockchip_dsi_drm_create_encoder(struct dw_mipi_dsi_rockchip *dsi, encoder->possible_crtcs = drm_of_find_possible_crtcs(drm_dev, dsi->dev->of_node); - ret = drm_simple_encoder_init(drm_dev, encoder, DRM_MODE_ENCODER_DSI); + ret = drm_encoder_init(drm_dev, encoder, + &dw_mipi_dsi_encoder_funcs, + DRM_MODE_ENCODER_DSI, NULL); if (ret) { DRM_ERROR("Failed to initialize encoder with drm\n"); return ret; diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c index d2e76d36d724..9dc207c2d20d 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c @@ -23,7 +23,6 @@ #include #include #include -#include #include @@ -275,6 +274,10 @@ dw_mipi_dsi2_encoder_atomic_check(struct drm_encoder *encoder, return 0; } +static const struct drm_encoder_funcs dw_mipi_dsi2_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static const struct drm_encoder_helper_funcs dw_mipi_dsi2_encoder_helper_funcs = { .atomic_enable = dw_mipi_dsi2_encoder_atomic_enable, @@ -290,7 +293,8 @@ static int rockchip_dsi2_drm_create_encoder(struct dw_mipi_dsi2_rockchip *dsi2, encoder->possible_crtcs = drm_of_find_possible_crtcs(drm_dev, dsi2->dev->of_node); - ret = drm_simple_encoder_init(drm_dev, encoder, DRM_MODE_ENCODER_DSI); + ret = drm_encoder_init(drm_dev, encoder, &dw_mipi_dsi2_encoder_funcs, + DRM_MODE_ENCODER_DSI, NULL); if (ret) { dev_err(dsi2->dev, "Failed to initialize encoder with drm\n"); return ret; diff --git a/drivers/gpu/drm/rockchip/dw_dp-rockchip.c b/drivers/gpu/drm/rockchip/dw_dp-rockchip.c index 0de822360c8d..b23efb153c9e 100644 --- a/drivers/gpu/drm/rockchip/dw_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_dp-rockchip.c @@ -20,7 +20,6 @@ #include #include #include -#include #include "rockchip_drm_drv.h" diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index cffc0af5190f..b6e154c35e7c 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -18,7 +18,6 @@ #include #include #include -#include #include "rockchip_drm_drv.h" diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index f35484715c2d..af34062685cd 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "rockchip_drm_drv.h" diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index 1996f8656612..b4ba9f894360 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -454,6 +453,10 @@ rk3066_hdmi_encoder_atomic_check(struct drm_encoder *encoder, return 0; } +static const struct drm_encoder_funcs rk3066_hdmi_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static const struct drm_encoder_helper_funcs rk3066_hdmi_encoder_helper_funcs = { .atomic_check = rk3066_hdmi_encoder_atomic_check, @@ -696,7 +699,8 @@ rk3066_hdmi_register(struct drm_device *drm, struct rk3066_hdmi *hdmi) return -EPROBE_DEFER; drm_encoder_helper_add(encoder, &rk3066_hdmi_encoder_helper_funcs); - drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS); + drm_encoder_init(drm, encoder, &rk3066_hdmi_encoder_funcs, + DRM_MODE_ENCODER_TMDS, NULL); hdmi->bridge.driver_private = hdmi; hdmi->bridge.funcs = &rk3066_hdmi_bridge_funcs; diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c index 7a0c4fa29f2f..f3be2c91d147 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "rockchip_drm_drv.h" #include "rockchip_lvds.h" @@ -427,6 +426,10 @@ static void px30_lvds_encoder_disable(struct drm_encoder *encoder) drm_panel_unprepare(lvds->panel); } +static const struct drm_encoder_funcs rockchip_lvds_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static const struct drm_encoder_helper_funcs rk3288_lvds_encoder_helper_funcs = { .enable = rk3288_lvds_encoder_enable, @@ -594,7 +597,9 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master, encoder->possible_crtcs = drm_of_find_possible_crtcs(drm_dev, dev->of_node); - ret = drm_simple_encoder_init(drm_dev, encoder, DRM_MODE_ENCODER_LVDS); + ret = drm_encoder_init(drm_dev, encoder, + &rockchip_lvds_encoder_funcs, + DRM_MODE_ENCODER_LVDS, NULL); if (ret < 0) { drm_err(drm_dev, "failed to initialize encoder: %d\n", ret); diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c b/drivers/gpu/drm/rockchip/rockchip_rgb.c index add3123e5ce7..2ad24b914989 100644 --- a/drivers/gpu/drm/rockchip/rockchip_rgb.c +++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "rockchip_drm_drv.h" #include "rockchip_rgb.h" @@ -65,6 +64,10 @@ rockchip_rgb_encoder_atomic_check(struct drm_encoder *encoder, return 0; } +static const struct drm_encoder_funcs rockchip_rgb_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static const struct drm_encoder_helper_funcs rockchip_rgb_encoder_helper_funcs = { .atomic_check = rockchip_rgb_encoder_atomic_check, @@ -127,7 +130,8 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, encoder = &rgb->encoder.encoder; encoder->possible_crtcs = drm_crtc_mask(crtc); - ret = drm_simple_encoder_init(drm_dev, encoder, DRM_MODE_ENCODER_NONE); + ret = drm_encoder_init(drm_dev, encoder, &rockchip_rgb_encoder_funcs, + DRM_MODE_ENCODER_NONE, NULL); if (ret < 0) { DRM_DEV_ERROR(drm_dev->dev, "failed to initialize encoder: %d\n", ret); -- 2.51.2 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip