xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/ltc/priv.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: priv.h,v 1.3 2021/12/18 23:45:40 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: MIT */
4 #ifndef __NVKM_LTC_PRIV_H__
5 #define __NVKM_LTC_PRIV_H__
6 #define nvkm_ltc(p) container_of((p), struct nvkm_ltc, subdev)
7 #include <subdev/ltc.h>
8 #include <core/enum.h>
9 
10 int nvkm_ltc_new_(const struct nvkm_ltc_func *, struct nvkm_device *,
11 		  int index, struct nvkm_ltc **);
12 
13 struct nvkm_ltc_func {
14 	int  (*oneinit)(struct nvkm_ltc *);
15 	void (*init)(struct nvkm_ltc *);
16 	void (*intr)(struct nvkm_ltc *);
17 
18 	void (*cbc_clear)(struct nvkm_ltc *, u32 start, u32 limit);
19 	void (*cbc_wait)(struct nvkm_ltc *);
20 
21 	int zbc;
22 	void (*zbc_clear_color)(struct nvkm_ltc *, int, const u32[4]);
23 	void (*zbc_clear_depth)(struct nvkm_ltc *, int, const u32);
24 	void (*zbc_clear_stencil)(struct nvkm_ltc *, int, const u32);
25 
26 	void (*invalidate)(struct nvkm_ltc *);
27 	void (*flush)(struct nvkm_ltc *);
28 };
29 
30 int gf100_ltc_oneinit(struct nvkm_ltc *);
31 int gf100_ltc_oneinit_tag_ram(struct nvkm_ltc *);
32 void gf100_ltc_intr(struct nvkm_ltc *);
33 void gf100_ltc_cbc_clear(struct nvkm_ltc *, u32, u32);
34 void gf100_ltc_cbc_wait(struct nvkm_ltc *);
35 void gf100_ltc_zbc_clear_color(struct nvkm_ltc *, int, const u32[4]);
36 void gf100_ltc_zbc_clear_depth(struct nvkm_ltc *, int, const u32);
37 void gf100_ltc_invalidate(struct nvkm_ltc *);
38 void gf100_ltc_flush(struct nvkm_ltc *);
39 extern const struct nvkm_bitfield gf100_ltc_lts_intr_name[];
40 
41 void gm107_ltc_intr(struct nvkm_ltc *);
42 void gm107_ltc_intr_lts(struct nvkm_ltc *, int ltc, int lts);
43 void gm107_ltc_cbc_clear(struct nvkm_ltc *, u32, u32);
44 void gm107_ltc_cbc_wait(struct nvkm_ltc *);
45 void gm107_ltc_zbc_clear_color(struct nvkm_ltc *, int, const u32[4]);
46 void gm107_ltc_zbc_clear_depth(struct nvkm_ltc *, int, const u32);
47 
48 int gp100_ltc_oneinit(struct nvkm_ltc *);
49 void gp100_ltc_init(struct nvkm_ltc *);
50 void gp100_ltc_intr(struct nvkm_ltc *);
51 
52 void gp102_ltc_zbc_clear_stencil(struct nvkm_ltc *, int, const u32);
53 #endif
54