Skip to content

Commit 7a5d5f9

Browse files
airlieddakr
authored andcommitted
drm/nouveau: fixup the uapi header file.
nouveau > 10 years ago had a plan for new multiplexer inside a multiplexer API using nvif. It never fully reached fruition, fast forward 10 years, and the new vulkan driver is avoiding libdrm and calling ioctls, and these 3 ioctls, getparam, channel alloc + free don't seem to be things we'd want to use nvif for. Undeprecate and put them into the uapi header so we can just copy it into mesa later. v2: use uapi types. Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Danilo Krummrich <dakr@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230804182406.5222-3-dakr@redhat.com
1 parent 0c0816d commit 7a5d5f9

2 files changed

Lines changed: 45 additions & 44 deletions

File tree

drivers/gpu/drm/nouveau/nouveau_abi16.h

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,6 @@ int nouveau_abi16_usif(struct drm_file *, void *data, u32 size);
4343
#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
4444
#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
4545

46-
struct drm_nouveau_channel_alloc {
47-
uint32_t fb_ctxdma_handle;
48-
uint32_t tt_ctxdma_handle;
49-
50-
int channel;
51-
uint32_t pushbuf_domains;
52-
53-
/* Notifier memory */
54-
uint32_t notifier_handle;
55-
56-
/* DRM-enforced subchannel assignments */
57-
struct {
58-
uint32_t handle;
59-
uint32_t grclass;
60-
} subchan[8];
61-
uint32_t nr_subchan;
62-
};
63-
64-
struct drm_nouveau_channel_free {
65-
int channel;
66-
};
67-
6846
struct drm_nouveau_grobj_alloc {
6947
int channel;
7048
uint32_t handle;
@@ -83,31 +61,12 @@ struct drm_nouveau_gpuobj_free {
8361
uint32_t handle;
8462
};
8563

86-
#define NOUVEAU_GETPARAM_PCI_VENDOR 3
87-
#define NOUVEAU_GETPARAM_PCI_DEVICE 4
88-
#define NOUVEAU_GETPARAM_BUS_TYPE 5
89-
#define NOUVEAU_GETPARAM_FB_SIZE 8
90-
#define NOUVEAU_GETPARAM_AGP_SIZE 9
91-
#define NOUVEAU_GETPARAM_CHIPSET_ID 11
92-
#define NOUVEAU_GETPARAM_VM_VRAM_BASE 12
93-
#define NOUVEAU_GETPARAM_GRAPH_UNITS 13
94-
#define NOUVEAU_GETPARAM_PTIMER_TIME 14
95-
#define NOUVEAU_GETPARAM_HAS_BO_USAGE 15
96-
#define NOUVEAU_GETPARAM_HAS_PAGEFLIP 16
97-
struct drm_nouveau_getparam {
98-
uint64_t param;
99-
uint64_t value;
100-
};
101-
10264
struct drm_nouveau_setparam {
10365
uint64_t param;
10466
uint64_t value;
10567
};
10668

107-
#define DRM_IOCTL_NOUVEAU_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GETPARAM, struct drm_nouveau_getparam)
10869
#define DRM_IOCTL_NOUVEAU_SETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SETPARAM, struct drm_nouveau_setparam)
109-
#define DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_ALLOC, struct drm_nouveau_channel_alloc)
110-
#define DRM_IOCTL_NOUVEAU_CHANNEL_FREE DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_FREE, struct drm_nouveau_channel_free)
11170
#define DRM_IOCTL_NOUVEAU_GROBJ_ALLOC DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GROBJ_ALLOC, struct drm_nouveau_grobj_alloc)
11271
#define DRM_IOCTL_NOUVEAU_NOTIFIEROBJ_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_NOTIFIEROBJ_ALLOC, struct drm_nouveau_notifierobj_alloc)
11372
#define DRM_IOCTL_NOUVEAU_GPUOBJ_FREE DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GPUOBJ_FREE, struct drm_nouveau_gpuobj_free)

include/uapi/drm/nouveau_drm.h

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,44 @@
3333
extern "C" {
3434
#endif
3535

36+
#define NOUVEAU_GETPARAM_PCI_VENDOR 3
37+
#define NOUVEAU_GETPARAM_PCI_DEVICE 4
38+
#define NOUVEAU_GETPARAM_BUS_TYPE 5
39+
#define NOUVEAU_GETPARAM_FB_SIZE 8
40+
#define NOUVEAU_GETPARAM_AGP_SIZE 9
41+
#define NOUVEAU_GETPARAM_CHIPSET_ID 11
42+
#define NOUVEAU_GETPARAM_VM_VRAM_BASE 12
43+
#define NOUVEAU_GETPARAM_GRAPH_UNITS 13
44+
#define NOUVEAU_GETPARAM_PTIMER_TIME 14
45+
#define NOUVEAU_GETPARAM_HAS_BO_USAGE 15
46+
#define NOUVEAU_GETPARAM_HAS_PAGEFLIP 16
47+
struct drm_nouveau_getparam {
48+
__u64 param;
49+
__u64 value;
50+
};
51+
52+
struct drm_nouveau_channel_alloc {
53+
__u32 fb_ctxdma_handle;
54+
__u32 tt_ctxdma_handle;
55+
56+
__s32 channel;
57+
__u32 pushbuf_domains;
58+
59+
/* Notifier memory */
60+
__u32 notifier_handle;
61+
62+
/* DRM-enforced subchannel assignments */
63+
struct {
64+
__u32 handle;
65+
__u32 grclass;
66+
} subchan[8];
67+
__u32 nr_subchan;
68+
};
69+
70+
struct drm_nouveau_channel_free {
71+
__s32 channel;
72+
};
73+
3674
#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
3775
#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
3876
#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
@@ -126,10 +164,10 @@ struct drm_nouveau_gem_cpu_fini {
126164
__u32 handle;
127165
};
128166

129-
#define DRM_NOUVEAU_GETPARAM 0x00 /* deprecated */
167+
#define DRM_NOUVEAU_GETPARAM 0x00
130168
#define DRM_NOUVEAU_SETPARAM 0x01 /* deprecated */
131-
#define DRM_NOUVEAU_CHANNEL_ALLOC 0x02 /* deprecated */
132-
#define DRM_NOUVEAU_CHANNEL_FREE 0x03 /* deprecated */
169+
#define DRM_NOUVEAU_CHANNEL_ALLOC 0x02
170+
#define DRM_NOUVEAU_CHANNEL_FREE 0x03
133171
#define DRM_NOUVEAU_GROBJ_ALLOC 0x04 /* deprecated */
134172
#define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x05 /* deprecated */
135173
#define DRM_NOUVEAU_GPUOBJ_FREE 0x06 /* deprecated */
@@ -188,6 +226,10 @@ struct drm_nouveau_svm_bind {
188226
#define NOUVEAU_SVM_BIND_TARGET__GPU_VRAM (1UL << 31)
189227

190228

229+
#define DRM_IOCTL_NOUVEAU_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GETPARAM, struct drm_nouveau_getparam)
230+
#define DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_ALLOC, struct drm_nouveau_channel_alloc)
231+
#define DRM_IOCTL_NOUVEAU_CHANNEL_FREE DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_FREE, struct drm_nouveau_channel_free)
232+
191233
#define DRM_IOCTL_NOUVEAU_SVM_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SVM_INIT, struct drm_nouveau_svm_init)
192234
#define DRM_IOCTL_NOUVEAU_SVM_BIND DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SVM_BIND, struct drm_nouveau_svm_bind)
193235

0 commit comments

Comments
 (0)