From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Harry Wentland" <harry.wentland@amd.com>,
"Leo Li" <sunpeng.li@amd.com>,
"Rodrigo Siqueira" <siqueira@igalia.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Laurent Pinchart" <laurent.pinchart+renesas@ideasonboard.com>,
"Tomi Valkeinen" <tomi.valkeinen+renesas@ideasonboard.com>,
"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Magnus Damm" <magnus.damm@gmail.com>,
"Dave Stevenson" <dave.stevenson@raspberrypi.com>,
"Maíra Canal" <mcanal@igalia.com>,
"Raspberry Pi Kernel Maintenance" <kernel-list@raspberrypi.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
amd-gfx@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org,
Suraj Kandpal <suraj.kandpal@intel.com>,
Louis Chauvet <louis.chauvet@bootlin.com>
Subject: [PATCH v6 5/9] drm/mali: use drmm_writeback_connector_init()
Date: Fri, 12 Jun 2026 21:30:15 +0300 [thread overview]
Message-ID: <20260612-wb-drop-encoder-v6-5-9f3a54f81310@oss.qualcomm.com> (raw)
In-Reply-To: <20260612-wb-drop-encoder-v6-0-9f3a54f81310@oss.qualcomm.com>
The driver uses drm_writeback_connector_init() instead of its drmm
counterpart, but it doesn't perform the job queue cleanup (neither
manually nor by calling drm_writeback_connector_cleanup()). On the
contrary, the drmm_writeback_connector_init() function ensures the
proper cleanup of the job queue.
Use drmm_plain_encoder_alloc() to allocate simple encoder and
drmm_writeback_connector_init() in order to initialize writeback
connector instance.
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/arm/malidp_mw.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c
index f8be65119e3b..cfb7300e3e95 100644
--- a/drivers/gpu/drm/arm/malidp_mw.c
+++ b/drivers/gpu/drm/arm/malidp_mw.c
@@ -84,11 +84,6 @@ malidp_mw_connector_detect(struct drm_connector *connector, bool force)
return connector_status_connected;
}
-static void malidp_mw_connector_destroy(struct drm_connector *connector)
-{
- drm_connector_cleanup(connector);
-}
-
static struct drm_connector_state *
malidp_mw_connector_duplicate_state(struct drm_connector *connector)
{
@@ -114,7 +109,6 @@ static const struct drm_connector_funcs malidp_mw_connector_funcs = {
.reset = malidp_mw_connector_reset,
.detect = malidp_mw_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
- .destroy = malidp_mw_connector_destroy,
.atomic_duplicate_state = malidp_mw_connector_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
};
@@ -211,6 +205,7 @@ static u32 *get_writeback_formats(struct malidp_drm *malidp, int *n_formats)
int malidp_mw_connector_init(struct drm_device *drm)
{
struct malidp_drm *malidp = drm_to_malidp(drm);
+ struct drm_encoder *encoder;
u32 *formats;
int ret, n_formats;
@@ -224,11 +219,19 @@ int malidp_mw_connector_init(struct drm_device *drm)
if (!formats)
return -ENOMEM;
- ret = drm_writeback_connector_init(drm, &malidp->mw_connector,
- &malidp_mw_connector_funcs,
- &malidp_mw_encoder_helper_funcs,
- formats, n_formats,
- 1 << drm_crtc_index(&malidp->crtc));
+ encoder = drmm_plain_encoder_alloc(drm, NULL, DRM_MODE_ENCODER_VIRTUAL,
+ NULL);
+ if (IS_ERR(encoder))
+ return PTR_ERR(encoder);
+
+ drm_encoder_helper_add(encoder, &malidp_mw_encoder_helper_funcs);
+
+ encoder->possible_crtcs = drm_crtc_mask(&malidp->crtc);
+
+ ret = drmm_writeback_connector_init(drm, &malidp->mw_connector,
+ &malidp_mw_connector_funcs,
+ encoder,
+ formats, n_formats);
kfree(formats);
if (ret)
return ret;
--
2.47.3
next prev parent reply other threads:[~2026-06-12 18:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 18:30 [PATCH v6 0/9] drm: writeback: clean up writeback connector initialization Dmitry Baryshkov
2026-06-12 18:30 ` [PATCH v6 1/9] drm/managed: implement managed versions of kzalloc_obj/objs() Dmitry Baryshkov
2026-07-13 21:06 ` John Harrison
2026-06-12 18:30 ` [PATCH v6 2/9] drm/amd/display: use drmm allocation for writeback connector Dmitry Baryshkov
2026-07-06 16:41 ` Rodrigo Siqueira
2026-06-12 18:30 ` [PATCH v6 3/9] drm/amd/display: use drmm_writeback_connector_init() Dmitry Baryshkov
2026-06-12 18:30 ` [PATCH v6 4/9] drm/komeda: " Dmitry Baryshkov
2026-06-12 18:30 ` Dmitry Baryshkov [this message]
2026-06-12 18:30 ` [PATCH v6 6/9] drm: renesas: rcar-du: " Dmitry Baryshkov
2026-06-12 18:30 ` [PATCH v6 7/9] drm/vc4: " Dmitry Baryshkov
2026-06-12 18:30 ` [PATCH v6 8/9] drm: writeback: drop excess connector initialization functions Dmitry Baryshkov
2026-06-12 18:30 ` [PATCH v6 9/9] drm: writeback: rename drm_writeback_connector_init_with_encoder() Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260612-wb-drop-encoder-v6-5-9f3a54f81310@oss.qualcomm.com \
--to=dmitry.baryshkov@oss.qualcomm.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert+renesas@glider.be \
--cc=harry.wentland@amd.com \
--cc=kernel-list@raspberrypi.com \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=louis.chauvet@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=magnus.damm@gmail.com \
--cc=mcanal@igalia.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=siqueira@igalia.com \
--cc=sunpeng.li@amd.com \
--cc=suraj.kandpal@intel.com \
--cc=tomi.valkeinen+renesas@ideasonboard.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®