aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-12-10 23:25:32 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-12-10 23:25:32 +0000
commitf4f8f9a2775fa1794de6935756f30bf4d99f33e8 (patch)
tree561979821548c1365549303b79fe72ad9ac4e284 /lib
parentf943061914ca950bb4538c31d00c409c0a3fa869 (diff)
downloadenigma2-f4f8f9a2775fa1794de6935756f30bf4d99f33e8.tar.gz
enigma2-f4f8f9a2775fa1794de6935756f30bf4d99f33e8.zip
add support for manual blit
Diffstat (limited to 'lib')
-rw-r--r--lib/gdi/fb.cpp37
-rw-r--r--lib/gdi/fb.h6
-rw-r--r--lib/gdi/gfbdc.cpp3
-rw-r--r--lib/gdi/grc.cpp15
-rw-r--r--lib/gdi/grc.h2
-rw-r--r--lib/gui/ewidgetdesktop.cpp1
6 files changed, 49 insertions, 15 deletions
diff --git a/lib/gdi/fb.cpp b/lib/gdi/fb.cpp
index 5d895901..adf06a2c 100644
--- a/lib/gdi/fb.cpp
+++ b/lib/gdi/fb.cpp
@@ -13,6 +13,10 @@
#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
#endif
+#ifndef FBIO_BLIT
+#define FBIO_SET_MANUAL_BLIT _IOW('F', 0x21, __u8)
+#define FBIO_BLIT 0x22
+#endif
fbClass *fbClass::instance;
@@ -23,6 +27,7 @@ fbClass *fbClass::getInstance()
fbClass::fbClass(const char *fb)
{
+ m_manual_blit=0;
instance=this;
locked=0;
available=0;
@@ -39,6 +44,8 @@ fbClass::fbClass(const char *fb)
perror(fb);
goto nolfb;
}
+
+
if (ioctl(fd, FBIOGET_VSCREENINFO, &screeninfo)<0)
{
perror("FBIOGET_VSCREENINFO");
@@ -64,6 +71,8 @@ fbClass::fbClass(const char *fb)
}
showConsole(0);
+
+ enableManualBlit();
return;
nolfb:
lfb=0;
@@ -146,6 +155,14 @@ int fbClass::waitVSync()
return ioctl(fd, FBIO_WAITFORVSYNC, &c);
}
+void fbClass::blit()
+{
+ if (m_manual_blit) {
+ if (ioctl(fd, FBIO_BLIT) < 0)
+ perror("FBIO_BLIT");
+ }
+}
+
fbClass::~fbClass()
{
if (available)
@@ -153,6 +170,7 @@ fbClass::~fbClass()
if (lfb)
munmap(lfb, available);
showConsole(1);
+ disableManualBlit();
}
int fbClass::PutCMAP()
@@ -176,3 +194,22 @@ void fbClass::unlock()
SetMode(xRes, yRes, bpp);
PutCMAP();
}
+
+void fbClass::enableManualBlit()
+{
+ unsigned char tmp = 1;
+ if (ioctl(fd,FBIO_SET_MANUAL_BLIT, &tmp)<0)
+ perror("FBIO_SET_MANUAL_BLIT");
+ else
+ m_manual_blit = 1;
+}
+
+void fbClass::disableManualBlit()
+{
+ unsigned char tmp = 0;
+ if (ioctl(fd,FBIO_SET_MANUAL_BLIT, &tmp)<0)
+ perror("FBIO_SET_MANUAL_BLIT");
+ else
+ m_manual_blit = 0;
+}
+
diff --git a/lib/gdi/fb.h b/lib/gdi/fb.h
index c83e7571..2b0d95b5 100644
--- a/lib/gdi/fb.h
+++ b/lib/gdi/fb.h
@@ -14,7 +14,8 @@ class fbClass
__u16 red[256], green[256], blue[256], trans[256];
static fbClass *instance;
int locked;
-
+
+ int m_manual_blit;
int m_number_of_pages;
#ifdef SWIG
fbClass(const char *fb="/dev/fb/0");
@@ -23,6 +24,8 @@ public:
#else
public:
unsigned char *lfb;
+ void enableManualBlit();
+ void disableManualBlit();
int showConsole(int state);
int SetMode(unsigned int xRes, unsigned int yRes, unsigned int bpp);
int Available() { return available; }
@@ -31,6 +34,7 @@ public:
int setOffset(int off);
int waitVSync();
+ void blit();
unsigned int Stride() { return stride; }
fb_cmap *CMAP() { return &cmap; }
diff --git a/lib/gdi/gfbdc.cpp b/lib/gdi/gfbdc.cpp
index 75efe891..b6cbc9b0 100644
--- a/lib/gdi/gfbdc.cpp
+++ b/lib/gdi/gfbdc.cpp
@@ -134,6 +134,9 @@ void gFBDC::exec(gOpcode *o)
fb->waitVSync();
break;
}
+ case gOpcode::flush:
+ fb->blit();
+ break;
default:
gDC::exec(o);
break;
diff --git a/lib/gdi/grc.cpp b/lib/gdi/grc.cpp
index 76c02d2d..a46b218c 100644
--- a/lib/gdi/grc.cpp
+++ b/lib/gdi/grc.cpp
@@ -207,7 +207,8 @@ void gRC::enableSpinner()
o.opcode = m_spinner_enabled ? gOpcode::incrementSpinner : gOpcode::enableSpinner;
m_spinner_dc->exec(&o);
m_spinner_enabled = 1;
-
+ o.opcode = gOpcode::flush;
+ m_spinner_dc->exec(&o);
}
void gRC::disableSpinner()
@@ -226,6 +227,8 @@ void gRC::disableSpinner()
gOpcode o;
o.opcode = gOpcode::disableSpinner;
m_spinner_dc->exec(&o);
+ o.opcode = gOpcode::flush;
+ m_spinner_dc->exec(&o);
}
static int gPainter_instances;
@@ -520,16 +523,6 @@ void gPainter::clippop()
m_rc->submit(o);
}
-void gPainter::flush()
-{
- if ( m_dc->islocked() )
- return;
- gOpcode o;
- o.opcode = gOpcode::flush;
- o.dc = m_dc.grabRef();
- m_rc->submit(o);
-}
-
void gPainter::waitVSync()
{
if ( m_dc->islocked() )
diff --git a/lib/gdi/grc.h b/lib/gdi/grc.h
index 555f2ffb..84f8ad6c 100644
--- a/lib/gdi/grc.h
+++ b/lib/gdi/grc.h
@@ -249,8 +249,6 @@ public:
void clip(const gRegion &clip);
void clippop();
- void flush();
-
void waitVSync();
void flip();
void notify();
diff --git a/lib/gui/ewidgetdesktop.cpp b/lib/gui/ewidgetdesktop.cpp
index 9e483083..78c9fbcf 100644
--- a/lib/gui/ewidgetdesktop.cpp
+++ b/lib/gui/ewidgetdesktop.cpp
@@ -227,7 +227,6 @@ void eWidgetDesktop::paintBackground(eWidgetDesktopCompBuffer *comp)
painter.resetClip(comp->m_dirty_region);
painter.setBackgroundColor(comp->m_background_color);
painter.clear();
- painter.flush();
comp->m_dirty_region = gRegion();
}