Commit 99d0701a authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/nvkm: rip out old notify



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 6c9705f6
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -33,31 +33,4 @@ nvif_event_ctor(struct nvif_object *parent, const char *name, u32 handle, nvif_e
void nvif_event_dtor(struct nvif_event *);
int nvif_event_allow(struct nvif_event *);
int nvif_event_block(struct nvif_event *);

struct nvif_notify_req_v0 {
	__u8  version;
	__u8  reply;
	__u8  pad02[5];
#define NVIF_NOTIFY_V0_ROUTE_NVIF                                          0x00
	__u8  route;
	__u64 token;	/* must be unique */
	__u8  data[];	/* request data (below) */
};

struct nvif_notify_rep_v0 {
	__u8  version;
	__u8  pad01[6];
	__u8  route;
	__u64 token;
	__u8  data[];	/* reply data (below) */
};

struct nvif_notify_uevent_req {
	/* nvif_notify_req ... */
};

struct nvif_notify_uevent_rep {
	/* nvif_notify_rep ... */
};

#endif
+8 −43
Original line number Diff line number Diff line
@@ -15,10 +15,6 @@ struct nvif_ioctl_v0 {
#define NVIF_IOCTL_V0_WR                                                   0x06
#define NVIF_IOCTL_V0_MAP                                                  0x07
#define NVIF_IOCTL_V0_UNMAP                                                0x08
#define NVIF_IOCTL_V0_NTFY_NEW                                             0x09
#define NVIF_IOCTL_V0_NTFY_DEL                                             0x0a
#define NVIF_IOCTL_V0_NTFY_GET                                             0x0b
#define NVIF_IOCTL_V0_NTFY_PUT                                             0x0c
	__u8  type;
	__u8  pad02[4];
#define NVIF_IOCTL_V0_OWNER_NVIF                                           0x00
@@ -63,6 +59,14 @@ struct nvif_ioctl_new_v0 {
struct nvif_ioctl_del {
};

struct nvif_ioctl_mthd_v0 {
	/* nvif_ioctl ... */
	__u8  version;
	__u8  method;
	__u8  pad02[6];
	__u8  data[];		/* method data (class.h) */
};

struct nvif_ioctl_rd_v0 {
	/* nvif_ioctl ... */
	__u8  version;
@@ -95,43 +99,4 @@ struct nvif_ioctl_map_v0 {

struct nvif_ioctl_unmap {
};

struct nvif_ioctl_ntfy_new_v0 {
	/* nvif_ioctl ... */
	__u8  version;
	__u8  event;
	__u8  index;
	__u8  pad03[5];
	__u8  data[];		/* event request data (event.h) */
};

struct nvif_ioctl_ntfy_del_v0 {
	/* nvif_ioctl ... */
	__u8  version;
	__u8  index;
	__u8  pad02[6];
};

struct nvif_ioctl_ntfy_get_v0 {
	/* nvif_ioctl ... */
	__u8  version;
	__u8  index;
	__u8  pad02[6];
};

struct nvif_ioctl_ntfy_put_v0 {
	/* nvif_ioctl ... */
	__u8  version;
	__u8  index;
	__u8  pad02[6];
};

struct nvif_ioctl_mthd_v0 {
	/* nvif_ioctl ... */
	__u8  version;
	__u8  method;
	__u8  pad02[6];
	__u8  data[];		/* method data (class.h) */
};

#endif
+0 −35
Original line number Diff line number Diff line
/* SPDX-License-Identifier: MIT */
#ifndef __NVIF_NOTIFY_H__
#define __NVIF_NOTIFY_H__

struct nvif_notify {
	struct nvif_object *object;
	const char *name;
	int index;

#define NVIF_NOTIFY_USER 0
#define NVIF_NOTIFY_WORK 1
	unsigned long flags;
	atomic_t putcnt;
	void (*dtor)(struct nvif_notify *);
#define NVIF_NOTIFY_DROP 0
#define NVIF_NOTIFY_KEEP 1
	int  (*func)(struct nvif_notify *);

	/* this is const for a *very* good reason - the data might be on the
	 * stack from an irq handler.  if you're not nvif/notify.c then you
	 * should probably think twice before casting it away...
	 */
	const void *data;
	u32 size;
	struct work_struct work;
};

int  nvif_notify_ctor(struct nvif_object *, const char *name,
		      int (*func)(struct nvif_notify *), bool work, u8 type,
		      void *data, u32 size, u32 reply, struct nvif_notify *);
int  nvif_notify_dtor(struct nvif_notify *);
int  nvif_notify_get(struct nvif_notify *);
int  nvif_notify_put(struct nvif_notify *);
int  nvif_notify(const void *, u32, const void *, u32);
#endif
+2 −13
Original line number Diff line number Diff line
@@ -10,30 +10,19 @@ struct nvkm_client {
	u64 device;
	u32 debug;

	struct nvkm_client_notify *notify[32];
	struct rb_root objroot;

	void *data;
	int (*ntfy)(const void *, u32, const void *, u32);
	int (*event)(u64 token, void *argv, u32 argc);

	struct list_head umem;
	spinlock_t lock;
};

int  nvkm_client_new(const char *name, u64 device, const char *cfg,
		     const char *dbg,
		     int (*)(const void *, u32, const void *, u32),
		     int (*)(u64, void *, u32),
		     struct nvkm_client **);
int  nvkm_client_new(const char *name, u64 device, const char *cfg, const char *dbg,
		     int (*)(u64, void *, u32), struct nvkm_client **);
struct nvkm_client *nvkm_client_search(struct nvkm_client *, u64 handle);

int nvkm_client_notify_new(struct nvkm_object *, struct nvkm_event *,
			   void *data, u32 size);
int nvkm_client_notify_del(struct nvkm_client *, int index);
int nvkm_client_notify_get(struct nvkm_client *, int index);
int nvkm_client_notify_put(struct nvkm_client *, int index);

/* logging for client-facing objects */
#define nvif_printk(o,l,p,f,a...) do {                                         \
	const struct nvkm_object *_object = (o);                               \
+0 −9
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
#ifndef __NVKM_EVENT_H__
#define __NVKM_EVENT_H__
#include <core/os.h>
struct nvkm_notify;
struct nvkm_object;
struct nvkm_oclass;
struct nvkm_uevent;
@@ -16,16 +15,12 @@ struct nvkm_event {

	spinlock_t refs_lock;
	spinlock_t list_lock;
	struct list_head list;
	int *refs;

	struct list_head ntfy;
};

struct nvkm_event_func {
	int  (*ctor)(struct nvkm_object *, void *data, u32 size,
		     struct nvkm_notify *);
	void (*send)(void *data, u32 size, struct nvkm_notify *);
	void (*init)(struct nvkm_event *, int type, int index);
	void (*fini)(struct nvkm_event *, int type, int index);
};
@@ -33,10 +28,6 @@ struct nvkm_event_func {
int  nvkm_event_init(const struct nvkm_event_func *func, struct nvkm_subdev *, int types_nr,
		     int index_nr, struct nvkm_event *);
void nvkm_event_fini(struct nvkm_event *);
void nvkm_event_get(struct nvkm_event *, u32 types, int index);
void nvkm_event_put(struct nvkm_event *, u32 types, int index);
void nvkm_event_send(struct nvkm_event *, u32 types, int index,
		     void *data, u32 size);

#define NVKM_EVENT_KEEP 0
#define NVKM_EVENT_DROP 1
Loading