summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_tex_copy.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-01-10 15:11:28 -0800
committerEric Anholt <eric@anholt.net>2013-01-18 12:48:13 -0800
commit60894edeef973e86a73067276f658b72f84271b6 (patch)
tree8ad06635586742380f5f429eecae0502057597d5 /src/mesa/drivers/dri/intel/intel_tex_copy.c
parent8fd62e80ae1985b1dc466ecddbbed1e48edb08f9 (diff)
intel: Make intel_region's pitch be bytes instead of pixels.
We almost never want a stride in pixels -- if you're doing anything with a stride, you're specifying an offset or incrementing a pointer, and in both cases you had to multiply by cpp to get the bytes value you wanted. But worse, on the way to creating a region from a new tiled BO, we divided by cpp to get pitch in pixels, and for an RGB32 buffer (an upcoming change) the pitch wouldn't divide exactly, and we'd end up with a wrong stride in our region. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_copy.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_copy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index 47b8dc3b3ae..1af7b1c5671 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -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 * region->cpp,
+ src_pitch,
region->bo,
0,
region->tiling,
- intelImage->mt->region->pitch * intelImage->mt->cpp,
+ intelImage->mt->region->pitch,
intelImage->mt->region->bo,
0,
intelImage->mt->region->tiling,