nouveau.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Ben Skeggs <bskeggs@nvidia.com>
To: <nouveau@lists.freedesktop.org>
Cc: Ben Skeggs <bskeggs@nvidia.com>
Subject: [PATCH 136/156] drm/nouveau/nvif: rework device/cgrp "new chan" apis
Date: Wed, 17 Apr 2024 09:39:42 +1000	[thread overview]
Message-ID: <20240416234002.19509-137-bskeggs@nvidia.com> (raw)
In-Reply-To: <20240416234002.19509-1-bskeggs@nvidia.com>

- transition from "ioctl" interfaces

Signed-off-by: Ben Skeggs <bskeggs@nvidia.com>
---
 drivers/gpu/drm/nouveau/include/nvif/chan.h   |  25 ++++
 .../gpu/drm/nouveau/include/nvif/driverif.h   |  31 +++++
 drivers/gpu/drm/nouveau/include/nvif/if0020.h |  32 -----
 drivers/gpu/drm/nouveau/nouveau_abi16.c       |  14 +--
 drivers/gpu/drm/nouveau/nouveau_bo.c          |   2 +-
 drivers/gpu/drm/nouveau/nouveau_chan.c        |  75 +++++------
 drivers/gpu/drm/nouveau/nouveau_chan.h        |   8 +-
 drivers/gpu/drm/nouveau/nouveau_drm.c         |   6 +-
 drivers/gpu/drm/nouveau/nouveau_fence.c       |   3 +-
 drivers/gpu/drm/nouveau/nv17_fence.c          |   2 +-
 drivers/gpu/drm/nouveau/nv50_fence.c          |   2 +-
 drivers/gpu/drm/nouveau/nvif/Kbuild           |   1 +
 drivers/gpu/drm/nouveau/nvif/chan.c           |  45 +++++++
 drivers/gpu/drm/nouveau/nvkm/device/user.c    |  24 ++++
 .../gpu/drm/nouveau/nvkm/engine/fifo/base.c   |  39 ------
 .../gpu/drm/nouveau/nvkm/engine/fifo/priv.h   |   3 -
 .../gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c  |  40 +++---
 .../gpu/drm/nouveau/nvkm/engine/fifo/uchan.c  | 116 ++++++++++--------
 .../gpu/drm/nouveau/nvkm/engine/fifo/uchan.h  |  11 ++
 19 files changed, 268 insertions(+), 211 deletions(-)
 create mode 100644 drivers/gpu/drm/nouveau/include/nvif/chan.h
 create mode 100644 drivers/gpu/drm/nouveau/nvif/chan.c
 create mode 100644 drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.h

diff --git a/drivers/gpu/drm/nouveau/include/nvif/chan.h b/drivers/gpu/drm/nouveau/include/nvif/chan.h
new file mode 100644
index 000000000000..80f7ea8c7268
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/include/nvif/chan.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: MIT */
+#ifndef __NVIF_CHAN_H__
+#define __NVIF_CHAN_H__
+#include <nvif/object.h>
+#include <nvif/driverif.h>
+#include <nvif/push.h>
+struct nvif_cgrp;
+struct nvif_device;
+
+struct nvif_chan {
+	const struct nvif_chan_impl *impl;
+	struct nvif_chan_priv *priv;
+	struct nvif_object object;
+
+	struct nvif_device *device;
+	u8 runl;
+	u8 runq;
+
+	struct nvif_push push;
+};
+
+void nvif_chan_ctor(struct nvif_device *, struct nvif_cgrp *, const char *name, u8 runl, u8 runq,
+		    struct nvif_chan *);
+void nvif_chan_dtor(struct nvif_chan *);
+#endif
diff --git a/drivers/gpu/drm/nouveau/include/nvif/driverif.h b/drivers/gpu/drm/nouveau/include/nvif/driverif.h
index c1971b85d927..cc858955a97b 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/driverif.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/driverif.h
@@ -20,6 +20,7 @@ struct nvif_head_priv;
 struct nvif_disp_chan_priv;
 struct nvif_ctxdma_priv;
 struct nvif_cgrp_priv;
+struct nvif_chan_priv;
 
 struct nvif_driver {
 	const char *name;
@@ -431,10 +432,34 @@ struct nvif_disp_impl {
 	} chan;
 };
 
+struct nvif_chan_impl {
+	void (*del)(struct nvif_chan_priv *);
+
+	u16 id;
+	u32 doorbell_token;
+
+	struct {
+		enum {
+			NVIF_CHAN_INST_APER_INST,
+			NVIF_CHAN_INST_APER_VRAM,
+			NVIF_CHAN_INST_APER_HOST,
+			NVIF_CHAN_INST_APER_NCOH,
+		} aper;
+		u64 addr;
+	} inst;
+};
+
 struct nvif_cgrp_impl {
 	void (*del)(struct nvif_cgrp_priv *);
 
 	u16 id;
+
+	struct {
+		int (*new)(struct nvif_cgrp_priv *, u8 runq, bool priv, u16 devm,
+			   u64 gpfifo_offset, u64 gpfifo_length,
+			   struct nvif_mem_priv *userd, u16 userd_offset, const char *name,
+			   const struct nvif_chan_impl **, struct nvif_chan_priv **);
+	} chan;
 };
 
 struct nvif_device_impl {
@@ -566,6 +591,12 @@ struct nvif_device_impl {
 
 		struct {
 			s32 oclass;
+			int (*new)(struct nvif_device_priv *, u8 runl, u8 runq, bool priv, u16 devm,
+				   struct nvif_vmm_priv *, struct nvif_ctxdma_priv *push,
+				   u64 offset, u64 length, struct nvif_mem_priv *userd,
+				   u16 userd_offset, const char *name,
+				   const struct nvif_chan_impl **, struct nvif_chan_priv **,
+				   u64 handle);
 		} chan;
 	} fifo;
 };
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0020.h b/drivers/gpu/drm/nouveau/include/nvif/if0020.h
index 085e0ae8a450..1893b8aa0abb 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/if0020.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/if0020.h
@@ -2,38 +2,6 @@
 #ifndef __NVIF_IF0020_H__
 #define __NVIF_IF0020_H__
 
