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 148/156] drm/nouveau/nvif: rework engobj "new event" api
Date: Wed, 17 Apr 2024 09:39:54 +1000	[thread overview]
Message-ID: <20240416234002.19509-149-bskeggs@nvidia.com> (raw)
In-Reply-To: <20240416234002.19509-1-bskeggs@nvidia.com>

- transition from "ioctl" interface

Signed-off-by: Ben Skeggs <bskeggs@nvidia.com>
---
 drivers/gpu/drm/nouveau/dispnv04/disp.c       |  8 ++-
 .../gpu/drm/nouveau/include/nvif/driverif.h   |  5 ++
 drivers/gpu/drm/nouveau/include/nvif/event.h  | 21 +------
 drivers/gpu/drm/nouveau/include/nvif/if000e.h | 26 --------
 drivers/gpu/drm/nouveau/include/nvif/object.h |  3 -
 .../gpu/drm/nouveau/include/nvkm/core/event.h |  1 -
 .../drm/nouveau/include/nvkm/core/object.h    |  6 +-
 .../gpu/drm/nouveau/include/nvkm/core/os.h    |  1 -
 drivers/gpu/drm/nouveau/nvif/event.c          | 46 +-------------
 drivers/gpu/drm/nouveau/nvif/object.c         | 29 ---------
 drivers/gpu/drm/nouveau/nvkm/core/ioctl.c     | 32 +---------
 drivers/gpu/drm/nouveau/nvkm/core/oproxy.c    | 13 ----
 drivers/gpu/drm/nouveau/nvkm/core/uevent.c    | 62 -------------------
 .../gpu/drm/nouveau/nvkm/engine/fifo/uchan.c  | 13 ++++
 drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c | 14 ++---
 15 files changed, 36 insertions(+), 244 deletions(-)
 delete mode 100644 drivers/gpu/drm/nouveau/include/nvif/if000e.h

diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c
index 3e10ba2ed20f..3d564512b0f6 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c
@@ -236,10 +236,14 @@ nv04_display_create(struct drm_device *dev)
 
 	/* Request page flip completion event. */
 	if (drm->channel) {
-		ret = nvif_event_ctor(&drm->channel->nvsw.object, "kmsFlip", 0, nv04_flip_complete,
-				      true, NULL, 0, &disp->flip);
+		ret = drm->channel->nvsw.impl->event.new(drm->channel->nvsw.priv,
+							 nvif_handle(&disp->flip.object),
+							 &disp->flip.impl, &disp->flip.priv);
 		if (ret)
 			return ret;
+
+		nvif_event_ctor(&drm->channel->nvsw.object, "kmsFlip", 0, nv04_flip_complete,
+				&disp->flip);
 	}
 
 	nouveau_hw_save_vga_fonts(dev, 1);
