diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-06-20 02:20:17 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-07-24 11:50:53 +0300 |
commit | 6d6e11e2844015a5f6c3d0373966fd4a459add8b (patch) | |
tree | be9a3cf55f5ec297ceecd79b826993a9a5d82e2d /drivers/gpu/drm/nouveau/dispnv50/ovly507e.c | |
parent | 34838908f62a0160d2c12c12be6c3be910d17b85 (diff) | |
download | linux-6d6e11e2844015a5f6c3d0373966fd4a459add8b.tar.xz |
drm/nouveau/kms/nv50-: convert wndw image_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/ovly507e.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/ovly507e.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c b/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c index 151064aa19e1..e182f376900f 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c +++ b/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c @@ -28,6 +28,7 @@ #include <nvif/cl507e.h> #include <nvif/event.h> +#include <nvif/push507c.h> void ovly507e_update(struct nv50_wndw *wndw, u32 *interlock) @@ -66,30 +67,28 @@ ovly507e_image_clr(struct nv50_wndw *wndw) } } -static void +static int ovly507e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) { - u32 *push; - if ((push = evo_wait(&wndw->wndw, 12))) { - evo_mthd(push, 0x0084, 1); - evo_data(push, asyw->image.interval << 4); - evo_mthd(push, 0x00c0, 1); - evo_data(push, asyw->image.handle[0]); - evo_mthd(push, 0x0100, 1); - evo_data(push, 0x00000002); - evo_mthd(push, 0x0800, 1); - evo_data(push, asyw->image.offset[0] >> 8); - evo_mthd(push, 0x0808, 3); - evo_data(push, asyw->image.h << 16 | asyw->image.w); - evo_data(push, asyw->image.layout << 20 | - (asyw->image.pitch[0] >> 8) << 8 | - asyw->image.blocks[0] << 8 | - asyw->image.blockh); - evo_data(push, asyw->image.kind << 16 | - asyw->image.format << 8 | - asyw->image.colorspace); - evo_kick(push, &wndw->wndw); - } + struct nvif_push *push = wndw->wndw.push; + int ret; + + if ((ret = PUSH_WAIT(push, 12))) + return ret; + + PUSH_NVSQ(push, NV507E, 0x0084, asyw->image.interval << 4); + PUSH_NVSQ(push, NV507E, 0x00c0, asyw->image.handle[0]); + PUSH_NVSQ(push, NV507E, 0x0100, 0x00000002); + PUSH_NVSQ(push, NV507E, 0x0800, asyw->image.offset[0] >> 8); + PUSH_NVSQ(push, NV507E, 0x0808, asyw->image.h << 16 | asyw->image.w, + 0x080c, asyw->image.layout << 20 | + (asyw->image.pitch[0] >> 8) << 8 | + asyw->image.blocks[0] << 8 | + asyw->image.blockh, + 0x0810, asyw->image.kind << 16 | + asyw->image.format << 8 | + asyw->image.colorspace); + return 0; } void |