- pick mipsbox code from DDT, TangoCash and max10

Conflicts:
	src/gui/cam_menu.cpp
	src/gui/update.cpp
	src/neutrino.cpp

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2019-05-03 22:50:45 +02:00
committed by Thilo Graf
parent 15e8b2d5ea
commit 8991ed60f4
25 changed files with 148 additions and 56 deletions

View File

@@ -93,6 +93,11 @@ libneutrino_driver_a_SOURCES += \
fb_accel_arm.cpp \
simple_display.cpp
endif
if BOXTYPE_MIPSBOX
libneutrino_driver_a_SOURCES += \
fb_accel_mips.cpp \
simple_display.cpp
endif
if USE_STB_HAL
AM_CPPFLAGS += \
@DIRECTFB_CFLAGS@

View File

@@ -5,6 +5,6 @@
#if HAVE_TRIPLEDRAGON
#include <driver/lcdd.h>
#endif
#if HAVE_SPARK_HARDWARE || HAVE_AZBOX_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE
#if HAVE_SPARK_HARDWARE || HAVE_AZBOX_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
#include <driver/simple_display.h>
#endif

View File

@@ -227,4 +227,19 @@ class CFbAccelARM
void setOsdResolutions();
};
class CFbAccelMIPS
: public CFbAccel
{
private:
fb_pixel_t *backbuffer;
public:
CFbAccelMIPS();
~CFbAccelMIPS();
fb_pixel_t * getBackBufferPointer() const;
int setMode(unsigned int xRes, unsigned int yRes, unsigned int bpp);
int scale2Res(int size);
bool fullHdAvailable();
void setOsdResolutions();
};
#endif

View File

@@ -143,6 +143,9 @@ CFrameBuffer* CFrameBuffer::getInstance()
#endif
#if HAVE_ARM_HARDWARE
frameBuffer = new CFbAccelARM();
#endif
#if HAVE_MIPS_HARDWARE
frameBuffer = new CFbAccelMIPS();
#endif
if (!frameBuffer)
frameBuffer = new CFrameBuffer();

View File

@@ -737,7 +737,7 @@ void CRadioText::run()
uint current_pid = 0;
printf("CRadioText::run: ###################### Starting thread ######################\n");
#if HAVE_SPARK_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE
#if HAVE_SPARK_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
int buflen = 0;
unsigned char *buf = NULL;
audioDemux = new cDemux(0); // live demux
@@ -768,7 +768,7 @@ void CRadioText::run()
}
mutex.unlock();
if (pid) {
#if HAVE_SPARK_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE
#if HAVE_SPARK_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
int n;
unsigned char tmp[6];
@@ -811,7 +811,7 @@ void CRadioText::run()
}
}
}
#if HAVE_SPARK_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE
#if HAVE_SPARK_HARDWARE || HAVE_GENERIC_HARDWARE || HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
if (buf)
free(buf);
#endif

View File

@@ -1341,7 +1341,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
now_pressed -= (t2.tv_usec + t2.tv_sec * 1000000ULL);
}
SHTDCNT::getInstance()->resetSleepTimer();
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
if ((ev.code == 0 || ev.code == 1) && ev.value && firstKey)
continue;
#endif
@@ -1735,7 +1735,7 @@ int CRCInput::translate(int code)
return RC_page_up;
case KEY_CHANNELDOWN:
return RC_page_down;
#ifdef HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARERE
case KEY_SWITCHVIDEOMODE:
return RC_mode;
case KEY_VIDEO:

View File

@@ -223,7 +223,7 @@ class CRCInput
RC_tv = KEY_TV,
RC_radio = KEY_RADIO,
RC_text = KEY_TEXT,
#if BOXMODEL_VUSOLO4K
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO
RC_info = 0xFFFE,
RC_epg = KEY_INFO,
#else

View File

