dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 1/2] drm/msm/dpu: add dpu encoder uninit
Date: Mon, 19 Nov 2018 10:50:16 -0800	[thread overview]
Message-ID: <17d9b0e2a897927121532df9c9a742fa@codeaurora.org> (raw)
In-Reply-To: <20181116213726.GA154160@art_vandelay>

On 2018-11-16 13:37, Sean Paul wrote:
> On Fri, Nov 16, 2018 at 04:35:26PM -0500, Sean Paul wrote:
>> On Fri, Nov 16, 2018 at 11:22:21AM -0800, Jeykumar Sankaran wrote:
>> > Add encoder interface to release dpu encoder
>> > on mode_init failures in kms.
>> >
>> > Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
>> > ---
>> >  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 12 ++++++++++--
>> >  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h |  6 ++++++
>> >  2 files changed, 16 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> > index dd7ab85..b253165 100644
>> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> > @@ -422,6 +422,15 @@ void dpu_encoder_get_hw_resources(struct
> drm_encoder *drm_enc,
>> >  	}
>> >  }
>> >
>> > +void dpu_encoder_uninit(struct drm_encoder *drm_enc)
>> > +{
>> > +	struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc);
>> > +
>> > +	drm_encoder_cleanup(drm_enc);
>> > +
>> > +	kfree(dpu_enc);
>> > +}
>> > +
>> >  static void dpu_encoder_destroy(struct drm_encoder *drm_enc)
>> >  {
>> >  	struct dpu_encoder_virt *dpu_enc = NULL;
>> > @@ -453,10 +462,9 @@ static void dpu_encoder_destroy(struct
> drm_encoder *drm_enc)
>> >  	dpu_enc->num_phys_encs = 0;
>> >  	mutex_unlock(&dpu_enc->enc_lock);
>> >
>> > -	drm_encoder_cleanup(drm_enc);
>> >  	mutex_destroy(&dpu_enc->enc_lock);
>> >
>> > -	kfree(dpu_enc);
>> > +	dpu_encoder_uninit(drm_enc);
>> >  }
>> >
>> >  void dpu_encoder_helper_split_config(
>> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> > index 9dbf38f..60b88bd 100644
>> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> > @@ -142,6 +142,12 @@ struct drm_encoder *dpu_encoder_init(
>> >  		int drm_enc_mode);
>> >
>> >  /**
>> > + * dpu_encoder_uninit - uninitialize virtual encoder object
>> > + * @drm_enc:  Pointer to drm encoder
>> > + */
>> > +void dpu_encoder_uninit(struct drm_encoder *drm_enc);
>> 
>> Just make it static?
> 
> I just saw YueHaibing's patch to remove the kfree entirely since 
> dpu_enc
> is
> devm_* managed. IMO, that'd be a better solution than this.
> 
> Sean
> 
I still need the unint here to call drm_encoder_cleanup
if the display mode_init fails.

I will rebase the patch on top of https://lkml.org/lkml/2018/11/17/87

Thanks,
Jeykumar S.
> 
>> 
>> > +
>> > +/**
>> >   * dpu_encoder_setup - setup dpu_encoder for the display probed
>> >   * @dev:		Pointer to drm device structure
>> >   * @enc:		Pointer to the drm_encoder
>> > --
>> > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> Forum,
>> > a Linux Foundation Collaborative Project
>> >
>> 
>> --
>> Sean Paul, Software Engineer, Google / Chromium OS

-- 
Jeykumar S
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  reply	other threads:[~2018-11-19 18:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16 19:22 [PATCH 1/2] drm/msm/dpu: add dpu encoder uninit Jeykumar Sankaran
2018-11-16 19:22 ` [PATCH 2/2] drm/msm/dpu: add display port support in DPU Jeykumar Sankaran
2018-11-16 20:33   ` Jordan Crouse
     [not found] ` <1542396142-19534-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-16 21:35   ` [PATCH 1/2] drm/msm/dpu: add dpu encoder uninit Sean Paul
2018-11-16 21:37     ` Sean Paul
2018-11-19 18:50       ` Jeykumar Sankaran [this message]
2018-11-19 18:48     ` Jeykumar Sankaran

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=17d9b0e2a897927121532df9c9a742fa@codeaurora.org \
    --to=jsanka-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org \
    --cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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