aboutsummaryrefslogtreecommitdiff
path: root/lib/gdi/gfbdc.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-08-31 14:19:02 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-08-31 14:19:02 +0000
commit9bc92cbd0be7b1973960e88808feaca26a00aecd (patch)
treef130433372ad4bb83c60b1bcfaba63e4f311dd28 /lib/gdi/gfbdc.cpp
parentc692d6151aa59eb1823e131c6f97e51659c87ee8 (diff)
downloadenigma2-9bc92cbd0be7b1973960e88808feaca26a00aecd.tar.gz
enigma2-9bc92cbd0be7b1973960e88808feaca26a00aecd.zip
- fix when not enough framebuffer memory available
Diffstat (limited to 'lib/gdi/gfbdc.cpp')
-rw-r--r--lib/gdi/gfbdc.cpp37
1 files changed, 22 insertions, 15 deletions
diff --git a/lib/gdi/gfbdc.cpp b/lib/gdi/gfbdc.cpp
index a1f4c981..ee2227cf 100644
--- a/lib/gdi/gfbdc.cpp
+++ b/lib/gdi/gfbdc.cpp
@@ -34,20 +34,24 @@ gFBDC::gFBDC()
surface.data_phys = 50*1024*1024; // FIXME
- surface_back.type = 0;
- surface_back.x = 720;
- surface_back.y = 576;
- surface_back.bpp = 32;
- surface_back.bypp = 4;
- surface_back.stride = fb->Stride();
- surface_back.offset = surface.y;
-
int fb_size = surface.stride * surface.y;
- surface_back.data = fb->lfb + fb_size;
- surface_back.data_phys = surface.data_phys + fb_size;
+ if (fb->getNumPages() > 1)
+ {
+ m_enable_double_buffering = 1;
+ surface_back.type = 0;
+ surface_back.x = 720;
+ surface_back.y = 576;
+ surface_back.bpp = 32;
+ surface_back.bypp = 4;
+ surface_back.stride = fb->Stride();
+ surface_back.offset = surface.y;
+ surface_back.data = fb->lfb + fb_size;
+ surface_back.data_phys = surface.data_phys + fb_size;
- fb_size *= 2;
+ fb_size *= 2;
+ } else
+ m_enable_double_buffering = 0;
eDebug("%dkB available for acceleration surfaces.", (fb->Available() - fb_size)/1024);
@@ -139,11 +143,14 @@ void gFBDC::exec(gOpcode *o)
}
case gOpcode::flip:
{
- gSurface s(surface);
- surface = surface_back;
- surface_back = s;
+ if (m_enable_double_buffering)
+ {
+ gSurface s(surface);
+ surface = surface_back;
+ surface_back = s;
- fb->setOffset(surface_back.offset);
+ fb->setOffset(surface_back.offset);
+ }
break;
}
case gOpcode::waitVSync: