b1094778b5d4b1b0715e78ee394162573be0dcee
[openwrt/staging/mkresin.git] / target / linux / brcm2708 / patches-4.19 / 950-0497-drm-v3d-Stop-trying-to-flush-L2C-on-V3D-3.3.patch
1 From abee30ca29ec11b62842934de04b5a0033bff21b Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Mon, 3 Dec 2018 14:24:37 -0800
4 Subject: [PATCH] drm/v3d: Stop trying to flush L2C on V3D 3.3+
5
6 This cache was replaced with the slice accessing the L2T in the newer
7 generations. Noted by Dave during review.
8
9 Signed-off-by: Eric Anholt <eric@anholt.net>
10 Link: https://patchwork.freedesktop.org/patch/msgid/20181203222438.25417-5-eric@anholt.net
11 Reviewed-by: Dave Emett <david.emett@broadcom.com>
12 (cherry picked from commit 7b9d2fe4350a9c12f66ad8cc78c1098226f6c3c2)
13 ---
14 drivers/gpu/drm/v3d/v3d_gem.c | 11 ++++++++---
15 1 file changed, 8 insertions(+), 3 deletions(-)
16
17 --- a/drivers/gpu/drm/v3d/v3d_gem.c
18 +++ b/drivers/gpu/drm/v3d/v3d_gem.c
19 @@ -130,10 +130,15 @@ v3d_flush_l3(struct v3d_dev *v3d)
20 }
21 }
22
23 -/* Invalidates the (read-only) L2 cache. */
24 +/* Invalidates the (read-only) L2C cache. This was the L2 cache for
25 + * uniforms and instructions on V3D 3.2.
26 + */
27 static void
28 -v3d_invalidate_l2(struct v3d_dev *v3d, int core)
29 +v3d_invalidate_l2c(struct v3d_dev *v3d, int core)
30 {
31 + if (v3d->ver > 32)
32 + return;
33 +
34 V3D_CORE_WRITE(core, V3D_CTL_L2CACTL,
35 V3D_L2CACTL_L2CCLR |
36 V3D_L2CACTL_L2CENA);
37 @@ -168,7 +173,7 @@ v3d_invalidate_caches(struct v3d_dev *v3
38 {
39 v3d_flush_l3(v3d);
40
41 - v3d_invalidate_l2(v3d, 0);
42 + v3d_invalidate_l2c(v3d, 0);
43 v3d_invalidate_slices(v3d, 0);
44 v3d_flush_l2t(v3d, 0);
45 }