Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp282999pxb; Fri, 15 Jan 2021 13:01:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6P7am/g3cxDUdJpQvwPIdVms1WvV6A5Rp8cPW3pnBcVWcLZ7RDYWZ6dOEEsxVj885VmDk X-Received: by 2002:a17:906:7804:: with SMTP id u4mr10449421ejm.97.1610744480500; Fri, 15 Jan 2021 13:01:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610744480; cv=none; d=google.com; s=arc-20160816; b=Esz8Ee++wWGbvjGfhwU4lLpGd4XSnAqZh38RtuDnqJludItxIqxVh4o97feZZMgS2G nNLh5bsI5k1jyoak3pufwIDNWGEeFGldz6uYYx3zi1z+dP5sQegPD90/f0WNJnvNFHqJ AvxhMKsALyK3qEnx8xW7U/o9+rRadz9Jmt8w0Uq9mxujA5hYF0jqLQBesxjK5OWwMVUJ p2uNoR/Q0bVZunvkLjfwWgeyFNbrX/AVYwtsyiXOk6M1W2KBVOCTvOaPDNpoFLSGoZGG Ds2wknwv2yN9JE+E/8ocWMTQIt5hYH9s4i2CgPOQmMYxBRkw9EI55h4eVgekKlsTocoT H+sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WMUQl+7W2wg8Ex7Cab+wlEqJQFNg+NEUFN+VRHbl0VI=; b=nuCeNaD//y4vfqY4e3BKlXDJEvcDkROVkjQVA9EI3IwCg6J6qk7iOQ5lmJcrg5rjtm aMrRsSG4VXNHPQStXuFxWbj52Gpsmo34D6E15ern7wABMNDlna3fjAoLTcGwgue2lxtP gToRE3iJD0FAV3VKYp2BZatc43hcVH6ERi8S3iL2RIhDy0mtIe3Jp6LVNcG8QflLwFsa PVpMq1eyQ872jEScBLBJI2iBiHt/S4adxw5tLVb6vm7g+52zs+CyECkryJSJcbX3XC0L AJCRtVMBKmOjlJ9hZiqNVlkH7vvrwbWaskpyatRFM3zviseCuPMm7z1OSVLd5EZ3F7gX gt5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=BV3hEMjl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp16si2451193ejc.16.2021.01.15.13.00.55; Fri, 15 Jan 2021 13:01:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=BV3hEMjl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730295AbhAOU6k (ORCPT + 99 others); Fri, 15 Jan 2021 15:58:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbhAOU6j (ORCPT ); Fri, 15 Jan 2021 15:58:39 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39358C061757; Fri, 15 Jan 2021 12:57:59 -0800 (PST) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F32CB58B; Fri, 15 Jan 2021 21:57:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1610744277; bh=VjE+h+vZVJvv9Us4y8H19WCA00VSbF5Mv39d7q0MA9U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BV3hEMjlk7/sEuKZRq6pt0i2HuaqsH60PVECUzrsL2O1TD7ANDlEjKgpfLxpsno0J V+GDPEX+RT1JaaqsMkgbVNMHG6qTeG7N7mWXbGklvGmCYKw1yxb3d/evRKRLjIbvkr 5xrKIgguJLiN4CHn4qNUfx/2EFxHOtUVq3DDfbUg= Date: Fri, 15 Jan 2021 22:57:40 +0200 From: Laurent Pinchart To: Maxime Ripard Cc: Maarten Lankhorst , Thomas Zimmermann , Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, Alexey Brodkin , Daniel Vetter , Liviu Dudau , Brian Starkey , Sam Ravnborg , Boris Brezillon , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Anitha Chrisanthus , Edmund Dea , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , Tomi Valkeinen , Dave Airlie , Gerd Hoffmann , Kieran Bingham , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Thierry Reding , Jonathan Hunter , Hans de Goede , Rodrigo Siqueira , Melissa Wen , Haneen Mohammed , VMware Graphics , Roland Scheidegger , Hyun Kwon , Michal Simek , Shawn Guo , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH 07/10] drm: Store new plane state in a variable for atomic_update and disable Message-ID: References: <20210115125703.1315064-1-maxime@cerno.tech> <20210115125703.1315064-7-maxime@cerno.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210115125703.1315064-7-maxime@cerno.tech> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, Thank you for the patch. On Fri, Jan 15, 2021 at 01:56:59PM +0100, Maxime Ripard wrote: > In order to store the new plane state in a subsequent helper, let's move > the plane->state dereferences into a variable. > > This was done using the following coccinelle script, plus some hand > changes for vmwgfx: > > @ 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, > ..., > }; > ) > > @ has_new_state_old_state @ > identifier plane_atomic_func.func; > identifier plane; > identifier new_state; > symbol old_state; > @@ > > func(struct drm_plane *plane, struct drm_plane_state *old_state) > { > ... > struct drm_plane_state *new_state = plane->state; > ... > } > > @ depends on !has_new_state_old_state @ > identifier plane_atomic_func.func; > identifier plane; > symbol old_state; > @@ > > func(struct drm_plane *plane, struct drm_plane_state *old_state) > { > + struct drm_plane_state *new_state = plane->state; > <+... > - plane->state > + new_state > ...+> > } > > @ has_new_state_state @ > identifier plane_atomic_func.func; > identifier plane; > identifier new_state; > symbol state; > @@ > > func(struct drm_plane *plane, struct drm_plane_state *state) > { > ... > struct drm_plane_state *new_state = plane->state; > ... > } > > @ depends on !has_new_state_state @ > identifier plane_atomic_func.func; > identifier plane; > symbol state; > @@ > > func(struct drm_plane *plane, struct drm_plane_state *state) > { > + struct drm_plane_state *new_plane_state = plane->state; > <+... > - plane->state > + new_plane_state > ...+> > } > > @ has_new_state_old_s @ > identifier plane_atomic_func.func; > identifier plane; > identifier new_state; > symbol old_s; > @@ > > func(struct drm_plane *plane, struct drm_plane_state *old_s) > { > ... > struct drm_plane_state *new_state = plane->state; > ... > } > > @ depends on !has_new_state_old_s @ > identifier plane_atomic_func.func; > identifier plane; > symbol old_s; > @@ > > func(struct drm_plane *plane, struct drm_plane_state *old_s) > { > + struct drm_plane_state *new_s = plane->state; > <+... > - plane->state > + new_s > ...+> > } I may have taken this as an opportunity to align naming conventions for variables across drivers, but that may just be me. > > Signed-off-by: Maxime Ripard > --- [snip] > drivers/gpu/drm/omapdrm/omap_plane.c | 5 ++- > drivers/gpu/drm/rcar-du/rcar_du_plane.c | 5 ++- > drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 +- > drivers/gpu/drm/xlnx/zynqmp_disp.c | 7 ++-- For these, with the small issue below addressed, Reviewed-by: Laurent Pinchart [snip] > diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c > index 1042e1147e74..de5ad69af4cb 100644 > --- a/drivers/gpu/drm/omapdrm/omap_plane.c > +++ b/drivers/gpu/drm/omapdrm/omap_plane.c > @@ -88,11 +88,12 @@ static void omap_plane_atomic_update(struct drm_plane *plane, > static void omap_plane_atomic_disable(struct drm_plane *plane, > struct drm_plane_state *old_state) > { > + struct drm_plane_state *new_state = plane->state; > struct omap_drm_private *priv = plane->dev->dev_private; > struct omap_plane *omap_plane = to_omap_plane(plane); > > - plane->state->rotation = DRM_MODE_ROTATE_0; > - plane->state->zpos = plane->type == DRM_PLANE_TYPE_PRIMARY > + new_state->rotation = DRM_MODE_ROTATE_0; > + new_state->zpos = plane->type == DRM_PLANE_TYPE_PRIMARY > ? 0 : omap_plane->id; Can you fix the indentation ? > dispc_ovl_enable(priv->dispc, omap_plane->id, false); [snip] -- Regards, Laurent Pinchart