intel: Account for mt->offset in intel_miptree_map

We need to take account the offset from original bo when using glTexSubImage()
and other functions that manipulate the subregion of an exported texture.
Offsets are appended to mapped region address and when blitting from a source
region.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
This commit is contained in:
Abdiel Janulgue 2013-01-25 15:37:00 +02:00 committed by Chad Versace
parent 11f5c82e83
commit 8e2454c562
1 changed files with 2 additions and 2 deletions

View File

@ -1120,7 +1120,7 @@ intel_miptree_map_gtt(struct intel_context *intel,
assert(y % bh == 0);
y /= bh;
base = intel_region_map(intel, mt->region, map->mode);
base = intel_region_map(intel, mt->region, map->mode) + mt->offset;
if (base == NULL)
map->ptr = NULL;
@ -1180,7 +1180,7 @@ intel_miptree_map_blit(struct intel_context *intel,
if (!intelEmitCopyBlit(intel,
mt->region->cpp,
mt->region->pitch, mt->region->bo,
0, mt->region->tiling,
mt->offset, mt->region->tiling,
map->stride, map->bo,
0, I915_TILING_NONE,
x, y,