From e192ddc2d4e15611c34e755c276476b9804c3a84 Mon Sep 17 00:00:00 2001 From: glevand Date: Sun, 30 Sep 2012 10:16:54 -0800 Subject: [PATCH] optimize Ps3GpuTransferData, RSX is capable to transfer 2047 lines at once --- src/ps3gpu_accel.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/ps3gpu_accel.c b/src/ps3gpu_accel.c index 7701fd5..ec9841b 100644 --- a/src/ps3gpu_accel.c +++ b/src/ps3gpu_accel.c @@ -190,11 +190,12 @@ Ps3GpuContextInit(ScrnInfoPtr pScrn) static inline Bool Ps3GpuTransferData(ScrnInfoPtr pScrn, int mode, - CARD32 dst_offset, CARD32 dst_pitch, CARD32 src_offset, CARD32 src_pitch, + CARD32 dst_offset, INT32 dst_pitch, CARD32 src_offset, INT32 src_pitch, CARD32 row_length, CARD32 row_count) { Ps3GpuPtr gPtr = PS3GPUPTR(pScrn); CARD32 src, dst; + CARD32 h; if (row_length == 0 || row_count == 0) return (TRUE); @@ -225,20 +226,25 @@ Ps3GpuTransferData(ScrnInfoPtr pScrn, int mode, Ps3GpuFifoPut(pScrn, src); Ps3GpuFifoPut(pScrn, dst); - while (row_count--) { + while (row_count) { + h = row_count; + if (h > 2047) + h = 2047; + Ps3GpuFifoReserveSpace(pScrn, 9); Ps3GpuFifoPut(pScrn, 0x0020230c); Ps3GpuFifoPut(pScrn, src_offset); Ps3GpuFifoPut(pScrn, dst_offset); - Ps3GpuFifoPut(pScrn, 0x00000000); - Ps3GpuFifoPut(pScrn, 0x00000000); + Ps3GpuFifoPut(pScrn, src_pitch); + Ps3GpuFifoPut(pScrn, dst_pitch); Ps3GpuFifoPut(pScrn, row_length); - Ps3GpuFifoPut(pScrn, 0x00000001); + Ps3GpuFifoPut(pScrn, h); Ps3GpuFifoPut(pScrn, 0x00000101); Ps3GpuFifoPut(pScrn, 0x00000000); - src_offset += src_pitch; - dst_offset += dst_pitch; + src_offset += h * src_pitch; + dst_offset += h * dst_pitch; + row_count -= h; } Ps3GpuFifoKick(pScrn); -- 2.11.4.GIT