summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Dergachev <volodya@mindspring.com>2004-12-12 20:42:29 +0000
committerVladimir Dergachev <volodya@mindspring.com>2004-12-12 20:42:29 +0000
commit8c1969f22fba2e1c9ed34d5ca77bee3a9f577640 (patch)
tree277a2dff6797e115007ee7993200049563f343ef
parent8a9077bc70fd800983f138a224b95301992a2296 (diff)
Modified:
programs/Xserver/hw/xfree86/drivers/ati/radeon_render.c programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c Make DMA blitting code more robust.
-rw-r--r--src/radeon_accel.c4
-rw-r--r--src/radeon_render.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/src/radeon_accel.c b/src/radeon_accel.c
index 028f272..ac42257 100644
--- a/src/radeon_accel.c
+++ b/src/radeon_accel.c
@@ -712,6 +712,10 @@ RADEONHostDataBlitCopyPass(
unsigned int dstPitch,
unsigned int srcPitch
){
+
+ /* RADEONHostDataBlitCopy can return NULL ! */
+ if( (dst==NULL) || (src==NULL)) return;
+
if ( dstPitch == srcPitch )
{
memcpy( dst, src, hpass * dstPitch );
diff --git a/src/radeon_render.c b/src/radeon_render.c
index 29ef966..e5715fb 100644
--- a/src/radeon_render.c
+++ b/src/radeon_render.c
@@ -425,6 +425,7 @@ static Bool FUNC_NAME(R100SetupTexture)(
#ifdef ACCEL_CP
CARD32 buf_pitch;
unsigned int hpass;
+ CARD8 *tmp_dst;
#endif
ACCEL_PREAMBLE();
@@ -469,10 +470,10 @@ static Bool FUNC_NAME(R100SetupTexture)(
while ( height )
{
- RADEONHostDataBlitCopyPass( RADEONHostDataBlit( pScrn, tex_bytepp, width,
+ tmp_dst = RADEONHostDataBlit( pScrn, tex_bytepp, width,
dst_pitch, &buf_pitch,
- &dst, &height, &hpass ),
- src, hpass, buf_pitch, src_pitch );
+ &dst, &height, &hpass );
+ RADEONHostDataBlitCopyPass( tmp_dst, src, hpass, buf_pitch, src_pitch );
src += hpass * src_pitch;
}
@@ -743,6 +744,7 @@ static Bool FUNC_NAME(R200SetupTexture)(
#ifdef ACCEL_CP
CARD32 buf_pitch;
unsigned int hpass;
+ CARD8 *tmp_dst;
#endif
ACCEL_PREAMBLE();
@@ -787,10 +789,10 @@ static Bool FUNC_NAME(R200SetupTexture)(
while ( height )
{
- RADEONHostDataBlitCopyPass( RADEONHostDataBlit( pScrn, tex_bytepp, width,
+ tmp_dst = RADEONHostDataBlit( pScrn, tex_bytepp, width,
dst_pitch, &buf_pitch,
- &dst, &height, &hpass ),
- src, hpass, buf_pitch, src_pitch );
+ &dst, &height, &hpass );
+ RADEONHostDataBlitCopyPass( tmp_dst, src, hpass, buf_pitch, src_pitch );
src += hpass * src_pitch;
}