diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-06-20 11:34:00 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-07-24 11:50:54 +0300 |
commit | 1f772f5a08b28fd3d6fc385af70133952a202725 (patch) | |
tree | 7918486ed98b6598ed9ac732a01ec25150c07db9 /drivers/gpu/drm/nouveau/dispnv50/head507d.c | |
parent | 9ec5e8204053a46f9e0b6107844641eb4b3426a4 (diff) | |
download | linux-1f772f5a08b28fd3d6fc385af70133952a202725.tar.xz |
drm/nouveau/kms/nv50-: convert core head_view() 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/head507d.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/head507d.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/head507d.c b/drivers/gpu/drm/nouveau/dispnv50/head507d.c index 66ccf36b56a2..df0bc706bdbe 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head507d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head507d.c @@ -22,6 +22,8 @@ #include "head.h" #include "core.h" +#include <nvif/push507c.h> + void head507d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) { @@ -310,21 +312,21 @@ head507d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) } } -void +int head507d_view(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, 7))) { - evo_mthd(push, 0x08a4 + (head->base.index * 0x400), 1); - evo_data(push, 0x00000000); - evo_mthd(push, 0x08c8 + (head->base.index * 0x400), 1); - evo_data(push, asyh->view.iH << 16 | asyh->view.iW); - evo_mthd(push, 0x08d8 + (head->base.index * 0x400), 2); - evo_data(push, asyh->view.oH << 16 | asyh->view.oW); - evo_data(push, asyh->view.oH << 16 | asyh->view.oW); - 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, 7))) + return ret; + + PUSH_NVSQ(push, NV507D, 0x08a4 + (i * 0x400), 0x00000000); + PUSH_NVSQ(push, NV507D, 0x08c8 + (i * 0x400), asyh->view.iH << 16 | asyh->view.iW); + PUSH_NVSQ(push, NV507D, 0x08d8 + (i * 0x400), asyh->view.oH << 16 | asyh->view.oW, + 0x08dc + (i * 0x400), asyh->view.oH << 16 | asyh->view.oW); + return 0; } const struct nv50_head_func |