Commit 08f7633c authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/nvif: move internal class identifiers to class.h

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 21f560e9
#ifndef __NVIF_CLASS_H__ #ifndef __NVIF_CLASS_H__
#define __NVIF_CLASS_H__ #define __NVIF_CLASS_H__
/******************************************************************************* /* these class numbers are made up by us, and not nvidia-assigned */
* class identifiers #define NVIF_CLASS_CONTROL -1
******************************************************************************/ #define NVIF_CLASS_PERFMON -2
#define NVIF_CLASS_PERFDOM -3
#define NVIF_CLASS_SW_NV04 -4
#define NVIF_CLASS_SW_NV10 -5
#define NVIF_CLASS_SW_NV50 -6
#define NVIF_CLASS_SW_GF100 -7
/* the below match nvidia-assigned (either in hw, or sw) class numbers */ /* the below match nvidia-assigned (either in hw, or sw) class numbers */
#define NV_DEVICE 0x00000080 #define NV_DEVICE 0x00000080
......
...@@ -55,14 +55,6 @@ struct nvif_ioctl_new_v0 { ...@@ -55,14 +55,6 @@ struct nvif_ioctl_new_v0 {
__u64 token; __u64 token;
__u64 object; __u64 object;
__u32 handle; __u32 handle;
/* these class numbers are made up by us, and not nvidia-assigned */
#define NVIF_IOCTL_NEW_V0_CONTROL -1
#define NVIF_IOCTL_NEW_V0_PERFMON -2
#define NVIF_IOCTL_NEW_V0_PERFDOM -3
#define NVIF_IOCTL_NEW_V0_SW_NV04 -4
#define NVIF_IOCTL_NEW_V0_SW_NV10 -5
#define NVIF_IOCTL_NEW_V0_SW_NV50 -6
#define NVIF_IOCTL_NEW_V0_SW_GF100 -7
__s32 oclass; __s32 oclass;
__u8 data[]; /* class data (class.h) */ __u8 data[]; /* class data (class.h) */
}; };
......
...@@ -87,18 +87,18 @@ nouveau_abi16_swclass(struct nouveau_drm *drm) ...@@ -87,18 +87,18 @@ nouveau_abi16_swclass(struct nouveau_drm *drm)
{ {
switch (drm->device.info.family) { switch (drm->device.info.family) {
case NV_DEVICE_INFO_V0_TNT: case NV_DEVICE_INFO_V0_TNT:
return NVIF_IOCTL_NEW_V0_SW_NV04; return NVIF_CLASS_SW_NV04;
case NV_DEVICE_INFO_V0_CELSIUS: case NV_DEVICE_INFO_V0_CELSIUS:
case NV_DEVICE_INFO_V0_KELVIN: case NV_DEVICE_INFO_V0_KELVIN:
case NV_DEVICE_INFO_V0_RANKINE: case NV_DEVICE_INFO_V0_RANKINE:
case NV_DEVICE_INFO_V0_CURIE: case NV_DEVICE_INFO_V0_CURIE:
return NVIF_IOCTL_NEW_V0_SW_NV10; return NVIF_CLASS_SW_NV10;
case NV_DEVICE_INFO_V0_TESLA: case NV_DEVICE_INFO_V0_TESLA:
return NVIF_IOCTL_NEW_V0_SW_NV50; return NVIF_CLASS_SW_NV50;
case NV_DEVICE_INFO_V0_FERMI: case NV_DEVICE_INFO_V0_FERMI:
case NV_DEVICE_INFO_V0_KEPLER: case NV_DEVICE_INFO_V0_KEPLER:
case NV_DEVICE_INFO_V0_MAXWELL: case NV_DEVICE_INFO_V0_MAXWELL:
return NVIF_IOCTL_NEW_V0_SW_GF100; return NVIF_CLASS_SW_GF100;
} }
return 0x0000; return 0x0000;
...@@ -433,10 +433,10 @@ nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS) ...@@ -433,10 +433,10 @@ nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS)
/* nvsw: compatibility with older 0x*6e class identifier */ /* nvsw: compatibility with older 0x*6e class identifier */
for (i = 0; !oclass && i < ret; i++) { for (i = 0; !oclass && i < ret; i++) {
switch (sclass[i].oclass) { switch (sclass[i].oclass) {
case NVIF_IOCTL_NEW_V0_SW_NV04: case NVIF_CLASS_SW_NV04:
case NVIF_IOCTL_NEW_V0_SW_NV10: case NVIF_CLASS_SW_NV10:
case NVIF_IOCTL_NEW_V0_SW_NV50: case NVIF_CLASS_SW_NV50:
case NVIF_IOCTL_NEW_V0_SW_GF100: case NVIF_CLASS_SW_GF100:
oclass = sclass[i].oclass; oclass = sclass[i].oclass;
break; break;
default: default:
......
...@@ -378,7 +378,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart) ...@@ -378,7 +378,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
/* allocate software object class (used for fences on <= nv05) */ /* allocate software object class (used for fences on <= nv05) */
if (device->info.family < NV_DEVICE_INFO_V0_CELSIUS) { if (device->info.family < NV_DEVICE_INFO_V0_CELSIUS) {
ret = nvif_object_init(&chan->user, 0x006e, ret = nvif_object_init(&chan->user, 0x006e,
NVIF_IOCTL_NEW_V0_SW_NV04, NVIF_CLASS_SW_NV04,
NULL, 0, &chan->nvsw); NULL, 0, &chan->nvsw);
if (ret) if (ret)
return ret; return ret;
......
...@@ -188,7 +188,7 @@ nouveau_sysfs_init(struct drm_device *dev) ...@@ -188,7 +188,7 @@ nouveau_sysfs_init(struct drm_device *dev)
if (!sysfs) if (!sysfs)
return -ENOMEM; return -ENOMEM;
ret = nvif_object_init(&device->object, 0, NVIF_IOCTL_NEW_V0_CONTROL, ret = nvif_object_init(&device->object, 0, NVIF_CLASS_CONTROL,
NULL, 0, &sysfs->ctrl); NULL, 0, &sysfs->ctrl);
if (ret == 0) if (ret == 0)
device_create_file(nvxx_device(device)->dev, &dev_attr_pstate); device_create_file(nvxx_device(device)->dev, &dev_attr_pstate);
......
...@@ -204,7 +204,7 @@ nvkm_control_new(struct nvkm_device *device, const struct nvkm_oclass *oclass, ...@@ -204,7 +204,7 @@ nvkm_control_new(struct nvkm_device *device, const struct nvkm_oclass *oclass,
const struct nvkm_device_oclass const struct nvkm_device_oclass
nvkm_control_oclass = { nvkm_control_oclass = {
.base.oclass = NVIF_IOCTL_NEW_V0_CONTROL, .base.oclass = NVIF_CLASS_CONTROL,
.base.minver = -1, .base.minver = -1,
.base.maxver = -1, .base.maxver = -1,
.ctor = nvkm_control_new, .ctor = nvkm_control_new,
......
...@@ -612,7 +612,7 @@ nvkm_perfmon_child_get(struct nvkm_object *object, int index, ...@@ -612,7 +612,7 @@ nvkm_perfmon_child_get(struct nvkm_object *object, int index,
struct nvkm_oclass *oclass) struct nvkm_oclass *oclass)
{ {
if (index == 0) { if (index == 0) {
oclass->base.oclass = NVIF_IOCTL_NEW_V0_PERFDOM; oclass->base.oclass = NVIF_CLASS_PERFDOM;
oclass->base.minver = 0; oclass->base.minver = 0;
oclass->base.maxver = 0; oclass->base.maxver = 0;
oclass->ctor = nvkm_perfmon_child_new; oclass->ctor = nvkm_perfmon_child_new;
...@@ -679,7 +679,7 @@ nvkm_pm_oclass_new(struct nvkm_device *device, const struct nvkm_oclass *oclass, ...@@ -679,7 +679,7 @@ nvkm_pm_oclass_new(struct nvkm_device *device, const struct nvkm_oclass *oclass,
static const struct nvkm_device_oclass static const struct nvkm_device_oclass
nvkm_pm_oclass = { nvkm_pm_oclass = {
.base.oclass = NVIF_IOCTL_NEW_V0_PERFMON, .base.oclass = NVIF_CLASS_PERFMON,
.base.minver = -1, .base.minver = -1,
.base.maxver = -1, .base.maxver = -1,
.ctor = nvkm_pm_oclass_new, .ctor = nvkm_pm_oclass_new,
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include <engine/disp.h> #include <engine/disp.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <nvif/class.h>
#include <nvif/event.h> #include <nvif/event.h>
#include <nvif/ioctl.h>
/******************************************************************************* /*******************************************************************************
* software context * software context
...@@ -143,7 +143,7 @@ static const struct nvkm_sw_func ...@@ -143,7 +143,7 @@ static const struct nvkm_sw_func
gf100_sw = { gf100_sw = {
.chan_new = gf100_sw_chan_new, .chan_new = gf100_sw_chan_new,
.sclass = { .sclass = {
{ nvkm_nvsw_new, { -1, -1, NVIF_IOCTL_NEW_V0_SW_GF100 } }, { nvkm_nvsw_new, { -1, -1, NVIF_CLASS_SW_GF100 } },
{} {}
} }
}; };
......
...@@ -126,7 +126,7 @@ static const struct nvkm_sw_func ...@@ -126,7 +126,7 @@ static const struct nvkm_sw_func
nv04_sw = { nv04_sw = {
.chan_new = nv04_sw_chan_new, .chan_new = nv04_sw_chan_new,
.sclass = { .sclass = {
{ nv04_nvsw_new, { -1, -1, NVIF_IOCTL_NEW_V0_SW_NV04 } }, { nv04_nvsw_new, { -1, -1, NVIF_CLASS_SW_NV04 } },
{} {}
} }
}; };
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "chan.h" #include "chan.h"
#include "nvsw.h" #include "nvsw.h"
#include <nvif/ioctl.h> #include <nvif/class.h>
/******************************************************************************* /*******************************************************************************
* software context * software context
...@@ -56,7 +56,7 @@ static const struct nvkm_sw_func ...@@ -56,7 +56,7 @@ static const struct nvkm_sw_func
nv10_sw = { nv10_sw = {
.chan_new = nv10_sw_chan_new, .chan_new = nv10_sw_chan_new,
.sclass = { .sclass = {
{ nvkm_nvsw_new, { -1, -1, NVIF_IOCTL_NEW_V0_SW_NV10 } }, { nvkm_nvsw_new, { -1, -1, NVIF_CLASS_SW_NV10 } },
{} {}
} }
}; };
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include <engine/fifo/chan.h> #include <engine/fifo/chan.h>
#include <subdev/bar.h> #include <subdev/bar.h>
#include <nvif/class.h>
#include <nvif/event.h> #include <nvif/event.h>
#include <nvif/ioctl.h>
/******************************************************************************* /*******************************************************************************
* software context * software context
...@@ -136,7 +136,7 @@ static const struct nvkm_sw_func ...@@ -136,7 +136,7 @@ static const struct nvkm_sw_func
nv50_sw = { nv50_sw = {
.chan_new = nv50_sw_chan_new, .chan_new = nv50_sw_chan_new,
.sclass = { .sclass = {
{ nvkm_nvsw_new, { -1, -1, NVIF_IOCTL_NEW_V0_SW_NV50 } }, { nvkm_nvsw_new, { -1, -1, NVIF_CLASS_SW_NV50 } },
{} {}
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment