fifo.h (3328B)
1/* SPDX-License-Identifier: MIT */ 2#ifndef __NVKM_FIFO_H__ 3#define __NVKM_FIFO_H__ 4#include <core/engine.h> 5#include <core/object.h> 6#include <core/event.h> 7struct nvkm_fault_data; 8 9#define NVKM_FIFO_CHID_NR 4096 10#define NVKM_FIFO_ENGN_NR 16 11 12struct nvkm_fifo_engn { 13 struct nvkm_object *object; 14 int refcount; 15 int usecount; 16}; 17 18struct nvkm_fifo_chan { 19 const struct nvkm_fifo_chan_func *func; 20 struct nvkm_fifo *fifo; 21 u32 engm; 22 struct nvkm_object object; 23 24 struct list_head head; 25 u16 chid; 26 struct nvkm_gpuobj *inst; 27 struct nvkm_gpuobj *push; 28 struct nvkm_vmm *vmm; 29 void __iomem *user; 30 u64 addr; 31 u32 size; 32 33 struct nvkm_fifo_engn engn[NVKM_FIFO_ENGN_NR]; 34}; 35 36struct nvkm_fifo { 37 const struct nvkm_fifo_func *func; 38 struct nvkm_engine engine; 39 40 DECLARE_BITMAP(mask, NVKM_FIFO_CHID_NR); 41 int nr; 42 struct list_head chan; 43 spinlock_t lock; 44 struct mutex mutex; 45 46 struct nvkm_event uevent; /* async user trigger */ 47 struct nvkm_event cevent; /* channel creation event */ 48 struct nvkm_event kevent; /* channel killed */ 49}; 50 51void nvkm_fifo_fault(struct nvkm_fifo *, struct nvkm_fault_data *); 52void nvkm_fifo_pause(struct nvkm_fifo *, unsigned long *); 53void nvkm_fifo_start(struct nvkm_fifo *, unsigned long *); 54 55void nvkm_fifo_chan_put(struct nvkm_fifo *, unsigned long flags, 56 struct nvkm_fifo_chan **); 57struct nvkm_fifo_chan * 58nvkm_fifo_chan_inst(struct nvkm_fifo *, u64 inst, unsigned long *flags); 59struct nvkm_fifo_chan * 60nvkm_fifo_chan_chid(struct nvkm_fifo *, int chid, unsigned long *flags); 61 62int nv04_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 63int nv10_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 64int nv17_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 65int nv40_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 66int nv50_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 67int g84_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 68int gf100_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 69int gk104_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 70int gk110_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 71int gk208_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 72int gk20a_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 73int gm107_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 74int gm200_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 75int gm20b_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 76int gp100_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 77int gp10b_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 78int gv100_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 79int tu102_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 80int ga102_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **); 81#endif