channv50.h 4.6 KB
Newer Older
1 2
#ifndef __NV50_DISP_CHAN_H__
#define __NV50_DISP_CHAN_H__
3
#define nv50_disp_chan(p) container_of((p), struct nv50_disp_chan, object)
4 5
#include "nv50.h"

6 7 8 9
struct nv50_disp_chan {
	const struct nv50_disp_chan_func *func;
	const struct nv50_disp_chan_mthd *mthd;
	struct nv50_disp_root *root;
10 11 12 13 14

	struct {
		int ctrl;
		int user;
	} chid;
15
	int head;
16

17 18
	struct nvkm_object object;
};
19

20 21 22 23 24 25 26 27
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 **);
28 29
};

30 31
int nv50_disp_chan_ctor(const struct nv50_disp_chan_func *,
			const struct nv50_disp_chan_mthd *,
32
			struct nv50_disp_root *, int ctrl, int user, int head,
33 34 35
			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 *,
36
			struct nv50_disp_root *, int ctrl, int user, int head,
37 38 39 40 41
			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;

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
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;

struct nv50_disp_mthd_list {
	u32 mthd;
	u32 addr;
	struct {
		u32 mthd;
		u32 addr;
		const char *name;
	} data[];
};

59
struct nv50_disp_chan_mthd {
60 61
	const char *name;
	u32 addr;
62
	s32 prev;
63 64 65 66 67 68 69
	struct {
		const char *name;
		int nr;
		const struct nv50_disp_mthd_list *mthd;
	} data[];
};

70
void nv50_disp_chan_mthd(struct nv50_disp_chan *, int debug);
71 72 73 74 75 76

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;

77
extern const struct nv50_disp_chan_mthd g84_disp_core_chan_mthd;
78 79
extern const struct nv50_disp_mthd_list g84_disp_core_mthd_dac;
extern const struct nv50_disp_mthd_list g84_disp_core_mthd_head;
80 81
extern const struct nv50_disp_chan_mthd g84_disp_base_chan_mthd;
extern const struct nv50_disp_chan_mthd g84_disp_ovly_chan_mthd;
82

83
extern const struct nv50_disp_chan_mthd g94_disp_core_chan_mthd;
84 85 86 87 88

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;
89 90 91
extern const struct nv50_disp_chan_mthd gf119_disp_base_chan_mthd;

extern const struct nv50_disp_chan_mthd gk104_disp_core_chan_mthd;
92
extern const struct nv50_disp_chan_mthd gk104_disp_ovly_chan_mthd;
93 94 95 96

struct nv50_disp_pioc_oclass {
	int (*ctor)(const struct nv50_disp_chan_func *,
		    const struct nv50_disp_chan_mthd *,
97
		    struct nv50_disp_root *, int ctrl, int user,
98 99 100 101 102
		    const struct nvkm_oclass *, void *data, u32 size,
		    struct nvkm_object **);
	struct nvkm_sclass base;
	const struct nv50_disp_chan_func *func;
	const struct nv50_disp_chan_mthd *mthd;
103 104 105 106
	struct {
		int ctrl;
		int user;
	} chid;
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
};

extern const struct nv50_disp_pioc_oclass nv50_disp_oimm_oclass;
extern const struct nv50_disp_pioc_oclass nv50_disp_curs_oclass;

extern const struct nv50_disp_pioc_oclass g84_disp_oimm_oclass;
extern const struct nv50_disp_pioc_oclass g84_disp_curs_oclass;

extern const struct nv50_disp_pioc_oclass gt215_disp_oimm_oclass;
extern const struct nv50_disp_pioc_oclass gt215_disp_curs_oclass;

extern const struct nv50_disp_pioc_oclass gf119_disp_oimm_oclass;
extern const struct nv50_disp_pioc_oclass gf119_disp_curs_oclass;

extern const struct nv50_disp_pioc_oclass gk104_disp_oimm_oclass;
extern const struct nv50_disp_pioc_oclass gk104_disp_curs_oclass;

124 125
extern const struct nv50_disp_pioc_oclass gp102_disp_oimm_oclass;
extern const struct nv50_disp_pioc_oclass gp102_disp_curs_oclass;
126

127 128
int nv50_disp_curs_new(const struct nv50_disp_chan_func *,
		       const struct nv50_disp_chan_mthd *,
129
		       struct nv50_disp_root *, int ctrl, int user,
130 131 132 133
		       const struct nvkm_oclass *, void *data, u32 size,
		       struct nvkm_object **);
int nv50_disp_oimm_new(const struct nv50_disp_chan_func *,
		       const struct nv50_disp_chan_mthd *,
134
		       struct nv50_disp_root *, int ctrl, int user,
135 136
		       const struct nvkm_oclass *, void *data, u32 size,
		       struct nvkm_object **);
137
#endif