summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-06-20 11:34:00 +0300
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 11:50:54 +0300
commit1f772f5a08b28fd3d6fc385af70133952a202725 (patch)
tree7918486ed98b6598ed9ac732a01ec25150c07db9 /drivers/gpu/drm/nouveau/dispnv50/headc37d.c
parent9ec5e8204053a46f9e0b6107844641eb4b3426a4 (diff)
downloadlinux-1f772f5a08b28fd3d6fc385af70133952a202725.tar.xz
drm/nouveau/kms/nv50-: convert core head_view() to new push macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv50/headc37d.c')
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/headc37d.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
index 35fcdf8825b5..0bdf2d2725bc 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
@@ -23,6 +23,8 @@
#include "atom.h"
#include "core.h"
+#include <nvif/pushc37b.h>
+
static void
headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
{
@@ -190,18 +192,19 @@ headc37d_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
}
}
-void
+int
headc37d_view(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, 4))) {
- evo_mthd(push, 0x204c + (head->base.index * 0x400), 1);
- evo_data(push, (asyh->view.iH << 16) | asyh->view.iW);
- evo_mthd(push, 0x2058 + (head->base.index * 0x400), 1);
- evo_data(push, (asyh->view.oH << 16) | asyh->view.oW);
- 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, 0x204c + (i * 0x400), asyh->view.iH << 16 | asyh->view.iW);
+ PUSH_NVSQ(push, NVC37D, 0x2058 + (i * 0x400), asyh->view.oH << 16 | asyh->view.oW);
+ return 0;
}
void