]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/nouveau/kms/nv50-: convert core head_procamp() to new push macros
authorBen Skeggs <bskeggs@redhat.com>
Sat, 20 Jun 2020 23:25:19 +0000 (09:25 +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/headc37d.c
drivers/gpu/drm/nouveau/dispnv50/headc57d.c

index 5cc65ca2c14b92e6dfc3d23e6f8a5952de3cd4e6..5fca0b725fe4c8c4539d1d2974d3a0e1751f4edb 100644 (file)
@@ -44,7 +44,7 @@ struct nv50_head_func {
        int (*base)(struct nv50_head *, struct nv50_head_atom *);
        int (*ovly)(struct nv50_head *, struct nv50_head_atom *);
        int (*dither)(struct nv50_head *, struct nv50_head_atom *);
-       void (*procamp)(struct nv50_head *, struct nv50_head_atom *);
+       int (*procamp)(struct nv50_head *, struct nv50_head_atom *);
        void (*or)(struct nv50_head *, struct nv50_head_atom *);
        void (*static_wndw_map)(struct nv50_head *, struct nv50_head_atom *);
 };
@@ -62,7 +62,7 @@ int head507d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
 int head507d_base(struct nv50_head *, struct nv50_head_atom *);
 int head507d_ovly(struct nv50_head *, struct nv50_head_atom *);
 int head507d_dither(struct nv50_head *, struct nv50_head_atom *);
-void head507d_procamp(struct nv50_head *, struct nv50_head_atom *);
+int head507d_procamp(struct nv50_head *, struct nv50_head_atom *);
 
 extern const struct nv50_head_func head827d;
 
@@ -77,7 +77,7 @@ int head907d_core_clr(struct nv50_head *);
 int head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
 int head907d_curs_clr(struct nv50_head *);
 int head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
-void head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
+int head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
 void head907d_or(struct nv50_head *, struct nv50_head_atom *);
 
 extern const struct nv50_head_func head917d;
index 34300607fc539f430de003baa07652b51e19375b..2e72ee410fa74a24ca77ceac63aff8861acd7963 100644 (file)
 
 #include <nvif/push507c.h>
 
-void
+int
 head507d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
-       u32 *push;
-       if ((push = evo_wait(core, 2))) {
-               evo_mthd(push, 0x08a8 + (head->base.index * 0x400), 1);
-               evo_data(push, asyh->procamp.sat.sin << 20 |
-                              asyh->procamp.sat.cos << 8);
-               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, 0x08a8 + (i * 0x400), asyh->procamp.sat.sin << 20 |
+                                                     asyh->procamp.sat.cos << 8);
+       return 0;
 }
 
 int
index b7fda2284e173bb845985bb772624ceadf9f92a2..b6b406d60b81708ca9ccd1fbfd045a951c45aa82 100644 (file)
@@ -48,17 +48,19 @@ head907d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-void
+int
 head907d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
-       u32 *push;
-       if ((push = evo_wait(core, 2))) {
-               evo_mthd(push, 0x0498 + (head->base.index * 0x300), 1);
-               evo_data(push, asyh->procamp.sat.sin << 20 |
-                              asyh->procamp.sat.cos << 8);
-               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, 0x0498 + (i * 0x300), asyh->procamp.sat.sin << 20 |
+                                                     asyh->procamp.sat.cos << 8);
+       return 0;
 }
 
 static int
index 0accc19991a4010187f23648251136b17006af22..20d3ce45c00f8c039b0841da06246df017b327fc 100644 (file)
@@ -56,18 +56,20 @@ headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-static void
+static int
 headc37d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
-       u32 *push;
-       if ((push = evo_wait(core, 2))) {
-               evo_mthd(push, 0x2000 + (head->base.index * 0x400), 1);
-               evo_data(push, 0x80000000 |
-                              asyh->procamp.sat.sin << 16 |
-                              asyh->procamp.sat.cos << 4);
-               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, NVC37D, 0x2000 + (i * 0x400), 0x80000000 |
+                                                     asyh->procamp.sat.sin << 16 |
+                                                     asyh->procamp.sat.cos << 4);
+       return 0;
 }
 
 int
index a39f7447c8a8f73afb91ae26da447fcacce7e744..751ffefd30553bb26e226ad189b772aee5d0e8df 100644 (file)
@@ -57,22 +57,19 @@ headc57d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-static void
+static int
 headc57d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
-       u32 *push;
-       if ((push = evo_wait(core, 2))) {
-               evo_mthd(push, 0x2000 + (head->base.index * 0x400), 1);
-#if 0
-               evo_data(push, 0x80000000 |
-                              asyh->procamp.sat.sin << 16 |
-                              asyh->procamp.sat.cos << 4);
-#else
-               evo_data(push, 0);
-#endif
-               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;
+
+       //TODO:
+       PUSH_NVSQ(push, NVC57D, 0x2000 + (i * 0x400), 0x00000000);
+       return 0;
 }
 
 static int