channv50.h 6.5 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
	int (*bind)(struct nv50_disp_chan *, struct nvkm_object *, u32 handle);
29 30
};

31 32
int nv50_disp_chan_new_(const struct nv50_disp_chan_func *,
			const struct nv50_disp_chan_mthd *,
33
			struct nv50_disp *, int ctrl, int user, int head,
34
			const struct nvkm_oclass *, struct nvkm_object **);
35 36 37 38
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 **);
39 40

extern const struct nv50_disp_chan_func nv50_disp_pioc_func;
41 42 43
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;
44

45 46 47 48 49 50
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 *);
51

52
extern const struct nv50_disp_chan_func gp102_disp_dmac_func;
53

54 55 56 57
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 **);
58 59 60 61
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 **);
62
int nv50_disp_base_new_(const struct nv50_disp_chan_func *,
63 64 65 66
			const struct nv50_disp_chan_mthd *,
			struct nv50_disp *, int chid,
			const struct nvkm_oclass *, void *argv, u32 argc,
			struct nvkm_object **);
67
int nv50_disp_core_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 *oclass, void *argv, u32 argc,
			struct nvkm_object **);
72
int nv50_disp_ovly_new_(const struct nv50_disp_chan_func *,
73 74 75 76 77
			const struct nv50_disp_chan_mthd *,
			struct nv50_disp *, int chid,
			const struct nvkm_oclass *, void *argv, u32 argc,
			struct nvkm_object **);

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

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

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

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

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

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

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

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

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

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

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;

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

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

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;
167
extern const struct nv50_disp_chan_mthd gf119_disp_base_mthd;
168

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