From: Daniel Vetter <daniel@ffwll.ch>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: airlied@linux.ie, alison.wang@nxp.com, linux@armlinux.org.uk,
linux-graphics-maintainer@vmware.com,
dri-devel@lists.freedesktop.org, airlied@redhat.com
Subject: Re: [PATCH 7/7] drm/fsl-dcu: Use drm_plane_helper_destroy()
Date: Thu, 11 Aug 2022 18:46:04 +0200 [thread overview]
Message-ID: <YvUyTNLUDTwBe9eD@phenom.ffwll.local> (raw)
In-Reply-To: <20220720083058.15371-8-tzimmermann@suse.de>
On Wed, Jul 20, 2022 at 10:30:58AM +0200, Thomas Zimmermann wrote:
> Replace the driver's own function with drm_plane_helper_destroy(). No
> functional changes.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Somewhat aside, but the real fix here is switching over to the drmm
versions of this. As long as all you're doing is cleanup+kfree those
should be safe, even if the driver overall is not converted at all.
Well ok I think you need to minimally convert over to
drmm_mode_config_init(), otherwise things go boom.
Quick grep says we don't have _destroy() helpers for anything else, so
this plane helper here is very much the odd one out, not sure spreading it
is a good idea. Maybe some todo at least?
-Daniel
> ---
> drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> index e4f518e44945..3b20e79158c8 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> @@ -14,6 +14,7 @@
> #include <drm/drm_fourcc.h>
> #include <drm/drm_framebuffer.h>
> #include <drm/drm_gem_cma_helper.h>
> +#include <drm/drm_plane_helper.h>
> #include <drm/drm_probe_helper.h>
>
> #include "fsl_dcu_drm_drv.h"
> @@ -170,16 +171,10 @@ static const struct drm_plane_helper_funcs fsl_dcu_drm_plane_helper_funcs = {
> .atomic_update = fsl_dcu_drm_plane_atomic_update,
> };
>
> -static void fsl_dcu_drm_plane_destroy(struct drm_plane *plane)
> -{
> - drm_plane_cleanup(plane);
> - kfree(plane);
> -}
> -
> static const struct drm_plane_funcs fsl_dcu_drm_plane_funcs = {
> .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
> .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
> - .destroy = fsl_dcu_drm_plane_destroy,
> + .destroy = drm_plane_helper_destroy,
> .disable_plane = drm_atomic_helper_disable_plane,
> .reset = drm_atomic_helper_plane_reset,
> .update_plane = drm_atomic_helper_update_plane,
> --
> 2.36.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2022-08-11 16:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 8:30 [PATCH 0/7] drm: Clean up plane helpers Thomas Zimmermann
2022-07-20 8:30 ` [PATCH 1/7] drm/vmwgfx: Remove trailing whitespace Thomas Zimmermann
2022-07-20 13:23 ` Zack Rusin
2022-07-20 8:30 ` [PATCH 2/7] drm/atomic-helper: Move DRM_PLANE_HELPER_NO_SCALING to atomic helpers Thomas Zimmermann
2022-07-20 8:30 ` [PATCH 3/7] drm/atomic-helper: Remove _HELPER_ infix from DRM_PLANE_HELPER_NO_SCALING Thomas Zimmermann
2022-07-20 8:30 ` [PATCH 4/7] drm: Remove unnecessary include statements of drm_plane_helper.h Thomas Zimmermann
2022-07-20 8:30 ` [PATCH 5/7] drm/plane-helper: Export individual helpers Thomas Zimmermann
2022-08-11 16:41 ` Daniel Vetter
2022-08-11 18:32 ` Thomas Zimmermann
2022-09-06 19:15 ` Daniel Vetter
2022-09-07 7:09 ` Thomas Zimmermann
2022-07-20 8:30 ` [PATCH 6/7] drm/armada: Use drm_plane_helper_destroy() Thomas Zimmermann
2022-07-20 8:30 ` [PATCH 7/7] drm/fsl-dcu: " Thomas Zimmermann
2022-08-11 16:46 ` Daniel Vetter [this message]
2022-07-20 15:08 ` [PATCH 0/7] drm: Clean up plane helpers Sam Ravnborg
2022-07-21 6:52 ` Thomas Zimmermann
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=YvUyTNLUDTwBe9eD@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=alison.wang@nxp.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-graphics-maintainer@vmware.com \
--cc=linux@armlinux.org.uk \
--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;
as well as URLs for NNTP newsgroup(s).