hi,
i have attached piece of code from sa2video.cpp(ie display driver on
x-scale)

my question is:
what is the advantages of using two buffers( virtual frame buffer
and physical frame buffer) in the display driver?


thanks and regards
sharath


piece of code from sa2video.cpp
----------------------------------------------------------------------------
if(!gUseDispDrvrPhysicalFrameBuffer)
{
// The GPE will allocate a virtual frame buffer and draw to that.
// The driver will copy this virtual frame buffer to the physical
frame buffer
// using the dirty rectangle algorithm.
#ifdef DD_ENABLE
PVOID pMem = VirtualAlloc(NULL, 1024*1024*2, MEM_RESERVE,
PAGE_NOACCESS);
pMem = VirtualAlloc(pMem, m_nScreenWidth * m_nScreenHeight * (bpp ==
8 ? 1 : 2 ), MEM_COMMIT, PAGE_READWRITE);
m_pPrimarySurface = new
DDGPESurf(m_nScreenWidth,m_nScreenHeight,pMem,m_nScreenWidth * (bpp ==
8 ? 1 : 2),m_pMode->format);
#else
m_pPrimarySurface = new
GPESurf(m_nScreenWidth,m_nScreenHeight,m_pMode->format);
#endif
// Clear the video memory
memset(m_pPrimarySurface->Buffer(),0,m_pPrimarySurface->Height()*m_pPrimarySurface->Width());
DispDrvrSetDibBuffer(m_pPrimarySurface->Buffer());
gDibBufferWidth = m_pPrimarySurface->Width();
gDibBufferHeight = m_pPrimarySurface->Height();
} else
{
// The GPE will draw directly to the physical frame buffer.
m_pVirtualFrameBuffer = gFrameBuffer;
// Init the frame buffer to color pattern -
#ifdef DD_ENABLE
m_pPrimarySurface = new
DDGPESurf(m_nScreenWidth,m_nScreenHeight,m_pVirtualFrameBuffer,
DispDrvr_cdwStride *
4,m_pMode->format);
#else
m_pPrimarySurface = new
GPESurf(m_nScreenWidth,m_nScreenHeight,m_pVirtualFrameBuffer,
DispDrvr_cdwStride * 4,m_pMode->format);
#endif
}

-------------------------------------------------------------------------------