i915g: kill buf->map_gtt
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Nov 2010 22:38:22 +0000 (23:38 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Sun, 21 Nov 2010 15:41:19 +0000 (16:41 +0100)
Not using the gtt is considered harmful for performance. And for
partial uploads there's always drm_intel_bo_subdata.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
src/gallium/winsys/i915/drm/i915_drm_buffer.c
src/gallium/winsys/i915/drm/i915_drm_winsys.h

index 6b06e7ae99508daddfef1d68a47c5980632d1c3d..b9fd436ed29ee85bc4d31935142fa41c096be038 100644 (file)
@@ -21,7 +21,6 @@ i915_drm_buffer_create(struct i915_winsys *iws,
    buf->magic = 0xDEAD1337;
    buf->flinked = FALSE;
    buf->flink = 0;
-   buf->map_gtt = FALSE;
 
    if (type == I915_NEW_TEXTURE) {
       name = "gallium3d_texture";
@@ -29,11 +28,9 @@ i915_drm_buffer_create(struct i915_winsys *iws,
    } else if (type == I915_NEW_VERTEX) {
       name = "gallium3d_vertex";
       pool = idws->pools.gem;
-      buf->map_gtt = TRUE;
    } else if (type == I915_NEW_SCANOUT) {
       name = "gallium3d_scanout";
       pool = idws->pools.gem;
-      buf->map_gtt = TRUE;
    } else {
       assert(0);
       name = "gallium3d_unknown";
@@ -74,8 +71,6 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
       goto err;
 
    drm_intel_bo_get_tiling(buf->bo, &tile, &swizzle);
-   if (tile != I915_TILE_NONE)
-      buf->map_gtt = TRUE;
 
    *stride = whandle->stride;
 
@@ -126,7 +121,6 @@ i915_drm_buffer_set_fence_reg(struct i915_winsys *iws,
 
    if (tile != I915_TILE_NONE) {
       assert(buf->map_count == 0);
-      buf->map_gtt = TRUE;
    }
 
    return drm_intel_bo_set_tiling(buf->bo, &tile, stride);
@@ -146,10 +140,7 @@ i915_drm_buffer_map(struct i915_winsys *iws,
    if (buf->map_count)
       goto out;
 
-   if (buf->map_gtt)
-      ret = drm_intel_gem_bo_map_gtt(bo);
-   else
-      ret = drm_intel_bo_map(bo, write);
+   ret = drm_intel_gem_bo_map_gtt(bo);
 
    buf->ptr = bo->virtual;
 
@@ -171,10 +162,7 @@ i915_drm_buffer_unmap(struct i915_winsys *iws,
    if (--buf->map_count)
       return;
 
-   if (buf->map_gtt)
-      drm_intel_gem_bo_unmap_gtt(intel_bo(buffer));
-   else
-      drm_intel_bo_unmap(intel_bo(buffer));
+   drm_intel_gem_bo_unmap_gtt(intel_bo(buffer));
 }
 
 static int
index 88a71f2424dc513138ba1cf1861745ffedcb008b..496c88de5a98acbc59908c1e41d5f35a9a932cce 100644 (file)
@@ -54,7 +54,6 @@ struct i915_drm_buffer {
 
    void *ptr;
    unsigned map_count;
-   boolean map_gtt;
 
    boolean flinked;
    unsigned flink;