1226584Sdim/*	$NetBSD: ltc.h,v 1.3 2021/12/18 23:45:33 riastradh Exp $	*/
2226584Sdim
3226584Sdim/* SPDX-License-Identifier: MIT */
4226584Sdim#ifndef __NVKM_LTC_H__
5226584Sdim#define __NVKM_LTC_H__
6226584Sdim#include <core/subdev.h>
7226584Sdim#include <core/mm.h>
8226584Sdim
9226584Sdim#define NVKM_LTC_MAX_ZBC_CNT 16
10226584Sdim
11226584Sdimstruct nvkm_ltc {
12226584Sdim	const struct nvkm_ltc_func *func;
13226584Sdim	struct nvkm_subdev subdev;
14243830Sdim
15226584Sdim	u32 ltc_nr;
16226584Sdim	u32 lts_nr;
17226584Sdim
18226584Sdim	u32 num_tags;
19226584Sdim	u32 tag_base;
20	struct nvkm_memory *tag_ram;
21
22	int zbc_min;
23	int zbc_max;
24	u32 zbc_color[NVKM_LTC_MAX_ZBC_CNT][4];
25	u32 zbc_depth[NVKM_LTC_MAX_ZBC_CNT];
26	u32 zbc_stencil[NVKM_LTC_MAX_ZBC_CNT];
27};
28
29void nvkm_ltc_tags_clear(struct nvkm_device *, u32 first, u32 count);
30
31int nvkm_ltc_zbc_color_get(struct nvkm_ltc *, int index, const u32[4]);
32int nvkm_ltc_zbc_depth_get(struct nvkm_ltc *, int index, const u32);
33int nvkm_ltc_zbc_stencil_get(struct nvkm_ltc *, int index, const u32);
34
35void nvkm_ltc_invalidate(struct nvkm_ltc *);
36void nvkm_ltc_flush(struct nvkm_ltc *);
37
38int gf100_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
39int gk104_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
40int gk20a_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
41int gm107_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
42int gm200_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
43int gp100_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
44int gp102_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
45int gp10b_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
46#endif
47