Commit d7ce92e2 authored by Ben Skeggs's avatar Ben Skeggs

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: default avatarBen Skeggs <bskeggs@redhat.com>
parent af85389c
...@@ -96,7 +96,7 @@ nvkm_disp_hpd_ctor(struct nvkm_object *object, void *data, u32 size, ...@@ -96,7 +96,7 @@ nvkm_disp_hpd_ctor(struct nvkm_object *object, void *data, u32 size,
union { union {
struct nvif_notify_conn_req_v0 v0; struct nvif_notify_conn_req_v0 v0;
} *req = data; } *req = data;
struct nvkm_output *outp; struct nvkm_outp *outp;
int ret = -ENOSYS; int ret = -ENOSYS;
if (!(ret = nvif_unpack(ret, &data, &size, req->v0, 0, 0, false))) { 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) ...@@ -211,10 +211,10 @@ nvkm_disp_fini(struct nvkm_engine *engine, bool suspend)
{ {
struct nvkm_disp *disp = nvkm_disp(engine); struct nvkm_disp *disp = nvkm_disp(engine);
struct nvkm_connector *conn; struct nvkm_connector *conn;
struct nvkm_output *outp; struct nvkm_outp *outp;
list_for_each_entry(outp, &disp->outp, head) { list_for_each_entry(outp, &disp->outp, head) {
nvkm_output_fini(outp); nvkm_outp_fini(outp);
} }
list_for_each_entry(conn, &disp->conn, head) { list_for_each_entry(conn, &disp->conn, head) {
...@@ -229,14 +229,14 @@ nvkm_disp_init(struct nvkm_engine *engine) ...@@ -229,14 +229,14 @@ nvkm_disp_init(struct nvkm_engine *engine)
{ {
struct nvkm_disp *disp = nvkm_disp(engine); struct nvkm_disp *disp = nvkm_disp(engine);
struct nvkm_connector *conn; struct nvkm_connector *conn;
struct nvkm_output *outp; struct nvkm_outp *outp;
list_for_each_entry(conn, &disp->conn, head) { list_for_each_entry(conn, &disp->conn, head) {
nvkm_connector_init(conn); nvkm_connector_init(conn);
} }
list_for_each_entry(outp, &disp->outp, head) { list_for_each_entry(outp, &disp->outp, head) {
nvkm_output_init(outp); nvkm_outp_init(outp);
} }
return 0; return 0;
...@@ -247,7 +247,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine) ...@@ -247,7 +247,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine)
{ {
struct nvkm_disp *disp = nvkm_disp(engine); struct nvkm_disp *disp = nvkm_disp(engine);
struct nvkm_connector *conn; struct nvkm_connector *conn;
struct nvkm_output *outp; struct nvkm_outp *outp;
void *data = disp; void *data = disp;
if (disp->func->dtor) if (disp->func->dtor)
...@@ -259,7 +259,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine) ...@@ -259,7 +259,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine)
while (!list_empty(&disp->outp)) { while (!list_empty(&disp->outp)) {
outp = list_first_entry(&disp->outp, typeof(*outp), head); outp = list_first_entry(&disp->outp, typeof(*outp), head);
list_del(&outp->head); list_del(&outp->head);
nvkm_output_del(&outp); nvkm_outp_del(&outp);
} }
while (!list_empty(&disp->conn)) { while (!list_empty(&disp->conn)) {
...@@ -285,7 +285,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, ...@@ -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) int index, int heads, struct nvkm_disp *disp)
{ {
struct nvkm_bios *bios = device->bios; struct nvkm_bios *bios = device->bios;
struct nvkm_output *outp, *outt, *pair; struct nvkm_outp *outp, *outt, *pair;
struct nvkm_connector *conn; struct nvkm_connector *conn;
struct nvbios_connE connE; struct nvbios_connE connE;
struct dcb_output dcbE; struct dcb_output dcbE;
...@@ -307,7 +307,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, ...@@ -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))) { while ((data = dcb_outp_parse(bios, ++i, &ver, &hdr, &dcbE))) {
const struct nvkm_disp_func_outp *outps; const struct nvkm_disp_func_outp *outps;
int (*ctor)(struct nvkm_disp *, int, struct dcb_output *, int (*ctor)(struct nvkm_disp *, int, struct dcb_output *,
struct nvkm_output **); struct nvkm_outp **);
if (dcbE.type == DCB_OUTPUT_UNUSED) if (dcbE.type == DCB_OUTPUT_UNUSED)
continue; continue;
...@@ -350,7 +350,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, ...@@ -350,7 +350,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device,
} }
nvkm_error(&disp->engine.subdev, nvkm_error(&disp->engine.subdev,
"failed to create output %d\n", i); "failed to create output %d\n", i);
nvkm_output_del(&outp); nvkm_outp_del(&outp);
continue; continue;
} }
...@@ -411,7 +411,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, ...@@ -411,7 +411,7 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device,
outp->index, ret); outp->index, ret);
nvkm_connector_del(&outp->conn); nvkm_connector_del(&outp->conn);
list_del(&outp->head); list_del(&outp->head);
nvkm_output_del(&outp); nvkm_outp_del(&outp);
continue; continue;
} }
......
...@@ -566,7 +566,7 @@ nvkm_output_dp_ctor(const struct nvkm_output_dp_func *func, ...@@ -566,7 +566,7 @@ nvkm_output_dp_ctor(const struct nvkm_output_dp_func *func,
u32 data; u32 data;
int ret; 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->func = func;
outp->aux = aux; outp->aux = aux;
if (!outp->aux) { if (!outp->aux) {
......
...@@ -28,23 +28,23 @@ ...@@ -28,23 +28,23 @@
#include <subdev/i2c.h> #include <subdev/i2c.h>
void void
nvkm_output_fini(struct nvkm_output *outp) nvkm_outp_fini(struct nvkm_outp *outp)
{ {
if (outp->func->fini) if (outp->func->fini)
outp->func->fini(outp); outp->func->fini(outp);
} }
void void
nvkm_output_init(struct nvkm_output *outp) nvkm_outp_init(struct nvkm_outp *outp)
{ {
if (outp->func->init) if (outp->func->init)
outp->func->init(outp); outp->func->init(outp);
} }
void 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 && !WARN_ON(!outp->func)) {
if (outp->func->dtor) if (outp->func->dtor)
*poutp = outp->func->dtor(outp); *poutp = outp->func->dtor(outp);
...@@ -54,8 +54,8 @@ nvkm_output_del(struct nvkm_output **poutp) ...@@ -54,8 +54,8 @@ nvkm_output_del(struct nvkm_output **poutp)
} }
void void
nvkm_output_ctor(const struct nvkm_output_func *func, struct nvkm_disp *disp, nvkm_outp_ctor(const struct nvkm_outp_func *func, struct nvkm_disp *disp,
int index, struct dcb_output *dcbE, struct nvkm_output *outp) int index, struct dcb_output *dcbE, struct nvkm_outp *outp)
{ {
struct nvkm_i2c *i2c = disp->engine.subdev.device->i2c; 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, ...@@ -75,13 +75,13 @@ nvkm_output_ctor(const struct nvkm_output_func *func, struct nvkm_disp *disp,
} }
int int
nvkm_output_new_(const struct nvkm_output_func *func, nvkm_outp_new_(const struct nvkm_outp_func *func,
struct nvkm_disp *disp, int index, struct dcb_output *dcbE, struct nvkm_disp *disp, int index, struct dcb_output *dcbE,
struct nvkm_output **poutp) struct nvkm_outp **poutp)
{ {
if (!(*poutp = kzalloc(sizeof(**poutp), GFP_KERNEL))) if (!(*poutp = kzalloc(sizeof(**poutp), GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
nvkm_output_ctor(func, disp, index, dcbE, *poutp); nvkm_outp_ctor(func, disp, index, dcbE, *poutp);
return 0; return 0;
} }
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/dcb.h> #include <subdev/bios/dcb.h>
struct nvkm_output { struct nvkm_outp {
const struct nvkm_output_func *func; const struct nvkm_outp_func *func;
struct nvkm_disp *disp; struct nvkm_disp *disp;
int index; int index;
struct dcb_output info; struct dcb_output info;
...@@ -19,19 +19,24 @@ struct nvkm_output { ...@@ -19,19 +19,24 @@ struct nvkm_output {
struct nvkm_connector *conn; struct nvkm_connector *conn;
}; };
struct nvkm_output_func { void nvkm_outp_ctor(const struct nvkm_outp_func *, struct nvkm_disp *,
void *(*dtor)(struct nvkm_output *); int index, struct dcb_output *, struct nvkm_outp *);
void (*init)(struct nvkm_output *); void nvkm_outp_del(struct nvkm_outp **);
void (*fini)(struct nvkm_output *); 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 *, #define nvkm_output nvkm_outp
int index, struct dcb_output *, struct nvkm_output *); #define nvkm_output_func nvkm_outp_func
int nvkm_output_new_(const struct nvkm_output_func *, struct nvkm_disp *, #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 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 *);
int nv50_dac_output_new(struct nvkm_disp *, int, struct dcb_output *, int nv50_dac_output_new(struct nvkm_disp *, int, struct dcb_output *,
struct nvkm_output **); struct nvkm_output **);
...@@ -45,7 +50,7 @@ u32 g94_sor_dp_lane_map(struct nvkm_device *, u8 lane); ...@@ -45,7 +50,7 @@ u32 g94_sor_dp_lane_map(struct nvkm_device *, u8 lane);
void gm200_sor_magic(struct nvkm_output *outp); void gm200_sor_magic(struct nvkm_output *outp);
#define OUTP_MSG(o,l,f,a...) do { \ #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", \ nvkm_##l(&_outp->disp->engine.subdev, "outp %02x:%04x:%04x: "f"\n", \
_outp->index, _outp->info.hasht, _outp->info.hashm, ##a); \ _outp->index, _outp->info.hasht, _outp->info.hashm, ##a); \
} while(0) } while(0)
......
...@@ -76,8 +76,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size) ...@@ -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_root *root = nv50_disp_root(object);
struct nv50_disp *disp = root->disp; struct nv50_disp *disp = root->disp;
const struct nv50_disp_func *func = disp->func; const struct nv50_disp_func *func = disp->func;
struct nvkm_output *outp = NULL; struct nvkm_outp *temp, *outp = NULL;
struct nvkm_output *temp;
u16 type, mask = 0; u16 type, mask = 0;
int head, ret = -ENOSYS; int head, ret = -ENOSYS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment