diff options
author | Jakob Bornecrantz <wallbraker@gmail.com> | 2009-09-23 11:54:22 -0700 |
---|---|---|
committer | Jakob Bornecrantz <wallbraker@gmail.com> | 2009-09-27 13:19:49 -0700 |
commit | 5aecddc1532d6c7f5095145a50eed0405ea2bda4 (patch) | |
tree | 6102610a594b69fd647c3b1c3476632d08707d7c /src/gallium/winsys/drm | |
parent | 60d72d9e45b08c14ea4195950302f93e52e03603 (diff) |
i915g: Make sure to map tiled buffers via the gtt
Diffstat (limited to 'src/gallium/winsys/drm')
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_drm_api.c | 5 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_api.c b/src/gallium/winsys/drm/intel/gem/intel_drm_api.c index 46fdc9f92b..8b647a769b 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_api.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_api.c @@ -41,6 +41,7 @@ intel_drm_buffer_from_handle(struct intel_drm_winsys *idws, const char* name, unsigned handle) { struct intel_drm_buffer *buf = CALLOC_STRUCT(intel_drm_buffer); + uint32_t tile = 0, swizzle = 0; if (!buf) return NULL; @@ -53,6 +54,10 @@ intel_drm_buffer_from_handle(struct intel_drm_winsys *idws, if (!buf->bo) goto err; + drm_intel_bo_get_tiling(buf->bo, &tile, &swizzle); + if (tile != INTEL_TILE_NONE) + buf->map_gtt = TRUE; + return (struct intel_buffer *)buf; err: diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c b/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c index 0030f915a3..327e19fcd6 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c @@ -58,11 +58,17 @@ intel_drm_buffer_set_fence_reg(struct intel_winsys *iws, unsigned stride, enum intel_buffer_tile tile) { + struct intel_drm_buffer *buf = intel_drm_buffer(buffer); assert(I915_TILING_NONE == INTEL_TILE_NONE); assert(I915_TILING_X == INTEL_TILE_X); assert(I915_TILING_Y == INTEL_TILE_Y); - return drm_intel_bo_set_tiling(intel_bo(buffer), &tile, stride); + if (tile != INTEL_TILE_NONE) { + assert(buf->map_count == 0); + buf->map_gtt = TRUE; + } + + return drm_intel_bo_set_tiling(buf->bo, &tile, stride); } static void * |