projects/Odroid_C2: use WeTek Hub patches

This moves aarch64 common patches to $PKG_DIR/patches/aarch64 until $DEVICE is supported
This commit is contained in:
Jonas Karlman 2016-09-19 21:52:29 +02:00
parent 73b406c456
commit 40cab058da
19 changed files with 0 additions and 1876 deletions

View File

@ -1,11 +0,0 @@
diff -Naur a/configure.ac b/configure.ac
--- a/configure.ac 2016-02-10 07:28:43.854521022 +0100
+++ b/configure.ac 2016-02-10 07:42:40.195015151 +0100
@@ -126,7 +126,6 @@
AX_C_CHECK_FLAG([-pedantic],[],[],[CFLAGS="$CFLAGS -pedantic"],[])
AX_C_CHECK_FLAG([-flto],[],[],[CFLAGS="$CFLAGS -flto"],[])
AX_C_CHECK_FLAG([-fvisibility=hidden],[],[],[CFLAGS="$CFLAGS -fvisibility=hidden"],[])
-AX_C_CHECK_FLAG([-Werror],[],[],[CFLAGS="$CFLAGS -Werror"],[])
AX_C_CHECK_FLAG([-Wall],[],[],[CFLAGS="$CFLAGS -Wall"],[])
AX_C_CHECK_FLAG([-Wextra],[],[],[CFLAGS="$CFLAGS -Wextra"],[])
AX_C_CHECK_FLAG([-Wcast-qual],[],[],[CFLAGS="$CFLAGS -Wcast-qual"],[])

View File

