mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Liviu Dudau <liviu.dudau@arm.com>
To: Mihail Atanassov <mihail.atanassov@arm.com>
Cc: DRI devel <dri-devel@lists.freedesktop.org>,
	Brian Starkey <brian.starkey@arm.com>,
	Mali DP Maintainers <malidp@foss.arm.com>,
	David Airlie <airlied@linux.ie>,
	LKML <linux-kernel@vger.kernel.org>,
	nd@arm.com
Subject: Re: [PATCH] drm: mali-dp: add custom plane ->reset hook
Date: Mon, 30 Jan 2017 16:34:16 +0000	[thread overview]
Message-ID: <20170130163416.GI3140@e110455-lin.cambridge.arm.com> (raw)
In-Reply-To: <1485790946-18718-1-git-send-email-mihail.atanassov@arm.com>

On Mon, Jan 30, 2017 at 03:42:26PM +0000, Mihail Atanassov wrote:
> The reset hook needs to allocate space for a
> malidp_plane_state, which is larger than drm_plane_state.
> Otherwise, the hook is identical to the default one.
> 
> Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Thanks,
Liviu

> ---
>  drivers/gpu/drm/arm/malidp_planes.c | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> index eff2fe4..686ff86 100644
> --- a/drivers/gpu/drm/arm/malidp_planes.c
> +++ b/drivers/gpu/drm/arm/malidp_planes.c
> @@ -58,6 +58,27 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
>  	devm_kfree(plane->dev->dev, mp);
>  }
>  
> +/*
> + * Replicate what the default ->reset hook does: free the state pointer and
> + * allocate a new empty object. We just need enough space to store
> + * a malidp_plane_state instead of a drm_plane_state.
> + */
> +static void malidp_plane_reset(struct drm_plane *plane)
> +{
> +	struct malidp_plane_state *state = to_malidp_plane_state(plane->state);
> +
> +	if (state)
> +		__drm_atomic_helper_plane_destroy_state(&state->base);
> +	kfree(state);
> +	plane->state = NULL;
> +	state = kzalloc(sizeof(*state), GFP_KERNEL);
> +	if (state) {
> +		state->base.plane = plane;
> +		state->base.rotation = DRM_ROTATE_0;
> +		plane->state = &state->base;
> +	}
> +}
> +
>  static struct
>  drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
>  {
> @@ -92,7 +113,7 @@ static void malidp_destroy_plane_state(struct drm_plane *plane,
>  	.disable_plane = drm_atomic_helper_disable_plane,
>  	.set_property = drm_atomic_helper_plane_set_property,
>  	.destroy = malidp_de_plane_destroy,
> -	.reset = drm_atomic_helper_plane_reset,
> +	.reset = malidp_plane_reset,
>  	.atomic_duplicate_state = malidp_duplicate_plane_state,
>  	.atomic_destroy_state = malidp_destroy_plane_state,
>  };
> -- 
> 1.9.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

      reply	other threads:[~2017-01-30 16:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 15:42 Mihail Atanassov
2017-01-30 16:34 ` Liviu Dudau [this message]

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=20170130163416.GI3140@e110455-lin.cambridge.arm.com \
    --to=liviu.dudau@arm.com \
    --cc=airlied@linux.ie \
    --cc=brian.starkey@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malidp@foss.arm.com \
    --cc=mihail.atanassov@arm.com \
    --cc=nd@arm.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 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®