diff options
author | Chris Wilson | 2017-01-27 14:25:04 -0600 |
---|---|---|
committer | Chris Wilson | 2017-01-27 14:25:04 -0600 |
commit | dfd536c60d0bdffe005e354be0677f066af94f83 (patch) | |
tree | b880298cdc0782d9be36e2ede173ba3255a2f170 | |
parent | 22cfd0431131538ad1953af86f7cc2d48af176d4 (diff) | |
download | external-libgbm-dfd536c60d0bdffe005e354be0677f066af94f83.tar.gz external-libgbm-dfd536c60d0bdffe005e354be0677f066af94f83.tar.xz external-libgbm-dfd536c60d0bdffe005e354be0677f066af94f83.zip |
intel: Export a function to re-enable implicit synchronisation
Implicit synchronisation is the default behaviour of the kernel when
rendering with an execobject. It may be disabled with
drm_intel_gem_bo_disable_implicit_sync(), and then to restore it use
drm_intel_gem_bo_enable_implicit_sync().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | intel/intel_bufmgr.h | 1 | ||||
-rw-r--r-- | intel/intel_bufmgr_gem.c | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index 11579fbc..693472a5 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h | |||
@@ -187,6 +187,7 @@ int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo); | |||
187 | #define HAVE_DRM_INTEL_GEM_BO_DISABLE_IMPLICIT_SYNC 1 | 187 | #define HAVE_DRM_INTEL_GEM_BO_DISABLE_IMPLICIT_SYNC 1 |
188 | int drm_intel_bufmgr_gem_can_disable_implicit_sync(drm_intel_bufmgr *bufmgr); | 188 | int drm_intel_bufmgr_gem_can_disable_implicit_sync(drm_intel_bufmgr *bufmgr); |
189 | void drm_intel_gem_bo_disable_implicit_sync(drm_intel_bo *bo); | 189 | void drm_intel_gem_bo_disable_implicit_sync(drm_intel_bo *bo); |
190 | void drm_intel_gem_bo_enable_implicit_sync(drm_intel_bo *bo); | ||
190 | 191 | ||
191 | void *drm_intel_gem_bo_map__cpu(drm_intel_bo *bo); | 192 | void *drm_intel_gem_bo_map__cpu(drm_intel_bo *bo); |
192 | void *drm_intel_gem_bo_map__gtt(drm_intel_bo *bo); | 193 | void *drm_intel_gem_bo_map__gtt(drm_intel_bo *bo); |
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 077746cd..a6656003 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c | |||
@@ -2816,6 +2816,25 @@ drm_intel_gem_bo_disable_implicit_sync(drm_intel_bo *bo) | |||
2816 | } | 2816 | } |
2817 | 2817 | ||
2818 | /** | 2818 | /** |
2819 | * Enables implicit synchronisation before executing the bo | ||
2820 | * | ||
2821 | * This is the default behaviour of the kernel, to wait upon prior writes | ||
2822 | * completing on the object before rendering with it, or to wait for prior | ||
2823 | * reads to complete before writing into the object. | ||
2824 | * drm_intel_gem_bo_disable_implicit_sync() can stop this behaviour, telling | ||
2825 | * the kernel never to insert a stall before using the object. Then this | ||
2826 | * function can be used to restore the implicit sync before subsequent | ||
2827 | * rendering. | ||
2828 | */ | ||
2829 | void | ||
2830 | drm_intel_gem_bo_enable_implicit_sync(drm_intel_bo *bo) | ||
2831 | { | ||
2832 | drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; | ||
2833 | |||
2834 | bo_gem->kflags &= ~EXEC_OBJECT_ASYNC; | ||
2835 | } | ||
2836 | |||
2837 | /** | ||
2819 | * Query whether the kernel supports disabling of its implicit synchronisation | 2838 | * Query whether the kernel supports disabling of its implicit synchronisation |
2820 | * before execbuf. See drm_intel_gem_bo_disable_implicit_sync() | 2839 | * before execbuf. See drm_intel_gem_bo_disable_implicit_sync() |
2821 | */ | 2840 | */ |