summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-10-21 00:10:54 -0700
committerEric Anholt <eric@anholt.net>2008-10-28 14:27:49 -0700
commit0e867312323fa51af324228b98bff4f49a813481 (patch)
treee2ebd033a8ecf9661d9c2936455ce2ff9ba5dccb /shared-core
parente47ab7a5081e178bad385ce2e75b01474ea7aa4c (diff)
intel: Add dri_bufmgr_check_aperture support for bufmgr_gem.
This relies on a new kernel ioctl to get the available aperture size. In order to provide reasonable performance from dri_bufmgr_check_aperture, we now require that once a buffer has been used as the target of a relocation, it gets no further relocations added to it. This cuts the cost of check_aperture from 10% to 1% in the 3D driver with no code changes, but slightly complicates our plans for the 2D driver.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/i915_drm.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/shared-core/i915_drm.h b/shared-core/i915_drm.h
index 2801687c..9211b390 100644
--- a/shared-core/i915_drm.h
+++ b/shared-core/i915_drm.h
@@ -192,6 +192,7 @@ typedef struct drm_i915_sarea {
#define DRM_I915_GEM_SW_FINISH 0x20
#define DRM_I915_GEM_SET_TILING 0x21
#define DRM_I915_GEM_GET_TILING 0x22
+#define DRM_I915_GEM_GET_APERTURE 0x23
#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -227,6 +228,7 @@ typedef struct drm_i915_sarea {
#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
+#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
/* Asynchronous page flipping:
*/
@@ -716,4 +718,15 @@ struct drm_i915_gem_get_tiling {
uint32_t swizzle_mode;
};
+struct drm_i915_gem_get_aperture {
+ /** Total size of the aperture used by i915_gem_execbuffer, in bytes */
+ uint64_t aper_size;
+
+ /**
+ * Available space in the aperture used by i915_gem_execbuffer, in
+ * bytes
+ */
+ uint64_t aper_available_size;
+};
+
#endif /* _I915_DRM_H_ */