File: nv40.h

package info (click to toggle)
linux 6.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,488,076 kB
  • sloc: ansic: 23,401,844; asm: 266,744; sh: 108,976; makefile: 49,705; python: 36,927; perl: 36,810; cpp: 6,044; yacc: 4,904; lex: 2,722; awk: 1,440; ruby: 25; sed: 5
file content (49 lines) | stat: -rw-r--r-- 1,315 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* SPDX-License-Identifier: MIT */
#ifndef __NV40_GR_H__
#define __NV40_GR_H__
#define nv40_gr(p) container_of((p), struct nv40_gr, base)
#include "priv.h"

struct nv40_gr {
	struct nvkm_gr base;
	u32 size;
	struct list_head chan;
};

int nv40_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
		 struct nvkm_gr **);
int nv40_gr_init(struct nvkm_gr *);
void nv40_gr_intr(struct nvkm_gr *);
u64 nv40_gr_units(struct nvkm_gr *);

#define nv40_gr_chan(p) container_of((p), struct nv40_gr_chan, object)
#include <core/object.h>

struct nv40_gr_chan {
	struct nvkm_object object;
	struct nv40_gr *gr;
	struct nvkm_fifo_chan *fifo;
	u32 inst;
	struct list_head head;
};

int nv40_gr_chan_new(struct nvkm_gr *, struct nvkm_fifo_chan *,
		     const struct nvkm_oclass *, struct nvkm_object **);

extern const struct nvkm_object_func nv40_gr_object;

/* returns 1 if device is one of the nv4x using the 0x4497 object class,
 * helpful to determine a number of other hardware features
 */
static inline int
nv44_gr_class(struct nvkm_device *device)
{
	if ((device->chipset & 0xf0) == 0x60)
		return 1;

	return !(0x0aaf & (1 << (device->chipset & 0x0f)));
}

int  nv40_grctx_init(struct nvkm_device *, u32 *size);
void nv40_grctx_fill(struct nvkm_device *, struct nvkm_gpuobj *);
#endif