aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-06-20 17:10:46 +1000
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 18:50:54 +1000
commit203f6eaf4182bce0031888c5b7505750b8836758 (patch)
treee2bd89c158201c9997a971c3dc122d4a415bab52
parentdrm/nouveau/kms/nv50-: convert core caps_init() to new push macros (diff)
downloadwireguard-linux-203f6eaf4182bce0031888c5b7505750b8836758.tar.xz
wireguard-linux-203f6eaf4182bce0031888c5b7505750b8836758.zip
drm/nouveau/kms/nv50-: convert core update() to new push macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/core.h6
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/core507d.c27
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/corec37d.c34
3 files changed, 33 insertions, 34 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/core.h b/drivers/gpu/drm/nouveau/dispnv50/core.h
index 15a4ce92fa25..113368d62f02 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/core.h
+++ b/drivers/gpu/drm/nouveau/dispnv50/core.h
@@ -20,7 +20,7 @@ struct nv50_core_func {
int (*caps_init)(struct nouveau_drm *, struct nv50_disp *);
int (*ntfy_wait_done)(struct nouveau_bo *, u32 offset,
struct nvif_device *);
- void (*update)(struct nv50_core *, u32 *interlock, bool ntfy);
+ int (*update)(struct nv50_core *, u32 *interlock, bool ntfy);
struct {
void (*owner)(struct nv50_core *);
@@ -46,7 +46,7 @@ int core507d_init(struct nv50_core *);
void core507d_ntfy_init(struct nouveau_bo *, u32);
int core507d_caps_init(struct nouveau_drm *, struct nv50_disp *);
int core507d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
-void core507d_update(struct nv50_core *, u32 *, bool);
+int core507d_update(struct nv50_core *, u32 *, bool);
extern const struct nv50_outp_func dac507d;
extern const struct nv50_outp_func sor507d;
@@ -63,7 +63,7 @@ int core917d_new(struct nouveau_drm *, s32, struct nv50_core **);
int corec37d_new(struct nouveau_drm *, s32, struct nv50_core **);
int corec37d_caps_init(struct nouveau_drm *, struct nv50_disp *);
int corec37d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
-void corec37d_update(struct nv50_core *, u32 *, bool);
+int corec37d_update(struct nv50_core *, u32 *, bool);
void corec37d_wndw_owner(struct nv50_core *);
extern const struct nv50_outp_func sorc37d;
diff --git a/drivers/gpu/drm/nouveau/dispnv50/core507d.c b/drivers/gpu/drm/nouveau/dispnv50/core507d.c
index 455509c74d48..4938e4b751a4 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/core507d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/core507d.c
@@ -28,21 +28,22 @@
#include "nouveau_bo.h"
-void
+int
core507d_update(struct nv50_core *core, u32 *interlock, bool ntfy)
{
- u32 *push;
- if ((push = evo_wait(&core->chan, 5))) {
- if (ntfy) {
- evo_mthd(push, 0x0084, 1);
- evo_data(push, 0x80000000 | NV50_DISP_CORE_NTFY);
- }
- evo_mthd(push, 0x0080, 2);
- evo_data(push, interlock[NV50_DISP_INTERLOCK_BASE] |
- interlock[NV50_DISP_INTERLOCK_OVLY]);
- evo_data(push, 0x00000000);
- evo_kick(push, &core->chan);
- }
+ struct nvif_push *push = core->chan.push;
+ int ret;
+
+ if ((ret = PUSH_WAIT(push, 5)))
+ return ret;
+
+ if (ntfy)
+ PUSH_NVSQ(push, NV507D, 0x0084, 0x80000000 | NV50_DISP_CORE_NTFY);
+
+ PUSH_NVSQ(push, NV507D, 0x0080, interlock[NV50_DISP_INTERLOCK_BASE] |
+ interlock[NV50_DISP_INTERLOCK_OVLY],
+ 0x0084, 0x00000000);
+ return PUSH_KICK(push);
}
int
diff --git a/drivers/gpu/drm/nouveau/dispnv50/corec37d.c b/drivers/gpu/drm/nouveau/dispnv50/corec37d.c
index 59eef8de793f..38604f5a5d8b 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/corec37d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/corec37d.c
@@ -42,28 +42,26 @@ corec37d_wndw_owner(struct nv50_core *core)
}
}
-void
+int
corec37d_update(struct nv50_core *core, u32 *interlock, bool ntfy)
{
- u32 *push;
- if ((push = evo_wait(&core->chan, 9))) {
- if (ntfy) {
- evo_mthd(push, 0x020c, 1);
- evo_data(push, 0x00001000 | NV50_DISP_CORE_NTFY);
- }
+ struct nvif_push *push = core->chan.push;
+ int ret;
- evo_mthd(push, 0x0218, 2);
- evo_data(push, interlock[NV50_DISP_INTERLOCK_CURS]);
- evo_data(push, interlock[NV50_DISP_INTERLOCK_WNDW]);
- evo_mthd(push, 0x0200, 1);
- evo_data(push, 0x00000001);
+ if ((ret = PUSH_WAIT(push, 9)))
+ return ret;
- if (ntfy) {
- evo_mthd(push, 0x020c, 1);
- evo_data(push, 0x00000000);
- }
- evo_kick(push, &core->chan);
- }
+ if (ntfy)
+ PUSH_NVSQ(push, NVC37D, 0x020c, 0x00001000 | NV50_DISP_CORE_NTFY);
+
+ PUSH_NVSQ(push, NVC37D, 0x0218, interlock[NV50_DISP_INTERLOCK_CURS],
+ 0x021c, interlock[NV50_DISP_INTERLOCK_WNDW]);
+ PUSH_NVSQ(push, NVC37D, 0x0200, 0x00000001);
+
+ if (ntfy)
+ PUSH_NVSQ(push, NVC37D, 0x020c, 0x00000000);
+
+ return PUSH_KICK(push);
}
int