2019-06-19 20:13:43 -04:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
2015-01-14 15:28:47 +10:00
|
|
|
#ifndef __NVKM_FIFO_H__
|
|
|
|
#define __NVKM_FIFO_H__
|
2015-08-20 14:54:19 +10:00
|
|
|
#include <core/engine.h>
|
2017-11-01 03:56:19 +10:00
|
|
|
#include <core/object.h>
|
2015-08-20 14:54:19 +10:00
|
|
|
#include <core/event.h>
|
2023-09-19 06:21:43 +10:00
|
|
|
#include <subdev/gsp.h>
|
2018-05-08 20:39:46 +10:00
|
|
|
struct nvkm_fault_data;
|
2015-08-20 14:54:19 +10:00
|
|
|
|
2021-02-06 19:27:08 +10:00
|
|
|
#define NVKM_FIFO_ENGN_NR 16
|
2015-08-20 14:54:19 +10:00
|
|
|
|
2022-06-01 20:47:21 +10:00
|
|
|
struct nvkm_chan {
|
|
|
|
const struct nvkm_chan_func *func;
|
2022-06-01 20:47:26 +10:00
|
|
|
char name[64];
|
|
|
|
struct nvkm_cgrp *cgrp;
|
2022-06-01 20:47:35 +10:00
|
|
|
int runq;
|
2022-06-01 20:47:26 +10:00
|
|
|
|
2022-06-01 20:47:35 +10:00
|
|
|
struct nvkm_gpuobj *inst;
|
|
|
|
struct nvkm_vmm *vmm;
|
2022-06-01 20:47:38 +10:00
|
|
|
struct nvkm_gpuobj *push;
|
|
|
|
int id;
|
2022-06-01 20:47:21 +10:00
|
|
|
|
2022-06-01 20:47:36 +10:00
|
|
|
struct {
|
|
|
|
struct nvkm_memory *mem;
|
|
|
|
u32 base;
|
|
|
|
} userd;
|
|
|
|
|
2022-06-01 20:47:36 +10:00
|
|
|
u32 ramfc_offset;
|
|
|
|
struct nvkm_gpuobj *ramfc;
|
|
|
|
struct nvkm_gpuobj *cache;
|
|
|
|
struct nvkm_gpuobj *eng;
|
|
|
|
struct nvkm_gpuobj *pgd;
|
|
|
|
struct nvkm_ramht *ramht;
|
|
|
|
|
2022-06-01 20:47:32 +10:00
|
|
|
spinlock_t lock;
|
|
|
|
atomic_t blocked;
|
|
|
|
atomic_t errored;
|
|
|
|
|
2023-09-19 06:21:43 +10:00
|
|
|
struct {
|
|
|
|
struct nvkm_gsp_object object;
|
|
|
|
struct {
|
|
|
|
dma_addr_t addr;
|
|
|
|
void *ptr;
|
|
|
|
} mthdbuf;
|
2023-09-19 06:21:45 +10:00
|
|
|
struct nvkm_vctx *grctx;
|
2023-09-19 06:21:43 +10:00
|
|
|
} rm;
|
|
|
|
|
2022-06-01 20:47:30 +10:00
|
|
|
struct list_head cctxs;
|
2015-08-20 14:54:19 +10:00
|
|
|
struct list_head head;
|
2012-07-20 08:17:34 +10:00
|
|
|
};
|
|
|
|
|
2022-06-01 20:47:29 +10:00
|
|
|
struct nvkm_chan *nvkm_chan_get_chid(struct nvkm_engine *, int id, unsigned long *irqflags);
|
|
|
|
struct nvkm_chan *nvkm_chan_get_inst(struct nvkm_engine *, u64 inst, unsigned long *irqflags);
|
|
|
|
void nvkm_chan_put(struct nvkm_chan **, unsigned long irqflags);
|
|
|
|
|
2023-09-19 06:21:44 +10:00
|
|
|
struct nvkm_chan *nvkm_uchan_chan(struct nvkm_object *);
|
|
|
|
|
2015-01-14 15:28:47 +10:00
|
|
|
struct nvkm_fifo {
|
2015-08-20 14:54:19 +10:00
|
|
|
const struct nvkm_fifo_func *func;
|
2015-08-20 14:54:22 +10:00
|
|
|
struct nvkm_engine engine;
|
2013-01-31 13:51:20 +10:00
|
|
|
|
2022-06-01 20:47:23 +10:00
|
|
|
struct nvkm_chid *chid;
|
|
|
|
struct nvkm_chid *cgid;
|
|
|
|
|
2022-06-01 20:47:23 +10:00
|
|
|
struct list_head runqs;
|
2022-06-01 20:47:24 +10:00
|
|
|
struct list_head runls;
|
2022-06-01 20:47:23 +10:00
|
|
|
|
2022-06-01 20:47:27 +10:00
|
|
|
struct {
|
|
|
|
#define NVKM_FIFO_NONSTALL_EVENT BIT(0)
|
|
|
|
struct nvkm_event event;
|
2022-06-01 20:47:39 +10:00
|
|
|
struct nvkm_inth intr;
|
2022-06-01 20:47:27 +10:00
|
|
|
} nonstall;
|
|
|
|
|
2022-06-01 20:47:30 +10:00
|
|
|
struct {
|
|
|
|
u32 chan_msec;
|
|
|
|
} timeout;
|
|
|
|
|
2022-06-01 20:47:36 +10:00
|
|
|
struct {
|
|
|
|
struct nvkm_memory *mem;
|
|
|
|
struct nvkm_vma *bar1;
|
|
|
|
} userd;
|
|
|
|
|
2023-09-19 06:21:43 +10:00
|
|
|
struct {
|
|
|
|
u32 mthdbuf_size;
|
|
|
|
} rm;
|
|
|
|
|
2012-07-20 08:17:34 +10:00
|
|
|
spinlock_t lock;
|
2020-12-03 10:42:43 +10:00
|
|
|
struct mutex mutex;
|
2012-07-20 08:17:34 +10:00
|
|
|
};
|
|
|
|
|
2018-05-08 20:39:46 +10:00
|
|
|
void nvkm_fifo_fault(struct nvkm_fifo *, struct nvkm_fault_data *);
|
2015-08-20 14:54:22 +10:00
|
|
|
void nvkm_fifo_pause(struct nvkm_fifo *, unsigned long *);
|
|
|
|
void nvkm_fifo_start(struct nvkm_fifo *, unsigned long *);
|
2022-06-01 20:48:04 +10:00
|
|
|
bool nvkm_fifo_ctxsw_in_progress(struct nvkm_engine *);
|
2015-08-20 14:54:19 +10:00
|
|
|
|
2020-12-04 15:29:16 +10:00
|
|
|
int nv04_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int nv10_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int nv17_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int nv40_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int nv50_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int g84_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
2022-06-01 20:47:24 +10:00
|
|
|
int g98_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
2020-12-04 15:29:16 +10:00
|
|
|
int gf100_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int gk104_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int gk110_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int gk208_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int gk20a_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int gm107_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int gm200_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int gp100_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int gv100_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
|
|
|
int tu102_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
2022-06-01 20:47:39 +10:00
|
|
|
int ga100_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
2021-09-17 08:04:06 +10:00
|
|
|
int ga102_fifo_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fifo **);
|
2012-05-01 20:48:08 +10:00
|
|
|
#endif
|