History

drm/v3d: add generic ioctl extension

Add support to attach generic extensions on job submission. This patch is third prep work to enable multiple syncobjs on job submission. With this work, when the job submission interface needs to be extended to accommodate a new feature, we will use a generic extension struct where an id determines the data type to be pointed. The first application is to enable multiples in/out syncobj (next patch), but the base is already done for future features. Therefore, to attach a new feature, a specific extension struct should subclass drm_v3d_extension and update the list of extensions in a job submission. v2: - remove redundant elements to subclass struct (Daniel) v3: - add comment for v3d_get_extensions

Melissa Wen committed 5 years ago

Commit bb3425e1 parent 07c2a413 files · +103 −6Browse files

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

Unified · Split

include/uapi/drm/v3d_drm.h+31−0
@@ -58,6 +58,20 @@ extern "C" { · 57 unmodified lines
58 struct drm_v3d_perfmon_get_values)58 struct drm_v3d_perfmon_get_values)
59 59
60#define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x0160#define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x01
61#define DRM_V3D_SUBMIT_EXTENSION 0x02
62
63/* struct drm_v3d_extension - ioctl extensions
64 *
65 * Linked-list of generic extensions where the id identify which struct is
66 * pointed by ext_data. Therefore, DRM_V3D_EXT_ID_* is used on id to identify
67 * the extension type.
68 */
69struct drm_v3d_extension {
70 __u64 next;
71 __u32 id;
72#define DRM_V3D_EXT_ID_MULTI_SYNC 0x01
73 __u32 flags; /* mbz */
74};
61 75
62/**76/**
63 * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D77 * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D
@@ -135,12 +149,16 @@ struct drm_v3d_submit_cl { · 71 unmodified lines
135 /* Number of BO handles passed in (size is that times 4). */149 /* Number of BO handles passed in (size is that times 4). */
136 __u32 bo_handle_count;150 __u32 bo_handle_count;
137 151
152 /* DRM_V3D_SUBMIT_* properties */
138 __u32 flags;153 __u32 flags;
139 154
140 /* ID of the perfmon to attach to this job. 0 means no perfmon. */155 /* ID of the perfmon to attach to this job. 0 means no perfmon. */
141 __u32 perfmon_id;156 __u32 perfmon_id;
142 157
143 __u32 pad;158 __u32 pad;
159
160 /* Pointer to an array of ioctl extensions*/
161 __u64 extensions;
144};162};
145 163
146/**164/**
@@ -248,6 +266,12 @@ struct drm_v3d_submit_tfu { · 101 unmodified lines
248 __u32 in_sync;266 __u32 in_sync;
249 /* Sync object to signal when the TFU job is done. */267 /* Sync object to signal when the TFU job is done. */
250 __u32 out_sync;268 __u32 out_sync;
269
270 __u32 flags;
271
272 /* Pointer to an array of ioctl extensions*/
273 __u64 extensions;
274
251};275};
252 276
253/* Submits a compute shader for dispatch. This job will block on any277/* Submits a compute shader for dispatch. This job will block on any
@@ -276,6 +300,13 @@ struct drm_v3d_submit_csd { · 22 unmodified lines
276 300
277 /* ID of the perfmon to attach to this job. 0 means no perfmon. */301 /* ID of the perfmon to attach to this job. 0 means no perfmon. */
278 __u32 perfmon_id;302 __u32 perfmon_id;
303
304 /* Pointer to an array of ioctl extensions*/
305 __u64 extensions;
306
307 __u32 flags;
308
309 __u32 pad;
279};310};
280 311
281enum {312enum {