0001
0002 #ifndef __NOUVEAU_ABI16_H__
0003 #define __NOUVEAU_ABI16_H__
0004
0005 #define ABI16_IOCTL_ARGS \
0006 struct drm_device *dev, void *data, struct drm_file *file_priv
0007
0008 int nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS);
0009 int nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS);
0010 int nouveau_abi16_ioctl_channel_free(ABI16_IOCTL_ARGS);
0011 int nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS);
0012 int nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS);
0013 int nouveau_abi16_ioctl_gpuobj_free(ABI16_IOCTL_ARGS);
0014
0015 struct nouveau_abi16_ntfy {
0016 struct nvif_object object;
0017 struct list_head head;
0018 struct nvkm_mm_node *node;
0019 };
0020
0021 struct nouveau_abi16_chan {
0022 struct list_head head;
0023 struct nouveau_channel *chan;
0024 struct nvif_object ce;
0025 struct list_head notifiers;
0026 struct nouveau_bo *ntfy;
0027 struct nouveau_vma *ntfy_vma;
0028 struct nvkm_mm heap;
0029 };
0030
0031 struct nouveau_abi16 {
0032 struct nvif_device device;
0033 struct list_head channels;
0034 u64 handles;
0035 };
0036
0037 struct nouveau_abi16 *nouveau_abi16_get(struct drm_file *);
0038 int nouveau_abi16_put(struct nouveau_abi16 *, int);
0039 void nouveau_abi16_fini(struct nouveau_abi16 *);
0040 s32 nouveau_abi16_swclass(struct nouveau_drm *);
0041 int nouveau_abi16_usif(struct drm_file *, void *data, u32 size);
0042
0043 #define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
0044 #define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
0045
0046 struct drm_nouveau_channel_alloc {
0047 uint32_t fb_ctxdma_handle;
0048 uint32_t tt_ctxdma_handle;
0049
0050 int channel;
0051 uint32_t pushbuf_domains;
0052
0053
0054 uint32_t notifier_handle;
0055
0056
0057 struct {
0058 uint32_t handle;
0059 uint32_t grclass;
0060 } subchan[8];
0061 uint32_t nr_subchan;
0062 };
0063
0064 struct drm_nouveau_channel_free {
0065 int channel;
0066 };
0067
0068 struct drm_nouveau_grobj_alloc {
0069 int channel;
0070 uint32_t handle;
0071 int class;
0072 };
0073
0074 struct drm_nouveau_notifierobj_alloc {
0075 uint32_t channel;
0076 uint32_t handle;
0077 uint32_t size;
0078 uint32_t offset;
0079 };
0080
0081 struct drm_nouveau_gpuobj_free {
0082 int channel;
0083 uint32_t handle;
0084 };
0085
0086 #define NOUVEAU_GETPARAM_PCI_VENDOR 3
0087 #define NOUVEAU_GETPARAM_PCI_DEVICE 4
0088 #define NOUVEAU_GETPARAM_BUS_TYPE 5
0089 #define NOUVEAU_GETPARAM_FB_SIZE 8
0090 #define NOUVEAU_GETPARAM_AGP_SIZE 9
0091 #define NOUVEAU_GETPARAM_CHIPSET_ID 11
0092 #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12
0093 #define NOUVEAU_GETPARAM_GRAPH_UNITS 13
0094 #define NOUVEAU_GETPARAM_PTIMER_TIME 14
0095 #define NOUVEAU_GETPARAM_HAS_BO_USAGE 15
0096 #define NOUVEAU_GETPARAM_HAS_PAGEFLIP 16
0097 struct drm_nouveau_getparam {
0098 uint64_t param;
0099 uint64_t value;
0100 };
0101
0102 struct drm_nouveau_setparam {
0103 uint64_t param;
0104 uint64_t value;
0105 };
0106
0107 #define DRM_IOCTL_NOUVEAU_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GETPARAM, struct drm_nouveau_getparam)
0108 #define DRM_IOCTL_NOUVEAU_SETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SETPARAM, struct drm_nouveau_setparam)
0109 #define DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_ALLOC, struct drm_nouveau_channel_alloc)
0110 #define DRM_IOCTL_NOUVEAU_CHANNEL_FREE DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_FREE, struct drm_nouveau_channel_free)
0111 #define DRM_IOCTL_NOUVEAU_GROBJ_ALLOC DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GROBJ_ALLOC, struct drm_nouveau_grobj_alloc)
0112 #define DRM_IOCTL_NOUVEAU_NOTIFIEROBJ_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_NOTIFIEROBJ_ALLOC, struct drm_nouveau_notifierobj_alloc)
0113 #define DRM_IOCTL_NOUVEAU_GPUOBJ_FREE DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GPUOBJ_FREE, struct drm_nouveau_gpuobj_free)
0114
0115 #endif