From d805546a14277e37e7abe3a71a4a11957c92ab85 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Mon, 8 Jan 2024 14:26:25 +0900 Subject: [PATCH] drm/verisilicon: Add starfive_flush_dcache There is a problem that the garbage cache value comes out when the screen is displayed. Flush the cache by adding the flush feature. The feature referred to v5.15 kernel. Change-Id: I930d42cd11e55503e5acb2109674c4ea6f1e921a Signed-off-by: Hoegeun Kwon Signed-off-by: Jaehoon Chung --- drivers/gpu/drm/verisilicon/vs_dc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/verisilicon/vs_dc.c b/drivers/gpu/drm/verisilicon/vs_dc.c index 3f1e70b..4cf57fc 100644 --- a/drivers/gpu/drm/verisilicon/vs_dc.c +++ b/drivers/gpu/drm/verisilicon/vs_dc.c @@ -18,6 +18,10 @@ #include #include +#ifdef CONFIG_SIFIVE_FLUSH +#include +#endif + #include "vs_dc_hw.h" #include "vs_dc.h" #include "vs_drv.h" @@ -776,6 +780,14 @@ static void update_fb(struct vs_plane *plane, u8 display_id, fb->enable = state->visible; update_format(drm_fb->format->format, drm_fb->modifier, fb); update_swizzle(drm_fb->format->format, fb); + +#ifdef CONFIG_SIFIVE_FLUSH + starfive_flush_dcache(fb->y_address, fb->height * fb->y_stride); + if (fb->u_address) + starfive_flush_dcache(fb->u_address, fb->height * fb->u_stride); + if (fb->v_address) + starfive_flush_dcache(fb->v_address, fb->height * fb->v_stride); +#endif } static void update_plane(struct vs_dc *dc, struct vs_plane *plane, -- 2.7.4