summaryrefslogtreecommitdiff
path: root/include/uapi/drm/panfrost_drm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/drm/panfrost_drm.h')
-rw-r--r--include/uapi/drm/panfrost_drm.h150
1 files changed, 123 insertions, 27 deletions
diff --git a/include/uapi/drm/panfrost_drm.h b/include/uapi/drm/panfrost_drm.h
index ed67510395bd..1956431bb391 100644
--- a/include/uapi/drm/panfrost_drm.h
+++ b/include/uapi/drm/panfrost_drm.h
@@ -22,6 +22,8 @@ extern "C" {
#define DRM_PANFROST_PERFCNT_DUMP 0x07
#define DRM_PANFROST_MADVISE 0x08
#define DRM_PANFROST_SET_LABEL_BO 0x09
+#define DRM_PANFROST_JM_CTX_CREATE 0x0a
+#define DRM_PANFROST_JM_CTX_DESTROY 0x0b
#define DRM_IOCTL_PANFROST_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_SUBMIT, struct drm_panfrost_submit)
#define DRM_IOCTL_PANFROST_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_WAIT_BO, struct drm_panfrost_wait_bo)
@@ -31,6 +33,8 @@ extern "C" {
#define DRM_IOCTL_PANFROST_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_BO_OFFSET, struct drm_panfrost_get_bo_offset)
#define DRM_IOCTL_PANFROST_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_MADVISE, struct drm_panfrost_madvise)
#define DRM_IOCTL_PANFROST_SET_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_SET_LABEL_BO, struct drm_panfrost_set_label_bo)
+#define DRM_IOCTL_PANFROST_JM_CTX_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_JM_CTX_CREATE, struct drm_panfrost_jm_ctx_create)
+#define DRM_IOCTL_PANFROST_JM_CTX_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_JM_CTX_DESTROY, struct drm_panfrost_jm_ctx_destroy)
/*
* Unstable ioctl(s): only exposed when the unsafe unstable_ioctls module
@@ -50,27 +54,47 @@ extern "C" {
* This asks the kernel to have the GPU execute a render command list.
*/
struct drm_panfrost_submit {
-
- /** Address to GPU mapping of job descriptor */
+ /**
+ * @jc: Address to GPU mapping of job descriptor
+ */
__u64 jc;
-
- /** An optional array of sync objects to wait on before starting this job. */
+ /**
+ * @in_syncs: An optional array of sync objects to wait on
+ * before starting this job.
+ */
__u64 in_syncs;
-
- /** Number of sync objects to wait on before starting this job. */
+ /**
+ * @in_sync_count: Number of sync objects to wait on before
+ * starting this job.
+ */
__u32 in_sync_count;
-
- /** An optional sync object to place the completion fence in. */
+ /**
+ * @out_sync: An optional sync object to place the completion fence in.
+ */
__u32 out_sync;
-
- /** Pointer to a u32 array of the BOs that are referenced by the job. */
+ /**
+ * @bo_handles: Pointer to a u32 array of the BOs that are
+ * referenced by the job.
+ */
__u64 bo_handles;
-
- /** Number of BO handles passed in (size is that times 4). */
+ /**
+ * @bo_handle_count: Number of BO handles passed in (size is
+ * that times 4).
+ */
__u32 bo_handle_count;
-
- /** A combination of PANFROST_JD_REQ_* */
+ /**
+ * @requirements: A combination of PANFROST_JD_REQ_*
+ */
__u32 requirements;
+ /**
+ * @jm_ctx_handle: JM context handle. Zero if you want to use the
+ * default context.
+ */
+ __u32 jm_ctx_handle;
+ /**
+ * @pad: Padding field. Must be zero.
+ */
+ __u32 pad;
};
/**
@@ -82,9 +106,18 @@ struct drm_panfrost_submit {
* completed.
*/
struct drm_panfrost_wait_bo {
+ /**
+ * @handle: Handle for the object to wait for.
+ */
__u32 handle;
+ /**
+ * @pad: Padding, must be zero-filled.
+ */
__u32 pad;
- __s64 timeout_ns; /* absolute */
+ /**
+ * @timeout_ns: absolute number of nanoseconds to wait.
+ */
+ __s64 timeout_ns;
};
/* Valid flags to pass to drm_panfrost_create_bo */
@@ -97,16 +130,26 @@ struct drm_panfrost_wait_bo {
* The flags argument is a bit mask of PANFROST_BO_* flags.
*/
struct drm_panfrost_create_bo {
+ /**
+ * @size: size of shmem/BO area to create (bytes)
+ */
__u32 size;
+ /**
+ * @flags: see PANFROST_BO_* flags
+ */
__u32 flags;
- /** Returned GEM handle for the BO. */
+ /**
+ * @handle: Returned GEM handle for the BO.
+ */
__u32 handle;
- /* Pad, must be zero-filled. */
+ /**
+ * @pad: Padding, must be zero-filled.
+ */
__u32 pad;
/**
- * Returned offset for the BO in the GPU address space. This offset
- * is private to the DRM fd and is valid for the lifetime of the GEM
- * handle.
+ * @offset: Returned offset for the BO in the GPU address space.
+ * This offset is private to the DRM fd and is valid for the
+ * lifetime of the GEM handle.
*
* This offset value will always be nonzero, since various HW
* units treat 0 specially.
@@ -126,10 +169,17 @@ struct drm_panfrost_create_bo {
* used in a future extension.
*/
struct drm_panfrost_mmap_bo {
- /** Handle for the object being mapped. */
+ /**
+ * @handle: Handle for the object being mapped.
+ */
__u32 handle;
+ /**
+ * @flags: currently not used (should be zero)
+ */
__u32 flags;
- /** offset into the drm node to use for subsequent mmap call. */
+ /**
+ * @offset: offset into the drm node to use for subsequent mmap call.
+ */
__u64 offset;
};
@@ -177,6 +227,7 @@ enum drm_panfrost_param {
DRM_PANFROST_PARAM_AFBC_FEATURES,
DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP,
DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP_FREQUENCY,
+ DRM_PANFROST_PARAM_ALLOWED_JM_CTX_PRIORITIES,
};
struct drm_panfrost_get_param {
@@ -185,7 +236,7 @@ struct drm_panfrost_get_param {
__u64 value;
};
-/**
+/*
* Returns the offset for the BO in the GPU address space for this DRM fd.
* This is the same value returned by drm_panfrost_create_bo, if that was called
* from this DRM fd.
@@ -233,12 +284,14 @@ struct drm_panfrost_madvise {
* struct drm_panfrost_set_label_bo - ioctl argument for labelling Panfrost BOs.
*/
struct drm_panfrost_set_label_bo {
- /** @handle: Handle of the buffer object to label. */
+ /**
+ * @handle: Handle of the buffer object to label.
+ */
__u32 handle;
-
- /** @pad: MBZ. */
+ /**
+ * @pad: Must be zero.
+ */
__u32 pad;
-
/**
* @label: User pointer to a NUL-terminated string
*
@@ -299,6 +352,49 @@ struct panfrost_dump_registers {
__u32 value;
};
+enum drm_panfrost_jm_ctx_priority {
+ /**
+ * @PANFROST_JM_CTX_PRIORITY_LOW: Low priority context.
+ */
+ PANFROST_JM_CTX_PRIORITY_LOW = 0,
+
+ /**
+ * @PANFROST_JM_CTX_PRIORITY_MEDIUM: Medium priority context.
+ */
+ PANFROST_JM_CTX_PRIORITY_MEDIUM,
+
+ /**
+ * @PANFROST_JM_CTX_PRIORITY_HIGH: High priority context.
+ *
+ * Requires CAP_SYS_NICE or DRM_MASTER.
+ */
+ PANFROST_JM_CTX_PRIORITY_HIGH,
+};
+
+struct drm_panfrost_jm_ctx_create {
+ /**
+ * @handle: Handle of the created JM context
+ */
+ __u32 handle;
+ /**
+ * @priority: Context priority (see enum drm_panfrost_jm_ctx_priority).
+ */
+ __u32 priority;
+};
+
+struct drm_panfrost_jm_ctx_destroy {
+ /**
+ * @handle: Handle of the JM context to destroy.
+ *
+ * Must be a valid context handle returned by DRM_IOCTL_PANTHOR_JM_CTX_CREATE.
+ */
+ __u32 handle;
+ /**
+ * @pad: Padding field, must be zero.
+ */
+ __u32 pad;
+};
+
#if defined(__cplusplus)
}
#endif