summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Spliet <r.spliet@student.tudelft.nl>2010-08-07 20:59:06 +0200
committerMaarten Maathuis <madman2003@gmail.com>2010-08-07 21:54:37 +0200
commit1cb6c91a9afe88d73f8a1180b00f56a9150a16ed (patch)
treea6df4ee2b1e64f8cc00049981be41ab04df80dc0
parent9f50b62229d5984ee5c16bc54953c7f8e2d5e575 (diff)
downloadxorg-driver-xf86-video-nouveau-1cb6c91a9afe88d73f8a1180b00f56a9150a16ed.tar.gz
nouveau_exa.c: move line_count logic out of UTS/DFS loop
Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl> Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
-rw-r--r--src/nouveau_exa.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
index 80d0338..3b2c9be 100644
--- a/src/nouveau_exa.c
+++ b/src/nouveau_exa.c
@@ -52,6 +52,8 @@ NVAccelDownloadM2MF(PixmapPtr pspix, int x, int y, int w, int h,
unsigned cpp = pspix->drawable.bitsPerPixel / 8;
unsigned line_len = w * cpp;
unsigned src_offset = 0, src_pitch = 0, linear = 0;
+ /* Maximum DMA transfer */
+ unsigned line_count = pNv->GART->size / line_len;
if (!nv50_style_tiled_pixmap(pspix)) {
linear = 1;
@@ -59,21 +61,16 @@ NVAccelDownloadM2MF(PixmapPtr pspix, int x, int y, int w, int h,
src_offset += (y * src_pitch) + (x * cpp);
}
+ /* HW limitations */
+ if (line_count > 2047)
+ line_count = 2047;
+
while (h) {
- int line_count, i;
+ int i;
char *src;
- if (h * line_len <= pNv->GART->size) {
+ if (line_count > h)
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;
@@ -169,6 +166,8 @@ NVAccelUploadM2MF(PixmapPtr pdpix, int x, int y, int w, int h,
unsigned cpp = pdpix->drawable.bitsPerPixel / 8;
unsigned line_len = w * cpp;
unsigned dst_offset = 0, dst_pitch = 0, linear = 0;
+ /* Maximum DMA transfer */
+ unsigned line_count = pNv->GART->size / line_len;
if (!nv50_style_tiled_pixmap(pdpix)) {
linear = 1;
@@ -176,22 +175,16 @@ NVAccelUploadM2MF(PixmapPtr pdpix, int x, int y, int w, int h,
dst_offset += (y * dst_pitch) + (x * cpp);
}
+ /* HW limitations */
+ if (line_count > 2047)
+ line_count = 2047;
+
while (h) {
- int line_count, i;
+ int i;
char *dst;
- /* Determine max amount of data we can DMA at once */
- if (h * line_len <= pNv->GART->size) {
+ if (line_count > h)
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))