fb_generic: add pointer for double-buffered fb

This commit is contained in:
Stefan Seyfried
2017-02-05 18:04:15 +01:00
committed by M. Liebmann
parent 3f63080454
commit 9ba84a629a
2 changed files with 4 additions and 3 deletions

View File

@@ -153,7 +153,7 @@ void CFrameBuffer::init(const char * const fbDevice)
available=fix.smem_len; available=fix.smem_len;
printf("%dk video mem\n", available/1024); printf("%dk video mem\n", available/1024);
lfb=(fb_pixel_t*)mmap(0, available, PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0); lbb = lfb = (fb_pixel_t*)mmap(0, available, PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0);
if (!lfb) { if (!lfb) {
perror("mmap"); perror("mmap");
@@ -237,7 +237,7 @@ void CFrameBuffer::init(const char * const fbDevice)
nolfb: nolfb:
printf("framebuffer not available.\n"); printf("framebuffer not available.\n");
lfb=0; lbb = lfb = NULL;
} }
@@ -338,7 +338,7 @@ unsigned int CFrameBuffer::getScreenY()
fb_pixel_t * CFrameBuffer::getFrameBufferPointer() const fb_pixel_t * CFrameBuffer::getFrameBufferPointer() const
{ {
if (active || (virtual_fb == NULL)) if (active || (virtual_fb == NULL))
return lfb; return lbb;
else else
return (fb_pixel_t *) virtual_fb; return (fb_pixel_t *) virtual_fb;
} }

View File

@@ -105,6 +105,7 @@ class CFrameBuffer : public sigc::trackable
int fd, tty; int fd, tty;
fb_pixel_t * lfb; fb_pixel_t * lfb;
fb_pixel_t * lbb;
int available; int available;
fb_pixel_t * background; fb_pixel_t * background;
fb_pixel_t * backupBackground; fb_pixel_t * backupBackground;