Buffers that are not shared between contexts can share a single resv object. This way drm_gpuvm will not track them as external objects, and submit-time validating overhead will be O(1) for all N non-shared BOs, instead of O(n).
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -140,6 +140,19 @@ struct drm_msm_param { · 139 unmodified lines | ||
| 140 | 140 | |
| 141 | 141 | #define MSM_BO_SCANOUT 0x00000001 /* scanout capable */ |
| 142 | 142 | #define MSM_BO_GPU_READONLY 0x00000002 |
| 143 | +/* Private buffers do not need to be explicitly listed in the SUBMIT | |
| 144 | + * ioctl, unless referenced by a drm_msm_gem_submit_cmd. Private | |
| 145 | + * buffers may NOT be imported/exported or used for scanout (or any | |
| 146 | + * other situation where buffers can be indefinitely pinned, but | |
| 147 | + * cases other than scanout are all kernel owned BOs which are not | |
| 148 | + * visible to userspace). | |
| 149 | + * | |
| 150 | + * In exchange for those constraints, all private BOs associated with | |
| 151 | + * a single context (drm_file) share a single dma_resv, and if there | |
| 152 | + * has been no eviction since the last submit, there are no per-BO | |
| 153 | + * bookeeping to do, significantly cutting the SUBMIT overhead. | |
| 154 | + */ | |
| 155 | +#define MSM_BO_NO_SHARE 0x00000004 | |
| 143 | 156 | #define MSM_BO_CACHE_MASK 0x000f0000 |
| 144 | 157 | /* cache modes */ |
| 145 | 158 | #define MSM_BO_CACHED 0x00010000 |
| @@ -149,6 +162,7 @@ struct drm_msm_param { · 3 unmodified lines | ||
| 149 | 162 | |
| 150 | 163 | #define MSM_BO_FLAGS (MSM_BO_SCANOUT | \ |
| 151 | 164 | MSM_BO_GPU_READONLY | \ |
| 165 | + MSM_BO_NO_SHARE | \ | |
| 152 | 166 | MSM_BO_CACHE_MASK) |
| 153 | 167 | |
| 154 | 168 | struct drm_msm_gem_new { |