mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
projects/WeTek_Play: Remove support for CVBS output, because it causes problems for HDMI
This commit is contained in:
parent
b87a7edeca
commit
ffe3936840
@ -30,19 +30,6 @@ echo 0 > /sys/class/graphics/fb0/free_scale
|
|||||||
# Set framebuffer geometry
|
# Set framebuffer geometry
|
||||||
fbset -fb /dev/fb0 -g 1280 720 1280 1440 32
|
fbset -fb /dev/fb0 -g 1280 720 1280 1440 32
|
||||||
|
|
||||||
# Set framebuffer size in CVBS mode to match the resolution,
|
|
||||||
# for splash screen to be shown correctly
|
|
||||||
hpd_state=$(cat /sys/class/amhdmitx/amhdmitx0/hpd_state)
|
|
||||||
if [ "$hpd_state" != "1" ]; then # HDMI is not connected
|
|
||||||
display_height=480
|
|
||||||
display_mode=$(cat /sys/class/display/mode)
|
|
||||||
if [ "$display_mode" = "576cvbs" ]; then
|
|
||||||
display_height=576
|
|
||||||
fi
|
|
||||||
fbset -fb /dev/fb0 -g 720 "$display_height" 720 "$display_height" 32
|
|
||||||
fbset -fb /dev/fb1 -g 720 "$display_height" 720 "$display_height" 32
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Include deinterlacer into default VFM map
|
# Include deinterlacer into default VFM map
|
||||||
echo rm default > /sys/class/vfm/map
|
echo rm default > /sys/class/vfm/map
|
||||||
echo add default decoder ppmgr deinterlace amvideo > /sys/class/vfm/map
|
echo add default decoder ppmgr deinterlace amvideo > /sys/class/vfm/map
|
||||||
|
@ -1,128 +0,0 @@
|
|||||||
From ab1f9d62fe66bc66caf165a2928f0607777caf38 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Alex Deryskyba <alex@codesnake.com>
|
|
||||||
Date: Wed, 23 Jul 2014 22:23:34 +0300
|
|
||||||
Subject: [PATCH 05/17] Add support for AV (CVBS) video output on Amlogic
|
|
||||||
|
|
||||||
---
|
|
||||||
xbmc/utils/AMLUtils.cpp | 18 +++++++++++++
|
|
||||||
xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | 37 +++++++++++++++++++++++----
|
|
||||||
xbmc/windowing/egl/EGLNativeTypeAmlogic.h | 1 +
|
|
||||||
3 files changed, 51 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp
|
|
||||||
index 9553745..9d5b165 100644
|
|
||||||
--- a/xbmc/utils/AMLUtils.cpp
|
|
||||||
+++ b/xbmc/utils/AMLUtils.cpp
|
|
||||||
@@ -328,6 +328,24 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
|
|
||||||
res->fRefreshRate = 60;
|
|
||||||
res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
|
|
||||||
}
|
|
||||||
+ else if (fromMode.Equals("480cvbs"))
|
|
||||||
+ {
|
|
||||||
+ res->iWidth = 720;
|
|
||||||
+ res->iHeight= 480;
|
|
||||||
+ res->iScreenWidth = 720;
|
|
||||||
+ res->iScreenHeight= 480;
|
|
||||||
+ res->fRefreshRate = 60;
|
|
||||||
+ res->dwFlags = D3DPRESENTFLAG_INTERLACED;
|
|
||||||
+ }
|
|
||||||
+ else if (fromMode.Equals("576cvbs"))
|
|
||||||
+ {
|
|
||||||
+ res->iWidth = 720;
|
|
||||||
+ res->iHeight= 576;
|
|
||||||
+ res->iScreenWidth = 720;
|
|
||||||
+ res->iScreenHeight= 576;
|
|
||||||
+ res->fRefreshRate = 50;
|
|
||||||
+ res->dwFlags = D3DPRESENTFLAG_INTERLACED;
|
|
||||||
+ }
|
|
||||||
else if (fromMode.Equals("720p"))
|
|
||||||
{
|
|
||||||
res->iWidth = 1280;
|
|
||||||
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
|
|
||||||
index 362db6d..8e4bf37 100644
|
|
||||||
--- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
|
|
||||||
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
|
|
||||||
@@ -159,6 +159,10 @@ bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res)
|
|
||||||
else
|
|
||||||
SetDisplayResolution("1080p");
|
|
||||||
break;
|
|
||||||
+ case 720:
|
|
||||||
+ if (!IsHdmiConnected())
|
|
||||||
+ SetDisplayResolution("480cvbs");
|
|
||||||
+ break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 50:
|
|
||||||
@@ -174,6 +178,10 @@ bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res)
|
|
||||||
else
|
|
||||||
SetDisplayResolution("1080p50hz");
|
|
||||||
break;
|
|
||||||
+ case 720:
|
|
||||||
+ if (!IsHdmiConnected())
|
|
||||||
+ SetDisplayResolution("576cvbs");
|
|
||||||
+ break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
@@ -189,9 +197,18 @@ bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res)
|
|
||||||
|
|
||||||
bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions)
|
|
||||||
{
|
|
||||||
- char valstr[256] = {0};
|
|
||||||
- aml_get_sysfs_str("/sys/class/amhdmitx/amhdmitx0/disp_cap", valstr, 255);
|
|
||||||
- std::vector<std::string> probe_str = StringUtils::Split(valstr, "\n");
|
|
||||||
+ std::vector<std::string> probe_str;
|
|
||||||
+ if (IsHdmiConnected())
|
|
||||||
+ {
|
|
||||||
+ char valstr[256] = {0};
|
|
||||||
+ aml_get_sysfs_str("/sys/class/amhdmitx/amhdmitx0/disp_cap", valstr, 255);
|
|
||||||
+ probe_str = StringUtils::Split(valstr, "\n");
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ probe_str.push_back("480cvbs");
|
|
||||||
+ probe_str.push_back("576cvbs");
|
|
||||||
+ }
|
|
||||||
|
|
||||||
resolutions.clear();
|
|
||||||
RESOLUTION_INFO res;
|
|
||||||
@@ -209,8 +226,11 @@ bool CEGLNativeTypeAmlogic::GetPreferredResolution(RESOLUTION_INFO *res) const
|
|
||||||
// check display/mode, it gets defaulted at boot
|
|
||||||
if (!GetNativeResolution(res))
|
|
||||||
{
|
|
||||||
- // punt to 720p if we get nothing
|
|
||||||
- aml_mode_to_resolution("720p", res);
|
|
||||||
+ // punt to 720p or 576cvbs if we get nothing
|
|
||||||
+ if (IsHdmiConnected())
|
|
||||||
+ aml_mode_to_resolution("720p", res);
|
|
||||||
+ else
|
|
||||||
+ aml_mode_to_resolution("576cvbs", res);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
@@ -342,3 +362,10 @@ void CEGLNativeTypeAmlogic::SetFramebufferResolution(int width, int height) cons
|
|
||||||
close(fd0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+bool CEGLNativeTypeAmlogic::IsHdmiConnected() const
|
|
||||||
+{
|
|
||||||
+ char hpd_state[2] = {0};
|
|
||||||
+ aml_get_sysfs_str("/sys/class/amhdmitx/amhdmitx0/hpd_state", hpd_state, 2);
|
|
||||||
+ return hpd_state[0] == '1';
|
|
||||||
+}
|
|
||||||
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
|
|
||||||
index 781a153..8042f36 100644
|
|
||||||
--- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
|
|
||||||
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
|
|
||||||
@@ -56,6 +56,7 @@ protected:
|
|
||||||
private:
|
|
||||||
void SetFramebufferResolution(const RESOLUTION_INFO &res) const;
|
|
||||||
void SetFramebufferResolution(int width, int height) const;
|
|
||||||
+ bool IsHdmiConnected() const;
|
|
||||||
|
|
||||||
std::string m_framebuffer_name;
|
|
||||||
};
|
|
||||||
--
|
|
||||||
1.7.10.4
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user