xref: /linux/include/uapi/drm/amdxdna_accel.h (revision c0d6f52f9b62479d61f8cd4faf9fb2f8bce6e301)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  * Copyright (C) 2022-2024, Advanced Micro Devices, Inc.
4  */
5 
6 #ifndef _UAPI_AMDXDNA_ACCEL_H_
7 #define _UAPI_AMDXDNA_ACCEL_H_
8 
9 #include <linux/stddef.h>
10 #include "drm.h"
11 
12 #if defined(__cplusplus)
13 extern "C" {
14 #endif
15 
16 #define AMDXDNA_INVALID_CMD_HANDLE	(~0UL)
17 #define AMDXDNA_INVALID_ADDR		(~0UL)
18 #define AMDXDNA_INVALID_CTX_HANDLE	0
19 #define AMDXDNA_INVALID_BO_HANDLE	0
20 #define AMDXDNA_INVALID_FENCE_HANDLE	0
21 
22 /*
23  * Define hardware context priority
24  */
25 #define AMDXDNA_QOS_REALTIME_PRIORITY	0x100
26 #define AMDXDNA_QOS_HIGH_PRIORITY	0x180
27 #define AMDXDNA_QOS_NORMAL_PRIORITY	0x200
28 #define AMDXDNA_QOS_LOW_PRIORITY	0x280
29 
30 enum amdxdna_device_type {
31 	AMDXDNA_DEV_TYPE_UNKNOWN = -1,
32 	AMDXDNA_DEV_TYPE_KMQ,
33 };
34 
35 enum amdxdna_drm_ioctl_id {
36 	DRM_AMDXDNA_CREATE_HWCTX,
37 	DRM_AMDXDNA_DESTROY_HWCTX,
38 	DRM_AMDXDNA_CONFIG_HWCTX,
39 	DRM_AMDXDNA_CREATE_BO,
40 	DRM_AMDXDNA_GET_BO_INFO,
41 	DRM_AMDXDNA_SYNC_BO,
42 	DRM_AMDXDNA_EXEC_CMD,
43 	DRM_AMDXDNA_GET_INFO,
44 	DRM_AMDXDNA_SET_STATE,
45 	DRM_AMDXDNA_GET_ARRAY = 10,
46 };
47 
48 /**
49  * struct qos_info - QoS information for driver.
50  * @gops: Giga operations per second.
51  * @fps: Frames per second.
52  * @dma_bandwidth: DMA bandwidtha.
53  * @latency: Frame response latency.
54  * @frame_exec_time: Frame execution time.
55  * @priority: Request priority.
56  *
57  * User program can provide QoS hints to driver.
58  */
59 struct amdxdna_qos_info {
60 	__u32 gops;
61 	__u32 fps;
62 	__u32 dma_bandwidth;
63 	__u32 latency;
64 	__u32 frame_exec_time;
65 	__u32 priority;
66 };
67 
68 /**
69  * struct amdxdna_drm_create_hwctx - Create hardware context.
70  * @ext: MBZ.
71  * @ext_flags: MBZ.
72  * @qos_p: Address of QoS info.
73  * @umq_bo: BO handle for user mode queue(UMQ).
74  * @log_buf_bo: BO handle for log buffer.
75  * @max_opc: Maximum operations per cycle.
76  * @num_tiles: Number of AIE tiles.
77  * @mem_size: Size of AIE tile memory.
78  * @umq_doorbell: Returned offset of doorbell associated with UMQ.
79  * @handle: Returned hardware context handle.
80  * @syncobj_handle: Returned syncobj handle for command completion.
81  */
82 struct amdxdna_drm_create_hwctx {
83 	__u64 ext;
84 	__u64 ext_flags;
85 	__u64 qos_p;
86 	__u32 umq_bo;
87 	__u32 log_buf_bo;
88 	__u32 max_opc;
89 	__u32 num_tiles;
90 	__u32 mem_size;
91 	__u32 umq_doorbell;
92 	__u32 handle;
93 	__u32 syncobj_handle;
94 };
95 
96 /**
97  * struct amdxdna_drm_destroy_hwctx - Destroy hardware context.
98  * @handle: Hardware context handle.
99  * @pad: MBZ.
100  */
101 struct amdxdna_drm_destroy_hwctx {
102 	__u32 handle;
103 	__u32 pad;
104 };
105 
106 /**
107  * struct amdxdna_cu_config - configuration for one CU
108  * @cu_bo: CU configuration buffer bo handle.
109  * @cu_func: Function of a CU.
110  * @pad: MBZ.
111  */
112 struct amdxdna_cu_config {
113 	__u32 cu_bo;
114 	__u8  cu_func;
115 	__u8  pad[3];
116 };
117 
118 /**
119  * struct amdxdna_hwctx_param_config_cu - configuration for CUs in hardware context
120  * @num_cus: Number of CUs to configure.
121  * @pad: MBZ.
122  * @cu_configs: Array of CU configurations of struct amdxdna_cu_config.
123  */
124 struct amdxdna_hwctx_param_config_cu {
125 	__u16 num_cus;
126 	__u16 pad[3];
127 	struct amdxdna_cu_config cu_configs[] __counted_by(num_cus);
128 };
129 
130 enum amdxdna_drm_config_hwctx_param {
131 	DRM_AMDXDNA_HWCTX_CONFIG_CU,
132 	DRM_AMDXDNA_HWCTX_ASSIGN_DBG_BUF,
133 	DRM_AMDXDNA_HWCTX_REMOVE_DBG_BUF,
134 };
135 
136 /**
137  * struct amdxdna_drm_config_hwctx - Configure hardware context.
138  * @handle: hardware context handle.
139  * @param_type: Value in enum amdxdna_drm_config_hwctx_param. Specifies the
140  *              structure passed in via param_val.
141  * @param_val: A structure specified by the param_type struct member.
142  * @param_val_size: Size of the parameter buffer pointed to by the param_val.
143  *		    If param_val is not a pointer, driver can ignore this.
144  * @pad: MBZ.
145  *
146  * Note: if the param_val is a pointer pointing to a buffer, the maximum size
147  * of the buffer is 4KiB(PAGE_SIZE).
148  */
149 struct amdxdna_drm_config_hwctx {
150 	__u32 handle;
151 	__u32 param_type;
152 	__u64 param_val;
153 	__u32 param_val_size;
154 	__u32 pad;
155 };
156 
157 enum amdxdna_bo_type {
158 	AMDXDNA_BO_INVALID = 0,
159 	AMDXDNA_BO_SHMEM,
160 	AMDXDNA_BO_DEV_HEAP,
161 	AMDXDNA_BO_DEV,
162 	AMDXDNA_BO_CMD,
163 };
164 
165 /**
166  * struct amdxdna_drm_va_entry
167  * @vaddr: Virtual address.
168  * @len: Size of entry.
169  */
170 struct amdxdna_drm_va_entry {
171 	__u64 vaddr;
172 	__u64 len;
173 };
174 
175 /**
176  * struct amdxdna_drm_va_tbl
177  * @dmabuf_fd: The fd of dmabuf.
178  * @num_entries: Number of va entries.
179  * @va_entries: Array of va entries.
180  *
181  * The input can be either a dmabuf fd or a virtual address entry table.
182  * When dmabuf_fd is used, num_entries must be zero.
183  */
184 struct amdxdna_drm_va_tbl {
185 	__s32 dmabuf_fd;
186 	__u32 num_entries;
187 	struct amdxdna_drm_va_entry va_entries[];
188 };
189 
190 /**
191  * struct amdxdna_drm_create_bo - Create a buffer object.
192  * @flags: Buffer flags. MBZ.
193  * @vaddr: User VA of buffer if applied. MBZ.
194  * @size: Size in bytes.
195  * @type: Buffer type.
196  * @handle: Returned DRM buffer object handle.
197  */
198 struct amdxdna_drm_create_bo {
199 	__u64	flags;
200 	__u64	vaddr;
201 	__u64	size;
202 	__u32	type;
203 	__u32	handle;
204 };
205 
206 /**
207  * struct amdxdna_drm_get_bo_info - Get buffer object information.
208  * @ext: MBZ.
209  * @ext_flags: MBZ.
210  * @handle: DRM buffer object handle.
211  * @pad: MBZ.
212  * @map_offset: Returned DRM fake offset for mmap().
213  * @vaddr: Returned user VA of buffer. 0 in case user needs mmap().
214  * @xdna_addr: Returned XDNA device virtual address.
215  */
216 struct amdxdna_drm_get_bo_info {
217 	__u64 ext;
218 	__u64 ext_flags;
219 	__u32 handle;
220 	__u32 pad;
221 	__u64 map_offset;
222 	__u64 vaddr;
223 	__u64 xdna_addr;
224 };
225 
226 /**
227  * struct amdxdna_drm_sync_bo - Sync buffer object.
228  * @handle: Buffer object handle.
229  * @direction: Direction of sync, can be from device or to device.
230  * @offset: Offset in the buffer to sync.
231  * @size: Size in bytes.
232  */
233 struct amdxdna_drm_sync_bo {
234 	__u32 handle;
235 #define SYNC_DIRECT_TO_DEVICE	0U
236 #define SYNC_DIRECT_FROM_DEVICE	1U
237 	__u32 direction;
238 	__u64 offset;
239 	__u64 size;
240 };
241 
242 enum amdxdna_cmd_type {
243 	AMDXDNA_CMD_SUBMIT_EXEC_BUF = 0,
244 	AMDXDNA_CMD_SUBMIT_DEPENDENCY,
245 	AMDXDNA_CMD_SUBMIT_SIGNAL,
246 };
247 
248 /**
249  * struct amdxdna_drm_exec_cmd - Execute command.
250  * @ext: MBZ.
251  * @ext_flags: MBZ.
252  * @hwctx: Hardware context handle.
253  * @type: One of command type in enum amdxdna_cmd_type.
254  * @cmd_handles: Array of command handles or the command handle itself
255  *               in case of just one.
256  * @args: Array of arguments for all command handles.
257  * @cmd_count: Number of command handles in the cmd_handles array.
258  * @arg_count: Number of arguments in the args array.
259  * @seq: Returned sequence number for this command.
260  */
261 struct amdxdna_drm_exec_cmd {
262 	__u64 ext;
263 	__u64 ext_flags;
264 	__u32 hwctx;
265 	__u32 type;
266 	__u64 cmd_handles;
267 	__u64 args;
268 	__u32 cmd_count;
269 	__u32 arg_count;
270 	__u64 seq;
271 };
272 
273 /**
274  * struct amdxdna_drm_query_aie_status - Query the status of the AIE hardware
275  * @buffer: The user space buffer that will return the AIE status.
276  * @buffer_size: The size of the user space buffer.
277  * @cols_filled: A bitmap of AIE columns whose data has been returned in the buffer.
278  */
279 struct amdxdna_drm_query_aie_status {
280 	__u64 buffer; /* out */
281 	__u32 buffer_size; /* in */
282 	__u32 cols_filled; /* out */
283 };
284 
285 /**
286  * struct amdxdna_drm_query_aie_version - Query the version of the AIE hardware
287  * @major: The major version number.
288  * @minor: The minor version number.
289  */
290 struct amdxdna_drm_query_aie_version {
291 	__u32 major; /* out */
292 	__u32 minor; /* out */
293 };
294 
295 /**
296  * struct amdxdna_drm_query_aie_tile_metadata - Query the metadata of AIE tile (core, mem, shim)
297  * @row_count: The number of rows.
298  * @row_start: The starting row number.
299  * @dma_channel_count: The number of dma channels.
300  * @lock_count: The number of locks.
301  * @event_reg_count: The number of events.
302  * @pad: Structure padding.
303  */
304 struct amdxdna_drm_query_aie_tile_metadata {
305 	__u16 row_count;
306 	__u16 row_start;
307 	__u16 dma_channel_count;
308 	__u16 lock_count;
309 	__u16 event_reg_count;
310 	__u16 pad[3];
311 };
312 
313 /**
314  * struct amdxdna_drm_query_aie_metadata - Query the metadata of the AIE hardware
315  * @col_size: The size of a column in bytes.
316  * @cols: The total number of columns.
317  * @rows: The total number of rows.
318  * @version: The version of the AIE hardware.
319  * @core: The metadata for all core tiles.
320  * @mem: The metadata for all mem tiles.
321  * @shim: The metadata for all shim tiles.
322  */
323 struct amdxdna_drm_query_aie_metadata {
324 	__u32 col_size;
325 	__u16 cols;
326 	__u16 rows;
327 	struct amdxdna_drm_query_aie_version version;
328 	struct amdxdna_drm_query_aie_tile_metadata core;
329 	struct amdxdna_drm_query_aie_tile_metadata mem;
330 	struct amdxdna_drm_query_aie_tile_metadata shim;
331 };
332 
333 /**
334  * struct amdxdna_drm_query_clock - Metadata for a clock
335  * @name: The clock name.
336  * @freq_mhz: The clock frequency.
337  * @pad: Structure padding.
338  */
339 struct amdxdna_drm_query_clock {
340 	__u8 name[16];
341 	__u32 freq_mhz;
342 	__u32 pad;
343 };
344 
345 /**
346  * struct amdxdna_drm_query_clock_metadata - Query metadata for clocks
347  * @mp_npu_clock: The metadata for MP-NPU clock.
348  * @h_clock: The metadata for H clock.
349  */
350 struct amdxdna_drm_query_clock_metadata {
351 	struct amdxdna_drm_query_clock mp_npu_clock;
352 	struct amdxdna_drm_query_clock h_clock;
353 };
354 
355 enum amdxdna_sensor_type {
356 	AMDXDNA_SENSOR_TYPE_POWER
357 };
358 
359 /**
360  * struct amdxdna_drm_query_sensor - The data for single sensor.
361  * @label: The name for a sensor.
362  * @input: The current value of the sensor.
363  * @max: The maximum value possible for the sensor.
364  * @average: The average value of the sensor.
365  * @highest: The highest recorded sensor value for this driver load for the sensor.
366  * @status: The sensor status.
367  * @units: The sensor units.
368  * @unitm: Translates value member variables into the correct unit via (pow(10, unitm) * value).
369  * @type: The sensor type from enum amdxdna_sensor_type.
370  * @pad: Structure padding.
371  */
372 struct amdxdna_drm_query_sensor {
373 	__u8  label[64];
374 	__u32 input;
375 	__u32 max;
376 	__u32 average;
377 	__u32 highest;
378 	__u8  status[64];
379 	__u8  units[16];
380 	__s8  unitm;
381 	__u8  type;
382 	__u8  pad[6];
383 };
384 
385 /**
386  * struct amdxdna_drm_query_hwctx - The data for single context.
387  * @context_id: The ID for this context.
388  * @start_col: The starting column for the partition assigned to this context.
389  * @num_col: The number of columns in the partition assigned to this context.
390  * @pad: Structure padding.
391  * @pid: The Process ID of the process that created this context.
392  * @command_submissions: The number of commands submitted to this context.
393  * @command_completions: The number of commands completed by this context.
394  * @migrations: The number of times this context has been moved to a different partition.
395  * @preemptions: The number of times this context has been preempted by another context in the
396  *               same partition.
397  * @errors: The errors for this context.
398  */
399 struct amdxdna_drm_query_hwctx {
400 	__u32 context_id;
401 	__u32 start_col;
402 	__u32 num_col;
403 	__u32 pad;
404 	__s64 pid;
405 	__u64 command_submissions;
406 	__u64 command_completions;
407 	__u64 migrations;
408 	__u64 preemptions;
409 	__u64 errors;
410 };
411 
412 enum amdxdna_power_mode_type {
413 	POWER_MODE_DEFAULT, /* Fallback to calculated DPM */
414 	POWER_MODE_LOW,     /* Set frequency to lowest DPM */
415 	POWER_MODE_MEDIUM,  /* Set frequency to medium DPM */
416 	POWER_MODE_HIGH,    /* Set frequency to highest DPM */
417 	POWER_MODE_TURBO,   /* Maximum power */
418 };
419 
420 /**
421  * struct amdxdna_drm_get_power_mode - Get the configured power mode
422  * @power_mode: The mode type from enum amdxdna_power_mode_type
423  * @pad: Structure padding.
424  */
425 struct amdxdna_drm_get_power_mode {
426 	__u8 power_mode;
427 	__u8 pad[7];
428 };
429 
430 /**
431  * struct amdxdna_drm_query_firmware_version - Query the firmware version
432  * @major: The major version number
433  * @minor: The minor version number
434  * @patch: The patch level version number
435  * @build: The build ID
436  */
437 struct amdxdna_drm_query_firmware_version {
438 	__u32 major; /* out */
439 	__u32 minor; /* out */
440 	__u32 patch; /* out */
441 	__u32 build; /* out */
442 };
443 
444 enum amdxdna_drm_get_param {
445 	DRM_AMDXDNA_QUERY_AIE_STATUS,
446 	DRM_AMDXDNA_QUERY_AIE_METADATA,
447 	DRM_AMDXDNA_QUERY_AIE_VERSION,
448 	DRM_AMDXDNA_QUERY_CLOCK_METADATA,
449 	DRM_AMDXDNA_QUERY_SENSORS,
450 	DRM_AMDXDNA_QUERY_HW_CONTEXTS,
451 	DRM_AMDXDNA_QUERY_FIRMWARE_VERSION = 8,
452 	DRM_AMDXDNA_GET_POWER_MODE,
453 	DRM_AMDXDNA_QUERY_TELEMETRY,
454 	DRM_AMDXDNA_GET_FORCE_PREEMPT_STATE,
455 	DRM_AMDXDNA_QUERY_RESOURCE_INFO,
456 	DRM_AMDXDNA_GET_FRAME_BOUNDARY_PREEMPT_STATE,
457 };
458 
459 /**
460  * struct amdxdna_drm_get_resource_info - Get resource information
461  */
462 struct amdxdna_drm_get_resource_info {
463 	/** @npu_clk_max: max H-Clocks */
464 	__u64 npu_clk_max;
465 	/** @npu_tops_max: max TOPs */
466 	__u64 npu_tops_max;
467 	/** @npu_task_max: max number of tasks */
468 	__u64 npu_task_max;
469 	/** @npu_tops_curr: current TOPs */
470 	__u64 npu_tops_curr;
471 	/** @npu_task_curr: current number of tasks */
472 	__u64 npu_task_curr;
473 };
474 
475 /**
476  * struct amdxdna_drm_attribute_state - State of an attribute
477  */
478 struct amdxdna_drm_attribute_state {
479 	/** @state: enabled or disabled */
480 	__u8 state;
481 	/** @pad: MBZ */
482 	__u8 pad[7];
483 };
484 
485 /**
486  * struct amdxdna_drm_query_telemetry_header - Telemetry data header
487  */
488 struct amdxdna_drm_query_telemetry_header {
489 	/** @major: Firmware telemetry interface major version number */
490 	__u32 major;
491 	/** @minor: Firmware telemetry interface minor version number */
492 	__u32 minor;
493 	/** @type: Telemetry query type */
494 	__u32 type;
495 	/** @map_num_elements: Total number of elements in the map table */
496 	__u32 map_num_elements;
497 	/** @map: Element map */
498 	__u32 map[];
499 };
500 
501 /**
502  * struct amdxdna_drm_get_info - Get some information from the AIE hardware.
503  * @param: Value in enum amdxdna_drm_get_param. Specifies the structure passed in the buffer.
504  * @buffer_size: Size of the input buffer. Size needed/written by the kernel.
505  * @buffer: A structure specified by the param struct member.
506  */
507 struct amdxdna_drm_get_info {
508 	__u32 param; /* in */
509 	__u32 buffer_size; /* in/out */
510 	__u64 buffer; /* in/out */
511 };
512 
513 #define AMDXDNA_HWCTX_STATE_IDLE	0
514 #define AMDXDNA_HWCTX_STATE_ACTIVE	1
515 
516 /**
517  * struct amdxdna_drm_hwctx_entry - The hardware context array entry
518  */
519 struct amdxdna_drm_hwctx_entry {
520 	/** @context_id: Context ID. */
521 	__u32 context_id;
522 	/** @start_col: Start AIE array column assigned to context. */
523 	__u32 start_col;
524 	/** @num_col: Number of AIE array columns assigned to context. */
525 	__u32 num_col;
526 	/** @hwctx_id: The real hardware context id. */
527 	__u32 hwctx_id;
528 	/** @pid: ID of process which created this context. */
529 	__s64 pid;
530 	/** @command_submissions: Number of commands submitted. */
531 	__u64 command_submissions;
532 	/** @command_completions: Number of commands completed. */
533 	__u64 command_completions;
534 	/** @migrations: Number of times been migrated. */
535 	__u64 migrations;
536 	/** @preemptions: Number of times been preempted. */
537 	__u64 preemptions;
538 	/** @errors: Number of errors happened. */
539 	__u64 errors;
540 	/** @priority: Context priority. */
541 	__u64 priority;
542 	/** @heap_usage: Usage of device heap buffer. */
543 	__u64 heap_usage;
544 	/** @suspensions: Number of times been suspended. */
545 	__u64 suspensions;
546 	/**
547 	 * @state: Context state.
548 	 * %AMDXDNA_HWCTX_STATE_IDLE
549 	 * %AMDXDNA_HWCTX_STATE_ACTIVE
550 	 */
551 	__u32 state;
552 	/** @pasid: PASID been bound. */
553 	__u32 pasid;
554 	/** @gops: Giga operations per second. */
555 	__u32 gops;
556 	/** @fps: Frames per second. */
557 	__u32 fps;
558 	/** @dma_bandwidth: DMA bandwidth. */
559 	__u32 dma_bandwidth;
560 	/** @latency: Frame response latency. */
561 	__u32 latency;
562 	/** @frame_exec_time: Frame execution time. */
563 	__u32 frame_exec_time;
564 	/** @txn_op_idx: Index of last control code executed. */
565 	__u32 txn_op_idx;
566 	/** @ctx_pc: Program counter. */
567 	__u32 ctx_pc;
568 	/** @fatal_error_type: Fatal error type if context crashes. */
569 	__u32 fatal_error_type;
570 	/** @fatal_error_exception_type: Firmware exception type. */
571 	__u32 fatal_error_exception_type;
572 	/** @fatal_error_exception_pc: Firmware exception program counter. */
573 	__u32 fatal_error_exception_pc;
574 	/** @fatal_error_app_module: Exception module name. */
575 	__u32 fatal_error_app_module;
576 	/** @pad: Structure pad. */
577 	__u32 pad;
578 };
579 
580 /**
581  * struct amdxdna_async_error - XDNA async error structure
582  */
583 struct amdxdna_async_error {
584 	/** @err_code: Error code. */
585 	__u64 err_code;
586 	/** @ts_us: Timestamp. */
587 	__u64 ts_us;
588 	/** @ex_err_code: Extra error code */
589 	__u64 ex_err_code;
590 };
591 
592 #define DRM_AMDXDNA_HW_CONTEXT_ALL	0
593 #define DRM_AMDXDNA_HW_LAST_ASYNC_ERR	2
594 
595 /**
596  * struct amdxdna_drm_get_array - Get information array.
597  */
598 struct amdxdna_drm_get_array {
599 	/**
600 	 * @param:
601 	 *
602 	 * Supported params:
603 	 *
604 	 * %DRM_AMDXDNA_HW_CONTEXT_ALL:
605 	 * Returns all created hardware contexts.
606 	 */
607 	__u32 param;
608 	/**
609 	 * @element_size:
610 	 *
611 	 * Specifies maximum element size and returns the actual element size.
612 	 */
613 	__u32 element_size;
614 	/**
615 	 * @num_element:
616 	 *
617 	 * Specifies maximum number of elements and returns the actual number
618 	 * of elements.
619 	 */
620 	__u32 num_element; /* in/out */
621 	/** @pad: MBZ */
622 	__u32 pad;
623 	/**
624 	 * @buffer:
625 	 *
626 	 * Specifies the match conditions and returns the matched information
627 	 * array.
628 	 */
629 	__u64 buffer;
630 };
631 
632 enum amdxdna_drm_set_param {
633 	DRM_AMDXDNA_SET_POWER_MODE,
634 	DRM_AMDXDNA_WRITE_AIE_MEM,
635 	DRM_AMDXDNA_WRITE_AIE_REG,
636 	DRM_AMDXDNA_SET_FORCE_PREEMPT,
637 	DRM_AMDXDNA_SET_FRAME_BOUNDARY_PREEMPT,
638 };
639 
640 /**
641  * struct amdxdna_drm_set_state - Set the state of the AIE hardware.
642  * @param: Value in enum amdxdna_drm_set_param.
643  * @buffer_size: Size of the input param.
644  * @buffer: Pointer to the input param.
645  */
646 struct amdxdna_drm_set_state {
647 	__u32 param; /* in */
648 	__u32 buffer_size; /* in */
649 	__u64 buffer; /* in */
650 };
651 
652 /**
653  * struct amdxdna_drm_set_power_mode - Set the power mode of the AIE hardware
654  * @power_mode: The sensor type from enum amdxdna_power_mode_type
655  * @pad: MBZ.
656  */
657 struct amdxdna_drm_set_power_mode {
658 	__u8 power_mode;
659 	__u8 pad[7];
660 };
661 
662 #define DRM_IOCTL_AMDXDNA_CREATE_HWCTX \
663 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_CREATE_HWCTX, \
664 		 struct amdxdna_drm_create_hwctx)
665 
666 #define DRM_IOCTL_AMDXDNA_DESTROY_HWCTX \
667 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_DESTROY_HWCTX, \
668 		 struct amdxdna_drm_destroy_hwctx)
669 
670 #define DRM_IOCTL_AMDXDNA_CONFIG_HWCTX \
671 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_CONFIG_HWCTX, \
672 		 struct amdxdna_drm_config_hwctx)
673 
674 #define DRM_IOCTL_AMDXDNA_CREATE_BO \
675 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_CREATE_BO, \
676 		 struct amdxdna_drm_create_bo)
677 
678 #define DRM_IOCTL_AMDXDNA_GET_BO_INFO \
679 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_GET_BO_INFO, \
680 		 struct amdxdna_drm_get_bo_info)
681 
682 #define DRM_IOCTL_AMDXDNA_SYNC_BO \
683 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_SYNC_BO, \
684 		 struct amdxdna_drm_sync_bo)
685 
686 #define DRM_IOCTL_AMDXDNA_EXEC_CMD \
687 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_EXEC_CMD, \
688 		 struct amdxdna_drm_exec_cmd)
689 
690 #define DRM_IOCTL_AMDXDNA_GET_INFO \
691 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_GET_INFO, \
692 		 struct amdxdna_drm_get_info)
693 
694 #define DRM_IOCTL_AMDXDNA_SET_STATE \
695 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_SET_STATE, \
696 		 struct amdxdna_drm_set_state)
697 
698 #define DRM_IOCTL_AMDXDNA_GET_ARRAY \
699 	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_GET_ARRAY, \
700 		 struct amdxdna_drm_get_array)
701 
702 #if defined(__cplusplus)
703 } /* extern c end */
704 #endif
705 
706 #endif /* _UAPI_AMDXDNA_ACCEL_H_ */
707