summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchanghuang.liang <changhuang.liang@starfivetech.com>2022-06-02 05:22:15 +0300
committerJianlong Huang <jianlong.huang@starfivetech.com>2022-06-13 06:39:17 +0300
commite6cdbc5fbaa2d43a1dd38b80101e4f5683b40498 (patch)
treeb08d7b4b09687f6855ac279b8012217e6b9f3a83
parentf4ad34ac9281539d7a300ead201b77e1c1830bcc (diff)
downloadlinux-e6cdbc5fbaa2d43a1dd38b80101e4f5683b40498.tar.xz
drm: buffer flush l2cache
Signed-off-by: changhuang.liang <changhuang.liang@starfivetech.com>
-rwxr-xr-xdrivers/gpu/drm/starfive/starfive_drm_crtc.h1
-rwxr-xr-xdrivers/gpu/drm/starfive/starfive_drm_plane.c1
-rwxr-xr-xdrivers/gpu/drm/starfive/starfive_drm_vpp.c3
3 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/starfive/starfive_drm_crtc.h b/drivers/gpu/drm/starfive/starfive_drm_crtc.h
index ab81cae24e48..f4810766d1ff 100755
--- a/drivers/gpu/drm/starfive/starfive_drm_crtc.h
+++ b/drivers/gpu/drm/starfive/starfive_drm_crtc.h
@@ -79,6 +79,7 @@ struct starfive_crtc {
int encoder_type;
dma_addr_t dma_addr;
bool dma_addr_change;
+ size_t size;
};
#define to_starfive_crtc(x) container_of(x, struct starfive_crtc, crtc)
diff --git a/drivers/gpu/drm/starfive/starfive_drm_plane.c b/drivers/gpu/drm/starfive/starfive_drm_plane.c
index b146d4716a97..864ca67edd88 100755
--- a/drivers/gpu/drm/starfive/starfive_drm_plane.c
+++ b/drivers/gpu/drm/starfive/starfive_drm_plane.c
@@ -123,6 +123,7 @@ static void starfive_plane_atomic_update(struct drm_plane *plane,
} else
sf_crtc->dma_addr_change = false;
+ sf_crtc->size = obj->size;
}
static int starfive_plane_atomic_async_check(struct drm_plane *plane,
diff --git a/drivers/gpu/drm/starfive/starfive_drm_vpp.c b/drivers/gpu/drm/starfive/starfive_drm_vpp.c
index 5ecdd5e73662..4b6c6b88ba44 100755
--- a/drivers/gpu/drm/starfive/starfive_drm_vpp.c
+++ b/drivers/gpu/drm/starfive/starfive_drm_vpp.c
@@ -9,7 +9,7 @@
#include <video/starfive_fb.h>
#include "starfive_drm_vpp.h"
#include "starfive_drm_crtc.h"
-
+#include <soc/sifive/sifive_l2_cache.h>
//#define SF_PP_DEBUG 1
#ifdef SF_PP_DEBUG
@@ -588,6 +588,7 @@ irqreturn_t vpp1_isr_handler(int this_irq, void *dev_id)
intr_status = sf_fb_vppread32(sf_crtc, 1, PP_INT_STATUS);
sf_fb_vppwrite32(sf_crtc, 1, PP_INT_CLR, 0xf);
+ sifive_l2_flush64_range(sf_crtc->dma_addr, sf_crtc->size);
return IRQ_HANDLED;
}