drm/nouveau/kms/nv50-: convert wimm update() to new push macros
authorBen Skeggs <bskeggs@redhat.com>
Sun, 21 Jun 2020 00:22:35 +0000 (10:22 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 24 Jul 2020 08:50:52 +0000 (18:50 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/nouveau/dispnv50/curs507a.c
drivers/gpu/drm/nouveau/dispnv50/cursc37a.c
drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
drivers/gpu/drm/nouveau/dispnv50/wndw.h

index babf680c25fdffb79ee8fe37c575717bdc351b49..47f6f01b52a047db58d8becb8bf730cf640c3310 100644 (file)
@@ -40,11 +40,13 @@ curs507a_space(struct nv50_wndw *wndw)
        return false;
 }
 
-static void
+static int
 curs507a_update(struct nv50_wndw *wndw, u32 *interlock)
 {
-       if (curs507a_space(wndw))
+       int ret = nvif_chan_wait(&wndw->wimm, 1);
+       if (ret == 0)
                nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000);
+       return ret;
 }
 
 static int
index 45c1c33e950ad0121451438e506eb9ae63ede997..9d96a246b39a3dd82c084e20c05f8e8de1c90d03 100644 (file)
 #include "curs.h"
 #include "atom.h"
 
-static void
+static int
 cursc37a_update(struct nv50_wndw *wndw, u32 *interlock)
 {
-       if (curs507a_space(wndw))
+       int ret = nvif_chan_wait(&wndw->wimm, 1);
+       if (ret == 0)
                nvif_wr32(&wndw->wimm.base.user, 0x0200, 0x00000001);
+       return ret;
 }
 
 static int
index 4eb5abfb8ebf74581a6d35aa391a549a2045f231..c2009d4777360cdb7ae8016aa5869a7b29f369c8 100644 (file)
 #include <nvif/clc37b.h>
 #include <nvif/pushc37b.h>
 
-static void
+static int
 wimmc37b_update(struct nv50_wndw *wndw, u32 *interlock)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wimm, 2))) {
-               evo_mthd(push, 0x0200, 1);
-               if (interlock[NV50_DISP_INTERLOCK_WNDW] & wndw->interlock.data)
-                       evo_data(push, 0x00000003);
-               else
-                       evo_data(push, 0x00000001);
-               evo_kick(push, &wndw->wimm);
-       }
+       struct nvif_push *push = wndw->wimm.push;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 2)))
+               return ret;
+
+       PUSH_NVSQ(push, NVC37B, 0x0200, ((interlock[NV50_DISP_INTERLOCK_WNDW] &
+                                         wndw->interlock.data) ? 0x00000002 : 0x00000000) |
+                                       0x00000001);
+       return PUSH_KICK(push);
 }
 
 static int
index 53e496bfbc9d839158c537c711fe3792ef32ffdf..ce1b2baf9d19ece3bd7f9c1345e0cc6aa10770bc 100644 (file)
@@ -93,7 +93,7 @@ void base907c_csc(struct nv50_wndw *, struct nv50_wndw_atom *,
 struct nv50_wimm_func {
        int (*point)(struct nv50_wndw *, struct nv50_wndw_atom *);
 
-       void (*update)(struct nv50_wndw *, u32 *interlock);
+       int (*update)(struct nv50_wndw *, u32 *interlock);
 };
 
 extern const struct nv50_wimm_func curs507a;