- *stride = mt->region->pitch * mt->cpp;
- *map = base + y * *stride + x * mt->cpp;
-
- DBG("%s: %d,%d %dx%d from mt %p %d,%d = %p/%d\n", __FUNCTION__,
- x - image_x, y - image_y, w, h,
- mt, x, y, *map, *stride);
- } else {
- /* texture data is in malloc'd memory */
- GLuint width = tex_image->Width;
- GLuint height = ALIGN(tex_image->Height, bh) / bh;
- GLuint texelSize = _mesa_get_format_bytes(tex_image->TexFormat);
-
- assert(map);
-
- *stride = _mesa_format_row_stride(tex_image->TexFormat, width);
- *map = intel_image->base.Data + (slice * height + y) * *stride + x * texelSize;
-
- DBG("%s: %d,%d %dx%d from data %p = %p/%d\n", __FUNCTION__,
- x, y, w, h,
- intel_image->base.Data, *map, *stride);
- }
+ intel_miptree_map(intel, mt, tex_image->Level, slice, x, y, w, h, mode,
+ (void **)map, stride);