From b4a7cb2e8b2d3bb51ba84e29269102e8be5d7bbb Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 19 Apr 2020 17:23:58 +0100 Subject: [PATCH] kodi (Amlogic/Allwinner): drop guisize patch --- .../Allwinner/patches/kodi/0002-guisize.patch | 150 ------------------ .../Amlogic/patches/kodi/kodi-guisize.patch | 150 ------------------ 2 files changed, 300 deletions(-) delete mode 100644 projects/Allwinner/patches/kodi/0002-guisize.patch delete mode 100644 projects/Amlogic/patches/kodi/kodi-guisize.patch diff --git a/projects/Allwinner/patches/kodi/0002-guisize.patch b/projects/Allwinner/patches/kodi/0002-guisize.patch deleted file mode 100644 index 192422b947..0000000000 --- a/projects/Allwinner/patches/kodi/0002-guisize.patch +++ /dev/null @@ -1,150 +0,0 @@ -From a1818990f68fe77d02a63c07c29e7832e2b9da27 Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Wed, 16 Oct 2019 19:38:11 +0000 -Subject: [PATCH] windowing/gbm: add option to limit gui size - ---- - .../resources/strings.po | 44 ++++++++++++++++++- - system/settings/gbm.xml | 15 +++++++ - xbmc/windowing/gbm/DRMUtils.cpp | 32 ++++++++++++++ - 3 files changed, 90 insertions(+), 1 deletion(-) - -diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index c573f6e5f9c9..a520acda5ca7 100644 ---- a/addons/resource.language.en_gb/resources/strings.po -+++ b/addons/resource.language.en_gb/resources/strings.po -@@ -7234,7 +7234,49 @@ msgctxt "#13465" - msgid "EGL" - msgstr "" - --#empty strings from id 13466 to 13504 -+#. Option for setting Limit GUI Size -+#: system/settings/gbm.xml -+msgctxt "#13466" -+msgid "Limit GUI Size" -+msgstr "" -+ -+#. Description of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13467" -+msgid "This option limits GUI size for screen resolutions above 1080p. Requires restart." -+msgstr "" -+ -+#. String for options 1 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13468" -+msgid "No limit" -+msgstr "" -+ -+#. String for options 2 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13469" -+msgid "720p" -+msgstr "" -+ -+#. String for options 3 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13470" -+msgid "1080p / 720p (>30hz)" -+msgstr "" -+ -+#. String for options 4 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13471" -+msgid "1080p" -+msgstr "" -+ -+#. String for options 5 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13472" -+msgid "No limit / 1080p (>30hz)" -+msgstr "" -+ -+#empty strings from id 13473 to 13504 - - #: system/settings/settings.xml - msgctxt "#13505" -diff --git a/system/settings/gbm.xml b/system/settings/gbm.xml -index 939ca12ba287..9bd1d04dfb7a 100644 ---- a/system/settings/gbm.xml -+++ b/system/settings/gbm.xml -@@ -36,6 +36,21 @@ - - false - -+ -+ false -+ 3 -+ 0 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - 3 - false -diff --git a/xbmc/windowing/gbm/DRMUtils.cpp b/xbmc/windowing/gbm/DRMUtils.cpp -index bbbc447498cf..3980ef7058e9 100644 ---- a/xbmc/windowing/gbm/DRMUtils.cpp -+++ b/xbmc/windowing/gbm/DRMUtils.cpp -@@ -8,6 +8,8 @@ - - #include "DRMUtils.h" - -+#include "settings/Settings.h" -+#include "settings/SettingsComponent.h" - #include "utils/StringUtils.h" - #include "utils/log.h" - #include "windowing/GraphicContext.h" -@@ -27,6 +29,11 @@ - - using namespace KODI::WINDOWING::GBM; - -+namespace -+{ -+const std::string SETTING_VIDEOSCREEN_LIMITGUISIZE = "videoscreen.limitguisize"; -+} -+ - CDRMUtils::CDRMUtils() - : m_connector(new connector) - , m_encoder(new encoder) -@@ -763,6 +770,31 @@ RESOLUTION_INFO CDRMUtils::GetResolutionInfo(drmModeModeInfoPtr mode) - res.iWidth = res.iScreenWidth; - res.iHeight = res.iScreenHeight; - -+ int limit = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt( -+ SETTING_VIDEOSCREEN_LIMITGUISIZE); -+ if (limit > 0 && res.iScreenWidth > 1920 && res.iScreenHeight > 1080) -+ { -+ switch (limit) -+ { -+ case 1: // 720p -+ res.iWidth = 1280; -+ res.iHeight = 720; -+ break; -+ case 2: // 1080p / 720p (>30hz) -+ res.iWidth = mode->vrefresh > 30 ? 1280 : 1920; -+ res.iHeight = mode->vrefresh > 30 ? 720 : 1080; -+ break; -+ case 3: // 1080p -+ res.iWidth = 1920; -+ res.iHeight = 1080; -+ break; -+ case 4: // No limit / 1080p (>30hz) -+ res.iWidth = mode->vrefresh > 30 ? 1920 : res.iScreenWidth; -+ res.iHeight = mode->vrefresh > 30 ? 1080 : res.iScreenHeight; -+ break; -+ } -+ } -+ - if (mode->clock % 5 != 0) - res.fRefreshRate = static_cast(mode->vrefresh) * (1000.0f/1001.0f); - else - diff --git a/projects/Amlogic/patches/kodi/kodi-guisize.patch b/projects/Amlogic/patches/kodi/kodi-guisize.patch deleted file mode 100644 index 192422b947..0000000000 --- a/projects/Amlogic/patches/kodi/kodi-guisize.patch +++ /dev/null @@ -1,150 +0,0 @@ -From a1818990f68fe77d02a63c07c29e7832e2b9da27 Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Wed, 16 Oct 2019 19:38:11 +0000 -Subject: [PATCH] windowing/gbm: add option to limit gui size - ---- - .../resources/strings.po | 44 ++++++++++++++++++- - system/settings/gbm.xml | 15 +++++++ - xbmc/windowing/gbm/DRMUtils.cpp | 32 ++++++++++++++ - 3 files changed, 90 insertions(+), 1 deletion(-) - -diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index c573f6e5f9c9..a520acda5ca7 100644 ---- a/addons/resource.language.en_gb/resources/strings.po -+++ b/addons/resource.language.en_gb/resources/strings.po -@@ -7234,7 +7234,49 @@ msgctxt "#13465" - msgid "EGL" - msgstr "" - --#empty strings from id 13466 to 13504 -+#. Option for setting Limit GUI Size -+#: system/settings/gbm.xml -+msgctxt "#13466" -+msgid "Limit GUI Size" -+msgstr "" -+ -+#. Description of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13467" -+msgid "This option limits GUI size for screen resolutions above 1080p. Requires restart." -+msgstr "" -+ -+#. String for options 1 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13468" -+msgid "No limit" -+msgstr "" -+ -+#. String for options 2 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13469" -+msgid "720p" -+msgstr "" -+ -+#. String for options 3 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13470" -+msgid "1080p / 720p (>30hz)" -+msgstr "" -+ -+#. String for options 4 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13471" -+msgid "1080p" -+msgstr "" -+ -+#. String for options 5 of setting with label #13466 "Limit GUI Size" -+#: system/settings/gbm.xml -+msgctxt "#13472" -+msgid "No limit / 1080p (>30hz)" -+msgstr "" -+ -+#empty strings from id 13473 to 13504 - - #: system/settings/settings.xml - msgctxt "#13505" -diff --git a/system/settings/gbm.xml b/system/settings/gbm.xml -index 939ca12ba287..9bd1d04dfb7a 100644 ---- a/system/settings/gbm.xml -+++ b/system/settings/gbm.xml -@@ -36,6 +36,21 @@ - - false - -+ -+ false -+ 3 -+ 0 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - 3 - false -diff --git a/xbmc/windowing/gbm/DRMUtils.cpp b/xbmc/windowing/gbm/DRMUtils.cpp -index bbbc447498cf..3980ef7058e9 100644 ---- a/xbmc/windowing/gbm/DRMUtils.cpp -+++ b/xbmc/windowing/gbm/DRMUtils.cpp -@@ -8,6 +8,8 @@ - - #include "DRMUtils.h" - -+#include "settings/Settings.h" -+#include "settings/SettingsComponent.h" - #include "utils/StringUtils.h" - #include "utils/log.h" - #include "windowing/GraphicContext.h" -@@ -27,6 +29,11 @@ - - using namespace KODI::WINDOWING::GBM; - -+namespace -+{ -+const std::string SETTING_VIDEOSCREEN_LIMITGUISIZE = "videoscreen.limitguisize"; -+} -+ - CDRMUtils::CDRMUtils() - : m_connector(new connector) - , m_encoder(new encoder) -@@ -763,6 +770,31 @@ RESOLUTION_INFO CDRMUtils::GetResolutionInfo(drmModeModeInfoPtr mode) - res.iWidth = res.iScreenWidth; - res.iHeight = res.iScreenHeight; - -+ int limit = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt( -+ SETTING_VIDEOSCREEN_LIMITGUISIZE); -+ if (limit > 0 && res.iScreenWidth > 1920 && res.iScreenHeight > 1080) -+ { -+ switch (limit) -+ { -+ case 1: // 720p -+ res.iWidth = 1280; -+ res.iHeight = 720; -+ break; -+ case 2: // 1080p / 720p (>30hz) -+ res.iWidth = mode->vrefresh > 30 ? 1280 : 1920; -+ res.iHeight = mode->vrefresh > 30 ? 720 : 1080; -+ break; -+ case 3: // 1080p -+ res.iWidth = 1920; -+ res.iHeight = 1080; -+ break; -+ case 4: // No limit / 1080p (>30hz) -+ res.iWidth = mode->vrefresh > 30 ? 1920 : res.iScreenWidth; -+ res.iHeight = mode->vrefresh > 30 ? 1080 : res.iScreenHeight; -+ break; -+ } -+ } -+ - if (mode->clock % 5 != 0) - res.fRefreshRate = static_cast(mode->vrefresh) * (1000.0f/1001.0f); - else -