*** xf86-video-nouveau/src/nouveau_exa.c 2009-12-11 19:02:00.131317432 +0100 --- xf86-video-nouveau/src/nouveau_exa.c.new 2009-12-11 20:28:05.208065974 +0100 *************** *** 56,61 **** --- 56,62 ---- unsigned cpp = pspix->drawable.bitsPerPixel / 8; unsigned line_len = w * cpp; unsigned src_pitch = 0, linear = 0; + unsigned max_line_count = pNv->GART->size / line_len; /* Max amount of data we can DMA at once */ if (!nouveau_exa_pixmap_is_tiled(pspix)) { linear = 1; *************** *** 63,84 **** src_offset += (y * src_pitch) + (x * cpp); } while (h) { int line_count, i; char *src; ! if (h * line_len <= pNv->GART->size) { ! line_count = h; ! } else { ! line_count = pNv->GART->size / line_len; ! if (line_count > h) ! line_count = h; } - /* HW limitations */ - if (line_count > 2047) - line_count = 2047; - if (MARK_RING(chan, 32, 6)) return FALSE; --- 64,83 ---- src_offset += (y * src_pitch) + (x * cpp); } + /* Hardware limit*/ + if(max_line_count > 2047) { + max_line_count = 2047; + } + while (h) { int line_count, i; char *src; ! line_count = h; ! if(line_count > max_line_count) { ! line_count = max_line_count; } if (MARK_RING(chan, 32, 6)) return FALSE; *************** *** 174,179 **** --- 173,179 ---- unsigned cpp = pdpix->drawable.bitsPerPixel / 8; unsigned line_len = w * cpp; unsigned dst_pitch = 0, linear = 0; + unsigned max_line_count = pNv->GART->size / line_len; /* Max amount of data we can DMA at once */ if (!nouveau_exa_pixmap_is_tiled(pdpix)) { linear = 1; *************** *** 181,203 **** dst_offset += (y * dst_pitch) + (x * cpp); } while (h) { int line_count, i; char *dst; ! /* Determine max amount of data we can DMA at once */ ! if (h * line_len <= pNv->GART->size) { ! line_count = h; ! } else { ! line_count = pNv->GART->size / line_len; ! if (line_count > h) ! line_count = h; } - /* HW limitations */ - if (line_count > 2047) - line_count = 2047; - /* Upload to GART */ if (nouveau_bo_map(pNv->GART, NOUVEAU_BO_WR)) return FALSE; --- 181,200 ---- dst_offset += (y * dst_pitch) + (x * cpp); } + /* Hardware limit */ + if (max_line_count > 2047) { + max_line_count = 2047; + } + while (h) { int line_count, i; char *dst; ! line_count = h; ! if(line_count > max_line_count) { ! line_count = max_line_count; } /* Upload to GART */ if (nouveau_bo_map(pNv->GART, NOUVEAU_BO_WR)) return FALSE;