A CPU job is a type of job that performs operations that requires CPU intervention. A reset timestamp job is a job that resets the timestamp queries based on the value offset of the first query. As V3D doesn't provide any mechanism to obtain a timestamp from the GPU, it is a job that needs CPU intervention. So, create a user extension for the CPU job that enables the creation of a reset timestamp job. This user extension will allow the creation of a CPU job that resets the timestamp value in the timestamp BO and resets the availability syncobj.
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -74,6 +74,7 @@ struct drm_v3d_extension { · 73 unmodified lines | ||
| 74 | 74 | #define DRM_V3D_EXT_ID_MULTI_SYNC 0x01 |
| 75 | 75 | #define DRM_V3D_EXT_ID_CPU_INDIRECT_CSD 0x02 |
| 76 | 76 | #define DRM_V3D_EXT_ID_CPU_TIMESTAMP_QUERY 0x03 |
| 77 | +#define DRM_V3D_EXT_ID_CPU_RESET_TIMESTAMP_QUERY 0x04 | |
| 77 | 78 | __u32 flags; /* mbz */ |
| 78 | 79 | }; |
| 79 | 80 | |
| @@ -427,6 +428,29 @@ struct drm_v3d_timestamp_query { · 347 unmodified lines | ||
| 427 | 428 | __u32 pad; |
| 428 | 429 | }; |
| 429 | 430 | |
| 431 | +/** | |
| 432 | + * struct drm_v3d_reset_timestamp_query - ioctl extension for the CPU job to | |
| 433 | + * reset timestamp queries | |
| 434 | + * | |
| 435 | + * When an extension DRM_V3D_EXT_ID_CPU_RESET_TIMESTAMP_QUERY is defined, it | |
| 436 | + * points to this extension to define a reset timestamp submission. This CPU | |
| 437 | + * job will reset the timestamp queries based on value offset of the first | |
| 438 | + * query. Moreover, it will reset the timestamp syncobj to reset query | |
| 439 | + * availability. | |
| 440 | + */ | |
| 441 | +struct drm_v3d_reset_timestamp_query { | |
| 442 | + struct drm_v3d_extension base; | |
| 443 | + | |
| 444 | + /* Array of timestamp's syncobjs to indicate its availability */ | |
| 445 | + __u64 syncs; | |
| 446 | + | |
| 447 | + /* Offset of the first query within the timestamp BO for its value */ | |
| 448 | + __u32 offset; | |
| 449 | + | |
| 450 | + /* Number of queries */ | |
| 451 | + __u32 count; | |
| 452 | +}; | |
| 453 | + | |
| 430 | 454 | struct drm_v3d_submit_cpu { |
| 431 | 455 | /* Pointer to a u32 array of the BOs that are referenced by the job. |
| 432 | 456 | * |
| @@ -435,6 +459,9 @@ struct drm_v3d_submit_cpu { · 2 unmodified lines | ||
| 435 | 459 | * |
| 436 | 460 | * For DRM_V3D_EXT_ID_TIMESTAMP_QUERY, it must contain only one BO, |
| 437 | 461 | * that will contain the timestamp. |
| 462 | + * | |
| 463 | + * For DRM_V3D_EXT_ID_CPU_RESET_TIMESTAMP_QUERY, it must contain only | |
| 464 | + * one BO, that contains the timestamp. | |
| 438 | 465 | */ |
| 439 | 466 | __u64 bo_handles; |
| 440 | 467 | |