fb_generic: remove unused VT switching / restoring code

This commit is contained in:
Stefan Seyfried
2017-02-09 00:01:08 +01:00
committed by M. Liebmann
parent b04b1d7f8c
commit d498917594
2 changed files with 1 additions and 108 deletions

View File

@@ -160,8 +160,6 @@ void CFrameBuffer::init(const char * const fbDevice)
goto nolfb; goto nolfb;
} }
memmove(&oldscreen, &screeninfo, sizeof(screeninfo));
if (ioctl(fd, FBIOGET_FSCREENINFO, &fix)<0) { if (ioctl(fd, FBIOGET_FSCREENINFO, &fix)<0) {
perror("FBIOGET_FSCREENINFO"); perror("FBIOGET_FSCREENINFO");
goto nolfb; goto nolfb;
@@ -201,52 +199,6 @@ void CFrameBuffer::init(const char * const fbDevice)
useBackground(false); useBackground(false);
m_transparent = m_transparent_default; m_transparent = m_transparent_default;
#if 0
if ((tty=open("/dev/vc/0", O_RDWR))<0) {
perror("open (tty)");
goto nolfb;
}
struct sigaction act;
memset(&act,0,sizeof(act));
act.sa_handler = switch_signal;
sigemptyset(&act.sa_mask);
sigaction(SIGUSR1,&act,NULL);
sigaction(SIGUSR2,&act,NULL);
struct vt_mode mode;
if (-1 == ioctl(tty,KDGETMODE, &kd_mode)) {
perror("ioctl KDGETMODE");
goto nolfb;
}
if (-1 == ioctl(tty,VT_GETMODE, &vt_mode)) {
perror("ioctl VT_GETMODE");
goto nolfb;
}
if (-1 == ioctl(tty,VT_GETMODE, &mode)) {
perror("ioctl VT_GETMODE");
goto nolfb;
}
mode.mode = VT_PROCESS;
mode.waitv = 0;
mode.relsig = SIGUSR1;
mode.acqsig = SIGUSR2;
if (-1 == ioctl(tty,VT_SETMODE, &mode)) {
perror("ioctl VT_SETMODE");
goto nolfb;
}
if (-1 == ioctl(tty,KDSETMODE, KD_GRAPHICS)) {
perror("ioctl KDSETMODE");
goto nolfb;
}
#endif
return; return;
@@ -281,13 +233,6 @@ CFrameBuffer::~CFrameBuffer()
q_circle = NULL; q_circle = NULL;
} }
#if 0
if (-1 == ioctl(tty,VT_SETMODE, &vt_mode))
perror("ioctl VT_SETMODE");
if (available)
ioctl(fd, FBIOPUT_VSCREENINFO, &oldscreen);
#endif
if (lfb) if (lfb)
munmap(lfb, available); munmap(lfb, available);
@@ -384,31 +329,6 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign
if (!available&&!active) if (!available&&!active)
return -1; return -1;
#if 0
screeninfo.xres_virtual=screeninfo.xres=nxRes;
screeninfo.yres_virtual=screeninfo.yres=nyRes;
screeninfo.height=0;
screeninfo.width=0;
screeninfo.xoffset=screeninfo.yoffset=0;
screeninfo.bits_per_pixel=nbpp;
if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) {
perror("FBIOPUT_VSCREENINFO");
}
if(1) {
printf("SetMode: %dbits, red %d:%d green %d:%d blue %d:%d transp %d:%d\n",
screeninfo.bits_per_pixel, screeninfo.red.length, screeninfo.red.offset, screeninfo.green.length, screeninfo.green.offset, screeninfo.blue.length, screeninfo.blue.offset, screeninfo.transp.length, screeninfo.transp.offset);
}
if ((screeninfo.xres!=nxRes) && (screeninfo.yres!=nyRes) && (screeninfo.bits_per_pixel!=nbpp))
{
printf("SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n",
nxRes, nyRes, nbpp,
screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel);
return -1;
}
#endif
xRes = screeninfo.xres; xRes = screeninfo.xres;
yRes = screeninfo.yres; yRes = screeninfo.yres;
bpp = screeninfo.bits_per_pixel; bpp = screeninfo.bits_per_pixel;
@@ -1557,33 +1477,6 @@ void CFrameBuffer::RestoreScreen(int x, int y, int dx, int dy, fb_pixel_t * cons
mark(x, y, x + dx, y + dy); mark(x, y, x + dx, y + dy);
checkFbArea(x, y, dx, dy, false); checkFbArea(x, y, dx, dy, false);
} }
#if 0
//never used
void CFrameBuffer::switch_signal (int signal)
{
CFrameBuffer * thiz = CFrameBuffer::getInstance();
if (signal == SIGUSR1) {
if (virtual_fb != NULL)
delete[] virtual_fb;
virtual_fb = new uint8_t[thiz->stride * thiz->yRes];
thiz->active = false;
if (virtual_fb != NULL)
memmove(virtual_fb, thiz->lfb, thiz->stride * thiz->yRes);
ioctl(thiz->tty, VT_RELDISP, 1);
printf ("release display\n");
}
else if (signal == SIGUSR2) {
ioctl(thiz->tty, VT_RELDISP, VT_ACKACQ);
thiz->active = true;
printf ("acquire display\n");
thiz->paletteSet(NULL);
if (virtual_fb != NULL)
memmove(thiz->lfb, virtual_fb, thiz->stride * thiz->yRes);
else
memset(thiz->lfb, 0, thiz->stride * thiz->yRes);
}
}
#endif
void CFrameBuffer::Clear() void CFrameBuffer::Clear()
{ {

View File

@@ -113,7 +113,7 @@ class CFrameBuffer : public sigc::trackable
std::string backgroundFilename; std::string backgroundFilename;
bool useBackgroundPaint; bool useBackgroundPaint;
unsigned int xRes, yRes, stride, bpp; unsigned int xRes, yRes, stride, bpp;
t_fb_var_screeninfo screeninfo, oldscreen; t_fb_var_screeninfo screeninfo;
fb_cmap cmap; fb_cmap cmap;
__u16 red[256], green[256], blue[256], trans[256]; __u16 red[256], green[256], blue[256], trans[256];