summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-02-17 07:33:57 +0300
committerBen Skeggs <bskeggs@redhat.com>2020-04-07 07:37:50 +0300
commit374b55802cd567e9f340b7f27d2c5e20b069ac3c (patch)
tree69d884e550a38caa1ae26711f25407827e9a9c33 /drivers/gpu/drm/nouveau/dispnv50/curs507a.c
parented3d1489d2717a13f3b47b296bb2faa7ce4168da (diff)
downloadlinux-374b55802cd567e9f340b7f27d2c5e20b069ac3c.tar.xz
drm/nouveau/kms/nv50-: wait for FIFO space on PIO channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv50/curs507a.c')
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/curs507a.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
index 397143b639c6..8c5cf096f69b 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
@@ -24,21 +24,36 @@
#include "head.h"
#include <nvif/cl507a.h>
+#include <nvif/timer.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_plane_helper.h>
+bool
+curs507a_space(struct nv50_wndw *wndw)
+{
+ nvif_msec(&nouveau_drm(wndw->plane.dev)->client.device, 2,
+ if (nvif_rd32(&wndw->wimm.base.user, 0x0008) >= 4)
+ return true;
+ );
+ WARN_ON(1);
+ return false;
+}
+
static void
curs507a_update(struct nv50_wndw *wndw, u32 *interlock)
{
- nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000);
+ if (curs507a_space(wndw))
+ nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000);
}
static void
curs507a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
- nvif_wr32(&wndw->wimm.base.user, 0x0084, asyw->point.y << 16 |
- asyw->point.x);
+ if (curs507a_space(wndw)) {
+ nvif_wr32(&wndw->wimm.base.user, 0x0084, asyw->point.y << 16 |
+ asyw->point.x);
+ }
}
const struct nv50_wimm_func