diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-06-21 02:28:36 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-07-24 11:50:55 +0300 |
commit | ff37116ea421ed62e99e310b793214f95f1f8eb0 (patch) | |
tree | 0deb943362bea27a7f97af097191a606532457fe /drivers/gpu/drm/nouveau/dispnv50/headc37d.c | |
parent | 246db5fd38b934fb6aefc31172e3afc3e613d20d (diff) | |
download | linux-ff37116ea421ed62e99e310b793214f95f1f8eb0.tar.xz |
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.c | 51 |
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 |