xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/fifo.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: fifo.h,v 1.2 2021/12/18 23:45:33 riastradh Exp $	*/
2 
3 #ifndef __NVIF_FIFO_H__
4 #define __NVIF_FIFO_H__
5 #include <nvif/device.h>
6 
7 /* Returns mask of runlists that support a NV_DEVICE_INFO_ENGINE_* type. */
8 u64 nvif_fifo_runlist(struct nvif_device *, u64 engine);
9 
10 /* CE-supporting runlists (excluding GRCE, if others exist). */
11 static inline u64
nvif_fifo_runlist_ce(struct nvif_device * device)12 nvif_fifo_runlist_ce(struct nvif_device *device)
13 {
14 	u64 runmgr = nvif_fifo_runlist(device, NV_DEVICE_INFO_ENGINE_GR);
15 	u64 runmce = nvif_fifo_runlist(device, NV_DEVICE_INFO_ENGINE_CE);
16 	if (runmce && !(runmce &= ~runmgr))
17 		runmce = runmgr;
18 	return runmce;
19 }
20 #endif
21