From: Liviu Dudau <liviu.dudau@arm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: "Jani Nikula" <jani.nikula@linux.intel.com>,
"Kandpal, Suraj" <suraj.kandpal@intel.com>,
"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>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Rob Clark" <robin.clark@oss.qualcomm.com>,
"Dmitry Baryshkov" <lumag@kernel.org>,
"Abhinav Kumar" <abhinav.kumar@linux.dev>,
"Sean Paul" <sean@poorly.run>,
"Marijn Suijten" <marijn.suijten@somainline.org>,
"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>,
"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
"Jessica Zhang" <jesszhan0024@gmail.com>,
"Louis Chauvet" <louis.chauvet@bootlin.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
freedreno@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v5 3/8] drm/komeda: use drmm_writeback_connector_init()
Date: Tue, 2 Jun 2026 11:32:32 +0100 [thread overview]
Message-ID: <ah6xQEWemicF_ECc@e142607> (raw)
In-Reply-To: <20260505-wb-drop-encoder-v5-3-42567b7c7af2@oss.qualcomm.com>
On Tue, May 05, 2026 at 03:25:00AM +0300, Dmitry Baryshkov wrote:
> 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>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> .../drm/arm/display/komeda/komeda_wb_connector.c | 30 ++++++++++++----------
> 1 file changed, 17 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
> index 41cc3e080dc9..bcc53d4015f1 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
> @@ -5,6 +5,7 @@
> *
> */
> #include <drm/drm_framebuffer.h>
> +#include <drm/drm_managed.h>
> #include "komeda_dev.h"
> #include "komeda_kms.h"
>
> @@ -121,17 +122,10 @@ komeda_wb_connector_fill_modes(struct drm_connector *connector,
> return 0;
> }
>
> -static void komeda_wb_connector_destroy(struct drm_connector *connector)
> -{
> - drm_connector_cleanup(connector);
> - kfree(to_kconn(to_wb_conn(connector)));
> -}
> -
> static const struct drm_connector_funcs komeda_wb_connector_funcs = {
> .reset = drm_atomic_helper_connector_reset,
> .detect = komeda_wb_connector_detect,
> .fill_modes = komeda_wb_connector_fill_modes,
> - .destroy = komeda_wb_connector_destroy,
> .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
> .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> };
> @@ -143,13 +137,15 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
> struct komeda_wb_connector *kwb_conn;
> struct drm_writeback_connector *wb_conn;
> struct drm_display_info *info;
> + struct drm_encoder *encoder;
> +
> u32 *formats, n_formats = 0;
> int err;
>
> if (!kcrtc->master->wb_layer)
> return 0;
>
> - kwb_conn = kzalloc_obj(*kwb_conn);
> + kwb_conn = drmm_kzalloc(&kms->base, sizeof(*kwb_conn), GFP_KERNEL);
> if (!kwb_conn)
> return -ENOMEM;
>
> @@ -165,11 +161,19 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
> return -ENOMEM;
> }
>
> - err = drm_writeback_connector_init(&kms->base, wb_conn,
> - &komeda_wb_connector_funcs,
> - &komeda_wb_encoder_helper_funcs,
> - formats, n_formats,
> - BIT(drm_crtc_index(&kcrtc->base)));
> + encoder = drmm_plain_encoder_alloc(&kms->base, NULL,
> + DRM_MODE_ENCODER_VIRTUAL, NULL);
> + if (IS_ERR(encoder))
> + return PTR_ERR(encoder);
> +
> + drm_encoder_helper_add(encoder, &komeda_wb_encoder_helper_funcs);
> +
> + encoder->possible_crtcs = drm_crtc_mask(&kcrtc->base);
> +
> + err = drmm_writeback_connector_init(&kms->base, wb_conn,
> + &komeda_wb_connector_funcs,
> + encoder,
> + formats, n_formats);
> komeda_put_fourcc_list(formats);
> if (err) {
> kfree(kwb_conn);
>
> --
> 2.47.3
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
next prev parent reply other threads:[~2026-06-02 10:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 0:24 [PATCH v5 0/8] drm: writeback: clean up writeback connector initialization Dmitry Baryshkov
2026-05-05 0:24 ` [PATCH v5 1/8] drm/msm/dpu: don't mix devm and drmm functions Dmitry Baryshkov
2026-05-05 18:35 ` John Harrison
2026-05-05 21:49 ` Rob Clark
2026-05-07 16:28 ` John Harrison
2026-05-07 16:30 ` Rob Clark
2026-05-08 12:07 ` Dmitry Baryshkov
2026-05-05 0:24 ` [PATCH v5 2/8] drm/amd/display: use drmm_writeback_connector_init() Dmitry Baryshkov
2026-05-26 18:46 ` Alex Hung
2026-06-09 18:07 ` John Harrison
2026-06-12 13:56 ` Dmitry Baryshkov
2026-05-05 0:25 ` [PATCH v5 3/8] drm/komeda: " Dmitry Baryshkov
2026-06-02 10:32 ` Liviu Dudau [this message]
2026-05-05 0:25 ` [PATCH v5 4/8] drm/mali: " Dmitry Baryshkov
2026-06-02 10:33 ` Liviu Dudau
2026-05-05 0:25 ` [PATCH v5 5/8] drm: renesas: rcar-du: " Dmitry Baryshkov
2026-05-05 0:25 ` [PATCH v5 6/8] drm/vc4: " Dmitry Baryshkov
2026-05-05 0:25 ` [PATCH v5 7/8] drm: writeback: drop excess connector initialization functions Dmitry Baryshkov
2026-05-05 0:25 ` [PATCH v5 8/8] drm: writeback: rename drm_writeback_connector_init_with_encoder() Dmitry Baryshkov
2026-05-16 15:25 ` [PATCH v5 0/8] drm: writeback: clean up writeback connector initialization Dmitry Baryshkov
2026-05-19 16:59 ` John Harrison
2026-05-20 13:04 ` Dmitry Baryshkov
2026-05-20 22:50 ` Rodrigo Siqueira
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=ah6xQEWemicF_ECc@e142607 \
--to=liviu.dudau@arm.com \
--cc=abhinav.kumar@linux.dev \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dave.stevenson@raspberrypi.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=geert+renesas@glider.be \
--cc=harry.wentland@amd.com \
--cc=jani.nikula@linux.intel.com \
--cc=jesszhan0024@gmail.com \
--cc=kernel-list@raspberrypi.com \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=magnus.damm@gmail.com \
--cc=marijn.suijten@somainline.org \
--cc=mcanal@igalia.com \
--cc=mripard@kernel.org \
--cc=robin.clark@oss.qualcomm.com \
--cc=sean@poorly.run \
--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