fb_accel: add accelerated framebuffer for Nevis GXA chips

This commit is contained in:
Stefan Seyfried
2017-02-05 23:03:22 +01:00
parent 7504fe264e
commit 9fffbef19d
4 changed files with 349 additions and 0 deletions

View File

@@ -32,6 +32,10 @@
#if HAVE_SPARK_HARDWARE
#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 +82,32 @@ class CFbAccelSTi
void setBlendLevel(int);
};
class CFbAccelCS
: 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 add_gxa_sync_marker(void);
void setupGXA(void);
void setColor(fb_pixel_t col);
void run(void);
fb_pixel_t *backbuffer;
public:
CFbAccelCS();
~CFbAccelCS();
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 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);
fb_pixel_t * getBackBufferPointer() const;
void setBlendMode(uint8_t);
void setBlendLevel(int);
};
#endif