History

drm/msm: Add MSM_SUBMIT_BO_NO_IMPLICIT

In cases where implicit sync is used, it is still useful (for things like sub-allocation, etc) to allow userspace to opt-out of implicit sync on per-BO basis.

Rob Clark committed 3 years ago

Commit b1bf64f1 parent 03a0a103 files · +16 −2Browse files

Unified · Split

3 files
  1. drivers/gpu/drm/msm/msm_drv.c +2 −1
  2. drivers/gpu/drm/msm/msm_gem_submit.c +11 −0
  3. include/uapi/drm/msm_drm.h +3 −1
drivers/gpu/drm/msm/msm_drv.c+2−1
@@ -45,9 +45,10 @@ · 44 unmodified lines
4545 * - 1.7.0 - Add MSM_PARAM_SUSPENDS to access suspend count
4646 * - 1.8.0 - Add MSM_BO_CACHED_COHERENT for supported GPUs (a6xx)
4747 * - 1.9.0 - Add MSM_SUBMIT_FENCE_SN_IN
48+ * - 1.10.0 - Add MSM_SUBMIT_BO_NO_IMPLICIT
4849 */
4950 #define MSM_VERSION_MAJOR 1
50−#define MSM_VERSION_MINOR 9
51+#define MSM_VERSION_MINOR 10
5152 #define MSM_VERSION_PATCHLEVEL 0
5253
5354 static const struct drm_mode_config_funcs mode_config_funcs = {
drivers/gpu/drm/msm/msm_gem_submit.c+11−0
@@ -334,9 +334,20 @@ static int submit_fence_sync(struct msm_gem_submit *submit, bool no_implicit) · 333 unmodified lines
334334 if (ret)
335335 return ret;
336336
337+ /* If userspace has determined that explicit fencing is
338+ * used, it can disable implicit sync on the entire
339+ * submit:
340+ */
337341 if (no_implicit)
338342 continue;
339343
344+ /* Otherwise userspace can ask for implicit sync to be
345+ * disabled on specific buffers. This is useful for internal
346+ * usermode driver managed buffers, suballocation, etc.
347+ */
348+ if (submit->bos[i].flags & MSM_SUBMIT_BO_NO_IMPLICIT)
349+ continue;
350+
340351 ret = drm_sched_job_add_implicit_dependencies(&submit->base,
341352 obj,
342353 write);
include/uapi/drm/msm_drm.h+3−1
@@ -222,10 +222,12 @@ struct drm_msm_gem_submit_cmd { · 221 unmodified lines
222222 #define MSM_SUBMIT_BO_READ 0x0001
223223 #define MSM_SUBMIT_BO_WRITE 0x0002
224224 #define MSM_SUBMIT_BO_DUMP 0x0004
225+#define MSM_SUBMIT_BO_NO_IMPLICIT 0x0008
225226
226227 #define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | \
227228 MSM_SUBMIT_BO_WRITE | \
228− MSM_SUBMIT_BO_DUMP)
229+ MSM_SUBMIT_BO_DUMP | \
230+ MSM_SUBMIT_BO_NO_IMPLICIT)
229231
230232 struct drm_msm_gem_submit_bo {
231233 __u32 flags; /* in, mask of MSM_SUBMIT_BO_x */