diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-06-20 01:50:50 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-07-24 11:50:53 +0300 |
commit | 34838908f62a0160d2c12c12be6c3be910d17b85 (patch) | |
tree | 86ed9d560df74bc7e9839f76b43c7329f8e77c2f | |
parent | 222439ebe6d4ec94b013968b07334a55612f641b (diff) | |
download | linux-34838908f62a0160d2c12c12be6c3be910d17b85.tar.xz |
drm/nouveau/kms/nv50-: convert wndw xlut_clr() 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 | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/base507c.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/base907c.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/wndw.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c | 16 |
6 files changed, 40 insertions, 34 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/base.h b/drivers/gpu/drm/nouveau/dispnv50/base.h index 0205f08a774f..fe362aa03c8e 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/base.h +++ b/drivers/gpu/drm/nouveau/dispnv50/base.h @@ -14,7 +14,7 @@ void base507c_release(struct nv50_wndw *, struct nv50_wndw_atom *, 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 *); -void base507c_xlut_clr(struct nv50_wndw *); +int base507c_xlut_clr(struct nv50_wndw *); void base507c_image_clr(struct nv50_wndw *); void base507c_update(struct nv50_wndw *, u32 *); diff --git a/drivers/gpu/drm/nouveau/dispnv50/base507c.c b/drivers/gpu/drm/nouveau/dispnv50/base507c.c index 49eac3a79f87..760ee65613a7 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/base507c.c +++ b/drivers/gpu/drm/nouveau/dispnv50/base507c.c @@ -89,15 +89,17 @@ base507c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) } } -void +int base507c_xlut_clr(struct nv50_wndw *wndw) { - u32 *push; - if ((push = evo_wait(&wndw->wndw, 2))) { - evo_mthd(push, 0x00e0, 1); - evo_data(push, 0x00000000); - 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, 0x00e0, 0x00000000); + return 0; } int diff --git a/drivers/gpu/drm/nouveau/dispnv50/base907c.c b/drivers/gpu/drm/nouveau/dispnv50/base907c.c index 91a3c60b2fcf..d50fa80f3c99 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/base907c.c +++ b/drivers/gpu/drm/nouveau/dispnv50/base907c.c @@ -46,19 +46,19 @@ base907c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) } } -static void +static int base907c_xlut_clr(struct nv50_wndw *wndw) { - u32 *push; - if ((push = evo_wait(&wndw->wndw, 6))) { - evo_mthd(push, 0x00e0, 1); - evo_data(push, 0x00000000); - evo_mthd(push, 0x00e8, 1); - evo_data(push, 0x00000000); - evo_mthd(push, 0x00fc, 1); - evo_data(push, 0x00000000); - evo_kick(push, &wndw->wndw); - } + struct nvif_push *push = wndw->wndw.push; + int ret; + + if ((ret = PUSH_WAIT(push, 6))) + return ret; + + PUSH_NVSQ(push, NV907C, 0x00e0, 0x00000000); + PUSH_NVSQ(push, NV907C, 0x00e8, 0x00000000); + PUSH_NVSQ(push, NV907C, 0x00fc, 0x00000000); + return 0; } static int diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.h b/drivers/gpu/drm/nouveau/dispnv50/wndw.h index f6069a95fb41..6baf27090fc2 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.h +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.h @@ -73,7 +73,7 @@ struct nv50_wndw_func { int ilut_size; bool olut_core; int (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *); - void (*xlut_clr)(struct nv50_wndw *); + int (*xlut_clr)(struct nv50_wndw *); void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *); void (*image_clr)(struct nv50_wndw *); void (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *); diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c index 38778cfaeca2..eab1c322eccb 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c @@ -48,15 +48,17 @@ wndwc37e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) return 0; } -static void +static int wndwc37e_ilut_clr(struct nv50_wndw *wndw) { - u32 *push; - if ((push = evo_wait(&wndw->wndw, 2))) { - evo_mthd(push, 0x02b8, 1); - evo_data(push, 0x00000000); - 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, NVC37E, 0x02b8, 0x00000000); + return 0; } static int diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c index 1dc5a188e6ff..f393399baab1 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c @@ -92,15 +92,17 @@ wndwc57e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) return 0; } -static void +static int wndwc57e_ilut_clr(struct nv50_wndw *wndw) { - u32 *push; - if ((push = evo_wait(&wndw->wndw, 2))) { - evo_mthd(push, 0x0444, 1); - evo_data(push, 0x00000000); - 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, NVC57E, 0x0444, 0x00000000); + return 0; } static int |