History

drm/msm: Add per-instance submit queues

Currently the behavior of a command stream is provided by the user application during submission and the application is expected to internally maintain the settings for each 'context' or 'rendering queue' and specify the correct ones. This works okay for simple cases but as applications become more complex we will want to set context specific flags and do various permission checks to allow certain contexts to enable additional privileges. Add kernel-side submit queues to be analogous to 'contexts' or 'rendering queues' on the application side. Each file descriptor instance will maintain its own list of queues. Queues cannot be shared between file descriptors. For backwards compatibility context id '0' is defined as a default context specifying no priority and no special flags. This is intended to be the usual configuration for 99% of applications so that a garden variety application can function correctly without creating a queue. Only those applications requiring the specific benefit of different queues need create one.

Jordan Crouse committed 9 years ago

Commit f7de1541 parent 0033e1b8 files · +250 −16Browse files

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

Unified · Split

include/uapi/drm/msm_drm.h+22−0
@@ -218,6 +218,7 @@ struct drm_msm_gem_submit { · 217 unmodified lines
218218 __u64 bos; /* in, ptr to array of submit_bo's */
219219 __u64 cmds; /* in, ptr to array of submit_cmd's */
220220 __s32 fence_fd; /* in/out fence fd (see MSM_SUBMIT_FENCE_FD_IN/OUT) */
221+ __u32 queueid; /* in, submitqueue id */
221222 };
222223
223224 /* The normal way to synchronize with the GPU is just to CPU_PREP on
@@ -254,6 +255,20 @@ struct drm_msm_gem_madvise { · 30 unmodified lines
254255 __u32 retained; /* out, whether backing store still exists */
255256 };
256257
258+/*
259+ * Draw queues allow the user to set specific submission parameter. Command
260+ * submissions specify a specific submitqueue to use. ID 0 is reserved for
261+ * backwards compatibility as a "default" submitqueue
262+ */
263+
264+#define MSM_SUBMITQUEUE_FLAGS (0)
265+
266+struct drm_msm_submitqueue {
267+ __u32 flags; /* in, MSM_SUBMITQUEUE_x */
268+ __u32 prio; /* in, Priority level */
269+ __u32 id; /* out, identifier */
270+};
271+
257272 #define DRM_MSM_GET_PARAM 0x00
258273 /* placeholder:
259274 #define DRM_MSM_SET_PARAM 0x01
@@ -265,6 +280,11 @@ struct drm_msm_gem_madvise { · 5 unmodified lines
265280 #define DRM_MSM_GEM_SUBMIT 0x06
266281 #define DRM_MSM_WAIT_FENCE 0x07
267282 #define DRM_MSM_GEM_MADVISE 0x08
283+/* placeholder:
284+#define DRM_MSM_GEM_SVM_NEW 0x09
285+ */
286+#define DRM_MSM_SUBMITQUEUE_NEW 0x0A
287+#define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B
268288
269289 #define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
270290 #define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
@@ -274,6 +294,8 @@ struct drm_msm_gem_madvise { · 3 unmodified lines
274294 #define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
275295 #define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
276296 #define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
297+#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
298+#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
277299
278300 #if defined(__cplusplus)
279301 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t