aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-06-21 09:28:36 +1000
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 18:50:55 +1000
commitff37116ea421ed62e99e310b793214f95f1f8eb0 (patch)
tree0deb943362bea27a7f97af097191a606532457fe /drivers/gpu/drm/nouveau/dispnv50/headc37d.c
parentdrm/nouveau/kms/nv50-: convert core head_procamp() to new push macros (diff)
downloadwireguard-linux-ff37116ea421ed62e99e310b793214f95f1f8eb0.tar.xz
wireguard-linux-ff37116ea421ed62e99e310b793214f95f1f8eb0.zip
drm/nouveau/kms/nv50-: convert core head_or() 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.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
index 20d3ce45c00f..bd63245caf6b 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
@@ -25,35 +25,36 @@
#include <nvif/pushc37b.h>
-static void
+static int
headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
{
- struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
+ struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
+ const int i = head->base.index;
u8 depth;
- u32 *push;
-
- if ((push = evo_wait(core, 2))) {
- /*XXX: This is a dirty hack until OR depth handling is
- * improved later for deep colour etc.
- */
- switch (asyh->or.depth) {
- case 6: depth = 5; break;
- case 5: depth = 4; break;
- case 2: depth = 1; break;
- case 0: depth = 4; break;
- default:
- depth = asyh->or.depth;
- WARN_ON(1);
- break;
- }
-
- evo_mthd(push, 0x2004 + (head->base.index * 0x400), 1);
- evo_data(push, depth << 4 |
- asyh->or.nvsync << 3 |
- asyh->or.nhsync << 2 |
- asyh->or.crc_raster);
- evo_kick(push, core);
+ int ret;
+
+ /*XXX: This is a dirty hack until OR depth handling is
+ * improved later for deep colour etc.
+ */
+ switch (asyh->or.depth) {
+ case 6: depth = 5; break;
+ case 5: depth = 4; break;
+ case 2: depth = 1; break;
+ case 0: depth = 4; break;
+ default:
+ depth = asyh->or.depth;
+ WARN_ON(1);
+ break;
}
+
+ if ((ret = PUSH_WAIT(push, 2)))
+ return ret;
+
+ PUSH_NVSQ(push, NVC37D, 0x2004 + (i * 0x400), depth << 4 |
+ asyh->or.nvsync << 3 |
+ asyh->or.nhsync << 2 |
+ asyh->or.crc_raster);
+ return 0;
}
static int