History

drm/v3d: Add a CPU job submission

Create a new type of job, a CPU job. A CPU job is a type of job that performs operations that requires CPU intervention. The overall idea is to use user extensions to enable different types of CPU job, allowing the CPU job to perform different operations according to the type of user extension. The user extension ID identify the type of CPU job that must be dealt. Having a CPU job is interesting for synchronization purposes as a CPU job has a queue like any other V3D job and can be synchoronized by the multisync extension.

Melissa Wen committed 2 years ago

Commit aafc1a21 parent 464c61e5 files · +179 −1Browse files

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

Unified · Split

include/uapi/drm/v3d_drm.h+17−0
@@ -41,6 +41,7 @@ extern "C" { · 40 unmodified lines
4141 #define DRM_V3D_PERFMON_CREATE 0x08
4242 #define DRM_V3D_PERFMON_DESTROY 0x09
4343 #define DRM_V3D_PERFMON_GET_VALUES 0x0a
44+#define DRM_V3D_SUBMIT_CPU 0x0b
4445
4546 #define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
4647 #define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
@@ -56,6 +57,7 @@ extern "C" { · 9 unmodified lines
5657 struct drm_v3d_perfmon_destroy)
5758 #define DRM_IOCTL_V3D_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_GET_VALUES, \
5859 struct drm_v3d_perfmon_get_values)
60+#define DRM_IOCTL_V3D_SUBMIT_CPU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CPU, struct drm_v3d_submit_cpu)
5961
6062 #define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x01
6163 #define DRM_V3D_SUBMIT_EXTENSION 0x02
@@ -93,6 +95,7 @@ enum v3d_queue { · 31 unmodified lines
9395 V3D_TFU,
9496 V3D_CSD,
9597 V3D_CACHE_CLEAN,
98+ V3D_CPU,
9699 };
97100
98101 /**
@@ -276,6 +279,7 @@ enum drm_v3d_param { · 177 unmodified lines
276279 DRM_V3D_PARAM_SUPPORTS_CACHE_FLUSH,
277280 DRM_V3D_PARAM_SUPPORTS_PERFMON,
278281 DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT,
282+ DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE,
279283 };
280284
281285 struct drm_v3d_get_param {
@@ -361,6 +365,19 @@ struct drm_v3d_submit_csd { · 79 unmodified lines
361365 __u32 pad;
362366 };
363367
368+struct drm_v3d_submit_cpu {
369+ /* Pointer to a u32 array of the BOs that are referenced by the job. */
370+ __u64 bo_handles;
371+
372+ /* Number of BO handles passed in (size is that times 4). */
373+ __u32 bo_handle_count;
374+
375+ __u32 flags;
376+
377+ /* Pointer to an array of ioctl extensions*/
378+ __u64 extensions;
379+};
380+
364381 enum {
365382 V3D_PERFCNT_FEP_VALID_PRIMTS_NO_PIXELS,
366383 V3D_PERFCNT_FEP_VALID_PRIMS,