From patchwork Fri Feb 19 12:00:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 385152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46CFCC43603 for ; Fri, 19 Feb 2021 12:02:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A87164EE7 for ; Fri, 19 Feb 2021 12:02:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbhBSMCl (ORCPT ); Fri, 19 Feb 2021 07:02:41 -0500 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:37777 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230489AbhBSMBz (ORCPT ); Fri, 19 Feb 2021 07:01:55 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 618985803A8; Fri, 19 Feb 2021 07:00:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 19 Feb 2021 07:00:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=wmcJw79XHvocI ZuyQCxDLYMomsdPgQjxjGbmG4eEhm0=; b=FU77xTVS7rLa9mBgPtX0wxVjPerQB ZfOjxs5FkXqHGLPJSo0BFoyBzNtAwHV5FxB6lcdr7w4TXmCGCcfiF3FSnMhfhcft OaYXvCzXe5LGTejfWv0S2e1UVDCdr3G5zl5g72l3TSrtGCc20wIrWGvU6Bh/LsHI bRWPrRn6AJ2QRgVYlgQG4ffL5Gsh7QfDKR65dDQPaoJX2FQKmV8GCJ+jzk8LLwfk Yw8zEfXc4ba4s12b70lF4NtOLy8AG1IkZoqoHSJZIbeVxHUE1Z5x+QOHsdcr6wrw fR0FdmiiUQppzRtQH7E4cigoMNELYiZUxnR+H8wDm1VoEop2KQEFbeLbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=wmcJw79XHvocIZuyQCxDLYMomsdPgQjxjGbmG4eEhm0=; b=qvRLsdNc U82+im/tOtvRUupUipeNSUtblOfbW2SD0/Ne71LNiFfJTuags4LyU4jNAPtvwFbV s7t88xNJkdOhNaoSa9CUjY0c4VJFe6ZSaWRbRf0EUoncNVM+0oaqUuKSCL63z31t NNxKb5Fr4T7XnK1bAC6IiNJRbbQQyIRkrqcN0cW/TF/E5sQm7Zs9cH2LnjmnrweJ UucFCfgZ8DW0ymHkEDwXn4xccLteDhzEFpzUfAaXnBqCK+HV816eKcFAaFiC6TPM Yss79ss+NXXPYVzXpfn3v18poU0HnuJnp6hFt1aZbBRsCiyTg66Mu+RPKFylDMoG hcT6FS0eXE1wvw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjeeigdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedunecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 39FA91080067; Fri, 19 Feb 2021 07:00:45 -0500 (EST) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie Cc: dri-devel@lists.freedesktop.org, Laurent Pinchart , Harry Wentland , Leo Li , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Daniel Vetter , "James (Qian) Wang" , Liviu Dudau , Mihail Atanassov , Brian Starkey , Russell King , Dave Airlie , Sam Ravnborg , Boris Brezillon , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Maxime Ripard , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , John Stultz , Xinwei Kong , Chen Feng , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Paul Cercueil , Anitha Chrisanthus , Edmund Dea , Chun-Kuang Hu , Matthias Brugger , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Rob Clark , Sean Paul , Marek Vasut , Ben Skeggs , Tomi Valkeinen , Gerd Hoffmann , Kieran Bingham , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Benjamin Gaignard , Vincent Abriou , Yannick Fertre , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Chen-Yu Tsai , Jernej Skrabec , Thierry Reding , Jonathan Hunter , Jyri Sarha , Hans de Goede , Eric Anholt , Rodrigo Siqueira , Melissa Wen , Haneen Mohammed , VMware Graphics , Roland Scheidegger , Zack Rusin , Hyun Kwon , Michal Simek , amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org Subject: [PATCH v3 04/11] drm/atomic: Pass the full state to planes atomic_check Date: Fri, 19 Feb 2021 13:00:24 +0100 Message-Id: <20210219120032.260676-4-maxime@cerno.tech> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210219120032.260676-1-maxime@cerno.tech> References: <20210219120032.260676-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The current atomic helpers have either their object state being passed as an argument or the full atomic state. The former is the pattern that was done at first, before switching to the latter for new hooks or when it was needed. Let's convert all the remaining helpers to provide a consistent interface, starting with the planes atomic_check. The conversion was done using the coccinelle script below plus some manual changes for vmwgfx, built tested on all the drivers. @@ identifier plane, plane_state; symbol state; @@ struct drm_plane_helper_funcs { ... int (*atomic_check)(struct drm_plane *plane, - struct drm_plane_state *plane_state); + struct drm_atomic_state *state); ... } @ plane_atomic_func @ identifier helpers; identifier func; @@ static const struct drm_plane_helper_funcs helpers = { ..., .atomic_check = func, ..., }; @@ struct drm_plane_helper_funcs *FUNCS; identifier f; identifier dev; identifier plane, plane_state, state; @@ f(struct drm_device *dev, struct drm_atomic_state *state) { <+... - FUNCS->atomic_check(plane, plane_state) + FUNCS->atomic_check(plane, state) ...+> } @ ignores_new_state @ identifier plane_atomic_func.func; identifier plane, new_plane_state; @@ func(struct drm_plane *plane, struct drm_plane_state *new_plane_state) { ... when != new_plane_state } @ adds_new_state depends on plane_atomic_func && !ignores_new_state @ identifier plane_atomic_func.func; identifier plane, new_plane_state; @@ func(struct drm_plane *plane, struct drm_plane_state *new_plane_state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); ... } @ depends on plane_atomic_func @ identifier plane_atomic_func.func; identifier plane, new_plane_state; @@ func(struct drm_plane *plane, - struct drm_plane_state *new_plane_state + struct drm_atomic_state *state ) { ... } @ include depends on adds_new_state @ @@ #include @ no_include depends on !include && adds_new_state @ @@ + #include #include Reviewed-by: Laurent Pinchart Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann --- Changes from v1: - Rewording and removal of a coccinelle rule suggested by Laurent --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++- drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 4 +++- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +++- drivers/gpu/drm/arm/malidp_planes.c | 4 +++- drivers/gpu/drm/armada/armada_plane.c | 4 +++- drivers/gpu/drm/armada/armada_plane.h | 2 +- drivers/gpu/drm/ast/ast_mode.c | 8 ++++++-- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 3 ++- drivers/gpu/drm/drm_atomic_helper.c | 2 +- drivers/gpu/drm/drm_simple_kms_helper.c | 4 +++- drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 +++- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 5 ++++- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 4 +++- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 4 +++- drivers/gpu/drm/imx/dcss/dcss-plane.c | 4 +++- drivers/gpu/drm/imx/ipuv3-plane.c | 4 +++- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 +++- drivers/gpu/drm/ingenic/ingenic-ipu.c | 4 +++- drivers/gpu/drm/kmb/kmb_plane.c | 4 +++- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 4 +++- drivers/gpu/drm/meson/meson_overlay.c | 4 +++- drivers/gpu/drm/meson/meson_plane.c | 4 +++- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 5 ++++- drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 +++- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 4 +++- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 5 ++++- drivers/gpu/drm/omapdrm/omap_plane.c | 4 +++- drivers/gpu/drm/qxl/qxl_display.c | 4 +++- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 4 +++- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 5 ++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +++- drivers/gpu/drm/sti/sti_cursor.c | 4 +++- drivers/gpu/drm/sti/sti_gdp.c | 4 +++- drivers/gpu/drm/sti/sti_hqvdp.c | 4 +++- drivers/gpu/drm/stm/ltdc.c | 4 +++- drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 4 +++- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 4 +++- drivers/gpu/drm/tegra/dc.c | 8 ++++++-- drivers/gpu/drm/tegra/hub.c | 4 +++- drivers/gpu/drm/tidss/tidss_plane.c | 4 +++- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 4 +++- drivers/gpu/drm/vboxvideo/vbox_mode.c | 8 ++++++-- drivers/gpu/drm/vc4/vc4_plane.c | 4 +++- drivers/gpu/drm/virtio/virtgpu_plane.c | 4 +++- drivers/gpu/drm/vkms/vkms_plane.c | 4 +++- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 ++++++-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 4 ++-- drivers/gpu/drm/xlnx/zynqmp_disp.c | 4 +++- drivers/gpu/drm/zte/zx_plane.c | 8 ++++++-- include/drm/drm_modeset_helper_vtables.h | 7 +++---- 51 files changed, 164 insertions(+), 60 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 906fa4ae25c9..1cdff048b0c0 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6432,8 +6432,10 @@ static int dm_plane_helper_check_state(struct drm_plane_state *state, } static int dm_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct amdgpu_device *adev = drm_to_adev(plane->dev); struct dc *dc = adev->dm.dc; struct dm_plane_state *dm_plane_state; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index 00fd83cbe565..96a6fe95a4e7 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c @@ -69,8 +69,10 @@ komeda_plane_init_data_flow(struct drm_plane_state *st, */ static int komeda_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct komeda_plane *kplane = to_kplane(plane); struct komeda_plane_state *kplane_st = to_kplane_st(new_plane_state); struct komeda_layer *layer = kplane->layer; diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index d5a79a4aa996..9da9d0581ce9 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -229,8 +229,10 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { }; static int hdlcd_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); int i; struct drm_crtc *crtc; struct drm_crtc_state *crtc_state; diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index e64367f55c70..c94c4a96db68 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -502,8 +502,10 @@ static void malidp_de_prefetch_settings(struct malidp_plane *mp, } static int malidp_de_plane_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct malidp_plane *mp = to_malidp_plane(plane); struct malidp_plane_state *ms = to_malidp_plane_state(new_plane_state); bool rotated = new_plane_state->rotation & MALIDP_ROTATED_MASK; diff --git a/drivers/gpu/drm/armada/armada_plane.c b/drivers/gpu/drm/armada/armada_plane.c index 27f83b07c8eb..b1266c588102 100644 --- a/drivers/gpu/drm/armada/armada_plane.c +++ b/drivers/gpu/drm/armada/armada_plane.c @@ -106,8 +106,10 @@ void armada_drm_plane_cleanup_fb(struct drm_plane *plane, } int armada_drm_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct armada_plane_state *st = to_armada_plane_state(new_plane_state); struct drm_crtc *crtc = new_plane_state->crtc; struct drm_crtc_state *crtc_state; diff --git a/drivers/gpu/drm/armada/armada_plane.h b/drivers/gpu/drm/armada/armada_plane.h index 2707ec781941..51dab8d8da22 100644 --- a/drivers/gpu/drm/armada/armada_plane.h +++ b/drivers/gpu/drm/armada/armada_plane.h @@ -26,7 +26,7 @@ int armada_drm_plane_prepare_fb(struct drm_plane *plane, void armada_drm_plane_cleanup_fb(struct drm_plane *plane, struct drm_plane_state *old_state); int armada_drm_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *state); + struct drm_atomic_state *state); void armada_plane_reset(struct drm_plane *plane); struct drm_plane_state *armada_plane_duplicate_state(struct drm_plane *plane); void armada_plane_destroy_state(struct drm_plane *plane, diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 2665d3d570f9..cb8650142f13 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -536,8 +536,10 @@ static const uint32_t ast_primary_plane_formats[] = { }; static int ast_primary_plane_helper_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state; struct ast_crtc_state *ast_crtc_state; int ret; @@ -756,8 +758,10 @@ static const uint32_t ast_cursor_plane_formats[] = { }; static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = new_plane_state->fb; struct drm_crtc_state *crtc_state; int ret; diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index c62e930bccad..445105e75a97 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -593,8 +593,9 @@ atmel_hlcdc_plane_update_disc_area(struct atmel_hlcdc_plane *plane, } static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, - struct drm_plane_state *s) + struct drm_atomic_state *state) { + struct drm_plane_state *s = drm_atomic_get_new_plane_state(state, p); struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p); struct atmel_hlcdc_plane_state *hstate = drm_plane_state_to_atmel_hlcdc_plane_state(s); diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index bd0bb74437c7..c06bd5f43e61 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -902,7 +902,7 @@ drm_atomic_helper_check_planes(struct drm_device *dev, if (!funcs || !funcs->atomic_check) continue; - ret = funcs->atomic_check(plane, new_plane_state); + ret = funcs->atomic_check(plane, state); if (ret) { DRM_DEBUG_ATOMIC("[PLANE:%d:%s] atomic driver check failed\n", plane->base.id, plane->name); diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c index 89675d4b7b6c..a43e34e04d6b 100644 --- a/drivers/gpu/drm/drm_simple_kms_helper.c +++ b/drivers/gpu/drm/drm_simple_kms_helper.c @@ -177,8 +177,10 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = { }; static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_simple_display_pipe *pipe; struct drm_crtc_state *crtc_state; int ret; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 009a62978fbc..2c4ceb768a08 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -228,8 +228,10 @@ exynos_drm_plane_check_size(const struct exynos_drm_plane_config *config, } static int exynos_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); struct exynos_drm_plane_state *exynos_state = to_exynos_plane_state(new_plane_state); diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c index fc3ec6b4c732..7d2aa2cbcff6 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c @@ -7,6 +7,7 @@ #include +#include #include #include #include @@ -33,8 +34,10 @@ static int fsl_dcu_drm_plane_index(struct drm_plane *plane) } static int fsl_dcu_drm_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = new_plane_state->fb; if (!new_plane_state->fb || !new_plane_state->crtc) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c index d276f37d9d80..ddcf121af542 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c @@ -53,8 +53,10 @@ static const struct hibmc_dislay_pll_config hibmc_pll_table[] = { }; static int hibmc_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = new_plane_state->fb; struct drm_crtc *crtc = new_plane_state->crtc; struct drm_crtc_state *crtc_state; diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index cba99b8d9e59..fab083380ef7 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -757,8 +757,10 @@ static void ade_disable_channel(struct kirin_plane *kplane) } static int ade_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = new_plane_state->fb; struct drm_crtc *crtc = new_plane_state->crtc; struct drm_crtc_state *crtc_state; diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c index c76fce2e8cf6..0e68d295bd60 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-plane.c +++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c @@ -137,8 +137,10 @@ static bool dcss_plane_is_source_size_allowed(u16 src_w, u16 src_h, u32 pix_fmt) } static int dcss_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct dcss_plane *dcss_plane = to_dcss_plane(plane); struct dcss_dev *dcss = plane->dev->dev_private; struct drm_framebuffer *fb = new_plane_state->fb; diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 1873a155bb26..28571091ff1c 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -337,8 +337,10 @@ static const struct drm_plane_funcs ipu_plane_funcs = { }; static int ipu_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_plane_state *old_state = plane->state; struct drm_crtc_state *crtc_state; struct device *dev = plane->dev->dev; diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index f589923b4a5d..8232104e598f 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -359,8 +359,10 @@ static void ingenic_drm_crtc_atomic_flush(struct drm_crtc *crtc, } static int ingenic_drm_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct ingenic_drm *priv = drm_device_get_priv(plane->dev); struct drm_crtc_state *crtc_state; struct drm_crtc *crtc = new_plane_state->crtc ?: plane->state->crtc; diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c index 623f42d44b07..7394b0af1259 100644 --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c @@ -514,8 +514,10 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane, } static int ingenic_ipu_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); unsigned int num_w, denom_w, num_h, denom_h, xres, yres, max_w, max_h; struct ingenic_ipu *ipu = plane_to_ingenic_ipu(plane); struct drm_crtc *crtc = new_plane_state->crtc ?: plane->state->crtc; diff --git a/drivers/gpu/drm/kmb/kmb_plane.c b/drivers/gpu/drm/kmb/kmb_plane.c index 51ceaae9e7e8..909045b67b28 100644 --- a/drivers/gpu/drm/kmb/kmb_plane.c +++ b/drivers/gpu/drm/kmb/kmb_plane.c @@ -77,8 +77,10 @@ static unsigned int check_pixel_format(struct drm_plane *plane, u32 format) } static int kmb_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb; int ret; struct drm_crtc_state *crtc_state; diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index cdd2f8cfb4ab..31f1cc2085c7 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -141,8 +141,10 @@ static const struct drm_plane_funcs mtk_plane_funcs = { }; static int mtk_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = new_plane_state->fb; struct drm_crtc_state *crtc_state; int ret; diff --git a/drivers/gpu/drm/meson/meson_overlay.c b/drivers/gpu/drm/meson/meson_overlay.c index a419a8c514e1..629ca303af25 100644 --- a/drivers/gpu/drm/meson/meson_overlay.c +++ b/drivers/gpu/drm/meson/meson_overlay.c @@ -165,8 +165,10 @@ struct meson_overlay { #define FRAC_16_16(mult, div) (((mult) << 16) / (div)) static int meson_overlay_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state; if (!new_plane_state->crtc) diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index 2c1256caf48a..f8355cb2a2e1 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -71,8 +71,10 @@ struct meson_plane { #define FRAC_16_16(mult, div) (((mult) << 16) / (div)) static int meson_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state; if (!new_plane_state->crtc) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 9bce72627ff0..9945d11bb6ed 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -950,8 +951,10 @@ static bool dpu_plane_validate_src(struct drm_rect *src, } static int dpu_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); int ret = 0, min_scale; struct dpu_plane *pdpu = to_dpu_plane(plane); struct dpu_plane_state *pstate = to_dpu_plane_state(new_plane_state); diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c index da3cc1d8c331..f95b14ebfa8a 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c @@ -106,7 +106,7 @@ static void mdp4_plane_cleanup_fb(struct drm_plane *plane, static int mdp4_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *state) + struct drm_atomic_state *state) { return 0; } diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index f5434a5254e0..45f7780da901 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -404,8 +404,10 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, } static int mdp5_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc *crtc; struct drm_crtc_state *crtc_state; diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c index 3e1bb0aefb87..85b547dcf86d 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c @@ -402,8 +402,10 @@ static const struct drm_encoder_funcs mxsfb_encoder_funcs = { */ static int mxsfb_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, + plane); struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev); struct drm_crtc_state *crtc_state; diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c index f83bfc0794ab..1382ccdfe7e3 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -435,8 +436,10 @@ nv50_wndw_atomic_check_lut(struct nv50_wndw *wndw, static int nv50_wndw_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct nouveau_drm *drm = nouveau_drm(plane->dev); struct nv50_wndw *wndw = nv50_wndw(plane); struct nv50_wndw_atom *armw = nv50_wndw_atom(wndw->plane.state); diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index 53ad0744e048..6bd384c79324 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -99,8 +99,10 @@ static void omap_plane_atomic_disable(struct drm_plane *plane, } static int omap_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state; if (!new_plane_state->fb) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 9b49b6c0af08..3304fdb020b2 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -463,8 +463,10 @@ static const struct drm_crtc_helper_funcs qxl_crtc_helper_funcs = { }; static int qxl_primary_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct qxl_device *qdev = to_qxl(plane->dev); struct qxl_bo *bo; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index b887ab8fc577..7afe7442214b 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -607,8 +607,10 @@ int __rcar_du_plane_atomic_check(struct drm_plane *plane, } static int rcar_du_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct rcar_du_plane_state *rstate = to_rcar_plane_state(new_plane_state); return __rcar_du_plane_atomic_check(plane, new_plane_state, diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index f6cc1a76708a..ab82fda22b70 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -7,6 +7,7 @@ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) */ +#include #include #include #include @@ -265,8 +266,10 @@ static void rcar_du_vsp_plane_cleanup_fb(struct drm_plane *plane, } static int rcar_du_vsp_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct rcar_du_vsp_plane_state *rstate = to_rcar_vsp_plane_state(new_plane_state); return __rcar_du_plane_atomic_check(plane, new_plane_state, diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 8a507917a0dc..d96d42dfc6c7 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -778,8 +778,10 @@ static bool rockchip_mod_supported(struct drm_plane *plane, } static int vop_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc *crtc = new_plane_state->crtc; struct drm_crtc_state *crtc_state; struct drm_framebuffer *fb = new_plane_state->fb; diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c index c04c868e337f..ceb30d545ab9 100644 --- a/drivers/gpu/drm/sti/sti_cursor.c +++ b/drivers/gpu/drm/sti/sti_cursor.c @@ -181,8 +181,10 @@ static void sti_cursor_init(struct sti_cursor *cursor) } static int sti_cursor_atomic_check(struct drm_plane *drm_plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + drm_plane); struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_cursor *cursor = to_sti_cursor(plane); struct drm_crtc *crtc = new_plane_state->crtc; diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c index 4fe91ab4f191..63823827417c 100644 --- a/drivers/gpu/drm/sti/sti_gdp.c +++ b/drivers/gpu/drm/sti/sti_gdp.c @@ -615,8 +615,10 @@ static int sti_gdp_get_dst(struct device *dev, int dst, int src) } static int sti_gdp_atomic_check(struct drm_plane *drm_plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + drm_plane); struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_gdp *gdp = to_sti_gdp(plane); struct drm_crtc *crtc = new_plane_state->crtc; diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 5d492ac1f2dd..b3b10ee96bb2 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1017,8 +1017,10 @@ static void sti_hqvdp_start_xp70(struct sti_hqvdp *hqvdp) } static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + drm_plane); struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane); struct drm_crtc *crtc = new_plane_state->crtc; diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index dbd3994a18e1..7367a1e73d73 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -749,8 +749,10 @@ static const struct drm_crtc_funcs ltdc_crtc_funcs = { */ static int ltdc_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = new_plane_state->fb; u32 src_w, src_h; diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index 19ed531c006b..b5fb50e72868 100644 --- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c @@ -257,8 +257,10 @@ static int sun8i_ui_layer_update_buffer(struct sun8i_mixer *mixer, int channel, } static int sun8i_ui_layer_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane); struct drm_crtc *crtc = new_plane_state->crtc; struct drm_crtc_state *crtc_state; diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index 6074863f41c3..85c2927755a4 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -361,8 +361,10 @@ static int sun8i_vi_layer_update_buffer(struct sun8i_mixer *mixer, int channel, } static int sun8i_vi_layer_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane); struct drm_crtc *crtc = new_plane_state->crtc; struct drm_crtc_state *crtc_state; diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 2d91956bc762..bd2ee94f6f52 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -604,8 +604,10 @@ static const u64 tegra124_modifiers[] = { }; static int tegra_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct tegra_plane_state *plane_state = to_tegra_plane_state(new_plane_state); unsigned int supported_rotation = DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_X | @@ -831,8 +833,10 @@ static const u32 tegra_cursor_plane_formats[] = { }; static int tegra_cursor_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct tegra_plane *tegra = to_tegra_plane(plane); int err; diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c index 8a2d359c4ff6..e5b22508e09a 100644 --- a/drivers/gpu/drm/tegra/hub.c +++ b/drivers/gpu/drm/tegra/hub.c @@ -336,8 +336,10 @@ static void tegra_dc_remove_shared_plane(struct tegra_dc *dc, } static int tegra_shared_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct tegra_plane_state *plane_state = to_tegra_plane_state(new_plane_state); struct tegra_shared_plane *tegra = to_tegra_shared_plane(plane); struct tegra_bo_tiling *tiling = &plane_state->tiling; diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c index 6dab9ad89644..980b65725d66 100644 --- a/drivers/gpu/drm/tidss/tidss_plane.c +++ b/drivers/gpu/drm/tidss/tidss_plane.c @@ -20,8 +20,10 @@ /* drm_plane_helper_funcs */ static int tidss_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_device *ddev = plane->dev; struct tidss_device *tidss = to_tidss(ddev); struct tidss_plane *tplane = to_tidss_plane(plane); diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c index 389c80a5873c..f43670aff5ad 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c @@ -21,8 +21,10 @@ static const struct drm_plane_funcs tilcdc_plane_funcs = { }; static int tilcdc_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state; struct drm_plane_state *old_state = plane->state; unsigned int pitch; diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c index 6e4ad966be71..7140086d8308 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c @@ -253,8 +253,10 @@ static const struct drm_crtc_funcs vbox_crtc_funcs = { }; static int vbox_primary_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state = NULL; if (new_state->crtc) { @@ -326,8 +328,10 @@ static void vbox_primary_atomic_disable(struct drm_plane *plane, } static int vbox_cursor_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state = NULL; u32 width = new_state->crtc_w; u32 height = new_state->crtc_h; diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index e4b2f537967f..b46d79efa4b0 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -1040,8 +1040,10 @@ static int vc4_plane_mode_set(struct drm_plane *plane, * in the CRTC's flush. */ static int vc4_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct vc4_plane_state *vc4_state = to_vc4_plane_state(new_plane_state); int ret; diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 9b2ec4db1265..0f4fdd8c28f9 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -83,8 +83,10 @@ static const struct drm_plane_funcs virtio_gpu_plane_funcs = { }; static int virtio_gpu_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); bool is_cursor = plane->type == DRM_PLANE_TYPE_CURSOR; struct drm_crtc_state *crtc_state; int ret; diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index eef120a573a8..751695a76e26 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -114,8 +114,10 @@ static void vkms_plane_atomic_update(struct drm_plane *plane, } static int vkms_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state; bool can_position = false; int ret; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 1b0c2e44b586..5be1e4bd8a5f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -437,8 +437,10 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane, * Returns 0 on success */ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state = NULL; struct drm_framebuffer *new_fb = new_state->fb; int ret; @@ -476,8 +478,10 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, * Returns 0 on success */ int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); int ret = 0; struct drm_crtc_state *crtc_state = NULL; struct vmw_surface *surface = NULL; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h index 6267ccf54944..c5183e7eea04 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h @@ -456,9 +456,9 @@ void vmw_du_cursor_plane_destroy(struct drm_plane *plane); /* Atomic Helpers */ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *state); + struct drm_atomic_state *state); int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *state); + struct drm_atomic_state *state); void vmw_du_cursor_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state); int vmw_du_cursor_plane_prepare_fb(struct drm_plane *plane, diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index ee7793d6a26e..b0a3ba528718 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1143,8 +1143,10 @@ static inline struct zynqmp_disp_layer *plane_to_layer(struct drm_plane *plane) static int zynqmp_disp_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state; if (!new_plane_state->crtc) diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c index 78d787afe594..20ac29212991 100644 --- a/drivers/gpu/drm/zte/zx_plane.c +++ b/drivers/gpu/drm/zte/zx_plane.c @@ -46,8 +46,10 @@ static const uint32_t vl_formats[] = { #define FRAC_16_16(mult, div) (((mult) << 16) / (div)) static int zx_vl_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = plane_state->fb; struct drm_crtc *crtc = plane_state->crtc; struct drm_crtc_state *crtc_state; @@ -275,8 +277,10 @@ static const struct drm_plane_helper_funcs zx_vl_plane_helper_funcs = { }; static int zx_gl_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *plane_state) + struct drm_atomic_state *state) { + struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = plane_state->fb; struct drm_crtc *crtc = plane_state->crtc; struct drm_crtc_state *crtc_state; diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index 2b4d085da450..484f91d772ea 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -1233,9 +1233,8 @@ struct drm_plane_helper_funcs { * NOTE: * * This function is called in the check phase of an atomic update. The - * driver is not allowed to change anything outside of the free-standing - * state objects passed-in or assembled in the overall &drm_atomic_state - * update tracking structure. + * driver is not allowed to change anything outside of the + * &drm_atomic_state update tracking structure. * * RETURNS: * @@ -1245,7 +1244,7 @@ struct drm_plane_helper_funcs { * deadlock. */ int (*atomic_check)(struct drm_plane *plane, - struct drm_plane_state *state); + struct drm_atomic_state *state); /** * @atomic_update: From patchwork Fri Feb 19 12:00:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 385153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEC5EC43331 for ; Fri, 19 Feb 2021 12:02:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6537064EE7 for ; Fri, 19 Feb 2021 12:02:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230512AbhBSMCB (ORCPT ); Fri, 19 Feb 2021 07:02:01 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:41203 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbhBSMBt (ORCPT ); Fri, 19 Feb 2021 07:01:49 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 07537871; Fri, 19 Feb 2021 07:00:58 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 19 Feb 2021 07:01:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm2; bh= h9E2QPlUES6ULfpioQgIWsCnzGyq5OTzZImJ4bPasC4=; b=mKQri3025J4YPMhT X3b8f/ytvpqmSz0oJPV5OkSttG+h1ChNiIJHb624xG0Et0ph5Bm8kaMoJn0zotOs lK18mJvczke9+/SyUrQXqXqrrvzW4SskEAJooNDy6PjwET+spjtUZBXnQ/xqZUpb v8DCZo1pQ3kjEKGujtv8CHiWntRiyGY0dhY/femKxR+DInNbhh3Uk0B4E3BDui0W D2hH3jON1oB1J7seP7z6xm42I3pF7YbCUk6YlB9dVRiTolMxDRYS+pMomyGNqLv7 yR66EJYOc3SEwC4/p9tJHUjXqS97YUXdz+IrZdvZF8O3SCck5cknB+1jBsO8a6F0 Ahbq2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=h9E2QPlUES6ULfpioQgIWsCnzGyq5OTzZImJ4bPas C4=; b=sgGsH5silfm+qmgnpMn6gEZcBQE39PdCgtkg6qopyOpBo/IoJAHRgRrL8 PrJDimeppzlmoTIJO4M/Sie5iNawHBxOFghoUpMPGQiAhTQ2LxeKyYGCEjr+IDKK +zpNPiK2XBSL2Fjmheo85g9sf8WZVfEXdZZGH1OtVezdjHc4FHsGfx1j6EMa/2cY NVyssfTKNLXYGtTWoZqR/zJscf2DLQRpUJJjZWcKD6S3QYF7zwFeuvRsg1TxirBf DqsVRNt8kdpMN4napWOL9CGhxpIQEgjp/mdYfc7DraCc00z5s54EltDiumygOEJ2 7M6mG+tx/pgTGZXYZwArpAq1QumfA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjeeigdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepjeeugfegkeffgfeuvedtvddufffhjeffjeejvddvudduteehhfefhfefgeei keeknecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 05FA31080057; Fri, 19 Feb 2021 07:00:57 -0500 (EST) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie Cc: dri-devel@lists.freedesktop.org, =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Liviu Dudau , Brian Starkey , Daniel Vetter , Russell King , Dave Airlie , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , John Stultz , Xinwei Kong , Chen Feng , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Paul Cercueil , Chun-Kuang Hu , Matthias Brugger , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Rob Clark , Sean Paul , Marek Vasut , Tomi Valkeinen , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Benjamin Gaignard , Vincent Abriou , Yannick Fertre , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Jonathan Hunter , Jyri Sarha , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org Subject: [PATCH v3 08/11] drm: Rename plane->state variables in atomic update and disable Date: Fri, 19 Feb 2021 13:00:28 +0100 Message-Id: <20210219120032.260676-8-maxime@cerno.tech> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210219120032.260676-1-maxime@cerno.tech> References: <20210219120032.260676-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Some drivers are storing the plane->state pointer in atomic_update and atomic_disable in a variable simply called state, while the state passed as an argument is called old_state. In order to ease subsequent reworks and to avoid confusing or inconsistent names, let's rename those variables to new_state. This was done using the following coccinelle script, plus some manual changes for mtk and tegra. @ 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, ..., }; ) @ moves_new_state_old_state @ identifier plane_atomic_func.func; identifier plane; symbol old_state; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_state) { ... - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; ... } @ depends on moves_new_state_old_state @ identifier plane_atomic_func.func; identifier plane; identifier old_state; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_state) { <... - state + new_state ...> } @ moves_new_state_oldstate @ identifier plane_atomic_func.func; identifier plane; symbol oldstate; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *oldstate) { ... - struct drm_plane_state *state = plane->state; + struct drm_plane_state *newstate = plane->state; ... } @ depends on moves_new_state_oldstate @ identifier plane_atomic_func.func; identifier plane; identifier old_state; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_state) { <... - state + newstate ...> } @ moves_new_state_old_pstate @ identifier plane_atomic_func.func; identifier plane; symbol old_pstate; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_pstate) { ... - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_pstate = plane->state; ... } @ depends on moves_new_state_old_pstate @ identifier plane_atomic_func.func; identifier plane; identifier old_pstate; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_pstate) { <... - state + new_pstate ...> } Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard --- drivers/gpu/drm/arm/malidp_planes.c | 34 +++--- drivers/gpu/drm/armada/armada_overlay.c | 104 +++++++++--------- drivers/gpu/drm/armada/armada_plane.c | 63 +++++------ drivers/gpu/drm/ast/ast_mode.c | 30 ++--- drivers/gpu/drm/exynos/exynos_drm_plane.c | 6 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 10 +- .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 12 +- .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 11 +- drivers/gpu/drm/imx/dcss/dcss-plane.c | 25 +++-- drivers/gpu/drm/imx/ipuv3-plane.c | 45 ++++---- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 16 +-- drivers/gpu/drm/ingenic/ingenic-ipu.c | 34 +++--- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 29 +++-- drivers/gpu/drm/meson/meson_overlay.c | 6 +- drivers/gpu/drm/meson/meson_plane.c | 30 ++--- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 4 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c | 12 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 8 +- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 4 +- drivers/gpu/drm/omapdrm/omap_plane.c | 21 ++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 20 ++-- drivers/gpu/drm/sti/sti_cursor.c | 10 +- drivers/gpu/drm/sti/sti_gdp.c | 40 +++---- drivers/gpu/drm/sti/sti_hqvdp.c | 40 +++---- drivers/gpu/drm/stm/ltdc.c | 28 ++--- drivers/gpu/drm/tegra/dc.c | 20 ++-- drivers/gpu/drm/tegra/hub.c | 10 +- drivers/gpu/drm/tidss/tidss_plane.c | 8 +- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 14 +-- drivers/gpu/drm/zte/zx_plane.c | 8 +- 30 files changed, 355 insertions(+), 347 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index c94c4a96db68..646b27a42452 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -795,9 +795,9 @@ static void malidp_de_plane_update(struct drm_plane *plane, { struct malidp_plane *mp; struct malidp_plane_state *ms = to_malidp_plane_state(plane->state); - struct drm_plane_state *state = plane->state; - u16 pixel_alpha = state->pixel_blend_mode; - u8 plane_alpha = state->alpha >> 8; + struct drm_plane_state *new_state = plane->state; + u16 pixel_alpha = new_state->pixel_blend_mode; + u8 plane_alpha = new_state->alpha >> 8; u32 src_w, src_h, dest_w, dest_h, val; int i; struct drm_framebuffer *fb = plane->state->fb; @@ -813,12 +813,12 @@ static void malidp_de_plane_update(struct drm_plane *plane, src_h = fb->height; } else { /* convert src values from Q16 fixed point to integer */ - src_w = state->src_w >> 16; - src_h = state->src_h >> 16; + src_w = new_state->src_w >> 16; + src_h = new_state->src_h >> 16; } - dest_w = state->crtc_w; - dest_h = state->crtc_h; + dest_w = new_state->crtc_w; + dest_h = new_state->crtc_h; val = malidp_hw_read(mp->hwdev, mp->layer->base); val = (val & ~LAYER_FORMAT_MASK) | ms->format; @@ -830,7 +830,7 @@ static void malidp_de_plane_update(struct drm_plane *plane, malidp_de_set_mmu_control(mp, ms); malidp_de_set_plane_pitches(mp, ms->n_planes, - state->fb->pitches); + new_state->fb->pitches); if ((plane->state->color_encoding != old_state->color_encoding) || (plane->state->color_range != old_state->color_range)) @@ -843,8 +843,8 @@ static void malidp_de_plane_update(struct drm_plane *plane, malidp_hw_write(mp->hwdev, LAYER_H_VAL(dest_w) | LAYER_V_VAL(dest_h), mp->layer->base + MALIDP_LAYER_COMP_SIZE); - malidp_hw_write(mp->hwdev, LAYER_H_VAL(state->crtc_x) | - LAYER_V_VAL(state->crtc_y), + malidp_hw_write(mp->hwdev, LAYER_H_VAL(new_state->crtc_x) | + LAYER_V_VAL(new_state->crtc_y), mp->layer->base + MALIDP_LAYER_OFFSET); if (mp->layer->id == DE_SMART) { @@ -866,19 +866,19 @@ static void malidp_de_plane_update(struct drm_plane *plane, val &= ~LAYER_ROT_MASK; /* setup the rotation and axis flip bits */ - if (state->rotation & DRM_MODE_ROTATE_MASK) + if (new_state->rotation & DRM_MODE_ROTATE_MASK) val |= ilog2(plane->state->rotation & DRM_MODE_ROTATE_MASK) << LAYER_ROT_OFFSET; - if (state->rotation & DRM_MODE_REFLECT_X) + if (new_state->rotation & DRM_MODE_REFLECT_X) val |= LAYER_H_FLIP; - if (state->rotation & DRM_MODE_REFLECT_Y) + if (new_state->rotation & DRM_MODE_REFLECT_Y) val |= LAYER_V_FLIP; val &= ~(LAYER_COMP_MASK | LAYER_PMUL_ENABLE | LAYER_ALPHA(0xff)); - if (state->alpha != DRM_BLEND_ALPHA_OPAQUE) { + if (new_state->alpha != DRM_BLEND_ALPHA_OPAQUE) { val |= LAYER_COMP_PLANE; - } else if (state->fb->format->has_alpha) { + } else if (new_state->fb->format->has_alpha) { /* We only care about blend mode if the format has alpha */ switch (pixel_alpha) { case DRM_MODE_BLEND_PREMULTI: @@ -892,9 +892,9 @@ static void malidp_de_plane_update(struct drm_plane *plane, val |= LAYER_ALPHA(plane_alpha); val &= ~LAYER_FLOWCFG(LAYER_FLOWCFG_MASK); - if (state->crtc) { + if (new_state->crtc) { struct malidp_crtc_state *m = - to_malidp_crtc_state(state->crtc->state); + to_malidp_crtc_state(new_state->crtc->state); if (m->scaler_config.scale_enable && m->scaler_config.plane_src_id == mp->layer->id) diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 6346b890279a..f5e75c96b476 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -68,7 +68,7 @@ static inline u32 armada_csc(struct drm_plane_state *state) static void armada_drm_overlay_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; struct armada_crtc *dcrtc; struct armada_regs *regs; unsigned int idx; @@ -76,62 +76,64 @@ static void armada_drm_overlay_plane_atomic_update(struct drm_plane *plane, DRM_DEBUG_KMS("[PLANE:%d:%s]\n", plane->base.id, plane->name); - if (!state->fb || WARN_ON(!state->crtc)) + if (!new_state->fb || WARN_ON(!new_state->crtc)) return; DRM_DEBUG_KMS("[PLANE:%d:%s] is on [CRTC:%d:%s] with [FB:%d] visible %u->%u\n", plane->base.id, plane->name, - state->crtc->base.id, state->crtc->name, - state->fb->base.id, - old_state->visible, state->visible); + new_state->crtc->base.id, new_state->crtc->name, + new_state->fb->base.id, + old_state->visible, new_state->visible); - dcrtc = drm_to_armada_crtc(state->crtc); + dcrtc = drm_to_armada_crtc(new_state->crtc); regs = dcrtc->regs + dcrtc->regs_idx; idx = 0; - if (!old_state->visible && state->visible) + if (!old_state->visible && new_state->visible) armada_reg_queue_mod(regs, idx, 0, CFG_PDWN16x66 | CFG_PDWN32x66, LCD_SPU_SRAM_PARA1); - val = armada_src_hw(state); + val = armada_src_hw(new_state); if (armada_src_hw(old_state) != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_DMA_HPXL_VLN); - val = armada_dst_yx(state); + val = armada_dst_yx(new_state); if (armada_dst_yx(old_state) != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_DMA_OVSA_HPXL_VLN); - val = armada_dst_hw(state); + val = armada_dst_hw(new_state); if (armada_dst_hw(old_state) != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_DZM_HPXL_VLN); /* FIXME: overlay on an interlaced display */ - if (old_state->src.x1 != state->src.x1 || - old_state->src.y1 != state->src.y1 || - old_state->fb != state->fb || - state->crtc->state->mode_changed) { + if (old_state->src.x1 != new_state->src.x1 || + old_state->src.y1 != new_state->src.y1 || + old_state->fb != new_state->fb || + new_state->crtc->state->mode_changed) { const struct drm_format_info *format; u16 src_x; - armada_reg_queue_set(regs, idx, armada_addr(state, 0, 0), + armada_reg_queue_set(regs, idx, armada_addr(new_state, 0, 0), LCD_SPU_DMA_START_ADDR_Y0); - armada_reg_queue_set(regs, idx, armada_addr(state, 0, 1), + armada_reg_queue_set(regs, idx, armada_addr(new_state, 0, 1), LCD_SPU_DMA_START_ADDR_U0); - armada_reg_queue_set(regs, idx, armada_addr(state, 0, 2), + armada_reg_queue_set(regs, idx, armada_addr(new_state, 0, 2), LCD_SPU_DMA_START_ADDR_V0); - armada_reg_queue_set(regs, idx, armada_addr(state, 1, 0), + armada_reg_queue_set(regs, idx, armada_addr(new_state, 1, 0), LCD_SPU_DMA_START_ADDR_Y1); - armada_reg_queue_set(regs, idx, armada_addr(state, 1, 1), + armada_reg_queue_set(regs, idx, armada_addr(new_state, 1, 1), LCD_SPU_DMA_START_ADDR_U1); - armada_reg_queue_set(regs, idx, armada_addr(state, 1, 2), + armada_reg_queue_set(regs, idx, armada_addr(new_state, 1, 2), LCD_SPU_DMA_START_ADDR_V1); - val = armada_pitch(state, 0) << 16 | armada_pitch(state, 0); + val = armada_pitch(new_state, 0) << 16 | armada_pitch(new_state, + 0); armada_reg_queue_set(regs, idx, val, LCD_SPU_DMA_PITCH_YC); - val = armada_pitch(state, 1) << 16 | armada_pitch(state, 2); + val = armada_pitch(new_state, 1) << 16 | armada_pitch(new_state, + 2); armada_reg_queue_set(regs, idx, val, LCD_SPU_DMA_PITCH_UV); - cfg = CFG_DMA_FMT(drm_fb_to_armada_fb(state->fb)->fmt) | - CFG_DMA_MOD(drm_fb_to_armada_fb(state->fb)->mod) | + cfg = CFG_DMA_FMT(drm_fb_to_armada_fb(new_state->fb)->fmt) | + CFG_DMA_MOD(drm_fb_to_armada_fb(new_state->fb)->mod) | CFG_CBSH_ENA; - if (state->visible) + if (new_state->visible) cfg |= CFG_DMA_ENA; /* @@ -139,28 +141,28 @@ static void armada_drm_overlay_plane_atomic_update(struct drm_plane *plane, * U/V planes to swap. Compensate for it by also toggling * the UV swap. */ - format = state->fb->format; - src_x = state->src.x1 >> 16; + format = new_state->fb->format; + src_x = new_state->src.x1 >> 16; if (format->num_planes == 1 && src_x & (format->hsub - 1)) cfg ^= CFG_DMA_MOD(CFG_SWAPUV); - if (to_armada_plane_state(state)->interlace) + if (to_armada_plane_state(new_state)->interlace) cfg |= CFG_DMA_FTOGGLE; cfg_mask = CFG_CBSH_ENA | CFG_DMAFORMAT | CFG_DMA_MOD(CFG_SWAPRB | CFG_SWAPUV | CFG_SWAPYU | CFG_YUV2RGB) | CFG_DMA_FTOGGLE | CFG_DMA_TSTMODE | CFG_DMA_ENA; - } else if (old_state->visible != state->visible) { - cfg = state->visible ? CFG_DMA_ENA : 0; + } else if (old_state->visible != new_state->visible) { + cfg = new_state->visible ? CFG_DMA_ENA : 0; cfg_mask = CFG_DMA_ENA; } else { cfg = cfg_mask = 0; } - if (drm_rect_width(&old_state->src) != drm_rect_width(&state->src) || - drm_rect_width(&old_state->dst) != drm_rect_width(&state->dst)) { + if (drm_rect_width(&old_state->src) != drm_rect_width(&new_state->src) || + drm_rect_width(&old_state->dst) != drm_rect_width(&new_state->dst)) { cfg_mask |= CFG_DMA_HSMOOTH; - if (drm_rect_width(&state->src) >> 16 != - drm_rect_width(&state->dst)) + if (drm_rect_width(&new_state->src) >> 16 != + drm_rect_width(&new_state->dst)) cfg |= CFG_DMA_HSMOOTH; } @@ -168,41 +170,41 @@ static void armada_drm_overlay_plane_atomic_update(struct drm_plane *plane, armada_reg_queue_mod(regs, idx, cfg, cfg_mask, LCD_SPU_DMA_CTRL0); - val = armada_spu_contrast(state); - if ((!old_state->visible && state->visible) || + val = armada_spu_contrast(new_state); + if ((!old_state->visible && new_state->visible) || armada_spu_contrast(old_state) != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_CONTRAST); - val = armada_spu_saturation(state); - if ((!old_state->visible && state->visible) || + val = armada_spu_saturation(new_state); + if ((!old_state->visible && new_state->visible) || armada_spu_saturation(old_state) != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_SATURATION); - if (!old_state->visible && state->visible) + if (!old_state->visible && new_state->visible) armada_reg_queue_set(regs, idx, 0x00002000, LCD_SPU_CBSH_HUE); - val = armada_csc(state); - if ((!old_state->visible && state->visible) || + val = armada_csc(new_state); + if ((!old_state->visible && new_state->visible) || armada_csc(old_state) != val) armada_reg_queue_mod(regs, idx, val, CFG_CSC_MASK, LCD_SPU_IOPAD_CONTROL); - val = drm_to_overlay_state(state)->colorkey_yr; - if ((!old_state->visible && state->visible) || + val = drm_to_overlay_state(new_state)->colorkey_yr; + if ((!old_state->visible && new_state->visible) || drm_to_overlay_state(old_state)->colorkey_yr != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_COLORKEY_Y); - val = drm_to_overlay_state(state)->colorkey_ug; - if ((!old_state->visible && state->visible) || + val = drm_to_overlay_state(new_state)->colorkey_ug; + if ((!old_state->visible && new_state->visible) || drm_to_overlay_state(old_state)->colorkey_ug != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_COLORKEY_U); - val = drm_to_overlay_state(state)->colorkey_vb; - if ((!old_state->visible && state->visible) || + val = drm_to_overlay_state(new_state)->colorkey_vb; + if ((!old_state->visible && new_state->visible) || drm_to_overlay_state(old_state)->colorkey_vb != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_COLORKEY_V); - val = drm_to_overlay_state(state)->colorkey_mode; - if ((!old_state->visible && state->visible) || + val = drm_to_overlay_state(new_state)->colorkey_mode; + if ((!old_state->visible && new_state->visible) || drm_to_overlay_state(old_state)->colorkey_mode != val) armada_reg_queue_mod(regs, idx, val, CFG_CKMODE_MASK | CFG_ALPHAM_MASK | CFG_ALPHA_MASK, LCD_SPU_DMA_CTRL1); - val = drm_to_overlay_state(state)->colorkey_enable; - if (((!old_state->visible && state->visible) || + val = drm_to_overlay_state(new_state)->colorkey_enable; + if (((!old_state->visible && new_state->visible) || drm_to_overlay_state(old_state)->colorkey_enable != val) && dcrtc->variant->has_spu_adv_reg) armada_reg_queue_mod(regs, idx, val, ADV_GRACOLORKEY | diff --git a/drivers/gpu/drm/armada/armada_plane.c b/drivers/gpu/drm/armada/armada_plane.c index 51f33c689df3..3be7b3cfd251 100644 --- a/drivers/gpu/drm/armada/armada_plane.c +++ b/drivers/gpu/drm/armada/armada_plane.c @@ -163,7 +163,7 @@ int armada_drm_plane_atomic_check(struct drm_plane *plane, static void armada_drm_primary_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; struct armada_crtc *dcrtc; struct armada_regs *regs; u32 cfg, cfg_mask, val; @@ -171,71 +171,72 @@ static void armada_drm_primary_plane_atomic_update(struct drm_plane *plane, DRM_DEBUG_KMS("[PLANE:%d:%s]\n", plane->base.id, plane->name); - if (!state->fb || WARN_ON(!state->crtc)) + if (!new_state->fb || WARN_ON(!new_state->crtc)) return; DRM_DEBUG_KMS("[PLANE:%d:%s] is on [CRTC:%d:%s] with [FB:%d] visible %u->%u\n", plane->base.id, plane->name, - state->crtc->base.id, state->crtc->name, - state->fb->base.id, - old_state->visible, state->visible); + new_state->crtc->base.id, new_state->crtc->name, + new_state->fb->base.id, + old_state->visible, new_state->visible); - dcrtc = drm_to_armada_crtc(state->crtc); + dcrtc = drm_to_armada_crtc(new_state->crtc); regs = dcrtc->regs + dcrtc->regs_idx; idx = 0; - if (!old_state->visible && state->visible) { + if (!old_state->visible && new_state->visible) { val = CFG_PDWN64x66; - if (drm_fb_to_armada_fb(state->fb)->fmt > CFG_420) + if (drm_fb_to_armada_fb(new_state->fb)->fmt > CFG_420) val |= CFG_PDWN256x24; armada_reg_queue_mod(regs, idx, 0, val, LCD_SPU_SRAM_PARA1); } - val = armada_src_hw(state); + val = armada_src_hw(new_state); if (armada_src_hw(old_state) != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_GRA_HPXL_VLN); - val = armada_dst_yx(state); + val = armada_dst_yx(new_state); if (armada_dst_yx(old_state) != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_GRA_OVSA_HPXL_VLN); - val = armada_dst_hw(state); + val = armada_dst_hw(new_state); if (armada_dst_hw(old_state) != val) armada_reg_queue_set(regs, idx, val, LCD_SPU_GZM_HPXL_VLN); - if (old_state->src.x1 != state->src.x1 || - old_state->src.y1 != state->src.y1 || - old_state->fb != state->fb || - state->crtc->state->mode_changed) { - armada_reg_queue_set(regs, idx, armada_addr(state, 0, 0), + if (old_state->src.x1 != new_state->src.x1 || + old_state->src.y1 != new_state->src.y1 || + old_state->fb != new_state->fb || + new_state->crtc->state->mode_changed) { + armada_reg_queue_set(regs, idx, armada_addr(new_state, 0, 0), LCD_CFG_GRA_START_ADDR0); - armada_reg_queue_set(regs, idx, armada_addr(state, 1, 0), + armada_reg_queue_set(regs, idx, armada_addr(new_state, 1, 0), LCD_CFG_GRA_START_ADDR1); - armada_reg_queue_mod(regs, idx, armada_pitch(state, 0), 0xffff, + armada_reg_queue_mod(regs, idx, armada_pitch(new_state, 0), + 0xffff, LCD_CFG_GRA_PITCH); } - if (old_state->fb != state->fb || - state->crtc->state->mode_changed) { - cfg = CFG_GRA_FMT(drm_fb_to_armada_fb(state->fb)->fmt) | - CFG_GRA_MOD(drm_fb_to_armada_fb(state->fb)->mod); - if (drm_fb_to_armada_fb(state->fb)->fmt > CFG_420) + if (old_state->fb != new_state->fb || + new_state->crtc->state->mode_changed) { + cfg = CFG_GRA_FMT(drm_fb_to_armada_fb(new_state->fb)->fmt) | + CFG_GRA_MOD(drm_fb_to_armada_fb(new_state->fb)->mod); + if (drm_fb_to_armada_fb(new_state->fb)->fmt > CFG_420) cfg |= CFG_PALETTE_ENA; - if (state->visible) + if (new_state->visible) cfg |= CFG_GRA_ENA; - if (to_armada_plane_state(state)->interlace) + if (to_armada_plane_state(new_state)->interlace) cfg |= CFG_GRA_FTOGGLE; cfg_mask = CFG_GRAFORMAT | CFG_GRA_MOD(CFG_SWAPRB | CFG_SWAPUV | CFG_SWAPYU | CFG_YUV2RGB) | CFG_PALETTE_ENA | CFG_GRA_FTOGGLE | CFG_GRA_ENA; - } else if (old_state->visible != state->visible) { - cfg = state->visible ? CFG_GRA_ENA : 0; + } else if (old_state->visible != new_state->visible) { + cfg = new_state->visible ? CFG_GRA_ENA : 0; cfg_mask = CFG_GRA_ENA; } else { cfg = cfg_mask = 0; } - if (drm_rect_width(&old_state->src) != drm_rect_width(&state->src) || - drm_rect_width(&old_state->dst) != drm_rect_width(&state->dst)) { + if (drm_rect_width(&old_state->src) != drm_rect_width(&new_state->src) || + drm_rect_width(&old_state->dst) != drm_rect_width(&new_state->dst)) { cfg_mask |= CFG_GRA_HSMOOTH; - if (drm_rect_width(&state->src) >> 16 != - drm_rect_width(&state->dst)) + if (drm_rect_width(&new_state->src) >> 16 != + drm_rect_width(&new_state->dst)) cfg |= CFG_GRA_HSMOOTH; } diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index d3c4a1f6aede..94950e0e338a 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -573,14 +573,14 @@ ast_primary_plane_helper_atomic_update(struct drm_plane *plane, { struct drm_device *dev = plane->dev; struct ast_private *ast = to_ast_private(dev); - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; struct drm_gem_vram_object *gbo; s64 gpu_addr; - struct drm_framebuffer *fb = state->fb; + struct drm_framebuffer *fb = new_state->fb; struct drm_framebuffer *old_fb = old_state->fb; if (!old_fb || (fb->format != old_fb->format)) { - struct drm_crtc_state *crtc_state = state->crtc->state; + struct drm_crtc_state *crtc_state = new_state->crtc->state; struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state); struct ast_vbios_mode_info *vbios_mode_info = &ast_crtc_state->vbios_mode_info; @@ -793,9 +793,9 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane); - struct drm_plane_state *state = plane->state; - struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state); - struct drm_framebuffer *fb = state->fb; + struct drm_plane_state *new_state = plane->state; + struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(new_state); + struct drm_framebuffer *fb = new_state->fb; struct ast_private *ast = to_ast_private(plane->dev); struct dma_buf_map dst_map = ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map; @@ -820,7 +820,7 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane, ast_update_cursor_image(dst, src, fb->width, fb->height); - if (state->fb != old_state->fb) { + if (new_state->fb != old_state->fb) { ast_set_cursor_base(ast, dst_off); ++ast_cursor_plane->next_hwc_index; @@ -831,25 +831,25 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane, * Update location in HWC signature and registers. */ - writel(state->crtc_x, sig + AST_HWC_SIGNATURE_X); - writel(state->crtc_y, sig + AST_HWC_SIGNATURE_Y); + writel(new_state->crtc_x, sig + AST_HWC_SIGNATURE_X); + writel(new_state->crtc_y, sig + AST_HWC_SIGNATURE_Y); offset_x = AST_MAX_HWC_WIDTH - fb->width; offset_y = AST_MAX_HWC_HEIGHT - fb->height; - if (state->crtc_x < 0) { - x_offset = (-state->crtc_x) + offset_x; + if (new_state->crtc_x < 0) { + x_offset = (-new_state->crtc_x) + offset_x; x = 0; } else { x_offset = offset_x; - x = state->crtc_x; + x = new_state->crtc_x; } - if (state->crtc_y < 0) { - y_offset = (-state->crtc_y) + offset_y; + if (new_state->crtc_y < 0) { + y_offset = (-new_state->crtc_y) + offset_y; y = 0; } else { y_offset = offset_y; - y = state->crtc_y; + y = new_state->crtc_y; } ast_set_cursor_location(ast, x, y, x_offset, y_offset); diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 2c4ceb768a08..673f8a1d9010 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -254,11 +254,11 @@ static int exynos_plane_atomic_check(struct drm_plane *plane, static void exynos_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; - struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(state->crtc); + struct drm_plane_state *new_state = plane->state; + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(new_state->crtc); struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); - if (!state->crtc) + if (!new_state->crtc) return; if (exynos_crtc->ops->update_plane) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c index 7d2aa2cbcff6..4272e121a185 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c @@ -80,7 +80,7 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane, { struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private; - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; struct drm_framebuffer *fb = plane->state->fb; struct drm_gem_cma_object *gem; unsigned int alpha = DCU_LAYER_AB_NONE, bpp; @@ -128,11 +128,11 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane, } regmap_write(fsl_dev->regmap, DCU_CTRLDESCLN(index, 1), - DCU_LAYER_HEIGHT(state->crtc_h) | - DCU_LAYER_WIDTH(state->crtc_w)); + DCU_LAYER_HEIGHT(new_state->crtc_h) | + DCU_LAYER_WIDTH(new_state->crtc_w)); regmap_write(fsl_dev->regmap, DCU_CTRLDESCLN(index, 2), - DCU_LAYER_POSY(state->crtc_y) | - DCU_LAYER_POSX(state->crtc_x)); + DCU_LAYER_POSY(new_state->crtc_y) | + DCU_LAYER_POSX(new_state->crtc_x)); regmap_write(fsl_dev->regmap, DCU_CTRLDESCLN(index, 3), gem->paddr); regmap_write(fsl_dev->regmap, DCU_CTRLDESCLN(index, 4), diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c index 3f7027e40c79..a4b54e841c76 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c @@ -101,17 +101,17 @@ static int hibmc_plane_atomic_check(struct drm_plane *plane, static void hibmc_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; u32 reg; s64 gpu_addr = 0; u32 line_l; struct hibmc_drm_private *priv = to_hibmc_drm_private(plane->dev); struct drm_gem_vram_object *gbo; - if (!state->fb) + if (!new_state->fb) return; - gbo = drm_gem_vram_of_gem(state->fb->obj[0]); + gbo = drm_gem_vram_of_gem(new_state->fb->obj[0]); gpu_addr = drm_gem_vram_offset(gbo); if (WARN_ON_ONCE(gpu_addr < 0)) @@ -119,9 +119,9 @@ static void hibmc_plane_atomic_update(struct drm_plane *plane, writel(gpu_addr, priv->mmio + HIBMC_CRT_FB_ADDRESS); - reg = state->fb->width * (state->fb->format->cpp[0]); + reg = new_state->fb->width * (new_state->fb->format->cpp[0]); - line_l = state->fb->pitches[0]; + line_l = new_state->fb->pitches[0]; writel(HIBMC_FIELD(HIBMC_CRT_FB_WIDTH_WIDTH, reg) | HIBMC_FIELD(HIBMC_CRT_FB_WIDTH_OFFS, line_l), priv->mmio + HIBMC_CRT_FB_WIDTH); @@ -130,7 +130,7 @@ static void hibmc_plane_atomic_update(struct drm_plane *plane, reg = readl(priv->mmio + HIBMC_CRT_DISP_CTL); reg &= ~HIBMC_CRT_DISP_CTL_FORMAT_MASK; reg |= HIBMC_FIELD(HIBMC_CRT_DISP_CTL_FORMAT, - state->fb->format->cpp[0] * 8 / 16); + new_state->fb->format->cpp[0] * 8 / 16); writel(reg, priv->mmio + HIBMC_CRT_DISP_CTL); } diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 320631cb7034..19416d9be46b 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -806,13 +806,14 @@ static int ade_plane_atomic_check(struct drm_plane *plane, static void ade_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; struct kirin_plane *kplane = to_kirin_plane(plane); - ade_update_channel(kplane, state->fb, state->crtc_x, state->crtc_y, - state->crtc_w, state->crtc_h, - state->src_x >> 16, state->src_y >> 16, - state->src_w >> 16, state->src_h >> 16); + ade_update_channel(kplane, new_state->fb, new_state->crtc_x, + new_state->crtc_y, + new_state->crtc_w, new_state->crtc_h, + new_state->src_x >> 16, new_state->src_y >> 16, + new_state->src_w >> 16, new_state->src_h >> 16); } static void ade_plane_atomic_disable(struct drm_plane *plane, diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c index 35a7b23060b3..06ecfff8d3c3 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-plane.c +++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c @@ -266,10 +266,10 @@ static bool dcss_plane_needs_setup(struct drm_plane_state *state, static void dcss_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; struct dcss_plane *dcss_plane = to_dcss_plane(plane); struct dcss_dev *dcss = plane->dev->dev_private; - struct drm_framebuffer *fb = state->fb; + struct drm_framebuffer *fb = new_state->fb; struct drm_crtc_state *crtc_state; bool modifiers_present; u32 src_w, src_h, dst_w, dst_h; @@ -277,14 +277,14 @@ static void dcss_plane_atomic_update(struct drm_plane *plane, bool enable = true; bool is_rotation_90_or_270; - if (!fb || !state->crtc || !state->visible) + if (!fb || !new_state->crtc || !new_state->visible) return; - crtc_state = state->crtc->state; + crtc_state = new_state->crtc->state; modifiers_present = !!(fb->flags & DRM_MODE_FB_MODIFIERS); if (old_state->fb && !drm_atomic_crtc_needs_modeset(crtc_state) && - !dcss_plane_needs_setup(state, old_state)) { + !dcss_plane_needs_setup(new_state, old_state)) { dcss_plane_atomic_set_base(dcss_plane); return; } @@ -304,23 +304,24 @@ static void dcss_plane_atomic_update(struct drm_plane *plane, modifiers_present && fb->modifier == DRM_FORMAT_MOD_LINEAR) modifiers_present = false; - dcss_dpr_format_set(dcss->dpr, dcss_plane->ch_num, state->fb->format, + dcss_dpr_format_set(dcss->dpr, dcss_plane->ch_num, + new_state->fb->format, modifiers_present ? fb->modifier : DRM_FORMAT_MOD_LINEAR); dcss_dpr_set_res(dcss->dpr, dcss_plane->ch_num, src_w, src_h); dcss_dpr_set_rotation(dcss->dpr, dcss_plane->ch_num, - state->rotation); + new_state->rotation); dcss_plane_atomic_set_base(dcss_plane); - is_rotation_90_or_270 = state->rotation & (DRM_MODE_ROTATE_90 | + is_rotation_90_or_270 = new_state->rotation & (DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270); dcss_scaler_set_filter(dcss->scaler, dcss_plane->ch_num, - state->scaling_filter); + new_state->scaling_filter); dcss_scaler_setup(dcss->scaler, dcss_plane->ch_num, - state->fb->format, + new_state->fb->format, is_rotation_90_or_270 ? src_h : src_w, is_rotation_90_or_270 ? src_w : src_h, dst_w, dst_h, @@ -329,9 +330,9 @@ static void dcss_plane_atomic_update(struct drm_plane *plane, dcss_dtg_plane_pos_set(dcss->dtg, dcss_plane->ch_num, dst.x1, dst.y1, dst_w, dst_h); dcss_dtg_plane_alpha_set(dcss->dtg, dcss_plane->ch_num, - fb->format, state->alpha >> 8); + fb->format, new_state->alpha >> 8); - if (!dcss_plane->ch_num && (state->alpha >> 8) == 0) + if (!dcss_plane->ch_num && (new_state->alpha >> 8) == 0) enable = false; dcss_dpr_enable(dcss->dpr, dcss_plane->ch_num, enable); diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 6484592e3f86..0dd10aec8194 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -542,11 +542,11 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct ipu_plane *ipu_plane = to_ipu_plane(plane); - struct drm_plane_state *state = plane->state; - struct ipu_plane_state *ipu_state = to_ipu_plane_state(state); - struct drm_crtc_state *crtc_state = state->crtc->state; - struct drm_framebuffer *fb = state->fb; - struct drm_rect *dst = &state->dst; + struct drm_plane_state *new_state = plane->state; + struct ipu_plane_state *ipu_state = to_ipu_plane_state(new_state); + struct drm_crtc_state *crtc_state = new_state->crtc->state; + struct drm_framebuffer *fb = new_state->fb; + struct drm_rect *dst = &new_state->dst; unsigned long eba, ubo, vbo; unsigned long alpha_eba = 0; enum ipu_color_space ics; @@ -561,7 +561,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, switch (ipu_plane->dp_flow) { case IPU_DP_FLOW_SYNC_BG: - if (state->normalized_zpos == 1) { + if (new_state->normalized_zpos == 1) { ipu_dp_set_global_alpha(ipu_plane->dp, !fb->format->has_alpha, 0xff, true); @@ -570,7 +570,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, } break; case IPU_DP_FLOW_SYNC_FG: - if (state->normalized_zpos == 1) { + if (new_state->normalized_zpos == 1) { ipu_dp_set_global_alpha(ipu_plane->dp, !fb->format->has_alpha, 0xff, false); @@ -578,7 +578,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, break; } - eba = drm_plane_state_to_eba(state, 0); + eba = drm_plane_state_to_eba(new_state, 0); /* * Configure PRG channel and attached PRE, this changes the EBA to an @@ -587,8 +587,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, if (ipu_state->use_pre) { axi_id = ipu_chan_assign_axi_id(ipu_plane->dma); ipu_prg_channel_configure(ipu_plane->ipu_ch, axi_id, - drm_rect_width(&state->src) >> 16, - drm_rect_height(&state->src) >> 16, + drm_rect_width(&new_state->src) >> 16, + drm_rect_height(&new_state->src) >> 16, fb->pitches[0], fb->format->format, fb->modifier, &eba); } @@ -622,8 +622,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, ipu_dmfc_config_wait4eot(ipu_plane->dmfc, drm_rect_width(dst)); - width = drm_rect_width(&state->src) >> 16; - height = drm_rect_height(&state->src) >> 16; + width = drm_rect_width(&new_state->src) >> 16; + height = drm_rect_height(&new_state->src) >> 16; info = drm_format_info(fb->format->format); ipu_calculate_bursts(width, info->cpp[0], fb->pitches[0], &burstsize, &num_bursts); @@ -645,8 +645,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, case DRM_FORMAT_YVU422: case DRM_FORMAT_YUV444: case DRM_FORMAT_YVU444: - ubo = drm_plane_state_to_ubo(state); - vbo = drm_plane_state_to_vbo(state); + ubo = drm_plane_state_to_ubo(new_state); + vbo = drm_plane_state_to_vbo(new_state); if (fb->format->format == DRM_FORMAT_YVU420 || fb->format->format == DRM_FORMAT_YVU422 || fb->format->format == DRM_FORMAT_YVU444) @@ -657,18 +657,18 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, dev_dbg(ipu_plane->base.dev->dev, "phy = %lu %lu %lu, x = %d, y = %d", eba, ubo, vbo, - state->src.x1 >> 16, state->src.y1 >> 16); + new_state->src.x1 >> 16, new_state->src.y1 >> 16); break; case DRM_FORMAT_NV12: case DRM_FORMAT_NV16: - ubo = drm_plane_state_to_ubo(state); + ubo = drm_plane_state_to_ubo(new_state); ipu_cpmem_set_yuv_planar_full(ipu_plane->ipu_ch, fb->pitches[1], ubo, ubo); dev_dbg(ipu_plane->base.dev->dev, "phy = %lu %lu, x = %d, y = %d", eba, ubo, - state->src.x1 >> 16, state->src.y1 >> 16); + new_state->src.x1 >> 16, new_state->src.y1 >> 16); break; case DRM_FORMAT_RGB565_A8: case DRM_FORMAT_BGR565_A8: @@ -676,18 +676,19 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, case DRM_FORMAT_BGR888_A8: case DRM_FORMAT_RGBX8888_A8: case DRM_FORMAT_BGRX8888_A8: - alpha_eba = drm_plane_state_to_eba(state, 1); + alpha_eba = drm_plane_state_to_eba(new_state, 1); num_bursts = 0; dev_dbg(ipu_plane->base.dev->dev, "phys = %lu %lu, x = %d, y = %d", - eba, alpha_eba, state->src.x1 >> 16, state->src.y1 >> 16); + eba, alpha_eba, new_state->src.x1 >> 16, + new_state->src.y1 >> 16); ipu_cpmem_set_burstsize(ipu_plane->ipu_ch, 16); ipu_cpmem_zero(ipu_plane->alpha_ch); ipu_cpmem_set_resolution(ipu_plane->alpha_ch, - drm_rect_width(&state->src) >> 16, - drm_rect_height(&state->src) >> 16); + drm_rect_width(&new_state->src) >> 16, + drm_rect_height(&new_state->src) >> 16); ipu_cpmem_set_format_passthrough(ipu_plane->alpha_ch, 8); ipu_cpmem_set_high_priority(ipu_plane->alpha_ch); ipu_idmac_set_double_buffer(ipu_plane->alpha_ch, 1); @@ -698,7 +699,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, break; default: dev_dbg(ipu_plane->base.dev->dev, "phys = %lu, x = %d, y = %d", - eba, state->src.x1 >> 16, state->src.y1 >> 16); + eba, new_state->src.x1 >> 16, new_state->src.y1 >> 16); break; } ipu_cpmem_set_buffer(ipu_plane->ipu_ch, 0, eba); diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index c022d9f1e737..1a336e922dc7 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -544,20 +544,20 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *oldstate) { struct ingenic_drm *priv = drm_device_get_priv(plane->dev); - struct drm_plane_state *state = plane->state; + struct drm_plane_state *newstate = plane->state; struct drm_crtc_state *crtc_state; struct ingenic_dma_hwdesc *hwdesc; unsigned int width, height, cpp, offset; dma_addr_t addr; u32 fourcc; - if (state && state->fb) { - crtc_state = state->crtc->state; + if (newstate && newstate->fb) { + crtc_state = newstate->crtc->state; - addr = drm_fb_cma_get_gem_addr(state->fb, state, 0); - width = state->src_w >> 16; - height = state->src_h >> 16; - cpp = state->fb->format->cpp[0]; + addr = drm_fb_cma_get_gem_addr(newstate->fb, newstate, 0); + width = newstate->src_w >> 16; + height = newstate->src_h >> 16; + cpp = newstate->fb->format->cpp[0]; if (priv->soc_info->has_osd && plane->type == DRM_PLANE_TYPE_OVERLAY) hwdesc = &priv->dma_hwdescs->hwdesc_f0; @@ -568,7 +568,7 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane, hwdesc->cmd = JZ_LCD_CMD_EOF_IRQ | (width * height * cpp / 4); if (drm_atomic_crtc_needs_modeset(crtc_state)) { - fourcc = state->fb->format->format; + fourcc = newstate->fb->format->format; ingenic_drm_plane_config(priv->dev, plane, fourcc); diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c index 3d072b25e1c4..bc8d6931cc3a 100644 --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c @@ -285,16 +285,16 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *oldstate) { struct ingenic_ipu *ipu = plane_to_ingenic_ipu(plane); - struct drm_plane_state *state = plane->state; + struct drm_plane_state *newstate = plane->state; const struct drm_format_info *finfo; u32 ctrl, stride = 0, coef_index = 0, format = 0; bool needs_modeset, upscaling_w, upscaling_h; int err; - if (!state || !state->fb) + if (!newstate || !newstate->fb) return; - finfo = drm_format_info(state->fb->format->format); + finfo = drm_format_info(newstate->fb->format->format); if (!ipu->clk_enabled) { err = clk_enable(ipu->clk); @@ -307,7 +307,7 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane, } /* Reset all the registers if needed */ - needs_modeset = drm_atomic_crtc_needs_modeset(state->crtc->state); + needs_modeset = drm_atomic_crtc_needs_modeset(newstate->crtc->state); if (needs_modeset) { regmap_set_bits(ipu->map, JZ_REG_IPU_CTRL, JZ_IPU_CTRL_RST); @@ -317,11 +317,13 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane, } /* New addresses will be committed in vblank handler... */ - ipu->addr_y = drm_fb_cma_get_gem_addr(state->fb, state, 0); + ipu->addr_y = drm_fb_cma_get_gem_addr(newstate->fb, newstate, 0); if (finfo->num_planes > 1) - ipu->addr_u = drm_fb_cma_get_gem_addr(state->fb, state, 1); + ipu->addr_u = drm_fb_cma_get_gem_addr(newstate->fb, newstate, + 1); if (finfo->num_planes > 2) - ipu->addr_v = drm_fb_cma_get_gem_addr(state->fb, state, 2); + ipu->addr_v = drm_fb_cma_get_gem_addr(newstate->fb, newstate, + 2); if (!needs_modeset) return; @@ -338,21 +340,21 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane, /* Set the input height/width/strides */ if (finfo->num_planes > 2) - stride = ((state->src_w >> 16) * finfo->cpp[2] / finfo->hsub) + stride = ((newstate->src_w >> 16) * finfo->cpp[2] / finfo->hsub) << JZ_IPU_UV_STRIDE_V_LSB; if (finfo->num_planes > 1) - stride |= ((state->src_w >> 16) * finfo->cpp[1] / finfo->hsub) + stride |= ((newstate->src_w >> 16) * finfo->cpp[1] / finfo->hsub) << JZ_IPU_UV_STRIDE_U_LSB; regmap_write(ipu->map, JZ_REG_IPU_UV_STRIDE, stride); - stride = ((state->src_w >> 16) * finfo->cpp[0]) << JZ_IPU_Y_STRIDE_Y_LSB; + stride = ((newstate->src_w >> 16) * finfo->cpp[0]) << JZ_IPU_Y_STRIDE_Y_LSB; regmap_write(ipu->map, JZ_REG_IPU_Y_STRIDE, stride); regmap_write(ipu->map, JZ_REG_IPU_IN_GS, (stride << JZ_IPU_IN_GS_W_LSB) | - ((state->src_h >> 16) << JZ_IPU_IN_GS_H_LSB)); + ((newstate->src_h >> 16) << JZ_IPU_IN_GS_H_LSB)); switch (finfo->format) { case DRM_FORMAT_XRGB1555: @@ -421,9 +423,9 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane, /* Set the output height/width/stride */ regmap_write(ipu->map, JZ_REG_IPU_OUT_GS, - ((state->crtc_w * 4) << JZ_IPU_OUT_GS_W_LSB) - | state->crtc_h << JZ_IPU_OUT_GS_H_LSB); - regmap_write(ipu->map, JZ_REG_IPU_OUT_STRIDE, state->crtc_w * 4); + ((newstate->crtc_w * 4) << JZ_IPU_OUT_GS_W_LSB) + | newstate->crtc_h << JZ_IPU_OUT_GS_H_LSB); + regmap_write(ipu->map, JZ_REG_IPU_OUT_STRIDE, newstate->crtc_w * 4); if (finfo->is_yuv) { regmap_set_bits(ipu->map, JZ_REG_IPU_CTRL, JZ_IPU_CTRL_CSC_EN); @@ -508,8 +510,8 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane, JZ_IPU_CTRL_RUN | JZ_IPU_CTRL_FM_IRQ_EN); dev_dbg(ipu->dev, "Scaling %ux%u to %ux%u (%u:%u horiz, %u:%u vert)\n", - state->src_w >> 16, state->src_h >> 16, - state->crtc_w, state->crtc_h, + newstate->src_w >> 16, newstate->src_h >> 16, + newstate->crtc_w, newstate->crtc_h, ipu->num_w, ipu->denom_w, ipu->num_h, ipu->denom_h); } diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index cd143a34bd60..6ae24058ec35 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -176,18 +176,17 @@ static void mtk_plane_atomic_disable(struct drm_plane *plane, struct drm_plane_state *old_state) { struct drm_plane_state *new_state = plane->state; - struct mtk_plane_state *state = to_mtk_plane_state(new_state); - - state->pending.enable = false; + struct mtk_plane_state *mtk_plane_state = to_mtk_plane_state(new_state); + mtk_plane_state->pending.enable = false; wmb(); /* Make sure the above parameter is set before update */ - state->pending.dirty = true; + mtk_plane_state->pending.dirty = true; } static void mtk_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct drm_plane_state *new_state = plane->state; - struct mtk_plane_state *state = to_mtk_plane_state(new_state); + struct mtk_plane_state *mtk_plane_state = to_mtk_plane_state(new_state); struct drm_crtc *crtc = new_state->crtc; struct drm_framebuffer *fb = new_state->fb; struct drm_gem_object *gem; @@ -212,17 +211,17 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, addr += (new_state->src.x1 >> 16) * fb->format->cpp[0]; addr += (new_state->src.y1 >> 16) * pitch; - state->pending.enable = true; - state->pending.pitch = pitch; - state->pending.format = format; - state->pending.addr = addr; - state->pending.x = new_state->dst.x1; - state->pending.y = new_state->dst.y1; - state->pending.width = drm_rect_width(&new_state->dst); - state->pending.height = drm_rect_height(&new_state->dst); - state->pending.rotation = new_state->rotation; + mtk_plane_state->pending.enable = true; + mtk_plane_state->pending.pitch = pitch; + mtk_plane_state->pending.format = format; + mtk_plane_state->pending.addr = addr; + mtk_plane_state->pending.x = new_state->dst.x1; + mtk_plane_state->pending.y = new_state->dst.y1; + mtk_plane_state->pending.width = drm_rect_width(&new_state->dst); + mtk_plane_state->pending.height = drm_rect_height(&new_state->dst); + mtk_plane_state->pending.rotation = new_state->rotation; wmb(); /* Make sure the above parameters are set before update */ - state->pending.dirty = true; + mtk_plane_state->pending.dirty = true; } static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = { diff --git a/drivers/gpu/drm/meson/meson_overlay.c b/drivers/gpu/drm/meson/meson_overlay.c index 93ba785de396..902b5711a2b8 100644 --- a/drivers/gpu/drm/meson/meson_overlay.c +++ b/drivers/gpu/drm/meson/meson_overlay.c @@ -471,8 +471,8 @@ static void meson_overlay_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct meson_overlay *meson_overlay = to_meson_overlay(plane); - struct drm_plane_state *state = plane->state; - struct drm_framebuffer *fb = state->fb; + struct drm_plane_state *new_state = plane->state; + struct drm_framebuffer *fb = new_state->fb; struct meson_drm *priv = meson_overlay->priv; struct drm_gem_cma_object *gem; unsigned long flags; @@ -480,7 +480,7 @@ static void meson_overlay_atomic_update(struct drm_plane *plane, DRM_DEBUG_DRIVER("\n"); - interlace_mode = state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE; + interlace_mode = new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE; spin_lock_irqsave(&priv->drm->event_lock, flags); diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index e5d05b725ed6..c2df7eca6808 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -133,10 +133,10 @@ static void meson_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct meson_plane *meson_plane = to_meson_plane(plane); - struct drm_plane_state *state = plane->state; - struct drm_rect dest = drm_plane_state_dest(state); + struct drm_plane_state *new_state = plane->state; + struct drm_rect dest = drm_plane_state_dest(new_state); struct meson_drm *priv = meson_plane->priv; - struct drm_framebuffer *fb = state->fb; + struct drm_framebuffer *fb = new_state->fb; struct drm_gem_cma_object *gem; unsigned long flags; int vsc_ini_rcv_num, vsc_ini_rpt_p0_num; @@ -249,7 +249,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane, hf_bank_len = 4; vf_bank_len = 4; - if (state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) { + if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) { vsc_bot_rcv_num = 6; vsc_bot_rpt_p0_num = 2; } @@ -259,10 +259,10 @@ static void meson_plane_atomic_update(struct drm_plane *plane, hsc_ini_rpt_p0_num = (hf_bank_len / 2) - 1; vsc_ini_rpt_p0_num = (vf_bank_len / 2) - 1; - src_w = fixed16_to_int(state->src_w); - src_h = fixed16_to_int(state->src_h); - dst_w = state->crtc_w; - dst_h = state->crtc_h; + src_w = fixed16_to_int(new_state->src_w); + src_h = fixed16_to_int(new_state->src_h); + dst_w = new_state->crtc_w; + dst_h = new_state->crtc_h; /* * When the output is interlaced, the OSD must switch between @@ -271,7 +271,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane, * But the vertical scaler can provide such funtionnality if * is configured for 2:1 scaling with interlace options enabled. */ - if (state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) { + if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) { dest.y1 /= 2; dest.y2 /= 2; dst_h /= 2; @@ -280,7 +280,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane, hf_phase_step = ((src_w << 18) / dst_w) << 6; vf_phase_step = (src_h << 20) / dst_h; - if (state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) + if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) bot_ini_phase = ((vf_phase_step / 2) >> 4); else bot_ini_phase = 0; @@ -312,7 +312,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane, VSC_TOP_RPT_L0_NUM(vsc_ini_rpt_p0_num) | VSC_VERTICAL_SCALER_EN; - if (state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) + if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) priv->viu.osd_sc_v_ctrl0 |= VSC_BOT_INI_RCV_NUM(vsc_bot_rcv_num) | VSC_BOT_RPT_L0_NUM(vsc_bot_rpt_p0_num) | @@ -347,11 +347,11 @@ static void meson_plane_atomic_update(struct drm_plane *plane, * e.g. +30x1920 would be (1919 << 16) | 30 */ priv->viu.osd1_blk0_cfg[1] = - ((fixed16_to_int(state->src.x2) - 1) << 16) | - fixed16_to_int(state->src.x1); + ((fixed16_to_int(new_state->src.x2) - 1) << 16) | + fixed16_to_int(new_state->src.x1); priv->viu.osd1_blk0_cfg[2] = - ((fixed16_to_int(state->src.y2) - 1) << 16) | - fixed16_to_int(state->src.y1); + ((fixed16_to_int(new_state->src.y2) - 1) << 16) | + fixed16_to_int(new_state->src.y1); priv->viu.osd1_blk0_cfg[3] = ((dest.x2 - 1) << 16) | dest.x1; priv->viu.osd1_blk0_cfg[4] = ((dest.y2 - 1) << 16) | dest.y1; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index d644044a2bbb..82a69d2cf20d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -1244,13 +1244,13 @@ static void dpu_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct dpu_plane *pdpu = to_dpu_plane(plane); - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; pdpu->is_error = false; DPU_DEBUG_PLANE(pdpu, "\n"); - if (!state->visible) { + if (!new_state->visible) { _dpu_plane_atomic_disable(plane); } else { dpu_plane_sspp_atomic_update(plane); diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c index f95b14ebfa8a..b4c74c1047ba 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c @@ -114,15 +114,15 @@ static int mdp4_plane_atomic_check(struct drm_plane *plane, static void mdp4_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; int ret; ret = mdp4_plane_mode_set(plane, - state->crtc, state->fb, - state->crtc_x, state->crtc_y, - state->crtc_w, state->crtc_h, - state->src_x, state->src_y, - state->src_w, state->src_h); + new_state->crtc, new_state->fb, + new_state->crtc_x, new_state->crtc_y, + new_state->crtc_w, new_state->crtc_h, + new_state->src_x, new_state->src_y, + new_state->src_w, new_state->src_h); /* atomic_check should have ensured that this doesn't fail */ WARN_ON(ret < 0); } diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 6ce6ce09fecc..da1cc66f9f49 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -428,16 +428,16 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane, static void mdp5_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; DBG("%s: update", plane->name); - if (plane_enabled(state)) { + if (plane_enabled(new_state)) { int ret; ret = mdp5_plane_mode_set(plane, - state->crtc, state->fb, - &state->src, &state->dst); + new_state->crtc, new_state->fb, + &new_state->src, &new_state->dst); /* atomic_check should have ensured that this doesn't fail */ WARN_ON(ret < 0); } diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c index 18c0c0d7b4b6..6b19a84340e3 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c @@ -433,7 +433,7 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_pstate) { struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev); - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_pstate = plane->state; dma_addr_t paddr; u32 ctrl; @@ -462,7 +462,7 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane, ctrl = AS_CTRL_AS_ENABLE | AS_CTRL_ALPHA(255); - switch (state->fb->format->format) { + switch (new_pstate->fb->format->format) { case DRM_FORMAT_XRGB4444: ctrl |= AS_CTRL_FORMAT_RGB444 | AS_CTRL_ALPHA_CTRL_OVERRIDE; break; diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index b08880915d5e..d52124adedf7 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -44,26 +44,27 @@ static void omap_plane_atomic_update(struct drm_plane *plane, { struct omap_drm_private *priv = plane->dev->dev_private; struct omap_plane *omap_plane = to_omap_plane(plane); - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; struct omap_overlay_info info; int ret; - DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb); + DBG("%s, crtc=%p fb=%p", omap_plane->name, new_state->crtc, + new_state->fb); memset(&info, 0, sizeof(info)); info.rotation_type = OMAP_DSS_ROT_NONE; info.rotation = DRM_MODE_ROTATE_0; - info.global_alpha = state->alpha >> 8; - info.zorder = state->normalized_zpos; - if (state->pixel_blend_mode == DRM_MODE_BLEND_PREMULTI) + info.global_alpha = new_state->alpha >> 8; + info.zorder = new_state->normalized_zpos; + if (new_state->pixel_blend_mode == DRM_MODE_BLEND_PREMULTI) info.pre_mult_alpha = 1; else info.pre_mult_alpha = 0; - info.color_encoding = state->color_encoding; - info.color_range = state->color_range; + info.color_encoding = new_state->color_encoding; + info.color_range = new_state->color_range; /* update scanout: */ - omap_framebuffer_update_scanout(state->fb, state, &info); + omap_framebuffer_update_scanout(new_state->fb, new_state, &info); DBG("%dx%d -> %dx%d (%d)", info.width, info.height, info.out_width, info.out_height, @@ -73,8 +74,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, /* and finally, update omapdss: */ ret = dispc_ovl_setup(priv->dispc, omap_plane->id, &info, - omap_crtc_timings(state->crtc), false, - omap_crtc_channel(state->crtc)); + omap_crtc_timings(new_state->crtc), false, + omap_crtc_channel(new_state->crtc)); if (ret) { dev_err(plane->dev->dev, "Failed to setup plane %s\n", omap_plane->name); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 01f6cb99e8ea..3a389cd756ff 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -876,18 +876,18 @@ static void vop_plane_atomic_disable(struct drm_plane *plane, static void vop_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; - struct drm_crtc *crtc = state->crtc; + struct drm_plane_state *new_state = plane->state; + struct drm_crtc *crtc = new_state->crtc; struct vop_win *vop_win = to_vop_win(plane); const struct vop_win_data *win = vop_win->data; const struct vop_win_yuv2yuv_data *win_yuv2yuv = vop_win->yuv2yuv_data; - struct vop *vop = to_vop(state->crtc); - struct drm_framebuffer *fb = state->fb; + struct vop *vop = to_vop(new_state->crtc); + struct drm_framebuffer *fb = new_state->fb; unsigned int actual_w, actual_h; unsigned int dsp_stx, dsp_sty; uint32_t act_info, dsp_info, dsp_st; - struct drm_rect *src = &state->src; - struct drm_rect *dest = &state->dst; + struct drm_rect *src = &new_state->src; + struct drm_rect *dest = &new_state->dst; struct drm_gem_object *obj, *uv_obj; struct rockchip_gem_object *rk_obj, *rk_uv_obj; unsigned long offset; @@ -908,7 +908,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane, if (WARN_ON(!vop->is_enabled)) return; - if (!state->visible) { + if (!new_state->visible) { vop_plane_atomic_disable(plane, old_state); return; } @@ -935,7 +935,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane, * For y-mirroring we need to move address * to the beginning of the last line. */ - if (state->rotation & DRM_MODE_REFLECT_Y) + if (new_state->rotation & DRM_MODE_REFLECT_Y) dma_addr += (actual_h - 1) * fb->pitches[0]; format = vop_convert_format(fb->format->format); @@ -957,9 +957,9 @@ static void vop_plane_atomic_update(struct drm_plane *plane, VOP_WIN_SET(vop, win, yrgb_mst, dma_addr); VOP_WIN_YUV2YUV_SET(vop, win_yuv2yuv, y2r_en, is_yuv); VOP_WIN_SET(vop, win, y_mir_en, - (state->rotation & DRM_MODE_REFLECT_Y) ? 1 : 0); + (new_state->rotation & DRM_MODE_REFLECT_Y) ? 1 : 0); VOP_WIN_SET(vop, win, x_mir_en, - (state->rotation & DRM_MODE_REFLECT_X) ? 1 : 0); + (new_state->rotation & DRM_MODE_REFLECT_X) ? 1 : 0); if (is_yuv) { int hsub = fb->format->hsub; diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c index e34ab8317f6d..4cf3bf1b3007 100644 --- a/drivers/gpu/drm/sti/sti_cursor.c +++ b/drivers/gpu/drm/sti/sti_cursor.c @@ -258,11 +258,11 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane, static void sti_cursor_atomic_update(struct drm_plane *drm_plane, struct drm_plane_state *oldstate) { - struct drm_plane_state *state = drm_plane->state; + struct drm_plane_state *newstate = drm_plane->state; struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_cursor *cursor = to_sti_cursor(plane); - struct drm_crtc *crtc = state->crtc; - struct drm_framebuffer *fb = state->fb; + struct drm_crtc *crtc = newstate->crtc; + struct drm_framebuffer *fb = newstate->fb; struct drm_display_mode *mode; int dst_x, dst_y; struct drm_gem_cma_object *cma_obj; @@ -273,8 +273,8 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane, return; mode = &crtc->mode; - dst_x = state->crtc_x; - dst_y = state->crtc_y; + dst_x = newstate->crtc_x; + dst_y = newstate->crtc_y; cma_obj = drm_fb_cma_get_gem_obj(fb, 0); diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c index f64eef90dc58..0407b7dbd228 100644 --- a/drivers/gpu/drm/sti/sti_gdp.c +++ b/drivers/gpu/drm/sti/sti_gdp.c @@ -701,11 +701,11 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane, static void sti_gdp_atomic_update(struct drm_plane *drm_plane, struct drm_plane_state *oldstate) { - struct drm_plane_state *state = drm_plane->state; + struct drm_plane_state *newstate = drm_plane->state; struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_gdp *gdp = to_sti_gdp(plane); - struct drm_crtc *crtc = state->crtc; - struct drm_framebuffer *fb = state->fb; + struct drm_crtc *crtc = newstate->crtc; + struct drm_framebuffer *fb = newstate->fb; struct drm_display_mode *mode; int dst_x, dst_y, dst_w, dst_h; int src_x, src_y, src_w, src_h; @@ -722,15 +722,15 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane, if (!crtc || !fb) return; - if ((oldstate->fb == state->fb) && - (oldstate->crtc_x == state->crtc_x) && - (oldstate->crtc_y == state->crtc_y) && - (oldstate->crtc_w == state->crtc_w) && - (oldstate->crtc_h == state->crtc_h) && - (oldstate->src_x == state->src_x) && - (oldstate->src_y == state->src_y) && - (oldstate->src_w == state->src_w) && - (oldstate->src_h == state->src_h)) { + if ((oldstate->fb == newstate->fb) && + (oldstate->crtc_x == newstate->crtc_x) && + (oldstate->crtc_y == newstate->crtc_y) && + (oldstate->crtc_w == newstate->crtc_w) && + (oldstate->crtc_h == newstate->crtc_h) && + (oldstate->src_x == newstate->src_x) && + (oldstate->src_y == newstate->src_y) && + (oldstate->src_w == newstate->src_w) && + (oldstate->src_h == newstate->src_h)) { /* No change since last update, do not post cmd */ DRM_DEBUG_DRIVER("No change, not posting cmd\n"); plane->status = STI_PLANE_UPDATED; @@ -748,15 +748,15 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane, } mode = &crtc->mode; - dst_x = state->crtc_x; - dst_y = state->crtc_y; - dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); - dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); + dst_x = newstate->crtc_x; + dst_y = newstate->crtc_y; + dst_w = clamp_val(newstate->crtc_w, 0, mode->hdisplay - dst_x); + dst_h = clamp_val(newstate->crtc_h, 0, mode->vdisplay - dst_y); /* src_x are in 16.16 format */ - src_x = state->src_x >> 16; - src_y = state->src_y >> 16; - src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH); - src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT); + src_x = newstate->src_x >> 16; + src_y = newstate->src_y >> 16; + src_w = clamp_val(newstate->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH); + src_h = clamp_val(newstate->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT); list = sti_gdp_get_free_nodes(gdp); top_field = list->top_field; diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index c1a2450beed4..264a80d606f9 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1111,11 +1111,11 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane, static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane, struct drm_plane_state *oldstate) { - struct drm_plane_state *state = drm_plane->state; + struct drm_plane_state *newstate = drm_plane->state; struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane); - struct drm_crtc *crtc = state->crtc; - struct drm_framebuffer *fb = state->fb; + struct drm_crtc *crtc = newstate->crtc; + struct drm_framebuffer *fb = newstate->fb; struct drm_display_mode *mode; int dst_x, dst_y, dst_w, dst_h; int src_x, src_y, src_w, src_h; @@ -1127,15 +1127,15 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane, if (!crtc || !fb) return; - if ((oldstate->fb == state->fb) && - (oldstate->crtc_x == state->crtc_x) && - (oldstate->crtc_y == state->crtc_y) && - (oldstate->crtc_w == state->crtc_w) && - (oldstate->crtc_h == state->crtc_h) && - (oldstate->src_x == state->src_x) && - (oldstate->src_y == state->src_y) && - (oldstate->src_w == state->src_w) && - (oldstate->src_h == state->src_h)) { + if ((oldstate->fb == newstate->fb) && + (oldstate->crtc_x == newstate->crtc_x) && + (oldstate->crtc_y == newstate->crtc_y) && + (oldstate->crtc_w == newstate->crtc_w) && + (oldstate->crtc_h == newstate->crtc_h) && + (oldstate->src_x == newstate->src_x) && + (oldstate->src_y == newstate->src_y) && + (oldstate->src_w == newstate->src_w) && + (oldstate->src_h == newstate->src_h)) { /* No change since last update, do not post cmd */ DRM_DEBUG_DRIVER("No change, not posting cmd\n"); plane->status = STI_PLANE_UPDATED; @@ -1143,15 +1143,15 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane, } mode = &crtc->mode; - dst_x = state->crtc_x; - dst_y = state->crtc_y; - dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); - dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); + dst_x = newstate->crtc_x; + dst_y = newstate->crtc_y; + dst_w = clamp_val(newstate->crtc_w, 0, mode->hdisplay - dst_x); + dst_h = clamp_val(newstate->crtc_h, 0, mode->vdisplay - dst_y); /* src_x are in 16.16 format */ - src_x = state->src_x >> 16; - src_y = state->src_y >> 16; - src_w = state->src_w >> 16; - src_h = state->src_h >> 16; + src_x = newstate->src_x >> 16; + src_y = newstate->src_y >> 16; + src_w = newstate->src_w >> 16; + src_h = newstate->src_h >> 16; cmd_offset = sti_hqvdp_get_free_cmd(hqvdp); if (cmd_offset == -1) { diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 7367a1e73d73..43de585b99d9 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -778,33 +778,33 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *oldstate) { struct ltdc_device *ldev = plane_to_ltdc(plane); - struct drm_plane_state *state = plane->state; - struct drm_framebuffer *fb = state->fb; + struct drm_plane_state *newstate = plane->state; + struct drm_framebuffer *fb = newstate->fb; u32 lofs = plane->index * LAY_OFS; - u32 x0 = state->crtc_x; - u32 x1 = state->crtc_x + state->crtc_w - 1; - u32 y0 = state->crtc_y; - u32 y1 = state->crtc_y + state->crtc_h - 1; + u32 x0 = newstate->crtc_x; + u32 x1 = newstate->crtc_x + newstate->crtc_w - 1; + u32 y0 = newstate->crtc_y; + u32 y1 = newstate->crtc_y + newstate->crtc_h - 1; u32 src_x, src_y, src_w, src_h; u32 val, pitch_in_bytes, line_length, paddr, ahbp, avbp, bpcr; enum ltdc_pix_fmt pf; - if (!state->crtc || !fb) { + if (!newstate->crtc || !fb) { DRM_DEBUG_DRIVER("fb or crtc NULL"); return; } /* convert src_ from 16:16 format */ - src_x = state->src_x >> 16; - src_y = state->src_y >> 16; - src_w = state->src_w >> 16; - src_h = state->src_h >> 16; + src_x = newstate->src_x >> 16; + src_y = newstate->src_y >> 16; + src_w = newstate->src_w >> 16; + src_h = newstate->src_h >> 16; DRM_DEBUG_DRIVER("plane:%d fb:%d (%dx%d)@(%d,%d) -> (%dx%d)@(%d,%d)\n", plane->base.id, fb->base.id, src_w, src_h, src_x, src_y, - state->crtc_w, state->crtc_h, - state->crtc_x, state->crtc_y); + newstate->crtc_w, newstate->crtc_h, + newstate->crtc_x, newstate->crtc_y); bpcr = reg_read(ldev->regs, LTDC_BPCR); ahbp = (bpcr & BPCR_AHBP) >> 16; @@ -863,7 +863,7 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane, reg_update_bits(ldev->regs, LTDC_L1CFBLNR + lofs, LXCFBLNR_CFBLN, val); /* Sets the FB address */ - paddr = (u32)drm_fb_cma_get_gem_addr(fb, state, 0); + paddr = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 0); DRM_DEBUG_DRIVER("fb: phys 0x%08x", paddr); reg_write(ldev->regs, LTDC_L1CFBAR + lofs, paddr); diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 9231c6ef602a..4eafd45baa60 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -709,7 +709,7 @@ static void tegra_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct drm_plane_state *new_state = plane->state; - struct tegra_plane_state *state = to_tegra_plane_state(new_state); + struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state); struct drm_framebuffer *fb = new_state->fb; struct tegra_plane *p = to_tegra_plane(plane); struct tegra_dc_window window; @@ -732,17 +732,17 @@ static void tegra_plane_atomic_update(struct drm_plane *plane, window.dst.w = drm_rect_width(&new_state->dst); window.dst.h = drm_rect_height(&new_state->dst); window.bits_per_pixel = fb->format->cpp[0] * 8; - window.reflect_x = state->reflect_x; - window.reflect_y = state->reflect_y; + window.reflect_x = tegra_plane_state->reflect_x; + window.reflect_y = tegra_plane_state->reflect_y; /* copy from state */ window.zpos = new_state->normalized_zpos; - window.tiling = state->tiling; - window.format = state->format; - window.swap = state->swap; + window.tiling = tegra_plane_state->tiling; + window.format = tegra_plane_state->format; + window.swap = tegra_plane_state->swap; for (i = 0; i < fb->format->num_planes; i++) { - window.base[i] = state->iova[i] + fb->offsets[i]; + window.base[i] = tegra_plane_state->iova[i] + fb->offsets[i]; /* * Tegra uses a shared stride for UV planes. Framebuffers are @@ -869,7 +869,7 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct drm_plane_state *new_state = plane->state; - struct tegra_plane_state *state = to_tegra_plane_state(new_state); + struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state); struct tegra_dc *dc = to_tegra_dc(new_state->crtc); u32 value = CURSOR_CLIP_DISPLAY; @@ -900,11 +900,11 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane, return; } - value |= (state->iova[0] >> 10) & 0x3fffff; + value |= (tegra_plane_state->iova[0] >> 10) & 0x3fffff; tegra_dc_writel(dc, value, DC_DISP_CURSOR_START_ADDR); #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT - value = (state->iova[0] >> 32) & 0x3; + value = (tegra_plane_state->iova[0] >> 32) & 0x3; tegra_dc_writel(dc, value, DC_DISP_CURSOR_START_ADDR_HI); #endif diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c index e9d86aec5ee8..1d31086e1cc9 100644 --- a/drivers/gpu/drm/tegra/hub.c +++ b/drivers/gpu/drm/tegra/hub.c @@ -428,7 +428,7 @@ static void tegra_shared_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct drm_plane_state *new_state = plane->state; - struct tegra_plane_state *state = to_tegra_plane_state(new_state); + struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state); struct tegra_dc *dc = to_tegra_dc(new_state->crtc); unsigned int zpos = new_state->normalized_zpos; struct drm_framebuffer *fb = new_state->fb; @@ -480,9 +480,9 @@ static void tegra_shared_plane_atomic_update(struct drm_plane *plane, /* disable compression */ tegra_plane_writel(p, 0, DC_WINBUF_CDE_CONTROL); - base = state->iova[0] + fb->offsets[0]; + base = tegra_plane_state->iova[0] + fb->offsets[0]; - tegra_plane_writel(p, state->format, DC_WIN_COLOR_DEPTH); + tegra_plane_writel(p, tegra_plane_state->format, DC_WIN_COLOR_DEPTH); tegra_plane_writel(p, 0, DC_WIN_PRECOMP_WGRP_PARAMS); value = V_POSITION(new_state->crtc_y) | @@ -512,10 +512,10 @@ static void tegra_shared_plane_atomic_update(struct drm_plane *plane, tegra_plane_writel(p, value, DC_WINBUF_CROPPED_POINT); if (dc->soc->supports_block_linear) { - unsigned long height = state->tiling.value; + unsigned long height = tegra_plane_state->tiling.value; /* XXX */ - switch (state->tiling.mode) { + switch (tegra_plane_state->tiling.mode) { case TEGRA_BO_TILING_MODE_PITCH: value = DC_WINBUF_SURFACE_KIND_BLOCK_HEIGHT(0) | DC_WINBUF_SURFACE_KIND_PITCH; diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c index 9b531e625ec9..90554d0be2d0 100644 --- a/drivers/gpu/drm/tidss/tidss_plane.c +++ b/drivers/gpu/drm/tidss/tidss_plane.c @@ -110,21 +110,21 @@ static void tidss_plane_atomic_update(struct drm_plane *plane, struct drm_device *ddev = plane->dev; struct tidss_device *tidss = to_tidss(ddev); struct tidss_plane *tplane = to_tidss_plane(plane); - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; u32 hw_videoport; int ret; dev_dbg(ddev->dev, "%s\n", __func__); - if (!state->visible) { + if (!new_state->visible) { dispc_plane_enable(tidss->dispc, tplane->hw_plane_id, false); return; } - hw_videoport = to_tidss_crtc(state->crtc)->hw_videoport; + hw_videoport = to_tidss_crtc(new_state->crtc)->hw_videoport; ret = dispc_plane_setup(tidss->dispc, tplane->hw_plane_id, - state, hw_videoport); + new_state, hw_videoport); if (ret) { dev_err(plane->dev->dev, "%s: Failed to setup plane %d\n", diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c index c86258132432..1d134a6d9fc6 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c @@ -78,18 +78,18 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane, static void tilcdc_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; - if (!state->crtc) + if (!new_state->crtc) return; - if (WARN_ON(!state->fb || !state->crtc->state)) + if (WARN_ON(!new_state->fb || !new_state->crtc->state)) return; - if (tilcdc_crtc_update_fb(state->crtc, - state->fb, - state->crtc->state->event) == 0) { - state->crtc->state->event = NULL; + if (tilcdc_crtc_update_fb(new_state->crtc, + new_state->fb, + new_state->crtc->state->event) == 0) { + new_state->crtc->state->event = NULL; } } diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c index 2db0ace95426..2833734bd5fb 100644 --- a/drivers/gpu/drm/zte/zx_plane.c +++ b/drivers/gpu/drm/zte/zx_plane.c @@ -184,10 +184,10 @@ static void zx_vl_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct zx_plane *zplane = to_zx_plane(plane); - struct drm_plane_state *state = plane->state; - struct drm_framebuffer *fb = state->fb; - struct drm_rect *src = &state->src; - struct drm_rect *dst = &state->dst; + struct drm_plane_state *new_state = plane->state; + struct drm_framebuffer *fb = new_state->fb; + struct drm_rect *src = &new_state->src; + struct drm_rect *dst = &new_state->dst; struct drm_gem_cma_object *cma_obj; void __iomem *layer = zplane->layer; void __iomem *hbsc = zplane->hbsc; From patchwork Fri Feb 19 12:00:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 385151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D03DDC4332D for ; Fri, 19 Feb 2021 12:05:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A81C664DFD for ; Fri, 19 Feb 2021 12:05:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231228AbhBSMFA (ORCPT ); Fri, 19 Feb 2021 07:05:00 -0500 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:56239 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbhBSMC4 (ORCPT ); Fri, 19 Feb 2021 07:02:56 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id B57C658018A; Fri, 19 Feb 2021 07:01:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 19 Feb 2021 07:01:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm2; bh= sIDsFI/uR6XN2etdjT1Ju6jt64IDwaJl5giMWD4uzJk=; b=gmVWaGk5JKwFuCH5 gmoMxw2bcnVEEywijWTPNU2LZJBGgUkKIJNk+NDz3Vjg3n/vQh61+06SsOSW70Fp nmgfiWCFSpIV/4ZL8NyAphTiraDRdIB5PrAtzI1OaBZJXGkA8+S7lmLJiTUFp0iy RLopz4ou/YBUctVFcTl+yPKxe3cRmbujgfV5/3z9dj8PNOAD+YR0ir8eHtaiXQ9l R5c6XubQFU+b/dPk/9GhfZL00bP/thd2QjQM71S6ewzSvBTyGNHOL96+8O1pz8pU Moi+DTj50jz29OiiXBvZ0++I2Etphg5+qJ8cjhUOO8bgWhhclF1UYO31PtXsWsdC NUSVog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=sIDsFI/uR6XN2etdjT1Ju6jt64IDwaJl5giMWD4uz Jk=; b=R0QPGk/vWgf4h2zIDyptGQZPxZbeAn0+EiPXwGu2wHg8mhuFVc4fKNqTt V6Y10/ncuCZAD3uMwd2SxrUHpvyXlWbJGcdgUmmbSce03OGELflfVvoIHHo2Ze+r 0eTWyVlLaiePfVNjsRLnpQhW2UwFtOgc5iC4zJ3L9C1rIIopCesIy37jlqOvBhql e7GOhNT+hes+kdC8WhKJUlQchrpQO+C4qMk4oG1hJgwaMvwoxk0Xp60XaeE4tnMu d9kjKfkkECYsg6DYGkKwYfH8rzdK9EYrtg/oRs5YPYGrWKaHPrhcrqVHeb3UMOA0 6OXHDM8KAcRNsTvnxLTEp0760Yw7Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjeeigdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepffegueefvdevvdduieegieeigeeigeevveekhfdtgeevieejtddvgfejleel jedunecuffhomhgrihhnpehshihnohhpshihshdrtghomhenucfkphepledtrdekledrie ekrdejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 136091080064; Fri, 19 Feb 2021 07:01:06 -0500 (EST) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie Cc: dri-devel@lists.freedesktop.org, =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Alexey Brodkin , Daniel Vetter , Liviu Dudau , Brian Starkey , Russell King , Dave Airlie , Sam Ravnborg , Boris Brezillon , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , John Stultz , Xinwei Kong , Chen Feng , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Paul Cercueil , Anitha Chrisanthus , Edmund Dea , Chun-Kuang Hu , Matthias Brugger , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Rob Clark , Sean Paul , Marek Vasut , Tomi Valkeinen , Gerd Hoffmann , Laurent Pinchart , Kieran Bingham , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Benjamin Gaignard , Vincent Abriou , Yannick Fertre , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Thierry Reding , Jonathan Hunter , Jyri Sarha , Hans de Goede , Rodrigo Siqueira , Melissa Wen , Haneen Mohammed , VMware Graphics , Roland Scheidegger , Zack Rusin , Hyun Kwon , Michal Simek , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org Subject: [PATCH v3 10/11] drm: Use state helper instead of the plane state pointer Date: Fri, 19 Feb 2021 13:00:30 +0100 Message-Id: <20210219120032.260676-10-maxime@cerno.tech> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210219120032.260676-1-maxime@cerno.tech> References: <20210219120032.260676-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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 @ no_include depends on !include && adds_new_state @ @@ + #include #include Reviewed-by: Ville Syrjälä Signed-off-by: Maxime Ripard --- drivers/gpu/drm/arc/arcpgu_crtc.c | 4 +++- drivers/gpu/drm/arm/hdlcd_crtc.c | 3 ++- drivers/gpu/drm/arm/malidp_planes.c | 3 ++- drivers/gpu/drm/armada/armada_overlay.c | 3 ++- drivers/gpu/drm/armada/armada_plane.c | 3 ++- drivers/gpu/drm/ast/ast_mode.c | 6 ++++-- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 3 ++- drivers/gpu/drm/exynos/exynos_drm_plane.c | 3 ++- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 3 ++- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 3 ++- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 3 ++- drivers/gpu/drm/imx/dcss/dcss-plane.c | 3 ++- drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 ++- drivers/gpu/drm/ingenic/ingenic-ipu.c | 3 ++- drivers/gpu/drm/kmb/kmb_plane.c | 3 ++- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++-- drivers/gpu/drm/meson/meson_overlay.c | 3 ++- drivers/gpu/drm/meson/meson_plane.c | 3 ++- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 3 ++- drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c | 4 +++- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 3 ++- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 3 ++- drivers/gpu/drm/omapdrm/omap_plane.c | 6 ++++-- drivers/gpu/drm/qxl/qxl_display.c | 6 ++++-- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 3 ++- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 ++- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 3 ++- drivers/gpu/drm/sti/sti_cursor.c | 3 ++- drivers/gpu/drm/sti/sti_gdp.c | 3 ++- drivers/gpu/drm/sti/sti_hqvdp.c | 3 ++- drivers/gpu/drm/stm/ltdc.c | 3 ++- drivers/gpu/drm/sun4i/sun4i_layer.c | 3 ++- drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 3 ++- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 3 ++- drivers/gpu/drm/tegra/dc.c | 6 ++++-- drivers/gpu/drm/tegra/hub.c | 3 ++- drivers/gpu/drm/tidss/tidss_plane.c | 3 ++- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 3 ++- drivers/gpu/drm/vboxvideo/vbox_mode.c | 6 ++++-- drivers/gpu/drm/vkms/vkms_plane.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 3 ++- drivers/gpu/drm/xlnx/zynqmp_disp.c | 3 ++- drivers/gpu/drm/zte/zx_plane.c | 6 ++++-- 46 files changed, 108 insertions(+), 53 deletions(-) diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c index b185452d5542..7016f9cfe30d 100644 --- a/drivers/gpu/drm/arc/arcpgu_crtc.c +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c @@ -5,6 +5,7 @@ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com) */ +#include #include #include #include @@ -147,7 +148,8 @@ static const struct drm_crtc_helper_funcs arc_pgu_crtc_helper_funcs = { static void arc_pgu_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_plane_state *new_plane_state = plane->state; + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct arcpgu_drm_private *arcpgu; struct drm_gem_cma_object *gem; diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 2500bf189420..7adb065169e9 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -262,7 +262,8 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, static void hdlcd_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_plane_state *new_plane_state = plane->state; + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = new_plane_state->fb; struct hdlcd_drm_private *hdlcd; u32 dest_h; diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 1cb207bb8dcd..ddbba67f0283 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -797,7 +797,8 @@ static void malidp_de_plane_update(struct drm_plane *plane, plane); struct malidp_plane *mp; struct malidp_plane_state *ms = to_malidp_plane_state(plane->state); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); u16 pixel_alpha = new_state->pixel_blend_mode; u8 plane_alpha = new_state->alpha >> 8; u32 src_w, src_h, dest_w, dest_h, val; diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 393e4ea841f9..d3e3e5fdc390 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -70,7 +70,8 @@ static void armada_drm_overlay_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct armada_crtc *dcrtc; struct armada_regs *regs; unsigned int idx; diff --git a/drivers/gpu/drm/armada/armada_plane.c b/drivers/gpu/drm/armada/armada_plane.c index 31d312d7ceef..40209e49f34a 100644 --- a/drivers/gpu/drm/armada/armada_plane.c +++ b/drivers/gpu/drm/armada/armada_plane.c @@ -165,7 +165,8 @@ static void armada_drm_primary_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct armada_crtc *dcrtc; struct armada_regs *regs; u32 cfg, cfg_mask, val; diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 61815eeb5157..36d9575aa27b 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -575,7 +575,8 @@ ast_primary_plane_helper_atomic_update(struct drm_plane *plane, plane); struct drm_device *dev = plane->dev; struct ast_private *ast = to_ast_private(dev); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_gem_vram_object *gbo; s64 gpu_addr; struct drm_framebuffer *fb = new_state->fb; @@ -797,7 +798,8 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane, struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane); struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(new_state); struct drm_framebuffer *fb = new_state->fb; struct ast_private *ast = to_ast_private(plane->dev); diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 2c6d71faa268..a077d93c78d7 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -733,7 +733,8 @@ static void atmel_hlcdc_plane_atomic_disable(struct drm_plane *p, static void atmel_hlcdc_plane_atomic_update(struct drm_plane *p, struct drm_atomic_state *state) { - struct drm_plane_state *new_s = p->state; + struct drm_plane_state *new_s = drm_atomic_get_new_plane_state(state, + p); struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p); struct atmel_hlcdc_plane_state *hstate = drm_plane_state_to_atmel_hlcdc_plane_state(new_s); diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index c0f733e6ed9e..ee99ab19f717 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -254,7 +254,8 @@ static int exynos_plane_atomic_check(struct drm_plane *plane, static void exynos_plane_atomic_update(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); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(new_state->crtc); struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c index d9efa6d1b2d4..8fe953d6e0a9 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c @@ -80,7 +80,8 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane, { struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private; - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = plane->state->fb; struct drm_gem_cma_object *gem; unsigned int alpha = DCU_LAYER_AB_NONE, bpp; diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c index 4f643fbc68fb..fa8da0ef707e 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c @@ -101,7 +101,8 @@ static int hibmc_plane_atomic_check(struct drm_plane *plane, static void hibmc_plane_atomic_update(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); u32 reg; s64 gpu_addr = 0; u32 line_l; diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 834fd101c3ba..6dcf9ec05eec 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -806,7 +806,8 @@ static int ade_plane_atomic_check(struct drm_plane *plane, static void ade_plane_atomic_update(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); struct kirin_plane *kplane = to_kirin_plane(plane); ade_update_channel(kplane, new_state->fb, new_state->crtc_x, diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c index d6bc9fb71756..ba297e108b43 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-plane.c +++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c @@ -268,7 +268,8 @@ static void dcss_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct dcss_plane *dcss_plane = to_dcss_plane(plane); struct dcss_dev *dcss = plane->dev->dev_private; struct drm_framebuffer *fb = new_state->fb; diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 7b0714061849..d9d71f3748e9 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -544,7 +544,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); struct ipu_plane *ipu_plane = to_ipu_plane(plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct ipu_plane_state *ipu_state = to_ipu_plane_state(new_state); struct drm_crtc_state *crtc_state = new_state->crtc->state; struct drm_framebuffer *fb = new_state->fb; diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 85c371d105e5..6d38eca052f7 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -544,7 +544,8 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { struct ingenic_drm *priv = drm_device_get_priv(plane->dev); - struct drm_plane_state *newstate = plane->state; + struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc_state *crtc_state; struct ingenic_dma_hwdesc *hwdesc; unsigned int width, height, cpp, offset; diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c index 7716bb211d7e..1e1c7dd3997a 100644 --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c @@ -285,7 +285,8 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { struct ingenic_ipu *ipu = plane_to_ingenic_ipu(plane); - struct drm_plane_state *newstate = plane->state; + struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state, + plane); const struct drm_format_info *finfo; u32 ctrl, stride = 0, coef_index = 0, format = 0; bool needs_modeset, upscaling_w, upscaling_h; diff --git a/drivers/gpu/drm/kmb/kmb_plane.c b/drivers/gpu/drm/kmb/kmb_plane.c index f837962474b1..d5b6195856d1 100644 --- a/drivers/gpu/drm/kmb/kmb_plane.c +++ b/drivers/gpu/drm/kmb/kmb_plane.c @@ -282,7 +282,8 @@ static void kmb_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_plane_state = plane->state; + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb; struct kmb_drm_private *kmb; unsigned int width; diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index 7f876b6c9615..a6efbc38db27 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -175,7 +175,8 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, static void mtk_plane_atomic_disable(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); struct mtk_plane_state *mtk_plane_state = to_mtk_plane_state(new_state); mtk_plane_state->pending.enable = false; wmb(); /* Make sure the above parameter is set before update */ @@ -185,7 +186,8 @@ static void mtk_plane_atomic_disable(struct drm_plane *plane, static void mtk_plane_atomic_update(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); struct mtk_plane_state *mtk_plane_state = to_mtk_plane_state(new_state); struct drm_crtc *crtc = new_state->crtc; struct drm_framebuffer *fb = new_state->fb; diff --git a/drivers/gpu/drm/meson/meson_overlay.c b/drivers/gpu/drm/meson/meson_overlay.c index 4b12a53e27c8..a820bf9b1075 100644 --- a/drivers/gpu/drm/meson/meson_overlay.c +++ b/drivers/gpu/drm/meson/meson_overlay.c @@ -471,7 +471,8 @@ static void meson_overlay_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { struct meson_overlay *meson_overlay = to_meson_overlay(plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = new_state->fb; struct meson_drm *priv = meson_overlay->priv; struct drm_gem_cma_object *gem; diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index 78bd3e9be3bf..f7fa37ac51cf 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -133,7 +133,8 @@ static void meson_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { struct meson_plane *meson_plane = to_meson_plane(plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_rect dest = drm_plane_state_dest(new_state); struct meson_drm *priv = meson_plane->priv; struct drm_framebuffer *fb = new_state->fb; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 31071f9e21d7..e8ce72fe54a4 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -1244,7 +1244,8 @@ static void dpu_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { struct dpu_plane *pdpu = to_dpu_plane(plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); pdpu->is_error = false; diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c index 5d78bce980a7..9aecca919f24 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c @@ -4,6 +4,7 @@ * Author: Rob Clark */ +#include #include #include @@ -114,7 +115,8 @@ static int mdp4_plane_atomic_check(struct drm_plane *plane, static void mdp4_plane_atomic_update(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); int ret; ret = mdp4_plane_mode_set(plane, diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 4dc82a0c12e9..8c9f2f492178 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -428,7 +428,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane, static void mdp5_plane_atomic_update(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); DBG("%s: update", plane->name); diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c index 980b567043ba..c7c0b21f541f 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c @@ -435,7 +435,8 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(state, plane); struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev); - struct drm_plane_state *new_pstate = plane->state; + struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state, + plane); dma_addr_t paddr; u32 ctrl; diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index d7c735dba3e1..801da917507d 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -44,7 +44,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, { struct omap_drm_private *priv = plane->dev->dev_private; struct omap_plane *omap_plane = to_omap_plane(plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct omap_overlay_info info; int ret; @@ -89,7 +90,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, static void omap_plane_atomic_disable(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); struct omap_drm_private *priv = plane->dev->dev_private; struct omap_plane *omap_plane = to_omap_plane(plane); diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index acde4b39bc9d..e1d7c2f2a8b9 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -528,7 +528,8 @@ static int qxl_primary_apply_cursor(struct drm_plane *plane) static void qxl_primary_atomic_update(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); struct qxl_device *qdev = to_qxl(plane->dev); struct qxl_bo *bo = gem_to_qxl_bo(new_state->fb->obj[0]); struct qxl_bo *primary; @@ -581,7 +582,8 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_device *dev = plane->dev; struct qxl_device *qdev = to_qxl(dev); struct drm_framebuffer *fb = new_state->fb; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index 50f7247b51fa..f9b8fa2082e8 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -622,7 +622,8 @@ static void rcar_du_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct rcar_du_plane *rplane = to_rcar_plane(plane); struct rcar_du_plane_state *old_rstate; struct rcar_du_plane_state *new_rstate; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 19fd424d1208..aa068b0d1315 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -281,7 +281,8 @@ static void rcar_du_vsp_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct rcar_du_vsp_plane *rplane = to_rcar_vsp_plane(plane); struct rcar_du_crtc *crtc = to_rcar_crtc(old_state->crtc); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index e0e2510bdaac..60f03e9899ae 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -880,7 +880,8 @@ static void vop_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc *crtc = new_state->crtc; struct vop_win *vop_win = to_vop_win(plane); const struct vop_win_data *win = vop_win->data; diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c index 217f456067c2..1d6051b4f6fe 100644 --- a/drivers/gpu/drm/sti/sti_cursor.c +++ b/drivers/gpu/drm/sti/sti_cursor.c @@ -258,7 +258,8 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane, static void sti_cursor_atomic_update(struct drm_plane *drm_plane, struct drm_atomic_state *state) { - struct drm_plane_state *newstate = drm_plane->state; + struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state, + drm_plane); struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_cursor *cursor = to_sti_cursor(plane); struct drm_crtc *crtc = newstate->crtc; diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c index eee17c6914a6..d1a35d97bc45 100644 --- a/drivers/gpu/drm/sti/sti_gdp.c +++ b/drivers/gpu/drm/sti/sti_gdp.c @@ -703,7 +703,8 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane, { struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state, drm_plane); - struct drm_plane_state *newstate = drm_plane->state; + struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state, + drm_plane); struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_gdp *gdp = to_sti_gdp(plane); struct drm_crtc *crtc = newstate->crtc; diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index f317c9aad9c5..edbb99f53de1 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1113,7 +1113,8 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane, { struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state, drm_plane); - struct drm_plane_state *newstate = drm_plane->state; + struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state, + drm_plane); struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane); struct drm_crtc *crtc = newstate->crtc; diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 62b6e4f9788c..c0bacbd73302 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -778,7 +778,8 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { struct ltdc_device *ldev = plane_to_ltdc(plane); - struct drm_plane_state *newstate = plane->state; + struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = newstate->fb; u32 lofs = plane->index * LAY_OFS; u32 x0 = newstate->crtc_x; diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index 3e985abdfef8..95f8cbae62d3 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -86,7 +86,8 @@ static void sun4i_backend_layer_atomic_disable(struct drm_plane *plane, static void sun4i_backend_layer_atomic_update(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); struct sun4i_layer_state *layer_state = state_to_sun4i_layer_state(new_state); struct sun4i_layer *layer = plane_to_sun4i_layer(plane); struct sun4i_backend *backend = layer->backend; diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index 07ef63531266..2dbf28448a8d 100644 --- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c @@ -306,7 +306,8 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane); unsigned int zpos = new_state->normalized_zpos; unsigned int old_zpos = old_state->normalized_zpos; diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index 4326bb9019cc..d0d16f40ebef 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -410,7 +410,8 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane); unsigned int zpos = new_state->normalized_zpos; unsigned int old_zpos = old_state->normalized_zpos; diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index c393db21c21a..455d449191ab 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -710,7 +710,8 @@ static void tegra_plane_atomic_disable(struct drm_plane *plane, static void tegra_plane_atomic_update(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); struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state); struct drm_framebuffer *fb = new_state->fb; struct tegra_plane *p = to_tegra_plane(plane); @@ -870,7 +871,8 @@ static int tegra_cursor_atomic_check(struct drm_plane *plane, static void tegra_cursor_atomic_update(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); struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state); struct tegra_dc *dc = to_tegra_dc(new_state->crtc); u32 value = CURSOR_CLIP_DISPLAY; diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c index b264c9729d94..8118007cb6d7 100644 --- a/drivers/gpu/drm/tegra/hub.c +++ b/drivers/gpu/drm/tegra/hub.c @@ -429,7 +429,8 @@ static void tegra_shared_plane_atomic_disable(struct drm_plane *plane, static void tegra_shared_plane_atomic_update(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); struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state); struct tegra_dc *dc = to_tegra_dc(new_state->crtc); unsigned int zpos = new_state->normalized_zpos; diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c index b0a4aff56095..875d678ae372 100644 --- a/drivers/gpu/drm/tidss/tidss_plane.c +++ b/drivers/gpu/drm/tidss/tidss_plane.c @@ -110,7 +110,8 @@ static void tidss_plane_atomic_update(struct drm_plane *plane, struct drm_device *ddev = plane->dev; struct tidss_device *tidss = to_tidss(ddev); struct tidss_plane *tplane = to_tidss_plane(plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); u32 hw_videoport; int ret; diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c index c7c27f577432..74a5c8832229 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c @@ -78,7 +78,8 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane, static void tilcdc_plane_atomic_update(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); if (!new_state->crtc) return; diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c index 07fd7826b6a2..964381d55fc1 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c @@ -275,7 +275,8 @@ static int vbox_primary_atomic_check(struct drm_plane *plane, static void vbox_primary_atomic_update(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); struct drm_crtc *crtc = new_state->crtc; struct drm_framebuffer *fb = new_state->fb; struct vbox_private *vbox = to_vbox_dev(fb->dev); @@ -387,7 +388,8 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct vbox_private *vbox = container_of(plane->dev, struct vbox_private, ddev); struct vbox_crtc *vbox_crtc = to_vbox_crtc(new_state->crtc); diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index d0056fab01eb..835559b6ec16 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -94,7 +94,8 @@ static const struct drm_plane_funcs vkms_plane_funcs = { static void vkms_plane_atomic_update(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); struct vkms_plane_state *vkms_plane_state; struct drm_framebuffer *fb = new_state->fb; struct vkms_composer *composer; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index dd8696fe7943..87e0b303d900 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -288,7 +288,8 @@ vmw_ldu_primary_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct vmw_private *dev_priv; struct vmw_legacy_display_unit *ldu; struct vmw_framebuffer *vfb; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 05f3111164d8..962e685f5d04 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -734,7 +734,8 @@ vmw_sou_primary_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_crtc *crtc = new_state->crtc; struct drm_pending_vblank_event *event = NULL; struct vmw_fence_obj *fence = NULL; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index 7d4f62834ec4..def3919d60f9 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -1584,7 +1584,8 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); struct drm_crtc *crtc = new_state->crtc; struct vmw_screen_target_display_unit *stdu; diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 56b1b855cfe9..64d02787a986 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1183,7 +1183,8 @@ zynqmp_disp_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct zynqmp_disp_layer *layer = plane_to_layer(plane); bool format_changed = false; diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c index fc2ac2672f1c..93bcca428e35 100644 --- a/drivers/gpu/drm/zte/zx_plane.c +++ b/drivers/gpu/drm/zte/zx_plane.c @@ -184,7 +184,8 @@ static void zx_vl_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { struct zx_plane *zplane = to_zx_plane(plane); - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, + plane); struct drm_framebuffer *fb = new_state->fb; struct drm_rect *src = &new_state->src; struct drm_rect *dst = &new_state->dst; @@ -355,7 +356,8 @@ static void zx_gl_rsz_setup(struct zx_plane *zplane, u32 src_w, u32 src_h, static void zx_gl_plane_atomic_update(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); struct zx_plane *zplane = to_zx_plane(plane); struct drm_framebuffer *fb = new_state->fb; struct drm_gem_cma_object *cma_obj;