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]
Date:   Tue, 26 Jan 2021 15:24:35 +0200
From:   Ville Syrjälä <ville.syrjala@...ux.intel.com>
To:     Maxime Ripard <maxime@...no.tech>
Cc:     Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Daniel Vetter <daniel.vetter@...el.com>,
        David Airlie <airlied@...ux.ie>,
        Haneen Mohammed <hamohammed.sa@...il.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Neil Armstrong <narmstrong@...libre.com>,
        Xinliang Liu <xinliang.liu@...aro.org>,
        Liviu Dudau <liviu.dudau@....com>,
        dri-devel@...ts.freedesktop.org, Sandy Huang <hjc@...k-chips.com>,
        Paul Cercueil <paul@...pouillou.net>,
        linux-tegra@...r.kernel.org, Chen-Yu Tsai <wens@...e.org>,
        Thierry Reding <thierry.reding@...il.com>,
        Gerd Hoffmann <kraxel@...hat.com>,
        Anitha Chrisanthus <anitha.chrisanthus@...el.com>,
        Sam Ravnborg <sam@...nborg.org>,
        Michal Simek <michal.simek@...inx.com>,
        Jerome Brunet <jbrunet@...libre.com>,
        Marek Vasut <marex@...x.de>,
        Yannick Fertre <yannick.fertre@...com>,
        linux-samsung-soc@...r.kernel.org,
        Joonyoung Shim <jy0922.shim@...sung.com>,
        linux-rockchip@...ts.infradead.org,
        Alexey Brodkin <abrodkin@...opsys.com>,
        Russell King <linux@...linux.org.uk>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Jonathan Hunter <jonathanh@...dia.com>,
        freedreno@...ts.freedesktop.org,
        Ludovic Desroches <ludovic.desroches@...rochip.com>,
        VMware Graphics <linux-graphics-maintainer@...are.com>,
        NXP Linux Team <linux-imx@....com>,
        linux-arm-msm@...r.kernel.org,
        Philippe Cornu <philippe.cornu@...com>,
        Dave Airlie <airlied@...hat.com>,
        Xinwei Kong <kong.kongxinwei@...ilicon.com>,
        virtualization@...ts.linux-foundation.org,
        Hyun Kwon <hyun.kwon@...inx.com>,
        Chun-Kuang Hu <chunkuang.hu@...nel.org>,
        Alexandre Torgue <alexandre.torgue@...com>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        Chen Feng <puck.chen@...ilicon.com>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Alison Wang <alison.wang@....com>,
        Roland Scheidegger <sroland@...are.com>,
        linux-renesas-soc@...r.kernel.org, linux-mips@...r.kernel.org,
        Hans de Goede <hdegoede@...hat.com>,
        linux-mediatek@...ts.infradead
Subject: Re: [PATCH v2 10/11] drm: Use state helper instead of the plane
 state pointer

On Thu, Jan 21, 2021 at 05:35:35PM +0100, Maxime Ripard wrote:
> Many drivers reference the plane->state pointer in order to get the
> current plane state in their atomic_update or atomic_disable hooks,
> which would be the new plane state in the global atomic state since
> _swap_state happened when those hooks are run.
> 
> Use the drm_atomic_get_new_plane_state helper to get that state to make it
> more obvious.
> 
> This was made using the coccinelle script below:
> 
> @ plane_atomic_func @
> identifier helpers;
> identifier func;
> @@
> 
> (
>  static const struct drm_plane_helper_funcs helpers = {
>  	...,
>  	.atomic_disable = func,
> 	...,
>  };
> |
>  static const struct drm_plane_helper_funcs helpers = {
>  	...,
>  	.atomic_update = func,
> 	...,
>  };
> )
> 
> @ adds_new_state @
> identifier plane_atomic_func.func;
> identifier plane, state;
> identifier new_state;
> @@
> 
>  func(struct drm_plane *plane, struct drm_atomic_state *state)
>  {
>  	...
> -	struct drm_plane_state *new_state = plane->state;
> +	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
> 	...
>  }
> 
> @ include depends on adds_new_state @
> @@
> 
>  #include <drm/drm_atomic.h>
> 
> @ no_include depends on !include && adds_new_state @
> @@
> 
> + #include <drm/drm_atomic.h>
>   #include <drm/...>
> 
> Signed-off-by: Maxime Ripard <maxime@...no.tech>

Looks great.

Reviewed-by: Ville Syrjälä <ville.syrjala@...ux.intel.com>

-- 
Ville Syrjälä
Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