summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/dispnv50/head827d.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-06-21 04:44:39 +0300
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 11:51:02 +0300
commita41ef363f5e8a1608d5dd970aa706601145a142f (patch)
tree4ca9f0e2f60094b77f8ee1b2b4f9f0e7b262966d /drivers/gpu/drm/nouveau/dispnv50/head827d.c
parentc4c751885efb951a65f3a4df123fe08464dddbba (diff)
downloadlinux-a41ef363f5e8a1608d5dd970aa706601145a142f.tar.xz
drm/nouveau/kms/nv50-: use NVIDIA's headers for core head_olut_set()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv50/head827d.c')
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/head827d.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/head827d.c b/drivers/gpu/drm/nouveau/dispnv50/head827d.c
index 66bacb4bb712..01a8887f4bbe 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/head827d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/head827d.c
@@ -24,6 +24,8 @@
#include <nvif/push507c.h>
+#include <nvhw/class/cl827d.h>
+
static int
head827d_curs_clr(struct nv50_head *head)
{
@@ -104,9 +106,15 @@ head827d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
if ((ret = PUSH_WAIT(push, 5)))
return ret;
- PUSH_NVSQ(push, NV827D, 0x0840 + (i * 0x400), 0x80000000 | asyh->olut.mode << 30,
- 0x0844 + (i * 0x400), asyh->olut.offset >> 8);
- PUSH_NVSQ(push, NV827D, 0x085c + (i * 0x400), asyh->olut.handle);
+ PUSH_MTHD(push, NV827D, HEAD_SET_BASE_LUT_LO(i),
+ NVDEF(NV827D, HEAD_SET_BASE_LUT_LO, ENABLE, ENABLE) |
+ NVVAL(NV827D, HEAD_SET_BASE_LUT_LO, MODE, asyh->olut.mode) |
+ NVVAL(NV827D, HEAD_SET_BASE_LUT_LO, ORIGIN, 0),
+
+ HEAD_SET_BASE_LUT_HI(i),
+ NVVAL(NV827D, HEAD_SET_BASE_LUT_HI, ORIGIN, asyh->olut.offset >> 8));
+
+ PUSH_MTHD(push, NV827D, HEAD_SET_CONTEXT_DMA_LUT(i), asyh->olut.handle);
return 0;
}