mediatek: add v4.19 support
[openwrt/staging/lynxis.git] / target / linux / brcm2708 / patches-4.19 / 950-0575-drm-v3d-Don-t-bother-flushing-L1TD-at-job-start.patch
1 From 7b8186de594a27954c909cd8a9ad1ac2cc27a526 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Mon, 3 Dec 2018 14:24:35 -0800
4 Subject: [PATCH 575/703] drm/v3d: Don't bother flushing L1TD at job start.
5
6 This is the write combiner for TMU writes. You're supposed to flush
7 that at job end if you had dirtied any cachelines. Flushing it at job
8 start then doesn't make any sense.
9
10 Signed-off-by: Eric Anholt <eric@anholt.net>
11 Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")
12 Reviewed-by: Dave Emett <david.emett@broadcom.com>
13 Link: https://patchwork.freedesktop.org/patch/msgid/20181203222438.25417-3-eric@anholt.net
14 (cherry picked from commit 2e6dc3bd80478212e84addf1cafd6ec60674b884)
15 ---
16 drivers/gpu/drm/v3d/v3d_gem.c | 12 ------------
17 1 file changed, 12 deletions(-)
18
19 --- a/drivers/gpu/drm/v3d/v3d_gem.c
20 +++ b/drivers/gpu/drm/v3d/v3d_gem.c
21 @@ -139,22 +139,10 @@ v3d_invalidate_l2(struct v3d_dev *v3d, i
22 V3D_L2CACTL_L2CENA);
23 }
24
25 -static void
26 -v3d_invalidate_l1td(struct v3d_dev *v3d, int core)
27 -{
28 - V3D_CORE_WRITE(core, V3D_CTL_L2TCACTL, V3D_L2TCACTL_TMUWCF);
29 - if (wait_for(!(V3D_CORE_READ(core, V3D_CTL_L2TCACTL) &
30 - V3D_L2TCACTL_L2TFLS), 100)) {
31 - DRM_ERROR("Timeout waiting for L1T write combiner flush\n");
32 - }
33 -}
34 -
35 /* Invalidates texture L2 cachelines */
36 static void
37 v3d_flush_l2t(struct v3d_dev *v3d, int core)
38 {
39 - v3d_invalidate_l1td(v3d, core);
40 -
41 V3D_CORE_WRITE(core, V3D_CTL_L2TCACTL,
42 V3D_L2TCACTL_L2TFLS |
43 V3D_SET_FIELD(V3D_L2TCACTL_FLM_FLUSH, V3D_L2TCACTL_FLM));