From d7ce92e27303082f00cf0976d673f4cc0a5f1c5f Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 19 May 2017 23:59:34 +1000 Subject: [PATCH] drm/nouveau/disp: rename nvkm_output to nvkm_outp This isn't technically "output", but, "display/output path". Not all users of nvkm_output have been changed here. The remaining ones belong to code that's disappearing in upcoming commits. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c | 22 +++++++-------- drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | 20 ++++++------- drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h | 33 +++++++++++++--------- .../gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c | 3 +- 5 files changed, 42 insertions(+), 38 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c index 1efe91b..5330921 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c @@ -96,7 +96,7 @@ nvkm_disp_hpd_ctor(struct nvkm_object *object, void *data, u32 size, union { struct nvif_notify_conn_req_v0 v0; } *req = data; - struct nvkm_output *outp; + struct nvkm_outp *outp; int ret = -ENOSYS; if (!(ret = nvif_unpack(ret, &data, &size, req->v0, 0, 0, false))) { @@ -211,10 +211,10 @@ nvkm_disp_fini(struct nvkm_engine *engine, bool suspend) { struct nvkm_disp *disp = nvkm_disp(engine); struct nvkm_connector *conn; - struct nvkm_output *outp; + struct nvkm_outp *outp; list_for_each_entry(outp, &disp->outp, head) { - nvkm_output_fini(outp); + nvkm_outp_fini(outp); } list_for_each_entry(conn, &disp->conn, head) { @@ -229,14 +229,14 @@ nvkm_disp_init(struct nvkm_engine *engine) { struct nvkm_disp *disp = nvkm_disp(engine); struct nvkm_connector *conn; - struct nvkm_output *outp; + struct nvkm_outp *outp; list_for_each_entry(conn, &disp->conn, head) { nvkm_connector_init(conn); } list_for_each_entry(outp, &disp->outp, head) { - nvkm_output_init(outp); + nvkm_outp_init(outp); } return 0; @@ -247,7 +247,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine) { struct nvkm_disp *disp = nvkm_disp(engine); struct nvkm_connector *conn; - struct nvkm_output *outp; + struct nvkm_outp *outp; void *data = disp; if (disp->func->dtor) @@ -259,7 +259,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine) while (!list_empty(&disp->outp)) { outp = list_first_entry(&disp->outp, typeof(*outp), head); list_del(&outp->head); - nvkm_output_del(&outp); + nvkm_outp_del(&outp); } while (!list_empty(&disp->conn)) { @@ -285,7 +285,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, int index, int heads, struct nvkm_disp *disp) { struct nvkm_bios *bios = device->bios; - struct nvkm_output *outp, *outt, *pair; + struct nvkm_outp *outp, *outt, *pair; struct nvkm_connector *conn; struct nvbios_connE connE; struct dcb_output dcbE; @@ -307,7 +307,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, while ((data = dcb_outp_parse(bios, ++i, &ver, &hdr, &dcbE))) { const struct nvkm_disp_func_outp *outps; int (*ctor)(struct nvkm_disp *, int, struct dcb_output *, - struct nvkm_output **); + struct nvkm_outp **); if (dcbE.type == DCB_OUTPUT_UNUSED) continue; @@ -350,7 +350,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, } nvkm_error(&disp->engine.subdev, "failed to create output %d\n", i); - nvkm_output_del(&outp); + nvkm_outp_del(&outp); continue; } @@ -411,7 +411,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, outp->index, ret); nvkm_connector_del(&outp->conn); list_del(&outp->head); - nvkm_output_del(&outp); + nvkm_outp_del(&outp); continue; } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c index 1a3c460b..35d9f0f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c @@ -566,7 +566,7 @@ nvkm_output_dp_ctor(const struct nvkm_output_dp_func *func, u32 data; int ret; - nvkm_output_ctor(&nvkm_output_dp_func, disp, index, dcbE, &outp->base); + nvkm_outp_ctor(&nvkm_output_dp_func, disp, index, dcbE, &outp->base); outp->func = func; outp->aux = aux; if (!outp->aux) { diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c index bbe5ec0..f030ff5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c @@ -28,23 +28,23 @@ #include void -nvkm_output_fini(struct nvkm_output *outp) +nvkm_outp_fini(struct nvkm_outp *outp) { if (outp->func->fini) outp->func->fini(outp); } void -nvkm_output_init(struct nvkm_output *outp) +nvkm_outp_init(struct nvkm_outp *outp) { if (outp->func->init) outp->func->init(outp); } void -nvkm_output_del(struct nvkm_output **poutp) +nvkm_outp_del(struct nvkm_outp **poutp) { - struct nvkm_output *outp = *poutp; + struct nvkm_outp *outp = *poutp; if (outp && !WARN_ON(!outp->func)) { if (outp->func->dtor) *poutp = outp->func->dtor(outp); @@ -54,8 +54,8 @@ nvkm_output_del(struct nvkm_output **poutp) } void -nvkm_output_ctor(const struct nvkm_output_func *func, struct nvkm_disp *disp, - int index, struct dcb_output *dcbE, struct nvkm_output *outp) +nvkm_outp_ctor(const struct nvkm_outp_func *func, struct nvkm_disp *disp, + int index, struct dcb_output *dcbE, struct nvkm_outp *outp) { struct nvkm_i2c *i2c = disp->engine.subdev.device->i2c; @@ -75,13 +75,13 @@ nvkm_output_ctor(const struct nvkm_output_func *func, struct nvkm_disp *disp, } int -nvkm_output_new_(const struct nvkm_output_func *func, - struct nvkm_disp *disp, int index, struct dcb_output *dcbE, - struct nvkm_output **poutp) +nvkm_outp_new_(const struct nvkm_outp_func *func, + struct nvkm_disp *disp, int index, struct dcb_output *dcbE, + struct nvkm_outp **poutp) { if (!(*poutp = kzalloc(sizeof(**poutp), GFP_KERNEL))) return -ENOMEM; - nvkm_output_ctor(func, disp, index, dcbE, *poutp); + nvkm_outp_ctor(func, disp, index, dcbE, *poutp); return 0; } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h index 0772719..b3e3030 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h @@ -5,8 +5,8 @@ #include #include -struct nvkm_output { - const struct nvkm_output_func *func; +struct nvkm_outp { + const struct nvkm_outp_func *func; struct nvkm_disp *disp; int index; struct dcb_output info; @@ -19,19 +19,24 @@ struct nvkm_output { struct nvkm_connector *conn; }; -struct nvkm_output_func { - void *(*dtor)(struct nvkm_output *); - void (*init)(struct nvkm_output *); - void (*fini)(struct nvkm_output *); +void nvkm_outp_ctor(const struct nvkm_outp_func *, struct nvkm_disp *, + int index, struct dcb_output *, struct nvkm_outp *); +void nvkm_outp_del(struct nvkm_outp **); +void nvkm_outp_init(struct nvkm_outp *); +void nvkm_outp_fini(struct nvkm_outp *); + +struct nvkm_outp_func { + void *(*dtor)(struct nvkm_outp *); + void (*init)(struct nvkm_outp *); + void (*fini)(struct nvkm_outp *); }; -void nvkm_output_ctor(const struct nvkm_output_func *, struct nvkm_disp *, - int index, struct dcb_output *, struct nvkm_output *); -int nvkm_output_new_(const struct nvkm_output_func *, struct nvkm_disp *, - int index, struct dcb_output *, struct nvkm_output **); -void nvkm_output_del(struct nvkm_output **); -void nvkm_output_init(struct nvkm_output *); -void nvkm_output_fini(struct nvkm_output *); +#define nvkm_output nvkm_outp +#define nvkm_output_func nvkm_outp_func +#define nvkm_output_new_ nvkm_outp_new_ + +int nvkm_outp_new_(const struct nvkm_outp_func *, struct nvkm_disp *, + int index, struct dcb_output *, struct nvkm_output **); int nv50_dac_output_new(struct nvkm_disp *, int, struct dcb_output *, struct nvkm_output **); @@ -45,7 +50,7 @@ u32 g94_sor_dp_lane_map(struct nvkm_device *, u8 lane); void gm200_sor_magic(struct nvkm_output *outp); #define OUTP_MSG(o,l,f,a...) do { \ - struct nvkm_output *_outp = (o); \ + struct nvkm_outp *_outp = (o); \ nvkm_##l(&_outp->disp->engine.subdev, "outp %02x:%04x:%04x: "f"\n", \ _outp->index, _outp->info.hasht, _outp->info.hashm, ##a); \ } while(0) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c index e70dc6a9..2e73aeb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c @@ -76,8 +76,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size) struct nv50_disp_root *root = nv50_disp_root(object); struct nv50_disp *disp = root->disp; const struct nv50_disp_func *func = disp->func; - struct nvkm_output *outp = NULL; - struct nvkm_output *temp; + struct nvkm_outp *temp, *outp = NULL; u16 type, mask = 0; int head, ret = -ENOSYS; -- 2.7.4