Skip to content

Commit 374b558

Browse files
author
Ben Skeggs
committed
drm/nouveau/kms/nv50-: wait for FIFO space on PIO channels
Signed-off-by: Ben Skeggs <[email protected]>
1 parent ed3d148 commit 374b558

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

drivers/gpu/drm/nouveau/dispnv50/curs507a.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,36 @@
2424
#include "head.h"
2525

2626
#include <nvif/cl507a.h>
27+
#include <nvif/timer.h>
2728

2829
#include <drm/drm_atomic_helper.h>
2930
#include <drm/drm_plane_helper.h>
3031

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+
3143
static void
3244
curs507a_update(struct nv50_wndw *wndw, u32 *interlock)
3345
{
34-
nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000);
46+
if (curs507a_space(wndw))
47+
nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000);
3548
}
3649

3750
static void
3851
curs507a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
3952
{
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+
}
4257
}
4358

4459
const struct nv50_wimm_func

drivers/gpu/drm/nouveau/dispnv50/cursc37a.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@
2525
static void
2626
cursc37a_update(struct nv50_wndw *wndw, u32 *interlock)
2727
{
28-
nvif_wr32(&wndw->wimm.base.user, 0x0200, 0x00000001);
28+
if (curs507a_space(wndw))
29+
nvif_wr32(&wndw->wimm.base.user, 0x0200, 0x00000001);
2930
}
3031

3132
static void
3233
cursc37a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
3334
{
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+
}
3639
}
3740

3841
static const struct nv50_wimm_func

drivers/gpu/drm/nouveau/dispnv50/wndw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ struct nv50_wimm_func {
9797
};
9898

9999
extern const struct nv50_wimm_func curs507a;
100+
bool curs507a_space(struct nv50_wndw *);
100101

101102
int wndwc37e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
102103
struct nv50_wndw **);

0 commit comments

Comments
 (0)