From 0a4693e80dc9a57f2133439e58a697f2d7730c4d Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sat, 20 Jun 2020 09:24:21 +1000 Subject: [PATCH] drm/nouveau/kms/nv50-: convert wndw scale_set() to new push macros Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/ovly.h | 2 +- drivers/gpu/drm/nouveau/dispnv50/ovly507e.c | 20 +++++++++++--------- drivers/gpu/drm/nouveau/dispnv50/wndw.h | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/ovly.h b/drivers/gpu/drm/nouveau/dispnv50/ovly.h index 89e84c66a081..71710fdaf1fa 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/ovly.h +++ b/drivers/gpu/drm/nouveau/dispnv50/ovly.h @@ -10,7 +10,7 @@ int ovly507e_acquire(struct nv50_wndw *, struct nv50_wndw_atom *, struct nv50_head_atom *); void ovly507e_release(struct nv50_wndw *, struct nv50_wndw_atom *, struct nv50_head_atom *); -void ovly507e_scale_set(struct nv50_wndw *, struct nv50_wndw_atom *); +int ovly507e_scale_set(struct nv50_wndw *, struct nv50_wndw_atom *); void ovly507e_update(struct nv50_wndw *, u32 *); extern const u32 ovly827e_format[]; diff --git a/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c b/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c index 1460dc529420..77f3c9789717 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c +++ b/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c @@ -41,17 +41,19 @@ ovly507e_update(struct nv50_wndw *wndw, u32 *interlock) } } -void +int ovly507e_scale_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) { - u32 *push; - if ((push = evo_wait(&wndw->wndw, 4))) { - evo_mthd(push, 0x00e0, 3); - evo_data(push, asyw->scale.sy << 16 | asyw->scale.sx); - evo_data(push, asyw->scale.sh << 16 | asyw->scale.sw); - evo_data(push, asyw->scale.dw); - evo_kick(push, &wndw->wndw); - } + struct nvif_push *push = wndw->wndw.push; + int ret; + + if ((ret = PUSH_WAIT(push, 4))) + return ret; + + PUSH_NVSQ(push, NV507E, 0x00e0, asyw->scale.sy << 16 | asyw->scale.sx, + 0x00e4, asyw->scale.sh << 16 | asyw->scale.sw, + 0x00e8, asyw->scale.dw); + return 0; } static int diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.h b/drivers/gpu/drm/nouveau/dispnv50/wndw.h index 41b418177646..92985e332531 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.h +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.h @@ -76,7 +76,7 @@ struct nv50_wndw_func { int (*xlut_clr)(struct nv50_wndw *); int (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *); int (*image_clr)(struct nv50_wndw *); - void (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *); + int (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *); void (*blend_set)(struct nv50_wndw *, struct nv50_wndw_atom *); void (*update)(struct nv50_wndw *, u32 *interlock);