How to speed up memory copying within RAM?
Posted: Sat Sep 03, 2016 10:58 pm
I am not talking about optimizations(done already), I need some hardware solution for speeding up this process. I was making a Windowing system ( :/ ) And a double buffering process for it (VESA). Now because the buffers are large enough (mbs depending on video mode), I need a faster way of doing it. Offcourse I have made an algorithm to decrease the buffer copied by making it copy only those pixels which have changed by making a small rectangular buffer around it such that only that buffer is copied, rest all remains same.
(Body of dbuff process).
And whenever any process wants to change any pixel, it notifies about change->
This has increased the speed of double buffering several times but still, it has to copy several pixels if several pixels change. I want to ask that is there some DMA type thing which can copy all the buffer in one go or would i have to make graphics card drivers to automate the dbuff thing?
[NOTE: I am a newbie, a stupid @$$, dont get angry on my silly doubts/reasons]
(Body of dbuff process).
Code: Select all
offset = (cx0*dv + (cy0*dv*widthVESA))/4;
cx0/=2;
cx1/=2;
sp = (uint_fast32_t*) buff + offset;
dp = (uint_fast32_t*) vga_mem + offset;
mp = (uint_fast32_t*) mouse_buff + offset;
for(uint32_t _i = cy0; _i < cy1; _i++)
{
for(uint32_t _j = cx0; _j < cx1; _j++)
{
*dp++ = *sp++*!*mp + *mp++;
}
dp += 512 - (cx1-cx0);
sp += 512 - (cx1-cx0);
mp += 512 - (cx1-cx0);
}
cx0 = 512;
cx1 = 512;
cy0 = 384;
cy1 = 384;
Code: Select all
inline void refresh_area(int x0, int y0, int x1, int y1)
{
cx0 = MIN(cx0,x0);
cx1 = MAX(cx1,x1);
cy0 = MIN(cy0,y0);
cy1 = MAX(cy1,y1);
}
[NOTE: I am a newbie, a stupid @$$, dont get angry on my silly doubts/reasons]