intel: Make intel_blit.c take pitches in bytes.
As we gain support for NPOT cpp, a pitch may not divide by cpp cleanly. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -144,9 +144,6 @@ intelEmitCopyBlit(struct intel_context *intel,
|
||||
src_buffer, src_pitch, src_offset, src_x, src_y,
|
||||
dst_buffer, dst_pitch, dst_offset, dst_x, dst_y, w, h);
|
||||
|
||||
src_pitch *= cpp;
|
||||
dst_pitch *= cpp;
|
||||
|
||||
/* Blit pitch must be dword-aligned. Otherwise, the hardware appears to drop
|
||||
* the low bits.
|
||||
*/
|
||||
@@ -421,8 +418,6 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
|
||||
if (w < 0 || h < 0)
|
||||
return true;
|
||||
|
||||
dst_pitch *= cpp;
|
||||
|
||||
DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d, %d bytes %d dwords\n",
|
||||
__FUNCTION__,
|
||||
dst_buffer, dst_pitch, dst_offset, x, y, w, h, src_size, dwords);
|
||||
|
||||
@@ -727,9 +727,9 @@ intel_miptree_copy_slice(struct intel_context *intel,
|
||||
|
||||
if (!intelEmitCopyBlit(intel,
|
||||
dst_mt->region->cpp,
|
||||
src_mt->region->pitch, src_mt->region->bo,
|
||||
src_mt->region->pitch * src_mt->region->cpp, src_mt->region->bo,
|
||||
0, src_mt->region->tiling,
|
||||
dst_mt->region->pitch, dst_mt->region->bo,
|
||||
dst_mt->region->pitch * dst_mt->region->cpp, dst_mt->region->bo,
|
||||
0, dst_mt->region->tiling,
|
||||
src_x, src_y,
|
||||
dst_x, dst_y,
|
||||
@@ -1165,9 +1165,9 @@ intel_miptree_map_blit(struct intel_context *intel,
|
||||
|
||||
if (!intelEmitCopyBlit(intel,
|
||||
mt->region->cpp,
|
||||
mt->region->pitch, mt->region->bo,
|
||||
mt->region->pitch * mt->region->cpp, mt->region->bo,
|
||||
0, mt->region->tiling,
|
||||
map->stride / mt->region->cpp, map->bo,
|
||||
map->stride, map->bo,
|
||||
0, I915_TILING_NONE,
|
||||
x, y,
|
||||
0, 0,
|
||||
|
||||
@@ -274,7 +274,7 @@ do_blit_bitmap( struct gl_context *ctx,
|
||||
(GLubyte *)stipple,
|
||||
sz,
|
||||
color,
|
||||
dst->pitch,
|
||||
dst->pitch * dst->cpp,
|
||||
dst->bo,
|
||||
0,
|
||||
dst->tiling,
|
||||
|
||||
@@ -151,8 +151,8 @@ do_blit_readpixels(struct gl_context * ctx,
|
||||
|
||||
if (!intelEmitCopyBlit(intel,
|
||||
src->cpp,
|
||||
src->pitch, src->bo, 0, src->tiling,
|
||||
rowLength, dst_buffer, dst_offset, false,
|
||||
src->pitch * src->cpp, src->bo, 0, src->tiling,
|
||||
rowLength * src->cpp, dst_buffer, dst_offset, false,
|
||||
x, y,
|
||||
dst_x, dst_y,
|
||||
width, height,
|
||||
|
||||
@@ -391,8 +391,8 @@ intel_region_copy(struct intel_context *intel,
|
||||
|
||||
return intelEmitCopyBlit(intel,
|
||||
dst->cpp,
|
||||
src_pitch, src->bo, src_offset, src->tiling,
|
||||
dst->pitch, dst->bo, dst_offset, dst->tiling,
|
||||
src_pitch * src->cpp, src->bo, src_offset, src->tiling,
|
||||
dst->pitch * dst->cpp, dst->bo, dst_offset, dst->tiling,
|
||||
srcx, srcy, dstx, dsty, width, height,
|
||||
logicop);
|
||||
}
|
||||
|
||||
@@ -125,11 +125,11 @@ intel_copy_texsubimage(struct intel_context *intel,
|
||||
/* blit from src buffer to texture */
|
||||
if (!intelEmitCopyBlit(intel,
|
||||
intelImage->mt->cpp,
|
||||
src_pitch,
|
||||
src_pitch * region->cpp,
|
||||
region->bo,
|
||||
0,
|
||||
region->tiling,
|
||||
intelImage->mt->region->pitch,
|
||||
intelImage->mt->region->pitch * intelImage->mt->cpp,
|
||||
intelImage->mt->region->bo,
|
||||
0,
|
||||
intelImage->mt->region->tiling,
|
||||
|
||||
@@ -182,12 +182,13 @@ try_pbo_upload(struct gl_context *ctx,
|
||||
src_stride = unpack->RowLength;
|
||||
else
|
||||
src_stride = image->Width;
|
||||
src_stride *= intelImage->mt->region->cpp;
|
||||
|
||||
intel_miptree_get_image_offset(intelImage->mt, intelImage->base.Base.Level,
|
||||
intelImage->base.Base.Face,
|
||||
&dst_x, &dst_y);
|
||||
|
||||
dst_stride = intelImage->mt->region->pitch;
|
||||
dst_stride = intelImage->mt->region->pitch * intelImage->mt->region->cpp;
|
||||
|
||||
if (!intelEmitCopyBlit(intel,
|
||||
intelImage->mt->cpp,
|
||||
|
||||
@@ -136,9 +136,9 @@ intel_blit_texsubimage(struct gl_context * ctx,
|
||||
|
||||
ret = intelEmitCopyBlit(intel,
|
||||
intelImage->mt->cpp,
|
||||
dstRowStride / intelImage->mt->cpp,
|
||||
dstRowStride,
|
||||
temp_bo, 0, false,
|
||||
dst_pitch / intelImage->mt->cpp,
|
||||
dst_pitch,
|
||||
intelImage->mt->region->bo, 0,
|
||||
intelImage->mt->region->tiling,
|
||||
0, 0, blit_x, blit_y, width, height,
|
||||
|
||||
Reference in New Issue
Block a user