From fac2ed4d10e4d8283f818989df5d5722a447aac4 Mon Sep 17 00:00:00 2001 From: Michel Daenzer Date: Thu, 6 Feb 2003 18:20:00 +0000 Subject: fix EAGAIN handling in radeon_cp_dispatch_texture() (fixes corruption of large textures), and get rid of superfluous local y variable --- shared-core/radeon_state.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'shared-core/radeon_state.c') diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c index 4211b233..d9bc948c 100644 --- a/shared-core/radeon_state.c +++ b/shared-core/radeon_state.c @@ -1073,7 +1073,7 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev, u32 *buffer; const u8 *data; int size, dwords, tex_width, blit_width; - u32 y, height; + u32 height; int i; RING_LOCALS; @@ -1138,10 +1138,9 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev, tex->offset >> 10, tex->pitch, tex->format, image->x, image->y, image->width, image->height ); - /* Make a copy of the parameters in case we have to + /* Make a copy of some parameters in case we have to * update them for a multi-pass texture blit. */ - y = image->y; height = image->height; data = (const u8 *)image->data; @@ -1156,11 +1155,6 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev, return 0; } - /* Update the input parameters for next time */ - image->y += height; - image->height -= height; - image->data = (const u8 *)image->data + size; - buf = radeon_freelist_get( dev ); if ( 0 && !buf ) { radeon_do_cp_idle( dev_priv ); @@ -1190,7 +1184,7 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev, buffer[2] = (tex->pitch << 22) | (tex->offset >> 10); buffer[3] = 0xffffffff; buffer[4] = 0xffffffff; - buffer[5] = (y << 16) | image->x; + buffer[5] = (image->y << 16) | image->x; buffer[6] = (height << 16) | image->width; buffer[7] = dwords; buffer += 8; @@ -1227,6 +1221,10 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev, radeon_cp_dispatch_indirect( dev, buf, 0, buf->used ); radeon_cp_discard_buffer( dev, buf ); + /* Update the input parameters for next time */ + image->y += height; + image->height -= height; + (const u8 *)image->data += size; } while (image->height > 0); /* Flush the pixel cache after the blit completes. This ensures -- cgit v1.2.3