uint32_t tiling;
do {
- unsigned long aligned_y;
+ unsigned long aligned_y, height_alignment;
tiling = *tiling_mode;
* too so we try to be careful.
*/
aligned_y = y;
- if (tiling == I915_TILING_NONE)
- aligned_y = ALIGN(y, 2);
- else if (tiling == I915_TILING_X)
- aligned_y = ALIGN(y, 8);
+ height_alignment = 2;
+
+ if (tiling == I915_TILING_X)
+ height_alignment = 8;
else if (tiling == I915_TILING_Y)
- aligned_y = ALIGN(y, 32);
+ height_alignment = 32;
+ /* i8xx has a interleaved 2-row tile layout */
+ if (IS_GEN2(bufmgr_gem))
+ height_alignment *= 2;
+ aligned_y = ALIGN(y, height_alignment);
stride = x * cpp;
stride = drm_intel_gem_bo_tile_pitch(bufmgr_gem, stride, tiling_mode);