2024-06-19 14:15:22 +10:00
|
|
|
/* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
|
|
|
|
*/
|
|
|
|
#ifndef __NVIF_CHAN_H__
|
|
|
|
#define __NVIF_CHAN_H__
|
|
|
|
#include "push.h"
|
|
|
|
|
|
|
|
struct nvif_chan {
|
|
|
|
const struct nvif_chan_func {
|
|
|
|
struct {
|
|
|
|
u32 (*read_get)(struct nvif_chan *);
|
|
|
|
} push;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 (*read_get)(struct nvif_chan *);
|
|
|
|
void (*push)(struct nvif_chan *, bool main, u64 addr, u32 size,
|
|
|
|
bool no_prefetch);
|
|
|
|
void (*kick)(struct nvif_chan *);
|
2024-06-19 14:23:04 +10:00
|
|
|
int (*post)(struct nvif_chan *, u32 gpptr, u32 pbptr);
|
|
|
|
u32 post_size;
|
2024-06-19 14:15:22 +10:00
|
|
|
} gpfifo;
|
2024-06-19 14:23:04 +10:00
|
|
|
|
|
|
|
struct {
|
|
|
|
int (*release)(struct nvif_chan *, u64 addr, u32 data);
|
|
|
|
} sem;
|
2024-06-19 14:15:22 +10:00
|
|
|
} *func;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
struct nvif_map map;
|
|
|
|
} userd;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
struct nvif_map map;
|
|
|
|
u32 cur;
|
|
|
|
u32 max;
|
|
|
|
int free;
|
|
|
|
} gpfifo;
|
|
|
|
|
2024-06-19 14:23:04 +10:00
|
|
|
struct {
|
|
|
|
struct nvif_map map;
|
|
|
|
u64 addr;
|
|
|
|
} sema;
|
|
|
|
|
2024-06-19 14:15:22 +10:00
|
|
|
struct nvif_push push;
|
|
|
|
|
|
|
|
struct nvif_user *usermode;
|
|
|
|
u32 doorbell_token;
|
|
|
|
};
|
|
|
|
|
|
|
|
int nvif_chan_dma_wait(struct nvif_chan *, u32 push_nr);
|
|
|
|
|
|
|
|
void nvif_chan_gpfifo_ctor(const struct nvif_chan_func *, void *userd, void *gpfifo, u32 gpfifo_size,
|
|
|
|
void *push, u64 push_addr, u32 push_size, struct nvif_chan *);
|
|
|
|
int nvif_chan_gpfifo_wait(struct nvif_chan *, u32 gpfifo_nr, u32 push_nr);
|
|
|
|
void nvif_chan_gpfifo_push(struct nvif_chan *, u64 addr, u32 size, bool no_prefetch);
|
2024-06-19 14:23:04 +10:00
|
|
|
int nvif_chan_gpfifo_post(struct nvif_chan *);
|
2024-06-19 14:15:22 +10:00
|
|
|
|
|
|
|
void nvif_chan506f_gpfifo_push(struct nvif_chan *, bool main, u64 addr, u32 size, bool no_prefetch);
|
2024-06-19 14:23:04 +10:00
|
|
|
void nvif_chan506f_gpfifo_kick(struct nvif_chan *);
|
|
|
|
|
|
|
|
int nvif_chan906f_ctor_(const struct nvif_chan_func *, void *userd, void *gpfifo, u32 gpfifo_size,
|
|
|
|
void *push, u64 push_addr, u32 push_size, void *sema, u64 sema_addr,
|
|
|
|
struct nvif_chan *);
|
|
|
|
u32 nvif_chan906f_read_get(struct nvif_chan *);
|
|
|
|
u32 nvif_chan906f_gpfifo_read_get(struct nvif_chan *);
|
|
|
|
int nvif_chan906f_gpfifo_post(struct nvif_chan *, u32 gpptr, u32 pbptr);
|
2024-06-19 14:15:22 +10:00
|
|
|
|
2024-06-19 14:23:04 +10:00
|
|
|
int nvif_chan506f_ctor(struct nvif_chan *, void *userd, void *gpfifo, u32 gpfifo_size,
|
|
|
|
void *push, u64 push_addr, u32 push_size);
|
|
|
|
int nvif_chan906f_ctor(struct nvif_chan *, void *userd, void *gpfifo, u32 gpfifo_size,
|
|
|
|
void *push, u64 push_addr, u32 push_size, void *sema, u64 sema_addr);
|
2024-06-19 14:15:22 +10:00
|
|
|
int nvif_chanc36f_ctor(struct nvif_chan *, void *userd, void *gpfifo, u32 gpfifo_size,
|
2024-06-19 14:23:04 +10:00
|
|
|
void *push, u64 push_addr, u32 push_size, void *sema, u64 sema_addr,
|
2024-06-19 14:15:22 +10:00
|
|
|
struct nvif_user *usermode, u32 doorbell_token);
|
|
|
|
#endif
|