summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0a1ff35)
raw | patch | inline | side by side (parent: 0a1ff35)
author | Chris Wilson <chris@chris-wilson.co.uk> | |
Fri, 29 Oct 2010 09:49:54 +0000 (10:49 +0100) | ||
committer | Chris Wilson <chris@chris-wilson.co.uk> | |
Fri, 29 Oct 2010 09:49:54 +0000 (10:49 +0100) |
The kernel has always allowed userspace to underallocate objects
supplied for fencing. However, the kernel only allocated the object size
for the fence in the GTT and so caused tiling corruption. More recently
the kernel does allocate the full fence region in the GTT for an
under-sized object and so advertises that clients may finally make use
of this feature. The biggest benefit is for texture-heavy GL games on
i945 such as World of Padman which go from needing over 1GiB of RAM to
play to fitting in the GTT!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
supplied for fencing. However, the kernel only allocated the object size
for the fence in the GTT and so caused tiling corruption. More recently
the kernel does allocate the full fence region in the GTT for an
under-sized object and so advertises that clients may finally make use
of this feature. The biggest benefit is for texture-heavy GL games on
i945 such as World of Padman which go from needing over 1GiB of RAM to
play to fitting in the GTT!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
include/drm/i915_drm.h | patch | blob | history | |
intel/intel_bufmgr_gem.c | patch | blob | history |
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index bd9306141cd11b3d2b24a4d64c12c68e7d698472..19da2c044007a57ed9c17bcb6ee1ecfb77597e56 100644 (file)
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
#define I915_PARAM_HAS_EXECBUF2 9
#define I915_PARAM_HAS_BSD 10
#define I915_PARAM_HAS_BLT 11
+#define I915_PARAM_HAS_RELAXED_FENCING 12
typedef struct drm_i915_getparam {
int param;
index c5847a8af422b0da303f8b102d9b85585ebdc1b9..37a3691c756ce7da420af71b485b14de7db06ee0 100644 (file)
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
int available_fences;
int pci_device;
int gen;
- char has_bsd;
- char has_blt;
- char bo_reuse;
+ unsigned int has_bsd : 1;
+ unsigned int has_blt : 1;
+ unsigned int has_relaxed_fencing : 1;
+ unsigned int bo_reuse : 1;
char fenced_relocs;
} drm_intel_bufmgr_gem;
@@ -243,6 +244,10 @@ drm_intel_gem_bo_tile_size(drm_intel_bufmgr_gem *bufmgr_gem, unsigned long size,
return size;
}
+ /* Do we need to allocate every page for the fence? */
+ if (bufmgr_gem->has_relaxed_fencing)
+ return ROUND_UP_TO(size, 4096);
+
for (i = min_size; i < size; i <<= 1)
;
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
bufmgr_gem->has_blt = ret == 0;
+ gp.param = I915_PARAM_HAS_RELAXED_FENCING;
+ ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
+ bufmgr_gem->has_relaxed_fencing = ret == 0;
+
if (bufmgr_gem->gen < 4) {
gp.param = I915_PARAM_NUM_FENCES_AVAIL;
gp.value = &bufmgr_gem->available_fences;