122851890Sopenharmony_ci/*
222851890Sopenharmony_ci * This header was generated from the Linux kernel headers by update_headers.py,
322851890Sopenharmony_ci * to provide necessary information from kernel to userspace, such as constants,
422851890Sopenharmony_ci * structures, and macros, and thus, contains no copyrightable information.
522851890Sopenharmony_ci */
622851890Sopenharmony_ci#ifndef __NOUVEAU_DRM_H__
722851890Sopenharmony_ci#define __NOUVEAU_DRM_H__
822851890Sopenharmony_ci#define DRM_NOUVEAU_EVENT_NVIF                                       0x80000000
922851890Sopenharmony_ci#include "drm.h"
1022851890Sopenharmony_ci#if defined(__cplusplus)
1122851890Sopenharmony_ciextern "C" {
1222851890Sopenharmony_ci#endif
1322851890Sopenharmony_ci#define NOUVEAU_GEM_DOMAIN_CPU       (1 << 0)
1422851890Sopenharmony_ci#define NOUVEAU_GEM_DOMAIN_VRAM      (1 << 1)
1522851890Sopenharmony_ci#define NOUVEAU_GEM_DOMAIN_GART      (1 << 2)
1622851890Sopenharmony_ci#define NOUVEAU_GEM_DOMAIN_MAPPABLE  (1 << 3)
1722851890Sopenharmony_ci#define NOUVEAU_GEM_DOMAIN_COHERENT  (1 << 4)
1822851890Sopenharmony_ci#define NOUVEAU_GEM_TILE_COMP        0x00030000
1922851890Sopenharmony_ci#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
2022851890Sopenharmony_ci#define NOUVEAU_GEM_TILE_16BPP       0x00000001
2122851890Sopenharmony_ci#define NOUVEAU_GEM_TILE_32BPP       0x00000002
2222851890Sopenharmony_ci#define NOUVEAU_GEM_TILE_ZETA        0x00000004
2322851890Sopenharmony_ci#define NOUVEAU_GEM_TILE_NONCONTIG   0x00000008
2422851890Sopenharmony_cistruct drm_nouveau_gem_info {
2522851890Sopenharmony_ci	__u32 handle;
2622851890Sopenharmony_ci	__u32 domain;
2722851890Sopenharmony_ci	__u64 size;
2822851890Sopenharmony_ci	__u64 offset;
2922851890Sopenharmony_ci	__u64 map_handle;
3022851890Sopenharmony_ci	__u32 tile_mode;
3122851890Sopenharmony_ci	__u32 tile_flags;
3222851890Sopenharmony_ci};
3322851890Sopenharmony_cistruct drm_nouveau_gem_new {
3422851890Sopenharmony_ci	struct drm_nouveau_gem_info info;
3522851890Sopenharmony_ci	__u32 channel_hint;
3622851890Sopenharmony_ci	__u32 align;
3722851890Sopenharmony_ci};
3822851890Sopenharmony_ci#define NOUVEAU_GEM_MAX_BUFFERS 1024
3922851890Sopenharmony_cistruct drm_nouveau_gem_pushbuf_bo_presumed {
4022851890Sopenharmony_ci	__u32 valid;
4122851890Sopenharmony_ci	__u32 domain;
4222851890Sopenharmony_ci	__u64 offset;
4322851890Sopenharmony_ci};
4422851890Sopenharmony_cistruct drm_nouveau_gem_pushbuf_bo {
4522851890Sopenharmony_ci	__u64 user_priv;
4622851890Sopenharmony_ci	__u32 handle;
4722851890Sopenharmony_ci	__u32 read_domains;
4822851890Sopenharmony_ci	__u32 write_domains;
4922851890Sopenharmony_ci	__u32 valid_domains;
5022851890Sopenharmony_ci	struct drm_nouveau_gem_pushbuf_bo_presumed presumed;
5122851890Sopenharmony_ci};
5222851890Sopenharmony_ci#define NOUVEAU_GEM_RELOC_LOW  (1 << 0)
5322851890Sopenharmony_ci#define NOUVEAU_GEM_RELOC_HIGH (1 << 1)
5422851890Sopenharmony_ci#define NOUVEAU_GEM_RELOC_OR   (1 << 2)
5522851890Sopenharmony_ci#define NOUVEAU_GEM_MAX_RELOCS 1024
5622851890Sopenharmony_cistruct drm_nouveau_gem_pushbuf_reloc {
5722851890Sopenharmony_ci	__u32 reloc_bo_index;
5822851890Sopenharmony_ci	__u32 reloc_bo_offset;
5922851890Sopenharmony_ci	__u32 bo_index;
6022851890Sopenharmony_ci	__u32 flags;
6122851890Sopenharmony_ci	__u32 data;
6222851890Sopenharmony_ci	__u32 vor;
6322851890Sopenharmony_ci	__u32 tor;
6422851890Sopenharmony_ci};
6522851890Sopenharmony_ci#define NOUVEAU_GEM_MAX_PUSH 512
6622851890Sopenharmony_cistruct drm_nouveau_gem_pushbuf_push {
6722851890Sopenharmony_ci	__u32 bo_index;
6822851890Sopenharmony_ci	__u32 pad;
6922851890Sopenharmony_ci	__u64 offset;
7022851890Sopenharmony_ci	__u64 length;
7122851890Sopenharmony_ci};
7222851890Sopenharmony_cistruct drm_nouveau_gem_pushbuf {
7322851890Sopenharmony_ci	__u32 channel;
7422851890Sopenharmony_ci	__u32 nr_buffers;
7522851890Sopenharmony_ci	__u64 buffers;
7622851890Sopenharmony_ci	__u32 nr_relocs;
7722851890Sopenharmony_ci	__u32 nr_push;
7822851890Sopenharmony_ci	__u64 relocs;
7922851890Sopenharmony_ci	__u64 push;
8022851890Sopenharmony_ci	__u32 suffix0;
8122851890Sopenharmony_ci	__u32 suffix1;
8222851890Sopenharmony_ci	__u64 vram_available;
8322851890Sopenharmony_ci	__u64 gart_available;
8422851890Sopenharmony_ci};
8522851890Sopenharmony_ci#define NOUVEAU_GEM_CPU_PREP_NOWAIT                                  0x00000001
8622851890Sopenharmony_ci#define NOUVEAU_GEM_CPU_PREP_WRITE                                   0x00000004
8722851890Sopenharmony_cistruct drm_nouveau_gem_cpu_prep {
8822851890Sopenharmony_ci	__u32 handle;
8922851890Sopenharmony_ci	__u32 flags;
9022851890Sopenharmony_ci};
9122851890Sopenharmony_cistruct drm_nouveau_gem_cpu_fini {
9222851890Sopenharmony_ci	__u32 handle;
9322851890Sopenharmony_ci};
9422851890Sopenharmony_ci#define DRM_NOUVEAU_GETPARAM           0x00
9522851890Sopenharmony_ci#define DRM_NOUVEAU_SETPARAM           0x01
9622851890Sopenharmony_ci#define DRM_NOUVEAU_CHANNEL_ALLOC      0x02
9722851890Sopenharmony_ci#define DRM_NOUVEAU_CHANNEL_FREE       0x03
9822851890Sopenharmony_ci#define DRM_NOUVEAU_GROBJ_ALLOC        0x04
9922851890Sopenharmony_ci#define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC  0x05
10022851890Sopenharmony_ci#define DRM_NOUVEAU_GPUOBJ_FREE        0x06
10122851890Sopenharmony_ci#define DRM_NOUVEAU_NVIF               0x07
10222851890Sopenharmony_ci#define DRM_NOUVEAU_GEM_NEW            0x40
10322851890Sopenharmony_ci#define DRM_NOUVEAU_GEM_PUSHBUF        0x41
10422851890Sopenharmony_ci#define DRM_NOUVEAU_GEM_CPU_PREP       0x42
10522851890Sopenharmony_ci#define DRM_NOUVEAU_GEM_CPU_FINI       0x43
10622851890Sopenharmony_ci#define DRM_NOUVEAU_GEM_INFO           0x44
10722851890Sopenharmony_ci#define DRM_IOCTL_NOUVEAU_GEM_NEW            DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_NEW, struct drm_nouveau_gem_new)
10822851890Sopenharmony_ci#define DRM_IOCTL_NOUVEAU_GEM_PUSHBUF        DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_PUSHBUF, struct drm_nouveau_gem_pushbuf)
10922851890Sopenharmony_ci#define DRM_IOCTL_NOUVEAU_GEM_CPU_PREP       DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_PREP, struct drm_nouveau_gem_cpu_prep)
11022851890Sopenharmony_ci#define DRM_IOCTL_NOUVEAU_GEM_CPU_FINI       DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_FINI, struct drm_nouveau_gem_cpu_fini)
11122851890Sopenharmony_ci#define DRM_IOCTL_NOUVEAU_GEM_INFO           DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_INFO, struct drm_nouveau_gem_info)
11222851890Sopenharmony_ci#if defined(__cplusplus)
11322851890Sopenharmony_ci}
11422851890Sopenharmony_ci#endif
11522851890Sopenharmony_ci#endif
116