drm/nouveau/kms/nv50-: convert core head_core_clr() to new push macros
authorBen Skeggs <bskeggs@redhat.com>
Sat, 20 Jun 2020 23:07:28 +0000 (09:07 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 24 Jul 2020 08:50:55 +0000 (18:50 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/nouveau/dispnv50/head.h
drivers/gpu/drm/nouveau/dispnv50/head507d.c
drivers/gpu/drm/nouveau/dispnv50/head907d.c

index 17c5fc77848a6c17cb38959c5bafc399a7b9fdd9..e30c9bbd7bfc30385409b327deed0e778319e78c 100644 (file)
@@ -34,7 +34,7 @@ struct nv50_head_func {
        int (*olut_clr)(struct nv50_head *);
        void (*core_calc)(struct nv50_head *, struct nv50_head_atom *);
        int (*core_set)(struct nv50_head *, struct nv50_head_atom *);
-       void (*core_clr)(struct nv50_head *);
+       int (*core_clr)(struct nv50_head *);
        int (*curs_layout)(struct nv50_head *, struct nv50_wndw_atom *,
                           struct nv50_head_atom *);
        int (*curs_format)(struct nv50_head *, struct nv50_wndw_atom *,
@@ -54,7 +54,7 @@ int head507d_view(struct nv50_head *, struct nv50_head_atom *);
 int head507d_mode(struct nv50_head *, struct nv50_head_atom *);
 bool head507d_olut(struct nv50_head *, struct nv50_head_atom *, int);
 void head507d_core_calc(struct nv50_head *, struct nv50_head_atom *);
-void head507d_core_clr(struct nv50_head *);
+int head507d_core_clr(struct nv50_head *);
 int head507d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
                         struct nv50_head_atom *);
 int head507d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
@@ -73,7 +73,7 @@ bool head907d_olut(struct nv50_head *, struct nv50_head_atom *, int);
 int head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
 int head907d_olut_clr(struct nv50_head *);
 int head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
-void head907d_core_clr(struct nv50_head *);
+int head907d_core_clr(struct nv50_head *);
 void head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
 void head907d_curs_clr(struct nv50_head *);
 void head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
@@ -86,7 +86,6 @@ int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
 
 extern const struct nv50_head_func headc37d;
 int headc37d_view(struct nv50_head *, struct nv50_head_atom *);
-void headc37d_core_clr(struct nv50_head *);
 int headc37d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
                         struct nv50_head_atom *);
 void headc37d_curs_set(struct nv50_head *, struct nv50_head_atom *);
index 3b280607bfc674d7545590d79ed926d4d1a32903..f062cd1b19dfe7a08479870afc05ca84853e83be 100644 (file)
@@ -157,16 +157,18 @@ head507d_curs_layout(struct nv50_head *head, struct nv50_wndw_atom *asyw,
        return 0;
 }
 
-void
+int
 head507d_core_clr(struct nv50_head *head)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
-       u32 *push;
-       if ((push = evo_wait(core, 2))) {
-               evo_mthd(push, 0x0874 + head->base.index * 0x400, 1);
-               evo_data(push, 0x00000000);
-               evo_kick(push, core);
-       }
+       struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
+       const int i = head->base.index;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 2)))
+               return ret;
+
+       PUSH_NVSQ(push, NV507D, 0x0874 + (i * 0x400), 0x00000000);
+       return 0;
 }
 
 static int
index 0957e25f30bd7347b7786ec0decc8ff0ea84991a..2e2b33b84c57a4083f4b4c811b7500f669af05a7 100644 (file)
@@ -160,16 +160,18 @@ head907d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-void
+int
 head907d_core_clr(struct nv50_head *head)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
-       u32 *push;
-       if ((push = evo_wait(core, 2))) {
-               evo_mthd(push, 0x0474 + head->base.index * 0x300, 1);
-               evo_data(push, 0x00000000);
-               evo_kick(push, core);
-       }
+       struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
+       const int i = head->base.index;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 2)))
+               return ret;
+
+       PUSH_NVSQ(push, NV907D, 0x0474 + (i * 0x300), 0x00000000);
+       return 0;
 }
 
 int