drm/nouveau/kms/nv50-: convert wndw update() to new push macros
authorBen Skeggs <bskeggs@redhat.com>
Fri, 19 Jun 2020 23:32:58 +0000 (09:32 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 24 Jul 2020 08:50:53 +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/ovly.h
drivers/gpu/drm/nouveau/dispnv50/ovly507e.c
drivers/gpu/drm/nouveau/dispnv50/ovly827e.c
drivers/gpu/drm/nouveau/dispnv50/ovly907e.c
drivers/gpu/drm/nouveau/dispnv50/wndw.h
drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c

index 826f141..085bd3a 100644 (file)
@@ -15,7 +15,6 @@ int base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 int base507c_sema_clr(struct nv50_wndw *);
 int base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 int base507c_xlut_clr(struct nv50_wndw *);
-void base507c_update(struct nv50_wndw *, u32 *);
 
 int base827c_new(struct nouveau_drm *, int, s32, struct nv50_wndw **);
 
index 40c2f07..e5f1898 100644 (file)
 
 #include "nouveau_bo.h"
 
-void
+int
 base507c_update(struct nv50_wndw *wndw, u32 *interlock)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 2))) {
-               evo_mthd(push, 0x0080, 1);
-               evo_data(push, interlock[NV50_DISP_INTERLOCK_CORE]);
-               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, 0x0080, interlock[NV50_DISP_INTERLOCK_CORE]);
+       return PUSH_KICK(push);
 }
 
 int
index 71710fd..6ae1fbe 100644 (file)
@@ -11,7 +11,6 @@ int ovly507e_acquire(struct nv50_wndw *, struct nv50_wndw_atom *,
 void ovly507e_release(struct nv50_wndw *, struct nv50_wndw_atom *,
                      struct nv50_head_atom *);
 int ovly507e_scale_set(struct nv50_wndw *, struct nv50_wndw_atom *);
-void ovly507e_update(struct nv50_wndw *, u32 *);
 
 extern const u32 ovly827e_format[];
 void ovly827e_ntfy_reset(struct nouveau_bo *, u32);
index 77f3c97..b46c95e 100644 (file)
 #include <nvif/event.h>
 #include <nvif/push507c.h>
 
-void
-ovly507e_update(struct nv50_wndw *wndw, u32 *interlock)
-{
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 2))) {
-               evo_mthd(push, 0x0080, 1);
-               evo_data(push, interlock[NV50_DISP_INTERLOCK_CORE]);
-               evo_kick(push, &wndw->wndw);
-       }
-}
-
 int
 ovly507e_scale_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
 {
@@ -118,7 +107,7 @@ ovly507e = {
        .image_set = ovly507e_image_set,
        .image_clr = base507c_image_clr,
        .scale_set = ovly507e_scale_set,
-       .update = ovly507e_update,
+       .update = base507c_update,
 };
 
 static const u32
index 77e19a0..40b89f8 100644 (file)
@@ -83,7 +83,7 @@ ovly827e = {
        .image_set = ovly827e_image_set,
        .image_clr = base507c_image_clr,
        .scale_set = ovly507e_scale_set,
-       .update = ovly507e_update,
+       .update = base507c_update,
 };
 
 const u32
index c77a3b4..b2780f5 100644 (file)
@@ -58,7 +58,7 @@ ovly907e = {
        .image_set = ovly907e_image_set,
        .image_clr = base507c_image_clr,
        .scale_set = ovly507e_scale_set,
-       .update = ovly507e_update,
+       .update = base507c_update,
 };
 
 static const u32
index 89c1d56..3278e28 100644 (file)
@@ -79,7 +79,7 @@ struct nv50_wndw_func {
        int (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
        int (*blend_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
 
-       void (*update)(struct nv50_wndw *, u32 *interlock);
+       int (*update)(struct nv50_wndw *, u32 *interlock);
 };
 
 extern const struct drm_plane_funcs nv50_wndw;
@@ -89,6 +89,7 @@ int base507c_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 int base507c_ntfy_clr(struct nv50_wndw *);
 int base507c_ntfy_wait_begun(struct nouveau_bo *, u32, struct nvif_device *);
 int base507c_image_clr(struct nv50_wndw *);
+int base507c_update(struct nv50_wndw *, u32 *);
 
 void base907c_csc(struct nv50_wndw *, struct nv50_wndw_atom *,
                  const struct drm_color_ctm *);
@@ -124,7 +125,7 @@ int wndwc37e_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 int wndwc37e_ntfy_clr(struct nv50_wndw *);
 int wndwc37e_image_clr(struct nv50_wndw *);
 int wndwc37e_blend_set(struct nv50_wndw *, struct nv50_wndw_atom *);
-void wndwc37e_update(struct nv50_wndw *, u32 *);
+int wndwc37e_update(struct nv50_wndw *, u32 *);
 
 int wndwc57e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
                 struct nv50_wndw **);
index 8c9b0a0..b000b3a 100644 (file)
@@ -215,22 +215,22 @@ wndwc37e_sema_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
        return 0;
 }
 
-void
+int
 wndwc37e_update(struct nv50_wndw *wndw, u32 *interlock)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 5))) {
-               evo_mthd(push, 0x0370, 2);
-               evo_data(push, interlock[NV50_DISP_INTERLOCK_CURS] << 1 |
-                              interlock[NV50_DISP_INTERLOCK_CORE]);
-               evo_data(push, interlock[NV50_DISP_INTERLOCK_WNDW]);
-               evo_mthd(push, 0x0200, 1);
-               if (interlock[NV50_DISP_INTERLOCK_WIMM] & wndw->interlock.data)
-                       evo_data(push, 0x00001001);
-               else
-                       evo_data(push, 0x00000001);
-               evo_kick(push, &wndw->wndw);
-       }
+       struct nvif_push *push = wndw->wndw.push;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 5)))
+               return ret;
+
+       PUSH_NVSQ(push, NVC37E, 0x0370,  interlock[NV50_DISP_INTERLOCK_CURS] << 1 |
+                                        interlock[NV50_DISP_INTERLOCK_CORE],
+                               0x0374,  interlock[NV50_DISP_INTERLOCK_WNDW]);
+       PUSH_NVSQ(push, NVC37E, 0x0200,((interlock[NV50_DISP_INTERLOCK_WIMM] &
+                                        wndw->interlock.data) ? 0x00001000 : 0x00000000) |
+                                        0x00000001);
+       return PUSH_KICK(push);
 }
 
 void