fix fading for mips hardware

- untested !


Origin commit data
------------------
Branch: ni/coolstream
Commit: 544fbd1ee2
Author: Frankenstone <dampf_acc@online.de>
Date: 2021-04-23 (Fri, 23 Apr 2021)



------------------
This commit was generated by Migit
This commit is contained in:
Frankenstone
2021-04-23 16:49:40 +02:00
committed by vanhofen
parent 1844849372
commit cf192d78f1
2 changed files with 22 additions and 0 deletions

View File

@@ -245,6 +245,8 @@ class CFbAccelMIPS
int scale2Res(int size);
bool fullHdAvailable();
void setOsdResolutions();
void setBlendMode(uint8_t mode);
void setBlendLevel(int level);
#if ENABLE_MIPS_ACC
void paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col);
#endif

View File

@@ -317,6 +317,26 @@ void CFbAccelMIPS::setOsdResolutions()
}
}
/* original interface: 1 == pixel alpha, 2 == global alpha premultiplied */
void CFbAccelMIPS::setBlendMode(uint8_t mode)
{
/* mode = 1 => reset to no extra transparency */
if (mode == 1)
setBlendLevel(0);
}
/* level = 100 -> transparent, level = 0 -> nontransparent */
void CFbAccelMIPS::setBlendLevel(int level)
{
char tmp[3]={0x0};
int _level = 0xff - ( level * 0xff / 100);
sprintf(tmp,"%d", _level);
int pfd = open("/proc/stb/video/alpha", O_WRONLY);
if (pfd)
write(pfd, tmp, sizeof(tmp));
close(pfd);
}
int CFbAccelMIPS::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp)
{
if (!available&&!active)