Commit 374b55802cd567e9f340b7f27d2c5e20b069ac3c

Authored by Ben Skeggs
1 parent ed3d1489d2

drm/nouveau/kms/nv50-: wait for FIFO space on PIO channels

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

Showing 3 changed files with 25 additions and 6 deletions Side-by-side Diff

drivers/gpu/drm/nouveau/dispnv50/curs507a.c
... ... @@ -24,21 +24,36 @@
24 24 #include "head.h"
25 25  
26 26 #include <nvif/cl507a.h>
  27 +#include <nvif/timer.h>
27 28  
28 29 #include <drm/drm_atomic_helper.h>
29 30 #include <drm/drm_plane_helper.h>
30 31  
  32 +bool
  33 +curs507a_space(struct nv50_wndw *wndw)
  34 +{
  35 + nvif_msec(&nouveau_drm(wndw->plane.dev)->client.device, 2,
  36 + if (nvif_rd32(&wndw->wimm.base.user, 0x0008) >= 4)
  37 + return true;
  38 + );
  39 + WARN_ON(1);
  40 + return false;
  41 +}
  42 +
31 43 static void
32 44 curs507a_update(struct nv50_wndw *wndw, u32 *interlock)
33 45 {
34   - nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000);
  46 + if (curs507a_space(wndw))
  47 + nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000);
35 48 }
36 49  
37 50 static void
38 51 curs507a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
39 52 {
40   - nvif_wr32(&wndw->wimm.base.user, 0x0084, asyw->point.y << 16 |
41   - asyw->point.x);
  53 + if (curs507a_space(wndw)) {
  54 + nvif_wr32(&wndw->wimm.base.user, 0x0084, asyw->point.y << 16 |
  55 + asyw->point.x);
  56 + }
42 57 }
43 58  
44 59 const struct nv50_wimm_func
drivers/gpu/drm/nouveau/dispnv50/cursc37a.c
... ... @@ -25,14 +25,17 @@
25 25 static void
26 26 cursc37a_update(struct nv50_wndw *wndw, u32 *interlock)
27 27 {
28   - nvif_wr32(&wndw->wimm.base.user, 0x0200, 0x00000001);
  28 + if (curs507a_space(wndw))
  29 + nvif_wr32(&wndw->wimm.base.user, 0x0200, 0x00000001);
29 30 }
30 31  
31 32 static void
32 33 cursc37a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
33 34 {
34   - nvif_wr32(&wndw->wimm.base.user, 0x0208, asyw->point.y << 16 |
35   - asyw->point.x);
  35 + if (curs507a_space(wndw)) {
  36 + nvif_wr32(&wndw->wimm.base.user, 0x0208, asyw->point.y << 16 |
  37 + asyw->point.x);
  38 + }
36 39 }
37 40  
38 41 static const struct nv50_wimm_func
drivers/gpu/drm/nouveau/dispnv50/wndw.h
... ... @@ -97,6 +97,7 @@
97 97 };
98 98  
99 99 extern const struct nv50_wimm_func curs507a;
  100 +bool curs507a_space(struct nv50_wndw *);
100 101  
101 102 int wndwc37e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
102 103 struct nv50_wndw **);