drm/nouveau/kms/nv50-: convert wndw sema_clr() to new push macros
authorBen Skeggs <bskeggs@redhat.com>
Fri, 19 Jun 2020 22:04:01 +0000 (08:04 +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/base.h
drivers/gpu/drm/nouveau/dispnv50/base507c.c
drivers/gpu/drm/nouveau/dispnv50/wndw.h
drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c

index a3e4e50c1558ea381bfb12e1bfc66248f0cbb87c..c59fd620f3922d894a2b5abfb351c039489b8a5f 100644 (file)
@@ -12,7 +12,7 @@ int base507c_acquire(struct nv50_wndw *, struct nv50_wndw_atom *,
 void base507c_release(struct nv50_wndw *, struct nv50_wndw_atom *,
                      struct nv50_head_atom *);
 int base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
-void base507c_sema_clr(struct nv50_wndw *);
+int base507c_sema_clr(struct nv50_wndw *);
 void base507c_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 void base507c_ntfy_clr(struct nv50_wndw *);
 void base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
index ed0e5ce2190cc53984cb4b3ad408c9fa88de0493..c9c920358d95c8083f31f8dcce914c4ca6a6cdf7 100644 (file)
@@ -153,15 +153,17 @@ base507c_ntfy_reset(struct nouveau_bo *bo, u32 offset)
        nouveau_bo_wr32(bo, offset / 4, 0x00000000);
 }
 
-void
+int
 base507c_sema_clr(struct nv50_wndw *wndw)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 2))) {
-               evo_mthd(push, 0x0094, 1);
-               evo_data(push, 0x00000000);
-               evo_kick(push, &wndw->wndw);
-       }
+       struct nvif_push *push = wndw->wndw.push;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 2)))
+               return ret;
+
+       PUSH_NVSQ(push, NV507C, 0x0094, 0x00000000);
+       return 0;
 }
 
 int
index 419cc30b3c64b4d913ba6ff019b59e2e78a15c4c..84bd402f935c2378bf66f925c33d26817cc075f2 100644 (file)
@@ -58,7 +58,7 @@ struct nv50_wndw_func {
                        struct nv50_wndw_atom *asyw);
 
        int (*sema_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
-       void (*sema_clr)(struct nv50_wndw *);
+       int (*sema_clr)(struct nv50_wndw *);
        void (*ntfy_reset)(struct nouveau_bo *, u32 offset);
        void (*ntfy_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
        void (*ntfy_clr)(struct nv50_wndw *);
@@ -116,7 +116,7 @@ int wndwc37e_acquire(struct nv50_wndw *, struct nv50_wndw_atom *,
 void wndwc37e_release(struct nv50_wndw *, struct nv50_wndw_atom *,
                      struct nv50_head_atom *);
 int wndwc37e_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
-void wndwc37e_sema_clr(struct nv50_wndw *);
+int wndwc37e_sema_clr(struct nv50_wndw *);
 void wndwc37e_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 void wndwc37e_ntfy_clr(struct nv50_wndw *);
 void wndwc37e_image_clr(struct nv50_wndw *);
index c135eeeeed22f4a2ab73882faa136a4924104ed7..965807f8b635316900ade5d3d1cb8ffbcb4bdab3 100644 (file)
@@ -175,15 +175,17 @@ wndwc37e_ntfy_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
        }
 }
 
-void
+int
 wndwc37e_sema_clr(struct nv50_wndw *wndw)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 2))) {
-               evo_mthd(push, 0x0218, 1);
-               evo_data(push, 0x00000000);
-               evo_kick(push, &wndw->wndw);
-       }
+       struct nvif_push *push = wndw->wndw.push;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 2)))
+               return ret;
+
+       PUSH_NVSQ(push, NVC37E, 0x0218, 0x00000000);
+       return 0;
 }
 
 int