@ -1,25 +0,0 @@
From be8eb87a89b6d074c16b6d4d138bfe0ff16aa663 Mon Sep 17 00:00:00 2001
From: Markus Pfau <pfau@peakwork.de>
Date: Wed, 24 Aug 2016 19:16:24 +0200
Subject: [PATCH] OMX_PTS type decision by sizeof(long)
---
xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
index ca8e964..e384711 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
@@ -1895,7 +1895,7 @@ int CAMLCodec::DequeueBuffer(int64_t &pts)
// Since kernel 3.14 Amlogic changed length and units of PTS values reported here.
// To differentiate such PTS values we check for existence of omx_pts_interval_lower
// parameter, because it was introduced since kernel 3.14.
- if (access("/sys/module/amvideo/parameters/omx_pts_interval_lower", F_OK) != -1)
+ if (1)
{
pts = vbuf.timestamp.tv_sec & 0xFFFFFFFF;
pts <<= 32;
--
1.9.1

View File

@ -1,730 +0,0 @@
From 99f9fb9e1df7f6877bbce3cf90ebf24cacea1797 Mon Sep 17 00:00:00 2001
From: Markus Pfau <pfau@peakwork.de>
Date: Tue, 23 Aug 2016 00:06:43 +0200
Subject: [PATCH] oversun-changes
---
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 39 ++++++---
.../cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp | 13 +--
xbmc/utils/AMLUtils.cpp | 93 ++++++++++++++++++--
xbmc/utils/CPUInfo.cpp | 25 +++---
xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | 98 ++++++++++++++++------
xbmc/windowing/egl/EGLNativeTypeAmlogic.h | 19 ++++-
6 files changed, 221 insertions(+), 66 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
index 4bb159f..ea2db01 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -490,6 +490,7 @@ snd_pcm_chmap_t* CAESinkALSA::SelectALSAChannelMap(const CAEChannelInfo& info)
void CAESinkALSA::GetAESParams(const AEAudioFormat& format, std::string& params)
{
+#if !defined(HAS_LIBAMCODEC)
if (m_passthrough)
params = "AES0=0x06";
else
@@ -506,6 +507,7 @@ void CAESinkALSA::GetAESParams(const AEAudioFormat& format, std::string& params)
else if (format.m_sampleRate == 44100) params += ",AES3=0x00";
else if (format.m_sampleRate == 32000) params += ",AES3=0x03";
else params += ",AES3=0x01";
+#endif
}
bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device)
@@ -744,16 +746,16 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig
snd_pcm_hw_params_get_buffer_size_max(hw_params, &bufferSize);
snd_pcm_hw_params_get_period_size_max(hw_params, &periodSize, NULL);
- /*
- We want to make sure, that we have max 200 ms Buffer with
+ /*
+ We want to make sure, that we have max 200 ms Buffer with
a periodSize of approx 50 ms. Choosing a higher bufferSize
will cause problems with menu sounds. Buffer will be increased
after those are fixed.
*/
periodSize = std::min(periodSize, (snd_pcm_uframes_t) sampleRate / 20);
bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) sampleRate / 5);
-
- /*
+
+ /*
According to upstream we should set buffer size first - so make sure it is always at least
4x period size to not get underruns (some systems seem to have issues with only 2 periods)
*/
@@ -772,7 +774,7 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig
snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy
CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Request: Failed to limit periodSize to %lu", periodSizeMax);
}
-
+
// first trying bufferSize, PeriodSize
// for more info see here:
// http://mailman.alsa-project.org/pipermail/alsa-devel/2009-September/021069.html
@@ -782,22 +784,24 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig
snd_pcm_uframes_t periodSizeTemp, bufferSizeTemp;
periodSizeTemp = periodSize;
bufferSizeTemp = bufferSize;
- if (snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0
- || snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0
+ int dir = 0;
+
+ if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, &dir) != 0
+ || snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0
|| snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
{
bufferSize = bufferSizeTemp;
periodSize = periodSizeTemp;
// retry with PeriodSize, bufferSize
snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy
- if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0
+ if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, &dir) != 0
|| snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0
|| snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
{
// try only periodSize
periodSize = periodSizeTemp;
snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy
- if(snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0
+ if(snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, &dir) != 0
|| snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
{
// try only BufferSize
@@ -819,7 +823,7 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig
snd_pcm_get_params(m_pcm, &bufferSize, &periodSize);
}
}
-
+
CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Got: periodSize %lu, bufferSize %lu", periodSize, bufferSize);
/* set the format parameters */
@@ -1302,6 +1306,15 @@ void CAESinkALSA::EnumerateDevicesEx(AEDeviceInfoList &list, bool force)
AEDeviceType CAESinkALSA::AEDeviceTypeFromName(const std::string &name)
{
+
+#if defined(HAS_LIBAMCODEC)
+ // ugly workaround to show DTS / AC3 caps
+ // but don't run into multi channel issues
+ // as we can only open 2 pcm channels
+ // God, forgive me I wrote this
+ return AE_DEVTYPE_IEC958;
+#endif
+
if (name.substr(0, 4) == "hdmi")
return AE_DEVTYPE_HDMI;
else if (name.substr(0, 6) == "iec958" || name.substr(0, 5) == "spdif")
@@ -1406,9 +1419,9 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev
if (badHDMI)
{
- /*
- * Warn about disconnected devices, but keep them enabled
- * Detection can go wrong on Intel, Nvidia and on all
+ /*
+ * Warn about disconnected devices, but keep them enabled
+ * Detection can go wrong on Intel, Nvidia and on all
* AMD (fglrx) hardware, so it is not safe to close those
* handles
*/
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
index 5dadf82..ca8e964 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
@@ -398,7 +398,7 @@ void dumpfile_write(am_private_t *para, void* buf, int bufsiz)
}
if (para->dumpdemux && para->dumpfile != -1)
- write(para->dumpfile, buf, bufsiz);
+ int ret = write(para->dumpfile, buf, bufsiz);
}
static vformat_t codecid_to_vformat(enum AVCodecID id)
@@ -713,7 +713,7 @@ int write_av_packet(am_private_t *para, am_packet_t *pkt)
}
pkt->newflag = 0;
}
-
+
buf = pkt->data;
size = pkt->data_size ;
if (size == 0 && pkt->isvalid) {
@@ -1563,7 +1563,7 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints)
// h264 in an avi file
if (m_hints.ptsinvalid)
am_private->gcodec.param = (void*)(EXTERNAL_PTS | SYNC_OUTSIDE);
- break;
+ break;
case VFORMAT_REAL:
am_private->stream_type = AM_STREAM_RM;
am_private->vcodec.noblock = 1;
@@ -1628,7 +1628,7 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints)
Create();
- m_display_rect = CRect(0, 0, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iWidth, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iHeight);
+ m_display_rect = CRect(0, 0, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenWidth, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenHeight);
std::string strScaler;
SysfsUtils::GetString("/sys/class/ppmgr/ppscaler", strScaler);
@@ -2154,7 +2154,6 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
int diff = (int) ((dst_rect.Height() - dst_rect.Width()) / 2);
dst_rect = CRect(DestRect.x1 - diff, DestRect.y1, DestRect.x2 + diff, DestRect.y2);
}
-
}
if (m_dst_rect != dst_rect)
@@ -2176,7 +2175,7 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
#ifdef TARGET_ANDROID
display = m_display_rect;
#else
- display = gui;
+ display = CRect(0, 0, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenWidth, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenHeight);;
#endif
if (gui != display)
{
@@ -2248,6 +2247,8 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
std::string s_gui = StringUtils::Format("%i,%i,%i,%i",
(int)gui.x1, (int)gui.y1,
(int)gui.Width(), (int)gui.Height());
+ CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:SrcRect(%i,%i,%i,%i)", (int)SrcRect.x1, (int)SrcRect.y1, (int)SrcRect.Width(), (int)SrcRect.Height());
+ CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:DestRect(%i,%i,%i,%i)", (int)DestRect.x1, (int)DestRect.y1, (int)DestRect.Width(), (int)DestRect.Height());
CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:display(%s)", s_display.c_str());
CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:gui(%s)", s_gui.c_str());
CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_dst_rect(%s)", s_m_dst_rect.c_str());
diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp
index 80fb453..0f0fef0 100644
--- a/xbmc/utils/AMLUtils.cpp
+++ b/xbmc/utils/AMLUtils.cpp
@@ -78,7 +78,7 @@ bool aml_wired_present()
}
bool aml_permissions()
-{
+{
if (!aml_present())
return false;
@@ -209,7 +209,8 @@ bool aml_support_h264_4k2k()
void aml_set_audio_passthrough(bool passthrough)
{
- SysfsUtils::SetInt("/sys/class/audiodsp/digital_raw", passthrough ? 2:0);
+ CLog::Log(LOGDEBUG, "AML: Setting passthrough %d", passthrough);
+ SysfsUtils::SetString("/sys/class/audiodsp/digital_raw", passthrough ? "2":"0");
}
void aml_probe_hdmi_audio()
@@ -227,7 +228,7 @@ void aml_probe_hdmi_audio()
{
char valstr[1024] = {0};
- read(fd, valstr, sizeof(valstr) - 1);
+ int tmp = read(fd, valstr, sizeof(valstr) - 1);
valstr[strlen(valstr)] = '\0';
close(fd);
@@ -362,6 +363,60 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
res->fRefreshRate = 50;
res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
}
+ else if (StringUtils::EqualsNoCase(fromMode, "720p23hz")) // fake
+ {
+ res->iWidth = 1280;
+ res->iHeight= 720;
+ res->iScreenWidth = 1280;
+ res->iScreenHeight= 720;
+ res->fRefreshRate = 23.98;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
+ else if (StringUtils::EqualsNoCase(fromMode, "720p24hz")) // fake
+ {
+ res->iWidth = 1280;
+ res->iHeight= 720;
+ res->iScreenWidth = 1280;
+ res->iScreenHeight= 720;
+ res->fRefreshRate = 24;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
+ else if (StringUtils::EqualsNoCase(fromMode, "720p25hz")) // fake
+ {
+ res->iWidth = 1280;
+ res->iHeight= 720;
+ res->iScreenWidth = 1280;
+ res->iScreenHeight= 720;
+ res->fRefreshRate = 25;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
+ else if (StringUtils::EqualsNoCase(fromMode, "720p29hz")) // fake
+ {
+ res->iWidth = 1280;
+ res->iHeight= 720;
+ res->iScreenWidth = 1280;
+ res->iScreenHeight= 720;
+ res->fRefreshRate = 29.97;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
+ else if (StringUtils::EqualsNoCase(fromMode, "720p30hz")) // fake
+ {
+ res->iWidth = 1280;
+ res->iHeight= 720;
+ res->iScreenWidth = 1280;
+ res->iScreenHeight= 720;
+ res->fRefreshRate = 30;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
+ else if (StringUtils::EqualsNoCase(fromMode, "720p59hz")) // real
+ {
+ res->iWidth = 1280;
+ res->iHeight= 720;
+ res->iScreenWidth = 1280;
+ res->iScreenHeight= 720;
+ res->fRefreshRate = 59.94;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
else if (StringUtils::EqualsNoCase(fromMode, "720p") || StringUtils::EqualsNoCase(fromMode, "720p60hz"))
{
res->iWidth = 1280;
@@ -407,6 +462,24 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
res->fRefreshRate = 24;
res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
}
+ else if (StringUtils::EqualsNoCase(fromMode, "1080p25hz"))
+ {
+ res->iWidth = 1920;
+ res->iHeight= 1080;
+ res->iScreenWidth = 1920;
+ res->iScreenHeight= 1080;
+ res->fRefreshRate = 25;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
+ else if (StringUtils::EqualsNoCase(fromMode, "1080p29hz")) // fake
+ {
+ res->iWidth = 1920;
+ res->iHeight= 1080;
+ res->iScreenWidth = 1920;
+ res->iScreenHeight= 1080;
+ res->fRefreshRate = 29.97;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
else if (StringUtils::EqualsNoCase(fromMode, "1080p30hz"))
{
res->iWidth = 1920;
@@ -515,7 +588,7 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
res->fRefreshRate = 30;
res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
}
- else if (StringUtils::EqualsNoCase(fromMode, "2160p50hz420"))
+ else if (StringUtils::EqualsNoCase(fromMode, "2160p50hz"))
{
res->iWidth = 1920;
res->iHeight= 1080;
@@ -524,7 +597,16 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
res->fRefreshRate = 50;
res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
}
- else if (StringUtils::EqualsNoCase(fromMode, "2160p60hz420"))
+ else if (StringUtils::EqualsNoCase(fromMode, "4k2k59hz") || StringUtils::EqualsNoCase(fromMode, "2160p59hz"))
+ {
+ res->iWidth = 1920;
+ res->iHeight= 1080;
+ res->iScreenWidth = 3840;
+ res->iScreenHeight= 2160;
+ res->fRefreshRate = 59.940;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
+ else if (StringUtils::EqualsNoCase(fromMode, "2160p60hz"))
{
res->iWidth = 1920;
res->iHeight= 1080;
@@ -549,4 +631,3 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
return res->iWidth > 0 && res->iHeight> 0;
}
-
diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp
index 6377d35..b50b288 100644
--- a/xbmc/utils/CPUInfo.cpp
+++ b/xbmc/utils/CPUInfo.cpp
@@ -120,7 +120,7 @@ CCPUInfo::CCPUInfo(void)
size_t len = 4;
std::string cpuVendor;
-
+
// The number of cores.
if (sysctlbyname("hw.activecpu", &m_cpuCount, &len, NULL, 0) == -1)
m_cpuCount = 1;
@@ -141,7 +141,7 @@ CCPUInfo::CCPUInfo(void)
len = 512;
if (sysctlbyname("machdep.cpu.vendor", &buffer, &len, NULL, 0) == 0)
cpuVendor = buffer;
-
+
#endif
// Go through each core.
for (int i=0; i<m_cpuCount; i++)
@@ -266,9 +266,9 @@ CCPUInfo::CCPUInfo(void)
if (m_fProcTemperature == NULL)
m_fProcTemperature = fopen("/proc/acpi/thermal_zone/TZ0/temperature", "r");
// read from the new location of the temperature data on new kernels, 2.6.39, 3.0 etc
- if (m_fProcTemperature == NULL)
+ if (m_fProcTemperature == NULL)
m_fProcTemperature = fopen("/sys/class/hwmon/hwmon0/temp1_input", "r");
- if (m_fProcTemperature == NULL)
+ if (m_fProcTemperature == NULL)
m_fProcTemperature = fopen("/sys/class/thermal/thermal_zone0/temp", "r"); // On Raspberry PIs
m_fCPUFreq = fopen ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
@@ -551,7 +551,7 @@ float CCPUInfo::getCPUFrequency()
return float(cnt.FirstValue);
}
}
-
+
if (!m_cores.empty())
return float(m_cores.begin()->second.m_fSpeed);
else
@@ -597,7 +597,7 @@ bool CCPUInfo::getTemperature(CTemperature& temperature)
{
int value = 0;
char scale = 0;
-
+
#ifdef TARGET_POSIX
#if defined(TARGET_DARWIN_OSX)
value = SMCGetTemperature(SMC_KEY_CPU_TEMP);
@@ -626,23 +626,24 @@ bool CCPUInfo::getTemperature(CTemperature& temperature)
// procfs is deprecated in the linux kernel, we should move away from
// using it for temperature data. It doesn't seem that sysfs has a
// general enough interface to bother implementing ATM.
-
+
rewind(m_fProcTemperature);
fflush(m_fProcTemperature);
ret = fscanf(m_fProcTemperature, "temperature: %d %c", &value, &scale);
-
+
// read from the temperature file of the new kernels
if (!ret)
{
ret = fscanf(m_fProcTemperature, "%d", &value);
- value = value / 1000;
+ if ((int)value > 1000)
+ value = value / 1000;
scale = 'c';
ret++;
}
}
if (ret != 2)
- return false;
+ return false;
#endif
#endif // TARGET_POSIX
@@ -652,7 +653,7 @@ bool CCPUInfo::getTemperature(CTemperature& temperature)
temperature = CTemperature::CreateFromFahrenheit(value);
else
return false;
-
+
return true;
}
@@ -707,7 +708,7 @@ bool CCPUInfo::readProcStat(unsigned long long& user, unsigned long long& nice,
const LONGLONG deltaTotal = coreTotal - curCore.m_total,
deltaIdle = coreIdle - curCore.m_idle;
const double load = (double(deltaTotal - deltaIdle) * 100.0) / double(deltaTotal);
-
+
// win32 has some problems with calculation of load if load close to zero
curCore.m_fPct = (load < 0) ? 0 : load;
if (load >= 0 || deltaTotal > 5 * 10 * 1000 * 1000) // do not update (smooth) values for 5 seconds on negative loads
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
index 88cd385..cc62734 100644
--- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
@@ -23,13 +23,18 @@
#include "utils/AMLUtils.h"
#include "utils/StringUtils.h"
#include "utils/SysfsUtils.h"
+#include "utils/log.h"
-#include <stdio.h>
#include <stdlib.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <EGL/egl.h>
+#ifdef CLASSNAME
+#undef CLASSNAME
+#endif
+#define CLASSNAME "CEGLNativeTypeAmlogic"
+
CEGLNativeTypeAmlogic::CEGLNativeTypeAmlogic()
{
const char *env_framebuffer = getenv("FRAMEBUFFER");
@@ -53,9 +58,12 @@ bool CEGLNativeTypeAmlogic::CheckCompatibility()
{
std::string name;
std::string modalias = "/sys/class/graphics/" + m_framebuffer_name + "/device/modalias";
+ std::string meson = "meson";
+ std::string fb = "fb";
SysfsUtils::GetString(modalias, name);
- if (name.find("meson") != std::string::npos)
+ StringUtils::Trim(name);
+ if (name.find(meson) != std::string::npos && name.find(fb) != std::string::npos)
return true;
return false;
}
@@ -63,28 +71,37 @@ bool CEGLNativeTypeAmlogic::CheckCompatibility()
void CEGLNativeTypeAmlogic::Initialize()
{
aml_permissions();
- DisableFreeScale();
+ FreeScale(false);
}
+
void CEGLNativeTypeAmlogic::Destroy()
{
+ SetScreenScale(1, 1, false);
return;
}
bool CEGLNativeTypeAmlogic::CreateNativeDisplay()
{
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
m_nativeDisplay = EGL_DEFAULT_DISPLAY;
return true;
}
bool CEGLNativeTypeAmlogic::CreateNativeWindow()
{
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
#if defined(_FBDEV_WINDOW_H_)
fbdev_window *nativeWindow = new fbdev_window;
if (!nativeWindow)
return false;
- nativeWindow->width = 1920;
- nativeWindow->height = 1080;
+ RESOLUTION_INFO res;
+ GetPreferredResolution(&res);
+
+ nativeWindow->width = res.iWidth;
+ nativeWindow->height = res.iHeight;
m_nativeWindow = nativeWindow;
SetFramebufferResolution(nativeWindow->width, nativeWindow->height);
@@ -97,6 +114,8 @@ bool CEGLNativeTypeAmlogic::CreateNativeWindow()
bool CEGLNativeTypeAmlogic::GetNativeDisplay(XBNativeDisplayType **nativeDisplay) const
{
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
if (!nativeDisplay)
return false;
*nativeDisplay = (XBNativeDisplayType*) &m_nativeDisplay;
@@ -105,6 +124,8 @@ bool CEGLNativeTypeAmlogic::GetNativeDisplay(XBNativeDisplayType **nativeDisplay
bool CEGLNativeTypeAmlogic::GetNativeWindow(XBNativeWindowType **nativeWindow) const
{
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
if (!nativeWindow)
return false;
*nativeWindow = (XBNativeWindowType*) &m_nativeWindow;
@@ -113,11 +134,15 @@ bool CEGLNativeTypeAmlogic::GetNativeWindow(XBNativeWindowType **nativeWindow) c
bool CEGLNativeTypeAmlogic::DestroyNativeDisplay()
{
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
return true;
}
bool CEGLNativeTypeAmlogic::DestroyNativeWindow()
{
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
#if defined(_FBDEV_WINDOW_H_)
delete (fbdev_window*)m_nativeWindow, m_nativeWindow = NULL;
#endif
@@ -133,6 +158,8 @@ bool CEGLNativeTypeAmlogic::GetNativeResolution(RESOLUTION_INFO *res) const
bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res)
{
+ CLog::Log(LOGNOTICE, "%s::%s to %dx%d@%f", CLASSNAME, __func__, res.iScreenWidth, res.iScreenHeight, res.fRefreshRate);
+
#if defined(_FBDEV_WINDOW_H_)
if (m_nativeWindow)
{
@@ -152,6 +179,8 @@ bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res)
bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions)
{
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
std::string valstr;
SysfsUtils::GetString("/sys/class/amhdmitx/amhdmitx0/disp_cap", valstr);
std::vector<std::string> probe_str = StringUtils::Split(valstr, "\n");
@@ -164,11 +193,12 @@ bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector<RESOLUTION_INFO> &resol
resolutions.push_back(res);
}
return resolutions.size() > 0;
-
}
bool CEGLNativeTypeAmlogic::GetPreferredResolution(RESOLUTION_INFO *res) const
{
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
// check display/mode, it gets defaulted at boot
if (!GetNativeResolution(res))
{
@@ -181,6 +211,8 @@ bool CEGLNativeTypeAmlogic::GetPreferredResolution(RESOLUTION_INFO *res) const
bool CEGLNativeTypeAmlogic::ShowWindow(bool show)
{
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
std::string blank_framebuffer = "/sys/class/graphics/" + m_framebuffer_name + "/blank";
SysfsUtils::SetInt(blank_framebuffer.c_str(), show ? 0 : 1);
return true;
@@ -188,6 +220,8 @@ bool CEGLNativeTypeAmlogic::ShowWindow(bool show)
bool CEGLNativeTypeAmlogic::SetDisplayResolution(const char *resolution)
{
+ CLog::Log(LOGNOTICE, "%s::%s to %s", CLASSNAME, __func__, resolution);
+
std::string mode = resolution;
// switch display resolution
SysfsUtils::SetString("/sys/class/display/mode", mode.c_str());
@@ -195,36 +229,46 @@ bool CEGLNativeTypeAmlogic::SetDisplayResolution(const char *resolution)
RESOLUTION_INFO res;
aml_mode_to_resolution(mode.c_str(), &res);
SetFramebufferResolution(res);
+ DealWithScale(res);
return true;
}
-void CEGLNativeTypeAmlogic::SetupVideoScaling(const char *mode)
+void CEGLNativeTypeAmlogic::FreeScale(bool state)
{
- SysfsUtils::SetInt("/sys/class/graphics/fb0/blank", 1);
- SysfsUtils::SetInt("/sys/class/graphics/fb0/free_scale", 0);
- SysfsUtils::SetInt("/sys/class/graphics/fb1/free_scale", 0);
- SysfsUtils::SetInt("/sys/class/ppmgr/ppscaler", 0);
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
- if (strstr(mode, "1080"))
- {
- SysfsUtils::SetString("/sys/class/graphics/fb0/request2XScale", "8");
- SysfsUtils::SetString("/sys/class/graphics/fb1/scale_axis", "1280 720 1920 1080");
- SysfsUtils::SetString("/sys/class/graphics/fb1/scale", "0x10001");
- }
- else
- {
- SysfsUtils::SetString("/sys/class/graphics/fb0/request2XScale", "16 1280 720");
+ std::string freescale_framebuffer = "/sys/class/graphics/" + m_framebuffer_name + "/free_scale";
+ SysfsUtils::SetInt(freescale_framebuffer.c_str(), state ? 1 : 0);
+}
+
+void CEGLNativeTypeAmlogic::DealWithScale(const RESOLUTION_INFO &res)
+{
+ CLog::Log(LOGDEBUG, "%s::%s Interface is %dx%d, screen size is %dx%d", CLASSNAME, __func__, res.iWidth, res.iHeight, res.iScreenWidth, res.iScreenHeight);
+
+ if (res.iScreenWidth > res.iWidth && res.iScreenHeight > res.iHeight) {
+ CLog::Log(LOGNOTICE, "%s::%s Scaling interfaces of size %dx%d to full screen", CLASSNAME, __func__, res.iWidth, res.iHeight);
+ SetScreenScale(res.iWidth, res.iHeight, true);
}
+}
- SysfsUtils::SetInt("/sys/class/graphics/fb0/blank", 0);
+void CEGLNativeTypeAmlogic::SetScreenScale(int width, int height, bool state)
+{
+ char setting[256] = {};
+ sprintf(setting, "0 0 %d %d", width - 1 , height - 1);
+ std::string framebuffer = "/sys/class/graphics/" + m_framebuffer_name;
+ SysfsUtils::SetString(framebuffer + "/scale_axis", setting);
+ SysfsUtils::SetString(framebuffer + "/scale", state ? "0x10001" : "0x0");
}
-void CEGLNativeTypeAmlogic::DisableFreeScale()
+bool CEGLNativeTypeAmlogic::IsHdmiConnected() const
{
- // turn off frame buffer freescale
- SysfsUtils::SetInt("/sys/class/graphics/fb0/free_scale", 0);
- SysfsUtils::SetInt("/sys/class/graphics/fb1/free_scale", 0);
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
+
+ std::string hpd_state;
+ SysfsUtils::GetString("/sys/class/amhdmitx/amhdmitx0/disp_cap", hpd_state);
+ StringUtils::Trim(hpd_state);
+ return hpd_state == "1";
}
void CEGLNativeTypeAmlogic::SetFramebufferResolution(const RESOLUTION_INFO &res) const
@@ -244,8 +288,8 @@ void CEGLNativeTypeAmlogic::SetFramebufferResolution(int width, int height) cons
{
vinfo.xres = width;
vinfo.yres = height;
- vinfo.xres_virtual = 1920;
- vinfo.yres_virtual = 2160;
+ vinfo.xres_virtual = width;
+ vinfo.yres_virtual = height * 2;
vinfo.bits_per_pixel = 32;
vinfo.activate = FB_ACTIVATE_ALL;
ioctl(fd0, FBIOPUT_VSCREENINFO, &vinfo);
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
index cfb33ca..bdb08b6 100644
--- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
@@ -24,6 +24,19 @@
#include <vector>
#include "EGLNativeType.h"
+#include <linux/fb.h>
+
+#ifndef _FBDEV_WINDOW_H_
+// Define it right here, since some platforms doesn't has fbdev_window.h at all.
+// This will not make it fail on these platforms badly, since it will fail softly anyway on some other init steps.
+#define _FBDEV_WINDOW_H_
+typedef struct fbdev_window
+{
+ unsigned short width;
+ unsigned short height;
+} fbdev_window;
+#endif
+
class CEGLNativeTypeAmlogic : public CEGLNativeType
{
public:
@@ -52,12 +65,14 @@ public:
protected:
bool SetDisplayResolution(const char *resolution);
- void SetupVideoScaling(const char *mode);
- void DisableFreeScale();
private:
void SetFramebufferResolution(const RESOLUTION_INFO &res) const;
void SetFramebufferResolution(int width, int height) const;
+ void FreeScale(bool state);
+ void DealWithScale(const RESOLUTION_INFO &res);
+ void SetScreenScale(int width, int height, bool state);
+ bool IsHdmiConnected() const;
std::string m_framebuffer_name;
};
--
1.9.1

View File

@ -1,102 +0,0 @@
From a49dd2258d46279466d5aaba44d1f0ee06253ff2 Mon Sep 17 00:00:00 2001
From: kszaq <kszaquitto@gmail.com>
Date: Sun, 4 Sep 2016 00:51:03 +0200
Subject: [PATCH] [aml] Multichannel-PCM and HD Audio passthrough
1. If we want passthrough, is should be redirected to device 1. To make sure device 1 output is enabled, set device 0 to stereo.
2. Set digital_codec parameter to notify sound driver about audio format.
3. Amlogic wants 48kHz for EAC3 passthrough.
4. Identify Amlogic audio output as HDMI.
---
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 59 +++++++++++++++++++++++++++--
1 file changed, 55 insertions(+), 4 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
index 6a9066b..9741e3e 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -38,6 +38,7 @@
#include "settings/AdvancedSettings.h"
#if defined(HAS_LIBAMCODEC)
#include "utils/AMLUtils.h"
+#include "utils/SysfsUtils.h"
#endif
#ifdef TARGET_POSIX
@@ -534,13 +535,57 @@ bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device)
{
m_passthrough = false;
}
-#if defined(HAS_LIBAMCODEC)
- if (aml_present())
+
+ if (device.find("M8AUDIO") != std::string::npos)
{
+ int aml_digital_codec = 0;
+
+ if (m_passthrough)
+ {
+ /* Open 2 channels at device 0 to enable device 1 output to HDMI */
+ ALSAConfig m_inconfig, m_outconfig;
+ snd_config_t *config;
+ m_inconfig = inconfig;
+ m_inconfig.channels = 2;
+ snd_config_copy(&config, snd_config);
+ OpenPCMDevice("hw:AMLM8AUDIO,0", "", m_inconfig.channels, &m_pcm, config);
+ snd_config_delete(config);
+ InitializeHW(m_inconfig, m_outconfig);
+
+ /* Passthrough is supported only by device 1 */
+ device = "hw:AMLM8AUDIO,1";
+
+ switch(format.m_streamInfo.m_type)
+ {
+ case CAEStreamInfo::STREAM_TYPE_AC3:
+ aml_digital_codec = 2;
+ break;
+
+ case CAEStreamInfo::STREAM_TYPE_DTS_512:
+ case CAEStreamInfo::STREAM_TYPE_DTS_1024:
+ case CAEStreamInfo::STREAM_TYPE_DTS_2048:
+ case CAEStreamInfo::STREAM_TYPE_DTSHD_CORE:
+ aml_digital_codec = 3;
+ break;
+
+ case CAEStreamInfo::STREAM_TYPE_EAC3:
+ aml_digital_codec = 4;
+ inconfig.sampleRate = 48000;
+ break;
+
+ case CAEStreamInfo::STREAM_TYPE_DTSHD:
+ aml_digital_codec = 8;
+ break;
+
+ case CAEStreamInfo::STREAM_TYPE_TRUEHD:
+ aml_digital_codec = 7;
+ break;
+ }
+ }
+
aml_set_audio_passthrough(m_passthrough);
- device = "default";
+ SysfsUtils::SetInt("/sys/class/audiodsp/digital_codec", aml_digital_codec);
}
-#endif
if (inconfig.channels == 0)
{
@@ -1550,6 +1595,12 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev
info.m_dataFormats.push_back(i);
}
+ if (info.m_displayName.find("M8AUDIO") != std::string::npos)
+ {
+ info.m_displayNameExtra = "HDMI";
+ info.m_deviceType = AE_DEVTYPE_HDMI;
+ }
+
if (info.m_deviceType == AE_DEVTYPE_HDMI)
{
// we don't trust ELD information and push back our supported formats explicitely
--
1.8.3.1

View File

@ -1,13 +0,0 @@
diff --git a/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp b/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp
index 4e5bcc6..ad5847d 100644
--- a/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp
+++ b/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp
@@ -53,7 +53,7 @@ CLogindUPowerSyscall::CLogindUPowerSyscall()
m_canPowerdown = LogindCheckCapability("CanPowerOff");
m_canReboot = LogindCheckCapability("CanReboot");
m_canHibernate = LogindCheckCapability("CanHibernate");
- m_canSuspend = LogindCheckCapability("CanSuspend");
+ m_canSuspend = false;
InhibitDelayLock();

View File

@ -1,803 +0,0 @@
diff --git a/README.md b/README.md
index dfaf4d6..87491ef 100644
--- a/README.md
+++ b/README.md
@@ -93,6 +93,12 @@ To compile in support for Exynos devices, you have to pass the argument -DHAVE_E
cmake -DHAVE_EXYNOS_API=1 ..
```
+### AOCEC
+To compile in support for AOCEC devices, you have to pass the argument -DHAVE_AOCEC_API=1 to cmake:
+```
+cmake -DHAVE_AOCEC_API=1 ..
+```
+
### TDA995x
To compile in support for TDA995x devices, you have to pass the argument -DHAVE_TDA995X_API=1 to cmake:
```
diff --git a/include/cectypes.h b/include/cectypes.h
index 0fdd48e..881a805 100644
--- a/include/cectypes.h
+++ b/include/cectypes.h
@@ -309,6 +309,16 @@ namespace CEC {
#define CEC_EXYNOS_VIRTUAL_COM "Exynos"
/*!
+ * the path to use for the AOCEC HDMI CEC device
+ */
+#define CEC_AOCEC_PATH "/dev/aocec"
+
+/*!
+ * the name of the virtual COM port to use for the AOCEC' CEC wire
+ */
+#define CEC_AOCEC_VIRTUAL_COM "AOCEC"
+
+/*!
* Mimimum client version
*/
#define CEC_MIN_LIB_VERSION 3
@@ -877,7 +887,8 @@ typedef enum cec_adapter_type
ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2,
ADAPTERTYPE_RPI = 0x100,
ADAPTERTYPE_TDA995x = 0x200,
- ADAPTERTYPE_EXYNOS = 0x300
+ ADAPTERTYPE_EXYNOS = 0x300,
+ ADAPTERTYPE_AOCEC = 0x500
} cec_adapter_type;
/** force exporting through swig */
diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt
index a494533..d3eefa3 100644
--- a/src/libcec/CMakeLists.txt
+++ b/src/libcec/CMakeLists.txt
@@ -87,6 +87,9 @@ set(CEC_HEADERS devices/CECRecordingDevice.h
adapter/Exynos/ExynosCEC.h
adapter/Exynos/ExynosCECAdapterDetection.h
adapter/Exynos/ExynosCECAdapterCommunication.h
+ adapter/AOCEC/AOCEC.h
+ adapter/AOCEC/AOCECAdapterDetection.h
+ adapter/AOCEC/AOCECAdapterCommunication.h
adapter/Pulse-Eight/USBCECAdapterMessageQueue.h
adapter/Pulse-Eight/USBCECAdapterCommunication.h
adapter/Pulse-Eight/USBCECAdapterCommands.h
diff --git a/src/libcec/adapter/AOCEC/AOCEC.h b/src/libcec/adapter/AOCEC/AOCEC.h
new file mode 100644
index 0000000..560fbdd
--- /dev/null
+++ b/src/libcec/adapter/AOCEC/AOCEC.h
@@ -0,0 +1,55 @@
+#pragma once
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
+ * based heavily on:
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing <license@pulse-eight.com>
+ * http://www.pulse-eight.com/
+ * http://www.pulse-eight.net/
+ */
+
+
+#define CEC_DEFAULT_PADDR 0x1000
+
+#define CEC_IOC_MAGIC 'C'
+#define CEC_IOC_GET_PHYSICAL_ADDR _IOR(CEC_IOC_MAGIC, 0x00, uint16_t)
+#define CEC_IOC_GET_VERSION _IOR(CEC_IOC_MAGIC, 0x01, int)
+#define CEC_IOC_GET_VENDOR_ID _IOR(CEC_IOC_MAGIC, 0x02, uint32_t)
+#define CEC_IOC_GET_PORT_INFO _IOR(CEC_IOC_MAGIC, 0x03, int)
+#define CEC_IOC_GET_PORT_NUM _IOR(CEC_IOC_MAGIC, 0x04, int)
+#define CEC_IOC_GET_SEND_FAIL_REASON _IOR(CEC_IOC_MAGIC, 0x05, uint32_t)
+#define CEC_IOC_SET_OPTION_WAKEUP _IOW(CEC_IOC_MAGIC, 0x06, uint32_t)
+#define CEC_IOC_SET_OPTION_ENALBE_CEC _IOW(CEC_IOC_MAGIC, 0x07, uint32_t)
+#define CEC_IOC_SET_OPTION_SYS_CTRL _IOW(CEC_IOC_MAGIC, 0x08, uint32_t)
+#define CEC_IOC_SET_OPTION_SET_LANG _IOW(CEC_IOC_MAGIC, 0x09, uint32_t)
+#define CEC_IOC_GET_CONNECT_STATUS _IOR(CEC_IOC_MAGIC, 0x0A, uint32_t)
+#define CEC_IOC_ADD_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0B, uint32_t)
+#define CEC_IOC_CLR_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0C, uint32_t)
+
+#define CEC_MAX_FRAME_SIZE 16
diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp
new file mode 100644
index 0000000..8edf981
--- /dev/null
+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp
@@ -0,0 +1,343 @@
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
+ * based heavily on:
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing <license@pulse-eight.com>
+ * http://www.pulse-eight.com/
+ * http://www.pulse-eight.net/
+ */
+
+#include "env.h"
+#include <fcntl.h>
+#include <sys/ioctl.h>
+
+
+#if defined(HAVE_AOCEC_API)
+#include "AOCEC.h"
+#include "AOCECAdapterCommunication.h"
+
+#include "CECTypeUtils.h"
+#include "LibCEC.h"
+#include <p8-platform/util/buffer.h>
+
+using namespace CEC;
+using namespace P8PLATFORM;
+
+#define LIB_CEC m_callback->GetLib()
+
+
+CAOCECAdapterCommunication::CAOCECAdapterCommunication(IAdapterCommunicationCallback *callback) :
+ IAdapterCommunication(callback),
+ m_bLogicalAddressChanged(false)
+{
+ CLockObject lock(m_mutex);
+
+ m_logicalAddresses.Clear();
+ m_fd = INVALID_SOCKET_VALUE;
+}
+
+
+CAOCECAdapterCommunication::~CAOCECAdapterCommunication(void)
+{
+ Close();
+}
+
+
+bool CAOCECAdapterCommunication::IsOpen(void)
+{
+ CLockObject lock(m_mutex);
+ return IsInitialised() && m_fd != INVALID_SOCKET_VALUE;
+}
+
+
+bool CAOCECAdapterCommunication::Open(uint32_t UNUSED(iTimeoutMs), bool UNUSED(bSkipChecks), bool bStartListening)
+{
+ if (IsOpen())
+ Close();
+
+ CLockObject lock(m_mutex);
+
+ if ((m_fd = open(CEC_AOCEC_PATH, O_RDWR)) > 0)
+ {
+ uint32_t enable = true;
+
+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable))
+ {
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__);
+ return false;
+ }
+
+ if (!bStartListening || CreateThread()) {
+ return true;
+ }
+ close(m_fd);
+ m_fd = INVALID_SOCKET_VALUE;
+ }
+ return false;
+}
+
+
+void CAOCECAdapterCommunication::Close(void)
+{
+ StopThread(0);
+
+ CLockObject lock(m_mutex);
+
+ uint32_t enable = false;
+
+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable))
+ {
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__);
+ }
+
+ close(m_fd);
+ m_fd = INVALID_SOCKET_VALUE;
+}
+
+
+std::string CAOCECAdapterCommunication::GetError(void) const
+{
+ std::string strError(m_strError);
+ return strError;
+}
+
+int CAOCECAdapterCommunication::getFileDescriptor(void)
+{
+ CLockObject lock(m_mutex);
+
+ return m_fd;
+}
+
+
+
+cec_adapter_message_state CAOCECAdapterCommunication::Write(
+ const cec_command &data, bool &UNUSED(bRetry), uint8_t UNUSED(iLineTimeout), bool UNUSED(bIsReply))
+{
+ uint8_t buffer[CEC_MAX_FRAME_SIZE];
+ int32_t size = 1;
+ cec_adapter_message_state rc = ADAPTER_MESSAGE_STATE_ERROR;
+
+ if (!IsOpen())
+ return rc;
+
+ CLockObject lock(m_mutex);
+
+ if ((size_t)data.parameters.size + data.opcode_set > sizeof(buffer))
+ {
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: data size too large !", __func__);
+ return ADAPTER_MESSAGE_STATE_ERROR;
+ }
+
+ buffer[0] = (data.initiator << 4) | (data.destination & 0x0f);
+
+ if (data.opcode_set)
+ {
+ buffer[1] = data.opcode;
+ size++;
+
+ memcpy(&buffer[size], data.parameters.data, data.parameters.size);
+ size += data.parameters.size;
+ }
+
+ if (write(m_fd, (void *)buffer, size) == size)
+ {
+ rc = ADAPTER_MESSAGE_STATE_SENT_ACKED;
+ }
+ else
+ {
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: write failed !", __func__);
+ }
+
+ return rc;
+}
+
+
+uint16_t CAOCECAdapterCommunication::GetFirmwareVersion(void)
+{
+ int version = 0;
+
+ if (!IsOpen())
+ return version;
+
+ CLockObject lock(m_mutex);
+
+ if (ioctl(m_fd, CEC_IOC_GET_VERSION, &version) < 0)
+ {
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VERSION failed !", __func__);
+ }
+ return (uint16_t)version;
+}
+
+
+cec_vendor_id CAOCECAdapterCommunication::GetVendorId(void)
+{
+ int vendor_id = CEC_VENDOR_UNKNOWN;
+
+ if (!IsOpen())
+ return cec_vendor_id(vendor_id);
+
+ CLockObject lock(m_mutex);
+
+ if (ioctl(m_fd, CEC_IOC_GET_VENDOR_ID, &vendor_id) < 0)
+ {
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VENDOR_ID failed !", __func__);
+ }
+ return cec_vendor_id(vendor_id);
+}
+
+
+uint16_t CAOCECAdapterCommunication::GetPhysicalAddress(void)
+{
+ int phys_addr = CEC_DEFAULT_PADDR;
+
+ if (!IsOpen())
+ return (uint16_t)phys_addr;
+
+ CLockObject lock(m_mutex);
+
+ if (ioctl(m_fd, CEC_IOC_GET_PHYSICAL_ADDR, &phys_addr) < 0)
+ {
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_PHYSICAL_ADDR failed !", __func__);
+ phys_addr = CEC_DEFAULT_PADDR;
+ }
+ return (uint16_t)phys_addr;
+}
+
+
+cec_logical_addresses CAOCECAdapterCommunication::GetLogicalAddresses(void)
+{
+ return m_logicalAddresses;
+}
+
+
+bool CAOCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses)
+{
+ unsigned int log_addr = addresses.primary;
+ if (!IsOpen())
+ return false;
+
+ CLockObject lock(m_mutex);
+
+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr))
+ {
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__);
+ return false;
+ }
+ m_logicalAddresses = addresses;
+ m_bLogicalAddressChanged = true;
+
+ return true;
+}
+
+
+void CAOCECAdapterCommunication::HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress))
+{
+ unsigned int log_addr = CECDEVICE_BROADCAST;
+
+ if (!IsOpen())
+ return;
+
+ CLockObject lock(m_mutex);
+
+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr))
+ {
+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__);
+ }
+}
+
+
+void *CAOCECAdapterCommunication::Process(void)
+{
+ uint8_t buffer[CEC_MAX_FRAME_SIZE];
+ uint32_t size;
+ fd_set rfds;
+ cec_logical_address initiator, destination;
+ struct timeval tv;
+
+ if (!IsOpen())
+ return 0;
+
+ while (!IsStopped())
+ {
+ int fd = getFileDescriptor();
+
+ if (fd == INVALID_SOCKET_VALUE)
+ {
+ break;
+ }
+
+ FD_ZERO(&rfds);
+ FD_SET(fd, &rfds);
+
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+
+ if (select(fd + 1, &rfds, NULL, NULL, &tv) >= 0 )
+ {
+
+ if (!FD_ISSET(fd, &rfds))
+ continue;
+
+ size = read(fd, buffer, CEC_MAX_FRAME_SIZE);
+
+ if (size > 0)
+ {
+#if 0 // currently unused
+ if (buffer[0] == 0xff) // driver wants us to reread the physical address
+ {
+ if (!IsStopped())
+ {
+ uint16_t iNewAddress = GetPhysicalAddress();
+ m_callback->HandlePhysicalAddressChanged(iNewAddress);
+ }
+ continue;
+ }
+#endif
+ initiator = cec_logical_address(buffer[0] >> 4);
+ destination = cec_logical_address(buffer[0] & 0x0f);
+
+ cec_command cmd;
+
+ cec_command::Format(
+ cmd, initiator, destination,
+ ( size > 1 ) ? cec_opcode(buffer[1]) : CEC_OPCODE_NONE);
+
+ for( uint8_t i = 2; i < size; i++ )
+ cmd.parameters.PushBack(buffer[i]);
+
+ if (!IsStopped())
+ m_callback->OnCommandReceived(cmd);
+ }
+ }
+ }
+
+ return 0;
+}
+
+#endif // HAVE_AOCEC_API
diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h
new file mode 100644
index 0000000..f6a8a4a
--- /dev/null
+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h
@@ -0,0 +1,105 @@
+#pragma once
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
+ * based heavily on:
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing <license@pulse-eight.com>
+ * http://www.pulse-eight.com/
+ * http://www.pulse-eight.net/
+ */
+
+#include "env.h"
+
+#if defined(HAVE_AOCEC_API)
+
+#include <p8-platform/threads/mutex.h>
+#include <p8-platform/threads/threads.h>
+#include "../AdapterCommunication.h"
+#include <map>
+
+namespace CEC
+{
+ class CAOCECAdapterCommunication : public IAdapterCommunication, public P8PLATFORM::CThread
+ {
+ public:
+ /*!
+ * @brief Create a new Exynos HDMI CEC communication handler.
+ * @param callback The callback to use for incoming CEC commands.
+ */
+ CAOCECAdapterCommunication(IAdapterCommunicationCallback *callback);
+ virtual ~CAOCECAdapterCommunication(void);
+
+ /** @name IAdapterCommunication implementation */
+ ///{
+ bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true);
+ void Close(void);
+ bool IsOpen(void);
+ std::string GetError(void) const;
+ cec_adapter_message_state Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout, bool bIsReply);
+
+ bool SetLineTimeout(uint8_t UNUSED(iTimeout)) { return true; }
+ bool StartBootloader(void) { return false; }
+ bool SetLogicalAddresses(const cec_logical_addresses &addresses);
+ cec_logical_addresses GetLogicalAddresses(void);
+ bool PingAdapter(void) { return IsInitialised(); }
+ uint16_t GetFirmwareVersion(void);
+ uint32_t GetFirmwareBuildDate(void) { return 0; }
+ bool IsRunningLatestFirmware(void) { return true; }
+ bool PersistConfiguration(const libcec_configuration & UNUSED(configuration)) { return false; }
+ bool GetConfiguration(libcec_configuration & UNUSED(configuration)) { return false; }
+ std::string GetPortName(void) { return std::string("AOCEC"); }
+ uint16_t GetPhysicalAddress(void);
+ bool SetControlledMode(bool UNUSED(controlled)) { return true; }
+ cec_vendor_id GetVendorId(void);
+ bool SupportsSourceLogicalAddress(const cec_logical_address address) { return address > CECDEVICE_TV && address <= CECDEVICE_BROADCAST; }
+ cec_adapter_type GetAdapterType(void) { return ADAPTERTYPE_AOCEC; }
+ uint16_t GetAdapterVendorId(void) const { return 1; }
+ uint16_t GetAdapterProductId(void) const { return 1; }
+ void HandleLogicalAddressLost(cec_logical_address oldAddress);
+ void SetActiveSource(bool UNUSED(bSetTo), bool UNUSED(bClientUnregistered)) {}
+ ///}
+
+ /** @name P8PLATFORM::CThread implementation */
+ ///{
+ void *Process(void);
+ ///}
+
+ private:
+ bool IsInitialised(void) const { return 1; };
+ int getFileDescriptor(void);
+
+ std::string m_strError; /**< current error message */
+
+ bool m_bLogicalAddressChanged;
+ cec_logical_addresses m_logicalAddresses;
+ P8PLATFORM::CMutex m_mutex;
+ int m_fd;
+ };
+};
+#endif
diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp
new file mode 100644
index 0000000..55f3ee0
--- /dev/null
+++ b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp
@@ -0,0 +1,50 @@
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
+ * based heavily on:
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing <license@pulse-eight.com>
+ * http://www.pulse-eight.com/
+ * http://www.pulse-eight.net/
+ */
+
+#include "env.h"
+#include <stdio.h>
+
+#if defined(HAVE_AOCEC_API)
+#include "AOCECAdapterDetection.h"
+#include "AOCEC.h"
+
+using namespace CEC;
+
+bool CAOCECAdapterDetection::FindAdapter(void)
+{
+ return access(CEC_AOCEC_PATH, 0) == 0;
+}
+
+#endif
diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h
new file mode 100644
index 0000000..cacaa19
--- /dev/null
+++ b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h
@@ -0,0 +1,46 @@
+#pragma once
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
+ * based heavily on:
+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing <license@pulse-eight.com>
+ * http://www.pulse-eight.com/
+ * http://www.pulse-eight.net/
+ */
+
+#include "env.h"
+
+namespace CEC
+{
+ class CAOCECAdapterDetection
+ {
+ public:
+ static bool FindAdapter(void);
+ };
+}
diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp
index da05725..1e946e6 100644
--- a/src/libcec/adapter/AdapterFactory.cpp
+++ b/src/libcec/adapter/AdapterFactory.cpp
@@ -58,6 +58,11 @@
#include "Exynos/ExynosCECAdapterCommunication.h"
#endif
+#if defined(HAVE_AOCEC_API)
+#include "AOCEC/AOCECAdapterDetection.h"
+#include "AOCEC/AOCECAdapterCommunication.h"
+#endif
+
using namespace CEC;
int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */)
@@ -126,8 +131,20 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8
}
#endif
+#if defined(HAVE_AOCEC_API)
+ if (iAdaptersFound < iBufSize && CAOCECAdapterDetection::FindAdapter())
+ {
+ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_AOCEC_PATH);
+ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_AOCEC_VIRTUAL_COM);
+ deviceList[iAdaptersFound].iVendorId = 0;
+ deviceList[iAdaptersFound].iProductId = 0;
+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_AOCEC;
+ iAdaptersFound++;
+ }
+#endif
+
-#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API)
+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_AOCEC_API)
#error "libCEC doesn't have support for any type of adapter. please check your build system or configuration"
#endif
@@ -146,6 +163,11 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_
return new CExynosCECAdapterCommunication(m_lib->m_cec);
#endif
+#if defined(HAVE_AOCEC_API)
+ if (!strcmp(strPort, CEC_AOCEC_VIRTUAL_COM))
+ return new CAOCECAdapterCommunication(m_lib->m_cec);
+#endif
+
#if defined(HAVE_RPI_API)
if (!strcmp(strPort, CEC_RPI_VIRTUAL_COM))
return new CRPiCECAdapterCommunication(m_lib->m_cec);
diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake
index b8a16c8..93a97e6 100644
--- a/src/libcec/cmake/CheckPlatformSupport.cmake
+++ b/src/libcec/cmake/CheckPlatformSupport.cmake
@@ -9,6 +9,7 @@
# HAVE_RPI_API 1 if Raspberry Pi is supported
# HAVE_TDA995X_API 1 if TDA995X is supported
# HAVE_EXYNOS_API 1 if Exynos is supported
+# HAVE_AOCEC_API 1 if AOCEC is supported
# HAVE_P8_USB 1 if Pulse-Eight devices are supported
# HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected
# HAVE_DRM_EDID_PARSER 1 if DRM EDID parsing is supported
@@ -132,6 +133,18 @@ else()
else()
set(HAVE_EXYNOS_API 0)
endif()
+
+ # AOCEC
+ if (${HAVE_AOCEC_API})
+ set(LIB_INFO "${LIB_INFO}, AOCEC")
+ set(HAVE_AOCEC_API 1)
+ set(CEC_SOURCES_ADAPTER_AOCEC adapter/AOCEC/AOCECAdapterDetection.cpp
+ adapter/AOCEC/AOCECAdapterCommunication.cpp)
+ source_group("Source Files\\adapter\\AOCEC" FILES ${CEC_SOURCES_ADAPTER_AOCEC})
+ list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_AOCEC})
+ else()
+ set(HAVE_AOCEC_API 0)
+ endif()
endif()
# rt
diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake
index 9dcaacf..7ec10f5 100644
--- a/src/libcec/cmake/DisplayPlatformSupport.cmake
+++ b/src/libcec/cmake/DisplayPlatformSupport.cmake
@@ -44,6 +44,12 @@ else()
message(STATUS "DRM support: no")
endif()
+if (HAVE_AOCEC_API)
+ message(STATUS "AOCEC support: yes")
+else()
+ message(STATUS "AOCEC support: no")
+endif()
+
if (HAVE_PYTHON)
message(STATUS "Python support: version ${PYTHONLIBS_VERSION_STRING} (${PYTHON_VERSION})")
else()
diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in
index 0496aa0..fe6c83d 100644
--- a/src/libcec/env.h.in
+++ b/src/libcec/env.h.in
@@ -72,6 +72,9 @@
/* Define to 1 for Exynos support */
#cmakedefine HAVE_EXYNOS_API @HAVE_EXYNOS_API@
+/* Define to 1 for AOCEC support */
+#cmakedefine HAVE_AOCEC_API @HAVE_AOCEC_API@
+
/* Define to 1 for nVidia EDID parsing support (on selected models) */
#cmakedefine HAVE_NVIDIA_EDID_PARSER @HAVE_NVIDIA_EDID_PARSER@

