fb_accel: add accelerated framebuffer for Nevis GXA chips

Signed-off-by: M. Liebmann <git@tuxcode.de>


Origin commit data
------------------
Branch: ni/coolstream
Commit: 0e63e5df3d
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-05 (Sun, 05 Feb 2017)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2017-02-05 23:03:22 +01:00
committed by Michael Liebmann
parent fa333ddbb0
commit 7d945c2d59
5 changed files with 445 additions and 1 deletions

View File

@@ -33,6 +33,11 @@
#define PARTIAL_BLIT 1
#endif
#if HAVE_COOL_HARDWARE
/* not needed -- if you don't want acceleration, don't call CFbAccel ;) */
#define USE_NEVIS_GXA 1
#endif
class CFbAccel
: public CFrameBuffer
{
@@ -78,4 +83,34 @@ class CFbAccelSTi
void setBlendLevel(int);
};
class CFbAccelCSNevis
: public CFbAccel
{
private:
fb_pixel_t lastcol;
int devmem_fd; /* to access the GXA register we use /dev/mem */
unsigned int smem_start; /* as aquired from the fbdev, the framebuffers physical start address */
volatile uint8_t *gxa_base; /* base address for the GXA's register access */
void setColor(fb_pixel_t col);
void run(void);
fb_pixel_t *backbuffer;
public:
CFbAccelCSNevis();
~CFbAccelCSNevis();
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 paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col);
void paintBoxRel(const int x, const int y, const int dx, const int dy, const fb_pixel_t col, int radius = 0, int type = CORNER_ALL);
void blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp = 0, uint32_t yp = 0, bool transp = false);
void blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff);
void waitForIdle(const char *func = NULL);
fb_pixel_t * getBackBufferPointer() const;
void setBlendMode(uint8_t);
void setBlendLevel(int);
void add_gxa_sync_marker(void);
void setupGXA(void);
};
#endif