aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2015-08-28 08:33:23 +0200
committerMartijn Kaijser <martijn@xbmc.org>2015-08-28 08:33:23 +0200
commit0209090b8204c2b60b79c5fceec5232af59ec8e4 (patch)
treeaa4a65f303911264edf706bf8b2358b9c341b860
parent1c65f74e3fe0fe033b3eae38d937866bb3b7ab0a (diff)
parent26db5af8a5c788ce8fa3e036a11a194b6a445bd4 (diff)
Merge pull request #7898 from koying/fixamlzoom
FIX: AML zoom issues
-rw-r--r--xbmc/utils/AMLUtils.cpp45
-rw-r--r--xbmc/windowing/egl/EGLNativeTypeAmlAndroid.cpp43
-rw-r--r--xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h1
3 files changed, 87 insertions, 2 deletions
diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp
index bcb57fcd46..ac2667c165 100644
--- a/xbmc/utils/AMLUtils.cpp
+++ b/xbmc/utils/AMLUtils.cpp
@@ -356,6 +356,15 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
res->fRefreshRate = 60;
res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
}
+ else if (StringUtils::EqualsNoCase(fromMode, "1080p23hz"))
+ {
+ res->iWidth = 1920;
+ res->iHeight= 1080;
+ res->iScreenWidth = 1920;
+ res->iScreenHeight= 1080;
+ res->fRefreshRate = 23.976;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
else if (StringUtils::EqualsNoCase(fromMode, "1080p24hz"))
{
res->iWidth = 1920;
@@ -383,6 +392,15 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
res->fRefreshRate = 50;
res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
}
+ else if (StringUtils::EqualsNoCase(fromMode, "1080p59hz"))
+ {
+ res->iWidth = 1920;
+ res->iHeight= 1080;
+ res->iScreenWidth = 1920;
+ res->iScreenHeight= 1080;
+ res->fRefreshRate = 59.940;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
else if (StringUtils::EqualsNoCase(fromMode, "1080i"))
{
res->iWidth = 1920;
@@ -401,6 +419,15 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
res->fRefreshRate = 50;
res->dwFlags = D3DPRESENTFLAG_INTERLACED;
}
+ else if (StringUtils::EqualsNoCase(fromMode, "1080i59hz"))
+ {
+ res->iWidth = 1920;
+ res->iHeight= 1080;
+ res->iScreenWidth = 1920;
+ res->iScreenHeight= 1080;
+ res->fRefreshRate = 59.940;
+ res->dwFlags = D3DPRESENTFLAG_INTERLACED;
+ }
else if (StringUtils::EqualsNoCase(fromMode, "4k2ksmpte"))
{
res->iWidth = 1920;
@@ -410,6 +437,15 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
res->fRefreshRate = 24;
res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
}
+ else if (StringUtils::EqualsNoCase(fromMode, "4k2k23hz"))
+ {
+ res->iWidth = 1920;
+ res->iHeight= 1080;
+ res->iScreenWidth = 3840;
+ res->iScreenHeight= 2160;
+ res->fRefreshRate = 23.976;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
else if (StringUtils::EqualsNoCase(fromMode, "4k2k24hz"))
{
res->iWidth = 1920;
@@ -428,6 +464,15 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
res->fRefreshRate = 25;
res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
}
+ else if (StringUtils::EqualsNoCase(fromMode, "4k2k29hz"))
+ {
+ res->iWidth = 1920;
+ res->iHeight= 1080;
+ res->iScreenWidth = 3840;
+ res->iScreenHeight= 2160;
+ res->fRefreshRate = 29.970;
+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ }
else if (StringUtils::EqualsNoCase(fromMode, "4k2k30hz"))
{
res->iWidth = 1920;
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.cpp b/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.cpp
index 5ea1d7c13c..111442cf49 100644
--- a/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.cpp
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.cpp
@@ -28,14 +28,18 @@
#include "utils/SysfsUtils.h"
#include "utils/AMLUtils.h"
+bool CEGLNativeTypeAmlAndroid::m_isWritable = false;
+
bool CEGLNativeTypeAmlAndroid::CheckCompatibility()
{
if (aml_present())
{
+ m_isWritable = false;
if (SysfsUtils::HasRW("/sys/class/display/mode"))
- return true;
+ m_isWritable = true;
else
- CLog::Log(LOGERROR, "AMLEGL: no rw on /sys/class/display/mode");
+ CLog::Log(LOGINFO, "AMLEGL: no rw on /sys/class/display/mode");
+ return true;
}
return false;
}
@@ -62,6 +66,9 @@ bool CEGLNativeTypeAmlAndroid::GetNativeResolution(RESOLUTION_INFO *res) const
bool CEGLNativeTypeAmlAndroid::SetNativeResolution(const RESOLUTION_INFO &res)
{
+ if (!m_isWritable)
+ return false;
+
switch((int)(res.fRefreshRate*10))
{
default:
@@ -80,6 +87,16 @@ bool CEGLNativeTypeAmlAndroid::SetNativeResolution(const RESOLUTION_INFO &res)
break;
}
break;
+ case 599:
+ switch(res.iScreenWidth)
+ {
+ default:
+ if (res.dwFlags & D3DPRESENTFLAG_INTERLACED)
+ return SetDisplayResolution("1080i59hz");
+ else
+ return SetDisplayResolution("1080p59hz");
+ break;
+ }
case 500:
switch(res.iScreenWidth)
{
@@ -106,6 +123,17 @@ bool CEGLNativeTypeAmlAndroid::SetNativeResolution(const RESOLUTION_INFO &res)
break;
}
break;
+ case 299:
+ switch(res.iScreenWidth)
+ {
+ case 3840:
+ return SetDisplayResolution("4k2k29hz");
+ break;
+ default:
+ return SetDisplayResolution("1080p29hz");
+ break;
+ }
+ break;
case 250:
switch(res.iScreenWidth)
{
@@ -131,6 +159,17 @@ bool CEGLNativeTypeAmlAndroid::SetNativeResolution(const RESOLUTION_INFO &res)
break;
}
break;
+ case 239:
+ switch(res.iScreenWidth)
+ {
+ case 3840:
+ return SetDisplayResolution("4k2k23hz");
+ break;
+ default:
+ return SetDisplayResolution("1080p23hz");
+ break;
+ }
+ break;
}
return false;
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h b/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h
index 27a935ba58..688753717e 100644
--- a/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h
@@ -36,6 +36,7 @@ public:
protected:
mutable std::string m_curHdmiResolution;
mutable RESOLUTION_INFO m_fb_res;
+ static bool m_isWritable;
bool SetDisplayResolution(const char *resolution);
};