drm/nouveau/kms/nv50-: convert wndw xlut_set() to new push macros
authorBen Skeggs <bskeggs@redhat.com>
Fri, 19 Jun 2020 22:47:20 +0000 (08:47 +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/base907c.c
drivers/gpu/drm/nouveau/dispnv50/wndw.h
drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c
drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c

index 03b655f02b680ddbb5a6f42ab26a45bf52db3c42..0205f08a774f7952420f09b039e78ef1319c5df8 100644 (file)
@@ -13,7 +13,7 @@ void base507c_release(struct nv50_wndw *, struct nv50_wndw_atom *,
                      struct nv50_head_atom *);
 int base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 int base507c_sema_clr(struct nv50_wndw *);
-void base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
+int base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
 void base507c_xlut_clr(struct nv50_wndw *);
 void base507c_image_clr(struct nv50_wndw *);
 void base507c_update(struct nv50_wndw *, u32 *);
index d707a75d9fdbba0b803b3e9eca6d6ed46e4559b8..49eac3a79f87099e3dea8ddf0bfff6bb67693002 100644 (file)
@@ -100,15 +100,17 @@ base507c_xlut_clr(struct nv50_wndw *wndw)
        }
 }
 
-void
+int
 base507c_xlut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 2))) {
-               evo_mthd(push, 0x00e0, 1);
-               evo_data(push, 0x40000000);
-               evo_kick(push, &wndw->wndw);
-       }
+       struct nvif_push *push = wndw->wndw.push;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 2)))
+               return ret;
+
+       PUSH_NVSQ(push, NV507C, 0x00e0, 0x40000000);
+       return 0;
 }
 
 int
index 78efecc39450e78ee942aa4e69d1f32e14c81fe5..91a3c60b2fcf9503da87761a191d97a7dfbf97da 100644 (file)
@@ -61,20 +61,21 @@ base907c_xlut_clr(struct nv50_wndw *wndw)
        }
 }
 
-static void
+static int
 base907c_xlut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 6))) {
-               evo_mthd(push, 0x00e0, 3);
-               evo_data(push, asyw->xlut.i.enable << 30 |
-                              asyw->xlut.i.mode << 24);
-               evo_data(push, asyw->xlut.i.offset >> 8);
-               evo_data(push, 0x40000000);
-               evo_mthd(push, 0x00fc, 1);
-               evo_data(push, asyw->xlut.handle);
-               evo_kick(push, &wndw->wndw);
-       }
+       struct nvif_push *push = wndw->wndw.push;
+       int ret;
+
+       if ((ret = PUSH_WAIT(push, 6)))
+               return ret;
+
+       PUSH_NVSQ(push, NV907C, 0x00e0, asyw->xlut.i.enable << 30 |
+                                       asyw->xlut.i.mode << 24,
+                               0x00e4, asyw->xlut.i.offset >> 8,
+                               0x00e8, 0x40000000);
+       PUSH_NVSQ(push, NV907C, 0x00fc, asyw->xlut.handle);
+       return 0;
 }
 
 static bool
index 578715747db53adb162b017d64bc4ee5e4eb7b61..f6069a95fb4108162ac4e40ccc01607a199221e9 100644 (file)
@@ -72,7 +72,7 @@ struct nv50_wndw_func {
        bool ilut_identity;
        int  ilut_size;
        bool olut_core;
-       void (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
+       int (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
        void (*xlut_clr)(struct nv50_wndw *);
        void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
        void (*image_clr)(struct nv50_wndw *);
index 8ed979836d637acdf4decacc4d7232af9b9d5989..38778cfaeca28c9e51477d5bab7ab9c19fb075a8 100644 (file)
@@ -59,19 +59,21 @@ wndwc37e_ilut_clr(struct nv50_wndw *wndw)
        }
 }
 
-static void
+static int
 wndwc37e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 4))) {
-               evo_mthd(push, 0x02b0, 3);
-               evo_data(push, asyw->xlut.i.output_mode << 8 |
-                              asyw->xlut.i.range << 4 |
-                              asyw->xlut.i.size);
-               evo_data(push, asyw->xlut.i.offset >> 8);
-               evo_data(push, asyw->xlut.handle);
-               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, 0x02b0, asyw->xlut.i.output_mode << 8 |
+                                       asyw->xlut.i.range << 4 |
+                                       asyw->xlut.i.size,
+                               0x02b4, asyw->xlut.i.offset >> 8,
+                               0x02b8, asyw->xlut.handle);
+       return 0;
 }
 
 static bool
index 1c33e18258d5dbedde2a6093f25a4a6ae64c67bb..1dc5a188e6ffec0612be8d2436501212f2138312 100644 (file)
@@ -103,19 +103,21 @@ wndwc57e_ilut_clr(struct nv50_wndw *wndw)
        }
 }
 
-static void
+static int
 wndwc57e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
 {
-       u32 *push;
-       if ((push = evo_wait(&wndw->wndw, 4))) {
-               evo_mthd(push, 0x0440, 3);
-               evo_data(push, asyw->xlut.i.size << 8 |
-                              asyw->xlut.i.mode << 2 |
-                              asyw->xlut.i.output_mode);
-               evo_data(push, asyw->xlut.handle);
-               evo_data(push, asyw->xlut.i.offset >> 8);
-               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, NVC57E, 0x0440, asyw->xlut.i.size << 8 |
+                                       asyw->xlut.i.mode << 2 |
+                                       asyw->xlut.i.output_mode,
+                               0x0444, asyw->xlut.handle,
+                               0x0448, asyw->xlut.i.offset >> 8);
+       return 0;
 }
 
 static u16