drm/verisilicon: Add starfive_flush_dcache
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 8 Jan 2024 05:26:25 +0000 (14:26 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 19 Feb 2024 00:13:54 +0000 (09:13 +0900)
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 <hoegeun.kwon@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/gpu/drm/verisilicon/vs_dc.c

index 3f1e70b..4cf57fc 100644 (file)
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_vblank.h>
 
+#ifdef CONFIG_SIFIVE_FLUSH
+#include <soc/sifive/sifive_ccache.h>
+#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,