mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-17 10:23:37 +02:00
Merge branch 'ni/tuxbox' into ni/mp/tuxbox
Origin commit data
------------------
Branch: ni/coolstream
Commit: 4f68a5502b
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-02-10 (Fri, 10 Feb 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -59,6 +59,7 @@ endif
|
|||||||
|
|
||||||
if BOXTYPE_TRIPLE
|
if BOXTYPE_TRIPLE
|
||||||
libneutrino_driver_a_SOURCES += \
|
libneutrino_driver_a_SOURCES += \
|
||||||
|
fb_accel_td.cpp \
|
||||||
newclock.cpp \
|
newclock.cpp \
|
||||||
lcdd.cpp
|
lcdd.cpp
|
||||||
endif
|
endif
|
||||||
|
@@ -150,4 +150,25 @@ class CFbAccelGLFB
|
|||||||
fb_pixel_t * getBackBufferPointer() const;
|
fb_pixel_t * getBackBufferPointer() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CFbAccelTD
|
||||||
|
: public CFbAccel
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
fb_pixel_t lastcol;
|
||||||
|
void setColor(fb_pixel_t col);
|
||||||
|
fb_pixel_t *backbuffer;
|
||||||
|
public:
|
||||||
|
CFbAccelTD();
|
||||||
|
~CFbAccelTD();
|
||||||
|
void init(const char * const);
|
||||||
|
int setMode(unsigned int xRes, unsigned int yRes, unsigned int bpp);
|
||||||
|
void paintPixel(int x, int y, const fb_pixel_t col);
|
||||||
|
void paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col);
|
||||||
|
void paintHLineRel(int x, int dx, int y, const fb_pixel_t col) { paintLine(x, y, x + dx, y, col); };
|
||||||
|
void paintVLineRel(int x, int y, int dy, const fb_pixel_t col) { paintLine(x, y, x, y + dy, col); };
|
||||||
|
void paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col);
|
||||||
|
void blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp);
|
||||||
|
void waitForIdle(const char *func = NULL);
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -150,10 +150,6 @@ CFbAccelCSHD1::~CFbAccelCSHD1()
|
|||||||
munmap((void *)gxa_base, 0x40000);
|
munmap((void *)gxa_base, 0x40000);
|
||||||
if (devmem_fd != -1)
|
if (devmem_fd != -1)
|
||||||
close(devmem_fd);
|
close(devmem_fd);
|
||||||
if (lfb)
|
|
||||||
munmap(lfb, available);
|
|
||||||
if (fd > -1)
|
|
||||||
close(fd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFbAccelCSHD1::setColor(fb_pixel_t col)
|
void CFbAccelCSHD1::setColor(fb_pixel_t col)
|
||||||
@@ -344,7 +340,7 @@ int CFbAccelCSHD1::setMode(unsigned int, unsigned int, unsigned int)
|
|||||||
xRes = screeninfo.xres;
|
xRes = screeninfo.xres;
|
||||||
yRes = screeninfo.yres;
|
yRes = screeninfo.yres;
|
||||||
bpp = screeninfo.bits_per_pixel;
|
bpp = screeninfo.bits_per_pixel;
|
||||||
printf(LOGTAG "%dx%dx%d line length %d. using hd1 graphics accelerator.\n", xRes, yRes, bpp, stride);
|
printf(LOGTAG "%dx%dx%d line length %d. using %s graphics accelerator.\n", xRes, yRes, bpp, stride, _fix.id);
|
||||||
int needmem = stride * yRes * 2;
|
int needmem = stride * yRes * 2;
|
||||||
if (available >= needmem)
|
if (available >= needmem)
|
||||||
{
|
{
|
||||||
|
176
src/driver/fb_accel_td.cpp
Normal file
176
src/driver/fb_accel_td.cpp
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
/*
|
||||||
|
Framebuffer acceleration hardware abstraction functions.
|
||||||
|
The hardware dependent framebuffer acceleration functions for the
|
||||||
|
TripleDragon are represented in this class using DirectFB.
|
||||||
|
|
||||||
|
License: GPL
|
||||||
|
|
||||||
|
(C) 2017 Stefan Seyfried
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <driver/fb_generic.h>
|
||||||
|
#include <driver/fb_accel.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <memory.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <system/set_threadname.h>
|
||||||
|
#include <gui/color.h>
|
||||||
|
|
||||||
|
#define LOGTAG "[fb_accel_td] "
|
||||||
|
|
||||||
|
#include <directfb.h>
|
||||||
|
#include <tdgfx/stb04gfx.h>
|
||||||
|
extern IDirectFB *dfb;
|
||||||
|
extern IDirectFBSurface *dfbdest;
|
||||||
|
extern int gfxfd;
|
||||||
|
void CFbAccelTD::waitForIdle(const char *)
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
struct timeval ts, te;
|
||||||
|
gettimeofday(&ts, NULL);
|
||||||
|
#endif
|
||||||
|
/* does not work: DFBResult r = dfb->WaitForSync(dfb); */
|
||||||
|
ioctl(gfxfd, STB04GFX_ENGINE_SYNC);
|
||||||
|
#if 0
|
||||||
|
gettimeofday(&te, NULL);
|
||||||
|
printf("STB04GFX_ENGINE_SYNC took %lld us\n", (te.tv_sec * 1000000LL + te.tv_usec) - (ts.tv_sec * 1000000LL + ts.tv_usec));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
CFbAccelTD::CFbAccelTD()
|
||||||
|
{
|
||||||
|
fb_name = "TripleDragon framebuffer";
|
||||||
|
lastcol = 0xffffffff;
|
||||||
|
lbb = lfb; /* the memory area to draw to... */
|
||||||
|
};
|
||||||
|
|
||||||
|
CFbAccelTD::~CFbAccelTD()
|
||||||
|
{
|
||||||
|
if (lfb)
|
||||||
|
munmap(lfb, available);
|
||||||
|
if (fd > -1)
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFbAccelTD::setColor(fb_pixel_t col)
|
||||||
|
{
|
||||||
|
if (col == lastcol)
|
||||||
|
return;
|
||||||
|
char *c = (char *)&col;
|
||||||
|
dfbdest->SetColor(dfbdest, c[1], c[2], c[3], c[0]);
|
||||||
|
lastcol = col;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFbAccelTD::paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col)
|
||||||
|
{
|
||||||
|
setColor(col);
|
||||||
|
dfbdest->FillRectangle(dfbdest, x, y, dx, dy);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFbAccelTD::paintPixel(const int x, const int y, const fb_pixel_t col)
|
||||||
|
{
|
||||||
|
setColor(col);
|
||||||
|
dfbdest->DrawLine(dfbdest, x, y, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFbAccelTD::paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col)
|
||||||
|
{
|
||||||
|
setColor(col);
|
||||||
|
dfbdest->DrawLine(dfbdest, xa, ya, xb, yb);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFbAccelTD::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp)
|
||||||
|
{
|
||||||
|
DFBRectangle src;
|
||||||
|
DFBResult err;
|
||||||
|
IDirectFBSurface *surf;
|
||||||
|
DFBSurfaceDescription dsc;
|
||||||
|
|
||||||
|
src.x = xp;
|
||||||
|
src.y = yp;
|
||||||
|
src.w = width - xp;
|
||||||
|
src.h = height - yp;
|
||||||
|
|
||||||
|
dsc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PREALLOCATED);
|
||||||
|
dsc.caps = DSCAPS_NONE;
|
||||||
|
dsc.width = width;
|
||||||
|
dsc.height = height;
|
||||||
|
dsc.preallocated[0].data = fbbuff;
|
||||||
|
dsc.preallocated[0].pitch = width * sizeof(fb_pixel_t);
|
||||||
|
err = dfb->CreateSurface(dfb, &dsc, &surf);
|
||||||
|
/* TODO: maybe we should not die if this fails? */
|
||||||
|
if (err != DFB_OK) {
|
||||||
|
fprintf(stderr, LOGTAG "blit2FB: ");
|
||||||
|
DirectFBErrorFatal("dfb->CreateSurface(dfb, &dsc, &surf)", err);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transp)
|
||||||
|
{
|
||||||
|
surf->SetSrcColorKey(surf, 0, 0, 0);
|
||||||
|
dfbdest->SetBlittingFlags(dfbdest, DSBLIT_SRC_COLORKEY);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dfbdest->SetBlittingFlags(dfbdest, DSBLIT_BLEND_ALPHACHANNEL);
|
||||||
|
|
||||||
|
dfbdest->Blit(dfbdest, surf, &src, xoff, yoff);
|
||||||
|
surf->Release(surf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFbAccelTD::init(const char *)
|
||||||
|
{
|
||||||
|
CFrameBuffer::init();
|
||||||
|
if (lfb == NULL) {
|
||||||
|
printf(LOGTAG "CFrameBuffer::init() failed.\n");
|
||||||
|
return; /* too bad... */
|
||||||
|
}
|
||||||
|
available = fix.smem_len;
|
||||||
|
printf(LOGTAG "%dk video mem\n", available / 1024);
|
||||||
|
memset(lfb, 0, available);
|
||||||
|
|
||||||
|
lbb = lfb; /* the memory area to draw to... */
|
||||||
|
available = fix.smem_len;
|
||||||
|
stride = fix.line_length;
|
||||||
|
xRes = screeninfo.xres;
|
||||||
|
yRes = screeninfo.yres;
|
||||||
|
bpp = screeninfo.bits_per_pixel;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* wrong name... */
|
||||||
|
int CFbAccelTD::setMode(unsigned int, unsigned int, unsigned int)
|
||||||
|
{
|
||||||
|
int needmem = stride * yRes * 2;
|
||||||
|
if (available >= needmem)
|
||||||
|
{
|
||||||
|
backbuffer = lfb + stride / sizeof(fb_pixel_t) * yRes;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
fprintf(stderr, LOGTAG " not enough FB memory (have %d, need %d)\n", available, needmem);
|
||||||
|
backbuffer = lfb; /* will not work well, but avoid crashes */
|
||||||
|
return 0;
|
||||||
|
}
|
@@ -133,6 +133,9 @@ CFrameBuffer* CFrameBuffer::getInstance()
|
|||||||
#endif
|
#endif
|
||||||
#if HAVE_GENERIC_HARDWARE
|
#if HAVE_GENERIC_HARDWARE
|
||||||
frameBuffer = new CFbAccelGLFB();
|
frameBuffer = new CFbAccelGLFB();
|
||||||
|
#endif
|
||||||
|
#if HAVE_TRIPLEDRAGON
|
||||||
|
frameBuffer = new CFbAccelTD();
|
||||||
#endif
|
#endif
|
||||||
if (!frameBuffer)
|
if (!frameBuffer)
|
||||||
frameBuffer = new CFrameBuffer();
|
frameBuffer = new CFrameBuffer();
|
||||||
@@ -145,7 +148,7 @@ void CFrameBuffer::init(const char * const fbDevice)
|
|||||||
{
|
{
|
||||||
int tr = 0xFF;
|
int tr = 0xFF;
|
||||||
|
|
||||||
fd = open(fbDevice, O_RDWR);
|
fd = open(fbDevice, O_RDWR|O_CLOEXEC);
|
||||||
|
|
||||||
if (fd<0) {
|
if (fd<0) {
|
||||||
perror(fbDevice);
|
perror(fbDevice);
|
||||||
@@ -157,17 +160,14 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
available=fix.smem_len;
|
available=fix.smem_len;
|
||||||
printf("[fb_generic] %dk video mem\n", available/1024);
|
printf("[fb_generic] [%s] framebuffer %dk video mem\n", fix.id, available/1024);
|
||||||
lbb = 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");
|
||||||
goto nolfb;
|
goto nolfb;
|
||||||
@@ -199,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;
|
||||||
|
|
||||||
@@ -284,13 +238,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);
|
||||||
|
|
||||||
@@ -387,31 +334,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;
|
||||||
@@ -1560,33 +1482,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()
|
||||||
{
|
{
|
||||||
|
@@ -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];
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ class CFrameBuffer : public sigc::trackable
|
|||||||
inline void paintBox(int xa, int ya, int xb, int yb, const fb_pixel_t col, int radius, int type) { paintBoxRel(xa, ya, xb - xa, yb - ya, col, radius, type); }
|
inline void paintBox(int xa, int ya, int xb, int yb, const fb_pixel_t col, int radius, int type) { paintBoxRel(xa, ya, xb - xa, yb - ya, col, radius, type); }
|
||||||
|
|
||||||
void paintBoxFrame(const int x, const int y, const int dx, const int dy, const int px, const fb_pixel_t col, int radius = 0, int type = CORNER_ALL);
|
void paintBoxFrame(const int x, const int y, const int dx, const int dy, const int px, const fb_pixel_t col, int radius = 0, int type = CORNER_ALL);
|
||||||
void paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col);
|
virtual void paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col);
|
||||||
|
|
||||||
inline void paintVLine(int x, int ya, int yb, const fb_pixel_t col) { paintVLineRel(x, ya, yb - ya, col); }
|
inline void paintVLine(int x, int ya, int yb, const fb_pixel_t col) { paintVLineRel(x, ya, yb - ya, col); }
|
||||||
virtual void paintVLineRel(int x, int y, int dy, const fb_pixel_t col);
|
virtual void paintVLineRel(int x, int y, int dy, const fb_pixel_t col);
|
||||||
|
@@ -425,7 +425,13 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const bool utf8_encoded = flags & IS_UTF8;
|
const bool utf8_encoded = flags & IS_UTF8;
|
||||||
|
#if HAVE_TRIPLEDRAGON
|
||||||
|
/* the TD Framebufffer is ARGB; the others are BGRA. The fullbg code does not handle that
|
||||||
|
* the quick workaround is to just disable the fullbg flag */
|
||||||
|
useFullBG = false;
|
||||||
|
#else
|
||||||
useFullBG = flags & FULLBG;
|
useFullBG = flags & FULLBG;
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
useFullBg = false
|
useFullBg = false
|
||||||
fetch bgcolor from framebuffer, using lower left edge of the font
|
fetch bgcolor from framebuffer, using lower left edge of the font
|
||||||
|
@@ -142,7 +142,7 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/)
|
|||||||
if (initRenderClass) {
|
if (initRenderClass) {
|
||||||
if (g_fontRenderer != NULL)
|
if (g_fontRenderer != NULL)
|
||||||
delete g_fontRenderer;
|
delete g_fontRenderer;
|
||||||
g_fontRenderer = new FBFontRenderClass(72 * g_settings.screen_xres / 100, 72 * g_settings.screen_yres / 100);
|
g_fontRenderer = new FBFontRenderClass(72 * g_settings.font_scaling_x / 100, 72 * g_settings.font_scaling_y / 100);
|
||||||
|
|
||||||
old_fontDescr.size_offset = fontDescr.size_offset;
|
old_fontDescr.size_offset = fontDescr.size_offset;
|
||||||
old_fontDescr.filename = fontDescr.filename;
|
old_fontDescr.filename = fontDescr.filename;
|
||||||
|
@@ -232,10 +232,8 @@ bool CNITouchFileNotifier::changeNotify(const neutrino_locale_t, void * data)
|
|||||||
|
|
||||||
CFrameBuffer::getInstance()->Clear();
|
CFrameBuffer::getInstance()->Clear();
|
||||||
|
|
||||||
g_settings.screen_height = 576;
|
g_settings.font_scaling_x = 100;
|
||||||
g_settings.screen_width = 720;
|
g_settings.font_scaling_y = 100;
|
||||||
g_settings.screen_xres = 100;
|
|
||||||
g_settings.screen_yres = 100;
|
|
||||||
}
|
}
|
||||||
else if (strstr(filename, "mgcamd") ||
|
else if (strstr(filename, "mgcamd") ||
|
||||||
strstr(filename, "newcs") ||
|
strstr(filename, "newcs") ||
|
||||||
@@ -288,10 +286,8 @@ bool CNITouchFileNotifier::changeNotify(const neutrino_locale_t, void * data)
|
|||||||
|
|
||||||
CFrameBuffer::getInstance()->Clear();
|
CFrameBuffer::getInstance()->Clear();
|
||||||
|
|
||||||
g_settings.screen_height = 720;
|
g_settings.font_scaling_x = 105;
|
||||||
g_settings.screen_width = 1280;
|
g_settings.font_scaling_y = 105;
|
||||||
g_settings.screen_xres = 112;
|
|
||||||
g_settings.screen_yres = 112;
|
|
||||||
}
|
}
|
||||||
else if (strstr(filename, "mgcamd") ||
|
else if (strstr(filename, "mgcamd") ||
|
||||||
strstr(filename, "newcs") ||
|
strstr(filename, "newcs") ||
|
||||||
|
@@ -278,26 +278,26 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "font_scaling") {
|
else if (actionKey == "font_scaling") {
|
||||||
int xre = g_settings.screen_xres;
|
int fs_x = g_settings.font_scaling_x;
|
||||||
int yre = g_settings.screen_yres;
|
int fs_y = g_settings.font_scaling_y;
|
||||||
|
|
||||||
CMenuWidget fontscale(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP_FONTSCALE);
|
CMenuWidget fontscale(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP_FONTSCALE);
|
||||||
fontscale.addIntroItems(LOCALE_FONTMENU_SCALING);
|
fontscale.addIntroItems(LOCALE_FONTMENU_SCALING);
|
||||||
|
|
||||||
CMenuOptionNumberChooser* mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_X, &g_settings.screen_xres, true, 50, 200, this);
|
CMenuOptionNumberChooser* mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_X, &g_settings.font_scaling_x, true, 50, 200, this);
|
||||||
mc->setNumericInput(true);
|
mc->setNumericInput(true);
|
||||||
mc->setNumberFormat("%d%%");
|
mc->setNumberFormat("%d%%");
|
||||||
fontscale.addItem(mc);
|
fontscale.addItem(mc);
|
||||||
|
|
||||||
mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_Y, &g_settings.screen_yres, true, 50, 200, this);
|
mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_Y, &g_settings.font_scaling_y, true, 50, 200, this);
|
||||||
mc->setNumericInput(true);
|
mc->setNumericInput(true);
|
||||||
mc->setNumberFormat("%d%%");
|
mc->setNumberFormat("%d%%");
|
||||||
fontscale.addItem(mc);
|
fontscale.addItem(mc);
|
||||||
|
|
||||||
res = fontscale.exec(NULL, "");
|
res = fontscale.exec(NULL, "");
|
||||||
|
|
||||||
if (xre != g_settings.screen_xres || yre != g_settings.screen_yres) {
|
if (fs_x != g_settings.font_scaling_x || fs_y != g_settings.font_scaling_y) {
|
||||||
printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", g_settings.screen_xres, g_settings.screen_yres);
|
printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", g_settings.font_scaling_x, g_settings.font_scaling_y);
|
||||||
CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT | CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST | CNeutrinoFonts::FONTSETUP_DYN_FONT);
|
CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT | CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST | CNeutrinoFonts::FONTSETUP_DYN_FONT);
|
||||||
if (CNeutrinoApp::getInstance()->channelList)
|
if (CNeutrinoApp::getInstance()->channelList)
|
||||||
CNeutrinoApp::getInstance()->channelList->ResetModules(); //force re init of all modules
|
CNeutrinoApp::getInstance()->channelList->ResetModules(); //force re init of all modules
|
||||||
|
@@ -803,8 +803,6 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
g_settings.channellist_show_numbers = configfile.getInt32("channellist_show_numbers", 1);
|
g_settings.channellist_show_numbers = configfile.getInt32("channellist_show_numbers", 1);
|
||||||
|
|
||||||
//screen configuration
|
//screen configuration
|
||||||
g_settings.screen_xres = configfile.getInt32("screen_xres", 105); //NI
|
|
||||||
g_settings.screen_yres = configfile.getInt32("screen_yres", 105); //NI
|
|
||||||
g_settings.screen_StartX_crt = configfile.getInt32( "screen_StartX_crt", DEFAULT_X_START_SD);
|
g_settings.screen_StartX_crt = configfile.getInt32( "screen_StartX_crt", DEFAULT_X_START_SD);
|
||||||
g_settings.screen_StartY_crt = configfile.getInt32( "screen_StartY_crt", DEFAULT_Y_START_SD );
|
g_settings.screen_StartY_crt = configfile.getInt32( "screen_StartY_crt", DEFAULT_Y_START_SD );
|
||||||
g_settings.screen_EndX_crt = configfile.getInt32( "screen_EndX_crt", DEFAULT_X_END_SD);
|
g_settings.screen_EndX_crt = configfile.getInt32( "screen_EndX_crt", DEFAULT_X_END_SD);
|
||||||
@@ -825,8 +823,14 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt;
|
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt;
|
||||||
g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt;
|
g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt;
|
||||||
|
|
||||||
g_settings.screen_width = configfile.getInt32("screen_width", 0);
|
g_settings.screen_width = frameBuffer->getScreenWidth(true);
|
||||||
g_settings.screen_height = configfile.getInt32("screen_height", 0);
|
g_settings.screen_height = frameBuffer->getScreenHeight(true);
|
||||||
|
|
||||||
|
// avoid configuration mismatch
|
||||||
|
if (g_settings.screen_EndX > g_settings.screen_width)
|
||||||
|
g_settings.screen_EndX = g_settings.screen_width;
|
||||||
|
if (g_settings.screen_EndY > g_settings.screen_height)
|
||||||
|
g_settings.screen_EndY = g_settings.screen_height;
|
||||||
|
|
||||||
g_settings.bigFonts = configfile.getInt32("bigFonts", 1); //NI
|
g_settings.bigFonts = configfile.getInt32("bigFonts", 1); //NI
|
||||||
g_settings.window_size = configfile.getInt32("window_size", 100);
|
g_settings.window_size = configfile.getInt32("window_size", 100);
|
||||||
@@ -875,6 +879,9 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
g_settings.ttx_font_file = configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf");
|
g_settings.ttx_font_file = configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf");
|
||||||
ttx_font_file = g_settings.ttx_font_file.c_str();
|
ttx_font_file = g_settings.ttx_font_file.c_str();
|
||||||
|
|
||||||
|
g_settings.font_scaling_x = configfile.getInt32("font_scaling_x", 105); //NI
|
||||||
|
g_settings.font_scaling_y = configfile.getInt32("font_scaling_y", 105); //NI
|
||||||
|
|
||||||
g_settings.update_dir = configfile.getString("update_dir", "/tmp");
|
g_settings.update_dir = configfile.getString("update_dir", "/tmp");
|
||||||
g_settings.update_dir_opkg = configfile.getString("update_dir_opkg", g_settings.update_dir);
|
g_settings.update_dir_opkg = configfile.getString("update_dir_opkg", g_settings.update_dir);
|
||||||
|
|
||||||
@@ -997,17 +1004,6 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
erg = 2;
|
erg = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* in case FB resolution changed */
|
|
||||||
if((g_settings.screen_width && g_settings.screen_width != (int) frameBuffer->getScreenWidth(true))
|
|
||||||
|| (g_settings.screen_height && g_settings.screen_height != (int) frameBuffer->getScreenHeight(true))) {
|
|
||||||
g_settings.screen_StartX = g_settings.screen_preset ? DEFAULT_X_START_HD : DEFAULT_X_START_SD;
|
|
||||||
g_settings.screen_StartY = g_settings.screen_preset ? DEFAULT_Y_START_HD : DEFAULT_Y_START_SD;
|
|
||||||
g_settings.screen_EndX = g_settings.screen_preset ? DEFAULT_X_END_HD : DEFAULT_X_END_SD;
|
|
||||||
g_settings.screen_EndY = g_settings.screen_preset ? DEFAULT_Y_END_HD : DEFAULT_Y_END_SD;
|
|
||||||
|
|
||||||
g_settings.screen_width = frameBuffer->getScreenWidth(true);
|
|
||||||
g_settings.screen_height = frameBuffer->getScreenHeight(true);
|
|
||||||
}
|
|
||||||
#ifdef BOXMODEL_APOLLO
|
#ifdef BOXMODEL_APOLLO
|
||||||
g_settings.brightness = configfile.getInt32("brightness", 0);
|
g_settings.brightness = configfile.getInt32("brightness", 0);
|
||||||
g_settings.contrast = configfile.getInt32("contrast", 0);
|
g_settings.contrast = configfile.getInt32("contrast", 0);
|
||||||
@@ -1056,15 +1052,6 @@ void CNeutrinoApp::upgradeSetup(const char * fname)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//NI
|
//NI
|
||||||
if (g_settings.version_pseudo < "20160623110000")
|
|
||||||
{
|
|
||||||
if (g_settings.screen_xres == 112)
|
|
||||||
g_settings.screen_xres = 105;
|
|
||||||
|
|
||||||
if (g_settings.screen_yres == 112)
|
|
||||||
g_settings.screen_yres = 105;
|
|
||||||
}
|
|
||||||
//NI
|
|
||||||
if (g_settings.version_pseudo < "20160804110000")
|
if (g_settings.version_pseudo < "20160804110000")
|
||||||
{
|
{
|
||||||
if (g_settings.tmdb_api_key == "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
|
if (g_settings.tmdb_api_key == "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
|
||||||
@@ -1103,6 +1090,23 @@ void CNeutrinoApp::upgradeSetup(const char * fname)
|
|||||||
configfile.deleteKey("progressbar_timescale_yellow");
|
configfile.deleteKey("progressbar_timescale_yellow");
|
||||||
configfile.deleteKey("progressbar_timescale_invert");
|
configfile.deleteKey("progressbar_timescale_invert");
|
||||||
}
|
}
|
||||||
|
if (g_settings.version_pseudo < "20170209181001")
|
||||||
|
{
|
||||||
|
//convert screen_x/yres keys to font_scaling_x/y
|
||||||
|
|
||||||
|
g_settings.font_scaling_x = configfile.getInt32("screen_xres", 100);
|
||||||
|
g_settings.font_scaling_y = configfile.getInt32("screen_yres", 100);
|
||||||
|
|
||||||
|
configfile.deleteKey("screen_xres");
|
||||||
|
configfile.deleteKey("screen_yres");
|
||||||
|
}
|
||||||
|
if (g_settings.version_pseudo < "20170209181002")
|
||||||
|
{
|
||||||
|
//remove screen_width/height keys
|
||||||
|
|
||||||
|
configfile.deleteKey("screen_width");
|
||||||
|
configfile.deleteKey("screen_height");
|
||||||
|
}
|
||||||
|
|
||||||
g_settings.version_pseudo = NEUTRINO_VERSION_PSEUDO;
|
g_settings.version_pseudo = NEUTRINO_VERSION_PSEUDO;
|
||||||
configfile.setString("version_pseudo", g_settings.version_pseudo);
|
configfile.setString("version_pseudo", g_settings.version_pseudo);
|
||||||
@@ -1449,8 +1453,6 @@ void CNeutrinoApp::saveSetup(const char * fname)
|
|||||||
configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers);
|
configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers);
|
||||||
|
|
||||||
//screen configuration
|
//screen configuration
|
||||||
configfile.setInt32( "screen_xres", g_settings.screen_xres);
|
|
||||||
configfile.setInt32( "screen_yres", g_settings.screen_yres);
|
|
||||||
configfile.setInt32( "screen_StartX_lcd", g_settings.screen_StartX_lcd );
|
configfile.setInt32( "screen_StartX_lcd", g_settings.screen_StartX_lcd );
|
||||||
configfile.setInt32( "screen_StartY_lcd", g_settings.screen_StartY_lcd );
|
configfile.setInt32( "screen_StartY_lcd", g_settings.screen_StartY_lcd );
|
||||||
configfile.setInt32( "screen_EndX_lcd", g_settings.screen_EndX_lcd );
|
configfile.setInt32( "screen_EndX_lcd", g_settings.screen_EndX_lcd );
|
||||||
@@ -1460,8 +1462,6 @@ void CNeutrinoApp::saveSetup(const char * fname)
|
|||||||
configfile.setInt32( "screen_EndX_crt", g_settings.screen_EndX_crt );
|
configfile.setInt32( "screen_EndX_crt", g_settings.screen_EndX_crt );
|
||||||
configfile.setInt32( "screen_EndY_crt", g_settings.screen_EndY_crt );
|
configfile.setInt32( "screen_EndY_crt", g_settings.screen_EndY_crt );
|
||||||
configfile.setInt32( "screen_preset", g_settings.screen_preset );
|
configfile.setInt32( "screen_preset", g_settings.screen_preset );
|
||||||
configfile.setInt32( "screen_width", g_settings.screen_width);
|
|
||||||
configfile.setInt32( "screen_height", g_settings.screen_height);
|
|
||||||
|
|
||||||
//Software-update
|
//Software-update
|
||||||
configfile.setInt32 ("softupdate_mode" , g_settings.softupdate_mode );
|
configfile.setInt32 ("softupdate_mode" , g_settings.softupdate_mode );
|
||||||
@@ -1490,6 +1490,9 @@ void CNeutrinoApp::saveSetup(const char * fname)
|
|||||||
configfile.setString("font_file", g_settings.font_file);
|
configfile.setString("font_file", g_settings.font_file);
|
||||||
configfile.setString("ttx_font_file", g_settings.ttx_font_file);
|
configfile.setString("ttx_font_file", g_settings.ttx_font_file);
|
||||||
|
|
||||||
|
configfile.setInt32( "font_scaling_x", g_settings.font_scaling_x);
|
||||||
|
configfile.setInt32( "font_scaling_y", g_settings.font_scaling_y);
|
||||||
|
|
||||||
//parentallock
|
//parentallock
|
||||||
configfile.setInt32( "parentallock_prompt", g_settings.parentallock_prompt );
|
configfile.setInt32( "parentallock_prompt", g_settings.parentallock_prompt );
|
||||||
configfile.setInt32( "parentallock_lockage", g_settings.parentallock_lockage );
|
configfile.setInt32( "parentallock_lockage", g_settings.parentallock_lockage );
|
||||||
|
@@ -640,8 +640,6 @@ struct SNeutrinoSettings
|
|||||||
int screen_preset;
|
int screen_preset;
|
||||||
int screen_width;
|
int screen_width;
|
||||||
int screen_height;
|
int screen_height;
|
||||||
int screen_xres;
|
|
||||||
int screen_yres;
|
|
||||||
|
|
||||||
//Software-update
|
//Software-update
|
||||||
int softupdate_mode;
|
int softupdate_mode;
|
||||||
@@ -804,9 +802,13 @@ struct SNeutrinoSettings
|
|||||||
int zap_cycle;
|
int zap_cycle;
|
||||||
int sms_channel;
|
int sms_channel;
|
||||||
int sms_movie;
|
int sms_movie;
|
||||||
|
|
||||||
std::string font_file;
|
std::string font_file;
|
||||||
std::string ttx_font_file;
|
std::string ttx_font_file;
|
||||||
|
|
||||||
|
int font_scaling_x;
|
||||||
|
int font_scaling_y;
|
||||||
|
|
||||||
//NI
|
//NI
|
||||||
int lcd4l_support;
|
int lcd4l_support;
|
||||||
std::string lcd4l_logodir;
|
std::string lcd4l_logodir;
|
||||||
|
@@ -1 +1 @@
|
|||||||
#define NEUTRINO_VERSION_PSEUDO "20162912080000"
|
#define NEUTRINO_VERSION_PSEUDO "20170209181002"
|
||||||
|
Reference in New Issue
Block a user