diff options
author | Michel Daenzer <michel@daenzer.net> | 2003-02-06 18:20:00 +0000 |
---|---|---|
committer | Michel Daenzer <michel@daenzer.net> | 2003-02-06 18:20:00 +0000 |
commit | fac2ed4d10e4d8283f818989df5d5722a447aac4 (patch) | |
tree | dc6d4441d7db9415ff609e18fccd5aed405aac28 | |
parent | b88cc5da26cf1478e425a6398456b52e27f53626 (diff) |
fix EAGAIN handling in radeon_cp_dispatch_texture() (fixes corruption of
large textures), and get rid of superfluous local y variable
-rw-r--r-- | shared-core/radeon_state.c | 16 | ||||
-rw-r--r-- | shared/radeon_state.c | 16 |
2 files changed, 14 insertions, 18 deletions
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 diff --git a/shared/radeon_state.c b/shared/radeon_state.c index 4211b233..d9bc948c 100644 --- a/shared/radeon_state.c +++ b/shared/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 |