]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[thirdparty/kernel/linux.git] / drivers / gpu / drm / nouveau / nvkm / engine / disp / outp.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
7a014a87
BS
2#ifndef __NVKM_DISP_OUTP_H__
3#define __NVKM_DISP_OUTP_H__
f2c906fc 4#include <engine/disp.h>
7a014a87 5
878da15a
BS
6#include <subdev/bios.h>
7#include <subdev/bios/dcb.h>
7a014a87 8
d7ce92e2
BS
9struct nvkm_outp {
10 const struct nvkm_outp_func *func;
f2c906fc 11 struct nvkm_disp *disp;
7a014a87 12 int index;
f2c906fc 13 struct dcb_output info;
7a014a87 14
2aa5eac5 15 struct nvkm_i2c_bus *i2c;
f2c906fc 16 int or;
7a014a87 17
f2c906fc 18 struct list_head head;
981a8162 19 struct nvkm_conn *conn;
01a97637
BS
20
21 /* Assembly state. */
6c22ea37
BS
22#define NVKM_OUTP_PRIV 1
23#define NVKM_OUTP_USER 2
24 u8 acquired:2;
01a97637 25 struct nvkm_ior *ior;
7a014a87
BS
26};
27
01a97637
BS
28int nvkm_outp_ctor(const struct nvkm_outp_func *, struct nvkm_disp *,
29 int index, struct dcb_output *, struct nvkm_outp *);
3c66c87d
BS
30int nvkm_outp_new(struct nvkm_disp *, int index, struct dcb_output *,
31 struct nvkm_outp **);
d7ce92e2
BS
32void nvkm_outp_del(struct nvkm_outp **);
33void nvkm_outp_init(struct nvkm_outp *);
34void nvkm_outp_fini(struct nvkm_outp *);
6c22ea37
BS
35int nvkm_outp_acquire(struct nvkm_outp *, u8 user);
36void nvkm_outp_release(struct nvkm_outp *, u8 user);
37void nvkm_outp_route(struct nvkm_disp *);
d7ce92e2
BS
38
39struct nvkm_outp_func {
40 void *(*dtor)(struct nvkm_outp *);
41 void (*init)(struct nvkm_outp *);
42 void (*fini)(struct nvkm_outp *);
8d7ef84d 43 int (*acquire)(struct nvkm_outp *);
d52e948c 44 void (*release)(struct nvkm_outp *, struct nvkm_ior *);
7a014a87
BS
45};
46
f2c906fc 47#define OUTP_MSG(o,l,f,a...) do { \
d7ce92e2 48 struct nvkm_outp *_outp = (o); \
f2c906fc
BS
49 nvkm_##l(&_outp->disp->engine.subdev, "outp %02x:%04x:%04x: "f"\n", \
50 _outp->index, _outp->info.hasht, _outp->info.hashm, ##a); \
7a014a87 51} while(0)
f2c906fc
BS
52#define OUTP_ERR(o,f,a...) OUTP_MSG((o), error, f, ##a)
53#define OUTP_DBG(o,f,a...) OUTP_MSG((o), debug, f, ##a)
54#define OUTP_TRACE(o,f,a...) OUTP_MSG((o), trace, f, ##a)
7a014a87 55#endif