diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 22:10:24 +0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 23:13:25 +0400 |
commit | 96af8222cef78ab4d92186d5e10880dc78395415 (patch) | |
tree | b90b8fe780d6e0530dfd98a798a08133ced8823c /drivers/gpu/drm/nouveau/nvif | |
parent | 4acfd707e28c820ba8ed8c12b497413a133d8c8f (diff) | |
download | linux-96af8222cef78ab4d92186d5e10880dc78395415.tar.xz |
drm/nouveau/pm: audit and version NVIF_PERFMON class and methods
The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvif')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvif/class.h | 34 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvif/ioctl.h | 2 |
2 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/class.h b/drivers/gpu/drm/nouveau/nvif/class.h index 5279d0dd4d6f..decca22ea528 100644 --- a/drivers/gpu/drm/nouveau/nvif/class.h +++ b/drivers/gpu/drm/nouveau/nvif/class.h @@ -151,4 +151,38 @@ struct gf110_dma_v0 { __u8 pad03[5]; }; + +/******************************************************************************* + * perfmon + ******************************************************************************/ + +struct nvif_perfctr_v0 { + __u8 version; + __u8 pad01[1]; + __u16 logic_op; + __u8 pad04[4]; + char name[4][64]; +}; + +#define NVIF_PERFCTR_V0_QUERY 0x00 +#define NVIF_PERFCTR_V0_SAMPLE 0x01 +#define NVIF_PERFCTR_V0_READ 0x02 + +struct nvif_perfctr_query_v0 { + __u8 version; + __u8 pad01[3]; + __u32 iter; + char name[64]; +}; + +struct nvif_perfctr_sample { +}; + +struct nvif_perfctr_read_v0 { + __u8 version; + __u8 pad01[7]; + __u32 ctr; + __u32 clk; +}; + #endif diff --git a/drivers/gpu/drm/nouveau/nvif/ioctl.h b/drivers/gpu/drm/nouveau/nvif/ioctl.h index 38f24d1e9f60..67a56711b18c 100644 --- a/drivers/gpu/drm/nouveau/nvif/ioctl.h +++ b/drivers/gpu/drm/nouveau/nvif/ioctl.h @@ -48,6 +48,8 @@ struct nvif_ioctl_new_v0 { __u8 route; __u64 token; __u32 handle; +/* these class numbers are made up by us, and not nvidia-assigned */ +#define NVIF_IOCTL_NEW_V0_PERFCTR 0x0000ffff __u32 oclass; __u8 data[]; /* class data (class.h) */ }; |