channv50.h 6.7 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

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

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

20
	struct nvkm_object object;
21 22

	u64 push;
23
};
24

25 26 27
struct nv50_disp_chan_func {
	int (*init)(struct nv50_disp_chan *);
	void (*fini)(struct nv50_disp_chan *);
28
	void (*intr)(struct nv50_disp_chan *, bool en);
29
	u64 (*user)(struct nv50_disp_chan *, u64 *size);
30
	int (*bind)(struct nv50_disp_chan *, struct nvkm_object *, u32 handle);
31 32
};

33 34
int nv50_disp_chan_new_(const struct nv50_disp_chan_func *,
			const struct nv50_disp_chan_mthd *,
35
			struct nv50_disp *, int ctrl, int user, int head,
36
			const struct nvkm_oclass *, struct nvkm_object **);
37 38 39 40
int nv50_disp_dmac_new_(const struct nv50_disp_chan_func *,
			const struct nv50_disp_chan_mthd *,
			struct nv50_disp *, int chid, int head, u64 push,
			const struct nvkm_oclass *, struct nvkm_object **);
41

42
void nv50_disp_chan_intr(struct nv50_disp_chan *, bool);
43
u64 nv50_disp_chan_user(struct nv50_disp_chan *, u64 *);
44
extern const struct nv50_disp_chan_func nv50_disp_pioc_func;
45 46 47
extern const struct nv50_disp_chan_func nv50_disp_dmac_func;
int nv50_disp_dmac_bind(struct nv50_disp_chan *, struct nvkm_object *, u32);
extern const struct nv50_disp_chan_func nv50_disp_core_func;
48

49
void gf119_disp_chan_intr(struct nv50_disp_chan *, bool);
50 51 52 53 54 55
extern const struct nv50_disp_chan_func gf119_disp_pioc_func;
extern const struct nv50_disp_chan_func gf119_disp_dmac_func;
void gf119_disp_dmac_fini(struct nv50_disp_chan *);
int gf119_disp_dmac_bind(struct nv50_disp_chan *, struct nvkm_object *, u32);
extern const struct nv50_disp_chan_func gf119_disp_core_func;
void gf119_disp_core_fini(struct nv50_disp_chan *);
56

57
extern const struct nv50_disp_chan_func gp102_disp_dmac_func;
58

59 60 61 62
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 **);
63 64 65 66
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 **);
67
int nv50_disp_base_new_(const struct nv50_disp_chan_func *,
68 69 70 71
			const struct nv50_disp_chan_mthd *,
			struct nv50_disp *, int chid,
			const struct nvkm_oclass *, void *argv, u32 argc,
			struct nvkm_object **);
72
int nv50_disp_core_new_(const struct nv50_disp_chan_func *,
73 74 75 76
			const struct nv50_disp_chan_mthd *,
			struct nv50_disp *, int chid,
			const struct nvkm_oclass *oclass, void *argv, u32 argc,
			struct nvkm_object **);
77
int nv50_disp_ovly_new_(const struct nv50_disp_chan_func *,
78 79 80 81 82
			const struct nv50_disp_chan_mthd *,
			struct nv50_disp *, int chid,
			const struct nvkm_oclass *, void *argv, u32 argc,
			struct nvkm_object **);

83 84
int nv50_disp_curs_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);
85 86
int nv50_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);
87 88
int nv50_disp_base_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);
89 90
int nv50_disp_core_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);
91 92 93
int nv50_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
		       struct nv50_disp *, struct nvkm_object **);

94 95
int g84_disp_base_new(const struct nvkm_oclass *, void *, u32,
		      struct nv50_disp *, struct nvkm_object **);
96 97
int g84_disp_core_new(const struct nvkm_oclass *, void *, u32,
		      struct nv50_disp *, struct nvkm_object **);
98 99 100
int g84_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
		      struct nv50_disp *, struct nvkm_object **);

101 102 103
int g94_disp_core_new(const struct nvkm_oclass *, void *, u32,
		      struct nv50_disp *, struct nvkm_object **);

104 105 106
int gt200_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);

107 108
int gf119_disp_curs_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
109 110
int gf119_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
111 112
int gf119_disp_base_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
113 114
int gf119_disp_core_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
115 116 117
int gf119_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);

118 119
int gk104_disp_core_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
120 121 122
int gk104_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);

123 124
int gp102_disp_curs_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
125 126
int gp102_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
127 128
int gp102_disp_base_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
129 130
int gp102_disp_core_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);
131 132 133
int gp102_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
			struct nv50_disp *, struct nvkm_object **);

134 135 136 137 138 139 140 141 142 143
struct nv50_disp_mthd_list {
	u32 mthd;
	u32 addr;
	struct {
		u32 mthd;
		u32 addr;
		const char *name;
	} data[];
};

144
struct nv50_disp_chan_mthd {
145 146
	const char *name;
	u32 addr;
147
	s32 prev;
148 149 150 151 152 153 154
	struct {
		const char *name;
		int nr;
		const struct nv50_disp_mthd_list *mthd;
	} data[];
};

155
void nv50_disp_chan_mthd(struct nv50_disp_chan *, int debug);
156 157 158 159 160 161

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;

162
extern const struct nv50_disp_chan_mthd g84_disp_core_mthd;
163 164 165
extern const struct nv50_disp_mthd_list g84_disp_core_mthd_dac;
extern const struct nv50_disp_mthd_list g84_disp_core_mthd_head;

166
extern const struct nv50_disp_chan_mthd g94_disp_core_mthd;
167 168 169 170 171

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;
172
extern const struct nv50_disp_chan_mthd gf119_disp_base_mthd;
173

174
extern const struct nv50_disp_chan_mthd gk104_disp_core_mthd;
175
extern const struct nv50_disp_chan_mthd gk104_disp_ovly_mthd;
176
#endif