mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- TRIPLEDRAGON: deleted
Conflicts: lib/libdvbsub/dvbsub.cpp src/system/flashtool.cpp
This commit is contained in:
@@ -70,13 +70,6 @@ libneutrino_driver_a_SOURCES += \
|
||||
endif
|
||||
endif
|
||||
|
||||
if BOXTYPE_TRIPLE
|
||||
libneutrino_driver_a_SOURCES += \
|
||||
fb_accel_td.cpp \
|
||||
newclock.cpp \
|
||||
lcdd.cpp
|
||||
endif
|
||||
|
||||
if BOXTYPE_SPARK
|
||||
libneutrino_driver_a_SOURCES += \
|
||||
fb_accel_sti.cpp \
|
||||
|
@@ -24,10 +24,6 @@
|
||||
#include <driver/vfd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include <driver/lcdd.h>
|
||||
#endif
|
||||
|
||||
#include "int_fft.c"
|
||||
|
||||
typedef signed short gint16;
|
||||
|
@@ -2,9 +2,6 @@
|
||||
#if HAVE_CST_HARDWARE
|
||||
#include <driver/vfd.h>
|
||||
#endif
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include <driver/lcdd.h>
|
||||
#endif
|
||||
#if HAVE_SPARK_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
|
||||
#include <driver/simple_display.h>
|
||||
#endif
|
||||
|
@@ -185,33 +185,6 @@ class CFbAccelGLFB
|
||||
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);
|
||||
#if 0
|
||||
/* this is too slow, just use simple software implementation */
|
||||
void blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp);
|
||||
#endif
|
||||
void waitForIdle(const char *func = NULL);
|
||||
fb_pixel_t * getBackBufferPointer() const;
|
||||
void setBlendMode(uint8_t);
|
||||
void setBlendLevel(int);
|
||||
};
|
||||
|
||||
class CFbAccelARM
|
||||
#if ENABLE_ARM_ACC
|
||||
: public OpenThreads::Thread, public CFbAccel
|
||||
|
@@ -1,218 +0,0 @@
|
||||
/*
|
||||
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-2018 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 <fcntl.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);
|
||||
}
|
||||
|
||||
#if 0
|
||||
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;
|
||||
int pitch = width * sizeof(fb_pixel_t);
|
||||
uint8_t *srcbuf = (uint8_t *)fbbuff + (pitch * yp);
|
||||
|
||||
src.x = xp;
|
||||
src.y = 0; /* y != 0 does not work => add offset to the buffer instead */
|
||||
src.w = width - xp;
|
||||
src.h = height;
|
||||
|
||||
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 = srcbuf;
|
||||
dsc.preallocated[0].pitch = pitch;
|
||||
err = dfb->CreateSurface(dfb, &dsc, &surf);
|
||||
if (err != DFB_OK) {
|
||||
/* probably width or height out of range... */
|
||||
fprintf(stderr, LOGTAG "blit2FB: w:%d h:%d data:0x%p pitch:%d\n", width, height, srcbuf, pitch);
|
||||
DirectFBError("dfb->CreateSurface(dfb, &dsc, &surf)", err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (transp)
|
||||
dfbdest->SetBlittingFlags(dfbdest, DSBLIT_NOFX);
|
||||
else
|
||||
dfbdest->SetBlittingFlags(dfbdest, DSBLIT_BLEND_ALPHACHANNEL);
|
||||
|
||||
err = dfbdest->Blit(dfbdest, surf, &src, xoff, yoff);
|
||||
if (err != DFB_OK) {
|
||||
/* something wrong with src or x/yoff... */
|
||||
fprintf(stderr, LOGTAG "blit2FB: w:%d h:%d data:0x%p pitch:%d xp:%d yp:%d xo:%d yo:%d\n",
|
||||
width, height, srcbuf, pitch, xp, yp, xoff, yoff);
|
||||
DirectFBError("dfbdest->Blit(dfbdest, surf, &src, xoff, yoff)", err);
|
||||
}
|
||||
surf->Release(surf);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
void CFbAccelTD::init(const char *)
|
||||
{
|
||||
CFrameBuffer::init();
|
||||
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
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;
|
||||
swidth = stride / sizeof(fb_pixel_t);
|
||||
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 + swidth * 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;
|
||||
}
|
||||
|
||||
void CFbAccelTD::setBlendMode(uint8_t mode)
|
||||
{
|
||||
Stb04GFXOsdControl g;
|
||||
ioctl(gfxfd, STB04GFX_OSD_GETCONTROL, &g);
|
||||
g.use_global_alpha = (mode == 2); /* 1 == pixel alpha, 2 == global alpha */
|
||||
ioctl(gfxfd, STB04GFX_OSD_SETCONTROL, &g);
|
||||
}
|
||||
|
||||
void CFbAccelTD::setBlendLevel(int level)
|
||||
{
|
||||
/* this is bypassing directfb, but faster and easier */
|
||||
Stb04GFXOsdControl g;
|
||||
ioctl(gfxfd, STB04GFX_OSD_GETCONTROL, &g);
|
||||
if (g.use_global_alpha == 0)
|
||||
return;
|
||||
|
||||
if (level < 0 || level > 100)
|
||||
return;
|
||||
|
||||
/* this is the same as convertSetupAlpha2Alpha(), but non-float */
|
||||
g.global_alpha = 255 - (255 * level / 100);
|
||||
ioctl(gfxfd, STB04GFX_OSD_SETCONTROL, &g);
|
||||
if (level == 100) // sucks
|
||||
usleep(20000);
|
||||
}
|
||||
|
||||
fb_pixel_t *CFbAccelTD::getBackBufferPointer() const
|
||||
{
|
||||
return backbuffer;
|
||||
}
|
@@ -140,9 +140,6 @@ CFrameBuffer* CFrameBuffer::getInstance()
|
||||
#if HAVE_GENERIC_HARDWARE
|
||||
frameBuffer = new CFbAccelGLFB();
|
||||
#endif
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
frameBuffer = new CFbAccelTD();
|
||||
#endif
|
||||
#if HAVE_ARM_HARDWARE
|
||||
frameBuffer = new CFbAccelARM();
|
||||
#endif
|
||||
|
@@ -489,13 +489,7 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f
|
||||
}
|
||||
|
||||
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;
|
||||
#endif
|
||||
/*
|
||||
useFullBg = false
|
||||
fetch bgcolor from framebuffer, using lower left edge of the font
|
||||
|
@@ -309,7 +309,6 @@ void CLCD::displayUpdate()
|
||||
display.update();
|
||||
}
|
||||
|
||||
#ifndef HAVE_TRIPLEDRAGON
|
||||
void CLCD::setlcdparameter(int dimm, const int contrast, const int power, const int inverse, const int bias)
|
||||
{
|
||||
#if defined HAVE_DBOX_HARDWARE || defined HAVE_DREAMBOX_HARDWARE || defined HAVE_IPBOX_HARDWARE
|
||||
@@ -367,23 +366,6 @@ void CLCD::setlcdparameter(int dimm, const int contrast, const int power, const
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
void CLCD::setlcdparameter(int /*dimm*/, const int contrast, const int /*power*/, const int inverse, const int /*bias*/)
|
||||
{
|
||||
int fd = open("/dev/" DEVICE_NAME_LCD, O_RDWR);
|
||||
if (fd < 0)
|
||||
{
|
||||
perror("CLCD::setlcdparameter open " DEVICE_NAME_LCD);
|
||||
return;
|
||||
}
|
||||
if (ioctl(fd, IOC_LCD_INVERS, inverse & 1) < 0)
|
||||
perror("CLCD::setlcdparameter ioctl IOC_LCD_INVERS");
|
||||
if (ioctl(fd, IOC_LCD_POTI, contrast) < 0)
|
||||
perror("CLCD::setlcdparameter ioctl IOC_LCD_POTI");
|
||||
|
||||
close(fd);
|
||||
}
|
||||
#endif
|
||||
|
||||
void CLCD::setlcdparameter(void)
|
||||
{
|
||||
|
@@ -119,13 +119,6 @@ typedef enum
|
||||
#include <pthread.h>
|
||||
#include <string>
|
||||
|
||||
#ifdef HAVE_TRIPLEDRAGON
|
||||
#include <lcddisplay/fontrenderer.h>
|
||||
|
||||
|
||||
class CLCDPainter;
|
||||
class LcdFontRenderClass;
|
||||
#endif
|
||||
class CLCD
|
||||
{
|
||||
public:
|
||||
@@ -157,56 +150,6 @@ class CLCD
|
||||
|
||||
|
||||
private:
|
||||
|
||||
#ifdef HAVE_TRIPLEDRAGON
|
||||
class FontsDef
|
||||
{
|
||||
public:
|
||||
LcdFont *channelname;
|
||||
LcdFont *time;
|
||||
LcdFont *menutitle;
|
||||
LcdFont *menu;
|
||||
};
|
||||
|
||||
CLCDDisplay display;
|
||||
LcdFontRenderClass *fontRenderer;
|
||||
FontsDef fonts;
|
||||
|
||||
#define LCD_NUMBER_OF_BACKGROUNDS 5
|
||||
raw_display_t background[LCD_NUMBER_OF_BACKGROUNDS];
|
||||
|
||||
MODES mode;
|
||||
AUDIOMODES movie_playmode;
|
||||
|
||||
std::string servicename;
|
||||
std::string epg_title;
|
||||
std::string movie_big;
|
||||
std::string movie_small;
|
||||
std::string menutitle;
|
||||
char volume;
|
||||
unsigned char percentOver;
|
||||
bool muted;
|
||||
bool showclock;
|
||||
bool movie_centered;
|
||||
bool movie_is_ac3;
|
||||
pthread_t thrTime;
|
||||
bool thread_started;
|
||||
int last_toggle_state_power;
|
||||
int clearClock;
|
||||
unsigned int timeout_cnt;
|
||||
|
||||
void count_down();
|
||||
|
||||
CLCD();
|
||||
|
||||
static void* TimeThread(void*);
|
||||
bool lcdInit(const char * fontfile1, const char * fontname1,
|
||||
const char * fontfile2=NULL, const char * fontname2=NULL,
|
||||
const char * fontfile3=NULL, const char * fontname3=NULL);
|
||||
void setlcdparameter(int dimm, int contrast, int power, int inverse, int bias);
|
||||
void displayUpdate();
|
||||
void showTextScreen(const std::string & big, const std::string & small, int showmode, bool perform_wakeup, bool centered = false);
|
||||
#else
|
||||
CLCD();
|
||||
std::string menutitle;
|
||||
std::string servicename;
|
||||
@@ -221,7 +164,6 @@ class CLCD
|
||||
unsigned int switch_name_time_cnt;
|
||||
void setlcdparameter(int dimm, int _power);
|
||||
void count_down();
|
||||
#endif
|
||||
|
||||
public:
|
||||
bool has_lcd;
|
||||
|
@@ -45,12 +45,7 @@ extern "C" {
|
||||
|
||||
#define REC_MAX_APIDS 10
|
||||
#define FILENAMEBUFFERSIZE 1024
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
/* I'm not able to get it to work with more than 1 recording at a time :-( */
|
||||
#define RECORD_MAX_COUNT 1
|
||||
#else
|
||||
#define RECORD_MAX_COUNT 8
|
||||
#endif
|
||||
|
||||
class CFrontend;
|
||||
class CZapitChannel;
|
||||
|
Reference in New Issue
Block a user