i915: make i915 use the cached mappings for batch/buffer objects.
authorDave Airlie <airlied@redhat.com>
Wed, 31 Oct 2007 23:41:27 +0000 (10:41 +1100)
committerDave Airlie <airlied@redhat.com>
Wed, 31 Oct 2007 23:41:39 +0000 (10:41 +1100)
This should restore gears speed on 9xx hardware

src/mesa/drivers/dri/common/dri_bufmgr.c
src/mesa/drivers/dri/i915/intel_batchbuffer.c
src/mesa/drivers/dri/i915/intel_buffer_objects.c

index 83886480dd3a5175adb3d9cd1fcc4dfcaf7096bd..72a4a1715003bd186ec336c9c515156a453649f3 100644 (file)
@@ -40,9 +40,8 @@ dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size,
    assert((location_mask & ~(DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_MEM_TT |
                             DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_PRIV0 |
                             DRM_BO_FLAG_MEM_PRIV1 | DRM_BO_FLAG_MEM_PRIV2 |
-                            DRM_BO_FLAG_MEM_PRIV3 |
-                            DRM_BO_FLAG_MEM_PRIV4)) == 0);
-
+                            DRM_BO_FLAG_MEM_PRIV3 | DRM_BO_FLAG_MEM_PRIV4 |
+                            DRM_BO_FLAG_CACHED | DRM_BO_FLAG_CACHED_MAPPED)) == 0);
    return bufmgr->bo_alloc(bufmgr, name, size, alignment, location_mask);
 }
 
index 74c75a3769bf0ad7952ee6a513554137020e1757..8ece6d2760c94d72b1d0164419bcb114eaef5ccc 100644 (file)
@@ -80,7 +80,7 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch)
 
    batch->buf = dri_bo_alloc(intel->intelScreen->bufmgr, "batchbuffer",
                             intel->intelScreen->maxBatchSize, 4096,
-                            DRM_BO_FLAG_MEM_TT);
+                            DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED | DRM_BO_FLAG_CACHED_MAPPED);
    dri_bo_map(batch->buf, GL_TRUE);
    batch->map = batch->buf->virtual;
    batch->size = intel->intelScreen->maxBatchSize;
index 3c73c402d962636c55f02fb91720c070fafc328d..5348822816c5c9c27ed003aa34ce844c929939ce 100644 (file)
@@ -42,7 +42,7 @@ intel_bufferobj_alloc_buffer(struct intel_context *intel,
 {
    intel_obj->buffer = dri_bo_alloc(intel->intelScreen->bufmgr, "bufferobj",
                                    intel_obj->Base.Size, 64,
-                                   DRM_BO_FLAG_MEM_TT);
+                                   DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED | DRM_BO_FLAG_CACHED_MAPPED);
 }
 
 /**