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 <bskeggs@redhat.com>
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))) {
{
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) {
{
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;
{
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)
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)) {
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;
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;
}
nvkm_error(&disp->engine.subdev,
"failed to create output %d\n", i);
- nvkm_output_del(&outp);
+ nvkm_outp_del(&outp);
continue;
}
outp->index, ret);
nvkm_connector_del(&outp->conn);
list_del(&outp->head);
- nvkm_output_del(&outp);
+ nvkm_outp_del(&outp);
continue;
}
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) {
#include <subdev/i2c.h>
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);
}
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;
}
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;
}
#include <subdev/bios.h>
#include <subdev/bios/dcb.h>
-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;
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 **);
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)
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;