All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <sean@poorly.run>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 10/17] drm/msm: Convert to using __drm_atomic_helper_crtc_reset() for reset.
Date: Mon, 4 Mar 2019 14:23:23 -0500	[thread overview]
Message-ID: <20190304192323.GB114153@art_vandelay> (raw)
In-Reply-To: <20190301125627.7285-11-maarten.lankhorst@linux.intel.com>

On Fri, Mar 01, 2019 at 01:56:20PM +0100, Maarten Lankhorst wrote:
> Convert msm to using __drm_atomic_helper_crtc_reset(), instead of
> writing its own version. Instead of open coding
> destroy_state(), call it directly for freeing the old state.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: Sean Paul <sean@poorly.run>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  |  6 ++---
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 28 +++++++++--------------
>  2 files changed, 13 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index b776fca571f3..eb156cb73dd4 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -753,14 +753,12 @@ void dpu_crtc_commit_kickoff(struct drm_crtc *crtc, bool async)
>  
>  static void dpu_crtc_reset(struct drm_crtc *crtc)
>  {
> -	struct dpu_crtc_state *cstate;
> +	struct dpu_crtc_state *cstate = kzalloc(sizeof(*cstate), GFP_KERNEL);
>  
>  	if (crtc->state)
>  		dpu_crtc_destroy_state(crtc, crtc->state);
>  
> -	crtc->state = kzalloc(sizeof(*cstate), GFP_KERNEL);
> -	if (crtc->state)
> -		crtc->state->crtc = crtc;
> +	__drm_atomic_helper_crtc_reset(crtc, &cstate->base);
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
> index b0cf63c4e3d7..bf24a08feab9 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
> @@ -1002,23 +1002,6 @@ mdp5_crtc_atomic_print_state(struct drm_printer *p,
>  	drm_printf(p, "\tcmd_mode=%d\n", mdp5_cstate->cmd_mode);
>  }
>  
> -static void mdp5_crtc_reset(struct drm_crtc *crtc)
> -{
> -	struct mdp5_crtc_state *mdp5_cstate;
> -
> -	if (crtc->state) {
> -		__drm_atomic_helper_crtc_destroy_state(crtc->state);
> -		kfree(to_mdp5_crtc_state(crtc->state));
> -	}
> -
> -	mdp5_cstate = kzalloc(sizeof(*mdp5_cstate), GFP_KERNEL);
> -
> -	if (mdp5_cstate) {
> -		mdp5_cstate->base.crtc = crtc;
> -		crtc->state = &mdp5_cstate->base;
> -	}
> -}
> -
>  static struct drm_crtc_state *
>  mdp5_crtc_duplicate_state(struct drm_crtc *crtc)
>  {
> @@ -1046,6 +1029,17 @@ static void mdp5_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state
>  	kfree(mdp5_cstate);
>  }
>  
> +static void mdp5_crtc_reset(struct drm_crtc *crtc)
> +{
> +	struct mdp5_crtc_state *mdp5_cstate =
> +		mdp5_cstate = kzalloc(sizeof(*mdp5_cstate), GFP_KERNEL);

Assigned twice for good measure ;)

> +
> +	if (crtc->state)
> +		mdp5_crtc_destroy_state(crtc, crtc->state);
> +
> +	__drm_atomic_helper_crtc_reset(crtc, &mdp5_cstate->base);
> +}
> +
>  static const struct drm_crtc_funcs mdp5_crtc_funcs = {
>  	.set_config = drm_atomic_helper_set_config,
>  	.destroy = mdp5_crtc_destroy,
> -- 
> 2.20.1
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-03-04 19:23 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 12:56 [PATCH 00/17] drm: Start subclassing crtc_state Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 01/17] drm/vc4: Fix memory leak during gpu reset Maarten Lankhorst
2019-03-01 12:56   ` Maarten Lankhorst
2019-03-01 22:43   ` Eric Anholt
2019-03-01 22:43     ` Eric Anholt
2019-03-01 12:56 ` [PATCH 02/17] drm/atomic: Create __drm_atomic_helper_crtc_reset() for subclassing crtc_state Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 03/17] drm/docs: Fix typo in __drm_atomic_helper_connector_reset Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 04/17] drm/amd: Convert to using __drm_atomic_helper_crtc_reset() for reset Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 05/17] drm/mali: " Maarten Lankhorst
2019-03-01 13:37   ` Liviu Dudau
2019-03-01 12:56 ` [PATCH 06/17] drm/atmel-hlcdc: " Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 07/17] drm/i915: Use the new __drm_atomic_helper_crtc_reset() helper Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 08/17] drm/imx: Convert to using __drm_atomic_helper_crtc_reset() for reset Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 09/17] drm/mediatek: " Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 10/17] drm/msm: " Maarten Lankhorst
2019-03-04 19:23   ` Sean Paul [this message]
2019-03-01 12:56 ` [PATCH 11/17] drm/omap: " Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 12/17] drm/rcar-du: " Maarten Lankhorst
2019-03-01 12:56   ` Maarten Lankhorst
2019-03-01 13:13   ` Laurent Pinchart
2019-03-01 13:13     ` Laurent Pinchart
2019-03-01 14:08     ` Maarten Lankhorst
2019-03-01 14:08       ` Maarten Lankhorst
2019-03-01 14:36       ` Laurent Pinchart
2019-03-01 14:36         ` Laurent Pinchart
2019-03-01 14:47         ` Maarten Lankhorst
2019-03-01 14:47           ` Maarten Lankhorst
2019-03-01 15:06           ` Laurent Pinchart
2019-03-01 15:06             ` Laurent Pinchart
     [not found] ` <20190301125627.7285-1-maarten.lankhorst-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2019-03-01 12:56   ` [PATCH 13/17] drm/rockchip: " Maarten Lankhorst
2019-03-18 18:07     ` Heiko Stübner
2019-03-01 12:56 ` [PATCH 14/17] drm/tegra: " Maarten Lankhorst
2019-03-04 13:02   ` Thierry Reding
2019-03-01 12:56 ` [PATCH 15/17] drm/vc4: " Maarten Lankhorst
2019-03-01 22:47   ` Eric Anholt
2019-03-04 13:51     ` Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 16/17] drm/vkms: " Maarten Lankhorst
2019-03-06 22:43   ` Rodrigo Siqueira
2019-04-25  9:41     ` Maarten Lankhorst
2019-03-01 12:56 ` [PATCH 17/17] drm/vmwgfx: " Maarten Lankhorst
2019-03-01 13:23 ` ✗ Fi.CI.CHECKPATCH: warning for drm: Start subclassing crtc_state Patchwork
2019-03-01 13:27 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-01 13:45 ` ✓ Fi.CI.BAT: success " Patchwork
2019-03-01 17:03 ` ✓ Fi.CI.IGT: " Patchwork

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=20190304192323.GB114153@art_vandelay \
    --to=sean@poorly.run \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.