diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-06-20 09:32:58 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-07-24 18:50:53 +1000 |
commit | 3afb4db782a3bf4e6f14912d7aeb534264d2d2e3 (patch) | |
tree | 964f2eea99e3747b8bceaa54ca344754ad5966c0 | |
parent | 85bdfcd4358832fd7185b27343ad305bf78b4269 (diff) |
drm/nouveau/kms/nv50-: convert wndw update() to new push macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/base.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/base507c.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/ovly.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/ovly507e.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/ovly827e.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/ovly907e.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/wndw.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c | 28 |
8 files changed, 29 insertions, 39 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/base.h b/drivers/gpu/drm/nouveau/dispnv50/base.h index 826f141d0d94..085bd3aeb40b 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/base.h +++ b/drivers/gpu/drm/nouveau/dispnv50/base.h @@ -15,7 +15,6 @@ int base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *); int base507c_sema_clr(struct nv50_wndw *); int base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *); int base507c_xlut_clr(struct nv50_wndw *); -void base507c_update(struct nv50_wndw *, u32 *); int base827c_new(struct nouveau_drm *, int, s32, struct nv50_wndw **); diff --git a/drivers/gpu/drm/nouveau/dispnv50/base507c.c b/drivers/gpu/drm/nouveau/dispnv50/base507c.c index 40c2f0712203..e5f189859bde 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/base507c.c +++ b/drivers/gpu/drm/nouveau/dispnv50/base507c.c @@ -32,15 +32,17 @@ #include "nouveau_bo.h" -void +int base507c_update(struct nv50_wndw *wndw, u32 *interlock) { - u32 *push; - if ((push = evo_wait(&wndw->wndw, 2))) { - evo_mthd(push, 0x0080, 1); - evo_data(push, interlock[NV50_DISP_INTERLOCK_CORE]); - evo_kick(push, &wndw->wndw); - } + struct nvif_push *push = wndw->wndw.push; + int ret; + + if ((ret = PUSH_WAIT(push, 2))) + return ret; + + PUSH_NVSQ(push, NV507C, 0x0080, interlock[NV50_DISP_INTERLOCK_CORE]); + return PUSH_KICK(push); } int diff --git a/drivers/gpu/drm/nouveau/dispnv50/ovly.h b/drivers/gpu/drm/nouveau/dispnv50/ovly.h index 71710fdaf1fa..6ae1fbe12ca7 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/ovly.h +++ b/drivers/gpu/drm/nouveau/dispnv50/ovly.h @@ -11,7 +11,6 @@ int ovly507e_acquire(struct nv50_wndw *, struct nv50_wndw_atom *, void ovly507e_release(struct nv50_wndw *, struct nv50_wndw_atom *, struct nv50_head_atom *); int ovly507e_scale_set(struct nv50_wndw *, struct nv50_wndw_atom *); -void ovly507e_update(struct nv50_wndw *, u32 *); extern const u32 ovly827e_format[]; void ovly827e_ntfy_reset(struct nouveau_bo *, u32); diff --git a/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c b/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c index 77f3c9789717..b46c95e71e49 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c +++ b/drivers/gpu/drm/nouveau/dispnv50/ovly507e.c @@ -30,17 +30,6 @@ #include <nvif/event.h> #include <nvif/push507c.h> -void -ovly507e_update(struct nv50_wndw *wndw, u32 *interlock) -{ - u32 *push; - if ((push = evo_wait(&wndw->wndw, 2))) { - evo_mthd(push, 0x0080, 1); - evo_data(push, interlock[NV50_DISP_INTERLOCK_CORE]); - evo_kick(push, &wndw->wndw); - } -} - int ovly507e_scale_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) { @@ -118,7 +107,7 @@ ovly507e = { .image_set = ovly507e_image_set, .image_clr = base507c_image_clr, .scale_set = ovly507e_scale_set, - .update = ovly507e_update, + .update = base507c_update, }; static const u32 diff --git a/drivers/gpu/drm/nouveau/dispnv50/ovly827e.c b/drivers/gpu/drm/nouveau/dispnv50/ovly827e.c index 77e19a024ac8..40b89f8648c4 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/ovly827e.c +++ b/drivers/gpu/drm/nouveau/dispnv50/ovly827e.c @@ -83,7 +83,7 @@ ovly827e = { .image_set = ovly827e_image_set, .image_clr = base507c_image_clr, .scale_set = ovly507e_scale_set, - .update = ovly507e_update, + .update = base507c_update, }; const u32 diff --git a/drivers/gpu/drm/nouveau/dispnv50/ovly907e.c b/drivers/gpu/drm/nouveau/dispnv50/ovly907e.c index c77a3b4b3cc9..b2780f5f6e64 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/ovly907e.c +++ b/drivers/gpu/drm/nouveau/dispnv50/ovly907e.c @@ -58,7 +58,7 @@ ovly907e = { .image_set = ovly907e_image_set, .image_clr = base507c_image_clr, .scale_set = ovly507e_scale_set, - .update = ovly507e_update, + .update = base507c_update, }; static const u32 diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.h b/drivers/gpu/drm/nouveau/dispnv50/wndw.h index 89c1d5602495..3278e2880034 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.h +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.h @@ -79,7 +79,7 @@ struct nv50_wndw_func { int (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *); int (*blend_set)(struct nv50_wndw *, struct nv50_wndw_atom *); - void (*update)(struct nv50_wndw *, u32 *interlock); + int (*update)(struct nv50_wndw *, u32 *interlock); }; extern const struct drm_plane_funcs nv50_wndw; @@ -89,6 +89,7 @@ int base507c_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *); int base507c_ntfy_clr(struct nv50_wndw *); int base507c_ntfy_wait_begun(struct nouveau_bo *, u32, struct nvif_device *); int base507c_image_clr(struct nv50_wndw *); +int base507c_update(struct nv50_wndw *, u32 *); void base907c_csc(struct nv50_wndw *, struct nv50_wndw_atom *, const struct drm_color_ctm *); @@ -124,7 +125,7 @@ int wndwc37e_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *); int wndwc37e_ntfy_clr(struct nv50_wndw *); int wndwc37e_image_clr(struct nv50_wndw *); int wndwc37e_blend_set(struct nv50_wndw *, struct nv50_wndw_atom *); -void wndwc37e_update(struct nv50_wndw *, u32 *); +int wndwc37e_update(struct nv50_wndw *, u32 *); int wndwc57e_new(struct nouveau_drm *, enum drm_plane_type, int, s32, struct nv50_wndw **); diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c index 8c9b0a0c289a..b000b3a86371 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c @@ -215,22 +215,22 @@ wndwc37e_sema_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) return 0; } -void +int wndwc37e_update(struct nv50_wndw *wndw, u32 *interlock) { - u32 *push; - if ((push = evo_wait(&wndw->wndw, 5))) { - evo_mthd(push, 0x0370, 2); - evo_data(push, interlock[NV50_DISP_INTERLOCK_CURS] << 1 | - interlock[NV50_DISP_INTERLOCK_CORE]); - evo_data(push, interlock[NV50_DISP_INTERLOCK_WNDW]); - evo_mthd(push, 0x0200, 1); - if (interlock[NV50_DISP_INTERLOCK_WIMM] & wndw->interlock.data) - evo_data(push, 0x00001001); - else - evo_data(push, 0x00000001); - evo_kick(push, &wndw->wndw); - } + struct nvif_push *push = wndw->wndw.push; + int ret; + + if ((ret = PUSH_WAIT(push, 5))) + return ret; + + PUSH_NVSQ(push, NVC37E, 0x0370, interlock[NV50_DISP_INTERLOCK_CURS] << 1 | + interlock[NV50_DISP_INTERLOCK_CORE], + 0x0374, interlock[NV50_DISP_INTERLOCK_WNDW]); + PUSH_NVSQ(push, NVC37E, 0x0200,((interlock[NV50_DISP_INTERLOCK_WIMM] & + wndw->interlock.data) ? 0x00001000 : 0x00000000) | + 0x00000001); + return PUSH_KICK(push); } void |