drm: Branch 'master' - 2 commits

[email protected] (Chris Wilson)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 intel/intel_bufmgr.h     |    1 +
 intel/intel_bufmgr_gem.c |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit dfd536c60d0bdffe005e354be0677f066af94f83
Author: Chris Wilson <[email protected]>
Date:   Fri Jan 27 20:25:04 2017 +0000

    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 <[email protected]>

diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h
index 11579fb..693472a 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);
 #define HAVE_DRM_INTEL_GEM_BO_DISABLE_IMPLICIT_SYNC 1
 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_enable_implicit_sync(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);
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 077746c..a665600 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)
 }
 
 /**
+ * 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
  * before execbuf. See drm_intel_gem_bo_disable_implicit_sync()
  */
commit 22cfd0431131538ad1953af86f7cc2d48af176d4
Author: Chris Wilson <[email protected]>
Date:   Fri Jan 27 20:20:30 2017 +0000

    intel: Clear execobject flags before preserving object in reuse cache
    
    Signed-off-by: Chris Wilson <[email protected]>

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 9195f3e..077746c 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1411,6 +1411,8 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time)
 		bo_gem->name = NULL;
 		bo_gem->validate_index = -1;
 
+		bo_gem->kflags = 0;
+
 		DRMLISTADDTAIL(&bo_gem->head, &bucket->head);
 	} else {
 		drm_intel_gem_bo_free(bo);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.