diff --git a/drivers/gpu/drm/nouveau/include/nvif/driverif.h b/drivers/gpu/drm/nouveau/include/nvif/driverif.h
index d8a30af9eae7..244024c19206 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/driverif.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/driverif.h
@@ -435,6 +435,11 @@ struct nvif_disp_impl {
 struct nvif_engobj_impl {
 	void (*del)(struct nvif_engobj_priv *);
 	int (*mthd)(struct nvif_engobj_priv *, u32 mthd, void *argv, u32 argc);
+
+	struct {
+		int (*new)(struct nvif_engobj_priv *, u64 token,
+			   const struct nvif_event_impl **, struct nvif_event_priv **);
+	} event;
 };
 
 struct nvif_chan_impl {
diff --git a/drivers/gpu/drm/nouveau/include/nvif/event.h b/drivers/gpu/drm/nouveau/include/nvif/event.h
index 338082bdc67c..42c2d0b5f66b 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/event.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/event.h
@@ -2,7 +2,6 @@
 #ifndef __NVIF_EVENT_H__
 #define __NVIF_EVENT_H__
 #include <nvif/object.h>
-#include <nvif/if000e.h>
 struct nvif_event;
 
 #define NVIF_EVENT_KEEP 0
@@ -23,30 +22,14 @@ nvif_event_constructed(struct nvif_event *event)
 	return nvif_object_constructed(&event->object);
 }
 
-int nvif_event_ctor_(struct nvif_object *, const char *, u32, nvif_event_func, bool,
-		     struct nvif_event_v0 *, u32, bool, struct nvif_event *);
-
-static inline int
-nvif_event_ctor_0(struct nvif_object *parent, const char *name, u32 handle, nvif_event_func func,
-		  bool wait, struct nvif_event_v0 *args, u32 argc, struct nvif_event *event)
-{
-	return nvif_event_ctor_(parent, name, handle, func, wait, args, argc, true, event);
-}
-
 static inline void
-nvif_event_ctor_1(struct nvif_object *parent, const char *name, u32 handle,
-		  nvif_event_func func, struct nvif_event *event)
+nvif_event_ctor(struct nvif_object *parent, const char *name, u32 handle,
+		nvif_event_func func, struct nvif_event *event)
 {
 	nvif_object_ctor(parent, name ?: "nvifEvent", handle, 0, &event->object);
 	event->func = func;
 }
 
-#define nvif_event_ctor__(A,B,C,D,E,F,G,H,IMPL,...) IMPL
-#define nvif_event_ctor(A...) nvif_event_ctor__(A, nvif_event_ctor_0, \
-						   nvif_event_ctor__, \
-						   nvif_event_ctor__, \
-						   nvif_event_ctor_1)(A)
-
 void nvif_event_dtor(struct nvif_event *);
 int nvif_event_allow(struct nvif_event *);
 int nvif_event_block(struct nvif_event *);
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if000e.h b/drivers/gpu/drm/nouveau/include/nvif/if000e.h
deleted file mode 100644
index 90a936cb1766..000000000000
--- a/drivers/gpu/drm/nouveau/include/nvif/if000e.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-#ifndef __NVIF_IF000E_H__
-#define __NVIF_IF000E_H__
-
-union nvif_event_args {
-	struct nvif_event_v0 {
-		__u8 version;
-		__u8 wait;
-		__u8 pad02[6];
-		__u8 data[];
-	} v0;
-};
-
-#define NVIF_EVENT_V0_ALLOW 0x00
-#define NVIF_EVENT_V0_BLOCK 0x01
-
-union nvif_event_allow_args {
-	struct nvif_event_allow_vn {
-	} vn;
-};
-
-union nvif_event_block_args {
-	struct nvif_event_block_vn {
-	} vn;
-};
-#endif
diff --git a/drivers/gpu/drm/nouveau/include/nvif/object.h b/drivers/gpu/drm/nouveau/include/nvif/object.h
index 56308333ef86..98a8bba8f0ee 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/object.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/object.h
@@ -40,7 +40,6 @@ void nvif_object_ctor_1(struct nvif_object *parent, const char *name, u32 handle
 
 void nvif_object_dtor(struct nvif_object *);
 int  nvif_object_ioctl(struct nvif_object *, void *, u32, void **);
-int  nvif_object_mthd(struct nvif_object *, u32, void *, u32);
 int nvif_object_map_cpu(struct nvif_object *, const struct nvif_mapinfo *, struct nvif_map *);
 int nvif_object_unmap_cpu(struct nvif_map *);
 
@@ -67,8 +66,6 @@ int nvif_object_unmap_cpu(struct nvif_map *);
 	_data;                                                                 \
 })
 
-#define nvif_mthd(a,b,c,d) nvif_object_mthd((a), (b), (c), (d))
-
 #define NVIF_RD32_(p,o,dr)   nvif_rd32((p), (o) + (dr))
 #define NVIF_WR32_(p,o,dr,f) nvif_wr32((p), (o) + (dr), (f))
 #define NVIF_RD32(p,A...) DRF_RD(NVIF_RD32_,                  (p), 0, ##A)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/event.h b/drivers/gpu/drm/nouveau/include/nvkm/core/event.h
