forked from LibreELEC/LibreELEC.tv
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
projects/WeTek_Hub: render GUI at 1080p for 4K output
Issues with previous set of patches: - at some 4K output resolutions GUI was rendered at 1080p and covered only 1/4 of screen due to not changed iWidth and iHeight parameters - rendering GUI at 4K while playing high-bitrate 4K video caused stuttering Changes introduced in this patch: - rewrite platform_init to be aware of 4K resolutions passed by uboot in "hdmimode" parameter - always set virtual framebuffer resolution to 1920x2160 (like Kodi does) - remove Kodi patch to render GUI at 4K - add Kodi patch (xbmc/xbmc#10332) to upscale GUI when screen resolution is 4K
- Loading branch information
Showing
5 changed files
with
123 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
...GLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
From a348ef744e260f76e1e4e1299f9181ae40352eb5 Mon Sep 17 00:00:00 2001 | ||
From: kszaq <kszaquitto@gmail.com> | ||
Date: Mon, 22 Aug 2016 06:55:00 +0200 | ||
Subject: [PATCH] EGLNativeTypeAmlogic: Enable GUI free_scale when framebuffer | ||
size is less than output resolution | ||
|
||
For 4K output Kodi renders GUI at 1080p and this results in GUI covering only 1/4 screen. | ||
This patch enables hardware upscaling if output resolution is greater than rendered GUI | ||
resolution. | ||
--- | ||
xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | 33 ++++++++++++++++++++++++++--- | ||
xbmc/windowing/egl/EGLNativeTypeAmlogic.h | 2 ++ | ||
2 files changed, 32 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | ||
index 88cd385..3cbb604 100644 | ||
--- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | ||
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | ||
@@ -133,6 +133,8 @@ bool CEGLNativeTypeAmlogic::GetNativeResolution(RESOLUTION_INFO *res) const | ||
|
||
bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res) | ||
{ | ||
+ bool result = false; | ||
+ | ||
#if defined(_FBDEV_WINDOW_H_) | ||
if (m_nativeWindow) | ||
{ | ||
@@ -144,10 +146,12 @@ bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res) | ||
// Don't set the same mode as current | ||
std::string mode; | ||
SysfsUtils::GetString("/sys/class/display/mode", mode); | ||
- if (res.strId == mode) | ||
- return false; | ||
+ if (res.strId != mode) | ||
+ result = SetDisplayResolution(res.strId.c_str()); | ||
+ | ||
+ DealWithScale(res); | ||
|
||
- return SetDisplayResolution(res.strId.c_str()); | ||
+ return result; | ||
} | ||
|
||
bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions) | ||
@@ -220,6 +224,29 @@ void CEGLNativeTypeAmlogic::SetupVideoScaling(const char *mode) | ||
SysfsUtils::SetInt("/sys/class/graphics/fb0/blank", 0); | ||
} | ||
|
||
+void CEGLNativeTypeAmlogic::DealWithScale(const RESOLUTION_INFO &res) | ||
+{ | ||
+ if (res.iScreenWidth > res.iWidth && res.iScreenHeight > res.iHeight) | ||
+ EnableFreeScale(res); | ||
+ else | ||
+ DisableFreeScale(); | ||
+} | ||
+ | ||
+void CEGLNativeTypeAmlogic::EnableFreeScale(const RESOLUTION_INFO &res) | ||
+{ | ||
+ char fsaxis_str[256] = {0}; | ||
+ sprintf(fsaxis_str, "0 0 %d %d", res.iWidth-1, res.iHeight-1); | ||
+ char waxis_str[256] = {0}; | ||
+ sprintf(waxis_str, "0 0 %d %d", res.iScreenWidth-1, res.iScreenHeight-1); | ||
+ | ||
+ SysfsUtils::SetInt("/sys/class/graphics/fb0/free_scale", 0); | ||
+ SysfsUtils::SetString("/sys/class/graphics/fb0/free_scale_axis", fsaxis_str); | ||
+ SysfsUtils::SetString("/sys/class/graphics/fb0/window_axis", waxis_str); | ||
+ SysfsUtils::SetInt("/sys/class/graphics/fb0/scale_width", res.iWidth); | ||
+ SysfsUtils::SetInt("/sys/class/graphics/fb0/scale_height", res.iHeight); | ||
+ SysfsUtils::SetInt("/sys/class/graphics/fb0/free_scale", 0x10001); | ||
+} | ||
+ | ||
void CEGLNativeTypeAmlogic::DisableFreeScale() | ||
{ | ||
// turn off frame buffer freescale | ||
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h | ||
index cfb33ca..96aa6f7 100644 | ||
--- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h | ||
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h | ||
@@ -53,6 +53,8 @@ public: | ||
protected: | ||
bool SetDisplayResolution(const char *resolution); | ||
void SetupVideoScaling(const char *mode); | ||
+ void DealWithScale(const RESOLUTION_INFO &res); | ||
+ void EnableFreeScale(const RESOLUTION_INFO &res); | ||
void DisableFreeScale(); | ||
|
||
private: | ||
-- | ||
1.8.3.1 | ||
|
124 changes: 0 additions & 124 deletions
124
projects/WeTek_Hub/patches/kodi/0003-aml-Add-support-for-4k-resolutions.patch
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
projects/WeTek_Hub/patches/kodi/0006-fix-resolution-fallback.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | ||
index cad677a..ad7be0b 100644 | ||
--- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | ||
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | ||
@@ -178,7 +178,7 @@ bool CEGLNativeTypeAmlogic::GetPreferredResolution(RESOLUTION_INFO *res) const | ||
if (!GetNativeResolution(res)) | ||
{ | ||
// punt to 720p if we get nothing | ||
- aml_mode_to_resolution("720p", res); | ||
+ aml_mode_to_resolution("720p60hz", res); | ||
} | ||
|
||
return true; |
22 changes: 0 additions & 22 deletions
22
projects/WeTek_Hub/patches/linux/increase_framebuffer_menory_to_be_enough_for_4k.patch
This file was deleted.
Oops, something went wrong.