fb_accel: Rename CFbAccelCSNevis class => CFbAccelCSHD1

Rename fb_accel_cs_nevis.cpp => fb_accel_cs_hd1.cpp
This commit is contained in:
M. Liebmann
2017-02-08 12:17:09 +01:00
parent 35b48372f8
commit 58bd8a4a63
4 changed files with 26 additions and 26 deletions

View File

@@ -52,7 +52,7 @@ libneutrino_driver_a_SOURCES += \
vfd.cpp vfd.cpp
else else
libneutrino_driver_a_SOURCES += \ libneutrino_driver_a_SOURCES += \
fb_accel_cs_nevis.cpp \ fb_accel_cs_hd1.cpp \
vfd.cpp vfd.cpp
endif endif
endif endif

View File

@@ -78,7 +78,7 @@ class CFbAccelSTi
void setBlendLevel(int); void setBlendLevel(int);
}; };
class CFbAccelCSNevis class CFbAccelCSHD1
: public CFbAccel : public CFbAccel
{ {
private: private:
@@ -90,8 +90,8 @@ class CFbAccelCSNevis
void run(void); void run(void);
fb_pixel_t *backbuffer; fb_pixel_t *backbuffer;
public: public:
CFbAccelCSNevis(); CFbAccelCSHD1();
~CFbAccelCSNevis(); ~CFbAccelCSHD1();
void init(const char * const); void init(const char * const);
int setMode(unsigned int xRes, unsigned int yRes, unsigned int bpp); int setMode(unsigned int xRes, unsigned int yRes, unsigned int bpp);
void paintPixel(int x, int y, const fb_pixel_t col); void paintPixel(int x, int y, const fb_pixel_t col);

View File

@@ -95,7 +95,7 @@ static void _write_gxa(volatile unsigned char *base_addr, unsigned int offset, u
/* this adds a tagged marker into the GXA queue. Once this comes out /* this adds a tagged marker into the GXA queue. Once this comes out
of the other end of the queue, all commands before it are finished */ of the other end of the queue, all commands before it are finished */
void CFbAccelCSNevis::add_gxa_sync_marker(void) void CFbAccelCSHD1::add_gxa_sync_marker(void)
{ {
unsigned int cmd = GXA_CMD_QMARK | GXA_PARAM_COUNT(1); unsigned int cmd = GXA_CMD_QMARK | GXA_PARAM_COUNT(1);
// TODO: locking? // TODO: locking?
@@ -106,7 +106,7 @@ void CFbAccelCSNevis::add_gxa_sync_marker(void)
} }
/* wait until the current marker comes out of the GXA command queue */ /* wait until the current marker comes out of the GXA command queue */
void CFbAccelCSNevis::waitForIdle(const char *func) void CFbAccelCSHD1::waitForIdle(const char *func)
{ {
unsigned int cfg, count = 0; unsigned int cfg, count = 0;
do { do {
@@ -124,12 +124,12 @@ void CFbAccelCSNevis::waitForIdle(const char *func)
fprintf(stderr, LOGTAG "waitForIdle: count is big (%d) [%s]!\n", count, func?func:""); fprintf(stderr, LOGTAG "waitForIdle: count is big (%d) [%s]!\n", count, func?func:"");
} }
CFbAccelCSNevis::CFbAccelCSNevis() CFbAccelCSHD1::CFbAccelCSHD1()
{ {
fb_name = "Coolstream NEVIS GXA framebuffer"; fb_name = "Coolstream NEVIS GXA framebuffer";
} }
void CFbAccelCSNevis::init(const char * const) void CFbAccelCSHD1::init(const char * const)
{ {
fprintf(stderr, ">FBACCEL::INIT\n"); fprintf(stderr, ">FBACCEL::INIT\n");
CFrameBuffer::init(); CFrameBuffer::init();
@@ -163,7 +163,7 @@ fprintf(stderr, ">FBACCEL::INIT\n");
; ;
}; };
CFbAccelCSNevis::~CFbAccelCSNevis() CFbAccelCSHD1::~CFbAccelCSHD1()
{ {
if (gxa_base != MAP_FAILED) if (gxa_base != MAP_FAILED)
munmap((void *)gxa_base, 0x40000); munmap((void *)gxa_base, 0x40000);
@@ -175,7 +175,7 @@ CFbAccelCSNevis::~CFbAccelCSNevis()
close(fd); close(fd);
} }
void CFbAccelCSNevis::setColor(fb_pixel_t col) void CFbAccelCSHD1::setColor(fb_pixel_t col)
{ {
if (col == lastcol) if (col == lastcol)
return; return;
@@ -183,7 +183,7 @@ void CFbAccelCSNevis::setColor(fb_pixel_t col)
lastcol = col; lastcol = col;
} }
void CFbAccelCSNevis::paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col) void CFbAccelCSHD1::paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col)
{ {
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex); OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
unsigned int cmd = GXA_CMD_BLT | GXA_CMD_NOT_TEXT | GXA_CMD_NOT_ALPHA | unsigned int cmd = GXA_CMD_BLT | GXA_CMD_NOT_TEXT | GXA_CMD_NOT_ALPHA |
@@ -200,12 +200,12 @@ void CFbAccelCSNevis::paintRect(const int x, const int y, const int dx, const in
add_gxa_sync_marker(); add_gxa_sync_marker();
} }
void CFbAccelCSNevis::paintPixel(const int x, const int y, const fb_pixel_t col) void CFbAccelCSHD1::paintPixel(const int x, const int y, const fb_pixel_t col)
{ {
paintLine(x, y, x + 1, y, col); paintLine(x, y, x + 1, y, col);
} }
void CFbAccelCSNevis::paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col) void CFbAccelCSHD1::paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col)
{ {
if (!getActive()) if (!getActive())
return; return;
@@ -219,7 +219,7 @@ void CFbAccelCSNevis::paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t
_write_gxa(gxa_base, cmd, GXA_POINT(xa, ya)); /* start point */ _write_gxa(gxa_base, cmd, GXA_POINT(xa, ya)); /* start point */
} }
void CFbAccelCSNevis::paintBoxRel(const int x, const int y, const int dx, const int dy, const fb_pixel_t col, int radius, int type) void CFbAccelCSHD1::paintBoxRel(const int x, const int y, const int dx, const int dy, const fb_pixel_t col, int radius, int type)
{ {
/* draw a filled rectangle (with additional round corners) */ /* draw a filled rectangle (with additional round corners) */
@@ -227,11 +227,11 @@ void CFbAccelCSNevis::paintBoxRel(const int x, const int y, const int dx, const
return; return;
if (dx == 0 || dy == 0) { if (dx == 0 || dy == 0) {
dprintf(DEBUG_DEBUG, "[CFbAccelCSNevis] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __func__, __LINE__, radius, x, y, x+dx, y+dy); dprintf(DEBUG_DEBUG, "[CFbAccelCSHD1] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __func__, __LINE__, radius, x, y, x+dx, y+dy);
return; return;
} }
if (radius < 0) if (radius < 0)
dprintf(DEBUG_NORMAL, "[CFbAccelCSNevis] [%s - %d]: WARNING! radius < 0 [%d] FIXME\n", __func__, __LINE__, radius); dprintf(DEBUG_NORMAL, "[CFbAccelCSHD1] [%s - %d]: WARNING! radius < 0 [%d] FIXME\n", __func__, __LINE__, radius);
checkFbArea(x, y, dx, dy, true); checkFbArea(x, y, dx, dy, true);
@@ -259,9 +259,9 @@ void CFbAccelCSNevis::paintBoxRel(const int x, const int y, const int dx, const
if (dx-ofr-ofl < 1) { if (dx-ofr-ofl < 1) {
if (dx-ofr-ofl == 0){ if (dx-ofr-ofl == 0){
dprintf(DEBUG_INFO, "[CFbAccelCSNevis] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __func__, __LINE__, radius, x, y, x+dx-ofr-ofl, y+line); dprintf(DEBUG_INFO, "[CFbAccelCSHD1] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __func__, __LINE__, radius, x, y, x+dx-ofr-ofl, y+line);
}else{ }else{
dprintf(DEBUG_INFO, "[CFbAccelCSNevis] [%s - %04d]: Calculated width: %d\n (radius %d, dx %d, offsetLeft %d, offsetRight %d).\n Width can not be less than 0, abort.\n", dprintf(DEBUG_INFO, "[CFbAccelCSHD1] [%s - %04d]: Calculated width: %d\n (radius %d, dx %d, offsetLeft %d, offsetRight %d).\n Width can not be less than 0, abort.\n",
__func__, __LINE__, dx-ofr-ofl, radius, dx, ofl, ofr); __func__, __LINE__, dx-ofr-ofl, radius, dx, ofl, ofr);
} }
line++; line++;
@@ -285,7 +285,7 @@ void CFbAccelCSNevis::paintBoxRel(const int x, const int y, const int dx, const
checkFbArea(x, y, dx, dy, false); checkFbArea(x, y, dx, dy, false);
} }
void CFbAccelCSNevis::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp) void CFbAccelCSHD1::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp)
{ {
int xc, yc; int xc, yc;
xc = (width > xRes) ? xRes : width; xc = (width > xRes) ? xRes : width;
@@ -310,7 +310,7 @@ void CFbAccelCSNevis::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uin
CFrameBuffer::blit2FB(fbbuff, width, height, xoff, yoff, xp, yp, transp); CFrameBuffer::blit2FB(fbbuff, width, height, xoff, yoff, xp, yp, transp);
} }
void CFbAccelCSNevis::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff) void CFbAccelCSHD1::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff)
{ {
if(width <1 || height <1 || !boxBuf ) if(width <1 || height <1 || !boxBuf )
return; return;
@@ -333,7 +333,7 @@ void CFbAccelCSNevis::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint3
CFrameBuffer::blitBox2FB(boxBuf, width, height, xoff, yoff); CFrameBuffer::blitBox2FB(boxBuf, width, height, xoff, yoff);
} }
void CFbAccelCSNevis::setupGXA() void CFbAccelCSHD1::setupGXA()
{ {
// We (re)store the GXA regs here in case DFB override them and was not // We (re)store the GXA regs here in case DFB override them and was not
// able to restore them. // able to restore them.
@@ -349,7 +349,7 @@ void CFbAccelCSNevis::setupGXA()
} }
/* wrong name... */ /* wrong name... */
int CFbAccelCSNevis::setMode(unsigned int, unsigned int, unsigned int) int CFbAccelCSHD1::setMode(unsigned int, unsigned int, unsigned int)
{ {
fb_fix_screeninfo _fix; fb_fix_screeninfo _fix;
@@ -375,18 +375,18 @@ int CFbAccelCSNevis::setMode(unsigned int, unsigned int, unsigned int)
return 0; /* dont fail because of this */ return 0; /* dont fail because of this */
} }
fb_pixel_t * CFbAccelCSNevis::getBackBufferPointer() const fb_pixel_t * CFbAccelCSHD1::getBackBufferPointer() const
{ {
return backbuffer; return backbuffer;
} }
void CFbAccelCSNevis::setBlendMode(uint8_t mode) void CFbAccelCSHD1::setBlendMode(uint8_t mode)
{ {
if (ioctl(fd, FBIO_SETBLENDMODE, mode)) if (ioctl(fd, FBIO_SETBLENDMODE, mode))
printf("FBIO_SETBLENDMODE failed.\n"); printf("FBIO_SETBLENDMODE failed.\n");
} }
void CFbAccelCSNevis::setBlendLevel(int level) void CFbAccelCSHD1::setBlendLevel(int level)
{ {
unsigned char value = 0xFF; unsigned char value = 0xFF;
if (level >= 0 && level <= 100) if (level >= 0 && level <= 100)

View File

@@ -127,7 +127,7 @@ CFrameBuffer* CFrameBuffer::getInstance()
#ifdef BOXMODEL_APOLLO #ifdef BOXMODEL_APOLLO
frameBuffer = new CFbAccelCSApollo(); frameBuffer = new CFbAccelCSApollo();
#else #else
frameBuffer = new CFbAccelCSNevis(); frameBuffer = new CFbAccelCSHD1();
#endif #endif
#endif #endif
#if HAVE_GENERIC_HARDWARE #if HAVE_GENERIC_HARDWARE