drm/nouveau/ltc: add zbc drivers
[jlayton/linux.git] / drivers / gpu / drm / nouveau / core / include / subdev / ltc.h
1 #ifndef __NOUVEAU_LTC_H__
2 #define __NOUVEAU_LTC_H__
3
4 #include <core/subdev.h>
5 #include <core/device.h>
6
7 #define NOUVEAU_LTC_MAX_ZBC_CNT 16
8
9 struct nouveau_mm_node;
10
11 struct nouveau_ltc {
12         struct nouveau_subdev base;
13
14         int  (*tags_alloc)(struct nouveau_ltc *, u32 count,
15                            struct nouveau_mm_node **);
16         void (*tags_free)(struct nouveau_ltc *, struct nouveau_mm_node **);
17         void (*tags_clear)(struct nouveau_ltc *, u32 first, u32 count);
18
19         int zbc_min;
20         int zbc_max;
21         int (*zbc_color_get)(struct nouveau_ltc *, int index, const u32[4]);
22         int (*zbc_depth_get)(struct nouveau_ltc *, int index, const u32);
23 };
24
25 static inline struct nouveau_ltc *
26 nouveau_ltc(void *obj)
27 {
28         return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_LTC];
29 }
30
31 extern struct nouveau_oclass *gf100_ltc_oclass;
32 extern struct nouveau_oclass *gk104_ltc_oclass;
33 extern struct nouveau_oclass *gm107_ltc_oclass;
34
35 #endif