@@ -176,7 +176,7 @@ void CRecordInstance::WaitRecMsg(time_t StartTime, time_t WaitTime)
usleep(100000);
}
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
void recordingFailureHelper(void *data)
{
CRecordInstance *inst = (CRecordInstance *) data;
@@ -276,7 +276,7 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
if (record == NULL)
{
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
record = new cRecord(channel->getRecordDemux(), g_settings.recording_bufsize_dmx * 1024 * 1024, g_settings.recording_bufsize * 1024 * 1024);
record->setFailureCallback(&recordingFailureHelper, this);
#else

View File

@@ -57,7 +57,7 @@ static bool usb_icon = false;
static bool timer_icon = false;
#endif
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
#define DISPLAY_DEV "/dev/dbox/oled0"
#include <zapit/zapit.h>
static bool usb_icon = false;
@@ -239,7 +239,7 @@ void CLCD::showServicename(std::string name, bool)
strncpy(display_text, servicename.c_str(), sizeof(display_text) - 1);
display_text[sizeof(display_text) - 1] = '\0';
upd_display = true;
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
}
@@ -323,7 +323,7 @@ void CLCD::showTime(bool force)
if (force || last_display || (switch_name_time_cnt == 0 && ((hour != t->tm_hour) || (minute != t->tm_min)))) {
hour = t->tm_hour;
minute = t->tm_min;
#if !HAVE_SPARK_HARDWARE && !HAVE_ARM_HARDWARE
#if !HAVE_SPARK_HARDWARE && !HAVE_ARM_HARDWARE && !HAVE_MIPS_HARDWARE
int ret = -1;
#endif
#if HAVE_SPARK_HARDWARE
@@ -334,7 +334,7 @@ void CLCD::showTime(bool force)
#endif
if ((g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) || (g_info.hw_caps->display_type == HW_DISPLAY_LED_NUM))
{
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
if (mode == MODE_STANDBY || (g_settings.lcd_info_line && mode == MODE_TVRADIO))
#else
if (ret < 0 && servicename.empty())
@@ -414,12 +414,12 @@ void CLCD::showVolume(const char vol, const bool update)
SetIcons(SPARK_MUTE, 0);
sprintf(s, vol_fmt[type], volume);
}
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT)
sprintf(s,"%.*s", volume*g_info.hw_caps->display_xres/100, "================");
#endif
ShowText(s);
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
vol_active = true;
@@ -436,7 +436,7 @@ void CLCD::showMenuText(const int, const char *text, const int, const bool)
std::string tmp = text;
replace_umlauts(tmp);
ShowText(tmp.c_str());
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
}
@@ -448,7 +448,7 @@ void CLCD::showAudioTrack(const std::string &, const std::string & title, const
std::string tmp = title;
replace_umlauts(tmp);
ShowText(tmp.c_str());
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
}
@@ -506,7 +506,7 @@ void CLCD::setMode(const MODES m, const char * const title)
showclock = true;
showTime();
}
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
}
@@ -553,6 +553,9 @@ void CLCD::setBrightness(int dimm)
#elif HAVE_ARM_HARDWARE
std::string value = to_string(255/15*dimm);
proc_put("/proc/stb/lcd/oled_brightness", value.c_str(), value.length());
#elif HAVE_MIPS_HARDWARE
std::string value = to_string(255/15*dimm);
proc_put("/proc/stb/fp/oled_brightness", value.c_str(), value.length());
#else
(void)dimm; // avoid compiler warning
#endif
@@ -755,7 +758,7 @@ void CLCD::SetIcons(int, bool)
void CLCD::ShowDiskLevel()
{
#if !HAVE_GENERIC_HARDWARE && !HAVE_ARM_HARDWARE
#if !HAVE_GENERIC_HARDWARE && !HAVE_ARM_HARDWARE && !HAVE_MIPS_HARDWARE
int hdd_icons[9] ={24, 23, 21, 20, 19, 18, 17, 16, 22};
int percent, digits, i, j;
uint64_t t, u;
@@ -794,7 +797,7 @@ void CLCD::UpdateIcons()
ShowDiskLevel();
SetIcons(SPARK_USB, usb_icon);
#endif
#if HAVE_SPARK_HARDWARE || HAVE_ARM_HARDWARE
#if HAVE_SPARK_HARDWARE || HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
CZapitChannel * chan = CZapit::getInstance()->GetCurrentChannel();
if (chan)
{

View File

@@ -113,7 +113,7 @@ void CVolume::setVolume(const neutrino_msg_t key)
neutrino_msg_data_t data = 0;
uint64_t timeoutEnd = 0;
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
if (g_settings.hdmi_cec_volume)
g_settings.current_volume = hdmi_cec::getInstance()->GetVolume();
#endif
@@ -136,7 +136,7 @@ void CVolume::setVolume(const neutrino_msg_t key)
g_RCInput->getMsg(&tmp, &data, 0);
if (tmp != CRCInput::RC_timeout)
g_RCInput->postMsg(tmp, data);
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
}
else if (g_settings.hdmi_cec_volume)
{