License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6-block.git] / drivers / gpu / drm / nouveau / nvkm / engine / gr / nv40.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
b8bf04e1
BS
2#ifndef __NV40_GR_H__
3#define __NV40_GR_H__
27f3d6cf
BS
4#define nv40_gr(p) container_of((p), struct nv40_gr, base)
5#include "priv.h"
9719047b 6
27f3d6cf
BS
7struct nv40_gr {
8 struct nvkm_gr base;
9 u32 size;
10 struct list_head chan;
11};
12
c85ee6ca
BS
13int nv40_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, int index,
14 struct nvkm_gr **);
15int nv40_gr_init(struct nvkm_gr *);
16void nv40_gr_intr(struct nvkm_gr *);
17u64 nv40_gr_units(struct nvkm_gr *);
18
27f3d6cf
BS
19#define nv40_gr_chan(p) container_of((p), struct nv40_gr_chan, object)
20
21struct nv40_gr_chan {
22 struct nvkm_object object;
23 struct nv40_gr *gr;
24 struct nvkm_fifo_chan *fifo;
25 u32 inst;
26 struct list_head head;
27};
c98b8194 28
c85ee6ca
BS
29int nv40_gr_chan_new(struct nvkm_gr *, struct nvkm_fifo_chan *,
30 const struct nvkm_oclass *, struct nvkm_object **);
31
32extern const struct nvkm_object_func nv40_gr_object;
33
ebb945a9
BS
34/* returns 1 if device is one of the nv4x using the 0x4497 object class,
35 * helpful to determine a number of other hardware features
36 */
37static inline int
b7a2bc18 38nv44_gr_class(struct nvkm_device *device)
ebb945a9 39{
ebb945a9
BS
40 if ((device->chipset & 0xf0) == 0x60)
41 return 1;
42
c85ee6ca 43 return !(0x0aaf & (1 << (device->chipset & 0x0f)));
ebb945a9
BS
44}
45
e3c71eb2
BS
46int nv40_grctx_init(struct nvkm_device *, u32 *size);
47void nv40_grctx_fill(struct nvkm_device *, struct nvkm_gpuobj *);
ebb945a9 48#endif