diff --git a/src/i830_memory.c b/src/i830_memory.c
index 052d906..3234e08 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -111,6 +111,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "i915_drm.h"
 #endif
 
+#ifndef I915_SETPARAM_NUM_USED_FENCES
+#define I915_SETPARAM_NUM_USED_FENCES	4
+#endif
+
 #define ALIGN(i,m)    (((i) + (m) - 1) & ~((m) - 1))
 
 /* Our hardware status area is just a single page */
