From patchwork Wed Nov 23 17:28:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13054034 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 710AAC433FE for ; Wed, 23 Nov 2022 17:32:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2974410E5EC; Wed, 23 Nov 2022 17:32:38 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by gabe.freedesktop.org (Postfix) with ESMTP id B904A10E5C6 for ; Wed, 23 Nov 2022 17:29:30 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.96,187,1665414000"; d="scan'208";a="143666643" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Nov 2022 02:29:29 +0900 Received: from localhost.localdomain (unknown [10.226.92.61]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 306AA40ADCCF; Thu, 24 Nov 2022 02:29:26 +0900 (JST) From: Biju Das To: David Airlie , Daniel Vetter Subject: [PATCH v6 05/19] drm: rcar-du: Move rcar_du_vsp_atomic_flush() Date: Wed, 23 Nov 2022 17:28:52 +0000 Message-Id: <20221123172906.2919734-6-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221123172906.2919734-1-biju.das.jz@bp.renesas.com> References: <20221123172906.2919734-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Geert Uytterhoeven , Prabhakar Mahadev Lad , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Kieran Bingham , Laurent Pinchart , Biju Das Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move rcar_du_vsp_atomic_flush() to RCar DU vsp lib. Signed-off-by: Biju Das --- v6: * Rebased on drm-misc-next and DU-next. v1->v2: * Rebased on drm-misc-next and DU-next. --- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 13 ------------- drivers/gpu/drm/rcar-du/rcar_du_vsp.h | 2 -- drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.c | 14 ++++++++++++++ drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.h | 2 ++ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 685e3e8f6ddb..870b72eda4da 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -88,19 +88,6 @@ void rcar_du_vsp_enable(struct rcar_du_crtc *crtc) vsp1_du_setup_lif(crtc->vsp->vsp, crtc->vsp_pipe, &cfg); } -void rcar_du_vsp_atomic_flush(struct rcar_du_crtc *crtc) -{ - struct vsp1_du_atomic_pipe_config cfg = { { 0, } }; - struct rcar_du_crtc_state *state; - - state = to_rcar_crtc_state(crtc->crtc.state); - cfg.crc = state->crc; - - rcar_du_writeback_setup(crtc, &cfg.writeback); - - vsp1_du_atomic_flush(crtc->vsp->vsp, crtc->vsp_pipe, &cfg); -} - static const u32 rcar_du_vsp_formats[] = { DRM_FORMAT_RGB332, DRM_FORMAT_ARGB4444, diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h index 83a2f3e85860..b610e6b40304 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h @@ -61,7 +61,6 @@ to_rcar_vsp_plane_state(struct drm_plane_state *state) int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np, unsigned int crtcs); void rcar_du_vsp_enable(struct rcar_du_crtc *crtc); -void rcar_du_vsp_atomic_flush(struct rcar_du_crtc *crtc); int rcar_du_vsp_map_fb(struct rcar_du_vsp *vsp, struct drm_framebuffer *fb, struct sg_table sg_tables[3]); void rcar_du_vsp_unmap_fb(struct rcar_du_vsp *vsp, struct drm_framebuffer *fb, @@ -74,7 +73,6 @@ static inline int rcar_du_vsp_init(struct rcar_du_vsp *vsp, return -ENXIO; } static inline void rcar_du_vsp_enable(struct rcar_du_crtc *crtc) { }; -static inline void rcar_du_vsp_atomic_flush(struct rcar_du_crtc *crtc) { }; static inline int rcar_du_vsp_map_fb(struct rcar_du_vsp *vsp, struct drm_framebuffer *fb, struct sg_table sg_tables[3]) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.c index f6c0cae7c4af..89169dc7594a 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.c @@ -10,6 +10,7 @@ #include #include "rcar_du_drv.h" +#include "rcar_du_writeback.h" void rcar_du_vsp_disable(struct rcar_du_crtc *crtc) { @@ -20,3 +21,16 @@ void rcar_du_vsp_atomic_begin(struct rcar_du_crtc *crtc) { vsp1_du_atomic_begin(crtc->vsp->vsp, crtc->vsp_pipe); } + +void rcar_du_vsp_atomic_flush(struct rcar_du_crtc *crtc) +{ + struct vsp1_du_atomic_pipe_config cfg = { { 0, } }; + struct rcar_du_crtc_state *state; + + state = to_rcar_crtc_state(crtc->crtc.state); + cfg.crc = state->crc; + + rcar_du_writeback_setup(crtc, &cfg.writeback); + + vsp1_du_atomic_flush(crtc->vsp->vsp, crtc->vsp_pipe, &cfg); +} diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.h b/drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.h index 8c22042d4a80..e8f16236be0a 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp_lib.h @@ -13,9 +13,11 @@ #ifdef CONFIG_DRM_RCAR_VSP void rcar_du_vsp_disable(struct rcar_du_crtc *crtc); void rcar_du_vsp_atomic_begin(struct rcar_du_crtc *crtc); +void rcar_du_vsp_atomic_flush(struct rcar_du_crtc *crtc); #else static inline void rcar_du_vsp_disable(struct rcar_du_crtc *crtc) { }; static inline void rcar_du_vsp_atomic_begin(struct rcar_du_crtc *crtc) { }; +static inline void rcar_du_vsp_atomic_flush(struct rcar_du_crtc *crtc) { }; #endif #endif /* __RCAR_DU_VSP_LIB_H__ */