-union nvif_chan_args {
-	struct nvif_chan_v0 {
-		__u8  version;
-		__u8  namelen;
-		__u8  runlist;
-		__u8  runq;
-		__u8  priv;
-		__u8  pad05;
-		__u16 devm;
-		__u64 vmm;
-
-		__u64 ctxdma;
-		__u64 offset;
-		__u64 length;
-
-		__u64 huserd;
-		__u64 ouserd;
-
-		__u32 token;
-		__u16 chid;
-		__u8  pad3e;
-#define NVIF_CHAN_V0_INST_APER_VRAM 0
-#define NVIF_CHAN_V0_INST_APER_HOST 1
-#define NVIF_CHAN_V0_INST_APER_NCOH 2
-#define NVIF_CHAN_V0_INST_APER_INST 0xff
-		__u8  aper;
-		__u64 inst;
-
-		__u8  name[];
-	} v0;
-};
-
 union nvif_chan_event_args {
 	struct nvif_chan_event_v0 {
 		__u8 version;
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
index fdbc982ea566..d7db5c0eeaea 100644
--- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
+++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
@@ -430,13 +430,13 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS)
 	 */
 	switch (device->info.family) {
 	case NV_DEVICE_INFO_V0_VOLTA:
-		ret = nvif_object_ctor(&chan->chan->user, "abi16CeWar", 0, VOLTA_DMA_COPY_A,
+		ret = nvif_object_ctor(&chan->chan->chan.object, "abi16CeWar", 0, VOLTA_DMA_COPY_A,
 				       NULL, 0, &chan->ce);
 		if (ret)
 			goto done;
 		break;
 	case NV_DEVICE_INFO_V0_TURING:
-		ret = nvif_object_ctor(&chan->chan->user, "abi16CeWar", 0, TURING_DMA_COPY_A,
+		ret = nvif_object_ctor(&chan->chan->chan.object, "abi16CeWar", 0, TURING_DMA_COPY_A,
 				       NULL, 0, &chan->ce);
 		if (ret)
 			goto done;
@@ -524,7 +524,7 @@ nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS)
 	if (!chan)
 		return nouveau_abi16_put(abi16, -ENOENT);
 
-	ret = nvif_object_sclass_get(&chan->chan->user, &sclass);
+	ret = nvif_object_sclass_get(&chan->chan->chan.object, &sclass);
 	if (ret < 0)
 		return nouveau_abi16_put(abi16, ret);
 
@@ -583,7 +583,7 @@ nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS)
 
 	list_add(&ntfy->head, &chan->notifiers);
 
-	ret = nvif_object_ctor(&chan->chan->user, "abi16EngObj", init->handle,
+	ret = nvif_object_ctor(&chan->chan->chan.object, "abi16EngObj", init->handle,
 			       oclass, NULL, 0, &ntfy->object);
 
 	if (ret)
@@ -645,7 +645,7 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS)
 		args.limit += chan->ntfy->offset;
 	}
 
-	ret = nvif_object_ctor(&chan->chan->user, "abi16Ntfy", info->handle,
+	ret = nvif_object_ctor(&chan->chan->chan.object, "abi16Ntfy", info->handle,
 			       NV_DMA_IN_MEMORY, &args, sizeof(args),
 			       &ntfy->object);
 	if (ret)
@@ -768,7 +768,7 @@ nouveau_abi16_ioctl_new(struct nouveau_abi16 *abi16, struct nvif_ioctl_v0 *ioctl
 	if (IS_ERR(obj))
 		return PTR_ERR(obj);
 
-	ret = nvif_object_ctor(&chan->chan->user, "abi16EngObj", args->handle, args->oclass,
+	ret = nvif_object_ctor(&chan->chan->chan.object, "abi16EngObj", args->handle, args->oclass,
 			       NULL, 0, &obj->engobj.object);
 	if (ret)
 		nouveau_abi16_obj_del(obj);
@@ -796,7 +796,7 @@ nouveau_abi16_ioctl_sclass(struct nouveau_abi16 *abi16, struct nvif_ioctl_v0 *io
 	if (!chan)
 		return -EINVAL;
 
-	ret = nvif_object_sclass_get(&chan->chan->user, &sclass);
+	ret = nvif_object_sclass_get(&chan->chan->chan.object, &sclass);
 	if (ret < 0)
 		return ret;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 7db05d6699d8..6c5426fe2007 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -965,7 +965,7 @@ nouveau_bo_move_init(struct nouveau_drm *drm)
 		if (chan == NULL)
 			continue;
 
-		ret = nvif_object_ctor(&chan->user, "ttmBoMove",
+		ret = nvif_object_ctor(&chan->chan.object, "ttmBoMove",
 				       mthd->oclass | (mthd->engine << 16),
 				       mthd->oclass, NULL, 0,
 				       &drm->ttm.copy);
diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c
index 7c57bc48a8af..21927b817fa8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_chan.c
+++ b/drivers/gpu/drm/nouveau/nouveau_chan.c
@@ -93,7 +93,7 @@ nouveau_channel_del(struct nouveau_channel **pchan)
 		if (chan->fence)
 			nouveau_fence(chan->cli->drm)->context_del(chan);
 
-		if (nvif_object_constructed(&chan->user))
+		if (chan->chan.impl)
 			nouveau_svmm_part(chan->vmm->svmm, chan->inst);
 
 		nvif_object_dtor(&chan->blit);
@@ -104,7 +104,7 @@ nouveau_channel_del(struct nouveau_channel **pchan)
 		if (!chan->userd.map.impl)
 			chan->userd.map.ptr = NULL;
 		nvif_object_unmap_cpu(&chan->userd.map);
-		nvif_object_dtor(&chan->user);
+		nvif_chan_dtor(&chan->chan);
 		nvif_mem_dtor(&chan->userd.mem);
 		nvif_ctxdma_dtor(&chan->push.ctxdma);
 		nouveau_vma_del(&chan->push.vma);
@@ -258,10 +258,6 @@ nouveau_channel_ctor(struct nouveau_cli *cli, bool priv, u64 runm,
 {
 	struct nvif_device *device = &cli->device;
 	const u32 oclass = device->impl->fifo.chan.oclass;
-	struct {
-		struct nvif_chan_v0 chan;
-		char name[TASK_COMM_LEN+16];
-	} args;
 	struct nouveau_channel *chan;
 	const u64 plength = 0x10000;
 	const u64 ioffset = plength;
@@ -269,6 +265,11 @@ nouveau_channel_ctor(struct nouveau_cli *cli, bool priv, u64 runm,
 	char name[TASK_COMM_LEN];
 	int ret;
 	u64 size;
+	struct nvif_vmm_priv *vmm = NULL;
+	struct nvif_ctxdma_priv *ctxdma = NULL;
+	struct nvif_mem_priv *userd = NULL;
+	u64 offset, length = 0;
+	u16 userd_offset = 0;
 
 	switch (oclass) {
 	case  AMPERE_CHANNEL_GPFIFO_B:
@@ -306,28 +307,17 @@ nouveau_channel_ctor(struct nouveau_cli *cli, bool priv, u64 runm,
 	chan->runlist = __ffs64(runm);
 
 	/* create channel object */
-	args.chan.version = 0;
-	args.chan.namelen = sizeof(args.name);
-	args.chan.runlist = cli->drm->device.impl->fifo.runl[chan->runlist].id;
-	args.chan.runq = 0;
-	args.chan.priv = priv;
-	args.chan.devm = BIT(0);
 	if (oclass < NV50_CHANNEL_GPFIFO) {
-		args.chan.vmm = 0;
-		args.chan.ctxdma = nvif_handle(&chan->push.ctxdma.object);
-		args.chan.offset = chan->push.addr;
-		args.chan.length = 0;
+		ctxdma = chan->push.ctxdma.priv;
+		offset = chan->push.addr;
 	} else {
-		args.chan.vmm = nvif_handle(&chan->vmm->vmm.object);
-		if (oclass < FERMI_CHANNEL_GPFIFO)
-			args.chan.ctxdma = nvif_handle(&chan->push.ctxdma.object);
-		else
-			args.chan.ctxdma = 0;
-		args.chan.offset = ioffset + chan->push.addr;
-		args.chan.length = ilength;
+		vmm = chan->vmm->vmm.priv;
+		if (device->impl->fifo.chan.oclass < FERMI_CHANNEL_GPFIFO)
+			ctxdma = chan->push.ctxdma.priv;
+
+		offset = ioffset + chan->push.addr;
+		length = ilength;
 	}
-	args.chan.huserd = 0;
-	args.chan.ouserd = 0;
 
 	/* allocate userd */
 	if (oclass >= VOLTA_CHANNEL_GPFIFO_A) {
@@ -337,23 +327,26 @@ nouveau_channel_ctor(struct nouveau_cli *cli, bool priv, u64 runm,
 		if (ret)
 			return ret;
 
-		args.chan.huserd = nvif_handle(&chan->userd.mem.object);
-		args.chan.ouserd = 0;
+		userd = chan->userd.mem.priv;
 	}
 
 	get_task_comm(name, current);
-	snprintf(args.name, sizeof(args.name), "%s[%d]", name, task_pid_nr(current));
+	snprintf(chan->name, sizeof(chan->name), "%s[%d]", name, task_pid_nr(current));
 
-	ret = nvif_object_ctor(&device->object, "abi16ChanUser", 0, oclass,
-			       &args, sizeof(args), &chan->user);
+	ret = device->impl->fifo.chan.new(device->priv, device->impl->fifo.runl[chan->runlist].id,
+					  0, priv, BIT(0), vmm, ctxdma, offset, length,
+					  userd, userd_offset, chan->name,
+					  &chan->chan.impl, &chan->chan.priv,
+					  nvif_handle(&chan->chan.object));
 	if (ret) {
 		nouveau_channel_del(pchan);
 		return ret;
 	}
 
-	chan->chid = args.chan.chid;
-	chan->inst = args.chan.inst;
-	chan->token = args.chan.token;
+	nvif_chan_ctor(device, NULL, chan->name, chan->runlist, 0, &chan->chan);
+	chan->chid = chan->chan.impl->id;
+	chan->inst = chan->chan.impl->inst.addr;
+	chan->token = chan->chan.impl->doorbell_token;
 	return 0;
 }
 
@@ -366,18 +359,18 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
 	int ret, i;
 
 	if (!chan->userd.mem.impl) {
-		ret = nvif_object_map(&chan->user, NULL, 0);
+		ret = nvif_object_map(&chan->chan.object, NULL, 0);
 		if (ret)
 			return ret;
 
-		chan->userd.map.ptr = chan->user.map.ptr;
+		chan->userd.map.ptr = chan->chan.object.map.ptr;
 	} else {
 		ret = nvif_mem_map(&chan->userd.mem, NULL, 0, &chan->userd.map);
 		if (ret)
 			return ret;
 	}
 
-	if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO) {
+	if (chan->chan.object.oclass >= FERMI_CHANNEL_GPFIFO) {
 		struct {
 			struct nvif_event_v0 base;
 			struct nvif_chan_event_v0 host;
@@ -386,7 +379,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
 		args.host.version = 0;
 		args.host.type = NVIF_CHAN_EVENT_V0_KILLED;
 
-		ret = nvif_event_ctor(&chan->user, "abi16ChanKilled", chan->chid,
+		ret = nvif_event_ctor(&chan->chan.object, "abi16ChanKilled", chan->chid,
 				      nouveau_channel_killed, false,
 				      &args.base, sizeof(args), &chan->kill);
 		if (ret == 0)
@@ -412,7 +405,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
 			args.limit = device->info.ram_user - 1;
 		}
 
-		ret = nvif_object_ctor(&chan->user, "abi16ChanVramCtxDma", vram,
+		ret = nvif_object_ctor(&chan->chan.object, "abi16ChanVramCtxDma", vram,
 				       NV_DMA_IN_MEMORY, &args, sizeof(args),
 				       &chan->vram);
 		if (ret)
@@ -436,7 +429,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
 			args.limit = chan->vmm->vmm.impl->limit - 1;
 		}
 
-		ret = nvif_object_ctor(&chan->user, "abi16ChanGartCtxDma", gart,
+		ret = nvif_object_ctor(&chan->chan.object, "abi16ChanGartCtxDma", gart,
 				       NV_DMA_IN_MEMORY, &args, sizeof(args),
 				       &chan->gart);
 		if (ret)
@@ -444,7 +437,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
 	}
 
 	/* initialise dma tracking parameters */
-	switch (chan->user.oclass) {
+	switch (chan->chan.object.oclass) {
 	case NV03_CHANNEL_DMA:
 	case NV10_CHANNEL_DMA:
 	case NV17_CHANNEL_DMA:
@@ -478,7 +471,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
 
 	/* allocate software object class (used for fences on <= nv05) */
 	if (device->info.family < NV_DEVICE_INFO_V0_CELSIUS) {
-		ret = nvif_object_ctor(&chan->user, "abi16NvswFence", 0x006e,
+		ret = nvif_object_ctor(&chan->chan.object, "abi16NvswFence", 0x006e,
 				       NVIF_CLASS_SW_NV04,
 				       NULL, 0, &chan->nvsw);
 		if (ret)
diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.h b/drivers/gpu/drm/nouveau/nouveau_chan.h
index 786c929843d1..8f71492e2df3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_chan.h
+++ b/drivers/gpu/drm/nouveau/nouveau_chan.h
@@ -4,13 +4,12 @@
 #include <nvif/object.h>
 #include <nvif/ctxdma.h>
 #include <nvif/event.h>
-#include <nvif/push.h>
+#include <nvif/chan.h>
 struct nvif_device;
 
 struct nouveau_channel {
-	struct {
-		struct nvif_push push;
-	} chan;
+	char name[TASK_COMM_LEN+16];
+	struct nvif_chan chan;
 
 	struct nouveau_cli *cli;
 	struct nouveau_vmm *vmm;
@@ -53,7 +52,6 @@ struct nouveau_channel {
 	u32 user_get;
 	u32 user_put;
 
-	struct nvif_object user;
 	struct nvif_object blit;
 
 	struct nvif_event kill;
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 8ab6b9e03eb5..a2c9e8fa4ebd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -316,12 +316,12 @@ nouveau_accel_gr_init(struct nouveau_drm *drm)
 	 * on TNT/TNT2 HW that lacks any kind of support in host.
 	 */
 	if (!drm->channel->nvsw.client && device->info.family < NV_DEVICE_INFO_V0_TESLA) {
-		ret = nvif_object_ctor(&drm->channel->user, "drmNvsw",
+		ret = nvif_object_ctor(&drm->channel->chan.object, "drmNvsw",
 				       NVDRM_NVSW, nouveau_abi16_swclass(drm),
 				       NULL, 0, &drm->channel->nvsw);
 
 		if (ret == 0 && device->info.chipset >= 0x11) {
-			ret = nvif_object_ctor(&drm->channel->user, "drmBlit",
+			ret = nvif_object_ctor(&drm->channel->chan.object, "drmBlit",
 					       0x005f, 0x009f,
 					       NULL, 0, &drm->channel->blit);
 		}
@@ -361,7 +361,7 @@ nouveau_accel_gr_init(struct nouveau_drm *drm)
 			return;
 		}
 
-		ret = nvif_object_ctor(&drm->channel->user, "drmM2mfNtfy",
+		ret = nvif_object_ctor(&drm->channel->chan.object, "drmM2mfNtfy",
 				       NvNotify0, NV_DMA_IN_MEMORY,
 				       (&(struct nv_dma_v0) {
 						.target = NV_DMA_V0_TARGET_VRAM,
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 09686d038d60..ff31784effeb 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -210,7 +210,8 @@ nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_cha
 	args.host.version = 0;
 	args.host.type = NVIF_CHAN_EVENT_V0_NON_STALL_INTR;
 
-	ret = nvif_event_ctor(&chan->user, "fenceNonStallIntr", (chan->runlist << 16) | chan->chid,
+	ret = nvif_event_ctor(&chan->chan.object, "fenceNonStallIntr",
+			      (chan->runlist << 16) | chan->chid,
 			      nouveau_fence_wait_uevent_handler, false,
 			      &args.base, sizeof(args), &fctx->event);
 
diff --git a/drivers/gpu/drm/nouveau/nv17_fence.c b/drivers/gpu/drm/nouveau/nv17_fence.c
index 5b4ceac49225..17ff00b22e9e 100644
--- a/drivers/gpu/drm/nouveau/nv17_fence.c
+++ b/drivers/gpu/drm/nouveau/nv17_fence.c
@@ -92,7 +92,7 @@ nv17_fence_context_new(struct nouveau_channel *chan)
 	fctx->base.read = nv10_fence_read;
 	fctx->base.sync = nv17_fence_sync;
 
-	ret = nvif_object_ctor(&chan->user, "fenceCtxDma", NvSema,
+	ret = nvif_object_ctor(&chan->chan.object, "fenceCtxDma", NvSema,
 			       NV_DMA_FROM_MEMORY,
 			       (&(struct nv_dma_v0) {
 					.target = NV_DMA_V0_TARGET_VRAM,
diff --git a/drivers/gpu/drm/nouveau/nv50_fence.c b/drivers/gpu/drm/nouveau/nv50_fence.c
index 1d8792fdd89b..b418439e6bb1 100644
--- a/drivers/gpu/drm/nouveau/nv50_fence.c
+++ b/drivers/gpu/drm/nouveau/nv50_fence.c
@@ -51,7 +51,7 @@ nv50_fence_context_new(struct nouveau_channel *chan)
 	fctx->base.read = nv10_fence_read;
 	fctx->base.sync = nv17_fence_sync;
 
-	ret = nvif_object_ctor(&chan->user, "fenceCtxDma", NvSema,
+	ret = nvif_object_ctor(&chan->chan.object, "fenceCtxDma", NvSema,
 			       NV_DMA_IN_MEMORY,
 			       (&(struct nv_dma_v0) {
 					.target = NV_DMA_V0_TARGET_VRAM,
diff --git a/drivers/gpu/drm/nouveau/nvif/Kbuild b/drivers/gpu/drm/nouveau/nvif/Kbuild
index 50489933655c..757e10e8dce5 100644
--- a/drivers/gpu/drm/nouveau/nvif/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvif/Kbuild
@@ -2,6 +2,7 @@
 nvif-y := nvif/object.o
 nvif-y += nvif/client.o
 nvif-y += nvif/cgrp.o
+nvif-y += nvif/chan.o
 nvif-y += nvif/conn.o
 nvif-y += nvif/device.o
 nvif-y += nvif/disp.o
diff --git a/drivers/gpu/drm/nouveau/nvif/chan.c b/drivers/gpu/drm/nouveau/nvif/chan.c
new file mode 100644
index 000000000000..cfca4dac5388
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nvif/chan.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#include <nvif/chan.h>
+#include <nvif/cgrp.h>
+#include <nvif/device.h>
+
+void
+nvif_chan_dtor(struct nvif_chan *chan)
+{
+	if (!chan->impl)
+		return;
+
+	chan->impl->del(chan->priv);
+	chan->impl = NULL;
+}
+
+void
+nvif_chan_ctor(struct nvif_device *device, struct nvif_cgrp *cgrp, const char *name,
+	       u8 runl, u8 runq, struct nvif_chan *chan)
+{
+	nvif_object_ctor(!cgrp ? &device->object : &cgrp->object, name, chan->impl->id,
+			 device->impl->fifo.chan.oclass, &chan->object);
+	chan->device = device;
+	chan->runl = runl;
+	chan->runq = runq;
+}
diff --git a/drivers/gpu/drm/nouveau/nvkm/device/user.c b/drivers/gpu/drm/nouveau/nvkm/device/user.c
index fc81d595bdb7..c1ccb75db3c1 100644
--- a/drivers/gpu/drm/nouveau/nvkm/device/user.c
+++ b/drivers/gpu/drm/nouveau/nvkm/device/user.c
@@ -31,11 +31,13 @@
 #include <subdev/instmem.h>
 #include <subdev/timer.h>
 #include <subdev/mmu/ummu.h>
+#include <subdev/mmu/uvmm.h>
 #include <subdev/vfn/uvfn.h>
 #include <engine/disp/priv.h>
 #include <engine/disp/udisp.h>
 #include <engine/fifo/ufifo.h>
 #include <engine/fifo/ucgrp.h>
+#include <engine/fifo/uchan.h>
 
 struct nvif_device_priv {
 	struct nvkm_object object;
@@ -95,6 +97,27 @@ nvkm_udevice_time(struct nvif_device_priv *udev)
 	return nvkm_timer_read(udev->device->timer);
 }
 
+static int
+nvkm_udevice_chan_new(struct nvif_device_priv *udev, u8 runl, u8 runq, bool priv, u16 devm,
+		      struct nvif_vmm_priv *uvmm, struct nvif_ctxdma_priv *push,
+		      u64 offset, u64 length, struct nvif_mem_priv *userd, u16 userd_offset,
+		      const char *name, const struct nvif_chan_impl **pimpl,
+		      struct nvif_chan_priv **ppriv, u64 handle)
+{
+	struct nvkm_vmm *vmm = nvkm_uvmm_ref(uvmm);
+	struct nvkm_object *object;
+	int ret;
+
+	ret = nvkm_uchan_new(udev->device, NULL, runl, runq, priv, devm, vmm,
+			     push, offset, length, userd, userd_offset, name,
+			     pimpl, ppriv, &object);
+	nvkm_vmm_unref(&vmm);
+	if (ret)
+		return ret;
+
+	return nvkm_object_link_rb(udev->object.client, &udev->object, handle, object);
+}
+
 static int
 nvkm_udevice_cgrp_new(struct nvif_device_priv *udev, u8 runl, struct nvif_vmm_priv *uvmm,
 		      const char *name, const struct nvif_cgrp_impl **pimpl,
@@ -394,6 +417,7 @@ nvkm_udevice_new(struct nvkm_device *device,
 			nvkm_ufifo_ctor(device->fifo, &udev->impl.fifo);
 
 			udev->impl.fifo.cgrp.new = nvkm_udevice_cgrp_new;
+			udev->impl.fifo.chan.new = nvkm_udevice_chan_new;
 		}
 	}
 
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c
index 1894a2075079..181c8cf426ab 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c
@@ -69,44 +69,6 @@ nvkm_fifo_fault(struct nvkm_fifo *fifo, struct nvkm_fault_data *info)
 	return fifo->func->mmu_fault->recover(fifo, info);
 }
 
-static int
-nvkm_fifo_class_new(struct nvkm_device *device, const struct nvkm_oclass *oclass,
-		    void *argv, u32 argc, struct nvkm_object **pobject)
-{
-	struct nvkm_fifo *fifo = nvkm_fifo(oclass->engine);
-
-	if (oclass->engn == &fifo->func->chan.user)
-		return nvkm_uchan_new(fifo, NULL, oclass, argv, argc, pobject);
-
-	WARN_ON(1);
-	return -ENOSYS;
-}
-
-static const struct nvkm_device_oclass
-nvkm_fifo_class = {
-	.ctor = nvkm_fifo_class_new,
-};
-
-static int
-nvkm_fifo_class_get(struct nvkm_oclass *oclass, int index, const struct nvkm_device_oclass **class)
-{
-	struct nvkm_fifo *fifo = nvkm_fifo(oclass->engine);
-	const struct nvkm_fifo_func_chan *chan = &fifo->func->chan;
-	int c = 0;
-
-	/* *_CHANNEL_DMA, *_CHANNEL_GPFIFO_* */
-	if (chan->user.oclass) {
-		if (c++ == index) {
-			oclass->base = chan->user;
-			oclass->engn = &fifo->func->chan.user;
-			*class = &nvkm_fifo_class;
-			return 0;
-		}
-	}
-
-	return c;
-}
-
 static int
 nvkm_fifo_fini(struct nvkm_engine *engine, bool suspend)
 {
@@ -281,7 +243,6 @@ nvkm_fifo = {
 	.oneinit = nvkm_fifo_oneinit,
 	.init = nvkm_fifo_init,
 	.fini = nvkm_fifo_fini,
-	.base.sclass = nvkm_fifo_class_get,
 };
 
 int
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h
index d1386d00fc36..cd02f31b601a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h
@@ -205,7 +205,4 @@ extern const struct nvkm_engn_func ga100_engn;
 extern const struct nvkm_engn_func ga100_engn_ce;
 extern const struct nvkm_cgrp_func ga100_cgrp;
 extern const struct nvkm_chan_func ga100_chan;
-
-int nvkm_uchan_new(struct nvkm_fifo *, struct nvkm_cgrp *, const struct nvkm_oclass *,
-		   void *argv, u32 argc, struct nvkm_object **);
 #endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c
index 8acfd85cee53..90a85c1c0b56 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c
@@ -25,6 +25,7 @@
 #include "runl.h"
 
 #include <subdev/mmu/uvmm.h>
+#include <engine/fifo/uchan.h>
 
 struct nvif_cgrp_priv {
 	struct nvkm_object object;
@@ -34,32 +35,23 @@ struct nvif_cgrp_priv {
 };
 
 static int
-nvkm_ucgrp_chan_new(const struct nvkm_oclass *oclass, void *argv, u32 argc,
-		    struct nvkm_object **pobject)
+nvkm_ucgrp_chan_new(struct nvif_cgrp_priv *ucgrp, u8 runq, bool priv, u16 devm,
+		    u64 gpfifo_offset, u64 gpfifo_length,
+		    struct nvif_mem_priv *userd, u16 userd_offset, const char *name,
+		    const struct nvif_chan_impl **pimpl, struct nvif_chan_priv **ppriv)
 {
-	struct nvkm_cgrp *cgrp = container_of(oclass->parent, struct nvif_cgrp_priv, object)->cgrp;
-
-	return nvkm_uchan_new(cgrp->runl->fifo, cgrp, oclass, argv, argc, pobject);
-}
+	struct nvkm_cgrp *cgrp = ucgrp->cgrp;
+	struct nvkm_object *object;
+	int ret;
 
-static int
-nvkm_ucgrp_sclass(struct nvkm_object *object, int index, struct nvkm_oclass *oclass)
-{
-	struct nvkm_cgrp *cgrp = container_of(object, struct nvif_cgrp_priv, object)->cgrp;
-	struct nvkm_fifo *fifo = cgrp->runl->fifo;
-	const struct nvkm_fifo_func_chan *chan = &fifo->func->chan;
-	int c = 0;
-
-	/* *_CHANNEL_GPFIFO_* */
-	if (chan->user.oclass) {
-		if (c++ == index) {
-			oclass->base = chan->user;
-			oclass->ctor = nvkm_ucgrp_chan_new;
-			return 0;
-		}
-	}
+	ret = nvkm_uchan_new(cgrp->runl->fifo->engine.subdev.device, cgrp, cgrp->runl->id,
+			     runq, priv, devm, cgrp->vmm, NULL, gpfifo_offset, gpfifo_length,
+			     userd, userd_offset, name, pimpl, ppriv, &object);
+	if (ret)
+		return ret;
 
-	return -EINVAL;
+	nvkm_object_link(&ucgrp->object, object);
+	return 0;
 }
 
 static void
@@ -73,6 +65,7 @@ nvkm_ucgrp_del(struct nvif_cgrp_priv *ucgrp)
 static const struct nvif_cgrp_impl
 nvkm_ucgrp_impl = {
 	.del = nvkm_ucgrp_del,
+	.chan.new = nvkm_ucgrp_chan_new,
 };
 
 static void *
@@ -87,7 +80,6 @@ nvkm_ucgrp_dtor(struct nvkm_object *object)
 static const struct nvkm_object_func
 nvkm_ucgrp = {
 	.dtor = nvkm_ucgrp_dtor,
-	.sclass = nvkm_ucgrp_sclass,
 };
 
 int
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c
index 23d992413442..f21cd52d5ae3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c
@@ -24,10 +24,12 @@
 #include "chan.h"
 #include "chid.h"
 #include "runl.h"
+#include "uchan.h"
 
 #include <core/gpuobj.h>
 #include <core/oproxy.h>
 #include <subdev/mmu.h>
+#include <subdev/mmu/umem.h>
 #include <engine/dma.h>
 
 #include <nvif/if0020.h>
@@ -35,6 +37,8 @@
 struct nvif_chan_priv {
 	struct nvkm_object object;
 	struct nvkm_chan *chan;
+
+	struct nvif_chan_impl impl;
 };
 
 static int
@@ -267,6 +271,20 @@ nvkm_uchan_map(struct nvkm_object *object, void *argv, u32 argc,
 	return 0;
 }
 
+static void
+nvkm_uchan_del(struct nvif_chan_priv *uchan)
+{
+	struct nvkm_object *object = &uchan->object;
+
+	nvkm_object_fini(object, false);
+	nvkm_object_del(&object);
+}
+
+static const struct nvif_chan_impl
+nvkm_uchan_impl = {
+	.del = nvkm_uchan_del,
+};
+
 static int
 nvkm_uchan_fini(struct nvkm_object *object, bool suspend)
 {
@@ -326,92 +344,84 @@ nvkm_uchan_chan(struct nvkm_object *object)
 }
 
 int
-nvkm_uchan_new(struct nvkm_fifo *fifo, struct nvkm_cgrp *cgrp, const struct nvkm_oclass *oclass,
-	       void *argv, u32 argc, struct nvkm_object **pobject)
+nvkm_uchan_new(struct nvkm_device *device, struct nvkm_cgrp *cgrp, u8 runi, u8 runq, bool priv,
+	       u16 devm, struct nvkm_vmm *vmm, struct nvif_ctxdma_priv *upush, u64 offset,
+	       u64 length, struct nvif_mem_priv *uuserd, u16 userd_offset, const char *name,
+	       const struct nvif_chan_impl **pimpl, struct nvif_chan_priv **ppriv,
+	       struct nvkm_object **pobject)
 {
-	union nvif_chan_args *args = argv;
+	struct nvkm_fifo *fifo = device->fifo;
 	struct nvkm_runl *runl;
-	struct nvkm_vmm *vmm = NULL;
-	struct nvkm_dmaobj *ctxdma = NULL;
+	struct nvkm_dmaobj *ctxdma = (void *)upush;
 	struct nvkm_memory *userd = NULL;
 	struct nvif_chan_priv *uchan;
+	struct nvkm_engine *engine;
 	struct nvkm_chan *chan;
 	int ret;
 
-	if (argc < sizeof(args->v0) || args->v0.version != 0)
-		return -ENOSYS;
-	argc -= sizeof(args->v0);
-
-	if (args->v0.namelen != argc)
-		return -EINVAL;
-
 	/* Lookup objects referenced in args. */
-	runl = nvkm_runl_get(fifo, args->v0.runlist, 0);
+	runl = nvkm_runl_get(fifo, runi, 0);
 	if (!runl)
 		return -EINVAL;
 
-	if (args->v0.vmm) {
-		vmm = nvkm_uvmm_search(oclass->client, args->v0.vmm);
-		if (IS_ERR(vmm))
-			return PTR_ERR(vmm);
-	}
+	ctxdma = (void *)upush;
+	userd = nvkm_umem_ref(uuserd);
 
-	if (args->v0.ctxdma) {
-		ctxdma = nvkm_dmaobj_search(oclass->client, args->v0.ctxdma);
-		if (IS_ERR(ctxdma)) {
-			ret = PTR_ERR(ctxdma);
-			goto done;
-		}
+	/* Allocate channel. */
+	uchan = kzalloc(sizeof(*uchan), GFP_KERNEL);
+	if (!uchan) {
+		nvkm_memory_unref(&userd);
+		return -ENOMEM;
 	}
 
-	if (args->v0.huserd) {
-		userd = nvkm_umem_search(fifo->engine.subdev.device->mmu, oclass->client, args->v0.huserd);
-		if (IS_ERR(userd)) {
-			ret = PTR_ERR(userd);
-			userd = NULL;
-			goto done;
-		}
+	engine = nvkm_engine_ref(&fifo->engine);
+	if (IS_ERR(engine)) {
+		kfree(uchan);
+		nvkm_memory_unref(&userd);
+		return PTR_ERR(engine);
 	}
 
-	/* Allocate channel. */
-	if (!(uchan = kzalloc(sizeof(*uchan), GFP_KERNEL))) {
-		ret = -ENOMEM;
-		goto done;
-	}
+	nvkm_object_ctor(&nvkm_uchan, &(struct nvkm_oclass) { .engine = engine }, &uchan->object);
 
-	nvkm_object_ctor(&nvkm_uchan, oclass, &uchan->object);
-	*pobject = &uchan->object;
+	ret = nvkm_chan_new_(fifo->func->chan.func, runl, runq, cgrp, name, priv, devm,
+			     vmm, ctxdma, offset, length, userd, userd_offset,
+			     &uchan->chan);
+	if (ret)
+		goto done;
 
-	ret = nvkm_chan_new_(fifo->func->chan.func, runl, args->v0.runq, cgrp, args->v0.name,
-			     args->v0.priv != 0, args->v0.devm, vmm, ctxdma, args->v0.offset,
-			     args->v0.length, userd, args->v0.ouserd, &uchan->chan);
+	ret = nvkm_uchan_init(&uchan->object);
 	if (ret)
 		goto done;
 
 	chan = uchan->chan;
 
 	/* Return channel info to caller. */
+	uchan->impl = nvkm_uchan_impl;
+	uchan->impl.id = chan->id;
 	if (chan->func->doorbell_handle)
-		args->v0.token = chan->func->doorbell_handle(chan);
-	else
-		args->v0.token = ~0;
-
-	args->v0.chid = chan->id;
+		uchan->impl.doorbell_token = chan->func->doorbell_handle(chan);
 
 	switch (nvkm_memory_target(chan->inst->memory)) {
-	case NVKM_MEM_TARGET_INST: args->v0.aper = NVIF_CHAN_V0_INST_APER_INST; break;
-	case NVKM_MEM_TARGET_VRAM: args->v0.aper = NVIF_CHAN_V0_INST_APER_VRAM; break;
-	case NVKM_MEM_TARGET_HOST: args->v0.aper = NVIF_CHAN_V0_INST_APER_HOST; break;
-	case NVKM_MEM_TARGET_NCOH: args->v0.aper = NVIF_CHAN_V0_INST_APER_NCOH; break;
+	case NVKM_MEM_TARGET_INST: uchan->impl.inst.aper = NVIF_CHAN_INST_APER_INST; break;
+	case NVKM_MEM_TARGET_VRAM: uchan->impl.inst.aper = NVIF_CHAN_INST_APER_VRAM; break;
+	case NVKM_MEM_TARGET_HOST: uchan->impl.inst.aper = NVIF_CHAN_INST_APER_HOST; break;
+	case NVKM_MEM_TARGET_NCOH: uchan->impl.inst.aper = NVIF_CHAN_INST_APER_NCOH; break;
 	default:
 		WARN_ON(1);
 		ret = -EFAULT;
-		break;
+		goto done;
 	}
 
-	args->v0.inst = nvkm_memory_addr(chan->inst->memory);
+	uchan->impl.inst.addr = nvkm_memory_addr(chan->inst->memory);
+
+	*pimpl = &uchan->impl;
+	*ppriv = uchan;
+	*pobject = &uchan->object;
+
 done:
+	if (ret)
+		nvkm_uchan_del(uchan);
+
 	nvkm_memory_unref(&userd);
-	nvkm_vmm_unref(&vmm);
 	return ret;
 }
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.h
new file mode 100644
index 000000000000..1ab4047644ef
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: MIT */
+#ifndef __NVKM_UCHAN_H__
+#define __NVKM_UCHAN_H__
+#include <engine/fifo.h>
+#include <nvif/driverif.h>
+
+int nvkm_uchan_new(struct nvkm_device *, struct nvkm_cgrp *, u8 runl, u8 runq, bool priv, u16 devm,
+		   struct nvkm_vmm *, struct nvif_ctxdma_priv *push, u64 offset, u64 length,
+		   struct nvif_mem_priv *userd, u16 userd_offset, const char *name,
+		   const struct nvif_chan_impl **, struct nvif_chan_priv **, struct nvkm_object **);
+#endif
-- 
2.41.0


  parent reply	other threads:[~2024-04-16 23:43 UTC|newest]

Thread overview: 163+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 23:37 [PATCH 000/156] drm/nouveau: replace "ioctl" interface between drm/nvkm Ben Skeggs
2024-04-16 23:37 ` [PATCH 001/156] drm/nouveau: add nouveau_drm.device/mmu Ben Skeggs
2024-04-16 23:37 ` [PATCH 002/156] drm/nouveau: alias nouveau_drm.client to nouveau_drm.cli Ben Skeggs
2024-04-16 23:37 ` [PATCH 003/156] drm/nouveau: pass drm to nouveau_mem_new(), instead of cli Ben Skeggs
2024-04-16 23:37 ` [PATCH 004/156] drm/nouveau: pass drm to nv50_dmac_create(), rather than device+disp Ben Skeggs
2024-04-17  6:27   ` Philipp Stanner
2024-04-16 23:37 ` [PATCH 005/156] drm/nouveau: pass cli to nouveau_channel_new() instead of drm+device Ben Skeggs
2024-04-16 23:37 ` [PATCH 006/156] drm/nouveau: remove nouveau_chan.device Ben Skeggs
2024-04-16 23:37 ` [PATCH 007/156] drm/nouveau: remove chan->drm Ben Skeggs
2024-04-16 23:37 ` [PATCH 008/156] drm/nouveau: replace some void casts with chan->cli Ben Skeggs
2024-04-16 23:37 ` [PATCH 009/156] drm/nouveau: remove nouveau_drm.master Ben Skeggs
2024-04-16 23:37 ` [PATCH 010/156] drm/nouveau: always map device Ben Skeggs
2024-04-16 23:37 ` [PATCH 011/156] drm/nouveau: add nouveau_cli to nouveau_abi16 Ben Skeggs
2024-04-16 23:37 ` [PATCH 012/156] drm/nouveau: handle limited nvif in abi16 Ben Skeggs
2024-04-16 23:37 ` [PATCH 013/156] drm/nouveau: remove abi16->device Ben Skeggs
2024-04-16 23:37 ` [PATCH 014/156] drm/nouveau: remove abi16->handles Ben Skeggs
2024-04-16 23:37 ` [PATCH 015/156] drm/nouveau: store nvkm_device pointer in nouveau_drm Ben Skeggs
2024-04-16 23:37 ` [PATCH 016/156] drm/nouveau: create pci device once Ben Skeggs
2024-04-16 23:37 ` [PATCH 017/156] drm/nouveau: remove push pointer from nouveau_channel Ben Skeggs
2024-04-16 23:37 ` [PATCH 018/156] drm/nouveau/kms: remove a few unused struct members and fn decls Ben Skeggs
2024-04-16 23:37 ` [PATCH 019/156] drm/nouveau/kms: remove push pointer from nv50_dmac Ben Skeggs
2024-04-16 23:37 ` [PATCH 020/156] drm/nouveau/kms: move hw ring tracking vars into nvif_push Ben Skeggs
2024-04-16 23:37 ` [PATCH 021/156] drm/nouveau/kms: move dmac sync/vram ctxdmas to core+wndws Ben Skeggs
2024-04-16 23:37 ` [PATCH 022/156] drm/nouveau/nvkm: remove detect/mmio/subdev_mask from device args Ben Skeggs
2024-04-16 23:37 ` [PATCH 023/156] drm/nouveau/nvkm: move nouveau_nvif.c to nvkm/core/driver.c Ben Skeggs
2024-04-16 23:37 ` [PATCH 024/156] drm/nouveau/nvkm: move nvkm/engine/device/ to nvkm/device/ Ben Skeggs
2024-04-16 23:37 ` [PATCH 025/156] drm/nouveau/nvkm: remove perfmon Ben Skeggs
2024-04-16 23:37 ` [PATCH 026/156] drm/nouveau/nvkm: remove nvkm_client_search() Ben Skeggs
2024-04-16 23:37 ` [PATCH 027/156] drm/nouveau/nvif: remove support for userspace backends Ben Skeggs
2024-04-16 23:37 ` [PATCH 028/156] drm/nouveau/nvif: remove route/token Ben Skeggs
2024-04-16 23:37 ` [PATCH 029/156] drm/nouveau/nvif: remove nvxx_object() Ben Skeggs
2024-04-16 23:37 ` [PATCH 030/156] drm/nouveau/nvif: remove nvxx_client() Ben Skeggs
2024-04-16 23:37 ` [PATCH 031/156] drm/nouveau/nvif: remove driver keep/fini Ben Skeggs
2024-04-16 23:37 ` [PATCH 032/156] drm/nouveau/nvif: remove client version Ben Skeggs
2024-04-16 23:37 ` [PATCH 033/156] drm/nouveau/nvif: remove client devlist Ben Skeggs
2024-04-16 23:38 ` [PATCH 034/156] drm/nouveau/nvif: remove client fini Ben Skeggs
2024-04-16 23:38 ` [PATCH 035/156] drm/nouveau/nvif: remove device args Ben Skeggs
2024-04-16 23:38 ` [PATCH 036/156] drm/nouveau/nvif: remove device rd/wr Ben Skeggs
2024-04-16 23:38 ` [PATCH 037/156] drm/nouveau/nvif: remove disp chan rd/wr Ben Skeggs
2024-04-16 23:38 ` [PATCH 038/156] drm/nouveau/nvkm: rename struct nvkm_uevent Ben Skeggs
2024-04-16 23:38 ` [PATCH 039/156] drm/nouveau/nvkm: remove nvkm_client() Ben Skeggs
2024-04-16 23:38 ` [PATCH 040/156] drm/nouveau/nvkm: rename struct nvkm_udevice Ben Skeggs
2024-04-16 23:38 ` [PATCH 041/156] drm/nouveau/nvkm: rename struct nvkm_control Ben Skeggs
2024-04-16 23:38 ` [PATCH 042/156] drm/nouveau/nvkm: rename struct nvkm_uvfn Ben Skeggs
2024-04-16 23:38 ` [PATCH 043/156] drm/nouveau/nvkm: rename struct nvkm_ummu Ben Skeggs
2024-04-16 23:38 ` [PATCH 044/156] drm/nouveau/nvkm: rename struct nvkm_umem Ben Skeggs
2024-04-16 23:38 ` [PATCH 045/156] drm/nouveau/nvkm: rename struct nvkm_uvmm Ben Skeggs
2024-04-16 23:38 ` [PATCH 046/156] drm/nouveau/nvkm: detach user handling from nvkm_fault_buffer Ben Skeggs
2024-04-16 23:38 ` [PATCH 047/156] drm/nouveau/nvkm: detach user handling from nvkm_disp Ben Skeggs
2024-04-16 23:38 ` [PATCH 048/156] drm/nouveau/nvkm: detach user handling from nvkm_conn Ben Skeggs
2024-04-16 23:38 ` [PATCH 049/156] drm/nouveau/nvkm: detach user handling from nvkm_outp Ben Skeggs
2024-04-16 23:38 ` [PATCH 050/156] drm/nouveau/nvkm: detach user handling from nvkm_uhead Ben Skeggs
2024-04-16 23:38 ` [PATCH 051/156] drm/nouveau/nvkm: detach user handling from nvkm_disp_chan Ben Skeggs
2024-04-16 23:38 ` [PATCH 052/156] drm/nouveau/nvkm: rename struct nvkm_ucgrp Ben Skeggs
2024-04-16 23:38 ` [PATCH 053/156] drm/nouveau/nvkm: rename struct nvkm_uchan Ben Skeggs
2024-04-16 23:38 ` [PATCH 054/156] drm/nouveau/nvkm: move umem list to mmu Ben Skeggs
2024-04-16 23:38 ` [PATCH 055/156] drm/nouveau/disp: simplify hw user definition Ben Skeggs
2024-04-16 23:38 ` [PATCH 056/156] drm/nouveau/nvif: output oclass id in object dbg messages Ben Skeggs
2024-04-16 23:38 ` [PATCH 057/156] drm/nouveau/nvif: add alternate version of nvif_object_ctor() Ben Skeggs
2024-04-16 23:38 ` [PATCH 058/156] drm/nouveau/nvif: add alternate version of nvif_event_ctor() Ben Skeggs
2024-04-16 23:38 ` [PATCH 059/156] drm/nouveau/nvif: move nvif<->nvkm interface definitions to driverif.h Ben Skeggs
2024-04-16 23:38 ` [PATCH 060/156] drm/nouveau/nvif: rework "new driver" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 061/156] drm/nouveau/nvkm: remove device list Ben Skeggs
2024-04-16 23:38 ` [PATCH 062/156] drm/nouveau/nvif: rework driver "new client" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 063/156] drm/nouveau/nvif: rework client "new device" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 064/156] drm/nouveau/nvif: remove client from object rb Ben Skeggs
2024-04-16 23:38 ` [PATCH 065/156] drm/nouveau/nvif: rework device "sclass" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 066/156] drm/nouveau/nvif: rework device "map" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 067/156] drm/nouveau/nvif: rework device "info v0" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 068/156] drm/nouveau/nvif: rework device "info v1" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 069/156] drm/nouveau/nvif: rework device "time" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 070/156] drm/nouveau/nvif: rework device "new ctrl" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 071/156] drm/nouveau/nvif: rework ctrl "pstate info" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 072/156] drm/nouveau/nvif: rework ctrl "pstate attr" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 073/156] drm/nouveau/nvif: rework ctrl "pstate user" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 074/156] drm/nouveau/nvif: remove ctrl from object rb Ben Skeggs
2024-04-16 23:38 ` [PATCH 075/156] drm/nouveau/nvif: rework device "new usermode" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 076/156] drm/nouveau/nvif: rework usermode "map" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 077/156] drm/nouveau/nvif: remove usermode from object rb Ben Skeggs
2024-04-16 23:38 ` [PATCH 078/156] drm/nouveau/nvif: rework device "new mmu" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 079/156] drm/nouveau/nvif: rework mmu "sclass" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 080/156] drm/nouveau/nvif: rework mmu "heap" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 081/156] drm/nouveau/nvif: rework mmu "type" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 082/156] drm/nouveau/nvif: rework mmu "kind" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 083/156] drm/nouveau/nvif: rework mmu "new mem" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 084/156] drm/nouveau/nvif: rework mem "map"/"unmap" apis Ben Skeggs
2024-04-16 23:38 ` [PATCH 085/156] drm/nouveau/nvif: rework mmu "new vmm" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 086/156] drm/nouveau/nvif: remove mmu from object rb Ben Skeggs
2024-04-16 23:38 ` [PATCH 087/156] drm/nouveau/nvif: rework vmm "page" api Ben Skeggs
2024-04-16 23:38 ` [PATCH 088/156] drm/nouveau/nvif: rework vmm "get"/"put" apis Ben Skeggs
2024-04-16 23:38 ` [PATCH 089/156] drm/nouveau/nvif: rework vmm "map"/"unmap" apis Ben Skeggs
2024-04-16 23:38 ` [PATCH 090/156] drm/nouveau/nvif: rework vmm "pfnmap"/"pfnclr" apis Ben Skeggs
2024-04-16 23:38 ` [PATCH 091/156] drm/nouveau/nvif: rework vmm "raw get"/"raw put" apis Ben Skeggs
2024-04-16 23:38 ` [PATCH 092/156] drm/nouveau/nvif: rework vmm "raw map"/"raw unmap" apis Ben Skeggs
2024-04-16 23:38 ` [PATCH 093/156] drm/nouveau/nvif: rework vmm "raw sparse" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 094/156] drm/nouveau/nvif: rework vmm "fault replay"/"fault cancel" apis Ben Skeggs
2024-04-16 23:39 ` [PATCH 095/156] drm/nouveau/nvif: rework device "new fault buffer" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 096/156] drm/nouveau/nvif: rework fault buffer "map" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 097/156] drm/nouveau/nvif: rework fault buffer "new event" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 098/156] drm/nouveau/nvif: remove fault buffer from object rb Ben Skeggs
2024-04-16 23:39 ` [PATCH 099/156] drm/nouveau/nvif: rework device "new disp" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 100/156] drm/nouveau/nvif: rework disp "sclass" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 101/156] drm/nouveau/nvif: rework disp "new caps" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 102/156] drm/nouveau/nvif: rework disp "new conn" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 103/156] drm/nouveau/nvif: rework conn "new event" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 104/156] drm/nouveau/nvif: remove conn from object rb Ben Skeggs
2024-04-16 23:39 ` [PATCH 105/156] drm/nouveau/nvif: rework disp "new outp" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 106/156] drm/nouveau/nvif: rework outp "detect" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 107/156] drm/nouveau/nvif: rework outp "edid get" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 108/156] drm/nouveau/nvif: rework outp "load detect" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 109/156] drm/nouveau/nvif: rework outp "inherit" apis Ben Skeggs
2024-04-16 23:39 ` [PATCH 110/156] drm/nouveau/nvif: rework outp "acquire" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 111/156] drm/nouveau/nvif: rework outp "release" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 112/156] drm/nouveau/nvif: rework outp "bl get"/"bl set" apis Ben Skeggs
2024-04-16 23:39 ` [PATCH 113/156] drm/nouveau/nvif: rework outp "lvds config" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 114/156] drm/nouveau/nvif: rework outp "hdmi " Ben Skeggs
2024-04-16 23:39 ` [PATCH 115/156] drm/nouveau/nvif: rework outp "infoframe" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 116/156] drm/nouveau/nvif: rework outp "hda eld" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 117/156] drm/nouveau/nvif: rework outp "dp aux pwr" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 118/156] drm/nouveau/nvif: rework outp "dp aux xfer" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 119/156] drm/nouveau/nvif: rework outp "dp rates" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 120/156] drm/nouveau/nvif: rework outp "dp train" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 121/156] drm/nouveau/nvif: rework outp "dp drive" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 122/156] drm/nouveau/nvif: rework outp "dp sst" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 123/156] drm/nouveau/nvif: rework outp "dp mst id get"/"dp mst id put" apis Ben Skeggs
2024-04-16 23:39 ` [PATCH 124/156] drm/nouveau/nvif: rework outp "dp mst vcpi" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 125/156] drm/nouveau/nvif: remove outp from object rb Ben Skeggs
2024-04-16 23:39 ` [PATCH 126/156] drm/nouveau/nvif: rework disp "new head" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 127/156] drm/nouveau/nvif: rework head "scanoutpos" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 128/156] drm/nouveau/nvif: rework head "new event" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 129/156] drm/nouveau/nvif: remove head from object rb Ben Skeggs
2024-04-16 23:39 ` [PATCH 130/156] drm/nouveau/nvif: rework disp "new chan" apis Ben Skeggs
2024-04-16 23:39 ` [PATCH 131/156] drm/nouveau/nvif: remove disp from object rb Ben Skeggs
2024-04-16 23:39 ` [PATCH 132/156] drm/nouveau/nvif: rework disp chan "new ctxdma" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 133/156] drm/nouveau/nvif: remove disp chans from object rb Ben Skeggs
2024-04-16 23:39 ` [PATCH 134/156] drm/nouveau/nvif: rework device "new cgrp" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 135/156] drm/nouveau/nvif: rework device "new ctxdma" api Ben Skeggs
2024-04-16 23:39 ` Ben Skeggs [this message]
2024-04-16 23:39 ` [PATCH 137/156] drm/nouveau/nvif: remove mem from object rb Ben Skeggs
2024-04-16 23:39 ` [PATCH 138/156] drm/nouveau/nvif: remove vmm " Ben Skeggs
2024-04-16 23:39 ` [PATCH 139/156] drm/nouveau/nvif: remove ctxdma " Ben Skeggs
2024-04-16 23:39 ` [PATCH 140/156] drm/nouveau/nvif: remove device " Ben Skeggs
2024-04-16 23:39 ` [PATCH 141/156] drm/nouveau/nvif: rework chan "map" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 142/156] drm/nouveau/nvif: rework chan "sclass" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 143/156] drm/nouveau/nvif: rework chan "new event" apis Ben Skeggs
2024-04-16 23:39 ` [PATCH 144/156] drm/nouveau/nvif: rework chan "new ctxdma" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 145/156] drm/nouveau/nvif: rework chan "new engobj" apis Ben Skeggs
2024-04-16 23:39 ` [PATCH 146/156] drm/nouveau/nvif: remove chan from object rb Ben Skeggs
2024-04-16 23:39 ` [PATCH 147/156] drm/nouveau/nvif: rework engobj "mthd" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 148/156] drm/nouveau/nvif: rework engobj "new event" api Ben Skeggs
2024-04-16 23:39 ` [PATCH 149/156] drm/nouveau/nvif: remove engobj from object rb Ben Skeggs
2024-04-16 23:39 ` [PATCH 150/156] drm/nouveau/nvkm: switch nvkm_object to non-irqsafe spinlock Ben Skeggs
2024-04-16 23:39 ` [PATCH 151/156] drm/nouveau: remove client_mutex Ben Skeggs
2024-04-16 23:39 ` [PATCH 152/156] drm/nouveau: move nvxx_* definitions to nouveau_drv.h Ben Skeggs
2024-04-16 23:39 ` [PATCH 153/156] drm/nouveau: pass nouveau_drm to nvxx_* Ben Skeggs
2024-04-16 23:40 ` [PATCH 154/156] drm/nouveau: remove remaining usage of nvif_device.info Ben Skeggs
2024-04-16 23:40 ` [PATCH 155/156] drm/nouveau: remove remaining usage of nvif_device.object.map Ben Skeggs
2024-04-16 23:40 ` [PATCH 156/156] drm/nouveau: remove remaining usage of nouveau_drm.client Ben Skeggs
2024-04-17  4:15 ` [PATCH 000/156] drm/nouveau: replace "ioctl" interface between drm/nvkm Dave Airlie
2024-04-18 12:52   ` Ben Skeggs
2024-04-17 22:24 ` Danilo Krummrich
2024-04-18 14:03   ` Ben Skeggs
2024-04-22  9:28     ` Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240416234002.19509-137-bskeggs@nvidia.com \
    --to=bskeggs@nvidia.com \
    --cc=nouveau@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).