From: Ben Skeggs Date: Sat, 20 Jun 2020 07:04:57 +0000 (+1000) Subject: drm/nouveau/kms/nv50-: convert core init() to new push macros X-Git-Tag: v5.10.7~1861^2~13^2~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e691222eac66e730e0fa6bd10e7564f3db202d5;p=platform%2Fkernel%2Flinux-rpi.git drm/nouveau/kms/nv50-: convert core init() to new push macros Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul --- diff --git a/drivers/gpu/drm/nouveau/dispnv50/core.h b/drivers/gpu/drm/nouveau/dispnv50/core.h index e021cb3..15a4ce9 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/core.h +++ b/drivers/gpu/drm/nouveau/dispnv50/core.h @@ -15,7 +15,7 @@ int nv50_core_new(struct nouveau_drm *, struct nv50_core **); void nv50_core_del(struct nv50_core **); struct nv50_core_func { - void (*init)(struct nv50_core *); + int (*init)(struct nv50_core *); void (*ntfy_init)(struct nouveau_bo *, u32 offset); int (*caps_init)(struct nouveau_drm *, struct nv50_disp *); int (*ntfy_wait_done)(struct nouveau_bo *, u32 offset, @@ -42,7 +42,7 @@ struct nv50_core_func { int core507d_new(struct nouveau_drm *, s32, struct nv50_core **); int core507d_new_(const struct nv50_core_func *, struct nouveau_drm *, s32, struct nv50_core **); -void core507d_init(struct nv50_core *); +int core507d_init(struct nv50_core *); void core507d_ntfy_init(struct nouveau_bo *, u32); int core507d_caps_init(struct nouveau_drm *, struct nv50_disp *); int core507d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *); diff --git a/drivers/gpu/drm/nouveau/dispnv50/core507d.c b/drivers/gpu/drm/nouveau/dispnv50/core507d.c index 1d66f69..ce6f649 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/core507d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/core507d.c @@ -23,6 +23,7 @@ #include "head.h" #include +#include #include #include "nouveau_bo.h" @@ -76,15 +77,17 @@ core507d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp) return 0; } -void +int core507d_init(struct nv50_core *core) { - u32 *push; - if ((push = evo_wait(&core->chan, 2))) { - evo_mthd(push, 0x0088, 1); - evo_data(push, core->chan.sync.handle); - evo_kick(push, &core->chan); - } + struct nvif_push *push = core->chan.push; + int ret; + + if ((ret = PUSH_WAIT(push, 2))) + return ret; + + PUSH_NVSQ(push, NV507D, 0x0088, core->chan.sync.handle); + return PUSH_KICK(push); } static const struct nv50_core_func diff --git a/drivers/gpu/drm/nouveau/dispnv50/corec37d.c b/drivers/gpu/drm/nouveau/dispnv50/corec37d.c index a4a307e..59eef8d 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/corec37d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/corec37d.c @@ -23,10 +23,11 @@ #include "head.h" #include -#include - +#include #include +#include + void corec37d_wndw_owner(struct nv50_core *core) { @@ -112,24 +113,26 @@ int corec37d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp) return 0; } -static void +static int corec37d_init(struct nv50_core *core) { + struct nvif_push *push = core->chan.push; const u32 windows = 8; /*XXX*/ - u32 *push, i; - if ((push = evo_wait(&core->chan, 2 + 5 * windows))) { - evo_mthd(push, 0x0208, 1); - evo_data(push, core->chan.sync.handle); - for (i = 0; i < windows; i++) { - evo_mthd(push, 0x1004 + (i * 0x080), 2); - evo_data(push, 0x0000001f); - evo_data(push, 0x00000000); - evo_mthd(push, 0x1010 + (i * 0x080), 1); - evo_data(push, 0x00127fff); - } - evo_kick(push, &core->chan); - core->assign_windows = true; + int ret, i; + + if ((ret = PUSH_WAIT(push, 2 + windows * 5))) + return ret; + + PUSH_NVSQ(push, NVC37D, 0x0208, core->chan.sync.handle); + + for (i = 0; i < windows; i++) { + PUSH_NVSQ(push, NVC37D, 0x1004 + (i * 0x080), 0x0000001f, + 0x1008 + (i * 0x080), 0x00000000); + PUSH_NVSQ(push, NVC37D, 0x1010 + (i * 0x080), 0x00127fff); } + + core->assign_windows = true; + return PUSH_KICK(push); } static const struct nv50_core_func diff --git a/drivers/gpu/drm/nouveau/dispnv50/corec57d.c b/drivers/gpu/drm/nouveau/dispnv50/corec57d.c index e1c11eb..afc703a 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/corec57d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/corec57d.c @@ -22,24 +22,28 @@ #include "core.h" #include "head.h" -static void +#include + +static int corec57d_init(struct nv50_core *core) { + struct nvif_push *push = core->chan.push; const u32 windows = 8; /*XXX*/ - u32 *push, i; - if ((push = evo_wait(&core->chan, 2 + 5 * windows))) { - evo_mthd(push, 0x0208, 1); - evo_data(push, core->chan.sync.handle); - for (i = 0; i < windows; i++) { - evo_mthd(push, 0x1004 + (i * 0x080), 2); - evo_data(push, 0x0000000f); - evo_data(push, 0x00000000); - evo_mthd(push, 0x1010 + (i * 0x080), 1); - evo_data(push, 0x00117fff); - } - evo_kick(push, &core->chan); - core->assign_windows = true; + int ret, i; + + if ((ret = PUSH_WAIT(push, 2 + windows * 5))) + return ret; + + PUSH_NVSQ(push, NVC57D, 0x0208, core->chan.sync.handle); + + for (i = 0; i < windows; i++) { + PUSH_NVSQ(push, NVC57D, 0x1004 + (i * 0x080), 0x0000000f, + 0x1008 + (i * 0x080), 0x00000000); + PUSH_NVSQ(push, NVC57D, 0x1010 + (i * 0x080), 0x00117fff); } + + core->assign_windows = true; + return PUSH_KICK(push); } static const struct nv50_core_func