drm/nouveau/kms/nv50-: convert core head_base() to new push macros
authorBen Skeggs <bskeggs@redhat.com>
Sat, 20 Jun 2020 23:19:28 +0000 (09:19 +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
drivers/gpu/drm/nouveau/dispnv50/head917d.c

index 6e1067f899382d7cd93b94bdea8bbc1eaf61efac..d8d6cf7987694f6e04b4d53bf0666827cbf6955b 100644 (file)
@@ -41,7 +41,7 @@ struct nv50_head_func {
                           struct nv50_head_atom *);
        int (*curs_set)(struct nv50_head *, struct nv50_head_atom *);
        int (*curs_clr)(struct nv50_head *);
-       void (*base)(struct nv50_head *, struct nv50_head_atom *);
+       int (*base)(struct nv50_head *, struct nv50_head_atom *);
        void (*ovly)(struct nv50_head *, struct nv50_head_atom *);
        void (*dither)(struct nv50_head *, struct nv50_head_atom *);
        void (*procamp)(struct nv50_head *, struct nv50_head_atom *);
@@ -59,7 +59,7 @@ 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 *,
                         struct nv50_head_atom *);
-void head507d_base(struct nv50_head *, struct nv50_head_atom *);
+int head507d_base(struct nv50_head *, struct nv50_head_atom *);
 void head507d_ovly(struct nv50_head *, struct nv50_head_atom *);
 void head507d_dither(struct nv50_head *, struct nv50_head_atom *);
 void head507d_procamp(struct nv50_head *, struct nv50_head_atom *);
index 8b9ec5beef8fca73b53b6160ea9f77f72b8fb9f5..3e56c3da504b3570eca13f97d829189896560282 100644 (file)
@@ -78,12 +78,13 @@ head507d_ovly(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-void
+int
 head507d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
+       struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
+       const int i = head->base.index;
        u32 bounds = 0;
-       u32 *push;
+       int ret;
 
        if (asyh->base.cpp) {
                switch (asyh->base.cpp) {
@@ -98,11 +99,11 @@ head507d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
                bounds |= 0x00000001;
        }
 
-       if ((push = evo_wait(core, 2))) {
-               evo_mthd(push, 0x0900 + head->base.index * 0x400, 1);
-               evo_data(push, bounds);
-               evo_kick(push, core);
-       }
+       if ((ret = PUSH_WAIT(push, 2)))
+               return ret;
+
+       PUSH_NVSQ(push, NV507D, 0x0900 + (i * 0x400), bounds);
+       return 0;
 }
 
 static int
index e3b30142b6f52793086bfb0e984ed53f5a7b65d1..a7202794d9c423bbf068020ca3c12584d1d9f915 100644 (file)
@@ -103,12 +103,13 @@ head907d_ovly(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-static void
+static int
 head907d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
+       struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
+       const int i = head->base.index;
        u32 bounds = 0;
-       u32 *push;
+       int ret;
 
        if (asyh->base.cpp) {
                switch (asyh->base.cpp) {
@@ -123,11 +124,11 @@ head907d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
                bounds |= 0x00000001;
        }
 
-       if ((push = evo_wait(core, 2))) {
-               evo_mthd(push, 0x04d0 + head->base.index * 0x300, 1);
-               evo_data(push, bounds);
-               evo_kick(push, core);
-       }
+       if ((ret = PUSH_WAIT(push, 2)))
+               return ret;
+
+       PUSH_NVSQ(push, NV907D, 0x04d0 + (i * 0x300), bounds);
+       return 0;
 }
 
 int
index 76958cedd51fd59185c3583e9dded9a35bb6452d..ec7511f47c71377170968bbc8a1ca937ed81484f 100644 (file)
@@ -22,6 +22,8 @@
 #include "head.h"
 #include "core.h"
 
+#include <nvif/push507c.h>
+
 static void
 head917d_dither(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
@@ -36,12 +38,13 @@ head917d_dither(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-static void
+static int
 head917d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
+       struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
+       const int i = head->base.index;
        u32 bounds = 0;
-       u32 *push;
+       int ret;
 
        if (asyh->base.cpp) {
                switch (asyh->base.cpp) {
@@ -56,11 +59,11 @@ head917d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
                bounds |= 0x00020001;
        }
 
-       if ((push = evo_wait(core, 2))) {
-               evo_mthd(push, 0x04d0 + head->base.index * 0x300, 1);
-               evo_data(push, bounds);
-               evo_kick(push, core);
-       }
+       if ((ret = PUSH_WAIT(push, 2)))
+               return ret;
+
+       PUSH_NVSQ(push, NV917D, 0x04d0 + (i * 0x300), bounds);
+       return 0;
 }
 
 int