From 0e867312323fa51af324228b98bff4f49a813481 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 21 Oct 2008 00:10:54 -0700 Subject: 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. --- shared-core/i915_drm.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'shared-core') 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_ */ -- cgit v1.2.3