Commit 85532bd9 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/fifo/gk104-: support enabling privileged ce functions



Will be used by SVM code to allow direct (without going through MMU) memcpy
using the GPU copy engines.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 86b442d7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

struct kepler_channel_gpfifo_a_v0 {
	__u8  version;
	__u8  pad01[1];
	__u8  priv;
	__u16 chid;
	__u32 ilength;
	__u64 ioffset;
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS)

	/* create channel object and initialise dma and fence management */
	ret = nouveau_channel_new(drm, device, init->fb_ctxdma_handle,
				  init->tt_ctxdma_handle, &chan->chan);
				  init->tt_ctxdma_handle, false, &chan->chan);
	if (ret)
		goto done;

+5 −3
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ nouveau_channel_prep(struct nouveau_drm *drm, struct nvif_device *device,

static int
nouveau_channel_ind(struct nouveau_drm *drm, struct nvif_device *device,
		    u64 runlist, struct nouveau_channel **pchan)
		    u64 runlist, bool priv, struct nouveau_channel **pchan)
{
	struct nouveau_cli *cli = (void *)device->object.client;
	static const u16 oclasses[] = { VOLTA_CHANNEL_GPFIFO_A,
@@ -253,6 +253,7 @@ nouveau_channel_ind(struct nouveau_drm *drm, struct nvif_device *device,
			args.kepler.ioffset = 0x10000 + chan->push.addr;
			args.kepler.runlist = runlist;
			args.kepler.vmm = nvif_handle(&cli->vmm.vmm.object);
			args.kepler.priv = priv;
			size = sizeof(args.kepler);
		} else
		if (oclass[0] >= FERMI_CHANNEL_GPFIFO) {
@@ -450,7 +451,8 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)

int
nouveau_channel_new(struct nouveau_drm *drm, struct nvif_device *device,
		    u32 arg0, u32 arg1, struct nouveau_channel **pchan)
		    u32 arg0, u32 arg1, bool priv,
		    struct nouveau_channel **pchan)
{
	struct nouveau_cli *cli = (void *)device->object.client;
	bool super;
@@ -460,7 +462,7 @@ nouveau_channel_new(struct nouveau_drm *drm, struct nvif_device *device,
	super = cli->base.super;
	cli->base.super = true;

	ret = nouveau_channel_ind(drm, device, arg0, pchan);
	ret = nouveau_channel_ind(drm, device, arg0, priv, pchan);
	if (ret) {
		NV_PRINTK(dbg, cli, "ib channel create, %d\n", ret);
		ret = nouveau_channel_dma(drm, device, pchan);
+2 −1
Original line number Diff line number Diff line
@@ -49,7 +49,8 @@ struct nouveau_channel {
int nouveau_channels_init(struct nouveau_drm *);

int  nouveau_channel_new(struct nouveau_drm *, struct nvif_device *,
			 u32 arg0, u32 arg1, struct nouveau_channel **);
			 u32 arg0, u32 arg1, bool priv,
			 struct nouveau_channel **);
void nouveau_channel_del(struct nouveau_channel **);
int  nouveau_channel_idle(struct nouveau_channel *);

+4 −3
Original line number Diff line number Diff line
@@ -370,7 +370,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
	if (device->info.family >= NV_DEVICE_INFO_V0_KEPLER) {
		ret = nouveau_channel_new(drm, &drm->client.device,
					  nvif_fifo_runlist_ce(device), 0,
					  &drm->cechan);
					  true, &drm->cechan);
		if (ret)
			NV_ERROR(drm, "failed to create ce channel, %d\n", ret);

@@ -381,7 +381,8 @@ nouveau_accel_init(struct nouveau_drm *drm)
	    device->info.chipset != 0xaa &&
	    device->info.chipset != 0xac) {
		ret = nouveau_channel_new(drm, &drm->client.device,
					  NvDmaFB, NvDmaTT, &drm->cechan);
					  NvDmaFB, NvDmaTT, false,
					  &drm->cechan);
		if (ret)
			NV_ERROR(drm, "failed to create ce channel, %d\n", ret);

@@ -393,7 +394,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
	}

	ret = nouveau_channel_new(drm, &drm->client.device,
				  arg0, arg1, &drm->channel);
				  arg0, arg1, false, &drm->channel);
	if (ret) {
		NV_ERROR(drm, "failed to create kernel channel, %d\n", ret);
		nouveau_accel_fini(drm);
Loading