diff --git a/packages/graphics/bcm2835-driver/package.mk b/packages/graphics/bcm2835-driver/package.mk index 083126b787..5af96f3d66 100644 --- a/packages/graphics/bcm2835-driver/package.mk +++ b/packages/graphics/bcm2835-driver/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="bcm2835-driver" -PKG_VERSION="df32073" +PKG_VERSION="89881b5" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="nonfree" diff --git a/packages/linux/package.mk b/packages/linux/package.mk index ccaaa62f4c..e0d3710fe0 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -40,7 +40,7 @@ case "$LINUX" in PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET imx6-status-led imx6-soc-fan" ;; *) - PKG_VERSION="4.1" + PKG_VERSION="4.1.1" PKG_URL="http://www.kernel.org/pub/linux/kernel/v4.x/$PKG_NAME-$PKG_VERSION.tar.xz" ;; esac diff --git a/packages/linux/patches/4.1/linux-003-no_dev_console.patch b/packages/linux/patches/4.1.1/linux-003-no_dev_console.patch similarity index 100% rename from packages/linux/patches/4.1/linux-003-no_dev_console.patch rename to packages/linux/patches/4.1.1/linux-003-no_dev_console.patch diff --git a/packages/linux/patches/4.1/linux-051-ouya_controller_support.patch b/packages/linux/patches/4.1.1/linux-051-ouya_controller_support.patch similarity index 100% rename from packages/linux/patches/4.1/linux-051-ouya_controller_support.patch rename to packages/linux/patches/4.1.1/linux-051-ouya_controller_support.patch diff --git a/packages/linux/patches/4.1/linux-052-XBOX_remote_support.patch b/packages/linux/patches/4.1.1/linux-052-XBOX_remote_support.patch similarity index 100% rename from packages/linux/patches/4.1/linux-052-XBOX_remote_support.patch rename to packages/linux/patches/4.1.1/linux-052-XBOX_remote_support.patch diff --git a/packages/linux/patches/4.1/linux-053-spinelplus-remote-0.2.patch b/packages/linux/patches/4.1.1/linux-053-spinelplus-remote-0.2.patch similarity index 100% rename from packages/linux/patches/4.1/linux-053-spinelplus-remote-0.2.patch rename to packages/linux/patches/4.1.1/linux-053-spinelplus-remote-0.2.patch diff --git a/packages/linux/patches/4.1/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch b/packages/linux/patches/4.1.1/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch similarity index 100% rename from packages/linux/patches/4.1/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch rename to packages/linux/patches/4.1.1/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch diff --git a/packages/linux/patches/4.1/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch b/packages/linux/patches/4.1.1/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/4.1/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch rename to packages/linux/patches/4.1.1/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch diff --git a/packages/linux/patches/4.1/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch b/packages/linux/patches/4.1.1/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch similarity index 100% rename from packages/linux/patches/4.1/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch rename to packages/linux/patches/4.1.1/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch diff --git a/packages/linux/patches/4.1/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch b/packages/linux/patches/4.1.1/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/4.1/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch rename to packages/linux/patches/4.1.1/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch diff --git a/packages/linux/patches/4.1/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch b/packages/linux/patches/4.1.1/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch similarity index 100% rename from packages/linux/patches/4.1/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch rename to packages/linux/patches/4.1.1/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch diff --git a/packages/linux/patches/4.1/linux-062-imon_pad_ignore_diagonal.patch b/packages/linux/patches/4.1.1/linux-062-imon_pad_ignore_diagonal.patch similarity index 100% rename from packages/linux/patches/4.1/linux-062-imon_pad_ignore_diagonal.patch rename to packages/linux/patches/4.1.1/linux-062-imon_pad_ignore_diagonal.patch diff --git a/packages/linux/patches/4.1/linux-203-stb0899_enable_low_symbol_rate.patch b/packages/linux/patches/4.1.1/linux-203-stb0899_enable_low_symbol_rate.patch similarity index 100% rename from packages/linux/patches/4.1/linux-203-stb0899_enable_low_symbol_rate.patch rename to packages/linux/patches/4.1.1/linux-203-stb0899_enable_low_symbol_rate.patch diff --git a/packages/linux/patches/4.1/linux-212-mantis_stb0899_faster_lock.patch b/packages/linux/patches/4.1.1/linux-212-mantis_stb0899_faster_lock.patch similarity index 100% rename from packages/linux/patches/4.1/linux-212-mantis_stb0899_faster_lock.patch rename to packages/linux/patches/4.1.1/linux-212-mantis_stb0899_faster_lock.patch diff --git a/packages/linux/patches/4.1/linux-221-ngene-octopus.patch b/packages/linux/patches/4.1.1/linux-221-ngene-octopus.patch similarity index 100% rename from packages/linux/patches/4.1/linux-221-ngene-octopus.patch rename to packages/linux/patches/4.1.1/linux-221-ngene-octopus.patch diff --git a/packages/linux/patches/4.1/linux-222-stb0899_signal_quality.patch b/packages/linux/patches/4.1.1/linux-222-stb0899_signal_quality.patch similarity index 100% rename from packages/linux/patches/4.1/linux-222-stb0899_signal_quality.patch rename to packages/linux/patches/4.1.1/linux-222-stb0899_signal_quality.patch diff --git a/packages/linux/patches/4.1/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch b/packages/linux/patches/4.1.1/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch similarity index 100% rename from packages/linux/patches/4.1/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch rename to packages/linux/patches/4.1.1/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch diff --git a/packages/linux/patches/4.1/linux-224-STK1160-addFramescaling.patch b/packages/linux/patches/4.1.1/linux-224-STK1160-addFramescaling.patch similarity index 100% rename from packages/linux/patches/4.1/linux-224-STK1160-addFramescaling.patch rename to packages/linux/patches/4.1.1/linux-224-STK1160-addFramescaling.patch diff --git a/packages/linux/patches/4.1/linux-227-ds3000-invalid-symbol-rate.patch b/packages/linux/patches/4.1.1/linux-227-ds3000-invalid-symbol-rate.patch similarity index 100% rename from packages/linux/patches/4.1/linux-227-ds3000-invalid-symbol-rate.patch rename to packages/linux/patches/4.1.1/linux-227-ds3000-invalid-symbol-rate.patch diff --git a/packages/linux/patches/4.1/linux-228-fix-tt-s2-4600.patch b/packages/linux/patches/4.1.1/linux-228-fix-tt-s2-4600.patch similarity index 100% rename from packages/linux/patches/4.1/linux-228-fix-tt-s2-4600.patch rename to packages/linux/patches/4.1.1/linux-228-fix-tt-s2-4600.patch diff --git a/packages/linux/patches/4.1/linux-229-hauppauge-hvr-2205-and-2255.patch b/packages/linux/patches/4.1.1/linux-229-hauppauge-hvr-2205-and-2255.patch similarity index 100% rename from packages/linux/patches/4.1/linux-229-hauppauge-hvr-2205-and-2255.patch rename to packages/linux/patches/4.1.1/linux-229-hauppauge-hvr-2205-and-2255.patch diff --git a/packages/linux/patches/4.1/linux-706-Sitecom-N300.patch b/packages/linux/patches/4.1.1/linux-706-Sitecom-N300.patch similarity index 100% rename from packages/linux/patches/4.1/linux-706-Sitecom-N300.patch rename to packages/linux/patches/4.1.1/linux-706-Sitecom-N300.patch diff --git a/packages/linux/patches/4.1/linux-950-saa716x_PCIe_interface_chipset.patch b/packages/linux/patches/4.1.1/linux-950-saa716x_PCIe_interface_chipset.patch similarity index 100% rename from packages/linux/patches/4.1/linux-950-saa716x_PCIe_interface_chipset.patch rename to packages/linux/patches/4.1.1/linux-950-saa716x_PCIe_interface_chipset.patch diff --git a/packages/linux/patches/4.1/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch b/packages/linux/patches/4.1.1/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch similarity index 100% rename from packages/linux/patches/4.1/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch rename to packages/linux/patches/4.1.1/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch diff --git a/packages/linux/patches/4.1/linux-995-CX24120-13Z_frontend.patch b/packages/linux/patches/4.1.1/linux-995-CX24120-13Z_frontend.patch similarity index 100% rename from packages/linux/patches/4.1/linux-995-CX24120-13Z_frontend.patch rename to packages/linux/patches/4.1.1/linux-995-CX24120-13Z_frontend.patch diff --git a/packages/linux/patches/4.1/linux-999-i915-use-legacy-turbo.patch b/packages/linux/patches/4.1.1/linux-999-i915-use-legacy-turbo.patch similarity index 100% rename from packages/linux/patches/4.1/linux-999-i915-use-legacy-turbo.patch rename to packages/linux/patches/4.1.1/linux-999-i915-use-legacy-turbo.patch diff --git a/packages/linux/patches/4.1/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch b/packages/linux/patches/4.1.1/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch similarity index 100% rename from packages/linux/patches/4.1/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch rename to packages/linux/patches/4.1.1/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch diff --git a/packages/linux/patches/4.1/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch b/packages/linux/patches/4.1.1/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch similarity index 100% rename from packages/linux/patches/4.1/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch rename to packages/linux/patches/4.1.1/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch diff --git a/packages/mediacenter/kodi/patches/kodi-999.99-buildfix.patch b/packages/mediacenter/kodi/patches/kodi-999.99-buildfix.patch new file mode 100644 index 0000000000..b0cb92442d --- /dev/null +++ b/packages/mediacenter/kodi/patches/kodi-999.99-buildfix.patch @@ -0,0 +1,12 @@ +diff -Naur kodi-15.0-rc1-9ff25f8/configure.ac kodi-15.0-rc1-9ff25f8.patch/configure.ac +--- kodi-15.0-rc1-9ff25f8/configure.ac 2015-07-02 23:35:21.000000000 +0200 ++++ kodi-15.0-rc1-9ff25f8.patch/configure.ac 2015-07-04 08:15:52.284856500 +0200 +@@ -1051,7 +1051,7 @@ + AC_DEFINE([HAVE_LIBEGL],[1],["Define to 1 if you have the `EGL' library (-lEGL)."]) + AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."]) + AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.) +- LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util" ++ LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm" + else + AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library)) + AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library)) diff --git a/packages/tools/bcm2835-bootloader/package.mk b/packages/tools/bcm2835-bootloader/package.mk index 96258cb564..1a9dd59494 100644 --- a/packages/tools/bcm2835-bootloader/package.mk +++ b/packages/tools/bcm2835-bootloader/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="bcm2835-bootloader" -PKG_VERSION="df32073" +PKG_VERSION="89881b5" PKG_REV="1" PKG_ARCH="arm" PKG_LICENSE="nonfree" diff --git a/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch b/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch index c60b9d9c25..e1ec4be1b1 100644 --- a/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch +++ b/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch @@ -1,7 +1,7 @@ -From 334f38e87d0f4d071929f26a73db4075f5a40a86 Mon Sep 17 00:00:00 2001 +From d4dbab9f0c3bc4ab02ba312ba0d4aa9f41371fdf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 01/51] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 01/58] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -25,10 +25,10 @@ index 2faceea..889d7a2 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 7ddf4d5ef049c6ab43814ea9946347fd8e13e36c Mon Sep 17 00:00:00 2001 +From 1ecf22c5b4c919e3aed5274c67f748bbae86fbf0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 03/51] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 03/58] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -51,10 +51,10 @@ index e22db7a..0120bd5 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 9d64e65d1de3cd2c18fdb95bc7d7825f42602ad9 Mon Sep 17 00:00:00 2001 +From ac054e5b5efd9ec9205598f9b7549a8e953272fd Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 04/51] Improved file buffering in CArchive +Subject: [PATCH 04/58] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -114,10 +114,10 @@ index 6ed0f8f..8506d95 100644 } else -From 11c32ec255761eb3763fa4b2bf7f4a261238e102 Mon Sep 17 00:00:00 2001 +From 1a7d63a938850a884f08bd3af66808bef91b7588 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH 05/51] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 05/58] [omxcodec] Don't force software codec with dvds --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ @@ -138,10 +138,10 @@ index 82b5baa..70b1ac3 100644 else if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) { -From 9a08c47d230a839bc32bf6c81c3d54bb8692b248 Mon Sep 17 00:00:00 2001 +From 47e9b3430cd67a4e9e17de65df96f9c0dbb7c39c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 06/51] filesystem: Make support of browsing into archives +Subject: [PATCH 06/58] filesystem: Make support of browsing into archives optional The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. @@ -159,7 +159,7 @@ We'll let people who don't use archives disable it manually 3 files changed, 18 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 97039ca..9614036 100644 +index ff32bfd..5345dc2 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16582,6 +16582,15 @@ msgstr "" @@ -224,10 +224,10 @@ index 5af92e7..568a1a8 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From 52ba2eb2daaeba3eaa7213b2f370f11b73ebdd51 Mon Sep 17 00:00:00 2001 +From e863fd0253902d92c56ed85e589bffadc98b245f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 08/51] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 08/58] [rbp] Make cachemembuffersize default depend on memory size --- @@ -329,10 +329,10 @@ index 2e3282c..d1606a2 100644 } -From b14ed34e6cf3a147e4e93161c60ff804b6a77286 Mon Sep 17 00:00:00 2001 +From 06bd0674846783738e6b81f351ba49bb633c473b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 10/51] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 10/58] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -354,10 +354,10 @@ index 4376463..fc4e5ea 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 975844c8114a270ab8c97925806b41a09600a90e Mon Sep 17 00:00:00 2001 +From c2b0eafa1ed07258aa09a24a443d4535db8b3a1e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 11/51] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 11/58] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -386,10 +386,10 @@ index bda7430..68fc647 100644 SetResolutionString(m_desktopRes); -From 873e875a8538a1c5219054f30a80d90877d0d301 Mon Sep 17 00:00:00 2001 +From 5f1821e4d8157a890c795744841dcb895a1349b4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 12/51] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 12/58] [dvdplayer/rbp] Add pi specific option to maintain vsync with pll adjustment New A/V sync option in settings/video/playback to do "Adjust PLL". @@ -414,7 +414,7 @@ Needed updated firmware 9 files changed, 91 insertions(+), 7 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 9614036..36b8c5d 100644 +index 5345dc2..6d08156 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -6321,7 +6321,22 @@ msgctxt "#13459" @@ -681,10 +681,10 @@ index 7df1bf7..732b69d 100644 float m_audioPlayCountMinimumPercent; bool m_dvdplayerIgnoreDTSinWAV; -From 0323acdf71a6bf8d66ff569403e8fc0412291325 Mon Sep 17 00:00:00 2001 +From 6ead5d132f5d43c6ea3063c5fcd1c7d3b23eca18 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 13/51] [audio] Add settings option to boost centre channel +Subject: [PATCH 13/58] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -702,7 +702,7 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 45 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 36b8c5d..c1148e8 100644 +index 6d08156..6e36b42 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16650,3 +16650,17 @@ msgctxt "#38006" @@ -772,7 +772,7 @@ index e4ddf9e..34d0152 100644 if (remapLayout) { diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index 7807149..759ba7b 100644 +index 78071493..759ba7b 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp @@ -164,6 +164,12 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d @@ -806,10 +806,10 @@ index f99c0e6..1911189 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 8dada388745328d01b186ede90c64be0b571a936 Mon Sep 17 00:00:00 2001 +From aca0d43f243143b6776e1cc8ef259197d2bee97a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 14/51] [rbp] Default extract thumbnails to false +Subject: [PATCH 14/58] [rbp] Default extract thumbnails to false It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. It genereates a lot of support issues. Best to default to disabled and let users enable it if they must @@ -839,10 +839,10 @@ index 50fe36a..a54a4c4 100644
-From cf3e013db35eda90e5e2f337d8355312ce0e5955 Mon Sep 17 00:00:00 2001 +From 35f0f171ab8a9c37b2ebb5aca81b2242834fda72 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH 19/51] [dvdplayer] Add lock for player creation +Subject: [PATCH 19/58] [dvdplayer] Add lock for player creation --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ @@ -878,7 +878,7 @@ index 70b1ac3..b41c8f0 100644 std::string retVal; diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index 2a4aea5..f74e71d 100644 +index ab6a228..32e76c1 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h @@ -557,4 +557,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer @@ -888,10 +888,10 @@ index 2a4aea5..f74e71d 100644 + CCriticalSection m_players_lock; }; -From 5d3ab1cf45b4eca6f524b4555e3f103e27467a49 Mon Sep 17 00:00:00 2001 +From 51e261109f6a8d1cb0e96bdaa56a01aa7077633f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 22:07:25 +0000 -Subject: [PATCH 20/51] [dvdplayervideo] Prod decoder when in stills mode +Subject: [PATCH 20/58] [dvdplayervideo] Prod decoder when in stills mode An asynchronous hardware decoder doesn't only produce output pictures when new packets arrive. In dvd stills mode give it a chance to return pictures that weren't ready when frame was decoded. @@ -900,7 +900,7 @@ In dvd stills mode give it a chance to return pictures that weren't ready when f 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 656c937..bdc3edb 100644 +index f1a7e60..9be8aae 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -314,7 +314,8 @@ void CDVDPlayerVideo::Process() @@ -968,10 +968,10 @@ index 656c937..bdc3edb 100644 if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) -From 25d43d2d6bdf9de85a30161aa1c7e0260b4de33b Mon Sep 17 00:00:00 2001 +From deb376b5dad3cef8f86cef69aab9a4280bac9b21 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH 21/51] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 21/58] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -994,10 +994,10 @@ index fcdd063..16f0c89 100644 } -From 126cddbf807d68c42e07d24c733d65abb687b500 Mon Sep 17 00:00:00 2001 +From 7351fa296cd1740f04c6c5a2047c11e3b607f700 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 22/51] logging: Add microsecond timer to log messages +Subject: [PATCH 22/58] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -1050,10 +1050,10 @@ index 3443f12..31c4a99 100644 levelNames[logLevel]) + strData; -From cfe6214efcc206c97cf8eb6b224c0a8d63981c77 Mon Sep 17 00:00:00 2001 +From c2bc1032b22f6214ffbbbecb29e3538f9790f016 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH 23/51] [rbp] hack: wait for splash to complete before changing +Subject: [PATCH 23/58] [rbp] hack: wait for splash to complete before changing hdmi mode --- @@ -1127,10 +1127,10 @@ index 68fc647..c80114e 100644 if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) -From 1610df489966e26604392af08d40a2a2eacad8db Mon Sep 17 00:00:00 2001 +From 58ed12b2f7dd77fc57b3ddbff8fbaa04a0172716 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH 24/51] Fix for UI not showing both extractflags and +Subject: [PATCH 24/58] Fix for UI not showing both extractflags and extractthumb --- @@ -1139,7 +1139,7 @@ Subject: [PATCH 24/51] Fix for UI not showing both extractflags and 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index b6b48b4..6c3a220 100644 +index 788a831..a794cd8 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -11015,7 +11015,7 @@ msgstr "" @@ -1194,10 +1194,10 @@ index 09c3d10..1059b09 100644 -From 07f3c28448d28cf7347394dca6e6a1faeaa7e3ec Mon Sep 17 00:00:00 2001 +From 6f0adae04039766326ebb5a735433dac07787a0f Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 25/51] Disable autoscrolling while on screensaver and while +Subject: [PATCH 25/58] Disable autoscrolling while on screensaver and while opening streams. --- @@ -1210,10 +1210,10 @@ Subject: [PATCH 25/51] Disable autoscrolling while on screensaver and while 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index ffc7ad3..f35871a 100644 +index 697f278..a2a7fd2 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -4993,3 +4993,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const +@@ -4996,3 +4996,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const return false; } @@ -1328,10 +1328,10 @@ index 0d5b3f7..6d23024 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 5acd81c2d630bbe83763c5463cc26aae862a87b4 Mon Sep 17 00:00:00 2001 +From 9b85c054f66cb5efde618d34198bd533f16f26d5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH 26/51] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 26/58] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -1426,10 +1426,10 @@ index ab298b2..10c5ee0 100644 } catch(...) { -From 80367ca635d7fd6ba3e278fe4c4f2a9275f5c358 Mon Sep 17 00:00:00 2001 +From cb5bcc331593fa2d2088c0a0f8f72aefce1030e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 15 Feb 2015 14:06:12 +0000 -Subject: [PATCH 27/51] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 27/58] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 7 +++++++ @@ -1461,10 +1461,10 @@ index 4c363cf..b90237b 100644 { // If dvd is an mpeg2 and hint.stills -From 959665eaf7160c8adb2d0f2e862e1e8ef5df2419 Mon Sep 17 00:00:00 2001 +From 3873604d5ef7443bdfc33603c979495fe8a0f17c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 31 Mar 2015 17:31:47 +0100 -Subject: [PATCH 28/51] [mmalrenderer] Add SetCodecControl function and prefer +Subject: [PATCH 28/58] [mmalrenderer] Add SetCodecControl function and prefer to return pictures when renderer is low (disabled) --- @@ -1535,10 +1535,10 @@ index 51a64d1..bde8c06 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_dec; -From aa0a393eb9fc52c4aa791042dd521d16f8852567 Mon Sep 17 00:00:00 2001 +From 8f077b7937e519bbe44a02c3559808672696903e Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH 29/51] Load OSD dialogs on startup. +Subject: [PATCH 29/58] Load OSD dialogs on startup. Fixes skipped frames the first time they're loaded in memory on less powered devices, like a Raspberry Pi, when using DVDPlayer. @@ -1633,10 +1633,10 @@ index 9f25fa5..3ece45b 100644 CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From cd731d75ce08cb29dc73de665830a4597db691a9 Mon Sep 17 00:00:00 2001 +From 2c96de41d5df402113fb6f675c5c6766ad48b267 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 7 Mar 2015 22:46:21 +0000 -Subject: [PATCH 30/51] configure: Add raspberry-pi2 platform +Subject: [PATCH 30/58] configure: Add raspberry-pi2 platform --- configure.ac | 14 +++++++-- @@ -1648,7 +1648,7 @@ Subject: [PATCH 30/51] configure: Add raspberry-pi2 platform 6 files changed, 44 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac -index 96be96f..7e924a2 100644 +index 71883d2..6beec97 100644 --- a/configure.ac +++ b/configure.ac @@ -744,8 +744,17 @@ case $use_platform in @@ -1810,449 +1810,10 @@ index cdc2fe4..379bd1d 100644 set(CMAKE_SYSTEM_NAME Linux) endif() -From a6e8bc8e2784775522dce233f0f9dc0bde7fca44 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 31/51] [omxplayer] Don't propagate 3d flags based on supported - 3d modes - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 +++-------------------------- - 1 file changed, 3 insertions(+), 26 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 212a89b..dd509ea 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -752,40 +752,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; - uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; - -- unsigned flags = 0; - ERenderFormat format = RENDER_FMT_BYPASS; - -+ /* figure out steremode expected based on user settings and hints */ -+ unsigned flags = GetStereoModeFlags(GetStereoMode()); -+ - if(m_bAllowFullscreen) - { - flags |= CONF_FLAGS_FULLSCREEN; - m_bAllowFullscreen = false; // only allow on first configure - } - -- flags |= GetStereoModeFlags(GetStereoMode()); -- -- if(flags & CONF_FLAGS_STEREO_MODE_SBS) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) -- CLog::Log(LOGNOTICE, "3DSBS movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); -- } -- } -- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) -- CLog::Log(LOGNOTICE, "3DTB movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); -- } -- } -- else -- CLog::Log(LOGNOTICE, "not a 3D movie"); -- - unsigned int iDisplayWidth = width; - unsigned int iDisplayHeight = height; - - -From 46641c44cbf4832f8dc2e09de13c90ec263c7eb0 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 32/51] [graphics] Allow switching to a more suitable 3D - resolution - ---- - xbmc/guilib/GraphicContext.cpp | 40 +++++++++++++++++++++++++++++++++++++++- - xbmc/guilib/GraphicContext.h | 1 + - 2 files changed, 40 insertions(+), 1 deletion(-) - -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index bd7dff9..ed7316a 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -32,6 +32,7 @@ - #include "input/InputManager.h" - #include "GUIWindowManager.h" - #include "video/VideoReferenceClock.h" -+#include - - using namespace std; - -@@ -499,6 +500,43 @@ RESOLUTION CGraphicContext::GetVideoResolution() const - return m_Resolution; - } - -+RESOLUTION CGraphicContext::Get3DVideoResolution(RESOLUTION resolution, RENDER_STEREO_MODE mode) const -+{ -+ RESOLUTION best = resolution; -+ RESOLUTION_INFO curr = CDisplaySettings::Get().GetResolutionInfo(best); -+ // Find closest refresh rate -+ for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) -+ { -+ const RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo((RESOLUTION)i); -+ -+ //discard resolutions that are not the same width and height (and interlaced/3D flags) -+ //or have a too low refreshrate -+ if (info.iScreenWidth != curr.iScreenWidth -+ || info.iScreenHeight != curr.iScreenHeight -+ || info.iScreen != curr.iScreen -+ || (info.dwFlags & D3DPRESENTFLAG_INTERLACED) != (curr.dwFlags & D3DPRESENTFLAG_INTERLACED) -+ || fabs(info.fRefreshRate - curr.fRefreshRate) >= FLT_EPSILON) -+ continue; -+ -+ if (mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ else if (mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && info.dwFlags & D3DPRESENTFLAG_MODE3DTB) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ else if ((mode == RENDER_STEREO_MODE_OFF || mode == RENDER_STEREO_MODE_MONO) && !(info.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ } -+ return best; -+} -+ - void CGraphicContext::ResetOverscan(RESOLUTION_INFO &res) - { - res.Overscan.left = 0; -@@ -1042,7 +1080,7 @@ void CGraphicContext::Flip(const CDirtyRegionList& dirty) - if(m_stereoMode != m_nextStereoMode) - { - m_stereoMode = m_nextStereoMode; -- SetVideoResolution(GetVideoResolution(), true); -+ SetVideoResolution(Get3DVideoResolution(m_Resolution, m_stereoMode), true); - g_windowManager.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_RENDERER_RESET); - } - } -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index a8fd03e..8501e58 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -108,6 +108,7 @@ class CGraphicContext : public CCriticalSection, - bool IsValidResolution(RESOLUTION res); - void SetVideoResolution(RESOLUTION res, bool forceUpdate = false); - RESOLUTION GetVideoResolution() const; -+ RESOLUTION Get3DVideoResolution(RESOLUTION resolution, RENDER_STEREO_MODE mode) const; - void ResetOverscan(RESOLUTION res, OVERSCAN &overscan); - void ResetOverscan(RESOLUTION_INFO &resinfo); - void ResetScreenParameters(RESOLUTION res); - -From 55a4a727c1c8d0ca28deb1a8ca2c6ffa6a4eb0aa Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 33/51] [3D] Support switching to 3D resolutions - -Include matching 3D flags (SBS/TAB) in the score of a resolution to switch to, to enable switching to 3d modes. -Also remove the old code that treated 3D modes differently when assigning a score. ---- - xbmc/cores/VideoRenderers/BaseRenderer.cpp | 47 +++++++++++------------------- - 1 file changed, 17 insertions(+), 30 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index bfafab7..84e6261 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -@@ -222,10 +222,14 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RESOLUTION current, float& weight) - { - RESOLUTION_INFO curr = g_graphicsContext.GetResInfo(current); -+ unsigned int stereo_mode = CONF_FLAGS_STEREO_MODE_MASK(m_iFlags); - - float fRefreshRate = fps; - -- float last_diff = fRefreshRate; -+ int c_weight = MathUtils::round_int(RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -+ if (!(stereo_mode == CONF_FLAGS_STEREO_MODE_SBS) != !(curr.dwFlags & D3DPRESENTFLAG_MODE3DSBS) || -+ !(stereo_mode == CONF_FLAGS_STEREO_MODE_TAB) != !(curr.dwFlags & D3DPRESENTFLAG_MODE3DTB)) -+ c_weight += 1000; - - // Find closest refresh rate - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) -@@ -241,40 +245,23 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES - || info.fRefreshRate < (fRefreshRate * multiplier / 1.001) - 0.001) - continue; - -- // For 3D choose the closest refresh rate -- if(CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -- { -- float diff = (info.fRefreshRate - fRefreshRate); -- if(diff < 0) -- diff *= -1.0f; -+ int i_weight = MathUtils::round_int(RefreshWeight(info.fRefreshRate, fRefreshRate * multiplier) * 1000.0); - -- if(diff < last_diff) -- { -- last_diff = diff; -- current = (RESOLUTION)i; -- curr = info; -- } -- } -- else -- { -- int c_weight = MathUtils::round_int(RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -- int i_weight = MathUtils::round_int(RefreshWeight(info.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -+ if (!(stereo_mode == CONF_FLAGS_STEREO_MODE_SBS) != !(info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) || -+ !(stereo_mode == CONF_FLAGS_STEREO_MODE_TAB) != !(info.dwFlags & D3DPRESENTFLAG_MODE3DTB)) -+ i_weight += 1000; - -- // Closer the better, prefer higher refresh rate if the same -- if ((i_weight < c_weight) -- || (i_weight == c_weight && info.fRefreshRate > curr.fRefreshRate)) -- { -- current = (RESOLUTION)i; -- curr = info; -- } -+ // Closer the better, prefer higher refresh rate if the same -+ if ((i_weight < c_weight) -+ || (i_weight == c_weight && info.fRefreshRate > curr.fRefreshRate)) -+ { -+ current = (RESOLUTION)i; -+ curr = info; -+ c_weight = i_weight; - } - } - -- // For 3D overwrite weight -- if(CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -- weight = 0; -- else -- weight = RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier); -+ weight = RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier); - - return current; - } - -From 568e84b69fc126735e0c9e298d3fa7d2eea0aae2 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 34/51] [graphics] Make pixel ratio for 3d modes consistent - -Note: Use the stored stereo flags from lists of resolutions. -Use current stereo mode for current resolution. ---- - xbmc/cores/VideoRenderers/BaseRenderer.cpp | 10 +++---- - xbmc/guilib/GraphicContext.cpp | 37 ++++++++++++------------- - xbmc/guilib/GraphicContext.h | 12 ++++++-- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 8 ------ - 4 files changed, 32 insertions(+), 35 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index 84e6261..f82f37f 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -@@ -119,7 +119,7 @@ bool CBaseRenderer::FindResolutionFromOverride(float fps, float& weight, bool fa - - for (size_t j = (int)RES_DESKTOP; j < CDisplaySettings::Get().ResolutionInfoSize(); j++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)j); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)j, g_graphicsContext.GetStereoMode((RESOLUTION)j)); - - if (info.iScreenWidth == curr.iScreenWidth - && info.iScreenHeight == curr.iScreenHeight -@@ -179,7 +179,7 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - //get the resolution with the refreshrate closest to 60 hertz - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - if (MathUtils::round_int(info.fRefreshRate) == 60 - && info.iScreenWidth == curr.iScreenWidth -@@ -200,7 +200,7 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - CLog::Log(LOGDEBUG, "60 hertz refreshrate not available, choosing highest"); - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - if (info.fRefreshRate > curr.fRefreshRate - && info.iScreenWidth == curr.iScreenWidth -@@ -234,14 +234,14 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES - // Find closest refresh rate - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- const RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ const RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - //discard resolutions that are not the same width and height (and interlaced/3D flags) - //or have a too low refreshrate - if (info.iScreenWidth != curr.iScreenWidth - || info.iScreenHeight != curr.iScreenHeight - || info.iScreen != curr.iScreen -- || (info.dwFlags & D3DPRESENTFLAG_MODEMASK) != (curr.dwFlags & D3DPRESENTFLAG_MODEMASK) -+ || (info.dwFlags & D3DPRESENTFLAG_INTERLACED) != (curr.dwFlags & D3DPRESENTFLAG_INTERLACED) - || info.fRefreshRate < (fRefreshRate * multiplier / 1.001) - 0.001) - continue; - -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index ed7316a..f591b9c 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -746,32 +746,33 @@ void CGraphicContext::ApplyStateBlock() - g_Windowing.ApplyStateBlock(); - } - --const RESOLUTION_INFO CGraphicContext::GetResInfo(RESOLUTION res) const -+RENDER_STEREO_MODE CGraphicContext::GetStereoMode(RESOLUTION res) const - { - RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo(res); -+ return (info.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? RENDER_STEREO_MODE_SPLIT_HORIZONTAL : -+ (info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? RENDER_STEREO_MODE_SPLIT_VERTICAL : RENDER_STEREO_MODE_OFF; -+} - -- if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -+const RESOLUTION_INFO CGraphicContext::GetResInfo(RESOLUTION res, RENDER_STEREO_MODE stereoMode) const -+{ -+ RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo(res); -+ -+ if(stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) - { -- if((info.dwFlags & D3DPRESENTFLAG_MODE3DTB) == 0) -- { -- info.fPixelRatio /= 2; -- info.iBlanking = 0; -- info.dwFlags |= D3DPRESENTFLAG_MODE3DTB; -- } -+ info.fPixelRatio /= 2; -+ info.iBlanking = 0; -+ info.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - info.iHeight = (info.iHeight - info.iBlanking) / 2; - info.Overscan.top /= 2; - info.Overscan.bottom = (info.Overscan.bottom - info.iBlanking) / 2; - info.iSubtitles = (info.iSubtitles - info.iBlanking) / 2; - } - -- if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -+ if(stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) - { -- if((info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) == 0) -- { -- info.fPixelRatio *= 2; -- info.iBlanking = 0; -- info.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -- } -+ info.fPixelRatio *= 2; -+ info.iBlanking = 0; -+ info.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; - info.iWidth = (info.iWidth - info.iBlanking) / 2; - info.Overscan.left /= 2; - info.Overscan.right = (info.Overscan.right - info.iBlanking) / 2; -@@ -795,16 +796,14 @@ void CGraphicContext::SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info) - if(info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) - { - curr.Overscan.right = info.Overscan.right * 2 + info.iBlanking; -- if((curr.dwFlags & D3DPRESENTFLAG_MODE3DSBS) == 0) -- curr.fPixelRatio /= 2.0; -+ curr.fPixelRatio /= 2.0; - } - - if(info.dwFlags & D3DPRESENTFLAG_MODE3DTB) - { - curr.Overscan.bottom = info.Overscan.bottom * 2 + info.iBlanking; - curr.iSubtitles = info.iSubtitles * 2 + info.iBlanking; -- if((curr.dwFlags & D3DPRESENTFLAG_MODE3DTB) == 0) -- curr.fPixelRatio *= 2.0; -+ curr.fPixelRatio *= 2.0; - } - } - -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index 8501e58..0c53cae 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -120,11 +120,15 @@ class CGraphicContext : public CCriticalSection, - void GetAllowedResolutions(std::vector &res); - - // output scaling -+ const RESOLUTION_INFO GetResInfo(RESOLUTION res) const -+ { -+ return GetResInfo(res, GetStereoMode()); -+ } - const RESOLUTION_INFO GetResInfo() const - { - return GetResInfo(m_Resolution); - } -- const RESOLUTION_INFO GetResInfo(RESOLUTION res) const; -+ const RESOLUTION_INFO GetResInfo(RESOLUTION res, RENDER_STEREO_MODE stereo_mode) const; - void SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info); - - /* \brief Get UI scaling information from a given resolution to the screen resolution. -@@ -161,9 +165,11 @@ class CGraphicContext : public CCriticalSection, - void RestoreOrigin(); - void SetCameraPosition(const CPoint &camera); - void SetStereoView(RENDER_STEREO_VIEW view); -- RENDER_STEREO_VIEW GetStereoView() { return m_stereoView; } -+ RENDER_STEREO_VIEW GetStereoView() const { return m_stereoView; } - void SetStereoMode(RENDER_STEREO_MODE mode) { m_nextStereoMode = mode; } -- RENDER_STEREO_MODE GetStereoMode() { return m_stereoMode; } -+ RENDER_STEREO_MODE GetStereoMode() const { return m_stereoMode; } -+ RENDER_STEREO_MODE GetStereoMode(RESOLUTION res) const; -+ - void RestoreCameraPosition(); - /*! \brief Set a region in which to clip all rendering - Anything that is rendered after setting a clip region will be clipped so that no part renders -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index c80114e..80c05d2 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -499,15 +499,9 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); - // Also add 3D flags - if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) -- { - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -- m_desktopRes.fPixelRatio *= 2.0; -- } - else if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_TB_HALF) -- { - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; -- m_desktopRes.fPixelRatio *= 0.5; -- } - HDMI_PROPERTY_PARAM_T property; - property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; - vc_tv_hdmi_get_property(&property); -@@ -650,7 +644,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - RESOLUTION_INFO res2 = res; - res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; - res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); -- res2.fPixelRatio *= 2.0f; - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); -@@ -666,7 +659,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - RESOLUTION_INFO res2 = res; - res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); -- res2.fPixelRatio *= 0.5f; - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); - -From 0c9da02efd32493162bbe0080ce08fc75d024ad2 Mon Sep 17 00:00:00 2001 +From ecf7d1b7364dd7cb121825168aa51a6b14946614 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 10 Mar 2015 17:05:18 +0000 -Subject: [PATCH 35/51] [players] Add settings option to enable MVC support +Subject: [PATCH 31/58] [players] Add settings option to enable MVC support --- addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ @@ -2262,7 +1823,7 @@ Subject: [PATCH 35/51] [players] Add settings option to enable MVC support 4 files changed, 27 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 6c3a220..f5b7c42 100644 +index a794cd8..acb6372 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16680,6 +16680,16 @@ msgctxt "#38052" @@ -2333,10 +1894,10 @@ index e4f6d86..5d324f4 100644 case AV_CODEC_ID_MPEG4: // (role name) video_decoder.mpeg4 -From 397a5d0b70abe0922387a0afd8beb4842a56e9b0 Mon Sep 17 00:00:00 2001 +From 7c831c1cf47b62ee6ea8d57457b4b5ee35f29882 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Mar 2015 12:38:08 +0000 -Subject: [PATCH 36/51] [mmalrenderer] Switch to using transform flags for 3d +Subject: [PATCH 32/58] [mmalrenderer] Switch to using transform flags for 3d modes --- @@ -2350,7 +1911,7 @@ Subject: [PATCH 36/51] [mmalrenderer] Switch to using transform flags for 3d 7 files changed, 75 insertions(+), 130 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index f5b7c42..4848047 100644 +index acb6372..e1b691d 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16690,6 +16690,16 @@ msgctxt "#38111" @@ -2529,7 +2090,7 @@ index 9f1f803..6cde0c5 100644 + region.dest_rect.x, region.dest_rect.y, region.dest_rect.width, region.dest_rect.height, region.transform); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index dd509ea..adf9910 100644 +index 212a89b..ba17a46 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -649,9 +649,7 @@ int OMXPlayerVideo::GetFreeSpace() @@ -2687,7 +2248,7 @@ index d0634bb..86e94ce 100644 bool GetPlayerInfo(double &match, double &phase, double &pll); void SubmitEOS(); diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index 80c05d2..ae85484 100644 +index c80114e..3816b55 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -281,7 +281,9 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) @@ -2695,7 +2256,7 @@ index 80c05d2..ae85484 100644 HDMI_PROPERTY_PARAM_T property; property.property = HDMI_PROPERTY_3D_STRUCTURE; - if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) -+ if (CSettings::Get().GetBool("videoplayer.framepacking")) ++ if (CSettings::Get().GetBool("videoplayer.framepacking") && CSettings::Get().GetBool("videoplayer.supportmvc")) + property.param1 = HDMI_3D_FORMAT_FRAME_PACKING; + else if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) property.param1 = HDMI_3D_FORMAT_SBS_HALF; @@ -2716,10 +2277,10 @@ index 80c05d2..ae85484 100644 m_width, m_height, dst_rect.width, dst_rect.height, res.fRefreshRate, GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), (int)res.dwFlags, res.fPixelRatio); -From 180bad11da9d406158975f960198af9315170743 Mon Sep 17 00:00:00 2001 +From 404462b4bf655a3dd1f50f619162839f47f6efaa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH 39/51] [gui] Also limit GUI updates when in non full-screen +Subject: [PATCH 35/58] [gui] Also limit GUI updates when in non full-screen video mode --- @@ -2727,10 +2288,10 @@ Subject: [PATCH 39/51] [gui] Also limit GUI updates when in non full-screen 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index f35871a..dd58116 100644 +index a2a7fd2..95ec768 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2504,7 +2504,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2507,7 +2507,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) #if defined(TARGET_RASPBERRY_PI) || defined(HAS_IMXVPU) // This code reduces rendering fps of the GUI layer when playing videos in fullscreen mode // it makes only sense on architectures with multiple layers @@ -2739,7 +2300,7 @@ index f35871a..dd58116 100644 fps = CSettings::Get().GetInt("videoplayer.limitguiupdate"); #endif -@@ -2517,6 +2517,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2520,6 +2520,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) { if (!m_skipGuiRender) g_windowManager.Process(CTimeUtils::GetFrameTime()); @@ -2749,10 +2310,761 @@ index f35871a..dd58116 100644 g_windowManager.FrameMove(); } -From a00d53ea266d3513d4785ff730d4d3ed9aace2a4 Mon Sep 17 00:00:00 2001 +From f83aef5f43795b2e08d87dc1ba8723bd7c7f09a2 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:24:42 +0200 +Subject: [PATCH 36/58] Added some vc_tv_* functions that were missing in + DllBCM. + +--- + xbmc/linux/DllBCM.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/xbmc/linux/DllBCM.h b/xbmc/linux/DllBCM.h +index b92fdb8..9c7e293 100644 +--- a/xbmc/linux/DllBCM.h ++++ b/xbmc/linux/DllBCM.h +@@ -48,6 +48,9 @@ class DllBcmHostInterface + virtual void bcm_host_init() = 0; + virtual void bcm_host_deinit() = 0; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) = 0; ++ virtual int vc_tv_power_off() = 0; ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) = 0; ++ virtual int vc_tv_hdmi_power_on_preferred() = 0; + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) = 0; + virtual int vc_tv_hdmi_power_on_best_3d(uint32_t width, uint32_t height, uint32_t frame_rate, +@@ -92,6 +95,12 @@ class DllBcmHost : public DllDynamic, DllBcmHostInterface + { return ::bcm_host_deinit(); }; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) + { return ::graphics_get_display_size(display_number, width, height); }; ++ virtual int vc_tv_power_off() ++ { return ::vc_tv_power_off(); } ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) ++ { return ::vc_tv_sdtv_power_on(mode, options); } ++ virtual int vc_tv_hdmi_power_on_preferred() ++ { return ::vc_tv_hdmi_power_on_preferred(); } + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) + { return ::vc_tv_hdmi_power_on_best(width, height, frame_rate, scan_mode, match_flags); }; + +From f72df42ab7b2987446c08230917f59391f58c1ef Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:29:03 +0200 +Subject: [PATCH 37/58] Added private utility function to map a float display + aspect, to the respective SDTV_ASPECT_* enum value. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 3816b55..520bf95 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -60,7 +60,10 @@ + # define DLOG(fmt, args...) + #endif + ++#if defined(TARGET_RASPBERRY_PI) + static void SetResolutionString(RESOLUTION_INFO &res); ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect); ++#endif + + CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() + { +@@ -470,6 +473,25 @@ static void SetResolutionString(RESOLUTION_INFO &res) + res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "", + res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : ""); + } ++ ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect) ++{ ++ SDTV_ASPECT_T aspect; ++ const float delta = 1e-3; ++ if(fabs(get_display_aspect_ratio(SDTV_ASPECT_16_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_16_9; ++ } ++ else if(fabs(get_display_aspect_ratio(SDTV_ASPECT_14_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_14_9; ++ } ++ else ++ { ++ aspect = SDTV_ASPECT_4_3; ++ } ++ return aspect; ++} + #endif + + bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) + +From dbb24dacba5c40c0d536f4f71f5ac8b3b01fab41 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 19:50:58 +0200 +Subject: [PATCH 38/58] Changed SDTV resolutions to be treated similarly to + HDMI resolutions in SetNativeResolution. This means that the SDTV interface + is powered up and set to the right mode. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 36 ++++++++++++++++++++----- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h | 1 - + 2 files changed, 29 insertions(+), 8 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 520bf95..a1f67fd 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -274,7 +274,7 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + DestroyDispmaxWindow(); + +- if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + { + sem_init(&m_tv_synced, 0, 0); + m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); +@@ -330,6 +330,33 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + m_desktopRes = res; + } ++ else if(!GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ { ++ sem_init(&m_tv_synced, 0, 0); ++ m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); ++ ++ SDTV_OPTIONS_T options; ++ options.aspect = get_sdtv_aspect_from_display_aspect((float)res.iScreenWidth / (float)res.iScreenHeight); ++ ++ int success = m_DllBcmHost->vc_tv_sdtv_power_on((SDTV_MODE_T)GETFLAGS_MODE(res.dwFlags), &options); ++ ++ if (success == 0) ++ { ++ CLog::Log(LOGDEBUG, "EGL set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ ++ sem_wait(&m_tv_synced); ++ } ++ else ++ { ++ CLog::Log(LOGERROR, "EGL failed to set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ } ++ m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); ++ sem_destroy(&m_tv_synced); ++ ++ m_desktopRes = res; ++ } + + m_dispman_display = g_RBP.OpenDisplay(0); + +@@ -502,8 +529,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + if(!m_DllBcmHost) + return false; + +- m_fixedMode = false; +- + /* read initial desktop resolution before probe resolutions. + * probing will replace the desktop resolution when it finds the same one. + * we raplace it because probing will generate more detailed +@@ -552,7 +577,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iHeight = tv_state.display.sdtv.height; + m_desktopRes.iScreenWidth = tv_state.display.sdtv.width; + m_desktopRes.iScreenHeight= tv_state.display.sdtv.height; +- m_desktopRes.dwFlags = D3DPRESENTFLAG_INTERLACED; ++ m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1); + m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; + m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); + } +@@ -575,9 +600,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); + } + +- if(resolutions.size() < 2) +- m_fixedMode = true; +- + DLOG("CEGLNativeTypeRaspberryPI::ProbeResolutions\n"); + return true; + #else +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +index 59401f5..a0acb1a 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +@@ -59,7 +59,6 @@ class CEGLNativeTypeRaspberryPI : public CEGLNativeType + DISPMANX_ELEMENT_HANDLE_T m_dispman_element; + TV_GET_STATE_RESP_T m_tv_state; + sem_t m_tv_synced; +- bool m_fixedMode; + RESOLUTION_INFO m_desktopRes; + int m_width; + int m_height; + +From 06f189a4535e06b3d21f89e43b7caee7dedbe0d3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 17:11:09 +0100 +Subject: [PATCH 39/58] Revert "[3D] don't back out from 3D handling on + resolution changes if we're switching to a different 3D mode" + +This reverts commit 3c4c236a799dab8369b4bb74ff9993bc58a61a72. +--- + xbmc/guilib/GraphicContext.cpp | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp +index bd7dff9..fc4cc95 100644 +--- a/xbmc/guilib/GraphicContext.cpp ++++ b/xbmc/guilib/GraphicContext.cpp +@@ -436,17 +436,14 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat + + RENDER_STEREO_MODE stereo_mode = m_stereoMode; + +- // if the new resolution is an actual stereo mode, switch to that +- // if the old resolution was an actual stereo mode and renderer is still in old 3D mode, switch to no 3d mode ++ // if the new mode is an actual stereo mode, switch to that ++ // if the old mode was an actual stereo mode, switch to no 3d mode + if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DTB) + stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; + else if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DSBS) + stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) +- && m_stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- stereo_mode = RENDER_STEREO_MODE_OFF; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) +- && m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) ++ else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) != 0 ++ || (info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) != 0) + stereo_mode = RENDER_STEREO_MODE_OFF; + + if(stereo_mode != m_stereoMode) + +From 445dce97603e36fadc97ee3d479abe6f581f6a07 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 10 Jun 2015 20:42:03 +0100 +Subject: [PATCH 40/58] [rbp] Fix zoom modes with stereoscopic videos + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 12 ++++++++++-- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 12 ++++++++++-- + 2 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 6cde0c5..5fc68d2 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -621,9 +621,17 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect + CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); + + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) +- DestRect.x2 *= 2.0f; ++ { ++ float width = DestRect.x2 - DestRect.x1; ++ DestRect.x1 *= 2.0f; ++ DestRect.x2 = DestRect.x1 + 2.0f * width; ++ } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- DestRect.y2 *= 2.0f; ++ { ++ float height = DestRect.y2 - DestRect.y1; ++ DestRect.y1 *= 2.0f; ++ DestRect.y2 = DestRect.y1 + 2.0f * height; ++ } + + if (gui != display) + { +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index ba17a46..298eaff 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -690,9 +690,17 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); + + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) +- DestRect.x2 *= 2.0f; ++ { ++ float width = DestRect.x2 - DestRect.x1; ++ DestRect.x1 *= 2.0f; ++ DestRect.x2 = DestRect.x1 + 2.0f * width; ++ } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- DestRect.y2 *= 2.0f; ++ { ++ float height = DestRect.y2 - DestRect.y1; ++ DestRect.y1 *= 2.0f; ++ DestRect.y2 = DestRect.y1 + 2.0f * height; ++ } + + if (gui != display) + { + +From 84bc87e546d79c342b8a7c169f81e8521611cdb3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 17:42:03 +0100 +Subject: [PATCH 41/58] [WinSystemEGL] Remove unused Support3D function + +--- + xbmc/windowing/egl/WinSystemEGL.cpp | 29 ----------------------------- + xbmc/windowing/egl/WinSystemEGL.h | 1 - + 2 files changed, 30 deletions(-) + +diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp +index c3bdb6a..c43c4d0 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.cpp ++++ b/xbmc/windowing/egl/WinSystemEGL.cpp +@@ -531,35 +531,6 @@ EGLConfig CWinSystemEGL::GetEGLConfig() + return m_config; + } + +-// the logic in this function should match whether CBaseRenderer::FindClosestResolution picks a 3D mode +-bool CWinSystemEGL::Support3D(int width, int height, uint32_t mode) const +-{ +- RESOLUTION_INFO &curr = CDisplaySettings::Get().GetResolutionInfo(g_graphicsContext.GetVideoResolution()); +- +- // if we are using automatic hdmi mode switching +- if (CSettings::Get().GetInt("videoplayer.adjustrefreshrate") != ADJUST_REFRESHRATE_OFF) +- { +- int searchWidth = curr.iScreenWidth; +- int searchHeight = curr.iScreenHeight; +- +- // only search the custom resolutions +- for (unsigned int i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) +- { +- RESOLUTION_INFO res = CDisplaySettings::Get().GetResolutionInfo(i); +- if(res.iScreenWidth == searchWidth && res.iScreenHeight == searchHeight && (res.dwFlags & mode)) +- return true; +- } +- } +- // otherwise just consider current mode +- else +- { +- if (curr.dwFlags & mode) +- return true; +- } +- +- return false; +-} +- + bool CWinSystemEGL::ClampToGUIDisplayLimits(int &width, int &height) + { + width = width > m_nWidth ? m_nWidth : width; +diff --git a/xbmc/windowing/egl/WinSystemEGL.h b/xbmc/windowing/egl/WinSystemEGL.h +index 9d4baf6..1ec4225 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.h ++++ b/xbmc/windowing/egl/WinSystemEGL.h +@@ -59,7 +59,6 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES + virtual void Register(IDispResource *resource); + virtual void Unregister(IDispResource *resource); + +- virtual bool Support3D(int width, int height, uint32_t mode) const; + virtual bool ClampToGUIDisplayLimits(int &width, int &height); + + EGLConfig GetEGLConfig(); + +From 1597e6d82c667d55a763e965cb1e6448e0fbc01e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 16 Apr 2014 21:18:06 +0100 +Subject: [PATCH 42/58] [omxplayer] Don't propagate 3d flags based on supported + 3d modes + +--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 +++-------------------------- + 1 file changed, 3 insertions(+), 26 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 298eaff..3bf7c2e 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -726,40 +726,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f + uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; + uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; + +- unsigned flags = 0; + ERenderFormat format = RENDER_FMT_BYPASS; + ++ /* figure out steremode expected based on user settings and hints */ ++ unsigned flags = GetStereoModeFlags(GetStereoMode()); ++ + if(m_bAllowFullscreen) + { + flags |= CONF_FLAGS_FULLSCREEN; + m_bAllowFullscreen = false; // only allow on first configure + } + +- flags |= GetStereoModeFlags(GetStereoMode()); +- +- if(flags & CONF_FLAGS_STEREO_MODE_SBS) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) +- CLog::Log(LOGNOTICE, "3DSBS movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); +- } +- } +- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) +- CLog::Log(LOGNOTICE, "3DTB movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); +- } +- } +- else +- CLog::Log(LOGNOTICE, "not a 3D movie"); +- + unsigned int iDisplayWidth = width; + unsigned int iDisplayHeight = height; + + +From abadc22d9bed0fdf91c3a5be16dd07d8aa8d9f79 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 18:52:28 +0100 +Subject: [PATCH 43/58] [3d] Avoid switching stereo mode based on current + display mode + +--- + xbmc/guilib/GraphicContext.cpp | 21 --------------------- + 1 file changed, 21 deletions(-) + +diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp +index fc4cc95..e18232e 100644 +--- a/xbmc/guilib/GraphicContext.cpp ++++ b/xbmc/guilib/GraphicContext.cpp +@@ -432,27 +432,6 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat + Lock(); + + RESOLUTION_INFO info_org = CDisplaySettings::Get().GetResolutionInfo(res); +- RESOLUTION_INFO info_last = CDisplaySettings::Get().GetResolutionInfo(lastRes); +- +- RENDER_STEREO_MODE stereo_mode = m_stereoMode; +- +- // if the new mode is an actual stereo mode, switch to that +- // if the old mode was an actual stereo mode, switch to no 3d mode +- if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DTB) +- stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; +- else if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DSBS) +- stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) != 0 +- || (info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) != 0) +- stereo_mode = RENDER_STEREO_MODE_OFF; +- +- if(stereo_mode != m_stereoMode) +- { +- m_stereoView = RENDER_STEREO_VIEW_OFF; +- m_stereoMode = stereo_mode; +- m_nextStereoMode = stereo_mode; +- CSettings::Get().SetInt("videoscreen.stereoscopicmode", (int)m_stereoMode); +- } + + RESOLUTION_INFO info_mod = GetResInfo(res); + + +From ecb3cd064f5df496cbf685eec4c4d680c3c79704 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 3 Jun 2015 23:13:51 +0100 +Subject: [PATCH 44/58] [rpi] Always add desktop resolution to supported list + +There was an assumption that the desktop resolution would be in the probed list, but that is sometimes not the case. +We don't add interlaced resolutions to list, but they can be the preferred resolution read from edid. See: +http://openelec.tv/forum/124-raspberry-pi/77074-forcing-interlaced-output + +Also hotplug changes causing an edid reread may cause the supported modes to change (e.g. powering on receiver) +and it is possible the previous preferred mode is no longer there + +So ensure that desktop resolution is always added to list. Also handle the case where desktop resolution is invalid on launch +(e.g. hdmi output powered off) +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index a1f67fd..69ce9b7 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -190,7 +190,7 @@ int CEGLNativeTypeRaspberryPI::FindMatchingResolution(const RESOLUTION_INFO &res + for (int i = 0; i < (int)resolutions.size(); i++) + { + if(resolutions[i].iScreenWidth == res.iScreenWidth && resolutions[i].iScreenHeight == res.iScreenHeight && resolutions[i].fRefreshRate == res.fRefreshRate && +- (resolutions[i].dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) == (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) ++ (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) + { + return i; + } +@@ -206,8 +206,7 @@ int CEGLNativeTypeRaspberryPI::AddUniqueResolution(RESOLUTION_INFO &res, std::ve + int i = FindMatchingResolution(res, resolutions); + if (i>=0) + { // don't replace a progressive resolution with an interlaced one of same resolution +- if (!(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) +- resolutions[i] = res; ++ resolutions[i] = res; + } + else + { +@@ -569,7 +568,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + vc_tv_hdmi_get_property(&property); + m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; + } +- else // sdtv ++ else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv + { + m_desktopRes.iScreen = 0; + m_desktopRes.bFullScreen = true; +@@ -594,7 +593,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); + GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); + +- if(resolutions.size() == 0) + { + AddUniqueResolution(m_desktopRes, resolutions); + CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); +@@ -686,6 +684,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); + res.iSubtitles = (int)(0.965 * res.iHeight); + ++ if (!m_desktopRes.dwFlags && prefer_group == group && prefer_mode == tv->code) ++ m_desktopRes = res; ++ ++ if (res.dwFlags & D3DPRESENTFLAG_INTERLACED) ++ continue; ++ + AddUniqueResolution(res, resolutions); + CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, + tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); + +From 71f32189c08f3001e0a00f3d21d799eb7b0ac9ba Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 18:53:29 +0100 +Subject: [PATCH 45/58] [rbp] Drop reporting 3D modes and just use current + rendering mode to request 3D signalling + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 76 +++++-------------------- + 1 file changed, 15 insertions(+), 61 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 69ce9b7..25a97ad 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -28,6 +28,9 @@ + #include "linux/RBP.h" + #include "utils/StringUtils.h" + #include "settings/Settings.h" ++#include "guilib/GraphicContext.h" ++#include "guilib/StereoscopicsManager.h" ++#include "rendering/RenderSystem.h" + #include + + #ifndef __VIDEOCORE4__ +@@ -273,21 +276,22 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + DestroyDispmaxWindow(); + ++ RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); + if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + { + sem_init(&m_tv_synced, 0, 0); + m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); + +- if (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) ++ if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL || stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + { + /* inform TV of any 3D settings. Note this property just applies to next hdmi mode change, so no need to call for 2D modes */ + HDMI_PROPERTY_PARAM_T property; + property.property = HDMI_PROPERTY_3D_STRUCTURE; + if (CSettings::Get().GetBool("videoplayer.framepacking") && CSettings::Get().GetBool("videoplayer.supportmvc")) + property.param1 = HDMI_3D_FORMAT_FRAME_PACKING; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + property.param1 = HDMI_3D_FORMAT_SBS_HALF; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + property.param1 = HDMI_3D_FORMAT_TB_HALF; + else + property.param1 = HDMI_3D_FORMAT_NONE; +@@ -310,19 +314,17 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + if (success == 0) + { +- CLog::Log(LOGDEBUG, "EGL set HDMI mode (%d,%d)=%d%s%s\n", ++ CLog::Log(LOGDEBUG, "EGL set HDMI mode (%d,%d)=%d %s\n", + GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success, +- (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? " SBS":"", +- (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? " TB":""); ++ CStereoscopicsManager::Get().ConvertGuiStereoModeToString(stereo_mode)); + + sem_wait(&m_tv_synced); + } + else + { +- CLog::Log(LOGERROR, "EGL failed to set HDMI mode (%d,%d)=%d%s%s\n", ++ CLog::Log(LOGERROR, "EGL failed to set HDMI mode (%d,%d)=%d %s\n", + GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success, +- (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? " SBS":"", +- (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? " TB":""); ++ CStereoscopicsManager::Get().ConvertGuiStereoModeToString(stereo_mode)); + } + m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); + sem_destroy(&m_tv_synced); +@@ -385,9 +387,9 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + DISPMANX_TRANSFORM_T transform = DISPMANX_NO_ROTATE; + DISPMANX_UPDATE_HANDLE_T dispman_update = m_DllBcmHost->vc_dispmanx_update_start(0); + +- if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ++ if (stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + transform = DISPMANX_STEREOSCOPIC_SBS; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + transform = DISPMANX_STEREOSCOPIC_TB; + else + transform = DISPMANX_STEREOSCOPIC_MONO; +@@ -494,10 +496,8 @@ static void SetResolutionString(RESOLUTION_INFO &res) + res.iWidth = gui_width; + res.iHeight = gui_height; + +- res.strMode = StringUtils::Format("%dx%d (%dx%d) @ %.2f%s%s%s - Full Screen", res.iScreenWidth, res.iScreenHeight, res.iWidth, res.iHeight, res.fRefreshRate, +- res.dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : "", +- res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "", +- res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : ""); ++ res.strMode = StringUtils::Format("%dx%d (%dx%d) @ %.2f%s - Full Screen", res.iScreenWidth, res.iScreenHeight, res.iWidth, res.iHeight, res.fRefreshRate, ++ res.dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : ""); + } + + static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect) +@@ -552,17 +552,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iScreenHeight= tv_state.display.hdmi.height; + m_desktopRes.dwFlags = MAKEFLAGS(tv_state.display.hdmi.group, tv_state.display.hdmi.mode, tv_state.display.hdmi.scan_mode); + m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); +- // Also add 3D flags +- if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) +- { +- m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; +- m_desktopRes.fPixelRatio *= 2.0; +- } +- else if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_TB_HALF) +- { +- m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; +- m_desktopRes.fPixelRatio *= 0.5; +- } + HDMI_PROPERTY_PARAM_T property; + property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; + vc_tv_hdmi_get_property(&property); +@@ -700,41 +689,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); + AddUniqueResolution(res2, resolutions); + } +- +- // Also add 3D versions of modes +- if (tv->struct_3d_mask & HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_HORIZONTAL) +- { +- RESOLUTION_INFO res2 = res; +- res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; +- res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- res2.fPixelRatio *= 2.0f; +- res2.iSubtitles = (int)(0.965 * res2.iHeight); +- +- AddUniqueResolution(res2, resolutions); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) +- { +- res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +- AddUniqueResolution(res2, resolutions); +- } +- } +- if (tv->struct_3d_mask & HDMI_3D_STRUCT_TOP_AND_BOTTOM) +- { +- RESOLUTION_INFO res2 = res; +- res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; +- res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- res2.fPixelRatio *= 0.5f; +- res2.iSubtitles = (int)(0.965 * res2.iHeight); +- +- AddUniqueResolution(res2, resolutions); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) +- { +- res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +- AddUniqueResolution(res2, resolutions); +- } +- +- } + } + } + if (supported_modes) + +From 23e4fb99f6f4ad1cc969cc8361dc55338769419f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 30 Jun 2015 14:08:24 +0100 +Subject: [PATCH 46/58] [rbp] Ignore video stereo mode when 3D display mode is + disabled + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 4 ++++ + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 5fc68d2..ce2e98d 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -589,6 +589,10 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect + bool stereo_invert = (m_iFlags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; + RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + ++ // ignore video stereo mode when 3D display mode is disabled ++ if (display_stereo_mode == RENDER_STEREO_MODE_OFF) ++ video_stereo_mode = RENDER_STEREO_MODE_OFF; ++ + // fix up transposed video + if (m_renderOrientation == 90 || m_renderOrientation == 270) + { +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 3bf7c2e..5f6b402 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -658,6 +658,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + bool stereo_invert = (flags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; + RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + ++ // ignore video stereo mode when 3D display mode is disabled ++ if (display_stereo_mode == RENDER_STEREO_MODE_OFF) ++ video_stereo_mode = RENDER_STEREO_MODE_OFF; ++ + // fix up transposed video + if (m_hints.orientation == 90 || m_hints.orientation == 270) + { + +From 72e7fc2a4f0701ce47e624c5c73f457ae8db93fd Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 22 Jun 2015 16:27:15 +0100 +Subject: [PATCH 47/58] [EGL] Don't skip out when HDMI mode is considered the + same + +It might have different 3D signalling. TODO: keep track of 3D signalling +--- + xbmc/windowing/egl/WinSystemEGL.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp +index c43c4d0..13b75b1 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.cpp ++++ b/xbmc/windowing/egl/WinSystemEGL.cpp +@@ -287,7 +287,7 @@ bool CWinSystemEGL::CreateNewWindow(const std::string& name, bool fullScreen, RE + (current_resolution.dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) + { + CLog::Log(LOGDEBUG, "CWinSystemEGL::CreateNewWindow: No need to create a new window"); +- return true; ++//xxx return true; + } + + m_bFullScreen = fullScreen; + +From 9747f3d0ba4d3fabe46c35ceaeb74d2ee5daf547 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Apr 2015 14:32:07 +0100 -Subject: [PATCH 40/51] [mmalrenderer] Add sharpness control +Subject: [PATCH 48/58] [mmalrenderer] Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -2761,7 +3073,7 @@ Subject: [PATCH 40/51] [mmalrenderer] Add sharpness control 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 5ad526e..d252240 100644 +index 6d861c1..c41b177 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -7503,7 +7503,7 @@ msgstr "" @@ -2774,7 +3086,7 @@ index 5ad526e..d252240 100644 #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 6cde0c5..9bf1aed 100644 +index ce2e98d..fb92079 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp @@ -207,6 +207,7 @@ CMMALRenderer::CMMALRenderer() @@ -2824,17 +3136,17 @@ index 1404fb3..9bced7e 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; -From 38eef3259f992329214af255923b6a2ce7364921 Mon Sep 17 00:00:00 2001 +From 7995698144c5b5c44dd9f4f80f17fa7803962586 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 24 Apr 2015 13:49:51 +0100 -Subject: [PATCH 41/51] [dvdplayer] Add back required include +Subject: [PATCH 49/58] [dvdplayer] Add back required include --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index bdc3edb..2dad96c 100644 +index 9be8aae..ebec92d 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -33,6 +33,7 @@ @@ -2846,10 +3158,10 @@ index bdc3edb..2dad96c 100644 #include "guilib/GraphicContext.h" #include -From ec33b18ad7a9fe49b5a9a10f053bd5b9d1ea4214 Mon Sep 17 00:00:00 2001 +From 9cb45bcb661cf5de4814e304706d982352453f48 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 May 2015 23:58:06 +0100 -Subject: [PATCH 42/51] [screensaver] Leave GUI contents available for +Subject: [PATCH 50/58] [screensaver] Leave GUI contents available for screensaver --- @@ -2879,10 +3191,10 @@ index ba33908..17ea269 100644 // Add window to the history list (we must do this before we activate it, -From 5964fa6583235b7fce1d0c83ba4005380a7bf322 Mon Sep 17 00:00:00 2001 +From 2e8dcaa3564b564dfdd7961c1d2beabee57cb7f8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 15 May 2015 14:04:11 +0100 -Subject: [PATCH 44/51] [omxplayer] Make unsupported when ac3transcode is +Subject: [PATCH 52/58] [omxplayer] Make unsupported when ac3transcode is enabled --- @@ -2890,7 +3202,7 @@ Subject: [PATCH 44/51] [omxplayer] Make unsupported when ac3transcode is 1 file changed, 6 insertions(+) diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp -index be54f31..373e3f2 100644 +index eff47e0..b954276 100644 --- a/xbmc/cores/omxplayer/OMXHelper.cpp +++ b/xbmc/cores/omxplayer/OMXHelper.cpp @@ -56,6 +56,12 @@ bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer @@ -2907,10 +3219,10 @@ index be54f31..373e3f2 100644 { // find video stream -From ba0740cf8f5e163720e03516186522bbf16c25b0 Mon Sep 17 00:00:00 2001 +From 8294881aca9494a55c30f7347599779fe770c50d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 1 Jun 2015 14:14:43 +0100 -Subject: [PATCH 45/51] [omximage] Don't report failed decode of progressive +Subject: [PATCH 53/58] [omximage] Don't report failed decode of progressive jpegs as as error --- @@ -2996,10 +3308,10 @@ index a43a446..890ca88 100644 } -From 33a38607218899acba79a30dc7b9163daaf99c65 Mon Sep 17 00:00:00 2001 +From 61003a22eb36823420523a2d3df994e1222e0cea Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 May 2015 19:01:00 +0100 -Subject: [PATCH 46/51] [rbp] Allow settings option for timestamp preference +Subject: [PATCH 54/58] [rbp] Allow settings option for timestamp preference We currently have some files that play better with pts timestamps and some that play better with dts timestamps Provide a gui setting to allow users to adjust this behaviour until we have a better solution @@ -3011,7 +3323,7 @@ Provide a gui setting to allow users to adjust this behaviour until we have a be 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index b76e723..3c18575 100644 +index 0138e5f..2d043ec 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16714,3 +16714,13 @@ msgstr "" @@ -3060,7 +3372,7 @@ index a583450..4a63820 100644 // set a flag so we can identify primary frames from generated frames (deinterlace) buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index adf9910..f9b9232 100644 +index 5f6b402..ce23bec 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -495,7 +495,7 @@ void OMXPlayerVideo::Process() @@ -3073,10 +3385,10 @@ index adf9910..f9b9232 100644 if (pts == DVD_NOPTS_VALUE) pts = dts; -From 792a42205d18d6d389a36101c85594884eb9b34e Mon Sep 17 00:00:00 2001 +From 9fc7a4289b865202e2b8d4ac9bc8174e1001e1ad Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:44:37 +0100 -Subject: [PATCH 47/51] [rbp] Ignore pts value when m_hints.ptsinvalid set +Subject: [PATCH 55/58] [rbp] Ignore pts value when m_hints.ptsinvalid set --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- @@ -3097,7 +3409,7 @@ index 4a63820..f7b0b25 100644 // set a flag so we can identify primary frames from generated frames (deinterlace) buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index f9b9232..33aa88c 100644 +index ce23bec..e17fdb8 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -495,7 +495,7 @@ void OMXPlayerVideo::Process() @@ -3110,69 +3422,10 @@ index f9b9232..33aa88c 100644 if (pts == DVD_NOPTS_VALUE) pts = dts; -From 493d0d8dfac375bedb0e80c08213bb45a714a4bb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 10 Jun 2015 20:42:03 +0100 -Subject: [PATCH 49/51] [rbp] Fix zoom modes with stereoscopic videos - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 12 ++++++++++-- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 12 ++++++++++-- - 2 files changed, 20 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 9bf1aed..e420834 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -632,9 +632,17 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect - CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); - - if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -- DestRect.x2 *= 2.0f; -+ { -+ float width = DestRect.x2 - DestRect.x1; -+ DestRect.x1 *= 2.0f; -+ DestRect.x2 = DestRect.x1 + 2.0f * width; -+ } - else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -- DestRect.y2 *= 2.0f; -+ { -+ float height = DestRect.y2 - DestRect.y1; -+ DestRect.y1 *= 2.0f; -+ DestRect.y2 = DestRect.y1 + 2.0f * height; -+ } - - if (gui != display) - { -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 33aa88c..e008405 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -690,9 +690,17 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec - CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); - - if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -- DestRect.x2 *= 2.0f; -+ { -+ float width = DestRect.x2 - DestRect.x1; -+ DestRect.x1 *= 2.0f; -+ DestRect.x2 = DestRect.x1 + 2.0f * width; -+ } - else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -- DestRect.y2 *= 2.0f; -+ { -+ float height = DestRect.y2 - DestRect.y1; -+ DestRect.y1 *= 2.0f; -+ DestRect.y2 = DestRect.y1 + 2.0f * height; -+ } - - if (gui != display) - { - -From 8312d9234bddd5878f60a7a297e16e61d2cab255 Mon Sep 17 00:00:00 2001 +From 08b2eeaffdfdd1dc124ee3eb2f5a21b664074eca Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:43:57 +0100 -Subject: [PATCH 50/51] ffmpeg: Automatic switch to software decode for GMC +Subject: [PATCH 56/58] ffmpeg: Automatic switch to software decode for GMC with more than one warp point --- @@ -3187,6 +3440,60 @@ Subject: [PATCH 50/51] ffmpeg: Automatic switch to software decode for GMC 8 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +diff --git a/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch b/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +new file mode 100644 +index 0000000..4cb8dd8 +--- /dev/null ++++ b/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +@@ -0,0 +1,48 @@ ++From 84e9a1784bbd3182b68cefa5e5feae8da8b9e184 Mon Sep 17 00:00:00 2001 ++From: popcornmix ++Date: Fri, 5 Jun 2015 22:48:33 +0100 ++Subject: [PATCH] mpeg4video: Signal unsupported GMC with more than one warp ++ point ++ ++--- ++ libavcodec/avcodec.h | 1 + ++ libavcodec/mpeg4videodec.c | 4 ++++ ++ 2 files changed, 5 insertions(+) ++ ++diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h ++index 8c7c420..e63dc2d 100644 ++--- a/libavcodec/avcodec.h +++++ b/libavcodec/avcodec.h ++@@ -2527,6 +2527,7 @@ typedef struct AVCodecContext { ++ #define FF_BUG_DC_CLIP 4096 ++ #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. ++ #define FF_BUG_TRUNCATED 16384 +++#define FF_BUG_GMC_UNSUPPORTED 32768 ++ ++ /** ++ * strictly follow the standard (MPEG4, ...). ++diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c ++index 9bf33dd..0b5d3b9 100644 ++--- a/libavcodec/mpeg4videodec.c +++++ b/libavcodec/mpeg4videodec.c ++@@ -2179,6 +2179,9 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) ++ ++ if (ctx->divx_version >= 0) ++ s->workaround_bugs |= FF_BUG_HPEL_CHROMA; +++ +++ if (ctx->num_sprite_warping_points > 1) +++ s->workaround_bugs |= FF_BUG_GMC_UNSUPPORTED; ++ } ++ ++ if (s->workaround_bugs & FF_BUG_STD_QPEL) { ++@@ -2203,6 +2206,7 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) ++ s->workaround_bugs, ctx->lavc_build, ctx->xvid_build, ++ ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : ""); ++ +++ avctx->workaround_bugs = s->workaround_bugs; ++ if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 && ++ s->codec_id == AV_CODEC_ID_MPEG4 && ++ avctx->idct_algo == FF_IDCT_AUTO) { ++-- ++1.9.1 ++ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp index f7b0b25..3e97f1d 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp @@ -3274,7 +3581,7 @@ index c0e22a2..3849993 100644 // AUDIO int channels; diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp -index 373e3f2..093388c 100644 +index b954276..b5ee4b6 100644 --- a/xbmc/cores/omxplayer/OMXHelper.cpp +++ b/xbmc/cores/omxplayer/OMXHelper.cpp @@ -77,7 +77,9 @@ bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer @@ -3289,74 +3596,1069 @@ index 373e3f2..093388c 100644 else if ((hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) && g_RBP.GetCodecWvc1()) supported = true; -From 1798b2059a7dcc34b4dcecfec56736225d2ac918 Mon Sep 17 00:00:00 2001 +From e51804ed122dd0a642104d102315787970fffb8d Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Wed, 3 Jun 2015 23:13:51 +0100 -Subject: [PATCH 51/51] [rpi] Always add desktop resolution to supported list +Date: Mon, 22 Jun 2015 21:46:57 +0100 +Subject: [PATCH 57/58] [rbp] Use default resampling setting on Pi2 -There was an assumption that the desktop resolution would be in the probed list, but that is sometimes not the case. -We don't add interlaced resolutions to list, but they can be the preferred resolution read from edid. See: -http://openelec.tv/forum/124-raspberry-pi/77074-forcing-interlaced-output - -Also hotplug changes causing an edid reread may cause the supported modes to change (e.g. powering on receiver) -and it is possible the previous preferred mode is no longer there - -So ensure that desktop resolution is always added to list. Also handle the case where desktop resolution is invalid on launch -(e.g. hdmi output powered off) --- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) + system/settings/rbp2.xml | 5 +++++ + 1 file changed, 5 insertions(+) -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index ae85484..a4b8a81 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -187,7 +187,7 @@ int CEGLNativeTypeRaspberryPI::FindMatchingResolution(const RESOLUTION_INFO &res - for (int i = 0; i < (int)resolutions.size(); i++) +diff --git a/system/settings/rbp2.xml b/system/settings/rbp2.xml +index b29a428..1c8b116 100644 +--- a/system/settings/rbp2.xml ++++ b/system/settings/rbp2.xml +@@ -28,6 +28,11 @@ + + + ++ ++ ++ 30 ++ ++ + +
+ + +From 175260bab79c330366834bd86512afc2902dba0a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 25 Jun 2015 19:43:10 +0100 +Subject: [PATCH 58/58] [rbp] HW mouse pointer + +Updating the mouse point provokes a complete screen update which can make it feel laggy +and results in high cpu. + +Render the mouse with an overlay to avoid redrawing the normal gui. + +Requires recent firmware. +--- + xbmc/guilib/GUIWindowManager.cpp | 2 + + xbmc/linux/RBP.cpp | 254 +++++++++++++++++++++ + xbmc/linux/RBP.h | 10 + + xbmc/linux/rpi_user_vcsm.h | 460 ++++++++++++++++++++++++++++++++++++++ + xbmc/windowing/WinEventsLinux.cpp | 147 ++++++++++++ + xbmc/windowing/WinEventsLinux.h | 11 + + 6 files changed, 884 insertions(+) + create mode 100644 xbmc/linux/rpi_user_vcsm.h + +diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp +index 17ea269..6965319 100644 +--- a/xbmc/guilib/GUIWindowManager.cpp ++++ b/xbmc/guilib/GUIWindowManager.cpp +@@ -193,7 +193,9 @@ void CGUIWindowManager::CreateWindows() + Add(new CGUIWindowAddonBrowser); + Add(new CGUIWindowScreensaverDim); + Add(new CGUIWindowDebugInfo); ++#ifndef TARGET_RASPBERRY_PI + Add(new CGUIWindowPointer); ++#endif + Add(new CGUIDialogYesNo); + Add(new CGUIDialogProgress); + Add(new CGUIDialogExtendedProgressBar); +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 096ea18..2c8d09b 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -28,6 +28,31 @@ + + #include "cores/omxplayer/OMXImage.h" + ++#include "guilib/GraphicContext.h" ++#include "settings/DisplaySettings.h" ++ ++#include ++#include ++#include "rpi_user_vcsm.h" ++ ++#define MAJOR_NUM 100 ++#define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *) ++#define DEVICE_FILE_NAME "/dev/vcio" ++ ++typedef struct gpu_mem_ptr_s { ++ void *arm; // Pointer to memory mapped on ARM side ++ int vc_handle; // Videocore handle of relocatable memory ++ int vcsm_handle; // Handle for use by VCSM ++ int vc; // Address for use in GPU code ++ int numbytes; // Size of memory block ++ int suballoc; ++} GPU_MEM_PTR_T; ++ ++static int mbox_open(); ++static void mbox_close(int file_desc); ++static void gpu_free_internal(GPU_MEM_PTR_T *p, int mb); ++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb); ++ + CRBP::CRBP() + { + m_initialized = false; +@@ -35,6 +60,9 @@ CRBP::CRBP() + m_DllBcmHost = new DllBcmHost(); + m_OMX = new COMXCore(); + m_display = DISPMANX_NO_HANDLE; ++ m_p = NULL; ++ m_mb = mbox_open(); ++ vcsm_init(); + } + + CRBP::~CRBP() +@@ -115,7 +143,10 @@ void CRBP::LogFirmwareVerison() + DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) + { + if (m_display == DISPMANX_NO_HANDLE) ++ { + m_display = vc_dispmanx_display_open( 0 /*screen*/ ); ++ init_cursor(); ++ } + return m_display; + } + +@@ -124,6 +155,7 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) + assert(display == m_display); + vc_dispmanx_display_close(m_display); + m_display = DISPMANX_NO_HANDLE; ++ uninit_cursor(); + } + + void CRBP::GetDisplaySize(int &width, int &height) +@@ -224,6 +256,15 @@ void CRBP::Deinitialize() + m_omx_image_init = false; + m_initialized = false; + m_omx_initialized = false; ++ uninit_cursor(); ++ if (m_mb && m_p) ++ gpu_free_internal(m_p, m_mb); ++ delete m_p; ++ m_p = NULL; ++ if (m_mb) ++ mbox_close(m_mb); ++ m_mb = 0; ++ vcsm_exit(); + } + + double CRBP::AdjustHDMIClock(double adjust) +@@ -239,4 +280,217 @@ double CRBP::AdjustHDMIClock(double adjust) + } + + ++static int mbox_property(int file_desc, void *buf) ++{ ++ int ret_val = ioctl(file_desc, IOCTL_MBOX_PROPERTY, buf); ++ ++ if (ret_val < 0) { ++ printf("ioctl_set_msg failed:%d\n", ret_val); ++ } ++ return ret_val; ++} ++ ++static int mbox_open() ++{ ++ int file_desc; ++ ++ // open a char device file used for communicating with kernel mbox driver ++ file_desc = open(DEVICE_FILE_NAME, 0); ++ if (file_desc < 0) { ++ printf("Can't open device file: %s (%d)\n", DEVICE_FILE_NAME, file_desc); ++ printf("Try creating a device file with: sudo mknod %s c %d 0\n", DEVICE_FILE_NAME, MAJOR_NUM); ++ } ++ return file_desc; ++} ++ ++static void mbox_close(int file_desc) ++{ ++ close(file_desc); ++} ++ ++static unsigned mem_lock(int file_desc, unsigned handle) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ ++ p[i++] = 0x3000d; // (the tag id) ++ p[i++] = 4; // (size of the buffer) ++ p[i++] = 4; // (size of the data) ++ p[i++] = handle; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++unsigned mem_unlock(int file_desc, unsigned handle) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ ++ p[i++] = 0x3000e; // (the tag id) ++ p[i++] = 4; // (size of the buffer) ++ p[i++] = 4; // (size of the data) ++ p[i++] = handle; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++unsigned int mailbox_set_cursor_info(int file_desc, int width, int height, int format, uint32_t buffer, int hotspotx, int hotspoty) ++{ ++ int i=0; ++ unsigned int p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ p[i++] = 0x00008010; // set cursor state ++ p[i++] = 24; // buffer size ++ p[i++] = 24; // data size ++ ++ p[i++] = width; ++ p[i++] = height; ++ p[i++] = format; ++ p[i++] = buffer; // ptr to VC memory buffer. Doesn't work in 64bit.... ++ p[i++] = hotspotx; ++ p[i++] = hotspoty; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof(*p); // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++ ++} ++ ++unsigned int mailbox_set_cursor_position(int file_desc, int enabled, int x, int y) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ p[i++] = 0x00008011; // set cursor state ++ p[i++] = 12; // buffer size ++ p[i++] = 12; // data size ++ ++ p[i++] = enabled; ++ p[i++] = x; ++ p[i++] = y; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb) ++{ ++ //printf("%s %d\n", __func__, numbytes); ++ ++ p->numbytes = numbytes; ++ p->suballoc = 0; ++ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Mouse pointer"); ++ assert(p->vcsm_handle); ++ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); ++ assert(p->vc_handle); ++ p->arm = vcsm_lock(p->vcsm_handle); ++ assert(p->arm); ++ p->vc = mem_lock(mb, p->vc_handle); ++ assert(p->vc); ++ return 0; ++} ++ ++static void gpu_free_internal(GPU_MEM_PTR_T *p, int mb) ++{ ++ mem_unlock(mb,p->vc_handle); ++ vcsm_unlock_ptr(p->arm); ++ vcsm_free(p->vcsm_handle); ++} ++ ++#define T 0 ++#define W 0xffffffff ++#define B 0xff000000 ++ ++const static uint32_t default_cursor_pixels[] = ++{ ++ B,B,B,B,B,B,B,B,B,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,W,B,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,B,T,T,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, ++ B,W,W,B,W,W,W,B,T,T,T,T,T,T,T,T, ++ B,W,B,T,B,W,W,W,B,T,T,T,T,T,T,T, ++ B,B,T,T,T,B,W,W,W,B,T,T,T,T,T,T, ++ B,T,T,T,T,T,B,W,W,W,B,T,T,T,T,T, ++ T,T,T,T,T,T,T,B,W,W,W,B,T,T,T,T, ++ T,T,T,T,T,T,T,T,B,W,W,W,B,T,T,T, ++ T,T,T,T,T,T,T,T,T,B,W,W,W,B,T,T, ++ T,T,T,T,T,T,T,T,T,T,B,W,W,W,B,T, ++ T,T,T,T,T,T,T,T,T,T,T,B,W,W,W,B, ++ T,T,T,T,T,T,T,T,T,T,T,T,B,W,B,T, ++ T,T,T,T,T,T,T,T,T,T,T,T,T,B,T,T ++}; ++ ++#undef T ++#undef W ++#undef B ++ ++void CRBP::init_cursor() ++{ ++ //printf("%s\n", __func__); ++ if (!m_mb) ++ return; ++ if (!m_p) ++ { ++ m_p = new GPU_MEM_PTR_T; ++ if (m_p) ++ gpu_malloc_uncached_internal(64 * 64 * 4, m_p, m_mb); ++ } ++ if (m_mb && m_p && m_p->arm && m_p->vc) ++ set_cursor(default_cursor_pixels, 16, 16, 0, 0); ++} ++ ++void CRBP::set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y) ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc || !pixels || width * height > 64 * 64) ++ return; ++ //printf("%s %dx%d %p\n", __func__, width, height, pixels); ++ memcpy(m_p->arm, pixels, width * height * 4); ++ unsigned int s = mailbox_set_cursor_info(m_mb, width, height, 0, m_p->vc, hotspot_x, hotspot_y); ++ assert(s == 0); ++} ++ ++void CRBP::update_cursor(int x, int y, bool enabled) ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc) ++ return; ++ ++ RESOLUTION res = g_graphicsContext.GetVideoResolution(); ++ CRect gui(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iWidth, CDisplaySettings::Get().GetResolutionInfo(res).iHeight); ++ CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); ++ ++ int x2 = x * display.Width() / gui.Width(); ++ int y2 = y * display.Height() / gui.Height(); ++ ++ //printf("%s %d,%d (%d)\n", __func__, x, y, enabled); ++ mailbox_set_cursor_position(m_mb, enabled, x2, y2); ++} ++ ++void CRBP::uninit_cursor() ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc) ++ return; ++ //printf("%s\n", __func__); ++ mailbox_set_cursor_position(m_mb, 0, 0, 0); ++} ++ + #endif +diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h +index b422c89..f233a5e 100644 +--- a/xbmc/linux/RBP.h ++++ b/xbmc/linux/RBP.h +@@ -41,6 +41,8 @@ + #include "threads/CriticalSection.h" + #include "threads/Event.h" + ++struct gpu_mem_ptr_s; ++ + class CRBP + { + public: +@@ -81,6 +83,14 @@ class CRBP + CEvent m_vsync; + class DllLibOMXCore; + CCriticalSection m_critSection; ++ ++ struct gpu_mem_ptr_s *m_p; ++ int m_mb; ++public: ++ void init_cursor(); ++ void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); ++ void update_cursor(int x, int y, bool enabled); ++ void uninit_cursor(); + }; + + extern CRBP g_RBP; +diff --git a/xbmc/linux/rpi_user_vcsm.h b/xbmc/linux/rpi_user_vcsm.h +new file mode 100644 +index 0000000..94e6e79 +--- /dev/null ++++ b/xbmc/linux/rpi_user_vcsm.h +@@ -0,0 +1,460 @@ ++/***************************************************************************** ++* Copyright 2001 - 2011 Broadcom Corporation. All rights reserved. ++* ++* This program is the proprietary software of Broadcom Corporation and/or ++* its licensors, and may only be used, duplicated, modified or distributed ++* pursuant to the terms and conditions of a separate, written license ++* agreement executed between you and Broadcom (an "Authorized License"). ++* Except as set forth in an Authorized License, Broadcom grants no license ++* (express or implied), right to use, or waiver of any kind with respect to ++* the Software, and Broadcom expressly reserves all rights in and to the ++* Software and all intellectual property rights therein. IF YOU HAVE NO ++* AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY ++* WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE ALL USE OF ++* THE SOFTWARE. ++* ++* Except as expressly set forth in the Authorized License, ++* 1. This program, including its structure, sequence and organization, ++* constitutes the valuable trade secrets of Broadcom, and you shall use ++* all reasonable efforts to protect the confidentiality thereof, and to ++* use this information only in connection with your use of Broadcom ++* integrated circuit products. ++* 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" ++* AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR ++* WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH ++* RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL ++* IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS ++* FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, ++* QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. YOU ++* ASSUME THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE. ++* 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS ++* LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, ++* OR EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO ++* YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ++* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS ++* OF THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER ++* IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ++* ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. ++*****************************************************************************/ ++ ++#ifndef __USER_VCSM__H__INCLUDED__ ++#define __USER_VCSM__H__INCLUDED__ ++ ++/* VideoCore Shared Memory - user interface library. ++** ++** This library provides all the necessary abstraction for any application to ++** make use of the shared memory service which is distributed accross a kernel ++** driver and a videocore service. ++** ++** It is an application design decision to choose or not to use this service. ++** ++** The logical flow of operations that a user application needs to follow when ++** using this service is: ++** ++** 1) Initialize the service. ++** 2) Allocate shared memory blocks. ++** 3) Start using the allocated blocks. ++** - In order to gain ownership on a block, lock the allocated block, ++** locking a block returns a valid address that the user application ++** can access. ++** - When finished with using the block for the current execution cycle ++** or function, and so when giving up the ownership, unlock the block. ++** 4) A block can be locked/unlocked as many times required - within or outside ++** of - a specific execution context. ++** 5) To completely release an allocated block, free it. ++** 6) If the service is no longer required, terminate it. ++** ++** ++** Some generic considerations: ++ ++** Allocating memory blocks. ++** ++** Memory blocks can be allocated in different manners depending on the cache ++** behavior desired. A given block can either be: ++ ++** - Allocated in a non cached fashion all the way through host and videocore. ++** - Allocated in a cached fashion on host OR videocore. ++** - Allocated in a cached fashion on host AND videocore. ++** ++** It is an application decision to determine how to allocate a block. Evidently ++** if the application will be doing substantial read/write accesses to a given block, ++** it is recommended to allocate the block at least in a 'host cached' fashion for ++** better results. ++** ++** ++** Locking memory blocks. ++** ++** When the memory block has been allocated in a host cached fashion, locking the ++** memory block (and so taking ownership of it) will trigger a cache invalidation. ++** ++** For the above reason and when using host cached allocation, it is important that ++** an application properly implements the lock/unlock mechanism to ensure cache will ++** stay coherent, otherwise there is no guarantee it will at all be. ++** ++** It is possible to dynamically change the host cache behavior (ie cached or non ++** cached) of a given allocation without needing to free and re-allocate the block. ++** This feature can be useful for such application which requires access to the block ++** only at certain times and not otherwise. By changing the cache behavior dynamically ++** the application can optimize performances for a given duration of use. ++** Such dynamic cache behavior remapping only applies to host cache and not videocore ++** cache. If one requires to change the videocore cache behavior, then a new block ++** must be created to replace the old one. ++** ++** On successful locking, a valid pointer is returned that the application can use ++** to access to data inside the block. There is no guarantee that the pointer will ++** stay valid following the unlock action corresponding to this lock. ++** ++** ++** Unocking memory blocks. ++** ++** When the memory block has been allocated in a host cached fashion, unlocking the ++** memory block (and so forgiving its ownership) will trigger a cache flush unless ++** explicitely asked not to flush the cache for performances reasons. ++** ++** For the above reason and when using host cached allocation, it is important that ++** an application properly implements the lock/unlock mechanism to ensure cache will ++** stay coherent, otherwise there is no guarantee it will at all be. ++** ++** ++** A complete API is defined below. ++*/ ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/* Different status that can be dumped. ++*/ ++typedef enum ++{ ++ VCSM_STATUS_VC_WALK_ALLOC = 0, // Walks *all* the allocation on videocore. ++ // Result of the walk is seen in the videocore ++ // log. ++ VCSM_STATUS_HOST_WALK_MAP, // Walks the *full* mapping allocation on host ++ // driver (ie for all processes). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_HOST_WALK_PID_MAP, // Walks the per process mapping allocation on host ++ // driver (for current process). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_HOST_WALK_PID_ALLOC, // Walks the per process host allocation on host ++ // driver (for current process). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_VC_MAP_ALL, // Equivalent to both VCSM_STATUS_VC_WALK_ALLOC and ++ // VCSM_STATUS_HOST_WALK_MAP. ++ // ++ VCSM_STATUS_NONE, // Must be last - invalid. ++ ++} VCSM_STATUS_T; ++ ++/* Different kind of cache behavior. ++*/ ++typedef enum ++{ ++ VCSM_CACHE_TYPE_NONE = 0, // No caching applies. ++ VCSM_CACHE_TYPE_HOST, // Allocation is cached on host (user space). ++ VCSM_CACHE_TYPE_VC, // Allocation is cached on videocore. ++ VCSM_CACHE_TYPE_HOST_AND_VC, // Allocation is cached on both host and videocore. ++ ++} VCSM_CACHE_TYPE_T; ++ ++/* Initialize the vcsm processing. ++** ++** Must be called once before attempting to do anything else. ++** ++** Returns 0 on success, -1 on error. ++*/ ++int vcsm_init( void ); ++ ++ ++/* Terminates the vcsm processing. ++** ++** Must be called vcsm services are no longer needed, it will ++** take care of removing any allocation under the current process ++** control if deemed necessary. ++*/ ++void vcsm_exit( void ); ++ ++ ++/* Queries the status of the the vcsm. ++** ++** Triggers dump of various kind of information, see the ++** different variants specified in VCSM_STATUS_T. ++** ++** Pid is optional. ++*/ ++void vcsm_status( VCSM_STATUS_T status, int pid ); ++ ++ ++/* Allocates a non-cached block of memory of size 'size' via the vcsm memory ++** allocator. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc( unsigned int size, char *name ); ++ ++ ++/* Allocates a cached block of memory of size 'size' via the vcsm memory ++** allocator, the type of caching requested is passed as argument of the ++** function call. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc_cache( unsigned int size, VCSM_CACHE_TYPE_T cache, char *name ); ++ ++ ++/* Shares an allocated block of memory via the vcsm memory allocator. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc_share( unsigned int handle ); ++ ++ ++/* Resizes a block of memory allocated previously by vcsm_alloc. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** The handle must be unlocked by user prior to attempting any ++** resize action. ++** ++** On error, the original size allocated against the handle ++** remains available the same way it would be following a ++** successful vcsm_malloc. ++*/ ++int vcsm_resize( unsigned int handle, unsigned int new_size ); ++ ++ ++/* Frees a block of memory that was successfully allocated by ++** a prior call the vcms_alloc. ++** ++** The handle should be considered invalid upon return from this ++** call. ++** ++** Whether any memory is actually freed up or not as the result of ++** this call will depends on many factors, if all goes well it will ++** be freed. If something goes wrong, the memory will likely end up ++** being freed up as part of the vcsm_exit process. In the end the ++** memory is guaranteed to be freed one way or another. ++*/ ++void vcsm_free( unsigned int handle ); ++ ++ ++/* Retrieves a videocore opaque handle from a mapped user address ++** pointer. The videocore handle will correspond to the actual ++** memory mapped in videocore. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** Note: the videocore opaque handle is distinct from the user ++** opaque handle (allocated via vcsm_malloc) and it is only ++** significant for such application which knows what to do ++** with it, for the others it is just a number with little ++** use since nothing can be done with it (in particular ++** for safety reason it cannot be used to map anything). ++*/ ++unsigned int vcsm_vc_hdl_from_ptr( void *usr_ptr ); ++ ++ ++/* Retrieves a videocore opaque handle from a opaque handle ++** pointer. The videocore handle will correspond to the actual ++** memory mapped in videocore. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** Note: the videocore opaque handle is distinct from the user ++** opaque handle (allocated via vcsm_malloc) and it is only ++** significant for such application which knows what to do ++** with it, for the others it is just a number with little ++** use since nothing can be done with it (in particular ++** for safety reason it cannot be used to map anything). ++*/ ++unsigned int vcsm_vc_hdl_from_hdl( unsigned int handle ); ++ ++ ++/* Retrieves a user opaque handle from a mapped user address ++** pointer. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++*/ ++unsigned int vcsm_usr_handle( void *usr_ptr ); ++ ++ ++/* Retrieves a mapped user address from an opaque user ++** handle. ++** ++** Returns: 0 on error ++** a non-zero address on success. ++** ++** On success, the address corresponds to the pointer ++** which can access the data allocated via the vcsm_malloc ++** call. ++*/ ++void *vcsm_usr_address( unsigned int handle ); ++ ++ ++/* Locks the memory associated with this opaque handle. ++** ++** Returns: NULL on error ++** a valid pointer on success. ++** ++** A user MUST lock the handle received from vcsm_malloc ++** in order to be able to use the memory associated with it. ++** ++** On success, the pointer returned is only valid within ++** the lock content (ie until a corresponding vcsm_unlock_xx ++** is invoked). ++*/ ++void *vcsm_lock( unsigned int handle ); ++ ++ ++/* Locks the memory associated with this opaque handle. The lock ++** also gives a chance to update the *host* cache behavior of the ++** allocated buffer if so desired. The *videocore* cache behavior ++** of the allocated buffer cannot be changed by this call and such ++** attempt will be ignored. ++** ++** The system will attempt to honour the cache_update mode request, ++** the cache_result mode will provide the final answer on which cache ++** mode is really in use. Failing to change the cache mode will not ++** result in a failure to lock the buffer as it is an application ++** decision to choose what to do if (cache_result != cache_update) ++** ++** The value returned in cache_result can only be considered valid if ++** the returned pointer is non NULL. The cache_result pointer may be ++** NULL if the application does not care about the actual outcome of ++** its action with regards to the cache behavior change. ++** ++** Returns: NULL on error ++** a valid pointer on success. ++** ++** A user MUST lock the handle received from vcsm_malloc ++** in order to be able to use the memory associated with it. ++** ++** On success, the pointer returned is only valid within ++** the lock content (ie until a corresponding vcsm_unlock_xx ++** is invoked). ++*/ ++void *vcsm_lock_cache( unsigned int handle, ++ VCSM_CACHE_TYPE_T cache_update, ++ VCSM_CACHE_TYPE_T *cache_result ); ++ ++ ++/* Unlocks the memory associated with this user mapped address. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking a mapped address, the user should no longer ++** attempt to reference it. ++*/ ++int vcsm_unlock_ptr( void *usr_ptr ); ++ ++ ++/* Unlocks the memory associated with this user mapped address. ++** Apply special processing that would override the otherwise ++** default behavior. ++** ++** If 'cache_no_flush' is specified: ++** Do not flush cache as the result of the unlock (if cache ++** flush was otherwise applicable in this case). ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking a mapped address, the user should no longer ++** attempt to reference it. ++*/ ++int vcsm_unlock_ptr_sp( void *usr_ptr, int cache_no_flush ); ++ ++ ++/* Unlocks the memory associated with this user opaque handle. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking an opaque handle, the user should no longer ++** attempt to reference the mapped addressed once associated ++** with it. ++*/ ++int vcsm_unlock_hdl( unsigned int handle ); ++ ++ ++/* Unlocks the memory associated with this user opaque handle. ++** Apply special processing that would override the otherwise ++** default behavior. ++** ++** If 'cache_no_flush' is specified: ++** Do not flush cache as the result of the unlock (if cache ++** flush was otherwise applicable in this case). ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking an opaque handle, the user should no longer ++** attempt to reference the mapped addressed once associated ++** with it. ++*/ ++int vcsm_unlock_hdl_sp( unsigned int handle, int cache_no_flush ); ++ ++/* Clean and/or invalidate the memory associated with this user opaque handle ++** ++** Returns: non-zero on error ++** ++** structure contains a list of flush/invalidate commands. Commands are: ++** 0: nop ++** 1: invalidate given virtual range in L1/L2 ++** 2: clean given virtual range in L1/L2 ++** 3: clean+invalidate given virtual range in L1/L2 ++** 4: flush all L1/L2 ++*/ ++struct vcsm_user_clean_invalid_s { ++ struct { ++ unsigned int cmd; ++ unsigned int handle; ++ unsigned int addr; ++ unsigned int size; ++ } s[8]; ++}; ++ ++int vcsm_clean_invalid( struct vcsm_user_clean_invalid_s *s ); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* __USER_VCSM__H__INCLUDED__ */ ++ +diff --git a/xbmc/windowing/WinEventsLinux.cpp b/xbmc/windowing/WinEventsLinux.cpp +index 6f97e9e..bde7649 100644 +--- a/xbmc/windowing/WinEventsLinux.cpp ++++ b/xbmc/windowing/WinEventsLinux.cpp +@@ -30,11 +30,31 @@ + #include "utils/log.h" + #include "powermanagement/PowerManager.h" + ++#ifdef TARGET_RASPBERRY_PI ++#include "utils/TimeUtils.h" ++#include "guilib/Resolution.h" ++#include "addons/Skin.h" ++#include "utils/XMLUtils.h" ++#include "utils/StringUtils.h" ++#include "filesystem/File.h" ++#include "guilib/iimage.h" ++#include "guilib/XBTF.h" ++#include "guilib/imagefactory.h" ++#include "guilib/TextureManager.h" ++#include "linux/RBP.h" ++#include "input/InputManager.h" ++#endif ++ + bool CWinEventsLinux::m_initialized = false; + CLinuxInputDevices CWinEventsLinux::m_devices; + + CWinEventsLinux::CWinEventsLinux() + { ++#ifdef TARGET_RASPBERRY_PI ++ m_last_mouse_move_time = 0; ++ m_mouse_state = -1; ++ memset(m_cursors, 0, sizeof m_cursors); ++#endif + } + + void CWinEventsLinux::RefreshDevices() +@@ -48,19 +68,142 @@ bool CWinEventsLinux::IsRemoteLowBattery() + return false; + } + ++#ifdef TARGET_RASPBERRY_PI ++void *CWinEventsLinux::LoadImage(const std::string texturePath, int &width, int &height) ++{ ++ void *pixels = NULL; ++ // Read image into memory to use our vfs ++ XFILE::CFile file; ++ XFILE::auto_buffer buf; ++ ++ if (file.LoadFile(texturePath, buf) <= 0) ++ return NULL; ++ ++ IImage *pImage = ImageFactory::CreateLoader(texturePath); ++ if (pImage != NULL && pImage->LoadImageFromMemory((unsigned char *)buf.get(), buf.size(), width, height)) ++ { ++ width = pImage->Width(); ++ height = pImage->Height(); ++ if (width > 0 && height > 0) ++ { ++ pixels = malloc(width * height * 4); ++ if (!pixels) ++ return NULL; ++ if (!pImage->Decode((unsigned char *)pixels, width * 4, XB_FMT_A8R8G8B8)) ++ { ++ free(pixels); ++ return NULL; ++ } ++ } ++ } ++ return pixels; ++} ++ ++bool CWinEventsLinux::LoadXML(const std::string strFileName) ++{ ++ RESOLUTION_INFO m_coordsRes; // resolution that the window coordinates are in. ++ // Find appropriate skin folder + resolution to load from ++ std::string strFileNameLower = strFileName; ++ StringUtils::ToLower(strFileNameLower); ++ std::string strLowerPath = g_SkinInfo->GetSkinPath(strFileNameLower, &m_coordsRes); ++ std::string strPath = g_SkinInfo->GetSkinPath(strFileName, &m_coordsRes); ++ ++ TiXmlElement* pRootElement = NULL; ++ CXBMCTinyXML xmlDoc; ++ std::string strPathLower = strPath; ++ StringUtils::ToLower(strPathLower); ++ if (!xmlDoc.LoadFile(strPath) && !xmlDoc.LoadFile(strPathLower) && !xmlDoc.LoadFile(strLowerPath)) ++ { ++ CLog::Log(LOGERROR, "unable to load:%s, Line %d\n%s", strPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc()); ++ return false; ++ } ++ pRootElement = (TiXmlElement*)xmlDoc.RootElement()->Clone(); ++ //printf("%s: load:%s,%s,%s\n", __func__, strPath.c_str(), strPathLower.c_str(), strLowerPath.c_str()); ++ ++ if (!pRootElement) ++ return false; ++ ++ if (strcmpi(pRootElement->Value(), "window")) ++ { ++ CLog::Log(LOGERROR, "file : XML file doesnt contain "); ++ return false; ++ } ++ ++ TiXmlElement *pChild = pRootElement->FirstChildElement(); ++ while (pChild) ++ { ++ if (strcmpi(pChild->Value(), "controls") == 0) ++ { ++ TiXmlElement *pControl = pChild->FirstChildElement(); ++ while (pControl) ++ { ++ //printf("%s:2 %s\n", __func__, pControl->Value()); ++ if (strcmpi(pControl->Value(), "control") == 0) ++ { ++ std::string strStringValue; ++ if (XMLUtils::GetString(pControl, "texture", strStringValue)) ++ { ++ const char* idAttr = pControl->Attribute("id"); ++ int index = idAttr ? atoi(idAttr)-1 : -1; ++ if (index >= 0 && index < (int)(sizeof m_cursors/sizeof *m_cursors)) ++ { ++ if (m_cursors[index].pixels) ++ free(m_cursors[index].pixels); ++ std::string path = g_TextureManager.GetTexturePath(strStringValue); ++ m_cursors[index].width = m_cursors[index].height = 64; // max ++ m_cursors[index].pixels = LoadImage(path, m_cursors[index].width, m_cursors[index].height); ++ //printf("%s: texture: %d %s %dx%d %p\n", __func__, index, path.c_str(), m_cursors[index].width, m_cursors[index].height, m_cursors[index].pixels); ++ } ++ } ++ } ++ pControl = pControl->NextSiblingElement(); ++ } ++ } ++ pChild = pChild->NextSiblingElement(); ++ } ++ delete pRootElement; ++ return true; ++} ++#endif ++ + bool CWinEventsLinux::MessagePump() + { + if (!m_initialized) { - if(resolutions[i].iScreenWidth == res.iScreenWidth && resolutions[i].iScreenHeight == res.iScreenHeight && resolutions[i].fRefreshRate == res.fRefreshRate && -- (resolutions[i].dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) == (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) -+ (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) - { - return i; - } -@@ -203,8 +203,7 @@ int CEGLNativeTypeRaspberryPI::AddUniqueResolution(RESOLUTION_INFO &res, std::ve - int i = FindMatchingResolution(res, resolutions); - if (i>=0) - { // don't replace a progressive resolution with an interlaced one of same resolution -- if (!(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) -- resolutions[i] = res; -+ resolutions[i] = res; + m_devices.InitAvailable(); + m_initialized = true; ++#ifdef TARGET_RASPBERRY_PI ++ LoadXML("Pointer.xml"); ++#endif } - else + + bool ret = false; + XBMC_Event event = {0}; ++#ifdef TARGET_RASPBERRY_PI ++ int64_t Now = CurrentHostCounter(); ++ int state = CInputManager::Get().GetMouseState() - 1; ++ if (m_mouse_state != state) ++ { ++ //printf("%s: %d->%d\n", __func__, m_mouse_state, state); ++ if (state >= 0 && state < (int)(sizeof m_cursors/sizeof *m_cursors) && m_cursors[state].pixels) ++ { ++ g_RBP.set_cursor(m_cursors[state].pixels, m_cursors[state].width, m_cursors[state].height, 0, 0); ++ } ++ m_mouse_state = state; ++ } ++#endif + while (1) { -@@ -516,7 +515,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - vc_tv_hdmi_get_property(&property); - m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; - } -- else // sdtv -+ else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv + event = m_devices.ReadEvent(); ++#ifdef TARGET_RASPBERRY_PI ++ if (event.type == XBMC_MOUSEMOTION || event.type == XBMC_MOUSEBUTTONDOWN || event.type == XBMC_MOUSEBUTTONUP) ++ { ++ if (event.type == XBMC_MOUSEMOTION) ++ g_RBP.update_cursor(event.motion.x, event.motion.y, 1); ++ m_last_mouse_move_time = Now; ++ //printf("%s: %d,%d %d %d,%d (%d,%d)\n", __func__, event.motion.type, event.motion.which, event.motion.state, event.motion.x, event.motion.y, event.motion.xrel, event.motion.yrel); ++ } ++#endif + if (event.type != XBMC_NOEVENT) { - m_desktopRes.iScreen = 0; - m_desktopRes.bFullScreen = true; -@@ -541,7 +540,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); - GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); + ret |= g_application.OnEvent(event); +@@ -71,6 +214,10 @@ bool CWinEventsLinux::MessagePump() + } + } -- if(resolutions.size() == 0) - { - AddUniqueResolution(m_desktopRes, resolutions); - CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); -@@ -636,6 +634,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); - res.iSubtitles = (int)(0.965 * res.iHeight); ++#ifdef TARGET_RASPBERRY_PI ++ if (Now - m_last_mouse_move_time > 5 * 1000000000LL) ++ g_RBP.update_cursor(0, 0, 0); ++#endif + return ret; + } -+ if (!m_desktopRes.dwFlags && prefer_group == group && prefer_mode == tv->code) -+ m_desktopRes = res; -+ -+ if (res.dwFlags & D3DPRESENTFLAG_INTERLACED) -+ continue; -+ - AddUniqueResolution(res, resolutions); - CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, - tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); +diff --git a/xbmc/windowing/WinEventsLinux.h b/xbmc/windowing/WinEventsLinux.h +index f6c8df0..5c2b583 100644 +--- a/xbmc/windowing/WinEventsLinux.h ++++ b/xbmc/windowing/WinEventsLinux.h +@@ -42,6 +42,17 @@ class CWinEventsLinux : public IWinEvents + private: + static bool m_initialized; + static CLinuxInputDevices m_devices; ++#ifdef TARGET_RASPBERRY_PI ++ bool LoadXML(const std::string strFileName); ++ void *LoadImage(const std::string texturePath, int &width, int &height); ++ int64_t m_last_mouse_move_time; ++ struct ++ { ++ void *pixels; ++ int width, height; ++ } m_cursors[4]; ++ int m_mouse_state; ++#endif + }; + + #endif diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index a35c13d26b..9da370c113 100644 --- a/projects/RPi/patches/linux/linux-01-RPi_support.patch +++ b/projects/RPi/patches/linux/linux-01-RPi_support.patch @@ -1,7 +1,7 @@ -From e9ee97a62574359de01411f0c74e23856e359952 Mon Sep 17 00:00:00 2001 +From f12410478cffff991f5e3c3d3fd68bab0bd33c2c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 01/85] Main bcm2708/bcm2709 linux port +Subject: [PATCH 001/105] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -7002,10 +7002,10 @@ index b5bedae..b0258e8 100644 mmc_pm_flag_t pm_caps; /* supported pm features */ -From 081ebd4ba394a354c03f7800b8d14519f165a0f9 Mon Sep 17 00:00:00 2001 +From e3d3c97f9f253df42f218071e9f9bb7fd8f602f0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 23:48:09 +0100 -Subject: [PATCH 02/85] power: Add power driver +Subject: [PATCH 002/105] power: Add power driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -7362,10 +7362,10 @@ index 0000000..bf22b26 + +#endif -From ddd21104179e4df6cf77762b1a7f4dabe65cc808 Mon Sep 17 00:00:00 2001 +From 6f7a17a848b57ac66f13d9ee9f09f4be89e74824 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Oct 2014 18:50:05 +0100 -Subject: [PATCH 03/85] Add bcm2708_gpio driver +Subject: [PATCH 003/105] Add bcm2708_gpio driver Signed-off-by: popcornmix @@ -7995,10 +7995,10 @@ index 0000000..fb69624 + +#endif -From 8957f79b301a70ab625baa2f9a4c613f871c3f22 Mon Sep 17 00:00:00 2001 +From e1fa284edd01b1a623096845dbe54c8d936aaaaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 1 May 2015 19:11:03 +0200 -Subject: [PATCH 04/85] mailbox: bcm2708: Add bcm2708-vcio +Subject: [PATCH 004/105] mailbox: bcm2708: Add bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -8629,10 +8629,10 @@ index 0000000..cc284ed + +#endif -From c1a8c5708161961f248f228d25da578e90fe127f Mon Sep 17 00:00:00 2001 +From 495cfff15f23f9b3ee26b0b92673ad77fc3e8d22 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 05/85] Add dwc_otg driver +Subject: [PATCH 005/105] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -69906,10 +69906,10 @@ index 0000000..cdc9963 +test_main(); +0; -From 2aced0ae5562b3dc60806a3ba2799af134732bdb Mon Sep 17 00:00:00 2001 +From 2fee602715f8de08540132094fe160dd21978680 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 06/85] bcm2708 watchdog driver +Subject: [PATCH 006/105] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -70346,10 +70346,10 @@ index 0000000..8a27d68 +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); -From 4a64377d42fac96be299fd210b0eb0bc3ba159b2 Mon Sep 17 00:00:00 2001 +From 164b737c320aca85798130a904c964f748423937 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 07/85] bcm2708 framebuffer driver +Subject: [PATCH 007/105] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73788,10 +73788,10 @@ index 3c14e43..7626beb6a 100644 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 -From b04b39dfe4cb2a287062d3b81287d9a9bf80e91a Mon Sep 17 00:00:00 2001 +From b1c418d504c5c7b800fee387abf9a03af0e1b4a4 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 08/85] dmaengine: Add support for BCM2708 +Subject: [PATCH 008/105] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75559,10 +75559,10 @@ index 0000000..2310e34 + +#endif /* _PLAT_BCM2708_DMA_H */ -From 34e4aa2e25b49261e2aa9d17a1ce767a3dfb90cf Mon Sep 17 00:00:00 2001 +From 8500a8de635dc4ce251330dfe0950453689d7a65 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 09/85] MMC: added alternative MMC driver +Subject: [PATCH 009/105] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -77378,11 +77378,11 @@ index 0000000..b7c4883 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From f1a7eefd17fbaf9335a5fdf6215d319b4042bb55 Mon Sep 17 00:00:00 2001 +From 6a1f159f160fec9d7b8f10cc0b37c79c58be80c8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 10/85] Adding bcm2835-sdhost driver, and an overlay to enable - it +Subject: [PATCH 010/105] Adding bcm2835-sdhost driver, and an overlay to + enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -79151,10 +79151,10 @@ index 0000000..eef8a24 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From effb9e4dd94cc200500fb22061ede69047cceea7 Mon Sep 17 00:00:00 2001 +From 8f5a0afb8bc65e48695b38a33dba8a17bb0c4218 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 11/85] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 011/105] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix @@ -80479,10 +80479,10 @@ index 0000000..5325832 + +#endif /* VC_CMA_H */ -From d83761e1a337d8eee9e9a196e23ceeefe51fff1e Mon Sep 17 00:00:00 2001 +From 8af8b7d264e546ee29b28acca735bd4ce8dbdb71 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 12/85] bcm2708: alsa sound driver +Subject: [PATCH 012/105] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -83324,10 +83324,10 @@ index 0000000..af3e6eb + +#endif // _VC_AUDIO_DEFS_H_ -From 53e9a31fe01ae9460b2361ec93a54bac888d8f5f Mon Sep 17 00:00:00 2001 +From d01fbc5cd5784094ffe247f269eaa1b31bb023d5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 13/85] bcm2708 vchiq driver +Subject: [PATCH 013/105] bcm2708 vchiq driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -96581,10 +96581,10 @@ index 0000000..b6bfa21 + return vchiq_build_time; +} -From 3f8c3cd61c11d730699b14ee1d64db95215487e8 Mon Sep 17 00:00:00 2001 +From efc783d883c14618d52d0d804a856ee31a152fcb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 14/85] vc_mem: Add vc_mem driver +Subject: [PATCH 014/105] vc_mem: Add vc_mem driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -97590,10 +97590,10 @@ index 0000000..20a4753 + +#endif /* _VC_MEM_H */ -From 138483d8fb3cbfcad83b0c450e3c3eb2fca5a8de Mon Sep 17 00:00:00 2001 +From 72c49d81f0dd002228b6cb26db9e5428eef39d41 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 15/85] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 015/105] vcsm: VideoCore shared memory service for BCM2835 Add experimental support for the VideoCore shared memory service. This allows user processes to allocate memory from VideoCore's @@ -102003,10 +102003,10 @@ index 0000000..0bfb42e +MODULE_DESCRIPTION("VideoCore SharedMemory Driver"); +MODULE_LICENSE("GPL v2"); -From 3b4d6cc19851307c0426fe31be9627558bb1b2cf Mon Sep 17 00:00:00 2001 +From 6b13df3a424914c3db0687d471236611c0cd6d60 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 16/85] Add hwrng (hardware random number generator) driver +Subject: [PATCH 016/105] Add hwrng (hardware random number generator) driver --- drivers/char/hw_random/Kconfig | 13 +++- @@ -102183,10 +102183,10 @@ index 0000000..340f004 +MODULE_DESCRIPTION("BCM2708 H/W Random Number Generator (RNG) driver"); +MODULE_LICENSE("GPL and additional rights"); -From 8312a7efc6b5c8fe996e41f62adf6e9c71f7a5f8 Mon Sep 17 00:00:00 2001 +From 71858ccb0a96e022238c9644177fcbf891807ffd Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 17/85] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 017/105] lirc: added support for RaspberryPi GPIO lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others See: https://github.com/raspberrypi/linux/issues/525 @@ -103039,10 +103039,10 @@ index 0000000..24563ec +module_param(debug, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(debug, "Enable debugging messages"); -From 4905ceea875bf96a9dbf4989347ed1d5e4e3875b Mon Sep 17 00:00:00 2001 +From 36fe69547259b45803b0cb11085d60374c92446a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 18/85] Add cpufreq driver +Subject: [PATCH 018/105] Add cpufreq driver Signed-off-by: popcornmix --- @@ -103315,10 +103315,10 @@ index 0000000..6735da9 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From 50ef992dbbc2e7e1c1a87a61b540c0b84f7cb3ee Mon Sep 17 00:00:00 2001 +From 50d7170ec5cf300e239ab575de3e0917ec44b8a6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 19/85] Added hwmon/thermal driver for reporting core +Subject: [PATCH 019/105] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -103615,10 +103615,10 @@ index 0000000..3bc80f1 + +module_platform_driver(bcm2835_thermal_driver); -From 0e6c5417c62642c7481e57ce937007277fe31cfd Mon Sep 17 00:00:00 2001 +From 4011c7c5c3c5a03af182dbed2e824a491d12e96c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:41:33 +0100 -Subject: [PATCH 20/85] Add Chris Boot's spi driver. +Subject: [PATCH 020/105] Add Chris Boot's spi driver. spi: bcm2708: add device tree support @@ -104530,10 +104530,10 @@ index 0000000..041b5e2 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 68bec2f411f5f7ea1720f555cadc7a5c6c214934 Mon Sep 17 00:00:00 2001 +From 04e6956b7d15554967ca2620563efc31a63cd69e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 21/85] Add Chris Boot's i2c driver +Subject: [PATCH 021/105] Add Chris Boot's i2c driver i2c-bcm2708: fixed baudrate @@ -105334,10 +105334,10 @@ index 0000000..8773203 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From f039d3ed041c0fd3267b149ef476638142535ef3 Mon Sep 17 00:00:00 2001 +From 9ed8236717339aab28673519a2300e6f0165d2da Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 22/85] bcm2835: add v4l2 camera device +Subject: [PATCH 022/105] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -112664,10 +112664,10 @@ index 0000000..9d1d11e + +#endif /* MMAL_VCHIQ_H */ -From 35af37046308a29d529e83d908c1fea9cd01a8a2 Mon Sep 17 00:00:00 2001 +From 8daf7f4a4f40fd1d6008fa8438d72ae3c9f2cd4f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Jan 2015 14:48:55 +0000 -Subject: [PATCH 23/85] scripts/dtc: Update to upstream version with overlay +Subject: [PATCH 023/105] scripts/dtc: Update to upstream version with overlay patches --- @@ -117880,10 +117880,10 @@ index 54d4e904..d644002 100644 -#define DTC_VERSION "DTC 1.4.0-dirty" +#define DTC_VERSION "DTC 1.4.1-g36c70742" -From 7b42e6d4640654b00e46f0b14a2f4d4f9979610e Mon Sep 17 00:00:00 2001 +From 0d794d8e6cccfbefeb6320acf871913dcd94d2ff Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 24/85] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 024/105] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -118368,10 +118368,10 @@ index 0000000..3dff948 + return (($val eq 'y') || ($val eq '1')); +} -From 23bd48a5f3cae21a2074ef421a675dfba54866de Mon Sep 17 00:00:00 2001 +From 79ae5c40586808d01368549b13b3c7a4709c9564 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 25/85] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH 025/105] fdt: Add support for the CONFIG_CMDLINE_EXTEND option --- drivers/of/fdt.c | 29 ++++++++++++++++++++++++----- @@ -118426,10 +118426,10 @@ index cde35c5d01..dd7fbfe 100644 pr_debug("Command line is: %s\n", (char*)data); -From 4c4001e3bc03206e4d87273ac410a719c7a128b4 Mon Sep 17 00:00:00 2001 +From 01a18bea60e6b60a6fcb0a58faaf34f1b5cc0281 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 26/85] BCM2708: Add core Device Tree support +Subject: [PATCH 026/105] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. @@ -122306,10 +122306,10 @@ index 0000000..66a98f6 + }; +}; -From 5cbd38e967d11494dbf7d401bfcce0240a176f1f Mon Sep 17 00:00:00 2001 +From 7c5cfbcdfa96680f63b0e82202ab509ef78bc023 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 27/85] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 027/105] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -122402,10 +122402,10 @@ index fb795c3..fa72af0 100644 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ -From 9907bcbcbae0e355d82cbc29e4f9667fb6fadfac Mon Sep 17 00:00:00 2001 +From b16b65cdb4064e32b321e4d3801bc1990ee258f7 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 30/85] Speed up console framebuffer imageblit function +Subject: [PATCH 030/105] Speed up console framebuffer imageblit function Especially on platforms with a slower CPU but a relatively high framebuffer fill bandwidth, like current ARM devices, the existing @@ -122614,10 +122614,10 @@ index a2bb276..436494f 100644 start_index, pitch_index); } else -From c50184c27d8c47aa92288d11c79ccbc193f91a74 Mon Sep 17 00:00:00 2001 +From bda0a510175903069a6e36ee03df8bb58da535fc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 31/85] Allow mac address to be set in smsc95xx +Subject: [PATCH 031/105] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -122708,10 +122708,10 @@ index 26423ad..e29a323 100644 if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -From b579f8fd561c7347d6354d3f7fc6880ac6b49e7f Mon Sep 17 00:00:00 2001 +From cc2b2db4dd1eea70daf6a7b2122bc2cc4fff16b5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 32/85] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 032/105] enabling the realtime clock 1-wire chip DS1307 and 1-wire on GPIO4 (as a module) 1-wire: Add support for configuring pin for w1-gpio kernel module @@ -123109,11 +123109,11 @@ index d58594a..feae942 100644 unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 8828223a011c97121c5824e4a9056ebfdb178612 Mon Sep 17 00:00:00 2001 +From f0f58bbd87e81fe4ff162b11faedbacc6b0c8f38 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 34/85] config: Enable CONFIG_MEMCG, but leave it disabled (due - to memory cost). Enable with cgroup_enable=memory. +Subject: [PATCH 034/105] config: Enable CONFIG_MEMCG, but leave it disabled + (due to memory cost). Enable with cgroup_enable=memory. --- kernel/cgroup.c | 23 +++++++++++++++++++++++ @@ -123167,10 +123167,10 @@ index a04225d..a2ef8af 100644 /** -From 9028029fe919c229779c848fd2a645bf02d2d959 Mon Sep 17 00:00:00 2001 +From c475efe6fd77dc1288117ba41451f11c7e46c74c Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 35/85] ASoC: Add support for BCM2708 +Subject: [PATCH 035/105] ASoC: Add support for BCM2708 This driver adds support for digital audio (I2S) for the BCM2708 SoC that is used by the @@ -124313,10 +124313,10 @@ index 0000000..6fdcbc1 + +#endif -From 2cd4bdd8e03b8a9ce11d39741d5670d10b58f13e Mon Sep 17 00:00:00 2001 +From ea9da38e0ab7aae107b1b2cb86f9e6728c54f72d Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 36/85] ASoC: Add support for PCM5102A codec +Subject: [PATCH 036/105] ASoC: Add support for PCM5102A codec Some definitions to support the PCM5102A codec by Texas Instruments. @@ -124441,10 +124441,10 @@ index 0000000..126f1e9 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 214e3f42b42cc6512664e15c2e6d48c44397ff30 Mon Sep 17 00:00:00 2001 +From 3843c763a49f690052a369c75a4b91e63e65ccd3 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 37/85] BCM2708: Add I2S support to board file +Subject: [PATCH 037/105] BCM2708: Add I2S support to board file Adds the required initializations for I2S to the board file of mach-bcm2708. @@ -124533,10 +124533,10 @@ index a3b65dc..a515992 100644 for (i = 0; i <= 1; i++) { void __iomem *base; -From 7cf3e108eda83b02d6dcf336c5e1842b36fab753 Mon Sep 17 00:00:00 2001 +From 9305f38947159f8027408f9caf57ff11d3a14e5d Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 38/85] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 038/105] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -124685,10 +124685,10 @@ index 0000000..4b70b45 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 895fd13e0cf6dc5febf489837d068825db70d7ac Mon Sep 17 00:00:00 2001 +From d48fc2d392448b821b9ff95e26cf859f2efe4794 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 39/85] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 039/105] BCM2708: Add HifiBerry DAC to board file This adds the initalization of the HifiBerry DAC to the mach-bcm2708 board file. @@ -124736,10 +124736,10 @@ index 01f2de7..1d9b788 100644 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { struct amba_device *d = amba_devs[i]; -From e01a75a2784a659fbd297dc849a2e25ae120e35c Mon Sep 17 00:00:00 2001 +From 1d90a3734460be00e20106847f347ff0bd4c322b Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 40/85] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 040/105] ASoC: BCM2708: Add support for RPi-DAC This adds a machine driver for the RPi-DAC. @@ -125034,13 +125034,13 @@ index 0000000..b4eaa44 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 4250d743113025b72b841b0b801aee698d8761ef Mon Sep 17 00:00:00 2001 +From 54b60a8b83358d2fedc3e401908d96e9053033fb Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 41/85] ASoC: wm8804: Implement MCLK configuration options, add - 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs for - most sample rates. At 192kHz only 128xfs is supported. The existing driver - selects 128xfs automatically for some lower samples rates. By using an +Subject: [PATCH 041/105] ASoC: wm8804: Implement MCLK configuration options, + add 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs + for most sample rates. At 192kHz only 128xfs is supported. The existing + driver selects 128xfs automatically for some lower samples rates. By using an additional mclk_div divider, it is now possible to control the behaviour. This allows using 256xfs PLL frequency on all sample rates up to 96kHz. It should allow lower jitter and better signal quality. The behavior has to be @@ -125077,10 +125077,10 @@ index 1e403f6..d4efa85 100644 #define WM8804_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \ -From bb771a22197d65ccab827fe36a8699d18b961693 Mon Sep 17 00:00:00 2001 +From bda0438e5d2450329f79c9c203eb7700ea94bcdc Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 42/85] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 042/105] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -125345,10 +125345,10 @@ index 0000000..92e9e46 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 6081cb2ed879b4e99cd91a36331460bf6ec2e3f0 Mon Sep 17 00:00:00 2001 +From f0b7e3863c1025b7318dfe2672828fc1186f5f0c Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 43/85] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 043/105] BCM2708: Added support for HiFiBerry Digi board Board initalization by I2C Signed-off-by: Daniel Matuschek @@ -125395,11 +125395,11 @@ index 6d53beb..a062d7f 100644 bcm_register_device_dt(&snd_rpi_dac_device); bcm_register_device_dt(&snd_pcm1794a_codec_device); -From 6d26e73e4afc0f00e514498776ff0e24d595f919 Mon Sep 17 00:00:00 2001 +From f1d5146257a0181f53a76aa7c1eab75d8cde3722 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 44/85] ASoC: wm8804: Set idle_bias_off to false Idle bias has - been change to remove warning on driver startup +Subject: [PATCH 044/105] ASoC: wm8804: Set idle_bias_off to false Idle bias + has been change to remove warning on driver startup Signed-off-by: Daniel Matuschek --- @@ -125420,10 +125420,10 @@ index d4efa85..f3f26a2 100644 .dapm_widgets = wm8804_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8804_dapm_widgets), -From 76c18d6844de1ab292a34baf6c96566ba05db024 Mon Sep 17 00:00:00 2001 +From e2bd270cae6b71e799cd32309da2efb131bfc0f7 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 45/85] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 045/105] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -125631,10 +125631,10 @@ index 0000000..aff7377 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 712b1f5ed46d64ace42306b175e84247ad466a86 Mon Sep 17 00:00:00 2001 +From 3722358310334b175672d037724974a827219c91 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 46/85] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 046/105] vmstat: Workaround for issue where dirty page count goes negative See: @@ -125661,10 +125661,10 @@ index 82e7db7..f87d16d 100644 static inline void __inc_zone_page_state(struct page *page, -From 8fe8c0d0126e286164be182add69b996012753b6 Mon Sep 17 00:00:00 2001 +From d0561fb6028c8eb1c26f3ad2f59d21d70eb778f4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 47/85] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 047/105] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -125700,10 +125700,10 @@ index bfbe1be..a738b25 100644 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From db5d9cfda38672c42a52574924297223f44ab568 Mon Sep 17 00:00:00 2001 +From efa286e84267224fb05bfe8615489d50932ed5b8 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 48/85] Added support for HiFiBerry DAC+ +Subject: [PATCH 048/105] Added support for HiFiBerry DAC+ The driver is based on the HiFiBerry DAC driver. However HiFiBerry DAC+ uses a different codec chip (PCM5122), therefore a new driver is necessary. @@ -125914,10 +125914,10 @@ index 0000000..c63387b +MODULE_DESCRIPTION("ASoC Driver for HiFiBerry DAC+"); +MODULE_LICENSE("GPL v2"); -From f929e0ea9b902ca56a57439ad326a7fe1bc190d2 Mon Sep 17 00:00:00 2001 +From f0b1de75a01f88b6250c208157a3a2f4a5c6b52d Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 49/85] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 049/105] Added driver for HiFiBerry Amp amplifier add-on board The driver contains a low-level hardware driver for the TAS5713 and the drivers for the Raspberry Pi I2S subsystem. @@ -126786,11 +126786,11 @@ index 0000000..8f019e0 + +#endif /* _TAS5713_H */ -From 0d10a0439bbde5d1bf74427cb93a55a29ea7ec12 Mon Sep 17 00:00:00 2001 +From 354cb37f33bee3d72e5a514999323689b00ca275 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Apr 2015 19:14:18 +0100 -Subject: [PATCH 50/85] bcm2708: Allow option card devices to be configured via - DT +Subject: [PATCH 050/105] bcm2708: Allow option card devices to be configured + via DT If the kernel is built with Device Tree support, and if a DT blob is provided for the kernel at boot time, then the platform devices @@ -126814,10 +126814,10 @@ index 03fa1cb..c816526 100644 static struct platform_driver bcm2835_i2s_driver = { .probe = bcm2835_i2s_probe, -From 8eaeacdeca7966b710fbdefad07bd3f0de14447c Mon Sep 17 00:00:00 2001 +From f5a17a7715495cd47e7c4eef2655346833b71139 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 18:45:39 +0100 -Subject: [PATCH 51/85] Adding Device Tree support for some RPi audio cards +Subject: [PATCH 051/105] Adding Device Tree support for some RPi audio cards --- arch/arm/mach-bcm2709/bcm2709.c | 143 ++++++++++++++++++++++++++++++++++++++ @@ -127180,10 +127180,10 @@ index 126f1e9..7c6598e 100644 }; -From 7dfce43c57cc203535e6098fcc1e8977d85ddeac Mon Sep 17 00:00:00 2001 +From 83c934f5afe83dab78859dbdcb6bc2fbcd24904a Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 29 Oct 2014 23:30:30 -0700 -Subject: [PATCH 52/85] Added support to reserve/enable a GPIO pin to be used +Subject: [PATCH 052/105] Added support to reserve/enable a GPIO pin to be used from pps-gpio module (LinuxPPS). Enable PPS modules in default config for RPi. @@ -127319,10 +127319,10 @@ index 57e1f3d..721559b 100644 +module_param(pps_gpio_pin, int, 0644); +MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS"); -From a3936496fcb450e52716292427b60570447b6b03 Mon Sep 17 00:00:00 2001 +From 98235f2a450b2f029e0bba2b566b5c86df9a6fef Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 53/85] Update ds1307 driver for device-tree support +Subject: [PATCH 053/105] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -127349,10 +127349,10 @@ index 4ffabb3..c6789a7 100644 .driver = { .name = "rtc-ds1307", -From eed1565f9cb449204057486a48c39f917c269fa1 Mon Sep 17 00:00:00 2001 +From d25a65991d2262ee56bf481b47a9980edf5e1ff0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 54/85] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 054/105] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -127463,10 +127463,10 @@ index 0000000..2ca2b98 +MODULE_DESCRIPTION("Set LED GPIO to Input \"trigger\""); +MODULE_LICENSE("GPL"); -From 494f12e28e415f895a337fcfcfe45cd530c1cc99 Mon Sep 17 00:00:00 2001 +From b478a1224ddadc079a085b1a9fd2f921f3492543 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 20 Jun 2014 17:19:27 +0100 -Subject: [PATCH 55/85] bcm2709: Simplify and strip down IRQ handler +Subject: [PATCH 055/105] bcm2709: Simplify and strip down IRQ handler --- arch/arm/include/asm/entry-macro-multi.S | 2 + @@ -127685,10 +127685,10 @@ index d08591b..08d184c 100644 +1: get_irqnr_and_base r0, r2, r6, lr + .endm -From 3e2b399180b8f5a0090134ba1889443945a13cf6 Mon Sep 17 00:00:00 2001 +From a149f4195cb6283d974f29f6853bc73666252e28 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 12 Feb 2015 11:17:53 +0000 -Subject: [PATCH 56/85] Fix LED "input" trigger implementation for 3.19 +Subject: [PATCH 056/105] Fix LED "input" trigger implementation for 3.19 --- drivers/leds/leds-gpio.c | 10 +++++++++- @@ -127775,10 +127775,10 @@ index 9a2b000..60accc5 100644 /* Set LED brightness level */ /* Must not sleep, use a workqueue if needed */ -From 5c958120f03edcedf40ff2d07b825229d348d26b Mon Sep 17 00:00:00 2001 +From 63f720f1e358012fdb2631c18c794c32beb1c53f Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 57/85] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 057/105] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -127800,11 +127800,11 @@ index 8d908e3..7a1900d 100644 .can_sleep = false, }; -From 784bb9af1427a9b17cd6894cff2dc3c2eb8c4735 Mon Sep 17 00:00:00 2001 +From 344a03d0bd987220640f4dd4ba4d083d2fdbb449 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 4 Feb 2015 10:02:24 +0000 -Subject: [PATCH 58/85] pinctrl-bcm2835: bcm2835_gpio_direction_output must set - the value +Subject: [PATCH 058/105] pinctrl-bcm2835: bcm2835_gpio_direction_output must + set the value --- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 9 ++++++++- @@ -127831,11 +127831,11 @@ index 7a1900d..62f85aa 100644 static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) -From c885a17c2aee5d4f00b2dc950bcdadd3ed7bd7cb Mon Sep 17 00:00:00 2001 +From 1c683d296c9424f0cf7dac30d8992258c28cbeb1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 59/85] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 - and 46-53 +Subject: [PATCH 059/105] pinctrl-bcm2835: Fix interrupt handling for GPIOs + 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has four interrupt lines - one each for the three IRQ groups and one common. Rather @@ -127980,11 +127980,11 @@ index 62f85aa..c7cf266 100644 }, }; -From ead5cb2483b2fb0943121dfb69786e6ec1c20ced Mon Sep 17 00:00:00 2001 +From e1a45c7cf40f11598c7faed4a1d1b594bcc05796 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 60/85] pinctrl-bcm2835: Only request the interrupts listed in - the DTB +Subject: [PATCH 060/105] pinctrl-bcm2835: Only request the interrupts listed + in the DTB Although the GPIO controller can generate three interrupts (four counting the common one), the device tree files currently only specify two. In the @@ -128010,10 +128010,10 @@ index c7cf266..986779a 100644 pc->irq_data[i].irqgroup = i; -From 15eff0b34d5eba282dfa1fc0303bb66f08d237ad Mon Sep 17 00:00:00 2001 +From 0fff72fcb15c962d0723f9cea13eb2c3fc31d465 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 61/85] enc28j60: Add device tree compatible string and an +Subject: [PATCH 061/105] enc28j60: Add device tree compatible string and an overlay --- @@ -128047,10 +128047,10 @@ index b1b5f66..c6b6e1a 100644 .probe = enc28j60_probe, .remove = enc28j60_remove, -From 4c1fa7e5d19f7f006576def6cdf591c325d9a167 Mon Sep 17 00:00:00 2001 +From 74c1893348470c0ec98d83ea63ab8e22e3da8c13 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 62/85] Add driver for rpi-proto +Subject: [PATCH 062/105] Add driver for rpi-proto Forward port of 3.10.x driver from https://github.com/koalo We are using a custom board and would like to use rpi 3.18.x @@ -128265,10 +128265,10 @@ index 0000000..c6e45a0 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From 3a796c13d6cf8d6cd51170b34944b18d50f30bba Mon Sep 17 00:00:00 2001 +From 607ebcbdf67cb576a652c505a367e614014547dd Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Thu, 2 Apr 2015 12:22:55 +0100 -Subject: [PATCH 63/85] Add Device Tree support for RPi-DAC. +Subject: [PATCH 063/105] Add Device Tree support for RPi-DAC. --- sound/soc/bcm/rpi-dac.c | 21 +++++++++++++++++++++ @@ -128343,10 +128343,10 @@ index b4eaa44..afe1b41 100644 }; -From 69754b2aaecf3eb2dd3bef6f68d7e7787a9dc6cc Mon Sep 17 00:00:00 2001 +From 1fa756b7cbc29e7ce003ed6f6b269faf8f114467 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 64/85] config: Add default configs +Subject: [PATCH 064/105] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1204 ++++++++++++++++++++++++++++++++++++ @@ -130771,10 +130771,10 @@ index 0000000..6a41231 +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From c6ed3e60b55412cdf8e130053f600c05c3e1460a Mon Sep 17 00:00:00 2001 +From 7d987bad7109b37ffac673a9975718ee4e9ea9ae Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 65/85] smsx95xx: fix crimes against truesize +Subject: [PATCH 065/105] smsx95xx: fix crimes against truesize smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings. @@ -130809,10 +130809,10 @@ index e29a323..aff63dc usbnet_skb_return(dev, ax_skb); } -From ef3796d3a8cdb18963e2eeb04fa493abca03af14 Mon Sep 17 00:00:00 2001 +From 888ea57ee7c57e7f43b3be9d7f9c70ea92e3ef2e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 66/85] smsc95xx: Disable turbo mode by default +Subject: [PATCH 066/105] smsc95xx: Disable turbo mode by default --- drivers/net/usb/smsc95xx.c | 2 +- @@ -130832,10 +130832,10 @@ index aff63dc..08a8a8c 100755 MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); -From 831d4392562d46f0d9a55c755c1363b84832af2a Mon Sep 17 00:00:00 2001 +From 43e2441e42ce3e68910e50a862e82cefff1491a8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2015 19:30:22 +0100 -Subject: [PATCH 67/85] Add blk_pos parameter to mmc multi_io_quirk callback +Subject: [PATCH 067/105] Add blk_pos parameter to mmc multi_io_quirk callback --- drivers/mmc/card/block.c | 1 + @@ -130918,10 +130918,10 @@ index b0258e8..d3cdad9 100644 struct mmc_card; -From a20e01130fd949a90e5e91821edd63581e95cc1e Mon Sep 17 00:00:00 2001 +From 3c38adf40dd65f96d317f60295ee47ddd5412d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 29 Apr 2015 17:24:02 +0200 -Subject: [PATCH 68/85] bcm2835: bcm2835_defconfig +Subject: [PATCH 068/105] bcm2835: bcm2835_defconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -132251,10 +132251,10 @@ index 31cb073..2e8a95a 100644 # CONFIG_XZ_DEC_ARM is not set # CONFIG_XZ_DEC_ARMTHUMB is not set -From f06ed380a59b6b336820510c6716db5bd9928e66 Mon Sep 17 00:00:00 2001 +From 219d0cd5afbcfc1d8d1bffc63c535c323ae8bf2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 1 May 2015 23:00:15 +0200 -Subject: [PATCH 69/85] BCM270x_DT: Add mailbox bcm2708-vcio +Subject: [PATCH 069/105] BCM270x_DT: Add mailbox bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -132295,10 +132295,10 @@ index 721559b..4a00561 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); -From ad4a25a7e27ffac5b4f5b9eba60c8588ec2e04c1 Mon Sep 17 00:00:00 2001 +From 3c10332d5214199b7df6d5d220eeef023706cbaf Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 70/85] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 070/105] rpi-ft5406: Add touchscreen driver for pi LCD display --- drivers/input/touchscreen/Kconfig | 7 + @@ -132615,10 +132615,11 @@ index cc284ed..d3ea839 100644 VCMSG_SET_CURSOR_STATE = 0x00008011, }; -From 4d11ea5e022aa484a8884a54d08bb5d3f26bed0b Mon Sep 17 00:00:00 2001 +From 10fe6a8ff8d397d392f84f71bccef590007c1035 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 71/85] Improve __copy_to_user and __copy_from_user performance +Subject: [PATCH 071/105] Improve __copy_to_user and __copy_from_user + performance Provide a __copy_from_user that uses memcpy. On BCM2708, use optimised memcpy/memmove/memcmp/memset implementations. @@ -134142,10 +134143,10 @@ index 3e58d71..0622891 100644 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) -From 961d37927bd0de6c86334892d19341f427a6d543 Mon Sep 17 00:00:00 2001 +From 55e619a1d22f898210f4d5df7056de9ca22262ef Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 May 2015 17:22:15 +0100 -Subject: [PATCH 72/85] bcm2835-audio: Create the platform device if the DT +Subject: [PATCH 072/105] bcm2835-audio: Create the platform device if the DT node is disabled For backwards compatibility, allow the built-in ALSA driver to be enabled @@ -134199,10 +134200,10 @@ index 4a00561..dec8043 100644 bcm_register_device_dt(&bcm2708_spi_device); -From 729ca6d5fc85ce618d61af67f400d1f20ddd2fbd Mon Sep 17 00:00:00 2001 +From 3a23003af149876e9459bf65f14eff38ddb57778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 3 Jun 2015 12:26:13 +0200 -Subject: [PATCH 73/85] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 073/105] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -134261,10 +134262,10 @@ index 70f2f39..f7fdacd 100644 static const char * const bcm2835_compat[] = { -From 9a645229a554cd9b0f211bd15310ceb4c61f32b2 Mon Sep 17 00:00:00 2001 +From a16205df7ca3759a05bf56e126d17fb496c12775 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 17:47:27 +0100 -Subject: [PATCH 74/85] platform: Add force_core command line setting to boot +Subject: [PATCH 074/105] platform: Add force_core command line setting to boot from a different core number --- @@ -134335,10 +134336,10 @@ index dec8043..fe71c50 100644 module_param(serial, uint, 0644); module_param(uart_clock, uint, 0644); -From 0733a658a5b233abd9da4157ab2bfd52ceebf404 Mon Sep 17 00:00:00 2001 +From d4fe01b4f1f6d84fb12a04e228edc19aea23865a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Jun 2015 17:46:17 +0100 -Subject: [PATCH 75/85] mach-bcm270x: Enable the building of pinctrl-bcm2835 +Subject: [PATCH 075/105] mach-bcm270x: Enable the building of pinctrl-bcm2835 --- drivers/pinctrl/Makefile | 1 + @@ -134357,10 +134358,10 @@ index 6eadf04..9119513 100644 obj-$(CONFIG_ARCH_BERLIN) += berlin/ obj-y += freescale/ -From 3c7dc45eee7c0339b72469bf6674e842385b7ab9 Mon Sep 17 00:00:00 2001 +From cd146348cbf2ff432f0cb3b05b0e0cf117dbba74 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 Jun 2015 16:41:39 +0100 -Subject: [PATCH 76/85] BCM270X_DT: Document the i2s-mmap overlay +Subject: [PATCH 076/105] BCM270X_DT: Document the i2s-mmap overlay --- arch/arm/boot/dts/overlays/README | 6 ++++++ @@ -134384,10 +134385,10 @@ index 3e08f98..7fa6d33 100644 Info: Configures the IQaudio DAC audio card Load: dtoverlay=iqaudio-dac -From d9fa11803a0d2e3b1eaf4041ddd0ca5651300d96 Mon Sep 17 00:00:00 2001 +From 88ffec3ff5b4505e53ee2fdcbc564fe734145ae6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 11:36:53 +0100 -Subject: [PATCH 77/85] bcm2835-sdhost: Improve error handling and recovery +Subject: [PATCH 077/105] bcm2835-sdhost: Improve error handling and recovery 1) Expose the hw_reset method to the MMC framework, removing many internal calls by the driver. @@ -135479,10 +135480,10 @@ index eef8a24..6277e43 100644 if (host->allow_dma) { -From 5920303037d30f0ecee57f83015cd8838ba1f77e Mon Sep 17 00:00:00 2001 +From afd5ae68ceec9ee73fb979c32ed1fd19ab6a1038 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:46 -0700 -Subject: [PATCH 78/85] ARM: bcm2835: Add the Raspberry Pi firmware driver +Subject: [PATCH 078/105] ARM: bcm2835: Add the Raspberry Pi firmware driver This gives us a function for making mailbox property channel requests of the firmware, which is most notable in that it will let us get and @@ -135530,7 +135531,7 @@ index 3fdd391..ee101a2 100644 obj-$(CONFIG_EFI) += efi/ diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c new file mode 100644 -index 0000000..dd506cd +index 0000000..dd506cd3 --- /dev/null +++ b/drivers/firmware/raspberrypi.c @@ -0,0 +1,260 @@ @@ -135916,10 +135917,10 @@ index 0000000..9d9efb7 + void *data, size_t tag_size); +struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node); -From c97b07c0494073a69820a78b6012dc62cb902144 Mon Sep 17 00:00:00 2001 +From c3629eb3fda93e5727602a1484daab7d08da61cb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 22 Mar 2015 13:33:23 +0000 -Subject: [PATCH 79/85] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING +Subject: [PATCH 079/105] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING --- arch/arm/configs/bcm2709_defconfig | 4 ++++ @@ -135971,10 +135972,11 @@ index 6a41231..cacde14 100644 CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_DRBD=m -From e547d7e94a85179d7ff7787eb95e29f0b0b657f4 Mon Sep 17 00:00:00 2001 +From 667729cc2a536b1cc6241973276fad1e72909f3a Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Mon, 22 Jun 2015 16:27:07 +0100 -Subject: [PATCH 80/85] Add rpi-ft5406 overlay Add rpi-ft5406 driver as module +Subject: [PATCH 080/105] Add rpi-ft5406 overlay Add rpi-ft5406 driver as + module --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -136060,10 +136062,10 @@ index cacde14..f952ff2 100644 CONFIG_TOUCHSCREEN_STMPE=m CONFIG_INPUT_MISC=y -From 9dea271e610d0524fad677b9cccdd3be84ab25da Mon Sep 17 00:00:00 2001 +From b2d8f6a978e70e941859cc4cfacaee8121f71b7c Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 23 Jun 2015 09:53:40 +0100 -Subject: [PATCH 81/85] Fix driver detection failure Check that the buffer +Subject: [PATCH 081/105] Fix driver detection failure Check that the buffer response is non-zero meaning the touchscreen was detected --- @@ -136084,10 +136086,10 @@ index f55151b..d41851d 100644 dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", request.tag.val); } -From 8ad2b6ac33fca9a40238c42fdd2b5ed840c2fc8d Mon Sep 17 00:00:00 2001 +From 47e896b8d1e0614ae8dc7a01b037d3d30bd87bf1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 13:24:01 +0100 -Subject: [PATCH 82/85] config: Enable 8250 serial port +Subject: [PATCH 082/105] config: Enable 8250 serial port --- arch/arm/configs/bcm2709_defconfig | 7 +++++++ @@ -136135,10 +136137,10 @@ index f952ff2..0c25d8b 100644 CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_BCM2835=m -From cc78a5ef74fc67465fdacffe452a5fab5848b33c Mon Sep 17 00:00:00 2001 +From e6e9f242d287b3fa1008ef3bfdac211906587585 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 14:10:58 +0100 -Subject: [PATCH 83/85] config: Enable POWER_RESET_GPIO +Subject: [PATCH 083/105] config: Enable POWER_RESET_GPIO --- arch/arm/configs/bcm2709_defconfig | 2 ++ @@ -136172,10 +136174,10 @@ index 0c25d8b..e757db6 100644 CONFIG_THERMAL=y CONFIG_THERMAL_BCM2835=y -From 01f5e319010c90770e0c8a87656c360a18a35208 Mon Sep 17 00:00:00 2001 +From acfa836e00324826a1aa3dc816d7dc5f4b5d5790 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 26 Jun 2015 17:37:38 +0100 -Subject: [PATCH 84/85] bcm2708-vcio: Remove restriction of only a single +Subject: [PATCH 084/105] bcm2708-vcio: Remove restriction of only a single instance being open We need more than one process to be able to use mailbox interface (e.g. HW cursor in fbturbo and hello_fft). @@ -136220,10 +136222,10 @@ index d91672b..06fb2c2f 100644 return 0; -From 2cdae3dcbcca3d818f64d14580f22c67e32d851c Mon Sep 17 00:00:00 2001 +From 7f23eccb28dd764cf1af231fdc69bc9f93db4972 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:39:19 +0100 -Subject: [PATCH 85/85] BCM270X_DT: Create a "core" clock, use it for SPI and +Subject: [PATCH 085/105] BCM270X_DT: Create a "core" clock, use it for SPI and sdhost --- @@ -136373,3 +136375,1790 @@ index b408ab4..897204a 100644 - sdhost_freq = <&clk_sdhost>,"clock-frequency:0"; }; }; + +From f64348123913a79fd145c5208039c8f66c0c4252 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 24 Jun 2015 09:24:31 +0100 +Subject: [PATCH 086/105] BCM270X_DT: Add MCP7941X to i2c-rtc overlay + +--- + arch/arm/boot/dts/overlays/README | 3 +++ + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 6 ++++++ + 2 files changed, 9 insertions(+) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index aa09b6c..425eb19 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -253,6 +253,8 @@ Params: ds1307 Select the DS1307 device + + ds3231 Select the DS3231 device + ++ mcp7941x Select the MCP7941x device ++ + pcf2127 Select the PCF2127 device + + pcf8523 Select the PCF8523 device +@@ -396,6 +398,7 @@ Params: speed Display SPI bus speed + + xohms Touchpanel sensitivity (X-plate resistance) + ++ + Name: rpi-ft5406 + Info: Official Raspberry Pi display touchscreen + Load: dtoverlay=rpi-ft5406 +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +index 6bccfdc..7052c71 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -17,6 +17,11 @@ + reg = <0x68>; + status = "disable"; + }; ++ mcp7941x: mcp7941x@6f { ++ compatible = "microchip,mcp7941x"; ++ reg = <0x6f>; ++ status = "disable"; ++ }; + ds3231: ds3231@68 { + compatible = "maxim,ds3231"; + reg = <0x68>; +@@ -42,6 +47,7 @@ + __overrides__ { + ds1307 = <&ds1307>,"status"; + ds3231 = <&ds3231>,"status"; ++ mcp7941x = <&mcp7941x>,"status"; + pcf2127 = <&pcf2127>,"status"; + pcf8523 = <&pcf8523>,"status"; + pcf8563 = <&pcf8563>,"status"; + +From 57fd1fbaa2d9281f2b9d70c8d15dbaa201af2b71 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Wed, 24 Jun 2015 11:23:06 +0100 +Subject: [PATCH 087/105] dts/overlays: document DHT11 overlay + +--- + arch/arm/boot/dts/overlays/README | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 425eb19..9406cf3 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -173,6 +173,14 @@ Load: dtoverlay=bmp085_i2c-sensor + Params: + + ++Name: dht11 ++Info: Overlay for the DHT11/DHT21/DHT22 humidity/temperature sensors ++ Also sometimes found with the part number(s) AM230x. ++Load: dtoverlay=dht11,= ++Params: gpiopin GPIO connected to the sensor's DATA output. ++ (default 4) ++ ++ + [ The ds1307-rtc overlay has been deleted. See i2c-rtc. ] + + + +From e072d9e5801bb111be321dff6feadd5c12e8d2ad Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 25 Jun 2015 12:16:11 +0100 +Subject: [PATCH 088/105] gpio-poweroff: Allow it to work on Raspberry Pi + +The Raspberry Pi firmware manages the power-down and reboot +process. To do this it installs a pm_power_off handler, causing +the gpio-poweroff module to abort the probe function. + +This patch introduces a "force" DT property that overrides that +behaviour, and also adds a DT overlay to enable and control it. + +Note that running in an active-low configuration (DT parameter +"active_low") requires a custom dt-blob.bin and probably won't +allow a reboot without switching off, so an external inversion +of the trigger signal may be preferable. +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 13 +++++++++ + .../boot/dts/overlays/gpio-poweroff-overlay.dts | 34 ++++++++++++++++++++++ + drivers/power/reset/gpio-poweroff.c | 4 ++- + 4 files changed, 51 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 19eef3c..a1397c7 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -16,6 +16,7 @@ dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += gpio-poweroff-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += hifiberry-amp-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += hifiberry-dac-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += hifiberry-dacplus-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 9406cf3..0ed7094 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -192,6 +192,19 @@ Params: int_pin GPIO used for INT (default 25) + speed SPI bus speed (default 12000000) + + ++Name: gpio-poweroff ++Info: Drives a GPIO high or low on reboot ++Load: gpio-poweroff,= ++Params: gpiopin GPIO for signalling (default 26) ++ ++ active_low Set if the power control device requires a ++ high->low transition to trigger a power-down. ++ Note that this will require the support of a ++ custom dt-blob.bin to prevent a power-down ++ during the boot process, and that a reboot ++ will also cause the pin to go low. ++ ++ + Name: hifiberry-amp + Info: Configures the HifiBerry Amp and Amp+ audio cards + Load: dtoverlay=hifiberry-amp +diff --git a/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts b/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts +new file mode 100644 +index 0000000..ff8cb36 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts +@@ -0,0 +1,34 @@ ++// Definitions for gpio-poweroff module ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/"; ++ __overlay__ { ++ power_ctrl: power_ctrl { ++ compatible = "gpio-poweroff"; ++ gpios = <&gpio 26 0>; ++ force; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ power_ctrl_pins: power_ctrl_pins { ++ brcm,pins = <26>; ++ brcm,function = <1>; // out ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ gpiopin = <&power_ctrl>,"gpios:4", ++ <&power_ctrl_pins>,"brcm,pins:0"; ++ active_low = <&power_ctrl>,"gpios:8"; ++ }; ++}; +diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c +index e5332f1..6e3fec2 100644 +--- a/drivers/power/reset/gpio-poweroff.c ++++ b/drivers/power/reset/gpio-poweroff.c +@@ -48,9 +48,11 @@ static void gpio_poweroff_do_poweroff(void) + static int gpio_poweroff_probe(struct platform_device *pdev) + { + bool input = false; ++ bool force = false; + + /* If a pm_power_off function has already been added, leave it alone */ +- if (pm_power_off != NULL) { ++ force = of_property_read_bool(pdev->dev.of_node, "force"); ++ if (!force && (pm_power_off != NULL)) { + dev_err(&pdev->dev, + "%s: pm_power_off function already registered", + __func__); + +From 45567cec8e8dc1be2d45fead5332258d3a49a088 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 17 Jun 2015 17:10:40 +0100 +Subject: [PATCH 089/105] BCM270x_DT: Default Compute Module i2c, i2s and spi + support + +--- + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 67 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 67 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index e82fcb2..af252bd 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -10,10 +10,77 @@ + status = "okay"; + }; + ++&gpio { ++ spi0_pins: spi0_pins { ++ brcm,pins = <7 8 9 10 11>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++ ++ i2c0_pins: i2c0 { ++ brcm,pins = <0 1>; ++ brcm,function = <4>; ++ }; ++ ++ i2c1_pins: i2c1 { ++ brcm,pins = <2 3>; ++ brcm,function = <4>; ++ }; ++ ++ i2s_pins: i2s { ++ brcm,pins = <18 19 20 21>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins>; ++ ++ spidev@0{ ++ compatible = "spidev"; ++ reg = <0>; /* CE0 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <500000>; ++ }; ++ ++ spidev@1{ ++ compatible = "spidev"; ++ reg = <1>; /* CE1 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <500000>; ++ }; ++}; ++ ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&i2s { ++ #sound-dai-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_pins>; ++}; ++ + / { + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ i2s = <&i2s>,"status"; ++ spi = <&spi0>,"status"; ++ i2c0 = <&i2c0>,"status"; ++ i2c1 = <&i2c1>,"status"; ++ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; ++ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + }; + }; + +From 2c610cb4fa176ac54d4e32a4744761aa9c600f3c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 22 Jun 2015 14:21:55 +0100 +Subject: [PATCH 090/105] BCM270X_DT: Sort nodes by bus address, and + consolidate aliases + +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 19 ---------- + arch/arm/boot/dts/bcm2708-rpi-b.dts | 19 ---------- + arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 21 ----------- + arch/arm/boot/dts/bcm2708_common.dtsi | 63 +++++++++++++++++++++++--------- + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 19 ---------- + 5 files changed, 46 insertions(+), 95 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index 3b252dc..9af99b8 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -5,25 +5,6 @@ + / { + compatible = "brcm,bcm2708"; + model = "Raspberry Pi Model B+"; +- +- aliases { +- soc = &soc; +- spi0 = &spi0; +- i2c0 = &i2c0; +- i2c1 = &i2c1; +- i2s = &i2s; +- gpio = &gpio; +- intc = &intc; +- leds = &leds; +- audio = &audio; +- sound = &sound; +- uart0 = &uart0; +- uart1 = &uart1; +- clocks = &clocks; +- }; +- +- sound: sound { +- }; + }; + + &gpio { +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 40fded1..092d15d 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -5,25 +5,6 @@ + / { + compatible = "brcm,bcm2708"; + model = "Raspberry Pi Model B"; +- +- aliases { +- soc = &soc; +- spi0 = &spi0; +- i2c0 = &i2c0; +- i2c1 = &i2c1; +- i2s = &i2s; +- gpio = &gpio; +- intc = &intc; +- leds = &leds; +- audio = &audio; +- sound = &sound; +- uart0 = &uart0; +- uart1 = &uart1; +- clocks = &clocks; +- }; +- +- sound: sound { +- }; + }; + + &gpio { +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +index 3da7d3b..34d4bc6 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +@@ -1,26 +1,5 @@ + /include/ "bcm2708.dtsi" + +-/ { +- aliases { +- soc = &soc; +- spi0 = &spi0; +- i2c0 = &i2c0; +- i2c1 = &i2c1; +- i2s = &i2s; +- gpio = &gpio; +- intc = &intc; +- leds = &leds; +- audio = &audio; +- sound = &sound; +- uart0 = &uart0; +- uart1 = &uart1; +- clocks = &clocks; +- }; +- +- sound: sound { +- }; +-}; +- + &leds { + act_led: act { + label = "led0"; +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index 4a975dfd..b71b208 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -3,6 +3,31 @@ + / { + interrupt-parent = <&intc>; + ++ aliases { ++ audio = &audio; ++ sound = &sound; ++ soc = &soc; ++ dma = &dma; ++ intc = &intc; ++ watchdog = &watchdog; ++ random = &random; ++ mailbox = &mailbox; ++ gpio = &gpio; ++ uart0 = &uart0; ++ i2s = &i2s; ++ spi0 = &spi0; ++ i2c0 = &i2c0; ++ uart1 = &uart1; ++ mmc = &mmc; ++ i2c1 = &i2c1; ++ usb = &usb; ++ leds = &leds; ++ fb = &fb; ++ vchiq = &vchiq; ++ thermal = &thermal; ++ clocks = &clocks; ++ }; ++ + /* Onboard audio */ + audio: audio { + compatible = "brcm,bcm2835-audio"; +@@ -10,6 +35,10 @@ + status = "disabled"; + }; + ++ /* External sound card */ ++ sound: sound { ++ }; ++ + soc: soc { + compatible = "simple-bus"; + #address-cells = <1>; +@@ -43,6 +72,12 @@ + #interrupt-cells = <2>; + }; + ++ mailbox: mailbox@7e00b800 { ++ compatible = "brcm,bcm2708-vcio"; ++ reg = <0x7e00b880 0x40>; ++ interrupts = <0 1>; ++ }; ++ + watchdog: watchdog@7e100000 { + compatible = "brcm,bcm2835-pm-wdt"; + reg = <0x7e100000 0x28>; +@@ -55,12 +90,6 @@ + status = "disabled"; + }; + +- mailbox: mailbox@7e00b800 { +- compatible = "brcm,bcm2708-vcio"; +- reg = <0x7e00b880 0x40>; +- interrupts = <0 1>; +- }; +- + gpio: gpio { + compatible = "brcm,bcm2835-gpio"; + reg = <0x7e200000 0xb4>; +@@ -73,17 +102,6 @@ + #interrupt-cells = <2>; + }; + +- mmc: mmc@7e300000 { +- compatible = "brcm,bcm2835-mmc"; +- reg = <0x7e300000 0x100>; +- interrupts = <2 30>; +- clocks = <&clk_mmc>; +- dmas = <&dma 11>, +- <&dma 11>; +- dma-names = "tx", "rx"; +- status = "disabled"; +- }; +- + uart0: uart@7e201000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7e201000 0x1000>; +@@ -144,6 +162,17 @@ + status = "disabled"; + }; + ++ mmc: mmc@7e300000 { ++ compatible = "brcm,bcm2835-mmc"; ++ reg = <0x7e300000 0x100>; ++ interrupts = <2 30>; ++ clocks = <&clk_mmc>; ++ dmas = <&dma 11>, ++ <&dma 11>; ++ dma-names = "tx", "rx"; ++ status = "disabled"; ++ }; ++ + i2c1: i2c@7e804000 { + compatible = "brcm,bcm2708-i2c"; + reg = <0x7e804000 0x1000>; +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index 24fa849..ccb9c31 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -5,25 +5,6 @@ + / { + compatible = "brcm,bcm2709"; + model = "Raspberry Pi 2 Model B"; +- +- aliases { +- soc = &soc; +- spi0 = &spi0; +- i2c0 = &i2c0; +- i2c1 = &i2c1; +- i2s = &i2s; +- gpio = &gpio; +- intc = &intc; +- leds = &leds; +- audio = &audio; +- sound = &sound; +- uart0 = &uart0; +- uart1 = &uart1; +- clocks = &clocks; +- }; +- +- sound: sound { +- }; + }; + + &gpio { + +From dab507d5936f3847a320b11be5a21b4c25c4601b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 22 Jun 2015 14:23:03 +0100 +Subject: [PATCH 091/105] i2c-bcm2708/BCM270X_DT: Add support for I2C2 + +The third I2C bus (I2C2) is normally reserved for HDMI use. Careless +use of this bus can break an attached display - use with caution. + +It is recommended to disable accesses by VideoCore by setting +hdmi_ignore_edid=1 or hdmi_edid_file=1 in config.txt. + +The interface is disabled by default - enable using the +i2c2_iknowwhatimdoing DT parameter. +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 6 ++++++ + arch/arm/boot/dts/bcm2708-rpi-b.dts | 6 ++++++ + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 6 ++++++ + arch/arm/boot/dts/bcm2708_common.dtsi | 14 ++++++++++++++ + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 6 ++++++ + drivers/i2c/busses/i2c-bcm2708.c | 5 ++++- + 6 files changed, 42 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index 9af99b8..e3ae8e6 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -75,6 +75,10 @@ + clock-frequency = <100000>; + }; + ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ + &i2s { + #sound-dai-cells = <0>; + pinctrl-names = "default"; +@@ -103,8 +107,10 @@ + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; + i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 092d15d..18ca7a2 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -75,6 +75,10 @@ + clock-frequency = <100000>; + }; + ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ + &i2s { + #sound-dai-cells = <0>; + pinctrl-names = "default"; +@@ -97,8 +101,10 @@ + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; + i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index af252bd..bddc369 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -65,6 +65,10 @@ + clock-frequency = <100000>; + }; + ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ + &i2s { + #sound-dai-cells = <0>; + pinctrl-names = "default"; +@@ -79,8 +83,10 @@ + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; + i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + }; + }; +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index b71b208..8181a4e 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -20,6 +20,7 @@ + uart1 = &uart1; + mmc = &mmc; + i2c1 = &i2c1; ++ i2c2 = &i2c2; + usb = &usb; + leds = &leds; + fb = &fb; +@@ -183,6 +184,19 @@ + status = "disabled"; + }; + ++ i2c2: i2c@7e805000 { ++ // Beware - this is shared with the HDMI module. ++ // Careless use may break (really) your display. ++ // Caveat emptor. ++ compatible = "brcm,bcm2708-i2c"; ++ reg = <0x7e805000 0x1000>; ++ interrupts = <2 21>; ++ clocks = <&clk_i2c>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ }; ++ + usb: usb@7e980000 { + compatible = "brcm,bcm2708-usb"; + reg = <0x7e980000 0x10000>, +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index ccb9c31..76d44a2 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -75,6 +75,10 @@ + clock-frequency = <100000>; + }; + ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ + &i2s { + #sound-dai-cells = <0>; + pinctrl-names = "default"; +@@ -103,8 +107,10 @@ + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; + i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; +diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c +index 8773203..7a24fbe 100644 +--- a/drivers/i2c/busses/i2c-bcm2708.c ++++ b/drivers/i2c/busses/i2c-bcm2708.c +@@ -407,8 +407,11 @@ static int bcm2708_i2c_probe(struct platform_device *pdev) + case 1: + adap->class = I2C_CLASS_DDC; + break; ++ case 2: ++ adap->class = I2C_CLASS_DDC; ++ break; + default: +- dev_err(&pdev->dev, "can only bind to BSC 0 or 1\n"); ++ dev_err(&pdev->dev, "can only bind to BSC 0, 1 or 2\n"); + err = -ENXIO; + goto out_free_bi; + } + +From c887101553aed347b4e0e29422cd5a7315cce18a Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 29 Jun 2015 12:14:02 +0100 +Subject: [PATCH 092/105] BCM270X_DT: Correct the lirc-rpi overlay + documentation + +The polarity of the "sense" parameter was inverted with respect to reality. + +See: https://github.com/raspberrypi/linux/issues/1038 +--- + arch/arm/boot/dts/overlays/README | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 0ed7094..ec762d2 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -313,8 +313,8 @@ Params: gpio_out_pin GPIO for output (default "17") + (default "down") + + sense Override the IR receive auto-detection logic: +- "1" = force active high +- "0" = force active low ++ "0" = force active-high ++ "1" = force active-low + "-1" = use auto-detection + (default "-1") + + +From b55c8ef4eab8f62f3087bcdf4eb9a603105d16fb Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 25 Jun 2015 08:47:09 +0100 +Subject: [PATCH 093/105] bcm2835-sdhost: Further improve overclock back-off + +--- + drivers/mmc/host/bcm2835-sdhost.c | 144 +++++++++++++++++++++----------------- + 1 file changed, 78 insertions(+), 66 deletions(-) + +diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c +index 6277e43..a03db06 100644 +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -161,8 +161,6 @@ struct bcm2835_host { + + unsigned int use_busy:1; /* Wait for busy interrupt */ + +- unsigned int reduce_overclock:1; /* ...at the next opportunity */ +- + unsigned int debug:1; /* Enable debug output */ + + u32 thread_isr; +@@ -466,36 +464,25 @@ static void bcm2835_sdhost_dma_complete(void *param) + spin_unlock_irqrestore(&host->lock, flags); + } + +-static bool data_transfer_wait(struct bcm2835_host *host, const char *caller) ++static bool data_transfer_wait(struct bcm2835_host *host) + { + unsigned long timeout = 1000000; +- u32 hsts; + while (timeout) + { +- hsts = bcm2835_sdhost_read(host, SDHSTS); +- if (hsts & (SDHSTS_TRANSFER_ERROR_MASK | +- SDHSTS_DATA_FLAG)) { +- bcm2835_sdhost_write(host, SDHSTS_TRANSFER_ERROR_MASK, +- SDHSTS); ++ u32 sdhsts = bcm2835_sdhost_read(host, SDHSTS); ++ if (sdhsts & SDHSTS_DATA_FLAG) { ++ bcm2835_sdhost_write(host, SDHSTS_DATA_FLAG, SDHSTS); + break; + } + timeout--; + } +- +- if (hsts & (SDHSTS_CRC16_ERROR | +- SDHSTS_CRC7_ERROR | +- SDHSTS_FIFO_ERROR)) { +- pr_err("%s: data error in %s - HSTS %x\n", +- mmc_hostname(host->mmc), caller, hsts); +- host->data->error = -EILSEQ; +- return false; +- } else if ((timeout == 0) || +- (hsts & (SDHSTS_CMD_TIME_OUT | +- SDHSTS_REW_TIME_OUT))) { +- pr_err("%s: timeout in %s - HSTS %x\n", +- mmc_hostname(host->mmc), caller, hsts); +- host->data->error = -ETIMEDOUT; +- return false; ++ if (timeout == 0) { ++ pr_err("%s: Data %s timeout\n", ++ mmc_hostname(host->mmc), ++ (host->data->flags & MMC_DATA_READ) ? "read" : "write"); ++ bcm2835_sdhost_dumpregs(host); ++ host->data->error = -ETIMEDOUT; ++ return false; + } + return true; + } +@@ -523,7 +510,7 @@ static void bcm2835_sdhost_read_block_pio(struct bcm2835_host *host) + buf = (u32 *)host->sg_miter.addr; + + while (len) { +- if (!data_transfer_wait(host, "read_block_pio")) ++ if (!data_transfer_wait(host)) + break; + + *(buf++) = bcm2835_sdhost_read(host, SDDATA); +@@ -562,7 +549,7 @@ static void bcm2835_sdhost_write_block_pio(struct bcm2835_host *host) + buf = host->sg_miter.addr; + + while (len) { +- if (!data_transfer_wait(host, "write_block_pio")) ++ if (!data_transfer_wait(host)) + break; + + bcm2835_sdhost_write(host, *(buf++), SDDATA); +@@ -581,13 +568,33 @@ static void bcm2835_sdhost_write_block_pio(struct bcm2835_host *host) + + static void bcm2835_sdhost_transfer_pio(struct bcm2835_host *host) + { ++ u32 sdhsts; ++ bool is_read; + BUG_ON(!host->data); + +- if (host->data->flags & MMC_DATA_READ) { ++ is_read = (host->data->flags & MMC_DATA_READ) != 0; ++ if (is_read) + bcm2835_sdhost_read_block_pio(host); +- } else { ++ else + bcm2835_sdhost_write_block_pio(host); + ++ sdhsts = bcm2835_sdhost_read(host, SDHSTS); ++ if (sdhsts & (SDHSTS_CRC16_ERROR | ++ SDHSTS_CRC7_ERROR | ++ SDHSTS_FIFO_ERROR)) { ++ pr_err("%s: %s transfer error - HSTS %x\n", ++ mmc_hostname(host->mmc), ++ is_read ? "read" : "write", ++ sdhsts); ++ host->data->error = -EILSEQ; ++ } else if ((sdhsts & (SDHSTS_CMD_TIME_OUT | ++ SDHSTS_REW_TIME_OUT))) { ++ pr_err("%s: %s timeout error - HSTS %x\n", ++ mmc_hostname(host->mmc), ++ is_read ? "read" : "write", ++ sdhsts); ++ host->data->error = -ETIMEDOUT; ++ } else if (!is_read && !host->data->error) { + /* Start a timer in case a transfer error occurs because + there is no error interrupt */ + mod_timer(&host->pio_timer, jiffies + host->pio_timeout); +@@ -701,8 +708,9 @@ static void bcm2835_sdhost_prepare_data(struct bcm2835_host *host, struct mmc_co + + void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command *cmd) + { +- u32 sdcmd; ++ u32 sdcmd, sdhsts; + unsigned long timeout; ++ int delay; + + WARN_ON(host->cmd); + +@@ -719,8 +727,8 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + mmc_hostname(host->mmc), + cmd->opcode, cmd->arg, cmd->flags); + +- /* Wait max 10 ms */ +- timeout = 1000; ++ /* Wait max 100 ms */ ++ timeout = 10000; + + while (bcm2835_sdhost_read(host, SDCMD) & SDCMD_NEW_FLAG) { + if (timeout == 0) { +@@ -735,8 +743,9 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + udelay(10); + } + +- if ((1000-timeout)/100 > 1 && (1000-timeout)/100 > host->max_delay) { +- host->max_delay = (1000-timeout)/100; ++ delay = (10000 - timeout)/100; ++ if (delay > host->max_delay) { ++ host->max_delay = delay; + pr_warning("%s: controller hung for %d ms\n", + mmc_hostname(host->mmc), + host->max_delay); +@@ -751,6 +760,11 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + + host->cmd = cmd; + ++ /* Clear any error flags */ ++ sdhsts = bcm2835_sdhost_read(host, SDHSTS); ++ if (sdhsts & SDHSTS_ERROR_MASK) ++ bcm2835_sdhost_write(host, sdhsts, SDHSTS); ++ + bcm2835_sdhost_prepare_data(host, cmd); + + bcm2835_sdhost_write(host, cmd->arg, SDARG); +@@ -876,7 +890,7 @@ static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host) + static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + { + u32 sdcmd; +- int timeout = 1000; ++ unsigned long timeout; + #ifdef DEBUG + struct timeval before, after; + int timediff = 0; +@@ -889,6 +903,8 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + #ifdef DEBUG + do_gettimeofday(&before); + #endif ++ /* Wait max 100 ms */ ++ timeout = 10000; + for (sdcmd = bcm2835_sdhost_read(host, SDCMD); + (sdcmd & SDCMD_NEW_FLAG) && timeout; + timeout--) { +@@ -1049,9 +1065,9 @@ static void bcm2835_sdhost_pio_timeout(unsigned long data) + spin_lock_irqsave(&host->lock, flags); + + if (host->data) { +- u32 hsts = bcm2835_sdhost_read(host, SDHSTS); ++ u32 sdhsts = bcm2835_sdhost_read(host, SDHSTS); + +- if (hsts & SDHSTS_REW_TIME_OUT) { ++ if (sdhsts & SDHSTS_REW_TIME_OUT) { + pr_err("%s: transfer timeout\n", + mmc_hostname(host->mmc)); + if (host->debug) +@@ -1380,19 +1396,10 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + if (host->debug) + pr_info("%s: set_clock(%d)\n", mmc_hostname(host->mmc), clock); + +- if ((clock == 0) && host->reduce_overclock) { +- /* This is a reset following data corruption - reduce any +- overclock */ +- host->reduce_overclock = 0; +- if (host->overclock_50 > 50) { +- pr_warn("%s: reducing overclock due to errors\n", +- mmc_hostname(host->mmc)); +- host->overclock_50--; +- } +- } +- +- if (host->overclock_50 && (clock == 50*MHZ)) ++ if ((host->overclock_50 > 50) && ++ (clock == 50*MHZ)) { + clock = host->overclock_50 * MHZ + (MHZ - 1); ++ } + + /* The SDCDIV register has 11 bits, and holds (div - 2). + But in data mode the max is 50MHz wihout a minimum, and only the +@@ -1450,11 +1457,12 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + host->overclock = clock; + } + } +- else if ((clock == 50 * MHZ) && host->overclock) ++ else if (host->overclock) + { +- pr_warn("%s: cancelling overclock\n", +- mmc_hostname(host->mmc)); + host->overclock = 0; ++ if (clock == 50 * MHZ) ++ pr_warn("%s: cancelling overclock\n", ++ mmc_hostname(host->mmc)); + } + + host->cdiv = div; +@@ -1492,6 +1500,14 @@ static void bcm2835_sdhost_request(struct mmc_host *mmc, struct mmc_request *mrq + cmd->opcode, cmd->arg, cmd->flags); + } + ++ /* Reset the error statuses in case this is a retry */ ++ if (mrq->cmd) ++ mrq->cmd->error = 0; ++ if (mrq->data) ++ mrq->data->error = 0; ++ if (mrq->stop) ++ mrq->stop->error = 0; ++ + if (mrq->data && !is_power_of_2(mrq->data->blksz)) { + pr_err("%s: unsupported block size (%d bytes)\n", + mmc_hostname(mmc), mrq->data->blksz); +@@ -1613,21 +1629,16 @@ static void bcm2835_sdhost_tasklet_finish(unsigned long param) + + /* Drop the overclock after any data corruption, or after any + error overclocked */ +- if (mrq->data && (mrq->data->error == -EILSEQ)) +- host->reduce_overclock = 1; +- else if (host->overclock) { +- /* Convert timeout errors while overclocked to data errors, +- because the system recovers better. */ +- if (mrq->cmd && mrq->cmd->error) { +- host->reduce_overclock = 1; +- if (mrq->cmd->error == -ETIMEDOUT) +- mrq->cmd->error = -EILSEQ; +- } +- +- if (mrq->data && mrq->data->error) { +- host->reduce_overclock = 1; +- if (mrq->data->error == -ETIMEDOUT) +- mrq->data->error = -EILSEQ; ++ if (host->overclock) { ++ if ((mrq->cmd && mrq->cmd->error) || ++ (mrq->data && mrq->data->error) || ++ (mrq->stop && mrq->stop->error)) { ++ host->overclock_50--; ++ pr_warn("%s: reducing overclock due to errors\n", ++ mmc_hostname(host->mmc)); ++ bcm2835_sdhost_set_clock(host,50*MHZ); ++ mrq->cmd->error = -EILSEQ; ++ mrq->cmd->retries = 1; + } + } + +@@ -1769,6 +1780,7 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) + host = mmc_priv(mmc); + host->mmc = mmc; + host->pio_timeout = msecs_to_jiffies(500); ++ host->max_delay = 1; /* Warn if over 1ms */ + spin_lock_init(&host->lock); + + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + +From 3d5ba5c480137b87aaee59c14f8e486e747cd450 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 30 Jun 2015 10:28:59 +0100 +Subject: [PATCH 094/105] i2c-bcm2708: Increase timeouts to allow larger + transfers + +Use the timeout value provided by the I2C_TIMEOUT ioctl when waiting +for completion. The default timeout is 1 second. + +See: https://github.com/raspberrypi/linux/issues/260 +--- + drivers/i2c/busses/i2c-bcm2708.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c +index 7a24fbe..8b8762d 100644 +--- a/drivers/i2c/busses/i2c-bcm2708.c ++++ b/drivers/i2c/busses/i2c-bcm2708.c +@@ -67,10 +67,9 @@ + #define BSC_S_DONE 0x00000002 + #define BSC_S_TA 0x00000001 + +-#define I2C_TIMEOUT_MS 150 +-#define I2C_WAIT_LOOP_COUNT 40 ++#define I2C_WAIT_LOOP_COUNT 200 + +-#define DRV_NAME "bcm2708_i2c" ++#define DRV_NAME "bcm2708_i2c" + + static unsigned int baudrate = CONFIG_I2C_BCM2708_BAUDRATE; + module_param(baudrate, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); +@@ -305,7 +304,7 @@ static int bcm2708_i2c_master_xfer(struct i2c_adapter *adap, + goto error_timeout; + } + +- ret = wait_for_completion_timeout(&bi->done, msecs_to_jiffies(I2C_TIMEOUT_MS)); ++ ret = wait_for_completion_timeout(&bi->done, adap->timeout); + if (ret == 0) { + dev_err(&adap->dev, "transfer timed out\n"); + goto error_timeout; + +From 31a5408b0734bc64969ab91be9cb3c1d898d655a Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 30 Jun 2015 10:33:52 +0100 +Subject: [PATCH 095/105] spi-bcm2708: Increase timeout from 150ms to 1s + +See: https://github.com/raspberrypi/linux/issues/260 +--- + drivers/spi/spi-bcm2708.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/spi/spi-bcm2708.c b/drivers/spi/spi-bcm2708.c +index 041b5e2..5c0214e 100644 +--- a/drivers/spi/spi-bcm2708.c ++++ b/drivers/spi/spi-bcm2708.c +@@ -70,9 +70,9 @@ + #define SPI_CS_CS_10 0x00000002 + #define SPI_CS_CS_01 0x00000001 + +-#define SPI_TIMEOUT_MS 150 ++#define SPI_TIMEOUT_MS 1000 + +-#define DRV_NAME "bcm2708_spi" ++#define DRV_NAME "bcm2708_spi" + + struct bcm2708_spi { + spinlock_t lock; + +From c66c0c2993daff0c44d7daae71421b1404f92233 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 15 Jun 2015 09:59:38 +0100 +Subject: [PATCH 096/105] bcm2708-spi: Don't use static pin configuration with + DT + +Also remove superfluous error checking - the SPI framework ensures the +validity of the chip_select value. +--- + drivers/spi/spi-bcm2708.c | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/drivers/spi/spi-bcm2708.c b/drivers/spi/spi-bcm2708.c +index 5c0214e..781c747 100644 +--- a/drivers/spi/spi-bcm2708.c ++++ b/drivers/spi/spi-bcm2708.c +@@ -386,14 +386,6 @@ static int bcm2708_spi_setup(struct spi_device *spi) + if (bs->stopping) + return -ESHUTDOWN; + +- if (!(spi->mode & SPI_NO_CS) && +- (spi->chip_select > spi->master->num_chipselect)) { +- dev_dbg(&spi->dev, +- "setup: invalid chipselect %u (%u defined)\n", +- spi->chip_select, spi->master->num_chipselect); +- return -EINVAL; +- } +- + state = spi->controller_state; + if (!state) { + state = kzalloc(sizeof(*state), GFP_KERNEL); +@@ -496,7 +488,8 @@ static int bcm2708_spi_probe(struct platform_device *pdev) + return PTR_ERR(clk); + } + +- bcm2708_init_pinmode(); ++ if (!pdev->dev.of_node) ++ bcm2708_init_pinmode(); + + master = spi_alloc_master(&pdev->dev, sizeof(*bs)); + if (!master) { + +From fb8c469783f4521176bebb9de94b6b456b4c35bb Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 15 Jun 2015 10:10:59 +0100 +Subject: [PATCH 097/105] bcm2708-i2s: Don't use static pin configuration with + DT + +--- + sound/soc/bcm/bcm2708-i2s.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/bcm/bcm2708-i2s.c b/sound/soc/bcm/bcm2708-i2s.c +index a515992..5e93cd6 100644 +--- a/sound/soc/bcm/bcm2708-i2s.c ++++ b/sound/soc/bcm/bcm2708-i2s.c +@@ -409,8 +409,8 @@ static int bcm2708_i2s_hw_params(struct snd_pcm_substream *substream, + if (csreg & (BCM2708_I2S_TXON | BCM2708_I2S_RXON)) + return 0; + +- +- bcm2708_i2s_setup_gpio(); ++ if (!dev->dev->of_node) ++ bcm2708_i2s_setup_gpio(); + + /* + * Adjust the data length according to the format. + +From 68df7b46c42bd73c44ae405adbd12be35e308a2b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 30 Jun 2015 14:12:42 +0100 +Subject: [PATCH 098/105] serial: 8250: Don't crash when nr_uarts is 0 + +--- + drivers/tty/serial/8250/8250_core.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c +index 4506e40..f03a19a 100644 +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -3262,6 +3262,8 @@ static void __init serial8250_isa_init_ports(void) + + if (nr_uarts > UART_NR) + nr_uarts = UART_NR; ++ if (!nr_uarts) ++ return; + + for (i = 0; i < nr_uarts; i++) { + struct uart_8250_port *up = &serial8250_ports[i]; + +From 3ceec0b963f3001adaa523d65508cc54a6f93cd0 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 26 Jun 2015 08:50:11 +0100 +Subject: [PATCH 099/105] BCM270X_DT: Add overlay to enable uart1 + +N.B. The UART1 clock is derived from the core clock. The firmware +will update clock-frequency if core_freq is set, but be aware +that unless force_turbo=1 while overclocking then the baud rate +will vary with ARM activity. +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 1 + + arch/arm/boot/dts/bcm2708-rpi-b.dts | 1 + + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 1 + + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 1 + + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 8 ++++++ + arch/arm/boot/dts/overlays/uart1-overlay.dts | 38 ++++++++++++++++++++++++++++ + arch/arm/configs/bcm2709_defconfig | 2 +- + arch/arm/configs/bcmrpi_defconfig | 2 +- + 9 files changed, 53 insertions(+), 2 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/uart1-overlay.dts + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index e3ae8e6..3ad2e0d 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -103,6 +103,7 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ uart1_clkrate = <&uart1>,"clock-frequency:0"; + i2s = <&i2s>,"status"; + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 18ca7a2..65628e1 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -97,6 +97,7 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ uart1_clkrate = <&uart1>,"clock-frequency:0"; + i2s = <&i2s>,"status"; + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index bddc369..96d8b97 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -79,6 +79,7 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ uart1_clkrate = <&uart1>,"clock-frequency:0"; + i2s = <&i2s>,"status"; + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index 76d44a2..f25f0a2 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -103,6 +103,7 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ uart1_clkrate = <&uart1>,"clock-frequency:0"; + i2s = <&i2s>,"status"; + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index a1397c7..e91548c 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -42,6 +42,7 @@ dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += tinylcd35-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += uart1-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += w1-gpio-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += w1-gpio-pullup-overlay.dtb + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index ec762d2..d81d41a 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -489,6 +489,14 @@ Params: speed Display SPI bus speed + dtoverlay=tinylcd35,touch,touchgpio=3 + + ++Name: uart1 ++Info: Enable uart1 in place of uart0 ++Load: dtoverlay=uart1,= ++Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default 14) ++ ++ rxd1_pin GPIO pin for RXD1 (15, 33 or 41 - default 15) ++ ++ + Name: w1-gpio + Info: Configures the w1-gpio Onewire interface module. + Use this overlay if you *don't* need a GPIO to drive an external pullup. +diff --git a/arch/arm/boot/dts/overlays/uart1-overlay.dts b/arch/arm/boot/dts/overlays/uart1-overlay.dts +new file mode 100644 +index 0000000..fa73e1f +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/uart1-overlay.dts +@@ -0,0 +1,38 @@ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&uart1>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ uart1_pins: uart1_pins { ++ brcm,pins = <14 15>; ++ brcm,function = <2>; /* alt5 */ ++ brcm,pull = <0 2>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "/chosen"; ++ __overlay__ { ++ bootargs = "8250.nr_uarts=1"; ++ }; ++ }; ++ ++ __overrides__ { ++ txd1_pin = <&uart1_pins>,"brcm,pins:0"; ++ rxd1_pin = <&uart1_pins>,"brcm,pins:4"; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 46d56d7..8a240fd 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -562,7 +562,7 @@ CONFIG_SERIAL_8250=y + CONFIG_SERIAL_8250_CONSOLE=y + # CONFIG_SERIAL_8250_DMA is not set + CONFIG_SERIAL_8250_NR_UARTS=1 +-CONFIG_SERIAL_8250_RUNTIME_UARTS=1 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=0 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y + CONFIG_SERIAL_OF_PLATFORM=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index e757db6..363c894 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -555,7 +555,7 @@ CONFIG_SERIAL_8250=y + CONFIG_SERIAL_8250_CONSOLE=y + # CONFIG_SERIAL_8250_DMA is not set + CONFIG_SERIAL_8250_NR_UARTS=1 +-CONFIG_SERIAL_8250_RUNTIME_UARTS=1 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=0 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y + CONFIG_SERIAL_OF_PLATFORM=y + +From 0365608651a901ee0b84351ed8ec9b7f0cdfd986 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 24 Jun 2015 14:10:44 +0100 +Subject: [PATCH 100/105] spi-bcm2835: Support pin groups other than 7-11 + +The spi-bcm2835 driver automatically uses GPIO chip-selects due to +some unreliability of the native ones. In doing so it chooses the +same pins as the native chip-selects would use, but the existing +code always uses pins 7 and 8, wherever the SPI function is mapped. + +Search the pinctrl group assigned to the driver for pins that +correspond to native chip-selects, and use those for GPIO chip- +selects. + +Signed-off-by: Phil Elwell +--- + drivers/spi/spi-bcm2835.c | 45 +++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 37 insertions(+), 8 deletions(-) + +diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c +index 37875cf..55e81c2 100644 +--- a/drivers/spi/spi-bcm2835.c ++++ b/drivers/spi/spi-bcm2835.c +@@ -359,6 +359,8 @@ static int bcm2835_spi_setup(struct spi_device *spi) + { + int err; + struct gpio_chip *chip; ++ struct device_node *pins; ++ u32 pingroup_index; + /* + * sanity checking the native-chipselects + */ +@@ -375,15 +377,42 @@ static int bcm2835_spi_setup(struct spi_device *spi) + "setup: only two native chip-selects are supported\n"); + return -EINVAL; + } +- /* now translate native cs to GPIO */ +- +- /* get the gpio chip for the base */ +- chip = gpiochip_find("pinctrl-bcm2835", chip_match_name); +- if (!chip) +- return 0; + +- /* and calculate the real CS */ +- spi->cs_gpio = chip->base + 8 - spi->chip_select; ++ /* now translate native cs to GPIO */ ++ /* first look for chip select pins in the devices pin groups */ ++ for (pingroup_index = 0; ++ (pins = of_parse_phandle(spi->master->dev.of_node, ++ "pinctrl-0", ++ pingroup_index)) != 0; ++ pingroup_index++) { ++ u32 pin; ++ u32 pin_index; ++ for (pin_index = 0; ++ of_property_read_u32_index(pins, ++ "brcm,pins", ++ pin_index, ++ &pin) == 0; ++ pin_index++) { ++ if (((spi->chip_select == 0) && ++ ((pin == 8) || (pin == 36) || (pin == 46))) || ++ ((spi->chip_select == 1) && ++ ((pin == 7) || (pin == 35)))) { ++ spi->cs_gpio = pin; ++ break; ++ } ++ } ++ of_node_put(pins); ++ } ++ /* if that fails, assume GPIOs 7-11 are used */ ++ if (!gpio_is_valid(spi->cs_gpio) ) { ++ /* get the gpio chip for the base */ ++ chip = gpiochip_find("pinctrl-bcm2835", chip_match_name); ++ if (!chip) ++ return 0; ++ ++ /* and calculate the real CS */ ++ spi->cs_gpio = chip->base + 8 - spi->chip_select; ++ } + + /* and set up the "mode" and level */ + dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", + +From 1674fcd926873998471f71ad88306d47bc99862b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 30 Jun 2015 17:37:38 +0100 +Subject: [PATCH 101/105] BCM270X_DT: Change pio_limit of sdhost driver to 1 + +--- + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +index 897204a..2da14a4 100644 +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -22,7 +22,7 @@ + dma-names = "tx", "rx"; + brcm,delay-after-stop = <0>; + brcm,overclock-50 = <0>; +- brcm,pio-limit = <2>; ++ brcm,pio-limit = <1>; + status = "okay"; + }; + }; + +From f72606ab1e40707a3dc9243e0d0b87b98654e02b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 1 Jul 2015 12:51:52 +0100 +Subject: [PATCH 102/105] bcm2835-sdhost: Clear HBLC for PIO mode + +Also update pio_limit default in overlay README. +--- + arch/arm/boot/dts/overlays/README | 2 +- + drivers/mmc/host/bcm2835-sdhost.c | 3 +-- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index d81d41a..980d358 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -441,7 +441,7 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework + force_pio Disable DMA support (default off) + + pio_limit Number of blocks above which to use DMA +- (default 2) ++ (default 1) + + debug Enable debug output (default off) + +diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c +index a03db06..d65870a 100644 +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -699,8 +699,7 @@ static void bcm2835_sdhost_prepare_data(struct bcm2835_host *host, struct mmc_co + bcm2835_sdhost_set_transfer_irqs(host); + + bcm2835_sdhost_write(host, data->blksz, SDHBCT); +- if (host->use_dma) +- bcm2835_sdhost_write(host, data->blocks, SDHBLC); ++ bcm2835_sdhost_write(host, host->use_dma ? data->blocks : 0, SDHBLC); + + BUG_ON(!host->data); + } + +From 93e9bd0c71d224db35cc8019a1ebc16bf77f0fa2 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 3 Jul 2015 12:21:01 +0100 +Subject: [PATCH 103/105] BCM270X_DT: I2S needs function Alt2 + +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 2 +- + arch/arm/boot/dts/bcm2708-rpi-b.dts | 2 +- + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 2 +- + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index 3ad2e0d..562eb08 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -25,7 +25,7 @@ + + i2s_pins: i2s { + brcm,pins = <18 19 20 21>; +- brcm,function = <4>; /* alt0 */ ++ brcm,function = <6>; /* alt2 */ + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 65628e1..e2b1491 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -25,7 +25,7 @@ + + i2s_pins: i2s { + brcm,pins = <28 29 30 31>; +- brcm,function = <4>; /* alt0 */ ++ brcm,function = <6>; /* alt2 */ + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index 96d8b97..5e3db01 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -28,7 +28,7 @@ + + i2s_pins: i2s { + brcm,pins = <18 19 20 21>; +- brcm,function = <4>; /* alt0 */ ++ brcm,function = <6>; /* alt2 */ + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index f25f0a2..62d1c62 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -25,7 +25,7 @@ + + i2s_pins: i2s { + brcm,pins = <18 19 20 21>; +- brcm,function = <4>; /* alt0 */ ++ brcm,function = <6>; /* alt2 */ + }; + }; + + +From 5edaac580d81f7edd48afd1e8c296cdedd94cc7a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 26 Jun 2015 14:16:15 +0200 +Subject: [PATCH 104/105] configs: Incorporate v4.1 dependency changes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit 78e9b7de78bb53e8bc7f4c4a60ebacb250c0c190 added a +dependency on TI_ST instead of selecting it, disabling: +CONFIG_BT_WILINK=m +CONFIG_RADIO_WL128X=m + +Commit 652ccae5cc4e1305fb0a4619947f9ee89d8c7f5a added a +depency on ARM_CRYPTO, disabling: +CONFIG_CRYPTO_SHA*_ARM*=m +CONFIG_CRYPTO_AES_ARM*=m + +Signed-off-by: Noralf Trønnes +--- + arch/arm/configs/bcm2709_defconfig | 10 ++++++---- + arch/arm/configs/bcm2835_defconfig | 8 +++++--- + arch/arm/configs/bcmrpi_defconfig | 8 +++++--- + 3 files changed, 16 insertions(+), 10 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 8a240fd..ccfc14c 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -401,6 +401,7 @@ CONFIG_BLK_DEV_RAM=y + CONFIG_CDROM_PKTCDVD=m + CONFIG_ATA_OVER_ETH=m + CONFIG_EEPROM_AT24=m ++CONFIG_TI_ST=m + CONFIG_SCSI=y + # CONFIG_SCSI_PROC_FS is not set + CONFIG_BLK_DEV_SD=y +@@ -1100,6 +1101,7 @@ CONFIG_OCFS2_FS=m + CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m ++CONFIG_F2FS_FS=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m + CONFIG_QFMT_V2=m +@@ -1129,7 +1131,6 @@ CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y + CONFIG_SQUASHFS_XZ=y +-CONFIG_F2FS_FS=y + CONFIG_NFS_FS=y + CONFIG_NFS_V3_ACL=y + CONFIG_NFS_V4=y +@@ -1205,14 +1206,15 @@ CONFIG_CRYPTO_CBC=y + CONFIG_CRYPTO_CTS=m + CONFIG_CRYPTO_XTS=m + CONFIG_CRYPTO_XCBC=m +-CONFIG_CRYPTO_SHA1_ARM_NEON=m +-CONFIG_CRYPTO_SHA512_ARM_NEON=m + CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m +-CONFIG_CRYPTO_AES_ARM_BS=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y + # CONFIG_CRYPTO_ANSI_CPRNG is not set + # CONFIG_CRYPTO_HW is not set ++CONFIG_ARM_CRYPTO=y ++CONFIG_CRYPTO_SHA1_ARM_NEON=m ++CONFIG_CRYPTO_SHA512_ARM_NEON=m ++CONFIG_CRYPTO_AES_ARM_BS=m + CONFIG_CRC_ITU_T=y + CONFIG_LIBCRC32C=y +diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig +index 2e8a95a..47f2a6a 100644 +--- a/arch/arm/configs/bcm2835_defconfig ++++ b/arch/arm/configs/bcm2835_defconfig +@@ -402,6 +402,7 @@ CONFIG_BLK_DEV_RAM=y + CONFIG_CDROM_PKTCDVD=m + CONFIG_ATA_OVER_ETH=m + CONFIG_EEPROM_AT24=m ++CONFIG_TI_ST=m + CONFIG_SCSI=y + # CONFIG_SCSI_PROC_FS is not set + CONFIG_BLK_DEV_SD=y +@@ -1091,6 +1092,7 @@ CONFIG_OCFS2_FS=m + CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m ++CONFIG_F2FS_FS=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m + CONFIG_QFMT_V2=m +@@ -1120,7 +1122,6 @@ CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y + CONFIG_SQUASHFS_XZ=y +-CONFIG_F2FS_FS=y + CONFIG_NFS_FS=y + CONFIG_NFS_V3_ACL=y + CONFIG_NFS_V4=y +@@ -1208,15 +1209,16 @@ CONFIG_CRYPTO_CBC=y + CONFIG_CRYPTO_CTS=m + CONFIG_CRYPTO_XTS=m + CONFIG_CRYPTO_XCBC=m +-CONFIG_CRYPTO_SHA1_ARM=m + CONFIG_CRYPTO_SHA512=m + CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m +-CONFIG_CRYPTO_AES_ARM=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y + # CONFIG_CRYPTO_ANSI_CPRNG is not set + # CONFIG_CRYPTO_HW is not set ++CONFIG_ARM_CRYPTO=y ++CONFIG_CRYPTO_SHA1_ARM=m ++CONFIG_CRYPTO_AES_ARM=m + CONFIG_CRC_ITU_T=y + CONFIG_LIBCRC32C=y + # CONFIG_XZ_DEC_ARM is not set +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 363c894..80f84d7 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -394,6 +394,7 @@ CONFIG_BLK_DEV_RAM=y + CONFIG_CDROM_PKTCDVD=m + CONFIG_ATA_OVER_ETH=m + CONFIG_EEPROM_AT24=m ++CONFIG_TI_ST=m + CONFIG_SCSI=y + # CONFIG_SCSI_PROC_FS is not set + CONFIG_BLK_DEV_SD=y +@@ -1093,6 +1094,7 @@ CONFIG_OCFS2_FS=m + CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m ++CONFIG_F2FS_FS=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m + CONFIG_QFMT_V2=m +@@ -1122,7 +1124,6 @@ CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y + CONFIG_SQUASHFS_XZ=y +-CONFIG_F2FS_FS=y + CONFIG_NFS_FS=y + CONFIG_NFS_V3_ACL=y + CONFIG_NFS_V4=y +@@ -1200,14 +1201,15 @@ CONFIG_CRYPTO_CBC=y + CONFIG_CRYPTO_CTS=m + CONFIG_CRYPTO_XTS=m + CONFIG_CRYPTO_XCBC=m +-CONFIG_CRYPTO_SHA1_ARM=m + CONFIG_CRYPTO_SHA512=m + CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m +-CONFIG_CRYPTO_AES_ARM=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y + # CONFIG_CRYPTO_ANSI_CPRNG is not set + # CONFIG_CRYPTO_HW is not set ++CONFIG_ARM_CRYPTO=y ++CONFIG_CRYPTO_SHA1_ARM=m ++CONFIG_CRYPTO_AES_ARM=m + CONFIG_CRC_ITU_T=y + CONFIG_LIBCRC32C=y + +From 18f4efa3ad700a4caf72f45ff95d7acfb40f3255 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 3 Jul 2015 15:47:33 +0100 +Subject: [PATCH 105/105] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for + HifiBerry Digi) + +4.1 has split out support for the I2C and SPI variants, so it now +necessary to explicitly enable the I2C support. +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index ccfc14c..5ecd84f 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -823,6 +823,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m + CONFIG_SND_BCM2708_SOC_RPI_DAC=m + CONFIG_SND_BCM2708_SOC_RPI_PROTO=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m ++CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m + CONFIG_HIDRAW=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 80f84d7..14b91fdf 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -816,6 +816,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m + CONFIG_SND_BCM2708_SOC_RPI_DAC=m + CONFIG_SND_BCM2708_SOC_RPI_PROTO=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m ++CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m + CONFIG_HIDRAW=y diff --git a/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch b/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch index c60b9d9c25..e1ec4be1b1 100644 --- a/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch +++ b/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch @@ -1,7 +1,7 @@ -From 334f38e87d0f4d071929f26a73db4075f5a40a86 Mon Sep 17 00:00:00 2001 +From d4dbab9f0c3bc4ab02ba312ba0d4aa9f41371fdf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 01/51] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 01/58] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -25,10 +25,10 @@ index 2faceea..889d7a2 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 7ddf4d5ef049c6ab43814ea9946347fd8e13e36c Mon Sep 17 00:00:00 2001 +From 1ecf22c5b4c919e3aed5274c67f748bbae86fbf0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 03/51] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 03/58] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -51,10 +51,10 @@ index e22db7a..0120bd5 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 9d64e65d1de3cd2c18fdb95bc7d7825f42602ad9 Mon Sep 17 00:00:00 2001 +From ac054e5b5efd9ec9205598f9b7549a8e953272fd Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 04/51] Improved file buffering in CArchive +Subject: [PATCH 04/58] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -114,10 +114,10 @@ index 6ed0f8f..8506d95 100644 } else -From 11c32ec255761eb3763fa4b2bf7f4a261238e102 Mon Sep 17 00:00:00 2001 +From 1a7d63a938850a884f08bd3af66808bef91b7588 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH 05/51] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 05/58] [omxcodec] Don't force software codec with dvds --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ @@ -138,10 +138,10 @@ index 82b5baa..70b1ac3 100644 else if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) { -From 9a08c47d230a839bc32bf6c81c3d54bb8692b248 Mon Sep 17 00:00:00 2001 +From 47e9b3430cd67a4e9e17de65df96f9c0dbb7c39c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 06/51] filesystem: Make support of browsing into archives +Subject: [PATCH 06/58] filesystem: Make support of browsing into archives optional The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. @@ -159,7 +159,7 @@ We'll let people who don't use archives disable it manually 3 files changed, 18 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 97039ca..9614036 100644 +index ff32bfd..5345dc2 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16582,6 +16582,15 @@ msgstr "" @@ -224,10 +224,10 @@ index 5af92e7..568a1a8 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From 52ba2eb2daaeba3eaa7213b2f370f11b73ebdd51 Mon Sep 17 00:00:00 2001 +From e863fd0253902d92c56ed85e589bffadc98b245f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 08/51] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 08/58] [rbp] Make cachemembuffersize default depend on memory size --- @@ -329,10 +329,10 @@ index 2e3282c..d1606a2 100644 } -From b14ed34e6cf3a147e4e93161c60ff804b6a77286 Mon Sep 17 00:00:00 2001 +From 06bd0674846783738e6b81f351ba49bb633c473b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 10/51] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 10/58] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -354,10 +354,10 @@ index 4376463..fc4e5ea 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 975844c8114a270ab8c97925806b41a09600a90e Mon Sep 17 00:00:00 2001 +From c2b0eafa1ed07258aa09a24a443d4535db8b3a1e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 11/51] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 11/58] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -386,10 +386,10 @@ index bda7430..68fc647 100644 SetResolutionString(m_desktopRes); -From 873e875a8538a1c5219054f30a80d90877d0d301 Mon Sep 17 00:00:00 2001 +From 5f1821e4d8157a890c795744841dcb895a1349b4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 12/51] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 12/58] [dvdplayer/rbp] Add pi specific option to maintain vsync with pll adjustment New A/V sync option in settings/video/playback to do "Adjust PLL". @@ -414,7 +414,7 @@ Needed updated firmware 9 files changed, 91 insertions(+), 7 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 9614036..36b8c5d 100644 +index 5345dc2..6d08156 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -6321,7 +6321,22 @@ msgctxt "#13459" @@ -681,10 +681,10 @@ index 7df1bf7..732b69d 100644 float m_audioPlayCountMinimumPercent; bool m_dvdplayerIgnoreDTSinWAV; -From 0323acdf71a6bf8d66ff569403e8fc0412291325 Mon Sep 17 00:00:00 2001 +From 6ead5d132f5d43c6ea3063c5fcd1c7d3b23eca18 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 13/51] [audio] Add settings option to boost centre channel +Subject: [PATCH 13/58] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -702,7 +702,7 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 45 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 36b8c5d..c1148e8 100644 +index 6d08156..6e36b42 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16650,3 +16650,17 @@ msgctxt "#38006" @@ -772,7 +772,7 @@ index e4ddf9e..34d0152 100644 if (remapLayout) { diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index 7807149..759ba7b 100644 +index 78071493..759ba7b 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp @@ -164,6 +164,12 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d @@ -806,10 +806,10 @@ index f99c0e6..1911189 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 8dada388745328d01b186ede90c64be0b571a936 Mon Sep 17 00:00:00 2001 +From aca0d43f243143b6776e1cc8ef259197d2bee97a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 14/51] [rbp] Default extract thumbnails to false +Subject: [PATCH 14/58] [rbp] Default extract thumbnails to false It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. It genereates a lot of support issues. Best to default to disabled and let users enable it if they must @@ -839,10 +839,10 @@ index 50fe36a..a54a4c4 100644
-From cf3e013db35eda90e5e2f337d8355312ce0e5955 Mon Sep 17 00:00:00 2001 +From 35f0f171ab8a9c37b2ebb5aca81b2242834fda72 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH 19/51] [dvdplayer] Add lock for player creation +Subject: [PATCH 19/58] [dvdplayer] Add lock for player creation --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ @@ -878,7 +878,7 @@ index 70b1ac3..b41c8f0 100644 std::string retVal; diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index 2a4aea5..f74e71d 100644 +index ab6a228..32e76c1 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h @@ -557,4 +557,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer @@ -888,10 +888,10 @@ index 2a4aea5..f74e71d 100644 + CCriticalSection m_players_lock; }; -From 5d3ab1cf45b4eca6f524b4555e3f103e27467a49 Mon Sep 17 00:00:00 2001 +From 51e261109f6a8d1cb0e96bdaa56a01aa7077633f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 22:07:25 +0000 -Subject: [PATCH 20/51] [dvdplayervideo] Prod decoder when in stills mode +Subject: [PATCH 20/58] [dvdplayervideo] Prod decoder when in stills mode An asynchronous hardware decoder doesn't only produce output pictures when new packets arrive. In dvd stills mode give it a chance to return pictures that weren't ready when frame was decoded. @@ -900,7 +900,7 @@ In dvd stills mode give it a chance to return pictures that weren't ready when f 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 656c937..bdc3edb 100644 +index f1a7e60..9be8aae 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -314,7 +314,8 @@ void CDVDPlayerVideo::Process() @@ -968,10 +968,10 @@ index 656c937..bdc3edb 100644 if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) -From 25d43d2d6bdf9de85a30161aa1c7e0260b4de33b Mon Sep 17 00:00:00 2001 +From deb376b5dad3cef8f86cef69aab9a4280bac9b21 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH 21/51] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 21/58] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -994,10 +994,10 @@ index fcdd063..16f0c89 100644 } -From 126cddbf807d68c42e07d24c733d65abb687b500 Mon Sep 17 00:00:00 2001 +From 7351fa296cd1740f04c6c5a2047c11e3b607f700 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 22/51] logging: Add microsecond timer to log messages +Subject: [PATCH 22/58] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -1050,10 +1050,10 @@ index 3443f12..31c4a99 100644 levelNames[logLevel]) + strData; -From cfe6214efcc206c97cf8eb6b224c0a8d63981c77 Mon Sep 17 00:00:00 2001 +From c2bc1032b22f6214ffbbbecb29e3538f9790f016 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH 23/51] [rbp] hack: wait for splash to complete before changing +Subject: [PATCH 23/58] [rbp] hack: wait for splash to complete before changing hdmi mode --- @@ -1127,10 +1127,10 @@ index 68fc647..c80114e 100644 if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) -From 1610df489966e26604392af08d40a2a2eacad8db Mon Sep 17 00:00:00 2001 +From 58ed12b2f7dd77fc57b3ddbff8fbaa04a0172716 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH 24/51] Fix for UI not showing both extractflags and +Subject: [PATCH 24/58] Fix for UI not showing both extractflags and extractthumb --- @@ -1139,7 +1139,7 @@ Subject: [PATCH 24/51] Fix for UI not showing both extractflags and 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index b6b48b4..6c3a220 100644 +index 788a831..a794cd8 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -11015,7 +11015,7 @@ msgstr "" @@ -1194,10 +1194,10 @@ index 09c3d10..1059b09 100644 -From 07f3c28448d28cf7347394dca6e6a1faeaa7e3ec Mon Sep 17 00:00:00 2001 +From 6f0adae04039766326ebb5a735433dac07787a0f Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 25/51] Disable autoscrolling while on screensaver and while +Subject: [PATCH 25/58] Disable autoscrolling while on screensaver and while opening streams. --- @@ -1210,10 +1210,10 @@ Subject: [PATCH 25/51] Disable autoscrolling while on screensaver and while 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index ffc7ad3..f35871a 100644 +index 697f278..a2a7fd2 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -4993,3 +4993,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const +@@ -4996,3 +4996,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const return false; } @@ -1328,10 +1328,10 @@ index 0d5b3f7..6d23024 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 5acd81c2d630bbe83763c5463cc26aae862a87b4 Mon Sep 17 00:00:00 2001 +From 9b85c054f66cb5efde618d34198bd533f16f26d5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH 26/51] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 26/58] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -1426,10 +1426,10 @@ index ab298b2..10c5ee0 100644 } catch(...) { -From 80367ca635d7fd6ba3e278fe4c4f2a9275f5c358 Mon Sep 17 00:00:00 2001 +From cb5bcc331593fa2d2088c0a0f8f72aefce1030e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 15 Feb 2015 14:06:12 +0000 -Subject: [PATCH 27/51] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 27/58] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 7 +++++++ @@ -1461,10 +1461,10 @@ index 4c363cf..b90237b 100644 { // If dvd is an mpeg2 and hint.stills -From 959665eaf7160c8adb2d0f2e862e1e8ef5df2419 Mon Sep 17 00:00:00 2001 +From 3873604d5ef7443bdfc33603c979495fe8a0f17c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 31 Mar 2015 17:31:47 +0100 -Subject: [PATCH 28/51] [mmalrenderer] Add SetCodecControl function and prefer +Subject: [PATCH 28/58] [mmalrenderer] Add SetCodecControl function and prefer to return pictures when renderer is low (disabled) --- @@ -1535,10 +1535,10 @@ index 51a64d1..bde8c06 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_dec; -From aa0a393eb9fc52c4aa791042dd521d16f8852567 Mon Sep 17 00:00:00 2001 +From 8f077b7937e519bbe44a02c3559808672696903e Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH 29/51] Load OSD dialogs on startup. +Subject: [PATCH 29/58] Load OSD dialogs on startup. Fixes skipped frames the first time they're loaded in memory on less powered devices, like a Raspberry Pi, when using DVDPlayer. @@ -1633,10 +1633,10 @@ index 9f25fa5..3ece45b 100644 CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From cd731d75ce08cb29dc73de665830a4597db691a9 Mon Sep 17 00:00:00 2001 +From 2c96de41d5df402113fb6f675c5c6766ad48b267 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 7 Mar 2015 22:46:21 +0000 -Subject: [PATCH 30/51] configure: Add raspberry-pi2 platform +Subject: [PATCH 30/58] configure: Add raspberry-pi2 platform --- configure.ac | 14 +++++++-- @@ -1648,7 +1648,7 @@ Subject: [PATCH 30/51] configure: Add raspberry-pi2 platform 6 files changed, 44 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac -index 96be96f..7e924a2 100644 +index 71883d2..6beec97 100644 --- a/configure.ac +++ b/configure.ac @@ -744,8 +744,17 @@ case $use_platform in @@ -1810,449 +1810,10 @@ index cdc2fe4..379bd1d 100644 set(CMAKE_SYSTEM_NAME Linux) endif() -From a6e8bc8e2784775522dce233f0f9dc0bde7fca44 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 31/51] [omxplayer] Don't propagate 3d flags based on supported - 3d modes - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 +++-------------------------- - 1 file changed, 3 insertions(+), 26 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 212a89b..dd509ea 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -752,40 +752,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; - uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; - -- unsigned flags = 0; - ERenderFormat format = RENDER_FMT_BYPASS; - -+ /* figure out steremode expected based on user settings and hints */ -+ unsigned flags = GetStereoModeFlags(GetStereoMode()); -+ - if(m_bAllowFullscreen) - { - flags |= CONF_FLAGS_FULLSCREEN; - m_bAllowFullscreen = false; // only allow on first configure - } - -- flags |= GetStereoModeFlags(GetStereoMode()); -- -- if(flags & CONF_FLAGS_STEREO_MODE_SBS) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) -- CLog::Log(LOGNOTICE, "3DSBS movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); -- } -- } -- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) -- CLog::Log(LOGNOTICE, "3DTB movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); -- } -- } -- else -- CLog::Log(LOGNOTICE, "not a 3D movie"); -- - unsigned int iDisplayWidth = width; - unsigned int iDisplayHeight = height; - - -From 46641c44cbf4832f8dc2e09de13c90ec263c7eb0 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 32/51] [graphics] Allow switching to a more suitable 3D - resolution - ---- - xbmc/guilib/GraphicContext.cpp | 40 +++++++++++++++++++++++++++++++++++++++- - xbmc/guilib/GraphicContext.h | 1 + - 2 files changed, 40 insertions(+), 1 deletion(-) - -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index bd7dff9..ed7316a 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -32,6 +32,7 @@ - #include "input/InputManager.h" - #include "GUIWindowManager.h" - #include "video/VideoReferenceClock.h" -+#include - - using namespace std; - -@@ -499,6 +500,43 @@ RESOLUTION CGraphicContext::GetVideoResolution() const - return m_Resolution; - } - -+RESOLUTION CGraphicContext::Get3DVideoResolution(RESOLUTION resolution, RENDER_STEREO_MODE mode) const -+{ -+ RESOLUTION best = resolution; -+ RESOLUTION_INFO curr = CDisplaySettings::Get().GetResolutionInfo(best); -+ // Find closest refresh rate -+ for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) -+ { -+ const RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo((RESOLUTION)i); -+ -+ //discard resolutions that are not the same width and height (and interlaced/3D flags) -+ //or have a too low refreshrate -+ if (info.iScreenWidth != curr.iScreenWidth -+ || info.iScreenHeight != curr.iScreenHeight -+ || info.iScreen != curr.iScreen -+ || (info.dwFlags & D3DPRESENTFLAG_INTERLACED) != (curr.dwFlags & D3DPRESENTFLAG_INTERLACED) -+ || fabs(info.fRefreshRate - curr.fRefreshRate) >= FLT_EPSILON) -+ continue; -+ -+ if (mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ else if (mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && info.dwFlags & D3DPRESENTFLAG_MODE3DTB) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ else if ((mode == RENDER_STEREO_MODE_OFF || mode == RENDER_STEREO_MODE_MONO) && !(info.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ } -+ return best; -+} -+ - void CGraphicContext::ResetOverscan(RESOLUTION_INFO &res) - { - res.Overscan.left = 0; -@@ -1042,7 +1080,7 @@ void CGraphicContext::Flip(const CDirtyRegionList& dirty) - if(m_stereoMode != m_nextStereoMode) - { - m_stereoMode = m_nextStereoMode; -- SetVideoResolution(GetVideoResolution(), true); -+ SetVideoResolution(Get3DVideoResolution(m_Resolution, m_stereoMode), true); - g_windowManager.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_RENDERER_RESET); - } - } -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index a8fd03e..8501e58 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -108,6 +108,7 @@ class CGraphicContext : public CCriticalSection, - bool IsValidResolution(RESOLUTION res); - void SetVideoResolution(RESOLUTION res, bool forceUpdate = false); - RESOLUTION GetVideoResolution() const; -+ RESOLUTION Get3DVideoResolution(RESOLUTION resolution, RENDER_STEREO_MODE mode) const; - void ResetOverscan(RESOLUTION res, OVERSCAN &overscan); - void ResetOverscan(RESOLUTION_INFO &resinfo); - void ResetScreenParameters(RESOLUTION res); - -From 55a4a727c1c8d0ca28deb1a8ca2c6ffa6a4eb0aa Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 33/51] [3D] Support switching to 3D resolutions - -Include matching 3D flags (SBS/TAB) in the score of a resolution to switch to, to enable switching to 3d modes. -Also remove the old code that treated 3D modes differently when assigning a score. ---- - xbmc/cores/VideoRenderers/BaseRenderer.cpp | 47 +++++++++++------------------- - 1 file changed, 17 insertions(+), 30 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index bfafab7..84e6261 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -@@ -222,10 +222,14 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RESOLUTION current, float& weight) - { - RESOLUTION_INFO curr = g_graphicsContext.GetResInfo(current); -+ unsigned int stereo_mode = CONF_FLAGS_STEREO_MODE_MASK(m_iFlags); - - float fRefreshRate = fps; - -- float last_diff = fRefreshRate; -+ int c_weight = MathUtils::round_int(RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -+ if (!(stereo_mode == CONF_FLAGS_STEREO_MODE_SBS) != !(curr.dwFlags & D3DPRESENTFLAG_MODE3DSBS) || -+ !(stereo_mode == CONF_FLAGS_STEREO_MODE_TAB) != !(curr.dwFlags & D3DPRESENTFLAG_MODE3DTB)) -+ c_weight += 1000; - - // Find closest refresh rate - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) -@@ -241,40 +245,23 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES - || info.fRefreshRate < (fRefreshRate * multiplier / 1.001) - 0.001) - continue; - -- // For 3D choose the closest refresh rate -- if(CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -- { -- float diff = (info.fRefreshRate - fRefreshRate); -- if(diff < 0) -- diff *= -1.0f; -+ int i_weight = MathUtils::round_int(RefreshWeight(info.fRefreshRate, fRefreshRate * multiplier) * 1000.0); - -- if(diff < last_diff) -- { -- last_diff = diff; -- current = (RESOLUTION)i; -- curr = info; -- } -- } -- else -- { -- int c_weight = MathUtils::round_int(RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -- int i_weight = MathUtils::round_int(RefreshWeight(info.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -+ if (!(stereo_mode == CONF_FLAGS_STEREO_MODE_SBS) != !(info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) || -+ !(stereo_mode == CONF_FLAGS_STEREO_MODE_TAB) != !(info.dwFlags & D3DPRESENTFLAG_MODE3DTB)) -+ i_weight += 1000; - -- // Closer the better, prefer higher refresh rate if the same -- if ((i_weight < c_weight) -- || (i_weight == c_weight && info.fRefreshRate > curr.fRefreshRate)) -- { -- current = (RESOLUTION)i; -- curr = info; -- } -+ // Closer the better, prefer higher refresh rate if the same -+ if ((i_weight < c_weight) -+ || (i_weight == c_weight && info.fRefreshRate > curr.fRefreshRate)) -+ { -+ current = (RESOLUTION)i; -+ curr = info; -+ c_weight = i_weight; - } - } - -- // For 3D overwrite weight -- if(CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -- weight = 0; -- else -- weight = RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier); -+ weight = RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier); - - return current; - } - -From 568e84b69fc126735e0c9e298d3fa7d2eea0aae2 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 34/51] [graphics] Make pixel ratio for 3d modes consistent - -Note: Use the stored stereo flags from lists of resolutions. -Use current stereo mode for current resolution. ---- - xbmc/cores/VideoRenderers/BaseRenderer.cpp | 10 +++---- - xbmc/guilib/GraphicContext.cpp | 37 ++++++++++++------------- - xbmc/guilib/GraphicContext.h | 12 ++++++-- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 8 ------ - 4 files changed, 32 insertions(+), 35 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index 84e6261..f82f37f 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -@@ -119,7 +119,7 @@ bool CBaseRenderer::FindResolutionFromOverride(float fps, float& weight, bool fa - - for (size_t j = (int)RES_DESKTOP; j < CDisplaySettings::Get().ResolutionInfoSize(); j++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)j); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)j, g_graphicsContext.GetStereoMode((RESOLUTION)j)); - - if (info.iScreenWidth == curr.iScreenWidth - && info.iScreenHeight == curr.iScreenHeight -@@ -179,7 +179,7 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - //get the resolution with the refreshrate closest to 60 hertz - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - if (MathUtils::round_int(info.fRefreshRate) == 60 - && info.iScreenWidth == curr.iScreenWidth -@@ -200,7 +200,7 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - CLog::Log(LOGDEBUG, "60 hertz refreshrate not available, choosing highest"); - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - if (info.fRefreshRate > curr.fRefreshRate - && info.iScreenWidth == curr.iScreenWidth -@@ -234,14 +234,14 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES - // Find closest refresh rate - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- const RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ const RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - //discard resolutions that are not the same width and height (and interlaced/3D flags) - //or have a too low refreshrate - if (info.iScreenWidth != curr.iScreenWidth - || info.iScreenHeight != curr.iScreenHeight - || info.iScreen != curr.iScreen -- || (info.dwFlags & D3DPRESENTFLAG_MODEMASK) != (curr.dwFlags & D3DPRESENTFLAG_MODEMASK) -+ || (info.dwFlags & D3DPRESENTFLAG_INTERLACED) != (curr.dwFlags & D3DPRESENTFLAG_INTERLACED) - || info.fRefreshRate < (fRefreshRate * multiplier / 1.001) - 0.001) - continue; - -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index ed7316a..f591b9c 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -746,32 +746,33 @@ void CGraphicContext::ApplyStateBlock() - g_Windowing.ApplyStateBlock(); - } - --const RESOLUTION_INFO CGraphicContext::GetResInfo(RESOLUTION res) const -+RENDER_STEREO_MODE CGraphicContext::GetStereoMode(RESOLUTION res) const - { - RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo(res); -+ return (info.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? RENDER_STEREO_MODE_SPLIT_HORIZONTAL : -+ (info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? RENDER_STEREO_MODE_SPLIT_VERTICAL : RENDER_STEREO_MODE_OFF; -+} - -- if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -+const RESOLUTION_INFO CGraphicContext::GetResInfo(RESOLUTION res, RENDER_STEREO_MODE stereoMode) const -+{ -+ RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo(res); -+ -+ if(stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) - { -- if((info.dwFlags & D3DPRESENTFLAG_MODE3DTB) == 0) -- { -- info.fPixelRatio /= 2; -- info.iBlanking = 0; -- info.dwFlags |= D3DPRESENTFLAG_MODE3DTB; -- } -+ info.fPixelRatio /= 2; -+ info.iBlanking = 0; -+ info.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - info.iHeight = (info.iHeight - info.iBlanking) / 2; - info.Overscan.top /= 2; - info.Overscan.bottom = (info.Overscan.bottom - info.iBlanking) / 2; - info.iSubtitles = (info.iSubtitles - info.iBlanking) / 2; - } - -- if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -+ if(stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) - { -- if((info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) == 0) -- { -- info.fPixelRatio *= 2; -- info.iBlanking = 0; -- info.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -- } -+ info.fPixelRatio *= 2; -+ info.iBlanking = 0; -+ info.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; - info.iWidth = (info.iWidth - info.iBlanking) / 2; - info.Overscan.left /= 2; - info.Overscan.right = (info.Overscan.right - info.iBlanking) / 2; -@@ -795,16 +796,14 @@ void CGraphicContext::SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info) - if(info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) - { - curr.Overscan.right = info.Overscan.right * 2 + info.iBlanking; -- if((curr.dwFlags & D3DPRESENTFLAG_MODE3DSBS) == 0) -- curr.fPixelRatio /= 2.0; -+ curr.fPixelRatio /= 2.0; - } - - if(info.dwFlags & D3DPRESENTFLAG_MODE3DTB) - { - curr.Overscan.bottom = info.Overscan.bottom * 2 + info.iBlanking; - curr.iSubtitles = info.iSubtitles * 2 + info.iBlanking; -- if((curr.dwFlags & D3DPRESENTFLAG_MODE3DTB) == 0) -- curr.fPixelRatio *= 2.0; -+ curr.fPixelRatio *= 2.0; - } - } - -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index 8501e58..0c53cae 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -120,11 +120,15 @@ class CGraphicContext : public CCriticalSection, - void GetAllowedResolutions(std::vector &res); - - // output scaling -+ const RESOLUTION_INFO GetResInfo(RESOLUTION res) const -+ { -+ return GetResInfo(res, GetStereoMode()); -+ } - const RESOLUTION_INFO GetResInfo() const - { - return GetResInfo(m_Resolution); - } -- const RESOLUTION_INFO GetResInfo(RESOLUTION res) const; -+ const RESOLUTION_INFO GetResInfo(RESOLUTION res, RENDER_STEREO_MODE stereo_mode) const; - void SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info); - - /* \brief Get UI scaling information from a given resolution to the screen resolution. -@@ -161,9 +165,11 @@ class CGraphicContext : public CCriticalSection, - void RestoreOrigin(); - void SetCameraPosition(const CPoint &camera); - void SetStereoView(RENDER_STEREO_VIEW view); -- RENDER_STEREO_VIEW GetStereoView() { return m_stereoView; } -+ RENDER_STEREO_VIEW GetStereoView() const { return m_stereoView; } - void SetStereoMode(RENDER_STEREO_MODE mode) { m_nextStereoMode = mode; } -- RENDER_STEREO_MODE GetStereoMode() { return m_stereoMode; } -+ RENDER_STEREO_MODE GetStereoMode() const { return m_stereoMode; } -+ RENDER_STEREO_MODE GetStereoMode(RESOLUTION res) const; -+ - void RestoreCameraPosition(); - /*! \brief Set a region in which to clip all rendering - Anything that is rendered after setting a clip region will be clipped so that no part renders -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index c80114e..80c05d2 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -499,15 +499,9 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); - // Also add 3D flags - if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) -- { - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -- m_desktopRes.fPixelRatio *= 2.0; -- } - else if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_TB_HALF) -- { - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; -- m_desktopRes.fPixelRatio *= 0.5; -- } - HDMI_PROPERTY_PARAM_T property; - property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; - vc_tv_hdmi_get_property(&property); -@@ -650,7 +644,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - RESOLUTION_INFO res2 = res; - res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; - res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); -- res2.fPixelRatio *= 2.0f; - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); -@@ -666,7 +659,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - RESOLUTION_INFO res2 = res; - res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); -- res2.fPixelRatio *= 0.5f; - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); - -From 0c9da02efd32493162bbe0080ce08fc75d024ad2 Mon Sep 17 00:00:00 2001 +From ecf7d1b7364dd7cb121825168aa51a6b14946614 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 10 Mar 2015 17:05:18 +0000 -Subject: [PATCH 35/51] [players] Add settings option to enable MVC support +Subject: [PATCH 31/58] [players] Add settings option to enable MVC support --- addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ @@ -2262,7 +1823,7 @@ Subject: [PATCH 35/51] [players] Add settings option to enable MVC support 4 files changed, 27 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 6c3a220..f5b7c42 100644 +index a794cd8..acb6372 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16680,6 +16680,16 @@ msgctxt "#38052" @@ -2333,10 +1894,10 @@ index e4f6d86..5d324f4 100644 case AV_CODEC_ID_MPEG4: // (role name) video_decoder.mpeg4 -From 397a5d0b70abe0922387a0afd8beb4842a56e9b0 Mon Sep 17 00:00:00 2001 +From 7c831c1cf47b62ee6ea8d57457b4b5ee35f29882 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Mar 2015 12:38:08 +0000 -Subject: [PATCH 36/51] [mmalrenderer] Switch to using transform flags for 3d +Subject: [PATCH 32/58] [mmalrenderer] Switch to using transform flags for 3d modes --- @@ -2350,7 +1911,7 @@ Subject: [PATCH 36/51] [mmalrenderer] Switch to using transform flags for 3d 7 files changed, 75 insertions(+), 130 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index f5b7c42..4848047 100644 +index acb6372..e1b691d 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16690,6 +16690,16 @@ msgctxt "#38111" @@ -2529,7 +2090,7 @@ index 9f1f803..6cde0c5 100644 + region.dest_rect.x, region.dest_rect.y, region.dest_rect.width, region.dest_rect.height, region.transform); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index dd509ea..adf9910 100644 +index 212a89b..ba17a46 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -649,9 +649,7 @@ int OMXPlayerVideo::GetFreeSpace() @@ -2687,7 +2248,7 @@ index d0634bb..86e94ce 100644 bool GetPlayerInfo(double &match, double &phase, double &pll); void SubmitEOS(); diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index 80c05d2..ae85484 100644 +index c80114e..3816b55 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -281,7 +281,9 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) @@ -2695,7 +2256,7 @@ index 80c05d2..ae85484 100644 HDMI_PROPERTY_PARAM_T property; property.property = HDMI_PROPERTY_3D_STRUCTURE; - if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) -+ if (CSettings::Get().GetBool("videoplayer.framepacking")) ++ if (CSettings::Get().GetBool("videoplayer.framepacking") && CSettings::Get().GetBool("videoplayer.supportmvc")) + property.param1 = HDMI_3D_FORMAT_FRAME_PACKING; + else if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) property.param1 = HDMI_3D_FORMAT_SBS_HALF; @@ -2716,10 +2277,10 @@ index 80c05d2..ae85484 100644 m_width, m_height, dst_rect.width, dst_rect.height, res.fRefreshRate, GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), (int)res.dwFlags, res.fPixelRatio); -From 180bad11da9d406158975f960198af9315170743 Mon Sep 17 00:00:00 2001 +From 404462b4bf655a3dd1f50f619162839f47f6efaa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH 39/51] [gui] Also limit GUI updates when in non full-screen +Subject: [PATCH 35/58] [gui] Also limit GUI updates when in non full-screen video mode --- @@ -2727,10 +2288,10 @@ Subject: [PATCH 39/51] [gui] Also limit GUI updates when in non full-screen 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index f35871a..dd58116 100644 +index a2a7fd2..95ec768 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2504,7 +2504,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2507,7 +2507,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) #if defined(TARGET_RASPBERRY_PI) || defined(HAS_IMXVPU) // This code reduces rendering fps of the GUI layer when playing videos in fullscreen mode // it makes only sense on architectures with multiple layers @@ -2739,7 +2300,7 @@ index f35871a..dd58116 100644 fps = CSettings::Get().GetInt("videoplayer.limitguiupdate"); #endif -@@ -2517,6 +2517,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2520,6 +2520,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) { if (!m_skipGuiRender) g_windowManager.Process(CTimeUtils::GetFrameTime()); @@ -2749,10 +2310,761 @@ index f35871a..dd58116 100644 g_windowManager.FrameMove(); } -From a00d53ea266d3513d4785ff730d4d3ed9aace2a4 Mon Sep 17 00:00:00 2001 +From f83aef5f43795b2e08d87dc1ba8723bd7c7f09a2 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:24:42 +0200 +Subject: [PATCH 36/58] Added some vc_tv_* functions that were missing in + DllBCM. + +--- + xbmc/linux/DllBCM.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/xbmc/linux/DllBCM.h b/xbmc/linux/DllBCM.h +index b92fdb8..9c7e293 100644 +--- a/xbmc/linux/DllBCM.h ++++ b/xbmc/linux/DllBCM.h +@@ -48,6 +48,9 @@ class DllBcmHostInterface + virtual void bcm_host_init() = 0; + virtual void bcm_host_deinit() = 0; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) = 0; ++ virtual int vc_tv_power_off() = 0; ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) = 0; ++ virtual int vc_tv_hdmi_power_on_preferred() = 0; + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) = 0; + virtual int vc_tv_hdmi_power_on_best_3d(uint32_t width, uint32_t height, uint32_t frame_rate, +@@ -92,6 +95,12 @@ class DllBcmHost : public DllDynamic, DllBcmHostInterface + { return ::bcm_host_deinit(); }; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) + { return ::graphics_get_display_size(display_number, width, height); }; ++ virtual int vc_tv_power_off() ++ { return ::vc_tv_power_off(); } ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) ++ { return ::vc_tv_sdtv_power_on(mode, options); } ++ virtual int vc_tv_hdmi_power_on_preferred() ++ { return ::vc_tv_hdmi_power_on_preferred(); } + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) + { return ::vc_tv_hdmi_power_on_best(width, height, frame_rate, scan_mode, match_flags); }; + +From f72df42ab7b2987446c08230917f59391f58c1ef Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:29:03 +0200 +Subject: [PATCH 37/58] Added private utility function to map a float display + aspect, to the respective SDTV_ASPECT_* enum value. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 3816b55..520bf95 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -60,7 +60,10 @@ + # define DLOG(fmt, args...) + #endif + ++#if defined(TARGET_RASPBERRY_PI) + static void SetResolutionString(RESOLUTION_INFO &res); ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect); ++#endif + + CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() + { +@@ -470,6 +473,25 @@ static void SetResolutionString(RESOLUTION_INFO &res) + res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "", + res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : ""); + } ++ ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect) ++{ ++ SDTV_ASPECT_T aspect; ++ const float delta = 1e-3; ++ if(fabs(get_display_aspect_ratio(SDTV_ASPECT_16_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_16_9; ++ } ++ else if(fabs(get_display_aspect_ratio(SDTV_ASPECT_14_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_14_9; ++ } ++ else ++ { ++ aspect = SDTV_ASPECT_4_3; ++ } ++ return aspect; ++} + #endif + + bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) + +From dbb24dacba5c40c0d536f4f71f5ac8b3b01fab41 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 19:50:58 +0200 +Subject: [PATCH 38/58] Changed SDTV resolutions to be treated similarly to + HDMI resolutions in SetNativeResolution. This means that the SDTV interface + is powered up and set to the right mode. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 36 ++++++++++++++++++++----- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h | 1 - + 2 files changed, 29 insertions(+), 8 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 520bf95..a1f67fd 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -274,7 +274,7 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + DestroyDispmaxWindow(); + +- if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + { + sem_init(&m_tv_synced, 0, 0); + m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); +@@ -330,6 +330,33 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + m_desktopRes = res; + } ++ else if(!GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ { ++ sem_init(&m_tv_synced, 0, 0); ++ m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); ++ ++ SDTV_OPTIONS_T options; ++ options.aspect = get_sdtv_aspect_from_display_aspect((float)res.iScreenWidth / (float)res.iScreenHeight); ++ ++ int success = m_DllBcmHost->vc_tv_sdtv_power_on((SDTV_MODE_T)GETFLAGS_MODE(res.dwFlags), &options); ++ ++ if (success == 0) ++ { ++ CLog::Log(LOGDEBUG, "EGL set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ ++ sem_wait(&m_tv_synced); ++ } ++ else ++ { ++ CLog::Log(LOGERROR, "EGL failed to set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ } ++ m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); ++ sem_destroy(&m_tv_synced); ++ ++ m_desktopRes = res; ++ } + + m_dispman_display = g_RBP.OpenDisplay(0); + +@@ -502,8 +529,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + if(!m_DllBcmHost) + return false; + +- m_fixedMode = false; +- + /* read initial desktop resolution before probe resolutions. + * probing will replace the desktop resolution when it finds the same one. + * we raplace it because probing will generate more detailed +@@ -552,7 +577,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iHeight = tv_state.display.sdtv.height; + m_desktopRes.iScreenWidth = tv_state.display.sdtv.width; + m_desktopRes.iScreenHeight= tv_state.display.sdtv.height; +- m_desktopRes.dwFlags = D3DPRESENTFLAG_INTERLACED; ++ m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1); + m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; + m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); + } +@@ -575,9 +600,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); + } + +- if(resolutions.size() < 2) +- m_fixedMode = true; +- + DLOG("CEGLNativeTypeRaspberryPI::ProbeResolutions\n"); + return true; + #else +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +index 59401f5..a0acb1a 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +@@ -59,7 +59,6 @@ class CEGLNativeTypeRaspberryPI : public CEGLNativeType + DISPMANX_ELEMENT_HANDLE_T m_dispman_element; + TV_GET_STATE_RESP_T m_tv_state; + sem_t m_tv_synced; +- bool m_fixedMode; + RESOLUTION_INFO m_desktopRes; + int m_width; + int m_height; + +From 06f189a4535e06b3d21f89e43b7caee7dedbe0d3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 17:11:09 +0100 +Subject: [PATCH 39/58] Revert "[3D] don't back out from 3D handling on + resolution changes if we're switching to a different 3D mode" + +This reverts commit 3c4c236a799dab8369b4bb74ff9993bc58a61a72. +--- + xbmc/guilib/GraphicContext.cpp | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp +index bd7dff9..fc4cc95 100644 +--- a/xbmc/guilib/GraphicContext.cpp ++++ b/xbmc/guilib/GraphicContext.cpp +@@ -436,17 +436,14 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat + + RENDER_STEREO_MODE stereo_mode = m_stereoMode; + +- // if the new resolution is an actual stereo mode, switch to that +- // if the old resolution was an actual stereo mode and renderer is still in old 3D mode, switch to no 3d mode ++ // if the new mode is an actual stereo mode, switch to that ++ // if the old mode was an actual stereo mode, switch to no 3d mode + if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DTB) + stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; + else if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DSBS) + stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) +- && m_stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- stereo_mode = RENDER_STEREO_MODE_OFF; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) +- && m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) ++ else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) != 0 ++ || (info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) != 0) + stereo_mode = RENDER_STEREO_MODE_OFF; + + if(stereo_mode != m_stereoMode) + +From 445dce97603e36fadc97ee3d479abe6f581f6a07 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 10 Jun 2015 20:42:03 +0100 +Subject: [PATCH 40/58] [rbp] Fix zoom modes with stereoscopic videos + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 12 ++++++++++-- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 12 ++++++++++-- + 2 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 6cde0c5..5fc68d2 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -621,9 +621,17 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect + CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); + + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) +- DestRect.x2 *= 2.0f; ++ { ++ float width = DestRect.x2 - DestRect.x1; ++ DestRect.x1 *= 2.0f; ++ DestRect.x2 = DestRect.x1 + 2.0f * width; ++ } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- DestRect.y2 *= 2.0f; ++ { ++ float height = DestRect.y2 - DestRect.y1; ++ DestRect.y1 *= 2.0f; ++ DestRect.y2 = DestRect.y1 + 2.0f * height; ++ } + + if (gui != display) + { +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index ba17a46..298eaff 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -690,9 +690,17 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); + + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) +- DestRect.x2 *= 2.0f; ++ { ++ float width = DestRect.x2 - DestRect.x1; ++ DestRect.x1 *= 2.0f; ++ DestRect.x2 = DestRect.x1 + 2.0f * width; ++ } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- DestRect.y2 *= 2.0f; ++ { ++ float height = DestRect.y2 - DestRect.y1; ++ DestRect.y1 *= 2.0f; ++ DestRect.y2 = DestRect.y1 + 2.0f * height; ++ } + + if (gui != display) + { + +From 84bc87e546d79c342b8a7c169f81e8521611cdb3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 17:42:03 +0100 +Subject: [PATCH 41/58] [WinSystemEGL] Remove unused Support3D function + +--- + xbmc/windowing/egl/WinSystemEGL.cpp | 29 ----------------------------- + xbmc/windowing/egl/WinSystemEGL.h | 1 - + 2 files changed, 30 deletions(-) + +diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp +index c3bdb6a..c43c4d0 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.cpp ++++ b/xbmc/windowing/egl/WinSystemEGL.cpp +@@ -531,35 +531,6 @@ EGLConfig CWinSystemEGL::GetEGLConfig() + return m_config; + } + +-// the logic in this function should match whether CBaseRenderer::FindClosestResolution picks a 3D mode +-bool CWinSystemEGL::Support3D(int width, int height, uint32_t mode) const +-{ +- RESOLUTION_INFO &curr = CDisplaySettings::Get().GetResolutionInfo(g_graphicsContext.GetVideoResolution()); +- +- // if we are using automatic hdmi mode switching +- if (CSettings::Get().GetInt("videoplayer.adjustrefreshrate") != ADJUST_REFRESHRATE_OFF) +- { +- int searchWidth = curr.iScreenWidth; +- int searchHeight = curr.iScreenHeight; +- +- // only search the custom resolutions +- for (unsigned int i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) +- { +- RESOLUTION_INFO res = CDisplaySettings::Get().GetResolutionInfo(i); +- if(res.iScreenWidth == searchWidth && res.iScreenHeight == searchHeight && (res.dwFlags & mode)) +- return true; +- } +- } +- // otherwise just consider current mode +- else +- { +- if (curr.dwFlags & mode) +- return true; +- } +- +- return false; +-} +- + bool CWinSystemEGL::ClampToGUIDisplayLimits(int &width, int &height) + { + width = width > m_nWidth ? m_nWidth : width; +diff --git a/xbmc/windowing/egl/WinSystemEGL.h b/xbmc/windowing/egl/WinSystemEGL.h +index 9d4baf6..1ec4225 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.h ++++ b/xbmc/windowing/egl/WinSystemEGL.h +@@ -59,7 +59,6 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES + virtual void Register(IDispResource *resource); + virtual void Unregister(IDispResource *resource); + +- virtual bool Support3D(int width, int height, uint32_t mode) const; + virtual bool ClampToGUIDisplayLimits(int &width, int &height); + + EGLConfig GetEGLConfig(); + +From 1597e6d82c667d55a763e965cb1e6448e0fbc01e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 16 Apr 2014 21:18:06 +0100 +Subject: [PATCH 42/58] [omxplayer] Don't propagate 3d flags based on supported + 3d modes + +--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 +++-------------------------- + 1 file changed, 3 insertions(+), 26 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 298eaff..3bf7c2e 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -726,40 +726,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f + uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; + uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; + +- unsigned flags = 0; + ERenderFormat format = RENDER_FMT_BYPASS; + ++ /* figure out steremode expected based on user settings and hints */ ++ unsigned flags = GetStereoModeFlags(GetStereoMode()); ++ + if(m_bAllowFullscreen) + { + flags |= CONF_FLAGS_FULLSCREEN; + m_bAllowFullscreen = false; // only allow on first configure + } + +- flags |= GetStereoModeFlags(GetStereoMode()); +- +- if(flags & CONF_FLAGS_STEREO_MODE_SBS) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) +- CLog::Log(LOGNOTICE, "3DSBS movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); +- } +- } +- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) +- CLog::Log(LOGNOTICE, "3DTB movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); +- } +- } +- else +- CLog::Log(LOGNOTICE, "not a 3D movie"); +- + unsigned int iDisplayWidth = width; + unsigned int iDisplayHeight = height; + + +From abadc22d9bed0fdf91c3a5be16dd07d8aa8d9f79 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 18:52:28 +0100 +Subject: [PATCH 43/58] [3d] Avoid switching stereo mode based on current + display mode + +--- + xbmc/guilib/GraphicContext.cpp | 21 --------------------- + 1 file changed, 21 deletions(-) + +diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp +index fc4cc95..e18232e 100644 +--- a/xbmc/guilib/GraphicContext.cpp ++++ b/xbmc/guilib/GraphicContext.cpp +@@ -432,27 +432,6 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat + Lock(); + + RESOLUTION_INFO info_org = CDisplaySettings::Get().GetResolutionInfo(res); +- RESOLUTION_INFO info_last = CDisplaySettings::Get().GetResolutionInfo(lastRes); +- +- RENDER_STEREO_MODE stereo_mode = m_stereoMode; +- +- // if the new mode is an actual stereo mode, switch to that +- // if the old mode was an actual stereo mode, switch to no 3d mode +- if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DTB) +- stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; +- else if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DSBS) +- stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) != 0 +- || (info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) != 0) +- stereo_mode = RENDER_STEREO_MODE_OFF; +- +- if(stereo_mode != m_stereoMode) +- { +- m_stereoView = RENDER_STEREO_VIEW_OFF; +- m_stereoMode = stereo_mode; +- m_nextStereoMode = stereo_mode; +- CSettings::Get().SetInt("videoscreen.stereoscopicmode", (int)m_stereoMode); +- } + + RESOLUTION_INFO info_mod = GetResInfo(res); + + +From ecb3cd064f5df496cbf685eec4c4d680c3c79704 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 3 Jun 2015 23:13:51 +0100 +Subject: [PATCH 44/58] [rpi] Always add desktop resolution to supported list + +There was an assumption that the desktop resolution would be in the probed list, but that is sometimes not the case. +We don't add interlaced resolutions to list, but they can be the preferred resolution read from edid. See: +http://openelec.tv/forum/124-raspberry-pi/77074-forcing-interlaced-output + +Also hotplug changes causing an edid reread may cause the supported modes to change (e.g. powering on receiver) +and it is possible the previous preferred mode is no longer there + +So ensure that desktop resolution is always added to list. Also handle the case where desktop resolution is invalid on launch +(e.g. hdmi output powered off) +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index a1f67fd..69ce9b7 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -190,7 +190,7 @@ int CEGLNativeTypeRaspberryPI::FindMatchingResolution(const RESOLUTION_INFO &res + for (int i = 0; i < (int)resolutions.size(); i++) + { + if(resolutions[i].iScreenWidth == res.iScreenWidth && resolutions[i].iScreenHeight == res.iScreenHeight && resolutions[i].fRefreshRate == res.fRefreshRate && +- (resolutions[i].dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) == (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) ++ (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) + { + return i; + } +@@ -206,8 +206,7 @@ int CEGLNativeTypeRaspberryPI::AddUniqueResolution(RESOLUTION_INFO &res, std::ve + int i = FindMatchingResolution(res, resolutions); + if (i>=0) + { // don't replace a progressive resolution with an interlaced one of same resolution +- if (!(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) +- resolutions[i] = res; ++ resolutions[i] = res; + } + else + { +@@ -569,7 +568,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + vc_tv_hdmi_get_property(&property); + m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; + } +- else // sdtv ++ else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv + { + m_desktopRes.iScreen = 0; + m_desktopRes.bFullScreen = true; +@@ -594,7 +593,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); + GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); + +- if(resolutions.size() == 0) + { + AddUniqueResolution(m_desktopRes, resolutions); + CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); +@@ -686,6 +684,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); + res.iSubtitles = (int)(0.965 * res.iHeight); + ++ if (!m_desktopRes.dwFlags && prefer_group == group && prefer_mode == tv->code) ++ m_desktopRes = res; ++ ++ if (res.dwFlags & D3DPRESENTFLAG_INTERLACED) ++ continue; ++ + AddUniqueResolution(res, resolutions); + CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, + tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); + +From 71f32189c08f3001e0a00f3d21d799eb7b0ac9ba Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 18:53:29 +0100 +Subject: [PATCH 45/58] [rbp] Drop reporting 3D modes and just use current + rendering mode to request 3D signalling + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 76 +++++-------------------- + 1 file changed, 15 insertions(+), 61 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 69ce9b7..25a97ad 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -28,6 +28,9 @@ + #include "linux/RBP.h" + #include "utils/StringUtils.h" + #include "settings/Settings.h" ++#include "guilib/GraphicContext.h" ++#include "guilib/StereoscopicsManager.h" ++#include "rendering/RenderSystem.h" + #include + + #ifndef __VIDEOCORE4__ +@@ -273,21 +276,22 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + DestroyDispmaxWindow(); + ++ RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); + if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + { + sem_init(&m_tv_synced, 0, 0); + m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); + +- if (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) ++ if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL || stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + { + /* inform TV of any 3D settings. Note this property just applies to next hdmi mode change, so no need to call for 2D modes */ + HDMI_PROPERTY_PARAM_T property; + property.property = HDMI_PROPERTY_3D_STRUCTURE; + if (CSettings::Get().GetBool("videoplayer.framepacking") && CSettings::Get().GetBool("videoplayer.supportmvc")) + property.param1 = HDMI_3D_FORMAT_FRAME_PACKING; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + property.param1 = HDMI_3D_FORMAT_SBS_HALF; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + property.param1 = HDMI_3D_FORMAT_TB_HALF; + else + property.param1 = HDMI_3D_FORMAT_NONE; +@@ -310,19 +314,17 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + if (success == 0) + { +- CLog::Log(LOGDEBUG, "EGL set HDMI mode (%d,%d)=%d%s%s\n", ++ CLog::Log(LOGDEBUG, "EGL set HDMI mode (%d,%d)=%d %s\n", + GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success, +- (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? " SBS":"", +- (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? " TB":""); ++ CStereoscopicsManager::Get().ConvertGuiStereoModeToString(stereo_mode)); + + sem_wait(&m_tv_synced); + } + else + { +- CLog::Log(LOGERROR, "EGL failed to set HDMI mode (%d,%d)=%d%s%s\n", ++ CLog::Log(LOGERROR, "EGL failed to set HDMI mode (%d,%d)=%d %s\n", + GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success, +- (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? " SBS":"", +- (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? " TB":""); ++ CStereoscopicsManager::Get().ConvertGuiStereoModeToString(stereo_mode)); + } + m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); + sem_destroy(&m_tv_synced); +@@ -385,9 +387,9 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + DISPMANX_TRANSFORM_T transform = DISPMANX_NO_ROTATE; + DISPMANX_UPDATE_HANDLE_T dispman_update = m_DllBcmHost->vc_dispmanx_update_start(0); + +- if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ++ if (stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + transform = DISPMANX_STEREOSCOPIC_SBS; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + transform = DISPMANX_STEREOSCOPIC_TB; + else + transform = DISPMANX_STEREOSCOPIC_MONO; +@@ -494,10 +496,8 @@ static void SetResolutionString(RESOLUTION_INFO &res) + res.iWidth = gui_width; + res.iHeight = gui_height; + +- res.strMode = StringUtils::Format("%dx%d (%dx%d) @ %.2f%s%s%s - Full Screen", res.iScreenWidth, res.iScreenHeight, res.iWidth, res.iHeight, res.fRefreshRate, +- res.dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : "", +- res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "", +- res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : ""); ++ res.strMode = StringUtils::Format("%dx%d (%dx%d) @ %.2f%s - Full Screen", res.iScreenWidth, res.iScreenHeight, res.iWidth, res.iHeight, res.fRefreshRate, ++ res.dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : ""); + } + + static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect) +@@ -552,17 +552,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iScreenHeight= tv_state.display.hdmi.height; + m_desktopRes.dwFlags = MAKEFLAGS(tv_state.display.hdmi.group, tv_state.display.hdmi.mode, tv_state.display.hdmi.scan_mode); + m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); +- // Also add 3D flags +- if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) +- { +- m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; +- m_desktopRes.fPixelRatio *= 2.0; +- } +- else if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_TB_HALF) +- { +- m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; +- m_desktopRes.fPixelRatio *= 0.5; +- } + HDMI_PROPERTY_PARAM_T property; + property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; + vc_tv_hdmi_get_property(&property); +@@ -700,41 +689,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); + AddUniqueResolution(res2, resolutions); + } +- +- // Also add 3D versions of modes +- if (tv->struct_3d_mask & HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_HORIZONTAL) +- { +- RESOLUTION_INFO res2 = res; +- res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; +- res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- res2.fPixelRatio *= 2.0f; +- res2.iSubtitles = (int)(0.965 * res2.iHeight); +- +- AddUniqueResolution(res2, resolutions); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) +- { +- res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +- AddUniqueResolution(res2, resolutions); +- } +- } +- if (tv->struct_3d_mask & HDMI_3D_STRUCT_TOP_AND_BOTTOM) +- { +- RESOLUTION_INFO res2 = res; +- res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; +- res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- res2.fPixelRatio *= 0.5f; +- res2.iSubtitles = (int)(0.965 * res2.iHeight); +- +- AddUniqueResolution(res2, resolutions); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) +- { +- res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +- AddUniqueResolution(res2, resolutions); +- } +- +- } + } + } + if (supported_modes) + +From 23e4fb99f6f4ad1cc969cc8361dc55338769419f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 30 Jun 2015 14:08:24 +0100 +Subject: [PATCH 46/58] [rbp] Ignore video stereo mode when 3D display mode is + disabled + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 4 ++++ + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 5fc68d2..ce2e98d 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -589,6 +589,10 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect + bool stereo_invert = (m_iFlags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; + RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + ++ // ignore video stereo mode when 3D display mode is disabled ++ if (display_stereo_mode == RENDER_STEREO_MODE_OFF) ++ video_stereo_mode = RENDER_STEREO_MODE_OFF; ++ + // fix up transposed video + if (m_renderOrientation == 90 || m_renderOrientation == 270) + { +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 3bf7c2e..5f6b402 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -658,6 +658,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + bool stereo_invert = (flags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; + RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + ++ // ignore video stereo mode when 3D display mode is disabled ++ if (display_stereo_mode == RENDER_STEREO_MODE_OFF) ++ video_stereo_mode = RENDER_STEREO_MODE_OFF; ++ + // fix up transposed video + if (m_hints.orientation == 90 || m_hints.orientation == 270) + { + +From 72e7fc2a4f0701ce47e624c5c73f457ae8db93fd Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 22 Jun 2015 16:27:15 +0100 +Subject: [PATCH 47/58] [EGL] Don't skip out when HDMI mode is considered the + same + +It might have different 3D signalling. TODO: keep track of 3D signalling +--- + xbmc/windowing/egl/WinSystemEGL.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp +index c43c4d0..13b75b1 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.cpp ++++ b/xbmc/windowing/egl/WinSystemEGL.cpp +@@ -287,7 +287,7 @@ bool CWinSystemEGL::CreateNewWindow(const std::string& name, bool fullScreen, RE + (current_resolution.dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) + { + CLog::Log(LOGDEBUG, "CWinSystemEGL::CreateNewWindow: No need to create a new window"); +- return true; ++//xxx return true; + } + + m_bFullScreen = fullScreen; + +From 9747f3d0ba4d3fabe46c35ceaeb74d2ee5daf547 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Apr 2015 14:32:07 +0100 -Subject: [PATCH 40/51] [mmalrenderer] Add sharpness control +Subject: [PATCH 48/58] [mmalrenderer] Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -2761,7 +3073,7 @@ Subject: [PATCH 40/51] [mmalrenderer] Add sharpness control 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 5ad526e..d252240 100644 +index 6d861c1..c41b177 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -7503,7 +7503,7 @@ msgstr "" @@ -2774,7 +3086,7 @@ index 5ad526e..d252240 100644 #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 6cde0c5..9bf1aed 100644 +index ce2e98d..fb92079 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp @@ -207,6 +207,7 @@ CMMALRenderer::CMMALRenderer() @@ -2824,17 +3136,17 @@ index 1404fb3..9bced7e 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; -From 38eef3259f992329214af255923b6a2ce7364921 Mon Sep 17 00:00:00 2001 +From 7995698144c5b5c44dd9f4f80f17fa7803962586 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 24 Apr 2015 13:49:51 +0100 -Subject: [PATCH 41/51] [dvdplayer] Add back required include +Subject: [PATCH 49/58] [dvdplayer] Add back required include --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index bdc3edb..2dad96c 100644 +index 9be8aae..ebec92d 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -33,6 +33,7 @@ @@ -2846,10 +3158,10 @@ index bdc3edb..2dad96c 100644 #include "guilib/GraphicContext.h" #include -From ec33b18ad7a9fe49b5a9a10f053bd5b9d1ea4214 Mon Sep 17 00:00:00 2001 +From 9cb45bcb661cf5de4814e304706d982352453f48 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 May 2015 23:58:06 +0100 -Subject: [PATCH 42/51] [screensaver] Leave GUI contents available for +Subject: [PATCH 50/58] [screensaver] Leave GUI contents available for screensaver --- @@ -2879,10 +3191,10 @@ index ba33908..17ea269 100644 // Add window to the history list (we must do this before we activate it, -From 5964fa6583235b7fce1d0c83ba4005380a7bf322 Mon Sep 17 00:00:00 2001 +From 2e8dcaa3564b564dfdd7961c1d2beabee57cb7f8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 15 May 2015 14:04:11 +0100 -Subject: [PATCH 44/51] [omxplayer] Make unsupported when ac3transcode is +Subject: [PATCH 52/58] [omxplayer] Make unsupported when ac3transcode is enabled --- @@ -2890,7 +3202,7 @@ Subject: [PATCH 44/51] [omxplayer] Make unsupported when ac3transcode is 1 file changed, 6 insertions(+) diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp -index be54f31..373e3f2 100644 +index eff47e0..b954276 100644 --- a/xbmc/cores/omxplayer/OMXHelper.cpp +++ b/xbmc/cores/omxplayer/OMXHelper.cpp @@ -56,6 +56,12 @@ bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer @@ -2907,10 +3219,10 @@ index be54f31..373e3f2 100644 { // find video stream -From ba0740cf8f5e163720e03516186522bbf16c25b0 Mon Sep 17 00:00:00 2001 +From 8294881aca9494a55c30f7347599779fe770c50d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 1 Jun 2015 14:14:43 +0100 -Subject: [PATCH 45/51] [omximage] Don't report failed decode of progressive +Subject: [PATCH 53/58] [omximage] Don't report failed decode of progressive jpegs as as error --- @@ -2996,10 +3308,10 @@ index a43a446..890ca88 100644 } -From 33a38607218899acba79a30dc7b9163daaf99c65 Mon Sep 17 00:00:00 2001 +From 61003a22eb36823420523a2d3df994e1222e0cea Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 May 2015 19:01:00 +0100 -Subject: [PATCH 46/51] [rbp] Allow settings option for timestamp preference +Subject: [PATCH 54/58] [rbp] Allow settings option for timestamp preference We currently have some files that play better with pts timestamps and some that play better with dts timestamps Provide a gui setting to allow users to adjust this behaviour until we have a better solution @@ -3011,7 +3323,7 @@ Provide a gui setting to allow users to adjust this behaviour until we have a be 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index b76e723..3c18575 100644 +index 0138e5f..2d043ec 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16714,3 +16714,13 @@ msgstr "" @@ -3060,7 +3372,7 @@ index a583450..4a63820 100644 // set a flag so we can identify primary frames from generated frames (deinterlace) buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index adf9910..f9b9232 100644 +index 5f6b402..ce23bec 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -495,7 +495,7 @@ void OMXPlayerVideo::Process() @@ -3073,10 +3385,10 @@ index adf9910..f9b9232 100644 if (pts == DVD_NOPTS_VALUE) pts = dts; -From 792a42205d18d6d389a36101c85594884eb9b34e Mon Sep 17 00:00:00 2001 +From 9fc7a4289b865202e2b8d4ac9bc8174e1001e1ad Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:44:37 +0100 -Subject: [PATCH 47/51] [rbp] Ignore pts value when m_hints.ptsinvalid set +Subject: [PATCH 55/58] [rbp] Ignore pts value when m_hints.ptsinvalid set --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- @@ -3097,7 +3409,7 @@ index 4a63820..f7b0b25 100644 // set a flag so we can identify primary frames from generated frames (deinterlace) buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index f9b9232..33aa88c 100644 +index ce23bec..e17fdb8 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -495,7 +495,7 @@ void OMXPlayerVideo::Process() @@ -3110,69 +3422,10 @@ index f9b9232..33aa88c 100644 if (pts == DVD_NOPTS_VALUE) pts = dts; -From 493d0d8dfac375bedb0e80c08213bb45a714a4bb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 10 Jun 2015 20:42:03 +0100 -Subject: [PATCH 49/51] [rbp] Fix zoom modes with stereoscopic videos - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 12 ++++++++++-- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 12 ++++++++++-- - 2 files changed, 20 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 9bf1aed..e420834 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -632,9 +632,17 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect - CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); - - if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -- DestRect.x2 *= 2.0f; -+ { -+ float width = DestRect.x2 - DestRect.x1; -+ DestRect.x1 *= 2.0f; -+ DestRect.x2 = DestRect.x1 + 2.0f * width; -+ } - else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -- DestRect.y2 *= 2.0f; -+ { -+ float height = DestRect.y2 - DestRect.y1; -+ DestRect.y1 *= 2.0f; -+ DestRect.y2 = DestRect.y1 + 2.0f * height; -+ } - - if (gui != display) - { -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 33aa88c..e008405 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -690,9 +690,17 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec - CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); - - if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -- DestRect.x2 *= 2.0f; -+ { -+ float width = DestRect.x2 - DestRect.x1; -+ DestRect.x1 *= 2.0f; -+ DestRect.x2 = DestRect.x1 + 2.0f * width; -+ } - else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -- DestRect.y2 *= 2.0f; -+ { -+ float height = DestRect.y2 - DestRect.y1; -+ DestRect.y1 *= 2.0f; -+ DestRect.y2 = DestRect.y1 + 2.0f * height; -+ } - - if (gui != display) - { - -From 8312d9234bddd5878f60a7a297e16e61d2cab255 Mon Sep 17 00:00:00 2001 +From 08b2eeaffdfdd1dc124ee3eb2f5a21b664074eca Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:43:57 +0100 -Subject: [PATCH 50/51] ffmpeg: Automatic switch to software decode for GMC +Subject: [PATCH 56/58] ffmpeg: Automatic switch to software decode for GMC with more than one warp point --- @@ -3187,6 +3440,60 @@ Subject: [PATCH 50/51] ffmpeg: Automatic switch to software decode for GMC 8 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +diff --git a/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch b/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +new file mode 100644 +index 0000000..4cb8dd8 +--- /dev/null ++++ b/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +@@ -0,0 +1,48 @@ ++From 84e9a1784bbd3182b68cefa5e5feae8da8b9e184 Mon Sep 17 00:00:00 2001 ++From: popcornmix ++Date: Fri, 5 Jun 2015 22:48:33 +0100 ++Subject: [PATCH] mpeg4video: Signal unsupported GMC with more than one warp ++ point ++ ++--- ++ libavcodec/avcodec.h | 1 + ++ libavcodec/mpeg4videodec.c | 4 ++++ ++ 2 files changed, 5 insertions(+) ++ ++diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h ++index 8c7c420..e63dc2d 100644 ++--- a/libavcodec/avcodec.h +++++ b/libavcodec/avcodec.h ++@@ -2527,6 +2527,7 @@ typedef struct AVCodecContext { ++ #define FF_BUG_DC_CLIP 4096 ++ #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. ++ #define FF_BUG_TRUNCATED 16384 +++#define FF_BUG_GMC_UNSUPPORTED 32768 ++ ++ /** ++ * strictly follow the standard (MPEG4, ...). ++diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c ++index 9bf33dd..0b5d3b9 100644 ++--- a/libavcodec/mpeg4videodec.c +++++ b/libavcodec/mpeg4videodec.c ++@@ -2179,6 +2179,9 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) ++ ++ if (ctx->divx_version >= 0) ++ s->workaround_bugs |= FF_BUG_HPEL_CHROMA; +++ +++ if (ctx->num_sprite_warping_points > 1) +++ s->workaround_bugs |= FF_BUG_GMC_UNSUPPORTED; ++ } ++ ++ if (s->workaround_bugs & FF_BUG_STD_QPEL) { ++@@ -2203,6 +2206,7 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) ++ s->workaround_bugs, ctx->lavc_build, ctx->xvid_build, ++ ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : ""); ++ +++ avctx->workaround_bugs = s->workaround_bugs; ++ if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 && ++ s->codec_id == AV_CODEC_ID_MPEG4 && ++ avctx->idct_algo == FF_IDCT_AUTO) { ++-- ++1.9.1 ++ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp index f7b0b25..3e97f1d 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp @@ -3274,7 +3581,7 @@ index c0e22a2..3849993 100644 // AUDIO int channels; diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp -index 373e3f2..093388c 100644 +index b954276..b5ee4b6 100644 --- a/xbmc/cores/omxplayer/OMXHelper.cpp +++ b/xbmc/cores/omxplayer/OMXHelper.cpp @@ -77,7 +77,9 @@ bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer @@ -3289,74 +3596,1069 @@ index 373e3f2..093388c 100644 else if ((hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) && g_RBP.GetCodecWvc1()) supported = true; -From 1798b2059a7dcc34b4dcecfec56736225d2ac918 Mon Sep 17 00:00:00 2001 +From e51804ed122dd0a642104d102315787970fffb8d Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Wed, 3 Jun 2015 23:13:51 +0100 -Subject: [PATCH 51/51] [rpi] Always add desktop resolution to supported list +Date: Mon, 22 Jun 2015 21:46:57 +0100 +Subject: [PATCH 57/58] [rbp] Use default resampling setting on Pi2 -There was an assumption that the desktop resolution would be in the probed list, but that is sometimes not the case. -We don't add interlaced resolutions to list, but they can be the preferred resolution read from edid. See: -http://openelec.tv/forum/124-raspberry-pi/77074-forcing-interlaced-output - -Also hotplug changes causing an edid reread may cause the supported modes to change (e.g. powering on receiver) -and it is possible the previous preferred mode is no longer there - -So ensure that desktop resolution is always added to list. Also handle the case where desktop resolution is invalid on launch -(e.g. hdmi output powered off) --- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) + system/settings/rbp2.xml | 5 +++++ + 1 file changed, 5 insertions(+) -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index ae85484..a4b8a81 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -187,7 +187,7 @@ int CEGLNativeTypeRaspberryPI::FindMatchingResolution(const RESOLUTION_INFO &res - for (int i = 0; i < (int)resolutions.size(); i++) +diff --git a/system/settings/rbp2.xml b/system/settings/rbp2.xml +index b29a428..1c8b116 100644 +--- a/system/settings/rbp2.xml ++++ b/system/settings/rbp2.xml +@@ -28,6 +28,11 @@ + + + ++ ++ ++ 30 ++ ++ + +
+ + +From 175260bab79c330366834bd86512afc2902dba0a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 25 Jun 2015 19:43:10 +0100 +Subject: [PATCH 58/58] [rbp] HW mouse pointer + +Updating the mouse point provokes a complete screen update which can make it feel laggy +and results in high cpu. + +Render the mouse with an overlay to avoid redrawing the normal gui. + +Requires recent firmware. +--- + xbmc/guilib/GUIWindowManager.cpp | 2 + + xbmc/linux/RBP.cpp | 254 +++++++++++++++++++++ + xbmc/linux/RBP.h | 10 + + xbmc/linux/rpi_user_vcsm.h | 460 ++++++++++++++++++++++++++++++++++++++ + xbmc/windowing/WinEventsLinux.cpp | 147 ++++++++++++ + xbmc/windowing/WinEventsLinux.h | 11 + + 6 files changed, 884 insertions(+) + create mode 100644 xbmc/linux/rpi_user_vcsm.h + +diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp +index 17ea269..6965319 100644 +--- a/xbmc/guilib/GUIWindowManager.cpp ++++ b/xbmc/guilib/GUIWindowManager.cpp +@@ -193,7 +193,9 @@ void CGUIWindowManager::CreateWindows() + Add(new CGUIWindowAddonBrowser); + Add(new CGUIWindowScreensaverDim); + Add(new CGUIWindowDebugInfo); ++#ifndef TARGET_RASPBERRY_PI + Add(new CGUIWindowPointer); ++#endif + Add(new CGUIDialogYesNo); + Add(new CGUIDialogProgress); + Add(new CGUIDialogExtendedProgressBar); +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 096ea18..2c8d09b 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -28,6 +28,31 @@ + + #include "cores/omxplayer/OMXImage.h" + ++#include "guilib/GraphicContext.h" ++#include "settings/DisplaySettings.h" ++ ++#include ++#include ++#include "rpi_user_vcsm.h" ++ ++#define MAJOR_NUM 100 ++#define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *) ++#define DEVICE_FILE_NAME "/dev/vcio" ++ ++typedef struct gpu_mem_ptr_s { ++ void *arm; // Pointer to memory mapped on ARM side ++ int vc_handle; // Videocore handle of relocatable memory ++ int vcsm_handle; // Handle for use by VCSM ++ int vc; // Address for use in GPU code ++ int numbytes; // Size of memory block ++ int suballoc; ++} GPU_MEM_PTR_T; ++ ++static int mbox_open(); ++static void mbox_close(int file_desc); ++static void gpu_free_internal(GPU_MEM_PTR_T *p, int mb); ++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb); ++ + CRBP::CRBP() + { + m_initialized = false; +@@ -35,6 +60,9 @@ CRBP::CRBP() + m_DllBcmHost = new DllBcmHost(); + m_OMX = new COMXCore(); + m_display = DISPMANX_NO_HANDLE; ++ m_p = NULL; ++ m_mb = mbox_open(); ++ vcsm_init(); + } + + CRBP::~CRBP() +@@ -115,7 +143,10 @@ void CRBP::LogFirmwareVerison() + DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) + { + if (m_display == DISPMANX_NO_HANDLE) ++ { + m_display = vc_dispmanx_display_open( 0 /*screen*/ ); ++ init_cursor(); ++ } + return m_display; + } + +@@ -124,6 +155,7 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) + assert(display == m_display); + vc_dispmanx_display_close(m_display); + m_display = DISPMANX_NO_HANDLE; ++ uninit_cursor(); + } + + void CRBP::GetDisplaySize(int &width, int &height) +@@ -224,6 +256,15 @@ void CRBP::Deinitialize() + m_omx_image_init = false; + m_initialized = false; + m_omx_initialized = false; ++ uninit_cursor(); ++ if (m_mb && m_p) ++ gpu_free_internal(m_p, m_mb); ++ delete m_p; ++ m_p = NULL; ++ if (m_mb) ++ mbox_close(m_mb); ++ m_mb = 0; ++ vcsm_exit(); + } + + double CRBP::AdjustHDMIClock(double adjust) +@@ -239,4 +280,217 @@ double CRBP::AdjustHDMIClock(double adjust) + } + + ++static int mbox_property(int file_desc, void *buf) ++{ ++ int ret_val = ioctl(file_desc, IOCTL_MBOX_PROPERTY, buf); ++ ++ if (ret_val < 0) { ++ printf("ioctl_set_msg failed:%d\n", ret_val); ++ } ++ return ret_val; ++} ++ ++static int mbox_open() ++{ ++ int file_desc; ++ ++ // open a char device file used for communicating with kernel mbox driver ++ file_desc = open(DEVICE_FILE_NAME, 0); ++ if (file_desc < 0) { ++ printf("Can't open device file: %s (%d)\n", DEVICE_FILE_NAME, file_desc); ++ printf("Try creating a device file with: sudo mknod %s c %d 0\n", DEVICE_FILE_NAME, MAJOR_NUM); ++ } ++ return file_desc; ++} ++ ++static void mbox_close(int file_desc) ++{ ++ close(file_desc); ++} ++ ++static unsigned mem_lock(int file_desc, unsigned handle) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ ++ p[i++] = 0x3000d; // (the tag id) ++ p[i++] = 4; // (size of the buffer) ++ p[i++] = 4; // (size of the data) ++ p[i++] = handle; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++unsigned mem_unlock(int file_desc, unsigned handle) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ ++ p[i++] = 0x3000e; // (the tag id) ++ p[i++] = 4; // (size of the buffer) ++ p[i++] = 4; // (size of the data) ++ p[i++] = handle; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++unsigned int mailbox_set_cursor_info(int file_desc, int width, int height, int format, uint32_t buffer, int hotspotx, int hotspoty) ++{ ++ int i=0; ++ unsigned int p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ p[i++] = 0x00008010; // set cursor state ++ p[i++] = 24; // buffer size ++ p[i++] = 24; // data size ++ ++ p[i++] = width; ++ p[i++] = height; ++ p[i++] = format; ++ p[i++] = buffer; // ptr to VC memory buffer. Doesn't work in 64bit.... ++ p[i++] = hotspotx; ++ p[i++] = hotspoty; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof(*p); // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++ ++} ++ ++unsigned int mailbox_set_cursor_position(int file_desc, int enabled, int x, int y) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ p[i++] = 0x00008011; // set cursor state ++ p[i++] = 12; // buffer size ++ p[i++] = 12; // data size ++ ++ p[i++] = enabled; ++ p[i++] = x; ++ p[i++] = y; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb) ++{ ++ //printf("%s %d\n", __func__, numbytes); ++ ++ p->numbytes = numbytes; ++ p->suballoc = 0; ++ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Mouse pointer"); ++ assert(p->vcsm_handle); ++ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); ++ assert(p->vc_handle); ++ p->arm = vcsm_lock(p->vcsm_handle); ++ assert(p->arm); ++ p->vc = mem_lock(mb, p->vc_handle); ++ assert(p->vc); ++ return 0; ++} ++ ++static void gpu_free_internal(GPU_MEM_PTR_T *p, int mb) ++{ ++ mem_unlock(mb,p->vc_handle); ++ vcsm_unlock_ptr(p->arm); ++ vcsm_free(p->vcsm_handle); ++} ++ ++#define T 0 ++#define W 0xffffffff ++#define B 0xff000000 ++ ++const static uint32_t default_cursor_pixels[] = ++{ ++ B,B,B,B,B,B,B,B,B,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,W,B,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,B,T,T,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, ++ B,W,W,B,W,W,W,B,T,T,T,T,T,T,T,T, ++ B,W,B,T,B,W,W,W,B,T,T,T,T,T,T,T, ++ B,B,T,T,T,B,W,W,W,B,T,T,T,T,T,T, ++ B,T,T,T,T,T,B,W,W,W,B,T,T,T,T,T, ++ T,T,T,T,T,T,T,B,W,W,W,B,T,T,T,T, ++ T,T,T,T,T,T,T,T,B,W,W,W,B,T,T,T, ++ T,T,T,T,T,T,T,T,T,B,W,W,W,B,T,T, ++ T,T,T,T,T,T,T,T,T,T,B,W,W,W,B,T, ++ T,T,T,T,T,T,T,T,T,T,T,B,W,W,W,B, ++ T,T,T,T,T,T,T,T,T,T,T,T,B,W,B,T, ++ T,T,T,T,T,T,T,T,T,T,T,T,T,B,T,T ++}; ++ ++#undef T ++#undef W ++#undef B ++ ++void CRBP::init_cursor() ++{ ++ //printf("%s\n", __func__); ++ if (!m_mb) ++ return; ++ if (!m_p) ++ { ++ m_p = new GPU_MEM_PTR_T; ++ if (m_p) ++ gpu_malloc_uncached_internal(64 * 64 * 4, m_p, m_mb); ++ } ++ if (m_mb && m_p && m_p->arm && m_p->vc) ++ set_cursor(default_cursor_pixels, 16, 16, 0, 0); ++} ++ ++void CRBP::set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y) ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc || !pixels || width * height > 64 * 64) ++ return; ++ //printf("%s %dx%d %p\n", __func__, width, height, pixels); ++ memcpy(m_p->arm, pixels, width * height * 4); ++ unsigned int s = mailbox_set_cursor_info(m_mb, width, height, 0, m_p->vc, hotspot_x, hotspot_y); ++ assert(s == 0); ++} ++ ++void CRBP::update_cursor(int x, int y, bool enabled) ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc) ++ return; ++ ++ RESOLUTION res = g_graphicsContext.GetVideoResolution(); ++ CRect gui(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iWidth, CDisplaySettings::Get().GetResolutionInfo(res).iHeight); ++ CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); ++ ++ int x2 = x * display.Width() / gui.Width(); ++ int y2 = y * display.Height() / gui.Height(); ++ ++ //printf("%s %d,%d (%d)\n", __func__, x, y, enabled); ++ mailbox_set_cursor_position(m_mb, enabled, x2, y2); ++} ++ ++void CRBP::uninit_cursor() ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc) ++ return; ++ //printf("%s\n", __func__); ++ mailbox_set_cursor_position(m_mb, 0, 0, 0); ++} ++ + #endif +diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h +index b422c89..f233a5e 100644 +--- a/xbmc/linux/RBP.h ++++ b/xbmc/linux/RBP.h +@@ -41,6 +41,8 @@ + #include "threads/CriticalSection.h" + #include "threads/Event.h" + ++struct gpu_mem_ptr_s; ++ + class CRBP + { + public: +@@ -81,6 +83,14 @@ class CRBP + CEvent m_vsync; + class DllLibOMXCore; + CCriticalSection m_critSection; ++ ++ struct gpu_mem_ptr_s *m_p; ++ int m_mb; ++public: ++ void init_cursor(); ++ void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); ++ void update_cursor(int x, int y, bool enabled); ++ void uninit_cursor(); + }; + + extern CRBP g_RBP; +diff --git a/xbmc/linux/rpi_user_vcsm.h b/xbmc/linux/rpi_user_vcsm.h +new file mode 100644 +index 0000000..94e6e79 +--- /dev/null ++++ b/xbmc/linux/rpi_user_vcsm.h +@@ -0,0 +1,460 @@ ++/***************************************************************************** ++* Copyright 2001 - 2011 Broadcom Corporation. All rights reserved. ++* ++* This program is the proprietary software of Broadcom Corporation and/or ++* its licensors, and may only be used, duplicated, modified or distributed ++* pursuant to the terms and conditions of a separate, written license ++* agreement executed between you and Broadcom (an "Authorized License"). ++* Except as set forth in an Authorized License, Broadcom grants no license ++* (express or implied), right to use, or waiver of any kind with respect to ++* the Software, and Broadcom expressly reserves all rights in and to the ++* Software and all intellectual property rights therein. IF YOU HAVE NO ++* AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY ++* WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE ALL USE OF ++* THE SOFTWARE. ++* ++* Except as expressly set forth in the Authorized License, ++* 1. This program, including its structure, sequence and organization, ++* constitutes the valuable trade secrets of Broadcom, and you shall use ++* all reasonable efforts to protect the confidentiality thereof, and to ++* use this information only in connection with your use of Broadcom ++* integrated circuit products. ++* 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" ++* AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR ++* WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH ++* RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL ++* IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS ++* FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, ++* QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. YOU ++* ASSUME THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE. ++* 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS ++* LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, ++* OR EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO ++* YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ++* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS ++* OF THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER ++* IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ++* ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. ++*****************************************************************************/ ++ ++#ifndef __USER_VCSM__H__INCLUDED__ ++#define __USER_VCSM__H__INCLUDED__ ++ ++/* VideoCore Shared Memory - user interface library. ++** ++** This library provides all the necessary abstraction for any application to ++** make use of the shared memory service which is distributed accross a kernel ++** driver and a videocore service. ++** ++** It is an application design decision to choose or not to use this service. ++** ++** The logical flow of operations that a user application needs to follow when ++** using this service is: ++** ++** 1) Initialize the service. ++** 2) Allocate shared memory blocks. ++** 3) Start using the allocated blocks. ++** - In order to gain ownership on a block, lock the allocated block, ++** locking a block returns a valid address that the user application ++** can access. ++** - When finished with using the block for the current execution cycle ++** or function, and so when giving up the ownership, unlock the block. ++** 4) A block can be locked/unlocked as many times required - within or outside ++** of - a specific execution context. ++** 5) To completely release an allocated block, free it. ++** 6) If the service is no longer required, terminate it. ++** ++** ++** Some generic considerations: ++ ++** Allocating memory blocks. ++** ++** Memory blocks can be allocated in different manners depending on the cache ++** behavior desired. A given block can either be: ++ ++** - Allocated in a non cached fashion all the way through host and videocore. ++** - Allocated in a cached fashion on host OR videocore. ++** - Allocated in a cached fashion on host AND videocore. ++** ++** It is an application decision to determine how to allocate a block. Evidently ++** if the application will be doing substantial read/write accesses to a given block, ++** it is recommended to allocate the block at least in a 'host cached' fashion for ++** better results. ++** ++** ++** Locking memory blocks. ++** ++** When the memory block has been allocated in a host cached fashion, locking the ++** memory block (and so taking ownership of it) will trigger a cache invalidation. ++** ++** For the above reason and when using host cached allocation, it is important that ++** an application properly implements the lock/unlock mechanism to ensure cache will ++** stay coherent, otherwise there is no guarantee it will at all be. ++** ++** It is possible to dynamically change the host cache behavior (ie cached or non ++** cached) of a given allocation without needing to free and re-allocate the block. ++** This feature can be useful for such application which requires access to the block ++** only at certain times and not otherwise. By changing the cache behavior dynamically ++** the application can optimize performances for a given duration of use. ++** Such dynamic cache behavior remapping only applies to host cache and not videocore ++** cache. If one requires to change the videocore cache behavior, then a new block ++** must be created to replace the old one. ++** ++** On successful locking, a valid pointer is returned that the application can use ++** to access to data inside the block. There is no guarantee that the pointer will ++** stay valid following the unlock action corresponding to this lock. ++** ++** ++** Unocking memory blocks. ++** ++** When the memory block has been allocated in a host cached fashion, unlocking the ++** memory block (and so forgiving its ownership) will trigger a cache flush unless ++** explicitely asked not to flush the cache for performances reasons. ++** ++** For the above reason and when using host cached allocation, it is important that ++** an application properly implements the lock/unlock mechanism to ensure cache will ++** stay coherent, otherwise there is no guarantee it will at all be. ++** ++** ++** A complete API is defined below. ++*/ ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/* Different status that can be dumped. ++*/ ++typedef enum ++{ ++ VCSM_STATUS_VC_WALK_ALLOC = 0, // Walks *all* the allocation on videocore. ++ // Result of the walk is seen in the videocore ++ // log. ++ VCSM_STATUS_HOST_WALK_MAP, // Walks the *full* mapping allocation on host ++ // driver (ie for all processes). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_HOST_WALK_PID_MAP, // Walks the per process mapping allocation on host ++ // driver (for current process). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_HOST_WALK_PID_ALLOC, // Walks the per process host allocation on host ++ // driver (for current process). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_VC_MAP_ALL, // Equivalent to both VCSM_STATUS_VC_WALK_ALLOC and ++ // VCSM_STATUS_HOST_WALK_MAP. ++ // ++ VCSM_STATUS_NONE, // Must be last - invalid. ++ ++} VCSM_STATUS_T; ++ ++/* Different kind of cache behavior. ++*/ ++typedef enum ++{ ++ VCSM_CACHE_TYPE_NONE = 0, // No caching applies. ++ VCSM_CACHE_TYPE_HOST, // Allocation is cached on host (user space). ++ VCSM_CACHE_TYPE_VC, // Allocation is cached on videocore. ++ VCSM_CACHE_TYPE_HOST_AND_VC, // Allocation is cached on both host and videocore. ++ ++} VCSM_CACHE_TYPE_T; ++ ++/* Initialize the vcsm processing. ++** ++** Must be called once before attempting to do anything else. ++** ++** Returns 0 on success, -1 on error. ++*/ ++int vcsm_init( void ); ++ ++ ++/* Terminates the vcsm processing. ++** ++** Must be called vcsm services are no longer needed, it will ++** take care of removing any allocation under the current process ++** control if deemed necessary. ++*/ ++void vcsm_exit( void ); ++ ++ ++/* Queries the status of the the vcsm. ++** ++** Triggers dump of various kind of information, see the ++** different variants specified in VCSM_STATUS_T. ++** ++** Pid is optional. ++*/ ++void vcsm_status( VCSM_STATUS_T status, int pid ); ++ ++ ++/* Allocates a non-cached block of memory of size 'size' via the vcsm memory ++** allocator. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc( unsigned int size, char *name ); ++ ++ ++/* Allocates a cached block of memory of size 'size' via the vcsm memory ++** allocator, the type of caching requested is passed as argument of the ++** function call. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc_cache( unsigned int size, VCSM_CACHE_TYPE_T cache, char *name ); ++ ++ ++/* Shares an allocated block of memory via the vcsm memory allocator. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc_share( unsigned int handle ); ++ ++ ++/* Resizes a block of memory allocated previously by vcsm_alloc. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** The handle must be unlocked by user prior to attempting any ++** resize action. ++** ++** On error, the original size allocated against the handle ++** remains available the same way it would be following a ++** successful vcsm_malloc. ++*/ ++int vcsm_resize( unsigned int handle, unsigned int new_size ); ++ ++ ++/* Frees a block of memory that was successfully allocated by ++** a prior call the vcms_alloc. ++** ++** The handle should be considered invalid upon return from this ++** call. ++** ++** Whether any memory is actually freed up or not as the result of ++** this call will depends on many factors, if all goes well it will ++** be freed. If something goes wrong, the memory will likely end up ++** being freed up as part of the vcsm_exit process. In the end the ++** memory is guaranteed to be freed one way or another. ++*/ ++void vcsm_free( unsigned int handle ); ++ ++ ++/* Retrieves a videocore opaque handle from a mapped user address ++** pointer. The videocore handle will correspond to the actual ++** memory mapped in videocore. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** Note: the videocore opaque handle is distinct from the user ++** opaque handle (allocated via vcsm_malloc) and it is only ++** significant for such application which knows what to do ++** with it, for the others it is just a number with little ++** use since nothing can be done with it (in particular ++** for safety reason it cannot be used to map anything). ++*/ ++unsigned int vcsm_vc_hdl_from_ptr( void *usr_ptr ); ++ ++ ++/* Retrieves a videocore opaque handle from a opaque handle ++** pointer. The videocore handle will correspond to the actual ++** memory mapped in videocore. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** Note: the videocore opaque handle is distinct from the user ++** opaque handle (allocated via vcsm_malloc) and it is only ++** significant for such application which knows what to do ++** with it, for the others it is just a number with little ++** use since nothing can be done with it (in particular ++** for safety reason it cannot be used to map anything). ++*/ ++unsigned int vcsm_vc_hdl_from_hdl( unsigned int handle ); ++ ++ ++/* Retrieves a user opaque handle from a mapped user address ++** pointer. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++*/ ++unsigned int vcsm_usr_handle( void *usr_ptr ); ++ ++ ++/* Retrieves a mapped user address from an opaque user ++** handle. ++** ++** Returns: 0 on error ++** a non-zero address on success. ++** ++** On success, the address corresponds to the pointer ++** which can access the data allocated via the vcsm_malloc ++** call. ++*/ ++void *vcsm_usr_address( unsigned int handle ); ++ ++ ++/* Locks the memory associated with this opaque handle. ++** ++** Returns: NULL on error ++** a valid pointer on success. ++** ++** A user MUST lock the handle received from vcsm_malloc ++** in order to be able to use the memory associated with it. ++** ++** On success, the pointer returned is only valid within ++** the lock content (ie until a corresponding vcsm_unlock_xx ++** is invoked). ++*/ ++void *vcsm_lock( unsigned int handle ); ++ ++ ++/* Locks the memory associated with this opaque handle. The lock ++** also gives a chance to update the *host* cache behavior of the ++** allocated buffer if so desired. The *videocore* cache behavior ++** of the allocated buffer cannot be changed by this call and such ++** attempt will be ignored. ++** ++** The system will attempt to honour the cache_update mode request, ++** the cache_result mode will provide the final answer on which cache ++** mode is really in use. Failing to change the cache mode will not ++** result in a failure to lock the buffer as it is an application ++** decision to choose what to do if (cache_result != cache_update) ++** ++** The value returned in cache_result can only be considered valid if ++** the returned pointer is non NULL. The cache_result pointer may be ++** NULL if the application does not care about the actual outcome of ++** its action with regards to the cache behavior change. ++** ++** Returns: NULL on error ++** a valid pointer on success. ++** ++** A user MUST lock the handle received from vcsm_malloc ++** in order to be able to use the memory associated with it. ++** ++** On success, the pointer returned is only valid within ++** the lock content (ie until a corresponding vcsm_unlock_xx ++** is invoked). ++*/ ++void *vcsm_lock_cache( unsigned int handle, ++ VCSM_CACHE_TYPE_T cache_update, ++ VCSM_CACHE_TYPE_T *cache_result ); ++ ++ ++/* Unlocks the memory associated with this user mapped address. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking a mapped address, the user should no longer ++** attempt to reference it. ++*/ ++int vcsm_unlock_ptr( void *usr_ptr ); ++ ++ ++/* Unlocks the memory associated with this user mapped address. ++** Apply special processing that would override the otherwise ++** default behavior. ++** ++** If 'cache_no_flush' is specified: ++** Do not flush cache as the result of the unlock (if cache ++** flush was otherwise applicable in this case). ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking a mapped address, the user should no longer ++** attempt to reference it. ++*/ ++int vcsm_unlock_ptr_sp( void *usr_ptr, int cache_no_flush ); ++ ++ ++/* Unlocks the memory associated with this user opaque handle. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking an opaque handle, the user should no longer ++** attempt to reference the mapped addressed once associated ++** with it. ++*/ ++int vcsm_unlock_hdl( unsigned int handle ); ++ ++ ++/* Unlocks the memory associated with this user opaque handle. ++** Apply special processing that would override the otherwise ++** default behavior. ++** ++** If 'cache_no_flush' is specified: ++** Do not flush cache as the result of the unlock (if cache ++** flush was otherwise applicable in this case). ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking an opaque handle, the user should no longer ++** attempt to reference the mapped addressed once associated ++** with it. ++*/ ++int vcsm_unlock_hdl_sp( unsigned int handle, int cache_no_flush ); ++ ++/* Clean and/or invalidate the memory associated with this user opaque handle ++** ++** Returns: non-zero on error ++** ++** structure contains a list of flush/invalidate commands. Commands are: ++** 0: nop ++** 1: invalidate given virtual range in L1/L2 ++** 2: clean given virtual range in L1/L2 ++** 3: clean+invalidate given virtual range in L1/L2 ++** 4: flush all L1/L2 ++*/ ++struct vcsm_user_clean_invalid_s { ++ struct { ++ unsigned int cmd; ++ unsigned int handle; ++ unsigned int addr; ++ unsigned int size; ++ } s[8]; ++}; ++ ++int vcsm_clean_invalid( struct vcsm_user_clean_invalid_s *s ); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* __USER_VCSM__H__INCLUDED__ */ ++ +diff --git a/xbmc/windowing/WinEventsLinux.cpp b/xbmc/windowing/WinEventsLinux.cpp +index 6f97e9e..bde7649 100644 +--- a/xbmc/windowing/WinEventsLinux.cpp ++++ b/xbmc/windowing/WinEventsLinux.cpp +@@ -30,11 +30,31 @@ + #include "utils/log.h" + #include "powermanagement/PowerManager.h" + ++#ifdef TARGET_RASPBERRY_PI ++#include "utils/TimeUtils.h" ++#include "guilib/Resolution.h" ++#include "addons/Skin.h" ++#include "utils/XMLUtils.h" ++#include "utils/StringUtils.h" ++#include "filesystem/File.h" ++#include "guilib/iimage.h" ++#include "guilib/XBTF.h" ++#include "guilib/imagefactory.h" ++#include "guilib/TextureManager.h" ++#include "linux/RBP.h" ++#include "input/InputManager.h" ++#endif ++ + bool CWinEventsLinux::m_initialized = false; + CLinuxInputDevices CWinEventsLinux::m_devices; + + CWinEventsLinux::CWinEventsLinux() + { ++#ifdef TARGET_RASPBERRY_PI ++ m_last_mouse_move_time = 0; ++ m_mouse_state = -1; ++ memset(m_cursors, 0, sizeof m_cursors); ++#endif + } + + void CWinEventsLinux::RefreshDevices() +@@ -48,19 +68,142 @@ bool CWinEventsLinux::IsRemoteLowBattery() + return false; + } + ++#ifdef TARGET_RASPBERRY_PI ++void *CWinEventsLinux::LoadImage(const std::string texturePath, int &width, int &height) ++{ ++ void *pixels = NULL; ++ // Read image into memory to use our vfs ++ XFILE::CFile file; ++ XFILE::auto_buffer buf; ++ ++ if (file.LoadFile(texturePath, buf) <= 0) ++ return NULL; ++ ++ IImage *pImage = ImageFactory::CreateLoader(texturePath); ++ if (pImage != NULL && pImage->LoadImageFromMemory((unsigned char *)buf.get(), buf.size(), width, height)) ++ { ++ width = pImage->Width(); ++ height = pImage->Height(); ++ if (width > 0 && height > 0) ++ { ++ pixels = malloc(width * height * 4); ++ if (!pixels) ++ return NULL; ++ if (!pImage->Decode((unsigned char *)pixels, width * 4, XB_FMT_A8R8G8B8)) ++ { ++ free(pixels); ++ return NULL; ++ } ++ } ++ } ++ return pixels; ++} ++ ++bool CWinEventsLinux::LoadXML(const std::string strFileName) ++{ ++ RESOLUTION_INFO m_coordsRes; // resolution that the window coordinates are in. ++ // Find appropriate skin folder + resolution to load from ++ std::string strFileNameLower = strFileName; ++ StringUtils::ToLower(strFileNameLower); ++ std::string strLowerPath = g_SkinInfo->GetSkinPath(strFileNameLower, &m_coordsRes); ++ std::string strPath = g_SkinInfo->GetSkinPath(strFileName, &m_coordsRes); ++ ++ TiXmlElement* pRootElement = NULL; ++ CXBMCTinyXML xmlDoc; ++ std::string strPathLower = strPath; ++ StringUtils::ToLower(strPathLower); ++ if (!xmlDoc.LoadFile(strPath) && !xmlDoc.LoadFile(strPathLower) && !xmlDoc.LoadFile(strLowerPath)) ++ { ++ CLog::Log(LOGERROR, "unable to load:%s, Line %d\n%s", strPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc()); ++ return false; ++ } ++ pRootElement = (TiXmlElement*)xmlDoc.RootElement()->Clone(); ++ //printf("%s: load:%s,%s,%s\n", __func__, strPath.c_str(), strPathLower.c_str(), strLowerPath.c_str()); ++ ++ if (!pRootElement) ++ return false; ++ ++ if (strcmpi(pRootElement->Value(), "window")) ++ { ++ CLog::Log(LOGERROR, "file : XML file doesnt contain "); ++ return false; ++ } ++ ++ TiXmlElement *pChild = pRootElement->FirstChildElement(); ++ while (pChild) ++ { ++ if (strcmpi(pChild->Value(), "controls") == 0) ++ { ++ TiXmlElement *pControl = pChild->FirstChildElement(); ++ while (pControl) ++ { ++ //printf("%s:2 %s\n", __func__, pControl->Value()); ++ if (strcmpi(pControl->Value(), "control") == 0) ++ { ++ std::string strStringValue; ++ if (XMLUtils::GetString(pControl, "texture", strStringValue)) ++ { ++ const char* idAttr = pControl->Attribute("id"); ++ int index = idAttr ? atoi(idAttr)-1 : -1; ++ if (index >= 0 && index < (int)(sizeof m_cursors/sizeof *m_cursors)) ++ { ++ if (m_cursors[index].pixels) ++ free(m_cursors[index].pixels); ++ std::string path = g_TextureManager.GetTexturePath(strStringValue); ++ m_cursors[index].width = m_cursors[index].height = 64; // max ++ m_cursors[index].pixels = LoadImage(path, m_cursors[index].width, m_cursors[index].height); ++ //printf("%s: texture: %d %s %dx%d %p\n", __func__, index, path.c_str(), m_cursors[index].width, m_cursors[index].height, m_cursors[index].pixels); ++ } ++ } ++ } ++ pControl = pControl->NextSiblingElement(); ++ } ++ } ++ pChild = pChild->NextSiblingElement(); ++ } ++ delete pRootElement; ++ return true; ++} ++#endif ++ + bool CWinEventsLinux::MessagePump() + { + if (!m_initialized) { - if(resolutions[i].iScreenWidth == res.iScreenWidth && resolutions[i].iScreenHeight == res.iScreenHeight && resolutions[i].fRefreshRate == res.fRefreshRate && -- (resolutions[i].dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) == (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) -+ (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) - { - return i; - } -@@ -203,8 +203,7 @@ int CEGLNativeTypeRaspberryPI::AddUniqueResolution(RESOLUTION_INFO &res, std::ve - int i = FindMatchingResolution(res, resolutions); - if (i>=0) - { // don't replace a progressive resolution with an interlaced one of same resolution -- if (!(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) -- resolutions[i] = res; -+ resolutions[i] = res; + m_devices.InitAvailable(); + m_initialized = true; ++#ifdef TARGET_RASPBERRY_PI ++ LoadXML("Pointer.xml"); ++#endif } - else + + bool ret = false; + XBMC_Event event = {0}; ++#ifdef TARGET_RASPBERRY_PI ++ int64_t Now = CurrentHostCounter(); ++ int state = CInputManager::Get().GetMouseState() - 1; ++ if (m_mouse_state != state) ++ { ++ //printf("%s: %d->%d\n", __func__, m_mouse_state, state); ++ if (state >= 0 && state < (int)(sizeof m_cursors/sizeof *m_cursors) && m_cursors[state].pixels) ++ { ++ g_RBP.set_cursor(m_cursors[state].pixels, m_cursors[state].width, m_cursors[state].height, 0, 0); ++ } ++ m_mouse_state = state; ++ } ++#endif + while (1) { -@@ -516,7 +515,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - vc_tv_hdmi_get_property(&property); - m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; - } -- else // sdtv -+ else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv + event = m_devices.ReadEvent(); ++#ifdef TARGET_RASPBERRY_PI ++ if (event.type == XBMC_MOUSEMOTION || event.type == XBMC_MOUSEBUTTONDOWN || event.type == XBMC_MOUSEBUTTONUP) ++ { ++ if (event.type == XBMC_MOUSEMOTION) ++ g_RBP.update_cursor(event.motion.x, event.motion.y, 1); ++ m_last_mouse_move_time = Now; ++ //printf("%s: %d,%d %d %d,%d (%d,%d)\n", __func__, event.motion.type, event.motion.which, event.motion.state, event.motion.x, event.motion.y, event.motion.xrel, event.motion.yrel); ++ } ++#endif + if (event.type != XBMC_NOEVENT) { - m_desktopRes.iScreen = 0; - m_desktopRes.bFullScreen = true; -@@ -541,7 +540,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); - GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); + ret |= g_application.OnEvent(event); +@@ -71,6 +214,10 @@ bool CWinEventsLinux::MessagePump() + } + } -- if(resolutions.size() == 0) - { - AddUniqueResolution(m_desktopRes, resolutions); - CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); -@@ -636,6 +634,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); - res.iSubtitles = (int)(0.965 * res.iHeight); ++#ifdef TARGET_RASPBERRY_PI ++ if (Now - m_last_mouse_move_time > 5 * 1000000000LL) ++ g_RBP.update_cursor(0, 0, 0); ++#endif + return ret; + } -+ if (!m_desktopRes.dwFlags && prefer_group == group && prefer_mode == tv->code) -+ m_desktopRes = res; -+ -+ if (res.dwFlags & D3DPRESENTFLAG_INTERLACED) -+ continue; -+ - AddUniqueResolution(res, resolutions); - CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, - tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); +diff --git a/xbmc/windowing/WinEventsLinux.h b/xbmc/windowing/WinEventsLinux.h +index f6c8df0..5c2b583 100644 +--- a/xbmc/windowing/WinEventsLinux.h ++++ b/xbmc/windowing/WinEventsLinux.h +@@ -42,6 +42,17 @@ class CWinEventsLinux : public IWinEvents + private: + static bool m_initialized; + static CLinuxInputDevices m_devices; ++#ifdef TARGET_RASPBERRY_PI ++ bool LoadXML(const std::string strFileName); ++ void *LoadImage(const std::string texturePath, int &width, int &height); ++ int64_t m_last_mouse_move_time; ++ struct ++ { ++ void *pixels; ++ int width, height; ++ } m_cursors[4]; ++ int m_mouse_state; ++#endif + }; + + #endif diff --git a/projects/RPi2/patches/linux/linux-01-RPi_support.patch b/projects/RPi2/patches/linux/linux-01-RPi_support.patch index a35c13d26b..9da370c113 100644 --- a/projects/RPi2/patches/linux/linux-01-RPi_support.patch +++ b/projects/RPi2/patches/linux/linux-01-RPi_support.patch @@ -1,7 +1,7 @@ -From e9ee97a62574359de01411f0c74e23856e359952 Mon Sep 17 00:00:00 2001 +From f12410478cffff991f5e3c3d3fd68bab0bd33c2c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 01/85] Main bcm2708/bcm2709 linux port +Subject: [PATCH 001/105] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -7002,10 +7002,10 @@ index b5bedae..b0258e8 100644 mmc_pm_flag_t pm_caps; /* supported pm features */ -From 081ebd4ba394a354c03f7800b8d14519f165a0f9 Mon Sep 17 00:00:00 2001 +From e3d3c97f9f253df42f218071e9f9bb7fd8f602f0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 23:48:09 +0100 -Subject: [PATCH 02/85] power: Add power driver +Subject: [PATCH 002/105] power: Add power driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -7362,10 +7362,10 @@ index 0000000..bf22b26 + +#endif -From ddd21104179e4df6cf77762b1a7f4dabe65cc808 Mon Sep 17 00:00:00 2001 +From 6f7a17a848b57ac66f13d9ee9f09f4be89e74824 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Oct 2014 18:50:05 +0100 -Subject: [PATCH 03/85] Add bcm2708_gpio driver +Subject: [PATCH 003/105] Add bcm2708_gpio driver Signed-off-by: popcornmix @@ -7995,10 +7995,10 @@ index 0000000..fb69624 + +#endif -From 8957f79b301a70ab625baa2f9a4c613f871c3f22 Mon Sep 17 00:00:00 2001 +From e1fa284edd01b1a623096845dbe54c8d936aaaaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 1 May 2015 19:11:03 +0200 -Subject: [PATCH 04/85] mailbox: bcm2708: Add bcm2708-vcio +Subject: [PATCH 004/105] mailbox: bcm2708: Add bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -8629,10 +8629,10 @@ index 0000000..cc284ed + +#endif -From c1a8c5708161961f248f228d25da578e90fe127f Mon Sep 17 00:00:00 2001 +From 495cfff15f23f9b3ee26b0b92673ad77fc3e8d22 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 05/85] Add dwc_otg driver +Subject: [PATCH 005/105] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -69906,10 +69906,10 @@ index 0000000..cdc9963 +test_main(); +0; -From 2aced0ae5562b3dc60806a3ba2799af134732bdb Mon Sep 17 00:00:00 2001 +From 2fee602715f8de08540132094fe160dd21978680 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 06/85] bcm2708 watchdog driver +Subject: [PATCH 006/105] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -70346,10 +70346,10 @@ index 0000000..8a27d68 +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); -From 4a64377d42fac96be299fd210b0eb0bc3ba159b2 Mon Sep 17 00:00:00 2001 +From 164b737c320aca85798130a904c964f748423937 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 07/85] bcm2708 framebuffer driver +Subject: [PATCH 007/105] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73788,10 +73788,10 @@ index 3c14e43..7626beb6a 100644 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 -From b04b39dfe4cb2a287062d3b81287d9a9bf80e91a Mon Sep 17 00:00:00 2001 +From b1c418d504c5c7b800fee387abf9a03af0e1b4a4 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 08/85] dmaengine: Add support for BCM2708 +Subject: [PATCH 008/105] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75559,10 +75559,10 @@ index 0000000..2310e34 + +#endif /* _PLAT_BCM2708_DMA_H */ -From 34e4aa2e25b49261e2aa9d17a1ce767a3dfb90cf Mon Sep 17 00:00:00 2001 +From 8500a8de635dc4ce251330dfe0950453689d7a65 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 09/85] MMC: added alternative MMC driver +Subject: [PATCH 009/105] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -77378,11 +77378,11 @@ index 0000000..b7c4883 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From f1a7eefd17fbaf9335a5fdf6215d319b4042bb55 Mon Sep 17 00:00:00 2001 +From 6a1f159f160fec9d7b8f10cc0b37c79c58be80c8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 10/85] Adding bcm2835-sdhost driver, and an overlay to enable - it +Subject: [PATCH 010/105] Adding bcm2835-sdhost driver, and an overlay to + enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -79151,10 +79151,10 @@ index 0000000..eef8a24 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From effb9e4dd94cc200500fb22061ede69047cceea7 Mon Sep 17 00:00:00 2001 +From 8f5a0afb8bc65e48695b38a33dba8a17bb0c4218 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 11/85] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 011/105] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix @@ -80479,10 +80479,10 @@ index 0000000..5325832 + +#endif /* VC_CMA_H */ -From d83761e1a337d8eee9e9a196e23ceeefe51fff1e Mon Sep 17 00:00:00 2001 +From 8af8b7d264e546ee29b28acca735bd4ce8dbdb71 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 12/85] bcm2708: alsa sound driver +Subject: [PATCH 012/105] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -83324,10 +83324,10 @@ index 0000000..af3e6eb + +#endif // _VC_AUDIO_DEFS_H_ -From 53e9a31fe01ae9460b2361ec93a54bac888d8f5f Mon Sep 17 00:00:00 2001 +From d01fbc5cd5784094ffe247f269eaa1b31bb023d5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 13/85] bcm2708 vchiq driver +Subject: [PATCH 013/105] bcm2708 vchiq driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -96581,10 +96581,10 @@ index 0000000..b6bfa21 + return vchiq_build_time; +} -From 3f8c3cd61c11d730699b14ee1d64db95215487e8 Mon Sep 17 00:00:00 2001 +From efc783d883c14618d52d0d804a856ee31a152fcb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 14/85] vc_mem: Add vc_mem driver +Subject: [PATCH 014/105] vc_mem: Add vc_mem driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -97590,10 +97590,10 @@ index 0000000..20a4753 + +#endif /* _VC_MEM_H */ -From 138483d8fb3cbfcad83b0c450e3c3eb2fca5a8de Mon Sep 17 00:00:00 2001 +From 72c49d81f0dd002228b6cb26db9e5428eef39d41 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 15/85] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 015/105] vcsm: VideoCore shared memory service for BCM2835 Add experimental support for the VideoCore shared memory service. This allows user processes to allocate memory from VideoCore's @@ -102003,10 +102003,10 @@ index 0000000..0bfb42e +MODULE_DESCRIPTION("VideoCore SharedMemory Driver"); +MODULE_LICENSE("GPL v2"); -From 3b4d6cc19851307c0426fe31be9627558bb1b2cf Mon Sep 17 00:00:00 2001 +From 6b13df3a424914c3db0687d471236611c0cd6d60 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 16/85] Add hwrng (hardware random number generator) driver +Subject: [PATCH 016/105] Add hwrng (hardware random number generator) driver --- drivers/char/hw_random/Kconfig | 13 +++- @@ -102183,10 +102183,10 @@ index 0000000..340f004 +MODULE_DESCRIPTION("BCM2708 H/W Random Number Generator (RNG) driver"); +MODULE_LICENSE("GPL and additional rights"); -From 8312a7efc6b5c8fe996e41f62adf6e9c71f7a5f8 Mon Sep 17 00:00:00 2001 +From 71858ccb0a96e022238c9644177fcbf891807ffd Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 17/85] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 017/105] lirc: added support for RaspberryPi GPIO lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others See: https://github.com/raspberrypi/linux/issues/525 @@ -103039,10 +103039,10 @@ index 0000000..24563ec +module_param(debug, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(debug, "Enable debugging messages"); -From 4905ceea875bf96a9dbf4989347ed1d5e4e3875b Mon Sep 17 00:00:00 2001 +From 36fe69547259b45803b0cb11085d60374c92446a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 18/85] Add cpufreq driver +Subject: [PATCH 018/105] Add cpufreq driver Signed-off-by: popcornmix --- @@ -103315,10 +103315,10 @@ index 0000000..6735da9 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From 50ef992dbbc2e7e1c1a87a61b540c0b84f7cb3ee Mon Sep 17 00:00:00 2001 +From 50d7170ec5cf300e239ab575de3e0917ec44b8a6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 19/85] Added hwmon/thermal driver for reporting core +Subject: [PATCH 019/105] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -103615,10 +103615,10 @@ index 0000000..3bc80f1 + +module_platform_driver(bcm2835_thermal_driver); -From 0e6c5417c62642c7481e57ce937007277fe31cfd Mon Sep 17 00:00:00 2001 +From 4011c7c5c3c5a03af182dbed2e824a491d12e96c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:41:33 +0100 -Subject: [PATCH 20/85] Add Chris Boot's spi driver. +Subject: [PATCH 020/105] Add Chris Boot's spi driver. spi: bcm2708: add device tree support @@ -104530,10 +104530,10 @@ index 0000000..041b5e2 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 68bec2f411f5f7ea1720f555cadc7a5c6c214934 Mon Sep 17 00:00:00 2001 +From 04e6956b7d15554967ca2620563efc31a63cd69e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 21/85] Add Chris Boot's i2c driver +Subject: [PATCH 021/105] Add Chris Boot's i2c driver i2c-bcm2708: fixed baudrate @@ -105334,10 +105334,10 @@ index 0000000..8773203 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From f039d3ed041c0fd3267b149ef476638142535ef3 Mon Sep 17 00:00:00 2001 +From 9ed8236717339aab28673519a2300e6f0165d2da Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 22/85] bcm2835: add v4l2 camera device +Subject: [PATCH 022/105] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -112664,10 +112664,10 @@ index 0000000..9d1d11e + +#endif /* MMAL_VCHIQ_H */ -From 35af37046308a29d529e83d908c1fea9cd01a8a2 Mon Sep 17 00:00:00 2001 +From 8daf7f4a4f40fd1d6008fa8438d72ae3c9f2cd4f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Jan 2015 14:48:55 +0000 -Subject: [PATCH 23/85] scripts/dtc: Update to upstream version with overlay +Subject: [PATCH 023/105] scripts/dtc: Update to upstream version with overlay patches --- @@ -117880,10 +117880,10 @@ index 54d4e904..d644002 100644 -#define DTC_VERSION "DTC 1.4.0-dirty" +#define DTC_VERSION "DTC 1.4.1-g36c70742" -From 7b42e6d4640654b00e46f0b14a2f4d4f9979610e Mon Sep 17 00:00:00 2001 +From 0d794d8e6cccfbefeb6320acf871913dcd94d2ff Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 24/85] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 024/105] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -118368,10 +118368,10 @@ index 0000000..3dff948 + return (($val eq 'y') || ($val eq '1')); +} -From 23bd48a5f3cae21a2074ef421a675dfba54866de Mon Sep 17 00:00:00 2001 +From 79ae5c40586808d01368549b13b3c7a4709c9564 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 25/85] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH 025/105] fdt: Add support for the CONFIG_CMDLINE_EXTEND option --- drivers/of/fdt.c | 29 ++++++++++++++++++++++++----- @@ -118426,10 +118426,10 @@ index cde35c5d01..dd7fbfe 100644 pr_debug("Command line is: %s\n", (char*)data); -From 4c4001e3bc03206e4d87273ac410a719c7a128b4 Mon Sep 17 00:00:00 2001 +From 01a18bea60e6b60a6fcb0a58faaf34f1b5cc0281 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 26/85] BCM2708: Add core Device Tree support +Subject: [PATCH 026/105] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. @@ -122306,10 +122306,10 @@ index 0000000..66a98f6 + }; +}; -From 5cbd38e967d11494dbf7d401bfcce0240a176f1f Mon Sep 17 00:00:00 2001 +From 7c5cfbcdfa96680f63b0e82202ab509ef78bc023 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 27/85] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 027/105] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -122402,10 +122402,10 @@ index fb795c3..fa72af0 100644 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ -From 9907bcbcbae0e355d82cbc29e4f9667fb6fadfac Mon Sep 17 00:00:00 2001 +From b16b65cdb4064e32b321e4d3801bc1990ee258f7 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 30/85] Speed up console framebuffer imageblit function +Subject: [PATCH 030/105] Speed up console framebuffer imageblit function Especially on platforms with a slower CPU but a relatively high framebuffer fill bandwidth, like current ARM devices, the existing @@ -122614,10 +122614,10 @@ index a2bb276..436494f 100644 start_index, pitch_index); } else -From c50184c27d8c47aa92288d11c79ccbc193f91a74 Mon Sep 17 00:00:00 2001 +From bda0a510175903069a6e36ee03df8bb58da535fc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 31/85] Allow mac address to be set in smsc95xx +Subject: [PATCH 031/105] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -122708,10 +122708,10 @@ index 26423ad..e29a323 100644 if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -From b579f8fd561c7347d6354d3f7fc6880ac6b49e7f Mon Sep 17 00:00:00 2001 +From cc2b2db4dd1eea70daf6a7b2122bc2cc4fff16b5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 32/85] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 032/105] enabling the realtime clock 1-wire chip DS1307 and 1-wire on GPIO4 (as a module) 1-wire: Add support for configuring pin for w1-gpio kernel module @@ -123109,11 +123109,11 @@ index d58594a..feae942 100644 unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 8828223a011c97121c5824e4a9056ebfdb178612 Mon Sep 17 00:00:00 2001 +From f0f58bbd87e81fe4ff162b11faedbacc6b0c8f38 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 34/85] config: Enable CONFIG_MEMCG, but leave it disabled (due - to memory cost). Enable with cgroup_enable=memory. +Subject: [PATCH 034/105] config: Enable CONFIG_MEMCG, but leave it disabled + (due to memory cost). Enable with cgroup_enable=memory. --- kernel/cgroup.c | 23 +++++++++++++++++++++++ @@ -123167,10 +123167,10 @@ index a04225d..a2ef8af 100644 /** -From 9028029fe919c229779c848fd2a645bf02d2d959 Mon Sep 17 00:00:00 2001 +From c475efe6fd77dc1288117ba41451f11c7e46c74c Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 35/85] ASoC: Add support for BCM2708 +Subject: [PATCH 035/105] ASoC: Add support for BCM2708 This driver adds support for digital audio (I2S) for the BCM2708 SoC that is used by the @@ -124313,10 +124313,10 @@ index 0000000..6fdcbc1 + +#endif -From 2cd4bdd8e03b8a9ce11d39741d5670d10b58f13e Mon Sep 17 00:00:00 2001 +From ea9da38e0ab7aae107b1b2cb86f9e6728c54f72d Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 36/85] ASoC: Add support for PCM5102A codec +Subject: [PATCH 036/105] ASoC: Add support for PCM5102A codec Some definitions to support the PCM5102A codec by Texas Instruments. @@ -124441,10 +124441,10 @@ index 0000000..126f1e9 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 214e3f42b42cc6512664e15c2e6d48c44397ff30 Mon Sep 17 00:00:00 2001 +From 3843c763a49f690052a369c75a4b91e63e65ccd3 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 37/85] BCM2708: Add I2S support to board file +Subject: [PATCH 037/105] BCM2708: Add I2S support to board file Adds the required initializations for I2S to the board file of mach-bcm2708. @@ -124533,10 +124533,10 @@ index a3b65dc..a515992 100644 for (i = 0; i <= 1; i++) { void __iomem *base; -From 7cf3e108eda83b02d6dcf336c5e1842b36fab753 Mon Sep 17 00:00:00 2001 +From 9305f38947159f8027408f9caf57ff11d3a14e5d Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 38/85] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 038/105] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -124685,10 +124685,10 @@ index 0000000..4b70b45 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 895fd13e0cf6dc5febf489837d068825db70d7ac Mon Sep 17 00:00:00 2001 +From d48fc2d392448b821b9ff95e26cf859f2efe4794 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 39/85] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 039/105] BCM2708: Add HifiBerry DAC to board file This adds the initalization of the HifiBerry DAC to the mach-bcm2708 board file. @@ -124736,10 +124736,10 @@ index 01f2de7..1d9b788 100644 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { struct amba_device *d = amba_devs[i]; -From e01a75a2784a659fbd297dc849a2e25ae120e35c Mon Sep 17 00:00:00 2001 +From 1d90a3734460be00e20106847f347ff0bd4c322b Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 40/85] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 040/105] ASoC: BCM2708: Add support for RPi-DAC This adds a machine driver for the RPi-DAC. @@ -125034,13 +125034,13 @@ index 0000000..b4eaa44 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 4250d743113025b72b841b0b801aee698d8761ef Mon Sep 17 00:00:00 2001 +From 54b60a8b83358d2fedc3e401908d96e9053033fb Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 41/85] ASoC: wm8804: Implement MCLK configuration options, add - 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs for - most sample rates. At 192kHz only 128xfs is supported. The existing driver - selects 128xfs automatically for some lower samples rates. By using an +Subject: [PATCH 041/105] ASoC: wm8804: Implement MCLK configuration options, + add 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs + for most sample rates. At 192kHz only 128xfs is supported. The existing + driver selects 128xfs automatically for some lower samples rates. By using an additional mclk_div divider, it is now possible to control the behaviour. This allows using 256xfs PLL frequency on all sample rates up to 96kHz. It should allow lower jitter and better signal quality. The behavior has to be @@ -125077,10 +125077,10 @@ index 1e403f6..d4efa85 100644 #define WM8804_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \ -From bb771a22197d65ccab827fe36a8699d18b961693 Mon Sep 17 00:00:00 2001 +From bda0438e5d2450329f79c9c203eb7700ea94bcdc Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 42/85] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 042/105] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -125345,10 +125345,10 @@ index 0000000..92e9e46 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 6081cb2ed879b4e99cd91a36331460bf6ec2e3f0 Mon Sep 17 00:00:00 2001 +From f0b7e3863c1025b7318dfe2672828fc1186f5f0c Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 43/85] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 043/105] BCM2708: Added support for HiFiBerry Digi board Board initalization by I2C Signed-off-by: Daniel Matuschek @@ -125395,11 +125395,11 @@ index 6d53beb..a062d7f 100644 bcm_register_device_dt(&snd_rpi_dac_device); bcm_register_device_dt(&snd_pcm1794a_codec_device); -From 6d26e73e4afc0f00e514498776ff0e24d595f919 Mon Sep 17 00:00:00 2001 +From f1d5146257a0181f53a76aa7c1eab75d8cde3722 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 44/85] ASoC: wm8804: Set idle_bias_off to false Idle bias has - been change to remove warning on driver startup +Subject: [PATCH 044/105] ASoC: wm8804: Set idle_bias_off to false Idle bias + has been change to remove warning on driver startup Signed-off-by: Daniel Matuschek --- @@ -125420,10 +125420,10 @@ index d4efa85..f3f26a2 100644 .dapm_widgets = wm8804_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8804_dapm_widgets), -From 76c18d6844de1ab292a34baf6c96566ba05db024 Mon Sep 17 00:00:00 2001 +From e2bd270cae6b71e799cd32309da2efb131bfc0f7 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 45/85] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 045/105] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -125631,10 +125631,10 @@ index 0000000..aff7377 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 712b1f5ed46d64ace42306b175e84247ad466a86 Mon Sep 17 00:00:00 2001 +From 3722358310334b175672d037724974a827219c91 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 46/85] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 046/105] vmstat: Workaround for issue where dirty page count goes negative See: @@ -125661,10 +125661,10 @@ index 82e7db7..f87d16d 100644 static inline void __inc_zone_page_state(struct page *page, -From 8fe8c0d0126e286164be182add69b996012753b6 Mon Sep 17 00:00:00 2001 +From d0561fb6028c8eb1c26f3ad2f59d21d70eb778f4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 47/85] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 047/105] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -125700,10 +125700,10 @@ index bfbe1be..a738b25 100644 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From db5d9cfda38672c42a52574924297223f44ab568 Mon Sep 17 00:00:00 2001 +From efa286e84267224fb05bfe8615489d50932ed5b8 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 48/85] Added support for HiFiBerry DAC+ +Subject: [PATCH 048/105] Added support for HiFiBerry DAC+ The driver is based on the HiFiBerry DAC driver. However HiFiBerry DAC+ uses a different codec chip (PCM5122), therefore a new driver is necessary. @@ -125914,10 +125914,10 @@ index 0000000..c63387b +MODULE_DESCRIPTION("ASoC Driver for HiFiBerry DAC+"); +MODULE_LICENSE("GPL v2"); -From f929e0ea9b902ca56a57439ad326a7fe1bc190d2 Mon Sep 17 00:00:00 2001 +From f0b1de75a01f88b6250c208157a3a2f4a5c6b52d Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 49/85] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 049/105] Added driver for HiFiBerry Amp amplifier add-on board The driver contains a low-level hardware driver for the TAS5713 and the drivers for the Raspberry Pi I2S subsystem. @@ -126786,11 +126786,11 @@ index 0000000..8f019e0 + +#endif /* _TAS5713_H */ -From 0d10a0439bbde5d1bf74427cb93a55a29ea7ec12 Mon Sep 17 00:00:00 2001 +From 354cb37f33bee3d72e5a514999323689b00ca275 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Apr 2015 19:14:18 +0100 -Subject: [PATCH 50/85] bcm2708: Allow option card devices to be configured via - DT +Subject: [PATCH 050/105] bcm2708: Allow option card devices to be configured + via DT If the kernel is built with Device Tree support, and if a DT blob is provided for the kernel at boot time, then the platform devices @@ -126814,10 +126814,10 @@ index 03fa1cb..c816526 100644 static struct platform_driver bcm2835_i2s_driver = { .probe = bcm2835_i2s_probe, -From 8eaeacdeca7966b710fbdefad07bd3f0de14447c Mon Sep 17 00:00:00 2001 +From f5a17a7715495cd47e7c4eef2655346833b71139 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 18:45:39 +0100 -Subject: [PATCH 51/85] Adding Device Tree support for some RPi audio cards +Subject: [PATCH 051/105] Adding Device Tree support for some RPi audio cards --- arch/arm/mach-bcm2709/bcm2709.c | 143 ++++++++++++++++++++++++++++++++++++++ @@ -127180,10 +127180,10 @@ index 126f1e9..7c6598e 100644 }; -From 7dfce43c57cc203535e6098fcc1e8977d85ddeac Mon Sep 17 00:00:00 2001 +From 83c934f5afe83dab78859dbdcb6bc2fbcd24904a Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 29 Oct 2014 23:30:30 -0700 -Subject: [PATCH 52/85] Added support to reserve/enable a GPIO pin to be used +Subject: [PATCH 052/105] Added support to reserve/enable a GPIO pin to be used from pps-gpio module (LinuxPPS). Enable PPS modules in default config for RPi. @@ -127319,10 +127319,10 @@ index 57e1f3d..721559b 100644 +module_param(pps_gpio_pin, int, 0644); +MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS"); -From a3936496fcb450e52716292427b60570447b6b03 Mon Sep 17 00:00:00 2001 +From 98235f2a450b2f029e0bba2b566b5c86df9a6fef Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 53/85] Update ds1307 driver for device-tree support +Subject: [PATCH 053/105] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -127349,10 +127349,10 @@ index 4ffabb3..c6789a7 100644 .driver = { .name = "rtc-ds1307", -From eed1565f9cb449204057486a48c39f917c269fa1 Mon Sep 17 00:00:00 2001 +From d25a65991d2262ee56bf481b47a9980edf5e1ff0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 54/85] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 054/105] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -127463,10 +127463,10 @@ index 0000000..2ca2b98 +MODULE_DESCRIPTION("Set LED GPIO to Input \"trigger\""); +MODULE_LICENSE("GPL"); -From 494f12e28e415f895a337fcfcfe45cd530c1cc99 Mon Sep 17 00:00:00 2001 +From b478a1224ddadc079a085b1a9fd2f921f3492543 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 20 Jun 2014 17:19:27 +0100 -Subject: [PATCH 55/85] bcm2709: Simplify and strip down IRQ handler +Subject: [PATCH 055/105] bcm2709: Simplify and strip down IRQ handler --- arch/arm/include/asm/entry-macro-multi.S | 2 + @@ -127685,10 +127685,10 @@ index d08591b..08d184c 100644 +1: get_irqnr_and_base r0, r2, r6, lr + .endm -From 3e2b399180b8f5a0090134ba1889443945a13cf6 Mon Sep 17 00:00:00 2001 +From a149f4195cb6283d974f29f6853bc73666252e28 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 12 Feb 2015 11:17:53 +0000 -Subject: [PATCH 56/85] Fix LED "input" trigger implementation for 3.19 +Subject: [PATCH 056/105] Fix LED "input" trigger implementation for 3.19 --- drivers/leds/leds-gpio.c | 10 +++++++++- @@ -127775,10 +127775,10 @@ index 9a2b000..60accc5 100644 /* Set LED brightness level */ /* Must not sleep, use a workqueue if needed */ -From 5c958120f03edcedf40ff2d07b825229d348d26b Mon Sep 17 00:00:00 2001 +From 63f720f1e358012fdb2631c18c794c32beb1c53f Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 57/85] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 057/105] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -127800,11 +127800,11 @@ index 8d908e3..7a1900d 100644 .can_sleep = false, }; -From 784bb9af1427a9b17cd6894cff2dc3c2eb8c4735 Mon Sep 17 00:00:00 2001 +From 344a03d0bd987220640f4dd4ba4d083d2fdbb449 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 4 Feb 2015 10:02:24 +0000 -Subject: [PATCH 58/85] pinctrl-bcm2835: bcm2835_gpio_direction_output must set - the value +Subject: [PATCH 058/105] pinctrl-bcm2835: bcm2835_gpio_direction_output must + set the value --- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 9 ++++++++- @@ -127831,11 +127831,11 @@ index 7a1900d..62f85aa 100644 static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) -From c885a17c2aee5d4f00b2dc950bcdadd3ed7bd7cb Mon Sep 17 00:00:00 2001 +From 1c683d296c9424f0cf7dac30d8992258c28cbeb1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 59/85] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 - and 46-53 +Subject: [PATCH 059/105] pinctrl-bcm2835: Fix interrupt handling for GPIOs + 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has four interrupt lines - one each for the three IRQ groups and one common. Rather @@ -127980,11 +127980,11 @@ index 62f85aa..c7cf266 100644 }, }; -From ead5cb2483b2fb0943121dfb69786e6ec1c20ced Mon Sep 17 00:00:00 2001 +From e1a45c7cf40f11598c7faed4a1d1b594bcc05796 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 60/85] pinctrl-bcm2835: Only request the interrupts listed in - the DTB +Subject: [PATCH 060/105] pinctrl-bcm2835: Only request the interrupts listed + in the DTB Although the GPIO controller can generate three interrupts (four counting the common one), the device tree files currently only specify two. In the @@ -128010,10 +128010,10 @@ index c7cf266..986779a 100644 pc->irq_data[i].irqgroup = i; -From 15eff0b34d5eba282dfa1fc0303bb66f08d237ad Mon Sep 17 00:00:00 2001 +From 0fff72fcb15c962d0723f9cea13eb2c3fc31d465 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 61/85] enc28j60: Add device tree compatible string and an +Subject: [PATCH 061/105] enc28j60: Add device tree compatible string and an overlay --- @@ -128047,10 +128047,10 @@ index b1b5f66..c6b6e1a 100644 .probe = enc28j60_probe, .remove = enc28j60_remove, -From 4c1fa7e5d19f7f006576def6cdf591c325d9a167 Mon Sep 17 00:00:00 2001 +From 74c1893348470c0ec98d83ea63ab8e22e3da8c13 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 62/85] Add driver for rpi-proto +Subject: [PATCH 062/105] Add driver for rpi-proto Forward port of 3.10.x driver from https://github.com/koalo We are using a custom board and would like to use rpi 3.18.x @@ -128265,10 +128265,10 @@ index 0000000..c6e45a0 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From 3a796c13d6cf8d6cd51170b34944b18d50f30bba Mon Sep 17 00:00:00 2001 +From 607ebcbdf67cb576a652c505a367e614014547dd Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Thu, 2 Apr 2015 12:22:55 +0100 -Subject: [PATCH 63/85] Add Device Tree support for RPi-DAC. +Subject: [PATCH 063/105] Add Device Tree support for RPi-DAC. --- sound/soc/bcm/rpi-dac.c | 21 +++++++++++++++++++++ @@ -128343,10 +128343,10 @@ index b4eaa44..afe1b41 100644 }; -From 69754b2aaecf3eb2dd3bef6f68d7e7787a9dc6cc Mon Sep 17 00:00:00 2001 +From 1fa756b7cbc29e7ce003ed6f6b269faf8f114467 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 64/85] config: Add default configs +Subject: [PATCH 064/105] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1204 ++++++++++++++++++++++++++++++++++++ @@ -130771,10 +130771,10 @@ index 0000000..6a41231 +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From c6ed3e60b55412cdf8e130053f600c05c3e1460a Mon Sep 17 00:00:00 2001 +From 7d987bad7109b37ffac673a9975718ee4e9ea9ae Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 65/85] smsx95xx: fix crimes against truesize +Subject: [PATCH 065/105] smsx95xx: fix crimes against truesize smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings. @@ -130809,10 +130809,10 @@ index e29a323..aff63dc usbnet_skb_return(dev, ax_skb); } -From ef3796d3a8cdb18963e2eeb04fa493abca03af14 Mon Sep 17 00:00:00 2001 +From 888ea57ee7c57e7f43b3be9d7f9c70ea92e3ef2e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 66/85] smsc95xx: Disable turbo mode by default +Subject: [PATCH 066/105] smsc95xx: Disable turbo mode by default --- drivers/net/usb/smsc95xx.c | 2 +- @@ -130832,10 +130832,10 @@ index aff63dc..08a8a8c 100755 MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); -From 831d4392562d46f0d9a55c755c1363b84832af2a Mon Sep 17 00:00:00 2001 +From 43e2441e42ce3e68910e50a862e82cefff1491a8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2015 19:30:22 +0100 -Subject: [PATCH 67/85] Add blk_pos parameter to mmc multi_io_quirk callback +Subject: [PATCH 067/105] Add blk_pos parameter to mmc multi_io_quirk callback --- drivers/mmc/card/block.c | 1 + @@ -130918,10 +130918,10 @@ index b0258e8..d3cdad9 100644 struct mmc_card; -From a20e01130fd949a90e5e91821edd63581e95cc1e Mon Sep 17 00:00:00 2001 +From 3c38adf40dd65f96d317f60295ee47ddd5412d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 29 Apr 2015 17:24:02 +0200 -Subject: [PATCH 68/85] bcm2835: bcm2835_defconfig +Subject: [PATCH 068/105] bcm2835: bcm2835_defconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -132251,10 +132251,10 @@ index 31cb073..2e8a95a 100644 # CONFIG_XZ_DEC_ARM is not set # CONFIG_XZ_DEC_ARMTHUMB is not set -From f06ed380a59b6b336820510c6716db5bd9928e66 Mon Sep 17 00:00:00 2001 +From 219d0cd5afbcfc1d8d1bffc63c535c323ae8bf2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 1 May 2015 23:00:15 +0200 -Subject: [PATCH 69/85] BCM270x_DT: Add mailbox bcm2708-vcio +Subject: [PATCH 069/105] BCM270x_DT: Add mailbox bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -132295,10 +132295,10 @@ index 721559b..4a00561 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); -From ad4a25a7e27ffac5b4f5b9eba60c8588ec2e04c1 Mon Sep 17 00:00:00 2001 +From 3c10332d5214199b7df6d5d220eeef023706cbaf Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 70/85] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 070/105] rpi-ft5406: Add touchscreen driver for pi LCD display --- drivers/input/touchscreen/Kconfig | 7 + @@ -132615,10 +132615,11 @@ index cc284ed..d3ea839 100644 VCMSG_SET_CURSOR_STATE = 0x00008011, }; -From 4d11ea5e022aa484a8884a54d08bb5d3f26bed0b Mon Sep 17 00:00:00 2001 +From 10fe6a8ff8d397d392f84f71bccef590007c1035 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 71/85] Improve __copy_to_user and __copy_from_user performance +Subject: [PATCH 071/105] Improve __copy_to_user and __copy_from_user + performance Provide a __copy_from_user that uses memcpy. On BCM2708, use optimised memcpy/memmove/memcmp/memset implementations. @@ -134142,10 +134143,10 @@ index 3e58d71..0622891 100644 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) -From 961d37927bd0de6c86334892d19341f427a6d543 Mon Sep 17 00:00:00 2001 +From 55e619a1d22f898210f4d5df7056de9ca22262ef Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 May 2015 17:22:15 +0100 -Subject: [PATCH 72/85] bcm2835-audio: Create the platform device if the DT +Subject: [PATCH 072/105] bcm2835-audio: Create the platform device if the DT node is disabled For backwards compatibility, allow the built-in ALSA driver to be enabled @@ -134199,10 +134200,10 @@ index 4a00561..dec8043 100644 bcm_register_device_dt(&bcm2708_spi_device); -From 729ca6d5fc85ce618d61af67f400d1f20ddd2fbd Mon Sep 17 00:00:00 2001 +From 3a23003af149876e9459bf65f14eff38ddb57778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 3 Jun 2015 12:26:13 +0200 -Subject: [PATCH 73/85] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 073/105] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -134261,10 +134262,10 @@ index 70f2f39..f7fdacd 100644 static const char * const bcm2835_compat[] = { -From 9a645229a554cd9b0f211bd15310ceb4c61f32b2 Mon Sep 17 00:00:00 2001 +From a16205df7ca3759a05bf56e126d17fb496c12775 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 17:47:27 +0100 -Subject: [PATCH 74/85] platform: Add force_core command line setting to boot +Subject: [PATCH 074/105] platform: Add force_core command line setting to boot from a different core number --- @@ -134335,10 +134336,10 @@ index dec8043..fe71c50 100644 module_param(serial, uint, 0644); module_param(uart_clock, uint, 0644); -From 0733a658a5b233abd9da4157ab2bfd52ceebf404 Mon Sep 17 00:00:00 2001 +From d4fe01b4f1f6d84fb12a04e228edc19aea23865a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Jun 2015 17:46:17 +0100 -Subject: [PATCH 75/85] mach-bcm270x: Enable the building of pinctrl-bcm2835 +Subject: [PATCH 075/105] mach-bcm270x: Enable the building of pinctrl-bcm2835 --- drivers/pinctrl/Makefile | 1 + @@ -134357,10 +134358,10 @@ index 6eadf04..9119513 100644 obj-$(CONFIG_ARCH_BERLIN) += berlin/ obj-y += freescale/ -From 3c7dc45eee7c0339b72469bf6674e842385b7ab9 Mon Sep 17 00:00:00 2001 +From cd146348cbf2ff432f0cb3b05b0e0cf117dbba74 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 Jun 2015 16:41:39 +0100 -Subject: [PATCH 76/85] BCM270X_DT: Document the i2s-mmap overlay +Subject: [PATCH 076/105] BCM270X_DT: Document the i2s-mmap overlay --- arch/arm/boot/dts/overlays/README | 6 ++++++ @@ -134384,10 +134385,10 @@ index 3e08f98..7fa6d33 100644 Info: Configures the IQaudio DAC audio card Load: dtoverlay=iqaudio-dac -From d9fa11803a0d2e3b1eaf4041ddd0ca5651300d96 Mon Sep 17 00:00:00 2001 +From 88ffec3ff5b4505e53ee2fdcbc564fe734145ae6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 11:36:53 +0100 -Subject: [PATCH 77/85] bcm2835-sdhost: Improve error handling and recovery +Subject: [PATCH 077/105] bcm2835-sdhost: Improve error handling and recovery 1) Expose the hw_reset method to the MMC framework, removing many internal calls by the driver. @@ -135479,10 +135480,10 @@ index eef8a24..6277e43 100644 if (host->allow_dma) { -From 5920303037d30f0ecee57f83015cd8838ba1f77e Mon Sep 17 00:00:00 2001 +From afd5ae68ceec9ee73fb979c32ed1fd19ab6a1038 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:46 -0700 -Subject: [PATCH 78/85] ARM: bcm2835: Add the Raspberry Pi firmware driver +Subject: [PATCH 078/105] ARM: bcm2835: Add the Raspberry Pi firmware driver This gives us a function for making mailbox property channel requests of the firmware, which is most notable in that it will let us get and @@ -135530,7 +135531,7 @@ index 3fdd391..ee101a2 100644 obj-$(CONFIG_EFI) += efi/ diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c new file mode 100644 -index 0000000..dd506cd +index 0000000..dd506cd3 --- /dev/null +++ b/drivers/firmware/raspberrypi.c @@ -0,0 +1,260 @@ @@ -135916,10 +135917,10 @@ index 0000000..9d9efb7 + void *data, size_t tag_size); +struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node); -From c97b07c0494073a69820a78b6012dc62cb902144 Mon Sep 17 00:00:00 2001 +From c3629eb3fda93e5727602a1484daab7d08da61cb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 22 Mar 2015 13:33:23 +0000 -Subject: [PATCH 79/85] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING +Subject: [PATCH 079/105] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING --- arch/arm/configs/bcm2709_defconfig | 4 ++++ @@ -135971,10 +135972,11 @@ index 6a41231..cacde14 100644 CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_DRBD=m -From e547d7e94a85179d7ff7787eb95e29f0b0b657f4 Mon Sep 17 00:00:00 2001 +From 667729cc2a536b1cc6241973276fad1e72909f3a Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Mon, 22 Jun 2015 16:27:07 +0100 -Subject: [PATCH 80/85] Add rpi-ft5406 overlay Add rpi-ft5406 driver as module +Subject: [PATCH 080/105] Add rpi-ft5406 overlay Add rpi-ft5406 driver as + module --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -136060,10 +136062,10 @@ index cacde14..f952ff2 100644 CONFIG_TOUCHSCREEN_STMPE=m CONFIG_INPUT_MISC=y -From 9dea271e610d0524fad677b9cccdd3be84ab25da Mon Sep 17 00:00:00 2001 +From b2d8f6a978e70e941859cc4cfacaee8121f71b7c Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 23 Jun 2015 09:53:40 +0100 -Subject: [PATCH 81/85] Fix driver detection failure Check that the buffer +Subject: [PATCH 081/105] Fix driver detection failure Check that the buffer response is non-zero meaning the touchscreen was detected --- @@ -136084,10 +136086,10 @@ index f55151b..d41851d 100644 dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", request.tag.val); } -From 8ad2b6ac33fca9a40238c42fdd2b5ed840c2fc8d Mon Sep 17 00:00:00 2001 +From 47e896b8d1e0614ae8dc7a01b037d3d30bd87bf1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 13:24:01 +0100 -Subject: [PATCH 82/85] config: Enable 8250 serial port +Subject: [PATCH 082/105] config: Enable 8250 serial port --- arch/arm/configs/bcm2709_defconfig | 7 +++++++ @@ -136135,10 +136137,10 @@ index f952ff2..0c25d8b 100644 CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_BCM2835=m -From cc78a5ef74fc67465fdacffe452a5fab5848b33c Mon Sep 17 00:00:00 2001 +From e6e9f242d287b3fa1008ef3bfdac211906587585 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 14:10:58 +0100 -Subject: [PATCH 83/85] config: Enable POWER_RESET_GPIO +Subject: [PATCH 083/105] config: Enable POWER_RESET_GPIO --- arch/arm/configs/bcm2709_defconfig | 2 ++ @@ -136172,10 +136174,10 @@ index 0c25d8b..e757db6 100644 CONFIG_THERMAL=y CONFIG_THERMAL_BCM2835=y -From 01f5e319010c90770e0c8a87656c360a18a35208 Mon Sep 17 00:00:00 2001 +From acfa836e00324826a1aa3dc816d7dc5f4b5d5790 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 26 Jun 2015 17:37:38 +0100 -Subject: [PATCH 84/85] bcm2708-vcio: Remove restriction of only a single +Subject: [PATCH 084/105] bcm2708-vcio: Remove restriction of only a single instance being open We need more than one process to be able to use mailbox interface (e.g. HW cursor in fbturbo and hello_fft). @@ -136220,10 +136222,10 @@ index d91672b..06fb2c2f 100644 return 0; -From 2cdae3dcbcca3d818f64d14580f22c67e32d851c Mon Sep 17 00:00:00 2001 +From 7f23eccb28dd764cf1af231fdc69bc9f93db4972 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:39:19 +0100 -Subject: [PATCH 85/85] BCM270X_DT: Create a "core" clock, use it for SPI and +Subject: [PATCH 085/105] BCM270X_DT: Create a "core" clock, use it for SPI and sdhost --- @@ -136373,3 +136375,1790 @@ index b408ab4..897204a 100644 - sdhost_freq = <&clk_sdhost>,"clock-frequency:0"; }; }; + +From f64348123913a79fd145c5208039c8f66c0c4252 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 24 Jun 2015 09:24:31 +0100 +Subject: [PATCH 086/105] BCM270X_DT: Add MCP7941X to i2c-rtc overlay + +--- + arch/arm/boot/dts/overlays/README | 3 +++ + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 6 ++++++ + 2 files changed, 9 insertions(+) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index aa09b6c..425eb19 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -253,6 +253,8 @@ Params: ds1307 Select the DS1307 device + + ds3231 Select the DS3231 device + ++ mcp7941x Select the MCP7941x device ++ + pcf2127 Select the PCF2127 device + + pcf8523 Select the PCF8523 device +@@ -396,6 +398,7 @@ Params: speed Display SPI bus speed + + xohms Touchpanel sensitivity (X-plate resistance) + ++ + Name: rpi-ft5406 + Info: Official Raspberry Pi display touchscreen + Load: dtoverlay=rpi-ft5406 +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +index 6bccfdc..7052c71 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -17,6 +17,11 @@ + reg = <0x68>; + status = "disable"; + }; ++ mcp7941x: mcp7941x@6f { ++ compatible = "microchip,mcp7941x"; ++ reg = <0x6f>; ++ status = "disable"; ++ }; + ds3231: ds3231@68 { + compatible = "maxim,ds3231"; + reg = <0x68>; +@@ -42,6 +47,7 @@ + __overrides__ { + ds1307 = <&ds1307>,"status"; + ds3231 = <&ds3231>,"status"; ++ mcp7941x = <&mcp7941x>,"status"; + pcf2127 = <&pcf2127>,"status"; + pcf8523 = <&pcf8523>,"status"; + pcf8563 = <&pcf8563>,"status"; + +From 57fd1fbaa2d9281f2b9d70c8d15dbaa201af2b71 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Wed, 24 Jun 2015 11:23:06 +0100 +Subject: [PATCH 087/105] dts/overlays: document DHT11 overlay + +--- + arch/arm/boot/dts/overlays/README | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 425eb19..9406cf3 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -173,6 +173,14 @@ Load: dtoverlay=bmp085_i2c-sensor + Params: + + ++Name: dht11 ++Info: Overlay for the DHT11/DHT21/DHT22 humidity/temperature sensors ++ Also sometimes found with the part number(s) AM230x. ++Load: dtoverlay=dht11,= ++Params: gpiopin GPIO connected to the sensor's DATA output. ++ (default 4) ++ ++ + [ The ds1307-rtc overlay has been deleted. See i2c-rtc. ] + + + +From e072d9e5801bb111be321dff6feadd5c12e8d2ad Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 25 Jun 2015 12:16:11 +0100 +Subject: [PATCH 088/105] gpio-poweroff: Allow it to work on Raspberry Pi + +The Raspberry Pi firmware manages the power-down and reboot +process. To do this it installs a pm_power_off handler, causing +the gpio-poweroff module to abort the probe function. + +This patch introduces a "force" DT property that overrides that +behaviour, and also adds a DT overlay to enable and control it. + +Note that running in an active-low configuration (DT parameter +"active_low") requires a custom dt-blob.bin and probably won't +allow a reboot without switching off, so an external inversion +of the trigger signal may be preferable. +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 13 +++++++++ + .../boot/dts/overlays/gpio-poweroff-overlay.dts | 34 ++++++++++++++++++++++ + drivers/power/reset/gpio-poweroff.c | 4 ++- + 4 files changed, 51 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 19eef3c..a1397c7 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -16,6 +16,7 @@ dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += gpio-poweroff-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += hifiberry-amp-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += hifiberry-dac-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += hifiberry-dacplus-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 9406cf3..0ed7094 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -192,6 +192,19 @@ Params: int_pin GPIO used for INT (default 25) + speed SPI bus speed (default 12000000) + + ++Name: gpio-poweroff ++Info: Drives a GPIO high or low on reboot ++Load: gpio-poweroff,= ++Params: gpiopin GPIO for signalling (default 26) ++ ++ active_low Set if the power control device requires a ++ high->low transition to trigger a power-down. ++ Note that this will require the support of a ++ custom dt-blob.bin to prevent a power-down ++ during the boot process, and that a reboot ++ will also cause the pin to go low. ++ ++ + Name: hifiberry-amp + Info: Configures the HifiBerry Amp and Amp+ audio cards + Load: dtoverlay=hifiberry-amp +diff --git a/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts b/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts +new file mode 100644 +index 0000000..ff8cb36 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts +@@ -0,0 +1,34 @@ ++// Definitions for gpio-poweroff module ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/"; ++ __overlay__ { ++ power_ctrl: power_ctrl { ++ compatible = "gpio-poweroff"; ++ gpios = <&gpio 26 0>; ++ force; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ power_ctrl_pins: power_ctrl_pins { ++ brcm,pins = <26>; ++ brcm,function = <1>; // out ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ gpiopin = <&power_ctrl>,"gpios:4", ++ <&power_ctrl_pins>,"brcm,pins:0"; ++ active_low = <&power_ctrl>,"gpios:8"; ++ }; ++}; +diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c +index e5332f1..6e3fec2 100644 +--- a/drivers/power/reset/gpio-poweroff.c ++++ b/drivers/power/reset/gpio-poweroff.c +@@ -48,9 +48,11 @@ static void gpio_poweroff_do_poweroff(void) + static int gpio_poweroff_probe(struct platform_device *pdev) + { + bool input = false; ++ bool force = false; + + /* If a pm_power_off function has already been added, leave it alone */ +- if (pm_power_off != NULL) { ++ force = of_property_read_bool(pdev->dev.of_node, "force"); ++ if (!force && (pm_power_off != NULL)) { + dev_err(&pdev->dev, + "%s: pm_power_off function already registered", + __func__); + +From 45567cec8e8dc1be2d45fead5332258d3a49a088 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 17 Jun 2015 17:10:40 +0100 +Subject: [PATCH 089/105] BCM270x_DT: Default Compute Module i2c, i2s and spi + support + +--- + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 67 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 67 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index e82fcb2..af252bd 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -10,10 +10,77 @@ + status = "okay"; + }; + ++&gpio { ++ spi0_pins: spi0_pins { ++ brcm,pins = <7 8 9 10 11>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++ ++ i2c0_pins: i2c0 { ++ brcm,pins = <0 1>; ++ brcm,function = <4>; ++ }; ++ ++ i2c1_pins: i2c1 { ++ brcm,pins = <2 3>; ++ brcm,function = <4>; ++ }; ++ ++ i2s_pins: i2s { ++ brcm,pins = <18 19 20 21>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins>; ++ ++ spidev@0{ ++ compatible = "spidev"; ++ reg = <0>; /* CE0 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <500000>; ++ }; ++ ++ spidev@1{ ++ compatible = "spidev"; ++ reg = <1>; /* CE1 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <500000>; ++ }; ++}; ++ ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&i2s { ++ #sound-dai-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_pins>; ++}; ++ + / { + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ i2s = <&i2s>,"status"; ++ spi = <&spi0>,"status"; ++ i2c0 = <&i2c0>,"status"; ++ i2c1 = <&i2c1>,"status"; ++ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; ++ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + }; + }; + +From 2c610cb4fa176ac54d4e32a4744761aa9c600f3c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 22 Jun 2015 14:21:55 +0100 +Subject: [PATCH 090/105] BCM270X_DT: Sort nodes by bus address, and + consolidate aliases + +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 19 ---------- + arch/arm/boot/dts/bcm2708-rpi-b.dts | 19 ---------- + arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 21 ----------- + arch/arm/boot/dts/bcm2708_common.dtsi | 63 +++++++++++++++++++++++--------- + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 19 ---------- + 5 files changed, 46 insertions(+), 95 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index 3b252dc..9af99b8 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -5,25 +5,6 @@ + / { + compatible = "brcm,bcm2708"; + model = "Raspberry Pi Model B+"; +- +- aliases { +- soc = &soc; +- spi0 = &spi0; +- i2c0 = &i2c0; +- i2c1 = &i2c1; +- i2s = &i2s; +- gpio = &gpio; +- intc = &intc; +- leds = &leds; +- audio = &audio; +- sound = &sound; +- uart0 = &uart0; +- uart1 = &uart1; +- clocks = &clocks; +- }; +- +- sound: sound { +- }; + }; + + &gpio { +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 40fded1..092d15d 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -5,25 +5,6 @@ + / { + compatible = "brcm,bcm2708"; + model = "Raspberry Pi Model B"; +- +- aliases { +- soc = &soc; +- spi0 = &spi0; +- i2c0 = &i2c0; +- i2c1 = &i2c1; +- i2s = &i2s; +- gpio = &gpio; +- intc = &intc; +- leds = &leds; +- audio = &audio; +- sound = &sound; +- uart0 = &uart0; +- uart1 = &uart1; +- clocks = &clocks; +- }; +- +- sound: sound { +- }; + }; + + &gpio { +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +index 3da7d3b..34d4bc6 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +@@ -1,26 +1,5 @@ + /include/ "bcm2708.dtsi" + +-/ { +- aliases { +- soc = &soc; +- spi0 = &spi0; +- i2c0 = &i2c0; +- i2c1 = &i2c1; +- i2s = &i2s; +- gpio = &gpio; +- intc = &intc; +- leds = &leds; +- audio = &audio; +- sound = &sound; +- uart0 = &uart0; +- uart1 = &uart1; +- clocks = &clocks; +- }; +- +- sound: sound { +- }; +-}; +- + &leds { + act_led: act { + label = "led0"; +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index 4a975dfd..b71b208 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -3,6 +3,31 @@ + / { + interrupt-parent = <&intc>; + ++ aliases { ++ audio = &audio; ++ sound = &sound; ++ soc = &soc; ++ dma = &dma; ++ intc = &intc; ++ watchdog = &watchdog; ++ random = &random; ++ mailbox = &mailbox; ++ gpio = &gpio; ++ uart0 = &uart0; ++ i2s = &i2s; ++ spi0 = &spi0; ++ i2c0 = &i2c0; ++ uart1 = &uart1; ++ mmc = &mmc; ++ i2c1 = &i2c1; ++ usb = &usb; ++ leds = &leds; ++ fb = &fb; ++ vchiq = &vchiq; ++ thermal = &thermal; ++ clocks = &clocks; ++ }; ++ + /* Onboard audio */ + audio: audio { + compatible = "brcm,bcm2835-audio"; +@@ -10,6 +35,10 @@ + status = "disabled"; + }; + ++ /* External sound card */ ++ sound: sound { ++ }; ++ + soc: soc { + compatible = "simple-bus"; + #address-cells = <1>; +@@ -43,6 +72,12 @@ + #interrupt-cells = <2>; + }; + ++ mailbox: mailbox@7e00b800 { ++ compatible = "brcm,bcm2708-vcio"; ++ reg = <0x7e00b880 0x40>; ++ interrupts = <0 1>; ++ }; ++ + watchdog: watchdog@7e100000 { + compatible = "brcm,bcm2835-pm-wdt"; + reg = <0x7e100000 0x28>; +@@ -55,12 +90,6 @@ + status = "disabled"; + }; + +- mailbox: mailbox@7e00b800 { +- compatible = "brcm,bcm2708-vcio"; +- reg = <0x7e00b880 0x40>; +- interrupts = <0 1>; +- }; +- + gpio: gpio { + compatible = "brcm,bcm2835-gpio"; + reg = <0x7e200000 0xb4>; +@@ -73,17 +102,6 @@ + #interrupt-cells = <2>; + }; + +- mmc: mmc@7e300000 { +- compatible = "brcm,bcm2835-mmc"; +- reg = <0x7e300000 0x100>; +- interrupts = <2 30>; +- clocks = <&clk_mmc>; +- dmas = <&dma 11>, +- <&dma 11>; +- dma-names = "tx", "rx"; +- status = "disabled"; +- }; +- + uart0: uart@7e201000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7e201000 0x1000>; +@@ -144,6 +162,17 @@ + status = "disabled"; + }; + ++ mmc: mmc@7e300000 { ++ compatible = "brcm,bcm2835-mmc"; ++ reg = <0x7e300000 0x100>; ++ interrupts = <2 30>; ++ clocks = <&clk_mmc>; ++ dmas = <&dma 11>, ++ <&dma 11>; ++ dma-names = "tx", "rx"; ++ status = "disabled"; ++ }; ++ + i2c1: i2c@7e804000 { + compatible = "brcm,bcm2708-i2c"; + reg = <0x7e804000 0x1000>; +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index 24fa849..ccb9c31 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -5,25 +5,6 @@ + / { + compatible = "brcm,bcm2709"; + model = "Raspberry Pi 2 Model B"; +- +- aliases { +- soc = &soc; +- spi0 = &spi0; +- i2c0 = &i2c0; +- i2c1 = &i2c1; +- i2s = &i2s; +- gpio = &gpio; +- intc = &intc; +- leds = &leds; +- audio = &audio; +- sound = &sound; +- uart0 = &uart0; +- uart1 = &uart1; +- clocks = &clocks; +- }; +- +- sound: sound { +- }; + }; + + &gpio { + +From dab507d5936f3847a320b11be5a21b4c25c4601b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 22 Jun 2015 14:23:03 +0100 +Subject: [PATCH 091/105] i2c-bcm2708/BCM270X_DT: Add support for I2C2 + +The third I2C bus (I2C2) is normally reserved for HDMI use. Careless +use of this bus can break an attached display - use with caution. + +It is recommended to disable accesses by VideoCore by setting +hdmi_ignore_edid=1 or hdmi_edid_file=1 in config.txt. + +The interface is disabled by default - enable using the +i2c2_iknowwhatimdoing DT parameter. +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 6 ++++++ + arch/arm/boot/dts/bcm2708-rpi-b.dts | 6 ++++++ + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 6 ++++++ + arch/arm/boot/dts/bcm2708_common.dtsi | 14 ++++++++++++++ + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 6 ++++++ + drivers/i2c/busses/i2c-bcm2708.c | 5 ++++- + 6 files changed, 42 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index 9af99b8..e3ae8e6 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -75,6 +75,10 @@ + clock-frequency = <100000>; + }; + ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ + &i2s { + #sound-dai-cells = <0>; + pinctrl-names = "default"; +@@ -103,8 +107,10 @@ + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; + i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 092d15d..18ca7a2 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -75,6 +75,10 @@ + clock-frequency = <100000>; + }; + ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ + &i2s { + #sound-dai-cells = <0>; + pinctrl-names = "default"; +@@ -97,8 +101,10 @@ + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; + i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index af252bd..bddc369 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -65,6 +65,10 @@ + clock-frequency = <100000>; + }; + ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ + &i2s { + #sound-dai-cells = <0>; + pinctrl-names = "default"; +@@ -79,8 +83,10 @@ + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; + i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + }; + }; +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index b71b208..8181a4e 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -20,6 +20,7 @@ + uart1 = &uart1; + mmc = &mmc; + i2c1 = &i2c1; ++ i2c2 = &i2c2; + usb = &usb; + leds = &leds; + fb = &fb; +@@ -183,6 +184,19 @@ + status = "disabled"; + }; + ++ i2c2: i2c@7e805000 { ++ // Beware - this is shared with the HDMI module. ++ // Careless use may break (really) your display. ++ // Caveat emptor. ++ compatible = "brcm,bcm2708-i2c"; ++ reg = <0x7e805000 0x1000>; ++ interrupts = <2 21>; ++ clocks = <&clk_i2c>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ }; ++ + usb: usb@7e980000 { + compatible = "brcm,bcm2708-usb"; + reg = <0x7e980000 0x10000>, +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index ccb9c31..76d44a2 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -75,6 +75,10 @@ + clock-frequency = <100000>; + }; + ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ + &i2s { + #sound-dai-cells = <0>; + pinctrl-names = "default"; +@@ -103,8 +107,10 @@ + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; + i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; + core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; +diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c +index 8773203..7a24fbe 100644 +--- a/drivers/i2c/busses/i2c-bcm2708.c ++++ b/drivers/i2c/busses/i2c-bcm2708.c +@@ -407,8 +407,11 @@ static int bcm2708_i2c_probe(struct platform_device *pdev) + case 1: + adap->class = I2C_CLASS_DDC; + break; ++ case 2: ++ adap->class = I2C_CLASS_DDC; ++ break; + default: +- dev_err(&pdev->dev, "can only bind to BSC 0 or 1\n"); ++ dev_err(&pdev->dev, "can only bind to BSC 0, 1 or 2\n"); + err = -ENXIO; + goto out_free_bi; + } + +From c887101553aed347b4e0e29422cd5a7315cce18a Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 29 Jun 2015 12:14:02 +0100 +Subject: [PATCH 092/105] BCM270X_DT: Correct the lirc-rpi overlay + documentation + +The polarity of the "sense" parameter was inverted with respect to reality. + +See: https://github.com/raspberrypi/linux/issues/1038 +--- + arch/arm/boot/dts/overlays/README | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 0ed7094..ec762d2 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -313,8 +313,8 @@ Params: gpio_out_pin GPIO for output (default "17") + (default "down") + + sense Override the IR receive auto-detection logic: +- "1" = force active high +- "0" = force active low ++ "0" = force active-high ++ "1" = force active-low + "-1" = use auto-detection + (default "-1") + + +From b55c8ef4eab8f62f3087bcdf4eb9a603105d16fb Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 25 Jun 2015 08:47:09 +0100 +Subject: [PATCH 093/105] bcm2835-sdhost: Further improve overclock back-off + +--- + drivers/mmc/host/bcm2835-sdhost.c | 144 +++++++++++++++++++++----------------- + 1 file changed, 78 insertions(+), 66 deletions(-) + +diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c +index 6277e43..a03db06 100644 +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -161,8 +161,6 @@ struct bcm2835_host { + + unsigned int use_busy:1; /* Wait for busy interrupt */ + +- unsigned int reduce_overclock:1; /* ...at the next opportunity */ +- + unsigned int debug:1; /* Enable debug output */ + + u32 thread_isr; +@@ -466,36 +464,25 @@ static void bcm2835_sdhost_dma_complete(void *param) + spin_unlock_irqrestore(&host->lock, flags); + } + +-static bool data_transfer_wait(struct bcm2835_host *host, const char *caller) ++static bool data_transfer_wait(struct bcm2835_host *host) + { + unsigned long timeout = 1000000; +- u32 hsts; + while (timeout) + { +- hsts = bcm2835_sdhost_read(host, SDHSTS); +- if (hsts & (SDHSTS_TRANSFER_ERROR_MASK | +- SDHSTS_DATA_FLAG)) { +- bcm2835_sdhost_write(host, SDHSTS_TRANSFER_ERROR_MASK, +- SDHSTS); ++ u32 sdhsts = bcm2835_sdhost_read(host, SDHSTS); ++ if (sdhsts & SDHSTS_DATA_FLAG) { ++ bcm2835_sdhost_write(host, SDHSTS_DATA_FLAG, SDHSTS); + break; + } + timeout--; + } +- +- if (hsts & (SDHSTS_CRC16_ERROR | +- SDHSTS_CRC7_ERROR | +- SDHSTS_FIFO_ERROR)) { +- pr_err("%s: data error in %s - HSTS %x\n", +- mmc_hostname(host->mmc), caller, hsts); +- host->data->error = -EILSEQ; +- return false; +- } else if ((timeout == 0) || +- (hsts & (SDHSTS_CMD_TIME_OUT | +- SDHSTS_REW_TIME_OUT))) { +- pr_err("%s: timeout in %s - HSTS %x\n", +- mmc_hostname(host->mmc), caller, hsts); +- host->data->error = -ETIMEDOUT; +- return false; ++ if (timeout == 0) { ++ pr_err("%s: Data %s timeout\n", ++ mmc_hostname(host->mmc), ++ (host->data->flags & MMC_DATA_READ) ? "read" : "write"); ++ bcm2835_sdhost_dumpregs(host); ++ host->data->error = -ETIMEDOUT; ++ return false; + } + return true; + } +@@ -523,7 +510,7 @@ static void bcm2835_sdhost_read_block_pio(struct bcm2835_host *host) + buf = (u32 *)host->sg_miter.addr; + + while (len) { +- if (!data_transfer_wait(host, "read_block_pio")) ++ if (!data_transfer_wait(host)) + break; + + *(buf++) = bcm2835_sdhost_read(host, SDDATA); +@@ -562,7 +549,7 @@ static void bcm2835_sdhost_write_block_pio(struct bcm2835_host *host) + buf = host->sg_miter.addr; + + while (len) { +- if (!data_transfer_wait(host, "write_block_pio")) ++ if (!data_transfer_wait(host)) + break; + + bcm2835_sdhost_write(host, *(buf++), SDDATA); +@@ -581,13 +568,33 @@ static void bcm2835_sdhost_write_block_pio(struct bcm2835_host *host) + + static void bcm2835_sdhost_transfer_pio(struct bcm2835_host *host) + { ++ u32 sdhsts; ++ bool is_read; + BUG_ON(!host->data); + +- if (host->data->flags & MMC_DATA_READ) { ++ is_read = (host->data->flags & MMC_DATA_READ) != 0; ++ if (is_read) + bcm2835_sdhost_read_block_pio(host); +- } else { ++ else + bcm2835_sdhost_write_block_pio(host); + ++ sdhsts = bcm2835_sdhost_read(host, SDHSTS); ++ if (sdhsts & (SDHSTS_CRC16_ERROR | ++ SDHSTS_CRC7_ERROR | ++ SDHSTS_FIFO_ERROR)) { ++ pr_err("%s: %s transfer error - HSTS %x\n", ++ mmc_hostname(host->mmc), ++ is_read ? "read" : "write", ++ sdhsts); ++ host->data->error = -EILSEQ; ++ } else if ((sdhsts & (SDHSTS_CMD_TIME_OUT | ++ SDHSTS_REW_TIME_OUT))) { ++ pr_err("%s: %s timeout error - HSTS %x\n", ++ mmc_hostname(host->mmc), ++ is_read ? "read" : "write", ++ sdhsts); ++ host->data->error = -ETIMEDOUT; ++ } else if (!is_read && !host->data->error) { + /* Start a timer in case a transfer error occurs because + there is no error interrupt */ + mod_timer(&host->pio_timer, jiffies + host->pio_timeout); +@@ -701,8 +708,9 @@ static void bcm2835_sdhost_prepare_data(struct bcm2835_host *host, struct mmc_co + + void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command *cmd) + { +- u32 sdcmd; ++ u32 sdcmd, sdhsts; + unsigned long timeout; ++ int delay; + + WARN_ON(host->cmd); + +@@ -719,8 +727,8 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + mmc_hostname(host->mmc), + cmd->opcode, cmd->arg, cmd->flags); + +- /* Wait max 10 ms */ +- timeout = 1000; ++ /* Wait max 100 ms */ ++ timeout = 10000; + + while (bcm2835_sdhost_read(host, SDCMD) & SDCMD_NEW_FLAG) { + if (timeout == 0) { +@@ -735,8 +743,9 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + udelay(10); + } + +- if ((1000-timeout)/100 > 1 && (1000-timeout)/100 > host->max_delay) { +- host->max_delay = (1000-timeout)/100; ++ delay = (10000 - timeout)/100; ++ if (delay > host->max_delay) { ++ host->max_delay = delay; + pr_warning("%s: controller hung for %d ms\n", + mmc_hostname(host->mmc), + host->max_delay); +@@ -751,6 +760,11 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + + host->cmd = cmd; + ++ /* Clear any error flags */ ++ sdhsts = bcm2835_sdhost_read(host, SDHSTS); ++ if (sdhsts & SDHSTS_ERROR_MASK) ++ bcm2835_sdhost_write(host, sdhsts, SDHSTS); ++ + bcm2835_sdhost_prepare_data(host, cmd); + + bcm2835_sdhost_write(host, cmd->arg, SDARG); +@@ -876,7 +890,7 @@ static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host) + static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + { + u32 sdcmd; +- int timeout = 1000; ++ unsigned long timeout; + #ifdef DEBUG + struct timeval before, after; + int timediff = 0; +@@ -889,6 +903,8 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + #ifdef DEBUG + do_gettimeofday(&before); + #endif ++ /* Wait max 100 ms */ ++ timeout = 10000; + for (sdcmd = bcm2835_sdhost_read(host, SDCMD); + (sdcmd & SDCMD_NEW_FLAG) && timeout; + timeout--) { +@@ -1049,9 +1065,9 @@ static void bcm2835_sdhost_pio_timeout(unsigned long data) + spin_lock_irqsave(&host->lock, flags); + + if (host->data) { +- u32 hsts = bcm2835_sdhost_read(host, SDHSTS); ++ u32 sdhsts = bcm2835_sdhost_read(host, SDHSTS); + +- if (hsts & SDHSTS_REW_TIME_OUT) { ++ if (sdhsts & SDHSTS_REW_TIME_OUT) { + pr_err("%s: transfer timeout\n", + mmc_hostname(host->mmc)); + if (host->debug) +@@ -1380,19 +1396,10 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + if (host->debug) + pr_info("%s: set_clock(%d)\n", mmc_hostname(host->mmc), clock); + +- if ((clock == 0) && host->reduce_overclock) { +- /* This is a reset following data corruption - reduce any +- overclock */ +- host->reduce_overclock = 0; +- if (host->overclock_50 > 50) { +- pr_warn("%s: reducing overclock due to errors\n", +- mmc_hostname(host->mmc)); +- host->overclock_50--; +- } +- } +- +- if (host->overclock_50 && (clock == 50*MHZ)) ++ if ((host->overclock_50 > 50) && ++ (clock == 50*MHZ)) { + clock = host->overclock_50 * MHZ + (MHZ - 1); ++ } + + /* The SDCDIV register has 11 bits, and holds (div - 2). + But in data mode the max is 50MHz wihout a minimum, and only the +@@ -1450,11 +1457,12 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + host->overclock = clock; + } + } +- else if ((clock == 50 * MHZ) && host->overclock) ++ else if (host->overclock) + { +- pr_warn("%s: cancelling overclock\n", +- mmc_hostname(host->mmc)); + host->overclock = 0; ++ if (clock == 50 * MHZ) ++ pr_warn("%s: cancelling overclock\n", ++ mmc_hostname(host->mmc)); + } + + host->cdiv = div; +@@ -1492,6 +1500,14 @@ static void bcm2835_sdhost_request(struct mmc_host *mmc, struct mmc_request *mrq + cmd->opcode, cmd->arg, cmd->flags); + } + ++ /* Reset the error statuses in case this is a retry */ ++ if (mrq->cmd) ++ mrq->cmd->error = 0; ++ if (mrq->data) ++ mrq->data->error = 0; ++ if (mrq->stop) ++ mrq->stop->error = 0; ++ + if (mrq->data && !is_power_of_2(mrq->data->blksz)) { + pr_err("%s: unsupported block size (%d bytes)\n", + mmc_hostname(mmc), mrq->data->blksz); +@@ -1613,21 +1629,16 @@ static void bcm2835_sdhost_tasklet_finish(unsigned long param) + + /* Drop the overclock after any data corruption, or after any + error overclocked */ +- if (mrq->data && (mrq->data->error == -EILSEQ)) +- host->reduce_overclock = 1; +- else if (host->overclock) { +- /* Convert timeout errors while overclocked to data errors, +- because the system recovers better. */ +- if (mrq->cmd && mrq->cmd->error) { +- host->reduce_overclock = 1; +- if (mrq->cmd->error == -ETIMEDOUT) +- mrq->cmd->error = -EILSEQ; +- } +- +- if (mrq->data && mrq->data->error) { +- host->reduce_overclock = 1; +- if (mrq->data->error == -ETIMEDOUT) +- mrq->data->error = -EILSEQ; ++ if (host->overclock) { ++ if ((mrq->cmd && mrq->cmd->error) || ++ (mrq->data && mrq->data->error) || ++ (mrq->stop && mrq->stop->error)) { ++ host->overclock_50--; ++ pr_warn("%s: reducing overclock due to errors\n", ++ mmc_hostname(host->mmc)); ++ bcm2835_sdhost_set_clock(host,50*MHZ); ++ mrq->cmd->error = -EILSEQ; ++ mrq->cmd->retries = 1; + } + } + +@@ -1769,6 +1780,7 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) + host = mmc_priv(mmc); + host->mmc = mmc; + host->pio_timeout = msecs_to_jiffies(500); ++ host->max_delay = 1; /* Warn if over 1ms */ + spin_lock_init(&host->lock); + + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + +From 3d5ba5c480137b87aaee59c14f8e486e747cd450 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 30 Jun 2015 10:28:59 +0100 +Subject: [PATCH 094/105] i2c-bcm2708: Increase timeouts to allow larger + transfers + +Use the timeout value provided by the I2C_TIMEOUT ioctl when waiting +for completion. The default timeout is 1 second. + +See: https://github.com/raspberrypi/linux/issues/260 +--- + drivers/i2c/busses/i2c-bcm2708.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c +index 7a24fbe..8b8762d 100644 +--- a/drivers/i2c/busses/i2c-bcm2708.c ++++ b/drivers/i2c/busses/i2c-bcm2708.c +@@ -67,10 +67,9 @@ + #define BSC_S_DONE 0x00000002 + #define BSC_S_TA 0x00000001 + +-#define I2C_TIMEOUT_MS 150 +-#define I2C_WAIT_LOOP_COUNT 40 ++#define I2C_WAIT_LOOP_COUNT 200 + +-#define DRV_NAME "bcm2708_i2c" ++#define DRV_NAME "bcm2708_i2c" + + static unsigned int baudrate = CONFIG_I2C_BCM2708_BAUDRATE; + module_param(baudrate, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); +@@ -305,7 +304,7 @@ static int bcm2708_i2c_master_xfer(struct i2c_adapter *adap, + goto error_timeout; + } + +- ret = wait_for_completion_timeout(&bi->done, msecs_to_jiffies(I2C_TIMEOUT_MS)); ++ ret = wait_for_completion_timeout(&bi->done, adap->timeout); + if (ret == 0) { + dev_err(&adap->dev, "transfer timed out\n"); + goto error_timeout; + +From 31a5408b0734bc64969ab91be9cb3c1d898d655a Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 30 Jun 2015 10:33:52 +0100 +Subject: [PATCH 095/105] spi-bcm2708: Increase timeout from 150ms to 1s + +See: https://github.com/raspberrypi/linux/issues/260 +--- + drivers/spi/spi-bcm2708.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/spi/spi-bcm2708.c b/drivers/spi/spi-bcm2708.c +index 041b5e2..5c0214e 100644 +--- a/drivers/spi/spi-bcm2708.c ++++ b/drivers/spi/spi-bcm2708.c +@@ -70,9 +70,9 @@ + #define SPI_CS_CS_10 0x00000002 + #define SPI_CS_CS_01 0x00000001 + +-#define SPI_TIMEOUT_MS 150 ++#define SPI_TIMEOUT_MS 1000 + +-#define DRV_NAME "bcm2708_spi" ++#define DRV_NAME "bcm2708_spi" + + struct bcm2708_spi { + spinlock_t lock; + +From c66c0c2993daff0c44d7daae71421b1404f92233 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 15 Jun 2015 09:59:38 +0100 +Subject: [PATCH 096/105] bcm2708-spi: Don't use static pin configuration with + DT + +Also remove superfluous error checking - the SPI framework ensures the +validity of the chip_select value. +--- + drivers/spi/spi-bcm2708.c | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/drivers/spi/spi-bcm2708.c b/drivers/spi/spi-bcm2708.c +index 5c0214e..781c747 100644 +--- a/drivers/spi/spi-bcm2708.c ++++ b/drivers/spi/spi-bcm2708.c +@@ -386,14 +386,6 @@ static int bcm2708_spi_setup(struct spi_device *spi) + if (bs->stopping) + return -ESHUTDOWN; + +- if (!(spi->mode & SPI_NO_CS) && +- (spi->chip_select > spi->master->num_chipselect)) { +- dev_dbg(&spi->dev, +- "setup: invalid chipselect %u (%u defined)\n", +- spi->chip_select, spi->master->num_chipselect); +- return -EINVAL; +- } +- + state = spi->controller_state; + if (!state) { + state = kzalloc(sizeof(*state), GFP_KERNEL); +@@ -496,7 +488,8 @@ static int bcm2708_spi_probe(struct platform_device *pdev) + return PTR_ERR(clk); + } + +- bcm2708_init_pinmode(); ++ if (!pdev->dev.of_node) ++ bcm2708_init_pinmode(); + + master = spi_alloc_master(&pdev->dev, sizeof(*bs)); + if (!master) { + +From fb8c469783f4521176bebb9de94b6b456b4c35bb Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 15 Jun 2015 10:10:59 +0100 +Subject: [PATCH 097/105] bcm2708-i2s: Don't use static pin configuration with + DT + +--- + sound/soc/bcm/bcm2708-i2s.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/bcm/bcm2708-i2s.c b/sound/soc/bcm/bcm2708-i2s.c +index a515992..5e93cd6 100644 +--- a/sound/soc/bcm/bcm2708-i2s.c ++++ b/sound/soc/bcm/bcm2708-i2s.c +@@ -409,8 +409,8 @@ static int bcm2708_i2s_hw_params(struct snd_pcm_substream *substream, + if (csreg & (BCM2708_I2S_TXON | BCM2708_I2S_RXON)) + return 0; + +- +- bcm2708_i2s_setup_gpio(); ++ if (!dev->dev->of_node) ++ bcm2708_i2s_setup_gpio(); + + /* + * Adjust the data length according to the format. + +From 68df7b46c42bd73c44ae405adbd12be35e308a2b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 30 Jun 2015 14:12:42 +0100 +Subject: [PATCH 098/105] serial: 8250: Don't crash when nr_uarts is 0 + +--- + drivers/tty/serial/8250/8250_core.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c +index 4506e40..f03a19a 100644 +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -3262,6 +3262,8 @@ static void __init serial8250_isa_init_ports(void) + + if (nr_uarts > UART_NR) + nr_uarts = UART_NR; ++ if (!nr_uarts) ++ return; + + for (i = 0; i < nr_uarts; i++) { + struct uart_8250_port *up = &serial8250_ports[i]; + +From 3ceec0b963f3001adaa523d65508cc54a6f93cd0 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 26 Jun 2015 08:50:11 +0100 +Subject: [PATCH 099/105] BCM270X_DT: Add overlay to enable uart1 + +N.B. The UART1 clock is derived from the core clock. The firmware +will update clock-frequency if core_freq is set, but be aware +that unless force_turbo=1 while overclocking then the baud rate +will vary with ARM activity. +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 1 + + arch/arm/boot/dts/bcm2708-rpi-b.dts | 1 + + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 1 + + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 1 + + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 8 ++++++ + arch/arm/boot/dts/overlays/uart1-overlay.dts | 38 ++++++++++++++++++++++++++++ + arch/arm/configs/bcm2709_defconfig | 2 +- + arch/arm/configs/bcmrpi_defconfig | 2 +- + 9 files changed, 53 insertions(+), 2 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/uart1-overlay.dts + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index e3ae8e6..3ad2e0d 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -103,6 +103,7 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ uart1_clkrate = <&uart1>,"clock-frequency:0"; + i2s = <&i2s>,"status"; + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 18ca7a2..65628e1 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -97,6 +97,7 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ uart1_clkrate = <&uart1>,"clock-frequency:0"; + i2s = <&i2s>,"status"; + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index bddc369..96d8b97 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -79,6 +79,7 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ uart1_clkrate = <&uart1>,"clock-frequency:0"; + i2s = <&i2s>,"status"; + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index 76d44a2..f25f0a2 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -103,6 +103,7 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ uart1_clkrate = <&uart1>,"clock-frequency:0"; + i2s = <&i2s>,"status"; + spi = <&spi0>,"status"; + i2c0 = <&i2c0>,"status"; +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index a1397c7..e91548c 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -42,6 +42,7 @@ dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += tinylcd35-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += uart1-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += w1-gpio-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += w1-gpio-pullup-overlay.dtb + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index ec762d2..d81d41a 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -489,6 +489,14 @@ Params: speed Display SPI bus speed + dtoverlay=tinylcd35,touch,touchgpio=3 + + ++Name: uart1 ++Info: Enable uart1 in place of uart0 ++Load: dtoverlay=uart1,= ++Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default 14) ++ ++ rxd1_pin GPIO pin for RXD1 (15, 33 or 41 - default 15) ++ ++ + Name: w1-gpio + Info: Configures the w1-gpio Onewire interface module. + Use this overlay if you *don't* need a GPIO to drive an external pullup. +diff --git a/arch/arm/boot/dts/overlays/uart1-overlay.dts b/arch/arm/boot/dts/overlays/uart1-overlay.dts +new file mode 100644 +index 0000000..fa73e1f +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/uart1-overlay.dts +@@ -0,0 +1,38 @@ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&uart1>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ uart1_pins: uart1_pins { ++ brcm,pins = <14 15>; ++ brcm,function = <2>; /* alt5 */ ++ brcm,pull = <0 2>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "/chosen"; ++ __overlay__ { ++ bootargs = "8250.nr_uarts=1"; ++ }; ++ }; ++ ++ __overrides__ { ++ txd1_pin = <&uart1_pins>,"brcm,pins:0"; ++ rxd1_pin = <&uart1_pins>,"brcm,pins:4"; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 46d56d7..8a240fd 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -562,7 +562,7 @@ CONFIG_SERIAL_8250=y + CONFIG_SERIAL_8250_CONSOLE=y + # CONFIG_SERIAL_8250_DMA is not set + CONFIG_SERIAL_8250_NR_UARTS=1 +-CONFIG_SERIAL_8250_RUNTIME_UARTS=1 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=0 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y + CONFIG_SERIAL_OF_PLATFORM=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index e757db6..363c894 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -555,7 +555,7 @@ CONFIG_SERIAL_8250=y + CONFIG_SERIAL_8250_CONSOLE=y + # CONFIG_SERIAL_8250_DMA is not set + CONFIG_SERIAL_8250_NR_UARTS=1 +-CONFIG_SERIAL_8250_RUNTIME_UARTS=1 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=0 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y + CONFIG_SERIAL_OF_PLATFORM=y + +From 0365608651a901ee0b84351ed8ec9b7f0cdfd986 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 24 Jun 2015 14:10:44 +0100 +Subject: [PATCH 100/105] spi-bcm2835: Support pin groups other than 7-11 + +The spi-bcm2835 driver automatically uses GPIO chip-selects due to +some unreliability of the native ones. In doing so it chooses the +same pins as the native chip-selects would use, but the existing +code always uses pins 7 and 8, wherever the SPI function is mapped. + +Search the pinctrl group assigned to the driver for pins that +correspond to native chip-selects, and use those for GPIO chip- +selects. + +Signed-off-by: Phil Elwell +--- + drivers/spi/spi-bcm2835.c | 45 +++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 37 insertions(+), 8 deletions(-) + +diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c +index 37875cf..55e81c2 100644 +--- a/drivers/spi/spi-bcm2835.c ++++ b/drivers/spi/spi-bcm2835.c +@@ -359,6 +359,8 @@ static int bcm2835_spi_setup(struct spi_device *spi) + { + int err; + struct gpio_chip *chip; ++ struct device_node *pins; ++ u32 pingroup_index; + /* + * sanity checking the native-chipselects + */ +@@ -375,15 +377,42 @@ static int bcm2835_spi_setup(struct spi_device *spi) + "setup: only two native chip-selects are supported\n"); + return -EINVAL; + } +- /* now translate native cs to GPIO */ +- +- /* get the gpio chip for the base */ +- chip = gpiochip_find("pinctrl-bcm2835", chip_match_name); +- if (!chip) +- return 0; + +- /* and calculate the real CS */ +- spi->cs_gpio = chip->base + 8 - spi->chip_select; ++ /* now translate native cs to GPIO */ ++ /* first look for chip select pins in the devices pin groups */ ++ for (pingroup_index = 0; ++ (pins = of_parse_phandle(spi->master->dev.of_node, ++ "pinctrl-0", ++ pingroup_index)) != 0; ++ pingroup_index++) { ++ u32 pin; ++ u32 pin_index; ++ for (pin_index = 0; ++ of_property_read_u32_index(pins, ++ "brcm,pins", ++ pin_index, ++ &pin) == 0; ++ pin_index++) { ++ if (((spi->chip_select == 0) && ++ ((pin == 8) || (pin == 36) || (pin == 46))) || ++ ((spi->chip_select == 1) && ++ ((pin == 7) || (pin == 35)))) { ++ spi->cs_gpio = pin; ++ break; ++ } ++ } ++ of_node_put(pins); ++ } ++ /* if that fails, assume GPIOs 7-11 are used */ ++ if (!gpio_is_valid(spi->cs_gpio) ) { ++ /* get the gpio chip for the base */ ++ chip = gpiochip_find("pinctrl-bcm2835", chip_match_name); ++ if (!chip) ++ return 0; ++ ++ /* and calculate the real CS */ ++ spi->cs_gpio = chip->base + 8 - spi->chip_select; ++ } + + /* and set up the "mode" and level */ + dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", + +From 1674fcd926873998471f71ad88306d47bc99862b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 30 Jun 2015 17:37:38 +0100 +Subject: [PATCH 101/105] BCM270X_DT: Change pio_limit of sdhost driver to 1 + +--- + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +index 897204a..2da14a4 100644 +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -22,7 +22,7 @@ + dma-names = "tx", "rx"; + brcm,delay-after-stop = <0>; + brcm,overclock-50 = <0>; +- brcm,pio-limit = <2>; ++ brcm,pio-limit = <1>; + status = "okay"; + }; + }; + +From f72606ab1e40707a3dc9243e0d0b87b98654e02b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 1 Jul 2015 12:51:52 +0100 +Subject: [PATCH 102/105] bcm2835-sdhost: Clear HBLC for PIO mode + +Also update pio_limit default in overlay README. +--- + arch/arm/boot/dts/overlays/README | 2 +- + drivers/mmc/host/bcm2835-sdhost.c | 3 +-- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index d81d41a..980d358 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -441,7 +441,7 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework + force_pio Disable DMA support (default off) + + pio_limit Number of blocks above which to use DMA +- (default 2) ++ (default 1) + + debug Enable debug output (default off) + +diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c +index a03db06..d65870a 100644 +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -699,8 +699,7 @@ static void bcm2835_sdhost_prepare_data(struct bcm2835_host *host, struct mmc_co + bcm2835_sdhost_set_transfer_irqs(host); + + bcm2835_sdhost_write(host, data->blksz, SDHBCT); +- if (host->use_dma) +- bcm2835_sdhost_write(host, data->blocks, SDHBLC); ++ bcm2835_sdhost_write(host, host->use_dma ? data->blocks : 0, SDHBLC); + + BUG_ON(!host->data); + } + +From 93e9bd0c71d224db35cc8019a1ebc16bf77f0fa2 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 3 Jul 2015 12:21:01 +0100 +Subject: [PATCH 103/105] BCM270X_DT: I2S needs function Alt2 + +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 2 +- + arch/arm/boot/dts/bcm2708-rpi-b.dts | 2 +- + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 2 +- + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index 3ad2e0d..562eb08 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -25,7 +25,7 @@ + + i2s_pins: i2s { + brcm,pins = <18 19 20 21>; +- brcm,function = <4>; /* alt0 */ ++ brcm,function = <6>; /* alt2 */ + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 65628e1..e2b1491 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -25,7 +25,7 @@ + + i2s_pins: i2s { + brcm,pins = <28 29 30 31>; +- brcm,function = <4>; /* alt0 */ ++ brcm,function = <6>; /* alt2 */ + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index 96d8b97..5e3db01 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -28,7 +28,7 @@ + + i2s_pins: i2s { + brcm,pins = <18 19 20 21>; +- brcm,function = <4>; /* alt0 */ ++ brcm,function = <6>; /* alt2 */ + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index f25f0a2..62d1c62 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -25,7 +25,7 @@ + + i2s_pins: i2s { + brcm,pins = <18 19 20 21>; +- brcm,function = <4>; /* alt0 */ ++ brcm,function = <6>; /* alt2 */ + }; + }; + + +From 5edaac580d81f7edd48afd1e8c296cdedd94cc7a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 26 Jun 2015 14:16:15 +0200 +Subject: [PATCH 104/105] configs: Incorporate v4.1 dependency changes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit 78e9b7de78bb53e8bc7f4c4a60ebacb250c0c190 added a +dependency on TI_ST instead of selecting it, disabling: +CONFIG_BT_WILINK=m +CONFIG_RADIO_WL128X=m + +Commit 652ccae5cc4e1305fb0a4619947f9ee89d8c7f5a added a +depency on ARM_CRYPTO, disabling: +CONFIG_CRYPTO_SHA*_ARM*=m +CONFIG_CRYPTO_AES_ARM*=m + +Signed-off-by: Noralf Trønnes +--- + arch/arm/configs/bcm2709_defconfig | 10 ++++++---- + arch/arm/configs/bcm2835_defconfig | 8 +++++--- + arch/arm/configs/bcmrpi_defconfig | 8 +++++--- + 3 files changed, 16 insertions(+), 10 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 8a240fd..ccfc14c 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -401,6 +401,7 @@ CONFIG_BLK_DEV_RAM=y + CONFIG_CDROM_PKTCDVD=m + CONFIG_ATA_OVER_ETH=m + CONFIG_EEPROM_AT24=m ++CONFIG_TI_ST=m + CONFIG_SCSI=y + # CONFIG_SCSI_PROC_FS is not set + CONFIG_BLK_DEV_SD=y +@@ -1100,6 +1101,7 @@ CONFIG_OCFS2_FS=m + CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m ++CONFIG_F2FS_FS=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m + CONFIG_QFMT_V2=m +@@ -1129,7 +1131,6 @@ CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y + CONFIG_SQUASHFS_XZ=y +-CONFIG_F2FS_FS=y + CONFIG_NFS_FS=y + CONFIG_NFS_V3_ACL=y + CONFIG_NFS_V4=y +@@ -1205,14 +1206,15 @@ CONFIG_CRYPTO_CBC=y + CONFIG_CRYPTO_CTS=m + CONFIG_CRYPTO_XTS=m + CONFIG_CRYPTO_XCBC=m +-CONFIG_CRYPTO_SHA1_ARM_NEON=m +-CONFIG_CRYPTO_SHA512_ARM_NEON=m + CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m +-CONFIG_CRYPTO_AES_ARM_BS=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y + # CONFIG_CRYPTO_ANSI_CPRNG is not set + # CONFIG_CRYPTO_HW is not set ++CONFIG_ARM_CRYPTO=y ++CONFIG_CRYPTO_SHA1_ARM_NEON=m ++CONFIG_CRYPTO_SHA512_ARM_NEON=m ++CONFIG_CRYPTO_AES_ARM_BS=m + CONFIG_CRC_ITU_T=y + CONFIG_LIBCRC32C=y +diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig +index 2e8a95a..47f2a6a 100644 +--- a/arch/arm/configs/bcm2835_defconfig ++++ b/arch/arm/configs/bcm2835_defconfig +@@ -402,6 +402,7 @@ CONFIG_BLK_DEV_RAM=y + CONFIG_CDROM_PKTCDVD=m + CONFIG_ATA_OVER_ETH=m + CONFIG_EEPROM_AT24=m ++CONFIG_TI_ST=m + CONFIG_SCSI=y + # CONFIG_SCSI_PROC_FS is not set + CONFIG_BLK_DEV_SD=y +@@ -1091,6 +1092,7 @@ CONFIG_OCFS2_FS=m + CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m ++CONFIG_F2FS_FS=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m + CONFIG_QFMT_V2=m +@@ -1120,7 +1122,6 @@ CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y + CONFIG_SQUASHFS_XZ=y +-CONFIG_F2FS_FS=y + CONFIG_NFS_FS=y + CONFIG_NFS_V3_ACL=y + CONFIG_NFS_V4=y +@@ -1208,15 +1209,16 @@ CONFIG_CRYPTO_CBC=y + CONFIG_CRYPTO_CTS=m + CONFIG_CRYPTO_XTS=m + CONFIG_CRYPTO_XCBC=m +-CONFIG_CRYPTO_SHA1_ARM=m + CONFIG_CRYPTO_SHA512=m + CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m +-CONFIG_CRYPTO_AES_ARM=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y + # CONFIG_CRYPTO_ANSI_CPRNG is not set + # CONFIG_CRYPTO_HW is not set ++CONFIG_ARM_CRYPTO=y ++CONFIG_CRYPTO_SHA1_ARM=m ++CONFIG_CRYPTO_AES_ARM=m + CONFIG_CRC_ITU_T=y + CONFIG_LIBCRC32C=y + # CONFIG_XZ_DEC_ARM is not set +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 363c894..80f84d7 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -394,6 +394,7 @@ CONFIG_BLK_DEV_RAM=y + CONFIG_CDROM_PKTCDVD=m + CONFIG_ATA_OVER_ETH=m + CONFIG_EEPROM_AT24=m ++CONFIG_TI_ST=m + CONFIG_SCSI=y + # CONFIG_SCSI_PROC_FS is not set + CONFIG_BLK_DEV_SD=y +@@ -1093,6 +1094,7 @@ CONFIG_OCFS2_FS=m + CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m ++CONFIG_F2FS_FS=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m + CONFIG_QFMT_V2=m +@@ -1122,7 +1124,6 @@ CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y + CONFIG_SQUASHFS_XZ=y +-CONFIG_F2FS_FS=y + CONFIG_NFS_FS=y + CONFIG_NFS_V3_ACL=y + CONFIG_NFS_V4=y +@@ -1200,14 +1201,15 @@ CONFIG_CRYPTO_CBC=y + CONFIG_CRYPTO_CTS=m + CONFIG_CRYPTO_XTS=m + CONFIG_CRYPTO_XCBC=m +-CONFIG_CRYPTO_SHA1_ARM=m + CONFIG_CRYPTO_SHA512=m + CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m +-CONFIG_CRYPTO_AES_ARM=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y + # CONFIG_CRYPTO_ANSI_CPRNG is not set + # CONFIG_CRYPTO_HW is not set ++CONFIG_ARM_CRYPTO=y ++CONFIG_CRYPTO_SHA1_ARM=m ++CONFIG_CRYPTO_AES_ARM=m + CONFIG_CRC_ITU_T=y + CONFIG_LIBCRC32C=y + +From 18f4efa3ad700a4caf72f45ff95d7acfb40f3255 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 3 Jul 2015 15:47:33 +0100 +Subject: [PATCH 105/105] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for + HifiBerry Digi) + +4.1 has split out support for the I2C and SPI variants, so it now +necessary to explicitly enable the I2C support. +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index ccfc14c..5ecd84f 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -823,6 +823,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m + CONFIG_SND_BCM2708_SOC_RPI_DAC=m + CONFIG_SND_BCM2708_SOC_RPI_PROTO=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m ++CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m + CONFIG_HIDRAW=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 80f84d7..14b91fdf 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -816,6 +816,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m + CONFIG_SND_BCM2708_SOC_RPI_DAC=m + CONFIG_SND_BCM2708_SOC_RPI_PROTO=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m ++CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m + CONFIG_HIDRAW=y