index f31f0f30732a..76e05c8da979 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/event.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/event.h
@@ -76,7 +76,6 @@ struct nvif_event_priv;
 int nvkm_uevent_new_(struct nvkm_object *parent, u64 handle, struct nvkm_event *event,
 		     bool wait, int id, u32 bits, nvkm_uevent_func,
 		     const struct nvif_event_impl **, struct nvif_event_priv **);
-int nvkm_uevent_new(const struct nvkm_oclass *, void *argv, u32 argc, struct nvkm_object **);
 int nvkm_uevent_add(struct nvif_event_priv *, struct nvkm_event *, int id, u32 bits,
 		    nvkm_uevent_func);
 #endif
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/object.h b/drivers/gpu/drm/nouveau/include/nvkm/core/object.h
index 69972b0836e4..de8bf1cc95d8 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/object.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/object.h
@@ -4,7 +4,8 @@
 #include <core/oclass.h>
 struct nvkm_event;
 struct nvkm_gpuobj;
-struct nvkm_uevent;
+struct nvif_event_impl;
+struct nvif_event_priv;
 
 struct nvkm_object {
 	const struct nvkm_object_func *func;
@@ -28,7 +29,8 @@ struct nvkm_object_func {
 	int (*bind)(struct nvkm_object *, struct nvkm_gpuobj *, int align,
 		    struct nvkm_gpuobj **);
 	int (*sclass)(struct nvkm_object *, int index, struct nvkm_oclass *);
-	int (*uevent)(struct nvkm_object *, void *argv, u32 argc, struct nvkm_uevent *);
+	int (*uevent)(struct nvkm_object *, u64 token,
+		      const struct nvif_event_impl **, struct nvif_event_priv **);
 };
 
 void nvkm_object_ctor(const struct nvkm_object_func *,
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h
index 9d16413239d4..056f182d9b0b 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h
@@ -31,6 +31,5 @@ nvkm_blob_dtor(struct nvkm_blob *blob)
 #define nvkm_list_foreach(p,h,m,c)                                                           \
 	for (p = nvkm_list_find(p, (h), m, (c)); p; p = nvkm_list_find_next(p, (h), m, (c)))
 
-#define nvkm_uevent nvif_event_priv
 #define nvkm_client nvif_client_priv
 #endif
diff --git a/drivers/gpu/drm/nouveau/nvif/event.c b/drivers/gpu/drm/nouveau/nvif/event.c
index 5b8ec641703b..2974ec8e13af 100644
--- a/drivers/gpu/drm/nouveau/nvif/event.c
+++ b/drivers/gpu/drm/nouveau/nvif/event.c
@@ -23,20 +23,11 @@
 #include <nvif/driverif.h>
 #include <nvif/printf.h>
 
-#include <nvif/class.h>
-#include <nvif/if000e.h>
-
 int
 nvif_event_block(struct nvif_event *event)
 {
 	int ret;
 
-	if (!event->impl && nvif_event_constructed(event)) {
-		int ret = nvif_mthd(&event->object, NVIF_EVENT_V0_BLOCK, NULL, 0);
-		NVIF_ERRON(ret, &event->object, "[BLOCK]");
-		return ret;
-	}
-
 	if (!event->impl)
 		return 0;
 
@@ -50,12 +41,6 @@ nvif_event_allow(struct nvif_event *event)
 {
 	int ret;
 
-	if (!event->impl && nvif_event_constructed(event)) {
-		int ret = nvif_mthd(&event->object, NVIF_EVENT_V0_ALLOW, NULL, 0);
-		NVIF_ERRON(ret, &event->object, "[ALLOW]");
-		return ret;
-	}
-
 	if (!event->impl)
 		return 0;
 
@@ -67,38 +52,9 @@ nvif_event_allow(struct nvif_event *event)
 void
 nvif_event_dtor(struct nvif_event *event)
 {
-	if (!event->impl) {
-		nvif_object_dtor(&event->object);
+	if (!event->impl)
 		return;
-	}
 
 	event->impl->del(event->priv);
 	event->impl = NULL;
 }
-
-int
-nvif_event_ctor_(struct nvif_object *parent, const char *name, u32 handle, nvif_event_func func,
-		 bool wait, struct nvif_event_v0 *args, u32 argc, bool warn,
-		 struct nvif_event *event)
-{
-	struct nvif_event_v0 _args;
-	int ret;
-
-	if (!args) {
-		args = &_args;
-		argc = sizeof(_args);
-	}
-
-	args->version = 0;
-	args->wait = wait;
-
-	ret = nvif_object_ctor(parent, name ?: "nvifEvent", handle,
-			       NVIF_CLASS_EVENT, args, argc, &event->object);
-	NVIF_ERRON(ret && warn, parent, "[NEW EVENT wait:%d size:%zd]",
-		   args->wait, argc - sizeof(*args));
-	if (ret)
-		return ret;
-
-	event->func = func;
-	return 0;
-}
diff --git a/drivers/gpu/drm/nouveau/nvif/object.c b/drivers/gpu/drm/nouveau/nvif/object.c
index 9887241c5200..3379580463e6 100644
--- a/drivers/gpu/drm/nouveau/nvif/object.c
+++ b/drivers/gpu/drm/nouveau/nvif/object.c
@@ -46,35 +46,6 @@ nvif_object_ioctl(struct nvif_object *object, void *data, u32 size, void **hack)
 	return client->driver->ioctl(client->object.priv, data, size, hack);
 }
 
-int
-nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size)
-{
-	struct {
-		struct nvif_ioctl_v0 ioctl;
-		struct nvif_ioctl_mthd_v0 mthd;
-	} *args;
-	u8 stack[128];
-	int ret;
-
-	if (sizeof(*args) + size > sizeof(stack)) {
-		if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL)))
-			return -ENOMEM;
-	} else {
-		args = (void *)stack;
-	}
-	args->ioctl.version = 0;
-	args->ioctl.type = NVIF_IOCTL_V0_MTHD;
-	args->mthd.version = 0;
-	args->mthd.method = mthd;
-
-	memcpy(args->mthd.data, data, size);
-	ret = nvif_object_ioctl(object, args, sizeof(*args) + size, NULL);
-	memcpy(data, args->mthd.data, size);
-	if (args != (void *)stack)
-		kfree(args);
-	return ret;
-}
-
 int
 nvif_object_unmap_cpu(struct nvif_map *map)
 {
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c
index b34ed158aa63..50e9a6d51c05 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c
@@ -24,7 +24,6 @@
 #include <core/ioctl.h>
 #include <core/client.h>
 #include <core/engine.h>
-#include <core/event.h>
 
 #include <nvif/unpack.h>
 #include <nvif/ioctl.h>
@@ -41,15 +40,6 @@ nvkm_ioctl_nop(struct nvkm_client *client,
 static int
 nvkm_ioctl_sclass_(struct nvkm_object *object, int index, struct nvkm_oclass *oclass)
 {
-	if ( object->func->uevent &&
-	    !object->func->uevent(object, NULL, 0, NULL) && index-- == 0) {
-		oclass->ctor = nvkm_uevent_new;
-		oclass->base.minver = 0;
-		oclass->base.maxver = 0;
-		oclass->base.oclass = NVIF_CLASS_EVENT;
-		return 0;
-	}
-
 	if (object->func->sclass)
 		return object->func->sclass(object, index, oclass);
 
@@ -82,7 +72,7 @@ nvkm_ioctl_new(struct nvkm_client *client,
 	} else
 		return ret;
 
-	if (!parent->func->sclass && !parent->func->uevent) {
+	if (!parent->func->sclass) {
 		nvif_ioctl(parent, "cannot have children\n");
 		return -EINVAL;
 	}
@@ -142,25 +132,6 @@ nvkm_ioctl_del(struct nvkm_client *client,
 	return ret ? ret : 1;
 }
 
-static int
-nvkm_ioctl_mthd(struct nvkm_client *client,
-		struct nvkm_object *object, void *data, u32 size)
-{
-	union {
-		struct nvif_ioctl_mthd_v0 v0;
-	} *args = data;
-	int ret = -ENOSYS;
-
-	nvif_ioctl(object, "mthd size %d\n", size);
-	if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, true))) {
-		nvif_ioctl(object, "mthd vers %d mthd %02x\n",
-			   args->v0.version, args->v0.method);
-		ret = nvkm_object_mthd(object, args->v0.method, data, size);
-	}
-
-	return ret;
-}
-
 static struct {
 	int version;
 	int (*func)(struct nvkm_client *, struct nvkm_object *, void *, u32);
@@ -170,7 +141,6 @@ nvkm_ioctl_v0[] = {
 	{ 0x00, nvkm_ioctl_sclass },
 	{ 0x00, nvkm_ioctl_new },
 	{ 0x00, nvkm_ioctl_del },
-	{ 0x00, nvkm_ioctl_mthd },
 };
 
 static int
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c b/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c
index 690131104d7b..890532836c03 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c
@@ -55,18 +55,6 @@ nvkm_oproxy_sclass(struct nvkm_object *object, int index,
 	return oproxy->object->func->sclass(oproxy->object, index, oclass);
 }
 
-static int
-nvkm_oproxy_uevent(struct nvkm_object *object, void *argv, u32 argc,
-		   struct nvkm_uevent *uevent)
-{
-	struct nvkm_oproxy *oproxy = nvkm_oproxy(object);
-
-	if (!oproxy->object->func->uevent)
-		return -ENOSYS;
-
-	return oproxy->object->func->uevent(oproxy->object, argv, argc, uevent);
-}
-
 static int
 nvkm_oproxy_fini(struct nvkm_object *object, bool suspend)
 {
@@ -142,7 +130,6 @@ nvkm_oproxy_func = {
 	.ntfy = nvkm_oproxy_ntfy,
 	.bind = nvkm_oproxy_bind,
 	.sclass = nvkm_oproxy_sclass,
-	.uevent = nvkm_oproxy_uevent,
 };
 
 void
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/uevent.c b/drivers/gpu/drm/nouveau/nvkm/core/uevent.c
index d922eebb689c..365e41134f3d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/uevent.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/uevent.c
@@ -23,7 +23,6 @@
 #include <core/client.h>
 
 #include <nvif/driverif.h>
-#include <nvif/if000e.h>
 
 struct nvif_event_priv {
 	struct nvkm_object object;
@@ -35,43 +34,6 @@ struct nvif_event_priv {
 	atomic_t allowed;
 };
 
-static int
-nvkm_uevent_mthd_block(struct nvkm_uevent *uevent, union nvif_event_block_args *args, u32 argc)
-{
-	if (argc != sizeof(args->vn))
-		return -ENOSYS;
-
-	nvkm_event_ntfy_block(&uevent->ntfy);
-	atomic_set(&uevent->allowed, 0);
-	return 0;
-}
-
-static int
-nvkm_uevent_mthd_allow(struct nvkm_uevent *uevent, union nvif_event_allow_args *args, u32 argc)
-{
-	if (argc != sizeof(args->vn))
-		return -ENOSYS;
-
-	nvkm_event_ntfy_allow(&uevent->ntfy);
-	atomic_set(&uevent->allowed, 1);
-	return 0;
-}
-
-static int
-nvkm_uevent_mthd(struct nvkm_object *object, u32 mthd, void *argv, u32 argc)
-{
-	struct nvif_event_priv *uevent = container_of(object, typeof(*uevent), object);
-
-	switch (mthd) {
-	case NVIF_EVENT_V0_ALLOW: return nvkm_uevent_mthd_allow(uevent, argv, argc);
-	case NVIF_EVENT_V0_BLOCK: return nvkm_uevent_mthd_block(uevent, argv, argc);
-	default:
-		break;
-	}
-
-	return -EINVAL;
-}
-
 static int
 nvkm_uevent_block(struct nvif_event_priv *uevent)
 {
@@ -138,7 +100,6 @@ nvkm_uevent = {
 	.dtor = nvkm_uevent_dtor,
 	.init = nvkm_uevent_init,
 	.fini = nvkm_uevent_fini,
-	.mthd = nvkm_uevent_mthd,
 };
 
 static int
@@ -165,29 +126,6 @@ nvkm_uevent_add(struct nvif_event_priv *uevent, struct nvkm_event *event, int id
 	return 0;
 }
 
-int
-nvkm_uevent_new(const struct nvkm_oclass *oclass, void *argv, u32 argc,
-		struct nvkm_object **pobject)
-{
-	struct nvkm_object *parent = oclass->parent;
-	struct nvif_event_priv *uevent;
-	union nvif_event_args *args = argv;
-
-	if (argc < sizeof(args->v0) || args->v0.version != 0)
-		return -ENOSYS;
-
-	if (!(uevent = kzalloc(sizeof(*uevent), GFP_KERNEL)))
-		return -ENOMEM;
-	*pobject = &uevent->object;
-
-	nvkm_object_ctor(&nvkm_uevent, oclass, &uevent->object);
-	uevent->parent = parent;
-	uevent->func = NULL;
-	uevent->wait = args->v0.wait;
-	uevent->ntfy.event = NULL;
-	return parent->func->uevent(parent, &args->v0.data, argc - sizeof(args->v0), uevent);
-}
-
 int
 nvkm_uevent_new_(struct nvkm_object *parent, u64 handle, struct nvkm_event *event,
 		 bool wait, int id, u32 bits, nvkm_uevent_func func,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c
index 6682245e4928..281994235c5f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c
@@ -46,6 +46,18 @@ struct nvkm_uobj {
 	int hash;
 };
 
+static int
+nvkm_uchan_object_event_new(struct nvif_engobj_priv *priv, u64 token,
+			    const struct nvif_event_impl **pimpl, struct nvif_event_priv **ppriv)
+{
+	struct nvkm_uobj *uobj = (void *)priv;
+
+	if (!uobj->oproxy.object->func->uevent)
+		return -ENODEV;
+
+	return uobj->oproxy.object->func->uevent(uobj->oproxy.object, token, pimpl, ppriv);
+}
+
 static int
 nvkm_uchan_object_mthd(struct nvif_engobj_priv *priv, u32 mthd, void *argv, u32 argc)
 {
@@ -68,6 +80,7 @@ static const struct nvif_engobj_impl
 nvkm_uchan_object_impl = {
 	.del = nvkm_uchan_object_del,
 	.mthd = nvkm_uchan_object_mthd,
+	.event.new = nvkm_uchan_object_event_new,
 };
 
 static int
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c
index f5affa1c8f34..6786882b5f7f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c
@@ -27,17 +27,11 @@
 #include <nvif/if0004.h>
 
 static int
-nvkm_nvsw_uevent(struct nvkm_object *object, void *argv, u32 argc, struct nvkm_uevent *uevent)
+nvkm_nvsw_uevent(struct nvkm_object *object, u64 token,
+		 const struct nvif_event_impl **pimpl, struct nvif_event_priv **ppriv)
 {
-	union nv04_nvsw_event_args *args = argv;
-
-	if (!uevent)
-		return 0;
-	if (argc != sizeof(args->vn))
-		return -ENOSYS;
-
-	return nvkm_uevent_add(uevent, &nvkm_nvsw(object)->chan->event, 0,
-			       NVKM_SW_CHAN_EVENT_PAGE_FLIP, NULL);
+	return nvkm_uevent_new_(object, token, &nvkm_nvsw(object)->chan->event, true, 0,
+				NVKM_SW_CHAN_EVENT_PAGE_FLIP, NULL, pimpl, ppriv);
 }
 
 static int
-- 
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 ` [PATCH 136/156] drm/nouveau/nvif: rework device/cgrp "new chan" apis Ben Skeggs
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 ` Ben Skeggs [this message]
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-149-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).