lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170130163416.GI3140@e110455-lin.cambridge.arm.com>
Date:   Mon, 30 Jan 2017 16:34:16 +0000
From:   Liviu Dudau <liviu.dudau@....com>
To:     Mihail Atanassov <mihail.atanassov@....com>
Cc:     DRI devel <dri-devel@...ts.freedesktop.org>,
        Brian Starkey <brian.starkey@....com>,
        Mali DP Maintainers <malidp@...s.arm.com>,
        David Airlie <airlied@...ux.ie>,
        LKML <linux-kernel@...r.kernel.org>, nd@....com
Subject: Re: [PATCH] drm: mali-dp: add custom plane ->reset hook

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@....com>

Acked-by: Liviu Dudau <liviu.dudau@....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!  /
  ---------------
    ¯\_(ツ)_/¯

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