summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-06-21 01:58:11 +0300
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 11:50:54 +0300
commita5df76301caedcb60bc5db6909547391277e7950 (patch)
treec3c80fd2f4a28a02baf80ba07f88e2ba0e7890d2 /drivers/gpu/drm/nouveau/dispnv50/headc37d.c
parentcaa966a7a6e57c61181e38de34d145df76a4f00b (diff)
downloadlinux-a5df76301caedcb60bc5db6909547391277e7950.tar.xz
drm/nouveau/kms/nv50-: convert core head_olut_set() 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.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
index e15a4d3afa4e..4363fccdaf73 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
@@ -137,20 +137,22 @@ headc37d_olut_clr(struct nv50_head *head)
}
}
-static void
+static int
headc37d_olut_set(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, 0x20a4 + (head->base.index * 0x400), 3);
- evo_data(push, asyh->olut.output_mode << 8 |
- asyh->olut.range << 4 |
- asyh->olut.size);
- evo_data(push, asyh->olut.offset >> 8);
- evo_data(push, asyh->olut.handle);
- 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, 0x20a4 + (i * 0x400), asyh->olut.output_mode << 8 |
+ asyh->olut.range << 4 |
+ asyh->olut.size,
+ 0x20a8 + (i * 0x400), asyh->olut.offset >> 8,
+ 0x20ac + (i * 0x400), asyh->olut.handle);
+ return 0;
}
static bool