Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf81df9b authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/nvif: replace path-based object identification



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a01ca78c
Loading
Loading
Loading
Loading
+11 −12
Original line number Original line Diff line number Diff line
@@ -354,8 +354,8 @@ struct nvif_control_pstate_user_v0 {
struct nv03_channel_dma_v0 {
struct nv03_channel_dma_v0 {
	__u8  version;
	__u8  version;
	__u8  chid;
	__u8  chid;
	__u8  pad02[2];
	__u8  pad02[6];
	__u32 pushbuf;
	__u64 pushbuf;
	__u64 offset;
	__u64 offset;
};
};


@@ -368,10 +368,10 @@ struct nv03_channel_dma_v0 {
struct nv50_channel_gpfifo_v0 {
struct nv50_channel_gpfifo_v0 {
	__u8  version;
	__u8  version;
	__u8  chid;
	__u8  chid;
	__u8  pad01[6];
	__u8  pad02[2];
	__u32 pushbuf;
	__u32 ilength;
	__u32 ilength;
	__u64 ioffset;
	__u64 ioffset;
	__u64 pushbuf;
};
};


struct kepler_channel_gpfifo_a_v0 {
struct kepler_channel_gpfifo_a_v0 {
@@ -385,10 +385,9 @@ struct kepler_channel_gpfifo_a_v0 {
#define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_ENC                              0x40
#define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_ENC                              0x40
	__u8  engine;
	__u8  engine;
	__u16 chid;
	__u16 chid;
	__u8  pad04[4];
	__u32 pushbuf;
	__u32 ilength;
	__u32 ilength;
	__u64 ioffset;
	__u64 ioffset;
	__u64 pushbuf;
};
};


/*******************************************************************************
/*******************************************************************************
@@ -509,8 +508,8 @@ struct nv50_disp_pior_pwr_v0 {
/* core */
/* core */
struct nv50_disp_core_channel_dma_v0 {
struct nv50_disp_core_channel_dma_v0 {
	__u8  version;
	__u8  version;
	__u8  pad01[3];
	__u8  pad01[7];
	__u32 pushbuf;
	__u64 pushbuf;
};
};


#define NV50_DISP_CORE_CHANNEL_DMA_V0_NTFY_UEVENT                          0x00
#define NV50_DISP_CORE_CHANNEL_DMA_V0_NTFY_UEVENT                          0x00
@@ -527,9 +526,9 @@ struct nv50_disp_cursor_v0 {
/* base */
/* base */
struct nv50_disp_base_channel_dma_v0 {
struct nv50_disp_base_channel_dma_v0 {
	__u8  version;
	__u8  version;
	__u8  pad01[2];
	__u8  head;
	__u8  head;
	__u32 pushbuf;
	__u8  pad02[6];
	__u64 pushbuf;
};
};


#define NV50_DISP_BASE_CHANNEL_DMA_V0_NTFY_UEVENT                          0x00
#define NV50_DISP_BASE_CHANNEL_DMA_V0_NTFY_UEVENT                          0x00
@@ -537,9 +536,9 @@ struct nv50_disp_base_channel_dma_v0 {
/* overlay */
/* overlay */
struct nv50_disp_overlay_channel_dma_v0 {
struct nv50_disp_overlay_channel_dma_v0 {
	__u8  version;
	__u8  version;
	__u8  pad01[2];
	__u8  head;
	__u8  head;
	__u32 pushbuf;
	__u8  pad02[6];
	__u64 pushbuf;
};
};


#define NV50_DISP_OVERLAY_CHANNEL_DMA_V0_NTFY_UEVENT                       0x00
#define NV50_DISP_OVERLAY_CHANNEL_DMA_V0_NTFY_UEVENT                       0x00
+6 −6
Original line number Original line Diff line number Diff line
@@ -3,9 +3,6 @@


struct nvif_ioctl_v0 {
struct nvif_ioctl_v0 {
	__u8  version;
	__u8  version;
#define NVIF_IOCTL_V0_OWNER_NVIF                                           0x00
#define NVIF_IOCTL_V0_OWNER_ANY                                            0xff
	__u8  owner;
#define NVIF_IOCTL_V0_NOP                                                  0x00
#define NVIF_IOCTL_V0_NOP                                                  0x00
#define NVIF_IOCTL_V0_SCLASS                                               0x01
#define NVIF_IOCTL_V0_SCLASS                                               0x01
#define NVIF_IOCTL_V0_NEW                                                  0x02
#define NVIF_IOCTL_V0_NEW                                                  0x02
@@ -20,13 +17,15 @@ struct nvif_ioctl_v0 {
#define NVIF_IOCTL_V0_NTFY_GET                                             0x0b
#define NVIF_IOCTL_V0_NTFY_GET                                             0x0b
#define NVIF_IOCTL_V0_NTFY_PUT                                             0x0c
#define NVIF_IOCTL_V0_NTFY_PUT                                             0x0c
	__u8  type;
	__u8  type;
	__u8  path_nr;
	__u8  pad02[4];
#define NVIF_IOCTL_V0_OWNER_NVIF                                           0x00
#define NVIF_IOCTL_V0_OWNER_ANY                                            0xff
	__u8  owner;
#define NVIF_IOCTL_V0_ROUTE_NVIF                                           0x00
#define NVIF_IOCTL_V0_ROUTE_NVIF                                           0x00
#define NVIF_IOCTL_V0_ROUTE_HIDDEN                                         0xff
#define NVIF_IOCTL_V0_ROUTE_HIDDEN                                         0xff
	__u8  pad04[3];
	__u8  route;
	__u8  route;
	__u64 token;
	__u64 token;
	__u32 path[8];		/* in reverse */
	__u64 object;
	__u8  data[];		/* ioctl data (below) */
	__u8  data[];		/* ioctl data (below) */
};
};


@@ -47,6 +46,7 @@ struct nvif_ioctl_new_v0 {
	__u8  pad01[6];
	__u8  pad01[6];
	__u8  route;
	__u8  route;
	__u64 token;
	__u64 token;
	__u64 object;
	__u32 handle;
	__u32 handle;
/* these class numbers are made up by us, and not nvidia-assigned */
/* these class numbers are made up by us, and not nvidia-assigned */
#define NVIF_IOCTL_NEW_V0_PERFMON                                    0x0000ffff
#define NVIF_IOCTL_NEW_V0_PERFMON                                    0x0000ffff
+1 −1
Original line number Original line Diff line number Diff line
@@ -5,7 +5,6 @@


struct nvif_object {
struct nvif_object {
	struct nvif_client *client;
	struct nvif_client *client;
	struct nvif_object *parent;
	u32 handle;
	u32 handle;
	u32 oclass;
	u32 oclass;
	void *priv; /*XXX: hack */
	void *priv; /*XXX: hack */
@@ -26,6 +25,7 @@ int nvif_object_mthd(struct nvif_object *, u32, void *, u32);
int  nvif_object_map(struct nvif_object *);
int  nvif_object_map(struct nvif_object *);
void nvif_object_unmap(struct nvif_object *);
void nvif_object_unmap(struct nvif_object *);


#define nvif_handle(a) (unsigned long)(void *)(a)
#define nvif_object(a) (a)->object
#define nvif_object(a) (a)->object


#define nvif_rd(a,f,b,c) ({                                                    \
#define nvif_rd(a,f,b,c) ({                                                    \
+6 −0
Original line number Original line Diff line number Diff line
@@ -14,8 +14,14 @@ struct nvkm_client {


	int (*ntfy)(const void *, u32, const void *, u32);
	int (*ntfy)(const void *, u32, const void *, u32);
	struct nvkm_client_notify *notify[16];
	struct nvkm_client_notify *notify[16];

	struct rb_root objroot;
};
};


bool nvkm_client_insert(struct nvkm_client *, struct nvkm_handle *);
void nvkm_client_remove(struct nvkm_client *, struct nvkm_handle *);
struct nvkm_handle *nvkm_client_search(struct nvkm_client *, u64 handle);

static inline struct nvkm_client *
static inline struct nvkm_client *
nv_client(void *obj)
nv_client(void *obj)
{
{
+3 −2
Original line number Original line Diff line number Diff line
@@ -17,6 +17,9 @@ struct nvkm_handle {


	struct nvkm_handle *parent;
	struct nvkm_handle *parent;
	struct nvkm_object *object;
	struct nvkm_object *object;

	struct rb_node rb;
	u64 handle;
};
};


int  nvkm_handle_create(struct nvkm_object *, u32 parent, u32 handle,
int  nvkm_handle_create(struct nvkm_object *, u32 parent, u32 handle,
@@ -25,8 +28,6 @@ void nvkm_handle_destroy(struct nvkm_handle *);
int  nvkm_handle_init(struct nvkm_handle *);
int  nvkm_handle_init(struct nvkm_handle *);
int  nvkm_handle_fini(struct nvkm_handle *, bool suspend);
int  nvkm_handle_fini(struct nvkm_handle *, bool suspend);


struct nvkm_object *nvkm_handle_ref(struct nvkm_object *, u32 name);

struct nvkm_handle *nvkm_handle_get_class(struct nvkm_object *, u16);
struct nvkm_handle *nvkm_handle_get_class(struct nvkm_object *, u16);
struct nvkm_handle *nvkm_handle_get_vinst(struct nvkm_object *, u64);
struct nvkm_handle *nvkm_handle_get_vinst(struct nvkm_object *, u64);
struct nvkm_handle *nvkm_handle_get_cinst(struct nvkm_object *, u32);
struct nvkm_handle *nvkm_handle_get_cinst(struct nvkm_object *, u32);
Loading