From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BE5A36F90F for ; Tue, 2 Jun 2026 10:34:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780396466; cv=none; b=U1DB5GSg7gcWmjwMeAqQobroSyxoEvgJwZLoMJh8qMSw0dR1y6RY+mUL/8b9Gin8j5+xd463dpAzNHoJxjh0mwFZq2e9AV3oBf+7ze1BkJZwJ+u5SiuaX8Jzzv+PxPBattNYCSdhpVdYN2AJiunfkmIJMj34xit5i/4iSqeOugQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780396466; c=relaxed/simple; bh=sSLG3wXzMGkuchBhOWXlkifyhi6ZS+mT6rRQfEDVsGo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ElT7KotSkfODummMPnb/Ip1CHZAw01bxG+B5BefVrDkuYw4YUeSHruesB7kBAX9+a8SiLI8HrhE77D+6L61BB1eQnqN9betzVyoAlzdc32IAEEj4zESvIjwMVD3pFZlGoOZamae9CJGgz87xzB8rJTkKeQLq1wMd2U9iQfT1n/s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=X47dmyng; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="X47dmyng" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 45AB62364 for ; Tue, 2 Jun 2026 03:34:19 -0700 (PDT) Received: from [192.168.0.1] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F30503F632 for ; Tue, 2 Jun 2026 03:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1780396464; bh=sSLG3wXzMGkuchBhOWXlkifyhi6ZS+mT6rRQfEDVsGo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X47dmyngrTZB/I6UonO8VGZTxpg8G7BK1HxcjcVUnTBc9YTovNKdb4rmSizj8gmBa KWe3E2sxP5hsi/tLizrgUNXeSCue6uDnT2xuQD4QKL3YCFplmVoSbhRxie8KNE3h1l loc3RM7ORpZetEG2bnfZj0fYtimqw33sbHIaxlo4= Date: Tue, 2 Jun 2026 11:33:49 +0100 From: Liviu Dudau To: Dmitry Baryshkov Cc: Jani Nikula , "Kandpal, Suraj" , Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , Christian =?utf-8?B?S8O2bmln?= , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Sean Paul , Marijn Suijten , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Dave Stevenson , =?utf-8?B?TWHDrXJh?= Canal , Raspberry Pi Kernel Maintenance , Christophe JAILLET , Jessica Zhang , Louis Chauvet , 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 4/8] drm/mali: use drmm_writeback_connector_init() Message-ID: References: <20260505-wb-drop-encoder-v5-0-42567b7c7af2@oss.qualcomm.com> <20260505-wb-drop-encoder-v5-4-42567b7c7af2@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260505-wb-drop-encoder-v5-4-42567b7c7af2@oss.qualcomm.com> On Tue, May 05, 2026 at 03:25:01AM +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 > Reviewed-by: Louis Chauvet > Signed-off-by: Dmitry Baryshkov Reviewed-by: Liviu Dudau Best regards, Liviu > --- > 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 fad343842038..6e0c78e998aa 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 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