View File

@ -1,58 +0,0 @@
From edab2a489829689fdaadb90f1897c948ea3c9020 Mon Sep 17 00:00:00 2001
From: kszaq <kszaquitto@gmail.com>
Date: Wed, 3 Jun 2015 10:20:04 +0200
Subject: [PATCH] sound/soc/aml/m8: Report only working frequecies and bit
depths
---
sound/soc/aml/m8/aml_spdif_codec.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/soc/aml/m8/aml_spdif_codec.c b/sound/soc/aml/m8/aml_spdif_codec.c
index ac76ef6..cf0e929 100644
--- a/sound/soc/aml/m8/aml_spdif_codec.c
+++ b/sound/soc/aml/m8/aml_spdif_codec.c
@@ -26,9 +26,8 @@
#define DRV_NAME "spdif-dit"
-#define STUB_RATES SNDRV_PCM_RATE_8000_192000
-#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
+#define STUB_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000
+#define STUB_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE
struct pinctrl *pin_spdif_ctl;
struct device *spdif_dev;
--
1.8.3.1
From 1e6294498438359c4ac39b2ab563487d750fbaaf Mon Sep 17 00:00:00 2001
From: kszaq <kszaquitto@gmail.com>
Date: Tue, 30 Aug 2016 23:31:29 +0200
Subject: [PATCH] sound/soc/aml/m8: report only working frequencies and bit
depths for I2S
---
sound/soc/aml/m8/aml_i2s_dai.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/soc/aml/m8/aml_i2s_dai.c b/sound/soc/aml/m8/aml_i2s_dai.c
index 3626676..d2ebad1 100644
--- a/sound/soc/aml/m8/aml_i2s_dai.c
+++ b/sound/soc/aml/m8/aml_i2s_dai.c
@@ -290,9 +290,8 @@ static int aml_dai_i2s_resume(struct snd_soc_dai *dai)
return 0;
}
-#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_192000)
-#define AML_DAI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
+#define AML_DAI_I2S_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000
+#define AML_DAI_I2S_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE
static struct snd_soc_dai_ops aml_dai_i2s_ops = {
.startup = aml_dai_i2s_startup,
--
1.8.3.1

View File

@ -1,21 +0,0 @@
diff --git a/init/main.c b/init/main.c
index 9484f4b..db55edd 100644
--- a/init/main.c
+++ b/init/main.c
@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
do_basic_setup();
/* Open the /dev/console on the rootfs, this should never fail */
- if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
- pr_err("Warning: unable to open an initial console.\n");
+ char *console = "/dev_console";
+
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
+ if (sys_open(console, O_RDWR, 0) < 0)
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
+ sys_unlink(console);
+ }
(void) sys_dup(0);
(void) sys_dup(0);

