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

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

drm/nouveau/core/object: allow arguments to be passed to map function



MMU will be needing this to specify kind info on BAR mappings.

We have no userspace currently using these interfaces, so break the ABI
instead of supporting both.  NVIF version bump so any future use can be
guarded.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 1f474be9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ nv04_display_create(struct drm_device *dev)
	if (!disp)
		return -ENOMEM;

	nvif_object_map(&drm->client.device.object);
	nvif_object_map(&drm->client.device.object, NULL, 0);

	nouveau_display(dev)->priv = disp;
	nouveau_display(dev)->dtor = nv04_display_destroy;
+7 −3
Original line number Diff line number Diff line
#ifndef __NVIF_IOCTL_H__
#define __NVIF_IOCTL_H__

#define NVIF_VERSION_LATEST                               0x0000000000000000ULL
#define NVIF_VERSION_LATEST                               0x0000000000000100ULL

struct nvif_ioctl_v0 {
	__u8  version;
@@ -83,9 +83,13 @@ struct nvif_ioctl_wr_v0 {
struct nvif_ioctl_map_v0 {
	/* nvif_ioctl ... */
	__u8  version;
	__u8  pad01[3];
	__u32 length;
#define NVIF_IOCTL_MAP_V0_IO                                               0x00
#define NVIF_IOCTL_MAP_V0_VA                                               0x01
	__u8  type;
	__u8  pad02[6];
	__u64 handle;
	__u64 length;
	__u8  data[];
};

struct nvif_ioctl_unmap {
+5 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ struct nvif_object {
	void *priv; /*XXX: hack */
	struct {
		void __iomem *ptr;
		u32 size;
		u64 size;
	} map;
};

@@ -29,7 +29,10 @@ void nvif_object_sclass_put(struct nvif_sclass **);
u32  nvif_object_rd(struct nvif_object *, int, u64);
void nvif_object_wr(struct nvif_object *, int, u64, u32);
int  nvif_object_mthd(struct nvif_object *, u32, void *, u32);
int  nvif_object_map(struct nvif_object *);
int  nvif_object_map_handle(struct nvif_object *, void *, u32,
			    u64 *handle, u64 *length);
void nvif_object_unmap_handle(struct nvif_object *);
int  nvif_object_map(struct nvif_object *, void *, u32);
void nvif_object_unmap(struct nvif_object *);

#define nvif_handle(a) (unsigned long)(void *)(a)
+9 −2
Original line number Diff line number Diff line
@@ -19,13 +19,19 @@ struct nvkm_object {
	struct rb_node node;
};

enum nvkm_object_map {
	NVKM_OBJECT_MAP_IO,
	NVKM_OBJECT_MAP_VA
};

struct nvkm_object_func {
	void *(*dtor)(struct nvkm_object *);
	int (*init)(struct nvkm_object *);
	int (*fini)(struct nvkm_object *, bool suspend);
	int (*mthd)(struct nvkm_object *, u32 mthd, void *data, u32 size);
	int (*ntfy)(struct nvkm_object *, u32 mthd, struct nvkm_event **);
	int (*map)(struct nvkm_object *, u64 *addr, u32 *size);
	int (*map)(struct nvkm_object *, void *argv, u32 argc,
		   enum nvkm_object_map *, u64 *addr, u64 *size);
	int (*rd08)(struct nvkm_object *, u64 addr, u8 *data);
	int (*rd16)(struct nvkm_object *, u64 addr, u16 *data);
	int (*rd32)(struct nvkm_object *, u64 addr, u32 *data);
@@ -50,7 +56,8 @@ int nvkm_object_init(struct nvkm_object *);
int nvkm_object_fini(struct nvkm_object *, bool suspend);
int nvkm_object_mthd(struct nvkm_object *, u32 mthd, void *data, u32 size);
int nvkm_object_ntfy(struct nvkm_object *, u32 mthd, struct nvkm_event **);
int nvkm_object_map(struct nvkm_object *, u64 *addr, u32 *size);
int nvkm_object_map(struct nvkm_object *, void *argv, u32 argc,
		    enum nvkm_object_map *, u64 *addr, u64 *size);
int nvkm_object_rd08(struct nvkm_object *, u64 addr, u8  *data);
int nvkm_object_rd16(struct nvkm_object *, u64 addr, u16 *data);
int nvkm_object_rd32(struct nvkm_object *, u64 addr, u32 *data);
+1 −1
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
	struct nv_dma_v0 args = {};
	int ret, i;

	nvif_object_map(&chan->user);
	nvif_object_map(&chan->user, NULL, 0);

	if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO) {
		ret = nvif_notify_init(&chan->user, nouveau_channel_killed,
Loading