History

accel/amdxdna: Add command doorbell and wait support

Expose the command doorbell register to userspace on a per-hardware context basis, enabling applications to notify the firmware of pending commands via doorbell writes. Introduce DRM_IOCTL_AMDXDNA_WAIT_CMD to allow userspace to wait for completion of individual commands.

David Zhang committed 6 months ago

Commit 91f4da81 parent 193612711 files · +198 −7Browse files

Showing the changes to include/uapi (1 of 11 files). Show all

Unified · Split

include/uapi/drm/amdxdna_accel.h+21−1
@@ -45,7 +45,8 @@ enum amdxdna_drm_ioctl_id { · 44 unmodified lines
45 DRM_AMDXDNA_EXEC_CMD,45 DRM_AMDXDNA_EXEC_CMD,
46 DRM_AMDXDNA_GET_INFO,46 DRM_AMDXDNA_GET_INFO,
47 DRM_AMDXDNA_SET_STATE,47 DRM_AMDXDNA_SET_STATE,
48 DRM_AMDXDNA_GET_ARRAY = 10,48 DRM_AMDXDNA_WAIT_CMD,
49 DRM_AMDXDNA_GET_ARRAY,
49};50};
50 51
51/**52/**
@@ -274,6 +275,21 @@ struct amdxdna_drm_exec_cmd { · 222 unmodified lines
274 __u64 seq;275 __u64 seq;
275};276};
276 277
278/**
279 * struct amdxdna_drm_wait_cmd - Wait execution command.
280 *
281 * @hwctx: Context handle.
282 * @timeout: timeout in ms, 0 implies infinite wait.
283 * @seq: sequence number of the command returned by execute command.
284 *
285 * Wait a command specified by seq to be completed.
286 */
287struct amdxdna_drm_wait_cmd {
288 __u32 hwctx;
289 __u32 timeout;
290 __u64 seq;
291};
292
277/**293/**
278 * struct amdxdna_drm_query_aie_status - Query the status of the AIE hardware294 * struct amdxdna_drm_query_aie_status - Query the status of the AIE hardware
279 * @buffer: The user space buffer that will return the AIE status.295 * @buffer: The user space buffer that will return the AIE status.
@@ -739,6 +755,10 @@ struct amdxdna_drm_set_power_mode { · 459 unmodified lines
739 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_GET_ARRAY, \755 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_GET_ARRAY, \
740 struct amdxdna_drm_get_array)756 struct amdxdna_drm_get_array)
741 757
758#define DRM_IOCTL_AMDXDNA_WAIT_CMD \
759 DRM_IOW(DRM_COMMAND_BASE + DRM_AMDXDNA_WAIT_CMD, \
760 struct amdxdna_drm_wait_cmd)
761
742#if defined(__cplusplus)762#if defined(__cplusplus)
743} /* extern c end */763} /* extern c end */
744#endif764#endif