drm/nouveau/kms/nv04: convert page_flip() to new push macros
authorBen Skeggs <bskeggs@redhat.com>
Mon, 22 Jun 2020 09:39:36 +0000 (19:39 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 24 Jul 2020 08:50:57 +0000 (18:50 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/nouveau/dispnv04/crtc.c
drivers/gpu/drm/nouveau/nouveau_dma.h

index 94782ba..6416b69 100644 (file)
@@ -1157,6 +1157,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
        struct nouveau_cli *cli;
        struct nouveau_fence *fence;
        struct nv04_display *dispnv04 = nv04_display(dev);
+       struct nvif_push *push;
        int head = nouveau_crtc(crtc)->index;
        int ret;
 
@@ -1164,6 +1165,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
        if (!chan)
                return -ENODEV;
        cli = (void *)chan->user.client;
+       push = chan->chan.push;
 
        s = kzalloc(sizeof(*s), GFP_KERNEL);
        if (!s)
@@ -1205,18 +1207,14 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 
        /* Emit a page flip */
        if (swap_interval) {
-               ret = RING_SPACE(chan, 8);
+               ret = PUSH_WAIT(push, 8);
                if (ret)
                        goto fail_unreserve;
 
-               BEGIN_NV04(chan, NvSubImageBlit, 0x012c, 1);
-               OUT_RING  (chan, 0);
-               BEGIN_NV04(chan, NvSubImageBlit, 0x0134, 1);
-               OUT_RING  (chan, head);
-               BEGIN_NV04(chan, NvSubImageBlit, 0x0100, 1);
-               OUT_RING  (chan, 0);
-               BEGIN_NV04(chan, NvSubImageBlit, 0x0130, 1);
-               OUT_RING  (chan, 0);
+               PUSH_NVSQ(push, NV05F, 0x012c, 0);
+               PUSH_NVSQ(push, NV05F, 0x0134, head);
+               PUSH_NVSQ(push, NV05F, 0x0100, 0);
+               PUSH_NVSQ(push, NV05F, 0x0130, 0);
        }
 
        nouveau_bo_ref(new_bo, &dispnv04->image[head]);
index 32a1f03..3531873 100644 (file)
@@ -48,7 +48,6 @@ void nv50_dma_push(struct nouveau_channel *, u64 addr, int length);
 /* Hardcoded object assignments to subchannels (subchannel id). */
 enum {
        NvSubSw         = 1,
-       NvSubImageBlit  = 2,
 };
 
 /* Object handles - for stuff that's doesn't use handle == oclass. */