Blame include/drm/nouveau_drm.h

Packit Service 103f6b
/*
Packit Service 103f6b
 * Copyright 2005 Stephane Marchesin.
Packit Service 103f6b
 * All Rights Reserved.
Packit Service 103f6b
 *
Packit Service 103f6b
 * Permission is hereby granted, free of charge, to any person obtaining a
Packit Service 103f6b
 * copy of this software and associated documentation files (the "Software"),
Packit Service 103f6b
 * to deal in the Software without restriction, including without limitation
Packit Service 103f6b
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Packit Service 103f6b
 * and/or sell copies of the Software, and to permit persons to whom the
Packit Service 103f6b
 * Software is furnished to do so, subject to the following conditions:
Packit Service 103f6b
 *
Packit Service 103f6b
 * The above copyright notice and this permission notice (including the next
Packit Service 103f6b
 * paragraph) shall be included in all copies or substantial portions of the
Packit Service 103f6b
 * Software.
Packit Service 103f6b
 *
Packit Service 103f6b
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service 103f6b
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service 103f6b
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
Packit Service 103f6b
 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
Packit Service 103f6b
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Packit Service 103f6b
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Packit Service 103f6b
 * OTHER DEALINGS IN THE SOFTWARE.
Packit Service 103f6b
 */
Packit Service 103f6b
Packit Service 103f6b
#ifndef __NOUVEAU_DRM_H__
Packit Service 103f6b
#define __NOUVEAU_DRM_H__
Packit Service 103f6b
Packit Service 103f6b
#define NOUVEAU_DRM_HEADER_PATCHLEVEL 16
Packit Service 103f6b
Packit Service 103f6b
#include "drm.h"
Packit Service 103f6b
Packit Service 103f6b
#if defined(__cplusplus)
Packit Service 103f6b
extern "C" {
Packit Service 103f6b
#endif
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_channel_alloc {
Packit Service 103f6b
	uint32_t     fb_ctxdma_handle;
Packit Service 103f6b
	uint32_t     tt_ctxdma_handle;
Packit Service 103f6b
Packit Service 103f6b
	int          channel;
Packit Service 103f6b
	uint32_t     pushbuf_domains;
Packit Service 103f6b
Packit Service 103f6b
	/* Notifier memory */
Packit Service 103f6b
	uint32_t     notifier_handle;
Packit Service 103f6b
Packit Service 103f6b
	/* DRM-enforced subchannel assignments */
Packit Service 103f6b
	struct {
Packit Service 103f6b
		uint32_t handle;
Packit Service 103f6b
		uint32_t grclass;
Packit Service 103f6b
	} subchan[8];
Packit Service 103f6b
	uint32_t nr_subchan;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_channel_free {
Packit Service 103f6b
	int channel;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_grobj_alloc {
Packit Service 103f6b
	int      channel;
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	int      class;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_notifierobj_alloc {
Packit Service 103f6b
	uint32_t channel;
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	uint32_t size;
Packit Service 103f6b
	uint32_t offset;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_gpuobj_free {
Packit Service 103f6b
	int      channel;
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
#define NOUVEAU_GETPARAM_PCI_VENDOR      3
Packit Service 103f6b
#define NOUVEAU_GETPARAM_PCI_DEVICE      4
Packit Service 103f6b
#define NOUVEAU_GETPARAM_BUS_TYPE        5
Packit Service 103f6b
#define NOUVEAU_GETPARAM_FB_SIZE         8
Packit Service 103f6b
#define NOUVEAU_GETPARAM_AGP_SIZE        9
Packit Service 103f6b
#define NOUVEAU_GETPARAM_CHIPSET_ID      11
Packit Service 103f6b
#define NOUVEAU_GETPARAM_VM_VRAM_BASE    12
Packit Service 103f6b
#define NOUVEAU_GETPARAM_GRAPH_UNITS     13
Packit Service 103f6b
#define NOUVEAU_GETPARAM_PTIMER_TIME     14
Packit Service 103f6b
#define NOUVEAU_GETPARAM_HAS_BO_USAGE    15
Packit Service 103f6b
#define NOUVEAU_GETPARAM_HAS_PAGEFLIP    16
Packit Service 103f6b
struct drm_nouveau_getparam {
Packit Service 103f6b
	uint64_t param;
Packit Service 103f6b
	uint64_t value;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_setparam {
Packit Service 103f6b
	uint64_t param;
Packit Service 103f6b
	uint64_t value;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
#define NOUVEAU_GEM_DOMAIN_CPU       (1 << 0)
Packit Service 103f6b
#define NOUVEAU_GEM_DOMAIN_VRAM      (1 << 1)
Packit Service 103f6b
#define NOUVEAU_GEM_DOMAIN_GART      (1 << 2)
Packit Service 103f6b
#define NOUVEAU_GEM_DOMAIN_MAPPABLE  (1 << 3)
Packit Service 103f6b
#define NOUVEAU_GEM_DOMAIN_COHERENT  (1 << 4)
Packit Service 103f6b
Packit Service 103f6b
#define NOUVEAU_GEM_TILE_COMP        0x00030000 /* nv50-only */
Packit Service 103f6b
#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
Packit Service 103f6b
#define NOUVEAU_GEM_TILE_16BPP       0x00000001
Packit Service 103f6b
#define NOUVEAU_GEM_TILE_32BPP       0x00000002
Packit Service 103f6b
#define NOUVEAU_GEM_TILE_ZETA        0x00000004
Packit Service 103f6b
#define NOUVEAU_GEM_TILE_NONCONTIG   0x00000008
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_gem_info {
Packit Service 103f6b
	__u32 handle;
Packit Service 103f6b
	__u32 domain;
Packit Service 103f6b
	__u64 size;
Packit Service 103f6b
	__u64 offset;
Packit Service 103f6b
	__u64 map_handle;
Packit Service 103f6b
	__u32 tile_mode;
Packit Service 103f6b
	__u32 tile_flags;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_gem_new {
Packit Service 103f6b
	struct drm_nouveau_gem_info info;
Packit Service 103f6b
	__u32 channel_hint;
Packit Service 103f6b
	__u32 align;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
#define NOUVEAU_GEM_MAX_BUFFERS 1024
Packit Service 103f6b
struct drm_nouveau_gem_pushbuf_bo_presumed {
Packit Service 103f6b
	__u32 valid;
Packit Service 103f6b
	__u32 domain;
Packit Service 103f6b
	__u64 offset;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_gem_pushbuf_bo {
Packit Service 103f6b
	__u64 user_priv;
Packit Service 103f6b
	__u32 handle;
Packit Service 103f6b
	__u32 read_domains;
Packit Service 103f6b
	__u32 write_domains;
Packit Service 103f6b
	__u32 valid_domains;
Packit Service 103f6b
	struct drm_nouveau_gem_pushbuf_bo_presumed presumed;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
#define NOUVEAU_GEM_RELOC_LOW  (1 << 0)
Packit Service 103f6b
#define NOUVEAU_GEM_RELOC_HIGH (1 << 1)
Packit Service 103f6b
#define NOUVEAU_GEM_RELOC_OR   (1 << 2)
Packit Service 103f6b
#define NOUVEAU_GEM_MAX_RELOCS 1024
Packit Service 103f6b
struct drm_nouveau_gem_pushbuf_reloc {
Packit Service 103f6b
	__u32 reloc_bo_index;
Packit Service 103f6b
	__u32 reloc_bo_offset;
Packit Service 103f6b
	__u32 bo_index;
Packit Service 103f6b
	__u32 flags;
Packit Service 103f6b
	__u32 data;
Packit Service 103f6b
	__u32 vor;
Packit Service 103f6b
	__u32 tor;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
#define NOUVEAU_GEM_MAX_PUSH 512
Packit Service 103f6b
struct drm_nouveau_gem_pushbuf_push {
Packit Service 103f6b
	__u32 bo_index;
Packit Service 103f6b
	__u32 pad;
Packit Service 103f6b
	__u64 offset;
Packit Service 103f6b
	__u64 length;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_gem_pushbuf {
Packit Service 103f6b
	__u32 channel;
Packit Service 103f6b
	__u32 nr_buffers;
Packit Service 103f6b
	__u64 buffers;
Packit Service 103f6b
	__u32 nr_relocs;
Packit Service 103f6b
	__u32 nr_push;
Packit Service 103f6b
	__u64 relocs;
Packit Service 103f6b
	__u64 push;
Packit Service 103f6b
	__u32 suffix0;
Packit Service 103f6b
	__u32 suffix1;
Packit Service 103f6b
#define NOUVEAU_GEM_PUSHBUF_SYNC                                    (1ULL << 0)
Packit Service 103f6b
	__u64 vram_available;
Packit Service 103f6b
	__u64 gart_available;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
#define NOUVEAU_GEM_CPU_PREP_NOWAIT                                  0x00000001
Packit Service 103f6b
#define NOUVEAU_GEM_CPU_PREP_WRITE                                   0x00000004
Packit Service 103f6b
struct drm_nouveau_gem_cpu_prep {
Packit Service 103f6b
	__u32 handle;
Packit Service 103f6b
	__u32 flags;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_gem_cpu_fini {
Packit Service 103f6b
	__u32 handle;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
#define DRM_NOUVEAU_GETPARAM           0x00 /* deprecated */
Packit Service 103f6b
#define DRM_NOUVEAU_SETPARAM           0x01 /* deprecated */
Packit Service 103f6b
#define DRM_NOUVEAU_CHANNEL_ALLOC      0x02 /* deprecated */
Packit Service 103f6b
#define DRM_NOUVEAU_CHANNEL_FREE       0x03 /* deprecated */
Packit Service 103f6b
#define DRM_NOUVEAU_GROBJ_ALLOC        0x04 /* deprecated */
Packit Service 103f6b
#define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC  0x05 /* deprecated */
Packit Service 103f6b
#define DRM_NOUVEAU_GPUOBJ_FREE        0x06 /* deprecated */
Packit Service 103f6b
#define DRM_NOUVEAU_NVIF               0x07
Packit Service 103f6b
#define DRM_NOUVEAU_SVM_INIT           0x08
Packit Service 103f6b
#define DRM_NOUVEAU_SVM_BIND           0x09
Packit Service 103f6b
#define DRM_NOUVEAU_GEM_NEW            0x40
Packit Service 103f6b
#define DRM_NOUVEAU_GEM_PUSHBUF        0x41
Packit Service 103f6b
#define DRM_NOUVEAU_GEM_CPU_PREP       0x42
Packit Service 103f6b
#define DRM_NOUVEAU_GEM_CPU_FINI       0x43
Packit Service 103f6b
#define DRM_NOUVEAU_GEM_INFO           0x44
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_svm_init {
Packit Service 103f6b
	__u64 unmanaged_addr;
Packit Service 103f6b
	__u64 unmanaged_size;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_nouveau_svm_bind {
Packit Service 103f6b
	__u64 header;
Packit Service 103f6b
	__u64 va_start;
Packit Service 103f6b
	__u64 va_end;
Packit Service 103f6b
	__u64 npages;
Packit Service 103f6b
	__u64 stride;
Packit Service 103f6b
	__u64 result;
Packit Service 103f6b
	__u64 reserved0;
Packit Service 103f6b
	__u64 reserved1;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_COMMAND_SHIFT          0
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_COMMAND_BITS           8
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_COMMAND_MASK           ((1 << 8) - 1)
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_PRIORITY_SHIFT         8
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_PRIORITY_BITS          8
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_PRIORITY_MASK          ((1 << 8) - 1)
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_TARGET_SHIFT           16
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_TARGET_BITS            32
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_TARGET_MASK            0xffffffff
Packit Service 103f6b
Packit Service 103f6b
/*
Packit Service 103f6b
 * Below is use to validate ioctl argument, userspace can also use it to make
Packit Service 103f6b
 * sure that no bit are set beyond known fields for a given kernel version.
Packit Service 103f6b
 */
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_VALID_BITS     48
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_VALID_MASK     ((1ULL << NOUVEAU_SVM_BIND_VALID_BITS) - 1)
Packit Service 103f6b
Packit Service 103f6b
Packit Service 103f6b
/*
Packit Service 103f6b
 * NOUVEAU_BIND_COMMAND__MIGRATE: synchronous migrate to target memory.
Packit Service 103f6b
 * result: number of page successfuly migrate to the target memory.
Packit Service 103f6b
 */
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_COMMAND__MIGRATE               0
Packit Service 103f6b
Packit Service 103f6b
/*
Packit Service 103f6b
 * NOUVEAU_SVM_BIND_HEADER_TARGET__GPU_VRAM: target the GPU VRAM memory.
Packit Service 103f6b
 */
Packit Service 103f6b
#define NOUVEAU_SVM_BIND_TARGET__GPU_VRAM               (1UL << 31)
Packit Service 103f6b
Packit Service 103f6b
Packit Service 103f6b
#if defined(__cplusplus)
Packit Service 103f6b
}
Packit Service 103f6b
#endif
Packit Service 103f6b
Packit Service 103f6b
#endif /* __NOUVEAU_DRM_H__ */