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
5858 struct drm_v3d_perfmon_get_values)
5959
6060 #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+ */
69+struct drm_v3d_extension {
70+ __u64 next;
71+ __u32 id;
72+#define DRM_V3D_EXT_ID_MULTI_SYNC 0x01
73+ __u32 flags; /* mbz */
74+};
6175
6276 /**
6377 * 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
135149 /* Number of BO handles passed in (size is that times 4). */
136150 __u32 bo_handle_count;
137151
152+ /* DRM_V3D_SUBMIT_* properties */
138153 __u32 flags;
139154
140155 /* ID of the perfmon to attach to this job. 0 means no perfmon. */
141156 __u32 perfmon_id;
142157
143158 __u32 pad;
159+
160+ /* Pointer to an array of ioctl extensions*/
161+ __u64 extensions;
144162 };
145163
146164 /**
@@ -248,6 +266,12 @@ struct drm_v3d_submit_tfu { · 101 unmodified lines
248266 __u32 in_sync;
249267 /* Sync object to signal when the TFU job is done. */
250268 __u32 out_sync;
269+
270+ __u32 flags;
271+
272+ /* Pointer to an array of ioctl extensions*/
273+ __u64 extensions;
274+
251275 };
252276
253277 /* Submits a compute shader for dispatch. This job will block on any
@@ -276,6 +300,13 @@ struct drm_v3d_submit_csd { · 22 unmodified lines
276300
277301 /* ID of the perfmon to attach to this job. 0 means no perfmon. */
278302 __u32 perfmon_id;
303+
304+ /* Pointer to an array of ioctl extensions*/
305+ __u64 extensions;
306+
307+ __u32 flags;
308+
309+ __u32 pad;
279310 };
280311
281312 enum {