mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Harrison <John.Harrison@Igalia.com>
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
	"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>,
	"Louis Chauvet" <louis.chauvet@bootlin.com>,
	"Mihail Atanassov" <mihail.atanassov@arm.com>,
	"Eric Anholt" <eric@anholt.net>,
	"Rob Clark" <robin.clark@oss.qualcomm.com>,
	"Brian Starkey" <brian.starkey@arm.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v8 07/10] drm: writeback: don't destroy the shared writeback properties
Date: Wed, 11 Nov 2026 17:32:05 -0800	[thread overview]
Message-ID: <ee8a57d3-d290-4a20-a3ca-ac8e17a7561c@Igalia.com> (raw)
In-Reply-To: <20261111-wb-drop-encoder-v8-7-62948ed87d13@oss.qualcomm.com>

On 11/10/26 16:42, Dmitry Baryshkov wrote:
> The writeback properties are created once per device and attached to
> every writeback connector. Nevertheless, a failing
> __drm_writeback_connector_init() destroys all three of them. If an
> earlier writeback connector has already been registered (komeda and
> rcar-du create one per CRTC), it is left holding stale property
> pointers. The drmm cleanup action likewise destroys them as soon as the
> first connector goes away.
>
> Leave the properties alone. They are on the device's property list, so
> drm_mode_config_cleanup() destroys them together with all other
> properties.
This does appear to be the actual behaviour. More importantly, it is 
also the intended behaviour according to various comments sprinkled 
around the property creation functions.

Reviewed-by: John Harrison <John.Harrison@Igalia.com>

> Fixes: 2f3f4a73631b ("drm: writeback: Add missing cleanup in case of initialization failure")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
>   drivers/gpu/drm/drm_writeback.c | 34 ++++++----------------------------
>   1 file changed, 6 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_writeback.c b/drivers/gpu/drm/drm_writeback.c
> index 89c36f1414ce..2f6a7b50336c 100644
> --- a/drivers/gpu/drm/drm_writeback.c
> +++ b/drivers/gpu/drm/drm_writeback.c
> @@ -148,22 +148,6 @@ static int create_writeback_properties(struct drm_device *dev)
>   	return 0;
>   }
>   
> -static void delete_writeback_properties(struct drm_device *dev)
> -{
> -	if (dev->mode_config.writeback_pixel_formats_property) {
> -		drm_property_destroy(dev, dev->mode_config.writeback_pixel_formats_property);
> -		dev->mode_config.writeback_pixel_formats_property = NULL;
> -	}
> -	if (dev->mode_config.writeback_out_fence_ptr_property) {
> -		drm_property_destroy(dev, dev->mode_config.writeback_out_fence_ptr_property);
> -		dev->mode_config.writeback_out_fence_ptr_property = NULL;
> -	}
> -	if (dev->mode_config.writeback_fb_id_property) {
> -		drm_property_destroy(dev, dev->mode_config.writeback_fb_id_property);
> -		dev->mode_config.writeback_fb_id_property = NULL;
> -	}
> -}
> -
>   /**
>    * __drm_writeback_connector_init - Initialize a writeback connector
>    *
> @@ -198,20 +182,18 @@ static int __drm_writeback_connector_init(struct drm_device *dev,
>   	int ret = create_writeback_properties(dev);
>   
>   	if (ret != 0)
> -		goto failed_properties;
> +		return ret;
>   
>   	connector->interlace_allowed = 0;
>   
>   	ret = drm_connector_attach_encoder(connector, enc);
>   	if (ret)
> -		goto failed_properties;
> +		return ret;
>   
>   	blob = drm_property_create_blob(dev, n_formats * sizeof(*formats),
>   					formats);
> -	if (IS_ERR(blob)) {
> -		ret = PTR_ERR(blob);
> -		goto failed_properties;
> -	}
> +	if (IS_ERR(blob))
> +		return PTR_ERR(blob);
>   
>   	INIT_LIST_HEAD(&wb_connector->job_queue);
>   	spin_lock_init(&wb_connector->job_lock);
> @@ -234,9 +216,6 @@ static int __drm_writeback_connector_init(struct drm_device *dev,
>   	wb_connector->pixel_formats_blob_ptr = blob;
>   
>   	return 0;
> -failed_properties:
> -	delete_writeback_properties(dev);
> -	return ret;
>   }
>   
>   /**
> @@ -295,8 +274,8 @@ EXPORT_SYMBOL(drm_writeback_connector_init);
>    * @dev: DRM device
>    * @data: Pointer to the writeback connector to clean up
>    *
> - * This will decrement the reference counter of blobs and destroy properties. It
> - * will also clean the remaining jobs in this writeback connector. Caution: This helper will not
> + * This will decrement the reference counter of blobs. It will also clean the
> + * remaining jobs in this writeback connector. Caution: This helper will not
>    * clean up the attached encoder and the drm_connector.
>    */
>   static void drm_writeback_connector_cleanup(struct drm_device *dev,
> @@ -306,7 +285,6 @@ static void drm_writeback_connector_cleanup(struct drm_device *dev,
>   	struct drm_writeback_job *pos, *n;
>   	struct drm_writeback_connector *wb_connector = data;
>   
> -	delete_writeback_properties(dev);
>   	drm_property_blob_put(wb_connector->pixel_formats_blob_ptr);
>   
>   	spin_lock_irqsave(&wb_connector->job_lock, flags);
>


  reply	other threads:[~2026-11-12  1:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  0:42 [PATCH v8 00/10] drm: writeback: clean up writeback connector initialization Dmitry Baryshkov
2026-11-11  0:42 ` [PATCH v8 01/10] drm/amd/display: embed the writeback encoder in amdgpu_dm_wb_connector Dmitry Baryshkov
2026-11-11  0:42 ` [PATCH v8 02/10] drm/komeda: embed the writeback encoder in komeda_wb_connector Dmitry Baryshkov
2026-11-11  0:42 ` [PATCH v8 03/10] drm/mali: embed the writeback encoder in malidp_drm Dmitry Baryshkov
2026-11-11  0:42 ` [PATCH v8 04/10] drm: renesas: rcar-du: embed the writeback encoder in rcar_du_crtc Dmitry Baryshkov
2026-11-11  0:42 ` [PATCH v8 05/10] drm: writeback: drop excess connector initialization functions Dmitry Baryshkov
2026-11-11  0:42 ` [PATCH v8 06/10] drm: writeback: rename drm_writeback_connector_init_with_encoder() Dmitry Baryshkov
2026-11-11  0:42 ` [PATCH v8 07/10] drm: writeback: don't destroy the shared writeback properties Dmitry Baryshkov
2026-11-12  1:32   ` John Harrison [this message]
2026-11-11  0:42 ` [PATCH v8 08/10] drm: writeback: clean up writeback jobs outside the job_lock Dmitry Baryshkov
2026-11-12  1:34   ` John Harrison
2026-11-11  0:42 ` [PATCH v8 09/10] drm: writeback: clean up writeback connectors in drm_connector_cleanup() Dmitry Baryshkov
2026-11-12  1:35   ` John Harrison
2026-11-11  0:42 ` [PATCH v8 10/10] drm: writeback: drop the drmm writeback cleanup action 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=ee8a57d3-d290-4a20-a3ca-ac8e17a7561c@Igalia.com \
    --to=john.harrison@igalia.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=brian.starkey@arm.com \
    --cc=christian.koenig@amd.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --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=mihail.atanassov@arm.com \
    --cc=mripard@kernel.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.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®