summaryrefslogtreecommitdiff
path: root/lib/libdrm
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-05-15 15:51:06 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-05-15 15:51:06 +0000
commitb6280b451fe07b1d8f3f3991ab5f15c95771e9d6 (patch)
treec97549f759810aa7242a596127be48ec688de8a1 /lib/libdrm
parent2cf3919008ea77bfbe118989e9dcdc4046d776d0 (diff)
Add drm_intel_bo_is_reusable(), to check if a buffer object will be put
in the userland BO cache or not. Bump minor. From Chris Wilson in upstream git. ok matthieu@
Diffstat (limited to 'lib/libdrm')
-rw-r--r--lib/libdrm/intel/intel_bufmgr.c7
-rw-r--r--lib/libdrm/intel/intel_bufmgr.h1
-rw-r--r--lib/libdrm/intel/intel_bufmgr_gem.c11
-rw-r--r--lib/libdrm/intel/intel_bufmgr_priv.h7
-rw-r--r--lib/libdrm/intel/shlib_version2
5 files changed, 26 insertions, 2 deletions
diff --git a/lib/libdrm/intel/intel_bufmgr.c b/lib/libdrm/intel/intel_bufmgr.c
index ce21a3323..9144fdd47 100644
--- a/lib/libdrm/intel/intel_bufmgr.c
+++ b/lib/libdrm/intel/intel_bufmgr.c
@@ -229,6 +229,13 @@ int drm_intel_bo_disable_reuse(drm_intel_bo *bo)
return 0;
}
+int drm_intel_bo_is_reusable(drm_intel_bo *bo)
+{
+ if (bo->bufmgr->bo_is_reusable)
+ return bo->bufmgr->bo_is_reusable(bo);
+ return 0;
+}
+
int drm_intel_bo_busy(drm_intel_bo *bo)
{
if (bo->bufmgr->bo_busy)
diff --git a/lib/libdrm/intel/intel_bufmgr.h b/lib/libdrm/intel/intel_bufmgr.h
index 0984ab087..cbcddb651 100644
--- a/lib/libdrm/intel/intel_bufmgr.h
+++ b/lib/libdrm/intel/intel_bufmgr.h
@@ -126,6 +126,7 @@ int drm_intel_bo_busy(drm_intel_bo *bo);
int drm_intel_bo_madvise(drm_intel_bo *bo, int madv);
int drm_intel_bo_disable_reuse(drm_intel_bo *bo);
+int drm_intel_bo_is_reusable(drm_intel_bo *bo);
int drm_intel_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo);
/* drm_intel_bufmgr_gem.c */
diff --git a/lib/libdrm/intel/intel_bufmgr_gem.c b/lib/libdrm/intel/intel_bufmgr_gem.c
index 50420d512..eefe25086 100644
--- a/lib/libdrm/intel/intel_bufmgr_gem.c
+++ b/lib/libdrm/intel/intel_bufmgr_gem.c
@@ -1078,7 +1078,7 @@ drm_intel_gem_bo_get_subdata(drm_intel_bo *bo, unsigned long offset,
static void
drm_intel_gem_bo_wait_rendering(drm_intel_bo *bo)
{
- drm_intel_gem_bo_start_gtt_access(bo, 0);
+ drm_intel_gem_bo_start_gtt_access(bo, 1);
}
/**
@@ -1683,6 +1683,14 @@ drm_intel_gem_bo_disable_reuse(drm_intel_bo *bo)
}
static int
+drm_intel_gem_bo_is_reusable(drm_intel_bo *bo)
+{
+ drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
+
+ return bo_gem->reusable;
+}
+
+static int
_drm_intel_gem_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo)
{
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
@@ -1829,6 +1837,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
bufmgr_gem->bufmgr.check_aperture_space =
drm_intel_gem_check_aperture_space;
bufmgr_gem->bufmgr.bo_disable_reuse = drm_intel_gem_bo_disable_reuse;
+ bufmgr_gem->bufmgr.bo_is_reusable = drm_intel_gem_bo_is_reusable;
bufmgr_gem->bufmgr.get_pipe_from_crtc_id =
drm_intel_gem_get_pipe_from_crtc_id;
bufmgr_gem->bufmgr.bo_references = drm_intel_gem_bo_references;
diff --git a/lib/libdrm/intel/intel_bufmgr_priv.h b/lib/libdrm/intel/intel_bufmgr_priv.h
index fb84e70f3..f987d97af 100644
--- a/lib/libdrm/intel/intel_bufmgr_priv.h
+++ b/lib/libdrm/intel/intel_bufmgr_priv.h
@@ -247,6 +247,13 @@ struct _drm_intel_bufmgr {
int (*bo_disable_reuse) (drm_intel_bo *bo);
/**
+ * Query whether a buffer is reusable.
+ *
+ * \param bo Buffer to query
+ */
+ int (*bo_is_reusable) (drm_intel_bo *bo);
+
+ /**
*
* Return the pipe associated with a crtc_id so that vblank
* synchronization can use the correct data in the request.
diff --git a/lib/libdrm/intel/shlib_version b/lib/libdrm/intel/shlib_version
index c8860078e..79d3d3afd 100644
--- a/lib/libdrm/intel/shlib_version
+++ b/lib/libdrm/intel/shlib_version
@@ -1,2 +1,2 @@
major=1
-minor=2
+minor=3