Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Jessica Zhang <quic_jesszhan@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Marijn Suijten <marijn.suijten@somainline.org>
Cc: Stephen Boyd <swboyd@chromium.org>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Bjorn Andersson <andersson@kernel.org>,
	<linux-arm-msm@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>,
	<freedreno@lists.freedesktop.org>
Subject: Re: [PATCH v2 10/13] drm/msm/dpu: use drmm-managed allocation for dpu_crtc
Date: Fri, 28 Jul 2023 17:55:35 -0700	[thread overview]
Message-ID: <defef5d7-fa21-89ab-d2fa-32145d565a06@quicinc.com> (raw)
In-Reply-To: <20230707231251.3849701-11-dmitry.baryshkov@linaro.org>



On 7/7/2023 4:12 PM, Dmitry Baryshkov wrote:
> Change struct dpu_crtc allocation to use drmm_crtc_alloc_with_planes().
> This removes the need to perform any actions on CRTC destruction.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>

> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 25 +++++++-----------------
>   1 file changed, 7 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index 214229d11e3e..a1fcb690c687 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -51,17 +51,6 @@ static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
>   	return to_dpu_kms(priv->kms);
>   }
>   
> -static void dpu_crtc_destroy(struct drm_crtc *crtc)
> -{
> -	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
> -
> -	if (!crtc)
> -		return;
> -
> -	drm_crtc_cleanup(crtc);
> -	kfree(dpu_crtc);
> -}
> -
>   static struct drm_encoder *get_encoder_from_crtc(struct drm_crtc *crtc)
>   {
>   	struct drm_device *dev = crtc->dev;
> @@ -1433,7 +1422,6 @@ static int dpu_crtc_late_register(struct drm_crtc *crtc)
>   
>   static const struct drm_crtc_funcs dpu_crtc_funcs = {
>   	.set_config = drm_atomic_helper_set_config,
> -	.destroy = dpu_crtc_destroy,
>   	.page_flip = drm_atomic_helper_page_flip,
>   	.reset = dpu_crtc_reset,
>   	.atomic_duplicate_state = dpu_crtc_duplicate_state,
> @@ -1467,9 +1455,13 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
>   	struct dpu_crtc *dpu_crtc = NULL;
>   	int i, ret;
>   
> -	dpu_crtc = kzalloc(sizeof(*dpu_crtc), GFP_KERNEL);
> -	if (!dpu_crtc)
> -		return ERR_PTR(-ENOMEM);
> +	dpu_crtc = drmm_crtc_alloc_with_planes(dev, struct dpu_crtc, base,
> +					       plane, cursor,
> +					       &dpu_crtc_funcs,
> +					       NULL);
> +
> +	if (IS_ERR(dpu_crtc))
> +		return ERR_CAST(dpu_crtc);
>   
>   	crtc = &dpu_crtc->base;
>   	crtc->dev = dev;
> @@ -1489,9 +1481,6 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
>   				dpu_crtc_frame_event_work);
>   	}
>   
> -	drm_crtc_init_with_planes(dev, crtc, plane, cursor, &dpu_crtc_funcs,
> -				NULL);
> -
>   	drm_crtc_helper_add(crtc, &dpu_crtc_helper_funcs);
>   
>   	if (dpu_kms->catalog->dspp_count)
> -- 
> 2.39.2
> 

  reply	other threads:[~2023-07-29  0:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-07 23:12 [PATCH v2 00/13] drm/msm/dpu: use managed memory allocations Dmitry Baryshkov
2023-07-07 23:12 ` [PATCH v2 01/13] drm/msm/dpu: cleanup dpu_kms_hw_init error path Dmitry Baryshkov
2023-07-14 21:43   ` Jessica Zhang
2023-07-30  1:15     ` Dmitry Baryshkov
2023-07-07 23:12 ` [PATCH v2 02/13] drm/msm/dpu: remove IS_ERR_OR_NULL for dpu_hw_intr_init() error handling Dmitry Baryshkov
2023-07-18 22:00   ` Jessica Zhang
2023-07-07 23:12 ` [PATCH v2 03/13] drm/msm/dpu: use devres-managed allocation for interrupts data Dmitry Baryshkov
2023-07-19  0:26   ` Jessica Zhang
2023-07-07 23:12 ` [PATCH v2 04/13] drm/msm/dpu: use devres-managed allocation for VBIF data Dmitry Baryshkov
2023-07-19  1:03   ` Jessica Zhang
2023-07-07 23:12 ` [PATCH v2 05/13] drm/msm/dpu: use devres-managed allocation for MDP TOP Dmitry Baryshkov
2023-07-15  0:55   ` Jessica Zhang
2023-07-07 23:12 ` [PATCH v2 06/13] drm/msm/dpu: use devres-managed allocation for HW blocks Dmitry Baryshkov
2023-07-29  0:28   ` Jessica Zhang
2023-07-07 23:12 ` [PATCH v2 07/13] drm/msm/dpu: drop unused dpu_plane::lock Dmitry Baryshkov
2023-07-29  1:10   ` Jessica Zhang
2023-07-07 23:12 ` [PATCH v2 08/13] drm/msm/dpu: remove QoS teardown on plane destruction Dmitry Baryshkov
2023-07-07 23:12 ` [PATCH v2 09/13] drm/msm/dpu: use drmm-managed allocation for dpu_plane Dmitry Baryshkov
2023-07-29  0:49   ` Jessica Zhang
2023-07-07 23:12 ` [PATCH v2 10/13] drm/msm/dpu: use drmm-managed allocation for dpu_crtc Dmitry Baryshkov
2023-07-29  0:55   ` Jessica Zhang [this message]
2023-07-07 23:12 ` [PATCH v2 11/13] drm/msm/dpu: use drmm-managed allocation for dpu_encoder_phys Dmitry Baryshkov
2023-07-29  1:08   ` Jessica Zhang
2023-07-07 23:12 ` [PATCH v2 12/13] drm/msm/dpu: drop dpu_encoder_phys_ops::destroy Dmitry Baryshkov
2023-07-29  1:11   ` Jessica Zhang
2023-07-07 23:12 ` [PATCH v2 13/13] drm/msm/dpu: use drmm-managed allocation for dpu_encoder_virt 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=defef5d7-fa21-89ab-d2fa-32145d565a06@quicinc.com \
    --to=quic_jesszhan@quicinc.com \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=swboyd@chromium.org \
    /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