CFbAccel arm and mips more enable acc

Origin commit data
------------------
Branch: ni/coolstream
Commit: 060e6dc41f
Author: Frankenstone <dampf_acc@online.de>
Date: 2020-06-12 (Fri, 12 Jun 2020)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Frankenstone
2020-06-12 20:54:46 +02:00
committed by vanhofen
parent efb8b5ccd3
commit e3d2e27d76
3 changed files with 41 additions and 4 deletions

View File

@@ -213,9 +213,15 @@ class CFbAccelTD
}; };
class CFbAccelARM class CFbAccelARM
#if ENABLE_ARM_ACC
: public OpenThreads::Thread, public CFbAccel : public OpenThreads::Thread, public CFbAccel
#else
: public CFbAccel
#endif
{ {
private: private:
#if ENABLE_ARM_ACC
void run(void); void run(void);
void blit(void); void blit(void);
void _blit(void); void _blit(void);
@@ -223,6 +229,7 @@ class CFbAccelARM
bool blit_pending; bool blit_pending;
OpenThreads::Condition blit_cond; OpenThreads::Condition blit_cond;
OpenThreads::Mutex blit_mutex; OpenThreads::Mutex blit_mutex;
#endif
fb_pixel_t *backbuffer; fb_pixel_t *backbuffer;
public: public:
CFbAccelARM(); CFbAccelARM();
@@ -238,9 +245,14 @@ class CFbAccelARM
}; };
class CFbAccelMIPS class CFbAccelMIPS
#if ENABLE_MIPS_ACC
: public OpenThreads::Thread, public CFbAccel : public OpenThreads::Thread, public CFbAccel
#else
: public CFbAccel
#endif
{ {
private: private:
#if ENABLE_MIPS_ACC
void run(void); void run(void);
void blit(void); void blit(void);
void _blit(void); void _blit(void);
@@ -248,6 +260,7 @@ class CFbAccelMIPS
bool blit_pending; bool blit_pending;
OpenThreads::Condition blit_cond; OpenThreads::Condition blit_cond;
OpenThreads::Mutex blit_mutex; OpenThreads::Mutex blit_mutex;
#endif
fb_pixel_t *backbuffer; fb_pixel_t *backbuffer;
public: public:
CFbAccelMIPS(); CFbAccelMIPS();

View File

@@ -39,13 +39,18 @@
#include <stdlib.h> #include <stdlib.h>
#if ENABLE_ARM_ACC
#include <driver/abstime.h> #include <driver/abstime.h>
#endif
#include <system/set_threadname.h> #include <system/set_threadname.h>
#include <gui/color.h> #include <gui/color.h>
#define LOGTAG "[fb_accel_arm] " #define LOGTAG "[fb_accel_arm] "
#if ENABLE_ARM_ACC
#define FBIO_BLIT 0x22 #define FBIO_BLIT 0x22
#endif
#define FBIO_ACCEL 0x23 #define FBIO_ACCEL 0x23
static unsigned int displaylist[1024]; static unsigned int displaylist[1024];
@@ -58,6 +63,7 @@ static bool supportblendingflags = true;
static int fb_fd = -1; static int fb_fd = -1;
static int exec_list(void); static int exec_list(void);
#if ENABLE_ARM_ACC
static bool accumulateoperations = false; static bool accumulateoperations = false;
bool bcm_accel_has_alphablending() bool bcm_accel_has_alphablending()
@@ -223,6 +229,7 @@ void bcm_accel_fill(
if (!accumulateoperations) exec_list(); if (!accumulateoperations) exec_list();
} }
#endif
static int exec_list(void) static int exec_list(void)
{ {
@@ -244,7 +251,9 @@ static int exec_list(void)
CFbAccelARM::CFbAccelARM() CFbAccelARM::CFbAccelARM()
{ {
#if ENABLE_ARM_ACC
blit_thread = false; blit_thread = false;
#endif
fb_name = "armbox framebuffer"; fb_name = "armbox framebuffer";
fb_fd = open(FB_DEVICE, O_RDWR); fb_fd = open(FB_DEVICE, O_RDWR);
if (fb_fd < 0) if (fb_fd < 0)
@@ -267,18 +276,21 @@ CFbAccelARM::CFbAccelARM()
/* hardware doesn't allow us to detect whether the opcode is working */ /* hardware doesn't allow us to detect whether the opcode is working */
supportblendingflags = false; supportblendingflags = false;
#endif #endif
#if ENABLE_ARM_ACC
OpenThreads::Thread::start(); OpenThreads::Thread::start();
#endif
} }
CFbAccelARM::~CFbAccelARM() CFbAccelARM::~CFbAccelARM()
{ {
#if ENABLE_ARM_ACC
if (blit_thread) if (blit_thread)
{ {
blit_thread = false; blit_thread = false;
blit(); /* wakes up the thread */ blit(); /* wakes up the thread */
OpenThreads::Thread::join(); OpenThreads::Thread::join();
} }
#endif
if (fb_fd >= 0) if (fb_fd >= 0)
{ {
close(fb_fd); close(fb_fd);
@@ -397,6 +409,7 @@ bool CFbAccelARM::fullHdAvailable()
return false; return false;
} }
#if ENABLE_ARM_ACC
#define BLIT_INTERVAL_MIN 40 #define BLIT_INTERVAL_MIN 40
#define BLIT_INTERVAL_MAX 250 #define BLIT_INTERVAL_MAX 250
void CFbAccelARM::run() void CFbAccelARM::run()
@@ -442,7 +455,6 @@ void CFbAccelARM::_blit()
printf("FBIO_BLIT"); printf("FBIO_BLIT");
} }
#if ENABLE_ARM_ACC
void CFbAccelARM::paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col) void CFbAccelARM::paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col)
{ {
if(dx <1 || dy <1 ) if(dx <1 || dy <1 )

View File

@@ -39,13 +39,18 @@
#include <stdlib.h> #include <stdlib.h>
#if ENABLE_MIPS_ACC
#include <driver/abstime.h> #include <driver/abstime.h>
#endif
#include <system/set_threadname.h> #include <system/set_threadname.h>
#include <gui/color.h> #include <gui/color.h>
#define LOGTAG "[fb_accel_mips] " #define LOGTAG "[fb_accel_mips] "
#if ENABLE_MIPS_ACC
#define FBIO_BLIT 0x22 #define FBIO_BLIT 0x22
#endif
#define FBIO_ACCEL 0x23 #define FBIO_ACCEL 0x23
static unsigned int displaylist[1024]; static unsigned int displaylist[1024];
@@ -58,6 +63,7 @@ static bool supportblendingflags = true;
static int fb_fd = -1; static int fb_fd = -1;
static int exec_list(void); static int exec_list(void);
#if ENABLE_MIPS_ACC
static bool accumulateoperations = false; static bool accumulateoperations = false;
bool bcm_accel_has_alphablending() bool bcm_accel_has_alphablending()
@@ -223,6 +229,7 @@ void bcm_accel_fill(
if (!accumulateoperations) exec_list(); if (!accumulateoperations) exec_list();
} }
#endif
static int exec_list(void) static int exec_list(void)
{ {
@@ -244,7 +251,9 @@ static int exec_list(void)
CFbAccelMIPS::CFbAccelMIPS() CFbAccelMIPS::CFbAccelMIPS()
{ {
#if ENABLE_MIPS_ACC
blit_thread = false; blit_thread = false;
#endif
fb_name = "mipsbox framebuffer"; fb_name = "mipsbox framebuffer";
fb_fd = open(FB_DEVICE, O_RDWR); fb_fd = open(FB_DEVICE, O_RDWR);
if (fb_fd < 0) if (fb_fd < 0)
@@ -268,18 +277,21 @@ CFbAccelMIPS::CFbAccelMIPS()
/* hardware doesn't allow us to detect whether the opcode is working */ /* hardware doesn't allow us to detect whether the opcode is working */
supportblendingflags = false; supportblendingflags = false;
#endif #endif
#if ENABLE_MIPS_ACC
OpenThreads::Thread::start(); OpenThreads::Thread::start();
#endif
} }
CFbAccelMIPS::~CFbAccelMIPS() CFbAccelMIPS::~CFbAccelMIPS()
{ {
#if ENABLE_MIPS_ACC
if (blit_thread) if (blit_thread)
{ {
blit_thread = false; blit_thread = false;
blit(); /* wakes up the thread */ blit(); /* wakes up the thread */
OpenThreads::Thread::join(); OpenThreads::Thread::join();
} }
#endif
if (fb_fd >= 0) if (fb_fd >= 0)
{ {
close(fb_fd); close(fb_fd);
@@ -398,6 +410,7 @@ bool CFbAccelMIPS::fullHdAvailable()
return false; return false;
} }
#if ENABLE_MIPS_ACC
#define BLIT_INTERVAL_MIN 40 #define BLIT_INTERVAL_MIN 40
#define BLIT_INTERVAL_MAX 250 #define BLIT_INTERVAL_MAX 250
void CFbAccelMIPS::run() void CFbAccelMIPS::run()
@@ -443,7 +456,6 @@ void CFbAccelMIPS::_blit()
printf("FBIO_BLIT"); printf("FBIO_BLIT");
} }
#if ENABLE_MIPS_ACC
void CFbAccelMIPS::paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col) void CFbAccelMIPS::paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col)
{ {
if(dx <1 || dy <1 ) if(dx <1 || dy <1 )