drm/nouveau/kms/nv50-: convert wndw image_clr() to new push macros
authorBen Skeggs <bskeggs@redhat.com>
Fri, 19 Jun 2020 23:23:10 +0000 (09:23 +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 fe362aa03c8e01324bcfbddb4a2b0f9dbc363b52..826f141d0d94d4f0dce38e803b76ec2482dd1dc0 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_image_clr(struct nv50_wndw *);
 void base507c_update(struct nv50_wndw *, u32 *);
 
 int base827c_new(struct nouveau_drm *, int, s32, struct nv50_wndw **);
index ae1c5cc00957904de74110016df652d2f67c372e..40c2f0712203830f25a6a25d5fade86fa32031d5 100644 (file)
@@ -43,17 +43,18 @@ base507c_update(struct nv50_wndw *wndw, u32 *interlock)
        }
 }
 
-void
+int
 base507c_image_clr(struct nv50_wndw *wndw)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 4))) {
-               evo_mthd(push, 0x0084, 1);
-               evo_data(push, 0x00000000);
-               evo_mthd(push, 0x00c0, 1);
-               evo_data(push, 0x00000000);
-               evo_kick(push, &wndw->wndw);
-       }
+       struct nvif_push *push = wndw->wndw.push;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 4)))
+               return ret;
+
+       PUSH_NVSQ(push, NV507C, 0x0084, 0x00000000);
+       PUSH_NVSQ(push, NV507C, 0x00c0, 0x00000000);
+       return 0;
 }
 
 static int
index 1048fc6bc7785c9b18d54e12d35dbe649791a0b2..89e84c66a0810861ff0781be5e82aaa5a52a90a6 100644 (file)
@@ -10,7 +10,6 @@ int ovly507e_acquire(struct nv50_wndw *, struct nv50_wndw_atom *,
                     struct nv50_head_atom *);
 void ovly507e_release(struct nv50_wndw *, struct nv50_wndw_atom *,
                      struct nv50_head_atom *);
-void ovly507e_image_clr(struct nv50_wndw *);
 void ovly507e_scale_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 void ovly507e_update(struct nv50_wndw *, u32 *);
 
index e182f376900fde56d08ffecb8f6fe0515fbf0179..1460dc52942014c06e68512c3385c72c842f8d41 100644 (file)
@@ -54,19 +54,6 @@ ovly507e_scale_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
        }
 }
 
-void
-ovly507e_image_clr(struct nv50_wndw *wndw)
-{
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 4))) {
-               evo_mthd(push, 0x0084, 1);
-               evo_data(push, 0x00000000);
-               evo_mthd(push, 0x00c0, 1);
-               evo_data(push, 0x00000000);
-               evo_kick(push, &wndw->wndw);
-       }
-}
-
 static int
 ovly507e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
 {
@@ -127,7 +114,7 @@ ovly507e = {
        .ntfy_reset = base507c_ntfy_reset,
        .ntfy_wait_begun = base507c_ntfy_wait_begun,
        .image_set = ovly507e_image_set,
-       .image_clr = ovly507e_image_clr,
+       .image_clr = base507c_image_clr,
        .scale_set = ovly507e_scale_set,
        .update = ovly507e_update,
 };
index cb0f372cbcf7ae91f86e9065d5cb874152d04952..77e19a024ac84323be2fb09b2f26d7b89aee5f4a 100644 (file)
@@ -81,7 +81,7 @@ ovly827e = {
        .ntfy_reset = ovly827e_ntfy_reset,
        .ntfy_wait_begun = ovly827e_ntfy_wait_begun,
        .image_set = ovly827e_image_set,
-       .image_clr = ovly507e_image_clr,
+       .image_clr = base507c_image_clr,
        .scale_set = ovly507e_scale_set,
        .update = ovly507e_update,
 };
index 6b83daff15601c66869184f71b79ae4c9c8067c4..c77a3b4b3cc92dd18746c6fe7a57cbb54248b724 100644 (file)
@@ -56,7 +56,7 @@ ovly907e = {
        .ntfy_reset = ovly827e_ntfy_reset,
        .ntfy_wait_begun = ovly827e_ntfy_wait_begun,
        .image_set = ovly907e_image_set,
-       .image_clr = ovly507e_image_clr,
+       .image_clr = base507c_image_clr,
        .scale_set = ovly507e_scale_set,
        .update = ovly507e_update,
 };
index d6e1c29da37962a09f79d3498c1e859372bb51c7..41b4181776465c2f4ac7984886c5045a72e2f556 100644 (file)
@@ -75,7 +75,7 @@ struct nv50_wndw_func {
        int (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
        int (*xlut_clr)(struct nv50_wndw *);
        int (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
-       void (*image_clr)(struct nv50_wndw *);
+       int (*image_clr)(struct nv50_wndw *);
        void (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
        void (*blend_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
 
@@ -88,6 +88,7 @@ void base507c_ntfy_reset(struct nouveau_bo *, u32);
 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 *);
 
 void base907c_csc(struct nv50_wndw *, struct nv50_wndw_atom *,
                  const struct drm_color_ctm *);
@@ -121,7 +122,7 @@ int wndwc37e_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 int wndwc37e_sema_clr(struct nv50_wndw *);
 int wndwc37e_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 int wndwc37e_ntfy_clr(struct nv50_wndw *);
-void wndwc37e_image_clr(struct nv50_wndw *);
+int wndwc37e_image_clr(struct nv50_wndw *);
 void wndwc37e_blend_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 void wndwc37e_update(struct nv50_wndw *, u32 *);
 
index 24cb4e9b356e59b335647f8e0275c570f45f5ad1..8b9afc6c692419e2f861f2d7679a7e6b2db559e5 100644 (file)
@@ -112,17 +112,18 @@ wndwc37e_blend_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
        }
 }
 
-void
+int
 wndwc37e_image_clr(struct nv50_wndw *wndw)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 4))) {
-               evo_mthd(push, 0x0308, 1);
-               evo_data(push, 0x00000000);
-               evo_mthd(push, 0x0240, 1);
-               evo_data(push, 0x00000000);
-               evo_kick(push, &wndw->wndw);
-       }
+       struct nvif_push *push = wndw->wndw.push;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 4)))
+               return ret;
+
+       PUSH_NVSQ(push, NVC37E, 0x0308, 0x00000000);
+       PUSH_NVSQ(push, NVC37E, 0x0240, 0x00000000);
+       return 0;
 }
 
 static int