mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

From VOLTA_CHANNEL_GPFIFO_A onwards, HW no longer updates the GET/GP_GET pointers in USERD following channel progress, but instead updates on a timer for compatibility, and SW is expected to implement its own method of tracking channel progress (typically via non-WFI semaphore release). Nouveau has been making use of the compatibility mode up until now, however, from BLACKWELL_CHANNEL_GPFIFO_A HW no longer supports USERD writeback at all. Allocate a per-channel buffer in system memory, and append a non-WFI semaphore release to the end of each push buffer segment to simulate the pointers previously read from USERD. This change is implemented for Fermi (which is the first to support non- WFI semaphore release) onwards, as readback from system memory is likely faster than BAR1 reads. Signed-off-by: Ben Skeggs <bskeggs@nvidia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Timur Tabi <ttabi@nvidia.com> Tested-by: Timur Tabi <ttabi@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
69 lines
1.3 KiB
C
69 lines
1.3 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
#ifndef __NOUVEAU_CHAN_H__
|
|
#define __NOUVEAU_CHAN_H__
|
|
#include <nvif/object.h>
|
|
#include <nvif/event.h>
|
|
#include <nvif/chan.h>
|
|
struct nvif_device;
|
|
|
|
struct nouveau_channel {
|
|
struct nvif_chan chan;
|
|
|
|
struct nouveau_cli *cli;
|
|
struct nouveau_vmm *vmm;
|
|
|
|
struct nvif_mem mem_userd;
|
|
struct nvif_object *userd;
|
|
|
|
int runlist;
|
|
int chid;
|
|
u64 inst;
|
|
u32 token;
|
|
|
|
struct nvif_object vram;
|
|
struct nvif_object gart;
|
|
struct nvif_object nvsw;
|
|
|
|
struct {
|
|
struct nouveau_bo *buffer;
|
|
struct nouveau_vma *vma;
|
|
struct nvif_object ctxdma;
|
|
u64 addr;
|
|
} push;
|
|
|
|
/* TODO: this will be reworked in the near future */
|
|
bool accel_done;
|
|
void *fence;
|
|
struct {
|
|
int max;
|
|
int free;
|
|
int cur;
|
|
int put;
|
|
} dma;
|
|
u32 user_get;
|
|
u32 user_put;
|
|
|
|
struct {
|
|
struct nouveau_bo *bo;
|
|
struct nouveau_vma *vma;
|
|
} sema;
|
|
|
|
struct nvif_object user;
|
|
struct nvif_object blit;
|
|
|
|
struct nvif_event kill;
|
|
atomic_t killed;
|
|
};
|
|
|
|
int nouveau_channels_init(struct nouveau_drm *);
|
|
void nouveau_channels_fini(struct nouveau_drm *);
|
|
|
|
int nouveau_channel_new(struct nouveau_cli *, bool priv, u64 runm,
|
|
u32 vram, u32 gart, struct nouveau_channel **);
|
|
void nouveau_channel_del(struct nouveau_channel **);
|
|
int nouveau_channel_idle(struct nouveau_channel *);
|
|
void nouveau_channel_kill(struct nouveau_channel *);
|
|
|
|
extern int nouveau_vram_pushbuf;
|
|
|
|
#endif
|