brcm2708: rename target to bcm27xx
[openwrt/staging/wigyori.git] / target / linux / bcm27xx / patches-4.19 / 950-0496-drm-v3d-Drop-the-wait-for-L2T-flush-to-complete.patch
1 From 9d8fa62500ae52348d36766e70b49c7508addaf3 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Mon, 3 Dec 2018 14:24:36 -0800
4 Subject: [PATCH] drm/v3d: Drop the wait for L2T flush to complete.
5
6 According to Dave, once you've started an L2T flush, all L2T accesses
7 will be blocked until the flush completes. This fixes a consistent
8 3-4ms stall between the ioctl and running the job, and 3DMMES Taiji
9 goes from 27fps to 110fps.
10
11 v2: Leave a note about why we don't need to wait for completion.
12
13 Signed-off-by: Eric Anholt <eric@anholt.net>
14 Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")
15 Reviewed-by: Dave Emett <david.emett@broadcom.com>
16 Link: https://patchwork.freedesktop.org/patch/msgid/20181203222438.25417-4-eric@anholt.net
17 (cherry picked from commit 51c1b6f9eb3dbdec91b0e3c89f623e634c996bbb)
18 ---
19 drivers/gpu/drm/v3d/v3d_gem.c | 8 ++++----
20 1 file changed, 4 insertions(+), 4 deletions(-)
21
22 --- a/drivers/gpu/drm/v3d/v3d_gem.c
23 +++ b/drivers/gpu/drm/v3d/v3d_gem.c
24 @@ -143,13 +143,13 @@ v3d_invalidate_l2(struct v3d_dev *v3d, i
25 static void
26 v3d_flush_l2t(struct v3d_dev *v3d, int core)
27 {
28 + /* While there is a busy bit (V3D_L2TCACTL_L2TFLS), we don't
29 + * need to wait for completion before dispatching the job --
30 + * L2T accesses will be stalled until the flush has completed.
31 + */
32 V3D_CORE_WRITE(core, V3D_CTL_L2TCACTL,
33 V3D_L2TCACTL_L2TFLS |
34 V3D_SET_FIELD(V3D_L2TCACTL_FLM_FLUSH, V3D_L2TCACTL_FLM));
35 - if (wait_for(!(V3D_CORE_READ(core, V3D_CTL_L2TCACTL) &
36 - V3D_L2TCACTL_L2TFLS), 100)) {
37 - DRM_ERROR("Timeout waiting for L2T flush\n");
38 - }
39 }
40
41 /* Invalidates the slice caches. These are read-only caches. */