channv50.h 6.3 KB
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
2 3
#ifndef __NV50_DISP_CHAN_H__
#define __NV50_DISP_CHAN_H__
4
#define nv50_disp_chan(p) container_of((p), struct nv50_disp_chan, object)
5
#include <core/object.h>
6
#include "nv50.h"
7
struct nv50_disp_root;
8
struct nv50_disp_dmac_func;
9

10 11 12
struct nv50_disp_chan {
	const struct nv50_disp_chan_func *func;
	const struct nv50_disp_chan_mthd *mthd;
13
	struct nv50_disp *disp;
14 15 16 17 18

	struct {
		int ctrl;
		int user;
	} chid;
19
	int head;
20

21 22
	struct nvkm_object object;
};
23

24 25 26 27 28 29 30 31
struct nv50_disp_chan_func {
	void *(*dtor)(struct nv50_disp_chan *);
	int (*init)(struct nv50_disp_chan *);
	void (*fini)(struct nv50_disp_chan *);
	int (*child_get)(struct nv50_disp_chan *, int index,
			 struct nvkm_oclass *);
	int (*child_new)(struct nv50_disp_chan *, const struct nvkm_oclass *,
			 void *data, u32 size, struct nvkm_object **);
32 33
};

34 35
int nv50_disp_chan_ctor(const struct nv50_disp_chan_func *,
			const struct nv50_disp_chan_mthd *,
36
			struct nv50_disp *, int ctrl, int user, int head,
37 38 39
			const struct nvkm_oclass *, struct nv50_disp_chan *);
int nv50_disp_chan_new_(const struct nv50_disp_chan_func *,
			const struct nv50_disp_chan_mthd *,
40
			struct nv50_disp *, int ctrl, int user, int head,
41 42 43 44 45
			const struct nvkm_oclass *, struct nvkm_object **);

extern const struct nv50_disp_chan_func nv50_disp_pioc_func;
extern const struct nv50_disp_chan_func gf119_disp_pioc_func;

46 47 48 49 50 51 52
extern const struct nvkm_event_func nv50_disp_chan_uevent;
int  nv50_disp_chan_uevent_ctor(struct nvkm_object *, void *, u32,
				struct nvkm_notify *);
void nv50_disp_chan_uevent_send(struct nv50_disp *, int);

extern const struct nvkm_event_func gf119_disp_chan_uevent;

53 54 55 56
int nv50_disp_curs_new_(const struct nv50_disp_chan_func *,
			struct nv50_disp *, int ctrl, int user,
			const struct nvkm_oclass *, void *argv, u32 argc,
			struct nvkm_object **);
57 58 59 60
int nv50_disp_oimm_new_(const struct nv50_disp_chan_func *,
			struct nv50_disp *, int ctrl, int user,
			const struct nvkm_oclass *, void *argv, u32 argc,
			struct nvkm_object **);
61 62 63 64 65
int nv50_disp_base_new_(const struct nv50_disp_dmac_func *,
			const struct nv50_disp_chan_mthd *,
			struct nv50_disp *, int chid,
			const struct nvkm_oclass *, void *argv, u32 argc,
			struct nvkm_object **);
66 67 68 69 70
int nv50_disp_core_new_(const struct nv50_disp_dmac_func *,
			const struct nv50_disp_chan_mthd *,
			struct nv50_disp *, int chid,
			const struct nvkm_oclass *oclass, void *argv, u32 argc,
			struct nvkm_object **);
71 72 73 74 75 76
int nv50_disp_ovly_new_(const struct nv50_disp_dmac_func *,
			const struct nv50_disp_chan_mthd *,
			struct nv50_disp *, int chid,
			const struct nvkm_oclass *, void *argv, u32 argc,
			struct nvkm_object **);

77 78
int nv50_disp_curs_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);
79 80
int nv50_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);
81 82
int nv50_disp_base_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);
83 84
int nv50_disp_core_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);
85 86 87
int nv50_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);

88 89
int g84_disp_base_new(const struct nvkm_oclass *, void *, u32,
		      struct nv50_disp *, struct nvkm_object **);
90 91
int g84_disp_core_new(const struct nvkm_oclass *, void *, u32,
		      struct nv50_disp *, struct nvkm_object **);
92 93 94
int g84_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
		      struct nv50_disp *, struct nvkm_object **);

95 96 97
int g94_disp_core_new(const struct nvkm_oclass *, void *, u32,
		      struct nv50_disp *, struct nvkm_object **);

98 99 100
int gt200_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);

101 102
int gf119_disp_curs_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
103 104
int gf119_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
105 106
int gf119_disp_base_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
107 108
int gf119_disp_core_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
109 110 111
int gf119_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);

112 113
int gk104_disp_core_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
114 115 116
int gk104_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);

117 118
int gp102_disp_curs_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
119 120
int gp102_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
121 122
int gp102_disp_base_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
123 124
int gp102_disp_core_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
125 126 127
int gp102_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);

128 129 130 131 132 133 134 135 136 137
struct nv50_disp_mthd_list {
	u32 mthd;
	u32 addr;
	struct {
		u32 mthd;
		u32 addr;
		const char *name;
	} data[];
};

138
struct nv50_disp_chan_mthd {
139 140
	const char *name;
	u32 addr;
141
	s32 prev;
142 143 144 145 146 147 148
	struct {
		const char *name;
		int nr;
		const struct nv50_disp_mthd_list *mthd;
	} data[];
};

149
void nv50_disp_chan_mthd(struct nv50_disp_chan *, int debug);
150 151 152 153 154 155

extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_base;
extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_sor;
extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_pior;
extern const struct nv50_disp_mthd_list nv50_disp_base_mthd_image;

156
extern const struct nv50_disp_chan_mthd g84_disp_core_mthd;
157 158 159
extern const struct nv50_disp_mthd_list g84_disp_core_mthd_dac;
extern const struct nv50_disp_mthd_list g84_disp_core_mthd_head;

160
extern const struct nv50_disp_chan_mthd g94_disp_core_mthd;
161 162 163 164 165

extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_base;
extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_dac;
extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_sor;
extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_pior;
166
extern const struct nv50_disp_chan_mthd gf119_disp_base_mthd;
167

168
extern const struct nv50_disp_chan_mthd gk104_disp_core_mthd;
169
extern const struct nv50_disp_chan_mthd gk104_disp_ovly_mthd;
170
#endif