drm-uapi: Sync nouveau_drm.h

Taken from drm-misc-next-fixes:

    commit 959314c438caf1b62d787f02d54a193efda38880
    Author: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
    Date:   Thu May 9 23:43:52 2024 +0300

        drm/nouveau: use tile_mode and pte_kind for VM_BIND bo allocations

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24795>
(cherry picked from commit 03c4a46fe5)
This commit is contained in:
Faith Ekstrand 2024-05-08 17:23:08 -05:00 committed by Eric Engestrom
parent 6eaf495a19
commit 20595e465b
2 changed files with 71 additions and 30 deletions

View file

@ -3874,7 +3874,7 @@
"description": "drm-uapi: Sync nouveau_drm.h", "description": "drm-uapi: Sync nouveau_drm.h",
"nominated": false, "nominated": false,
"nomination_type": 3, "nomination_type": 3,
"resolution": 4, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": null, "because_sha": null,
"notes": null "notes": null

View file

@ -54,11 +54,42 @@ extern "C" {
*/ */
#define NOUVEAU_GETPARAM_EXEC_PUSH_MAX 17 #define NOUVEAU_GETPARAM_EXEC_PUSH_MAX 17
/*
* NOUVEAU_GETPARAM_VRAM_BAR_SIZE - query bar size
*
* Query the VRAM BAR size.
*/
#define NOUVEAU_GETPARAM_VRAM_BAR_SIZE 18
/*
* NOUVEAU_GETPARAM_VRAM_USED
*
* Get remaining VRAM size.
*/
#define NOUVEAU_GETPARAM_VRAM_USED 19
/*
* NOUVEAU_GETPARAM_HAS_VMA_TILEMODE
*
* Query whether tile mode and PTE kind are accepted with VM allocs or not.
*/
#define NOUVEAU_GETPARAM_HAS_VMA_TILEMODE 20
struct drm_nouveau_getparam { struct drm_nouveau_getparam {
__u64 param; __u64 param;
__u64 value; __u64 value;
}; };
/*
* Those are used to support selecting the main engine used on Kepler.
* This goes into drm_nouveau_channel_alloc::tt_ctxdma_handle
*/
#define NOUVEAU_FIFO_ENGINE_GR 0x01
#define NOUVEAU_FIFO_ENGINE_VP 0x02
#define NOUVEAU_FIFO_ENGINE_PPP 0x04
#define NOUVEAU_FIFO_ENGINE_BSP 0x08
#define NOUVEAU_FIFO_ENGINE_CE 0x30
struct drm_nouveau_channel_alloc { struct drm_nouveau_channel_alloc {
__u32 fb_ctxdma_handle; __u32 fb_ctxdma_handle;
__u32 tt_ctxdma_handle; __u32 tt_ctxdma_handle;
@ -81,6 +112,18 @@ struct drm_nouveau_channel_free {
__s32 channel; __s32 channel;
}; };
struct drm_nouveau_notifierobj_alloc {
__u32 channel;
__u32 handle;
__u32 size;
__u32 offset;
};
struct drm_nouveau_gpuobj_free {
__s32 channel;
__u32 handle;
};
#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0) #define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1) #define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
#define NOUVEAU_GEM_DOMAIN_GART (1 << 2) #define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
@ -238,34 +281,32 @@ struct drm_nouveau_vm_init {
struct drm_nouveau_vm_bind_op { struct drm_nouveau_vm_bind_op {
/** /**
* @op: the operation type * @op: the operation type
*/
__u32 op;
/**
* @DRM_NOUVEAU_VM_BIND_OP_MAP:
* *
* Map a GEM object to the GPU's VA space. Optionally, the * Supported values:
* &DRM_NOUVEAU_VM_BIND_SPARSE flag can be passed to instruct the kernel to
* create sparse mappings for the given range.
*/
#define DRM_NOUVEAU_VM_BIND_OP_MAP 0x0
/**
* @DRM_NOUVEAU_VM_BIND_OP_UNMAP:
* *
* Unmap an existing mapping in the GPU's VA space. If the region the mapping * %DRM_NOUVEAU_VM_BIND_OP_MAP - Map a GEM object to the GPU's VA
* is located in is a sparse region, new sparse mappings are created where the * space. Optionally, the &DRM_NOUVEAU_VM_BIND_SPARSE flag can be
* unmapped (memory backed) mapping was mapped previously. To remove a sparse * passed to instruct the kernel to create sparse mappings for the
* given range.
*
* %DRM_NOUVEAU_VM_BIND_OP_UNMAP - Unmap an existing mapping in the
* GPU's VA space. If the region the mapping is located in is a
* sparse region, new sparse mappings are created where the unmapped
* (memory backed) mapping was mapped previously. To remove a sparse
* region the &DRM_NOUVEAU_VM_BIND_SPARSE must be set. * region the &DRM_NOUVEAU_VM_BIND_SPARSE must be set.
*/ */
__u32 op;
#define DRM_NOUVEAU_VM_BIND_OP_MAP 0x0
#define DRM_NOUVEAU_VM_BIND_OP_UNMAP 0x1 #define DRM_NOUVEAU_VM_BIND_OP_UNMAP 0x1
/** /**
* @flags: the flags for a &drm_nouveau_vm_bind_op * @flags: the flags for a &drm_nouveau_vm_bind_op
*
* Supported values:
*
* %DRM_NOUVEAU_VM_BIND_SPARSE - Indicates that an allocated VA
* space region should be sparse.
*/ */
__u32 flags; __u32 flags;
/**
* @DRM_NOUVEAU_VM_BIND_SPARSE:
*
* Indicates that an allocated VA space region should be sparse.
*/
#define DRM_NOUVEAU_VM_BIND_SPARSE (1 << 8) #define DRM_NOUVEAU_VM_BIND_SPARSE (1 << 8)
/** /**
* @handle: the handle of the DRM GEM object to map * @handle: the handle of the DRM GEM object to map
@ -301,17 +342,17 @@ struct drm_nouveau_vm_bind {
__u32 op_count; __u32 op_count;
/** /**
* @flags: the flags for a &drm_nouveau_vm_bind ioctl * @flags: the flags for a &drm_nouveau_vm_bind ioctl
*
* Supported values:
*
* %DRM_NOUVEAU_VM_BIND_RUN_ASYNC - Indicates that the given VM_BIND
* operation should be executed asynchronously by the kernel.
*
* If this flag is not supplied the kernel executes the associated
* operations synchronously and doesn't accept any &drm_nouveau_sync
* objects.
*/ */
__u32 flags; __u32 flags;
/**
* @DRM_NOUVEAU_VM_BIND_RUN_ASYNC:
*
* Indicates that the given VM_BIND operation should be executed asynchronously
* by the kernel.
*
* If this flag is not supplied the kernel executes the associated operations
* synchronously and doesn't accept any &drm_nouveau_sync objects.
*/
#define DRM_NOUVEAU_VM_BIND_RUN_ASYNC 0x1 #define DRM_NOUVEAU_VM_BIND_RUN_ASYNC 0x1
/** /**
* @wait_count: the number of wait &drm_nouveau_syncs * @wait_count: the number of wait &drm_nouveau_syncs