Commit 03295eab authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/core/client: modify prefix on nvif structures, for consistency



Preparation for supporting subclients.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 843faa03
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -2,13 +2,17 @@
#define __NVIF_CLASS_H__

/* these class numbers are made up by us, and not nvidia-assigned */
#define NVIF_CLASS_CONTROL                                    /* if0001.h */ -1
#define NVIF_CLASS_PERFMON                                    /* if0002.h */ -2
#define NVIF_CLASS_PERFDOM                                    /* if0003.h */ -3
#define NVIF_CLASS_SW_NV04                                    /* if0004.h */ -4
#define NVIF_CLASS_SW_NV10                                    /* if0005.h */ -5
#define NVIF_CLASS_SW_NV50                                    /* if0005.h */ -6
#define NVIF_CLASS_SW_GF100                                   /* if0005.h */ -7
#define NVIF_CLASS_CLIENT                            /* if0000.h */ -0x00000000

#define NVIF_CLASS_CONTROL                           /* if0001.h */ -0x00000001

#define NVIF_CLASS_PERFMON                           /* if0002.h */ -0x00000002
#define NVIF_CLASS_PERFDOM                           /* if0003.h */ -0x00000003

#define NVIF_CLASS_SW_NV04                           /* if0004.h */ -0x00000004
#define NVIF_CLASS_SW_NV10                           /* if0005.h */ -0x00000005
#define NVIF_CLASS_SW_NV50                           /* if0005.h */ -0x00000006
#define NVIF_CLASS_SW_GF100                          /* if0005.h */ -0x00000007

/* the below match nvidia-assigned (either in hw, or sw) class numbers */
#define NV_NULL_CLASS                                                0x00000030
+2 −2
Original line number Diff line number Diff line
#ifndef __NVIF_IF0000_H__
#define __NVIF_IF0000_H__

#define NV_CLIENT_DEVLIST                                                  0x00
#define NVIF_CLIENT_V0_DEVLIST                                             0x00

struct nv_client_devlist_v0 {
struct nvif_client_devlist_v0 {
	__u8  version;
	__u8  count;
	__u8  pad02[6];
+1 −0
Original line number Diff line number Diff line
#ifndef __NVKM_CLIENT_H__
#define __NVKM_CLIENT_H__
#define nvkm_client(p) container_of((p), struct nvkm_client, object)
#include <core/object.h>

struct nvkm_client {
+13 −7
Original line number Diff line number Diff line
@@ -31,6 +31,11 @@
#include <nvif/if0000.h>
#include <nvif/unpack.h>

static const struct nvkm_sclass
nvkm_uclient_sclass = {
	.oclass = NVIF_CLASS_CLIENT,
};

struct nvkm_client_notify {
	struct nvkm_client *client;
	struct nvkm_notify n;
@@ -139,16 +144,16 @@ nvkm_client_notify_new(struct nvkm_object *object,
}

static int
nvkm_client_mthd_devlist(struct nvkm_object *object, void *data, u32 size)
nvkm_client_mthd_devlist(struct nvkm_client *client, void *data, u32 size)
{
	union {
		struct nv_client_devlist_v0 v0;
		struct nvif_client_devlist_v0 v0;
	} *args = data;
	int ret = -ENOSYS;

	nvif_ioctl(object, "client devlist size %d\n", size);
	nvif_ioctl(&client->object, "client devlist size %d\n", size);
	if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, true))) {
		nvif_ioctl(object, "client devlist vers %d count %d\n",
		nvif_ioctl(&client->object, "client devlist vers %d count %d\n",
			   args->v0.version, args->v0.count);
		if (size == sizeof(args->v0.device[0]) * args->v0.count) {
			ret = nvkm_device_list(args->v0.device, args->v0.count);
@@ -167,9 +172,10 @@ nvkm_client_mthd_devlist(struct nvkm_object *object, void *data, u32 size)
static int
nvkm_client_mthd(struct nvkm_object *object, u32 mthd, void *data, u32 size)
{
	struct nvkm_client *client = nvkm_client(object);
	switch (mthd) {
	case NV_CLIENT_DEVLIST:
		return nvkm_client_mthd_devlist(object, data, size);
	case NVIF_CLIENT_V0_DEVLIST:
		return nvkm_client_mthd_devlist(client, data, size);
	default:
		break;
	}
@@ -243,7 +249,7 @@ int
nvkm_client_new(const char *name, u64 device, const char *cfg,
		const char *dbg, struct nvkm_client **pclient)
{
	struct nvkm_oclass oclass = {};
	struct nvkm_oclass oclass = { .base = nvkm_uclient_sclass };
	struct nvkm_client *client;

	if (!(client = *pclient = kzalloc(sizeof(*client), GFP_KERNEL)))