Home | History | Annotate | Line # | Download | only in nouveau
      1  1.2  riastrad /*	$NetBSD: nouveau_abi16.h,v 1.3 2021/12/18 23:45:32 riastradh Exp $	*/
      2  1.2  riastrad 
      3  1.3  riastrad /* SPDX-License-Identifier: MIT */
      4  1.1  riastrad #ifndef __NOUVEAU_ABI16_H__
      5  1.1  riastrad #define __NOUVEAU_ABI16_H__
      6  1.1  riastrad 
      7  1.1  riastrad #define ABI16_IOCTL_ARGS                                                       \
      8  1.1  riastrad 	struct drm_device *dev, void *data, struct drm_file *file_priv
      9  1.1  riastrad 
     10  1.1  riastrad int nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS);
     11  1.1  riastrad int nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS);
     12  1.1  riastrad int nouveau_abi16_ioctl_channel_free(ABI16_IOCTL_ARGS);
     13  1.1  riastrad int nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS);
     14  1.1  riastrad int nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS);
     15  1.1  riastrad int nouveau_abi16_ioctl_gpuobj_free(ABI16_IOCTL_ARGS);
     16  1.1  riastrad 
     17  1.1  riastrad struct nouveau_abi16_ntfy {
     18  1.2  riastrad 	struct nvif_object object;
     19  1.1  riastrad 	struct list_head head;
     20  1.2  riastrad 	struct nvkm_mm_node *node;
     21  1.1  riastrad };
     22  1.1  riastrad 
     23  1.1  riastrad struct nouveau_abi16_chan {
     24  1.1  riastrad 	struct list_head head;
     25  1.1  riastrad 	struct nouveau_channel *chan;
     26  1.1  riastrad 	struct list_head notifiers;
     27  1.1  riastrad 	struct nouveau_bo *ntfy;
     28  1.3  riastrad 	struct nouveau_vma *ntfy_vma;
     29  1.2  riastrad 	struct nvkm_mm  heap;
     30  1.1  riastrad };
     31  1.1  riastrad 
     32  1.1  riastrad struct nouveau_abi16 {
     33  1.2  riastrad 	struct nvif_device device;
     34  1.1  riastrad 	struct list_head channels;
     35  1.1  riastrad 	u64 handles;
     36  1.1  riastrad };
     37  1.1  riastrad 
     38  1.2  riastrad struct nouveau_abi16 *nouveau_abi16_get(struct drm_file *);
     39  1.1  riastrad int  nouveau_abi16_put(struct nouveau_abi16 *, int);
     40  1.1  riastrad void nouveau_abi16_fini(struct nouveau_abi16 *);
     41  1.2  riastrad s32  nouveau_abi16_swclass(struct nouveau_drm *);
     42  1.2  riastrad int  nouveau_abi16_usif(struct drm_file *, void *data, u32 size);
     43  1.1  riastrad 
     44  1.1  riastrad #define NOUVEAU_GEM_DOMAIN_VRAM      (1 << 1)
     45  1.1  riastrad #define NOUVEAU_GEM_DOMAIN_GART      (1 << 2)
     46  1.1  riastrad 
     47  1.1  riastrad struct drm_nouveau_channel_alloc {
     48  1.1  riastrad 	uint32_t     fb_ctxdma_handle;
     49  1.1  riastrad 	uint32_t     tt_ctxdma_handle;
     50  1.1  riastrad 
     51  1.1  riastrad 	int          channel;
     52  1.1  riastrad 	uint32_t     pushbuf_domains;
     53  1.1  riastrad 
     54  1.1  riastrad 	/* Notifier memory */
     55  1.1  riastrad 	uint32_t     notifier_handle;
     56  1.1  riastrad 
     57  1.1  riastrad 	/* DRM-enforced subchannel assignments */
     58  1.1  riastrad 	struct {
     59  1.1  riastrad 		uint32_t handle;
     60  1.1  riastrad 		uint32_t grclass;
     61  1.1  riastrad 	} subchan[8];
     62  1.1  riastrad 	uint32_t nr_subchan;
     63  1.1  riastrad };
     64  1.1  riastrad 
     65  1.1  riastrad struct drm_nouveau_channel_free {
     66  1.1  riastrad 	int channel;
     67  1.1  riastrad };
     68  1.1  riastrad 
     69  1.1  riastrad struct drm_nouveau_grobj_alloc {
     70  1.1  riastrad 	int      channel;
     71  1.1  riastrad 	uint32_t handle;
     72  1.1  riastrad 	int      class;
     73  1.1  riastrad };
     74  1.1  riastrad 
     75  1.1  riastrad struct drm_nouveau_notifierobj_alloc {
     76  1.1  riastrad 	uint32_t channel;
     77  1.1  riastrad 	uint32_t handle;
     78  1.1  riastrad 	uint32_t size;
     79  1.1  riastrad 	uint32_t offset;
     80  1.1  riastrad };
     81  1.1  riastrad 
     82  1.1  riastrad struct drm_nouveau_gpuobj_free {
     83  1.1  riastrad 	int      channel;
     84  1.1  riastrad 	uint32_t handle;
     85  1.1  riastrad };
     86  1.1  riastrad 
     87  1.1  riastrad #define NOUVEAU_GETPARAM_PCI_VENDOR      3
     88  1.1  riastrad #define NOUVEAU_GETPARAM_PCI_DEVICE      4
     89  1.1  riastrad #define NOUVEAU_GETPARAM_BUS_TYPE        5
     90  1.1  riastrad #define NOUVEAU_GETPARAM_FB_SIZE         8
     91  1.1  riastrad #define NOUVEAU_GETPARAM_AGP_SIZE        9
     92  1.1  riastrad #define NOUVEAU_GETPARAM_CHIPSET_ID      11
     93  1.1  riastrad #define NOUVEAU_GETPARAM_VM_VRAM_BASE    12
     94  1.1  riastrad #define NOUVEAU_GETPARAM_GRAPH_UNITS     13
     95  1.1  riastrad #define NOUVEAU_GETPARAM_PTIMER_TIME     14
     96  1.1  riastrad #define NOUVEAU_GETPARAM_HAS_BO_USAGE    15
     97  1.1  riastrad #define NOUVEAU_GETPARAM_HAS_PAGEFLIP    16
     98  1.1  riastrad struct drm_nouveau_getparam {
     99  1.1  riastrad 	uint64_t param;
    100  1.1  riastrad 	uint64_t value;
    101  1.1  riastrad };
    102  1.1  riastrad 
    103  1.1  riastrad struct drm_nouveau_setparam {
    104  1.1  riastrad 	uint64_t param;
    105  1.1  riastrad 	uint64_t value;
    106  1.1  riastrad };
    107  1.1  riastrad 
    108  1.1  riastrad #define DRM_IOCTL_NOUVEAU_GETPARAM           DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GETPARAM, struct drm_nouveau_getparam)
    109  1.1  riastrad #define DRM_IOCTL_NOUVEAU_SETPARAM           DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SETPARAM, struct drm_nouveau_setparam)
    110  1.1  riastrad #define DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC      DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_ALLOC, struct drm_nouveau_channel_alloc)
    111  1.1  riastrad #define DRM_IOCTL_NOUVEAU_CHANNEL_FREE       DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_FREE, struct drm_nouveau_channel_free)
    112  1.1  riastrad #define DRM_IOCTL_NOUVEAU_GROBJ_ALLOC        DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GROBJ_ALLOC, struct drm_nouveau_grobj_alloc)
    113  1.1  riastrad #define DRM_IOCTL_NOUVEAU_NOTIFIEROBJ_ALLOC  DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_NOTIFIEROBJ_ALLOC, struct drm_nouveau_notifierobj_alloc)
    114  1.1  riastrad #define DRM_IOCTL_NOUVEAU_GPUOBJ_FREE        DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GPUOBJ_FREE, struct drm_nouveau_gpuobj_free)
    115  1.1  riastrad 
    116  1.1  riastrad #endif
    117