View File

@ -1,113 +0,0 @@
From fa89009a1869844f9a9360eb07c45d457446ac0e Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 5 Jun 2014 22:48:15 +0200
Subject: [PATCH] staging: rtl8712, rtl8712: avoid lots of build warnings
commit 0c9f3a65c5eb7fe1fc611a22eb8a8b71ea865998 upstream.
The rtl8712 driver has an 'extern inline' function that contains an
'if', which causes lots of warnings with CONFIG_PROFILE_ALL_BRANCHES
overriding the definition of 'if':
drivers/staging/rtl8712/ieee80211.h:759:229: warning: '______f' is static but declared in inline function 'ieee80211_get_hdrlen' which is not static [enabled by default]
This changes the driver to use 'static inline' instead, which happens
to be the correct annotation anyway.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/staging/rtl8187se/ieee80211/ieee80211.h | 4 ++--
drivers/staging/rtl8192u/ieee80211/ieee80211.h | 10 +++++-----
drivers/staging/rtl8712/ieee80211.h | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211.h b/drivers/staging/rtl8187se/ieee80211/ieee80211.h
index 09ffd9b..6ebdd3f 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211.h
@@ -1460,12 +1460,12 @@ extern void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee,
extern const long ieee80211_wlan_frequencies[];
-extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
+static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
{
ieee->scans++;
}
-extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
+static inline int ieee80211_get_scans(struct ieee80211_device *ieee)
{
return ieee->scans;
}
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index bc64f05..b1a0380 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -2250,7 +2250,7 @@ static inline void *ieee80211_priv(struct net_device *dev)
return ((struct ieee80211_device *)netdev_priv(dev))->priv;
}
-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
+static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
{
/* Single white space is for Linksys APs */
if (essid_len == 1 && essid[0] == ' ')
@@ -2266,7 +2266,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
return 1;
}
-extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode)
+static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode)
{
/*
* It is possible for both access points and our device to support
@@ -2292,7 +2292,7 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod
return 0;
}
-extern inline int ieee80211_get_hdrlen(u16 fc)
+static inline int ieee80211_get_hdrlen(u16 fc)
{
int hdrlen = IEEE80211_3ADDR_LEN;
@@ -2578,12 +2578,12 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee);
extern const long ieee80211_wlan_frequencies[];
-extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
+static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
{
ieee->scans++;
}
-extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
+static inline int ieee80211_get_scans(struct ieee80211_device *ieee)
{
return ieee->scans;
}
diff --git a/drivers/staging/rtl8712/ieee80211.h b/drivers/staging/rtl8712/ieee80211.h
index da4000e..8269be8 100644
--- a/drivers/staging/rtl8712/ieee80211.h
+++ b/drivers/staging/rtl8712/ieee80211.h
@@ -734,7 +734,7 @@ enum ieee80211_state {
#define IEEE_G (1<<2)
#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)
-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
+static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
{
/* Single white space is for Linksys APs */
if (essid_len == 1 && essid[0] == ' ')
@@ -748,7 +748,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
return 1;
}
-extern inline int ieee80211_get_hdrlen(u16 fc)
+static inline int ieee80211_get_hdrlen(u16 fc)
{
int hdrlen = 24;