OSDN Git Service

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

index e49ef06..6e1067f 100644 (file)
@@ -40,7 +40,7 @@ struct nv50_head_func {
        int (*curs_format)(struct nv50_head *, struct nv50_wndw_atom *,
                           struct nv50_head_atom *);
        int (*curs_set)(struct nv50_head *, struct nv50_head_atom *);
-       void (*curs_clr)(struct nv50_head *);
+       int (*curs_clr)(struct nv50_head *);
        void (*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 *);
@@ -75,7 +75,7 @@ int head907d_olut_clr(struct nv50_head *);
 int head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
 int head907d_core_clr(struct nv50_head *);
 int head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
-void head907d_curs_clr(struct nv50_head *);
+int head907d_curs_clr(struct nv50_head *);
 void head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
 void head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
 void head907d_or(struct nv50_head *, struct nv50_head_atom *);
@@ -89,7 +89,7 @@ int headc37d_view(struct nv50_head *, struct nv50_head_atom *);
 int headc37d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
                         struct nv50_head_atom *);
 int headc37d_curs_set(struct nv50_head *, struct nv50_head_atom *);
-void headc37d_curs_clr(struct nv50_head *);
+int headc37d_curs_clr(struct nv50_head *);
 void headc37d_dither(struct nv50_head *, struct nv50_head_atom *);
 void headc37d_static_wndw_map(struct nv50_head *, struct nv50_head_atom *);
 
index 2cdbf49..8b9ec5b 100644 (file)
@@ -105,16 +105,18 @@ head507d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-static void
+static int
 head507d_curs_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, 0x0880 + head->base.index * 0x400, 1);
-               evo_data(push, 0x05000000);
-               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, 0x0880 + (i * 0x400), 0x05000000);
+       return 0;
 }
 
 static int
index 6b1b683..66bacb4 100644 (file)
 
 #include <nvif/push507c.h>
 
-static void
+static int
 head827d_curs_clr(struct nv50_head *head)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
-       u32 *push;
-       if ((push = evo_wait(core, 4))) {
-               evo_mthd(push, 0x0880 + head->base.index * 0x400, 1);
-               evo_data(push, 0x05000000);
-               evo_mthd(push, 0x089c + 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, 4)))
+               return ret;
+
+       PUSH_NVSQ(push, NV827D, 0x0880 + (i * 0x400), 0x05000000);
+       PUSH_NVSQ(push, NV827D, 0x089c + (i * 0x400), 0x00000000);
+       return 0;
 }
 
 static int
index 32dd0de..e3b3014 100644 (file)
@@ -130,18 +130,19 @@ head907d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-void
+int
 head907d_curs_clr(struct nv50_head *head)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
-       u32 *push;
-       if ((push = evo_wait(core, 4))) {
-               evo_mthd(push, 0x0480 + head->base.index * 0x300, 1);
-               evo_data(push, 0x05000000);
-               evo_mthd(push, 0x048c + 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, 4)))
+               return ret;
+
+       PUSH_NVSQ(push, NV907D, 0x0480 + (i * 0x300), 0x05000000);
+       PUSH_NVSQ(push, NV907D, 0x048c + (i * 0x300), 0x00000000);
+       return 0;
 }
 
 int
index 89ac5d7..2ecfcf4 100644 (file)
@@ -84,18 +84,19 @@ headc37d_dither(struct nv50_head *head, struct nv50_head_atom *asyh)
        }
 }
 
-void
+int
 headc37d_curs_clr(struct nv50_head *head)
 {
-       struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
-       u32 *push;
-       if ((push = evo_wait(core, 4))) {
-               evo_mthd(push, 0x209c + head->base.index * 0x400, 1);
-               evo_data(push, 0x000000cf);
-               evo_mthd(push, 0x2088 + 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, 4)))
+               return ret;
+
+       PUSH_NVSQ(push, NVC37D, 0x209c + (i * 0x400), 0x000000cf);
+       PUSH_NVSQ(push, NVC37D, 0x2088 + (i * 0x400), 0x00000000);
+       return 0;
 }
 
 int