mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 05:50:12 +01:00
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>
This commit is contained in:
parent
22cfd04311
commit
dfd536c60d
2 changed files with 20 additions and 0 deletions
|
|
@ -187,6 +187,7 @@ int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo);
|
||||||
#define HAVE_DRM_INTEL_GEM_BO_DISABLE_IMPLICIT_SYNC 1
|
#define HAVE_DRM_INTEL_GEM_BO_DISABLE_IMPLICIT_SYNC 1
|
||||||
int drm_intel_bufmgr_gem_can_disable_implicit_sync(drm_intel_bufmgr *bufmgr);
|
int drm_intel_bufmgr_gem_can_disable_implicit_sync(drm_intel_bufmgr *bufmgr);
|
||||||
void drm_intel_gem_bo_disable_implicit_sync(drm_intel_bo *bo);
|
void drm_intel_gem_bo_disable_implicit_sync(drm_intel_bo *bo);
|
||||||
|
void drm_intel_gem_bo_enable_implicit_sync(drm_intel_bo *bo);
|
||||||
|
|
||||||
void *drm_intel_gem_bo_map__cpu(drm_intel_bo *bo);
|
void *drm_intel_gem_bo_map__cpu(drm_intel_bo *bo);
|
||||||
void *drm_intel_gem_bo_map__gtt(drm_intel_bo *bo);
|
void *drm_intel_gem_bo_map__gtt(drm_intel_bo *bo);
|
||||||
|
|
|
||||||
|
|
@ -2815,6 +2815,25 @@ drm_intel_gem_bo_disable_implicit_sync(drm_intel_bo *bo)
|
||||||
bo_gem->kflags |= EXEC_OBJECT_ASYNC;
|
bo_gem->kflags |= EXEC_OBJECT_ASYNC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables implicit synchronisation before executing the bo
|
||||||
|
*
|
||||||
|
* This is the default behaviour of the kernel, to wait upon prior writes
|
||||||
|
* completing on the object before rendering with it, or to wait for prior
|
||||||
|
* reads to complete before writing into the object.
|
||||||
|
* drm_intel_gem_bo_disable_implicit_sync() can stop this behaviour, telling
|
||||||
|
* the kernel never to insert a stall before using the object. Then this
|
||||||
|
* function can be used to restore the implicit sync before subsequent
|
||||||
|
* rendering.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
drm_intel_gem_bo_enable_implicit_sync(drm_intel_bo *bo)
|
||||||
|
{
|
||||||
|
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
|
||||||
|
|
||||||
|
bo_gem->kflags &= ~EXEC_OBJECT_ASYNC;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query whether the kernel supports disabling of its implicit synchronisation
|
* Query whether the kernel supports disabling of its implicit synchronisation
|
||||||
* before execbuf. See drm_intel_gem_bo_disable_implicit_sync()
|
* before execbuf. See drm_intel_gem_bo_disable_implicit_sync()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue