xref: /linux/include/uapi/drm/rocket_accel.h (revision 658ebeac33517bd3169d4b65ed801e9065d0211a)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2024 Tomeu Vizoso
4  */
5 #ifndef __DRM_UAPI_ROCKET_ACCEL_H__
6 #define __DRM_UAPI_ROCKET_ACCEL_H__
7 
8 #include "drm.h"
9 
10 #if defined(__cplusplus)
11 extern "C" {
12 #endif
13 
14 #define DRM_ROCKET_CREATE_BO			0x00
15 
16 #define DRM_IOCTL_ROCKET_CREATE_BO		DRM_IOWR(DRM_COMMAND_BASE + DRM_ROCKET_CREATE_BO, struct drm_rocket_create_bo)
17 
18 /**
19  * struct drm_rocket_create_bo - ioctl argument for creating Rocket BOs.
20  *
21  */
22 struct drm_rocket_create_bo {
23 	/** Input: Size of the requested BO. */
24 	__u32 size;
25 
26 	/** Output: GEM handle for the BO. */
27 	__u32 handle;
28 
29 	/**
30 	 * Output: DMA address for the BO in the NPU address space.  This address
31 	 * is private to the DRM fd and is valid for the lifetime of the GEM
32 	 * handle.
33 	 */
34 	__u64 dma_address;
35 
36 	/** Output: Offset into the drm node to use for subsequent mmap call. */
37 	__u64 offset;
38 };
39 
40 #if defined(__cplusplus)
41 }
42 #endif
43 
44 #endif /* __DRM_UAPI_ROCKET_ACCEL_H__ */
45