From 03e5c85253ecd2608fb89d51219f33231c59381a Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sat, 15 Jun 2013 20:01:19 +0300 Subject: [PATCH 01/14] xbmc-pvr-addons: MySQL support should not be magically detected thanks to: Georgi Georgiev closes #2381 --- packages/mediacenter/xbmc-pvr-addons/build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/mediacenter/xbmc-pvr-addons/build b/packages/mediacenter/xbmc-pvr-addons/build index 09046d7f20..afa47dbec4 100755 --- a/packages/mediacenter/xbmc-pvr-addons/build +++ b/packages/mediacenter/xbmc-pvr-addons/build @@ -22,6 +22,12 @@ . config/options $1 +if [ "$MYSQL_SUPPORT" = yes ]; then + PVRADDONS_MYSQL="--enable-mysql" +else + PVRADDONS_MYSQL="--disable-mysql" +fi + cd $PKG_BUILD ./configure --host=$TARGET_NAME \ @@ -29,6 +35,7 @@ cd $PKG_BUILD --prefix=/usr/share/xbmc \ --disable-static \ --enable-addons-with-dependencies \ + $PVRADDONS_MYSQL \ --enable-shared make From c892d06a595d7a676de942867536b3caf91acb5d Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sat, 15 Jun 2013 20:05:52 +0300 Subject: [PATCH 02/14] vdr-addon: fix utf-8 in vdr.start before (bad) Jun 15 19:54:32 openelec user.err vdr: [2298] codeset is 'ANSI_X3.4-1968' - unknown now Jun 15 20:04:38 openelec user.err vdr: [2608] codeset is 'UTF-8' - known closes #2380 --- .../addons/service/multimedia/vdr-addon/source/bin/vdr.start | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/addons/service/multimedia/vdr-addon/source/bin/vdr.start b/packages/addons/service/multimedia/vdr-addon/source/bin/vdr.start index be346a7f48..ae20ad533e 100755 --- a/packages/addons/service/multimedia/vdr-addon/source/bin/vdr.start +++ b/packages/addons/service/multimedia/vdr-addon/source/bin/vdr.start @@ -171,6 +171,6 @@ if [ ! "$(pidof vdr.bin)" ];then continue fi check_tmpfs_mount - LANG=en_US.UTF-8 LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" eval vdr.bin $VDR_ARG &>$LOG_FILE + LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" eval LANG=en_US.UTF-8 vdr.bin $VDR_ARG &>$LOG_FILE done & fi From 2b7abc402dd0311344969290212a99400dff94f6 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 15 Jun 2013 19:32:56 +0200 Subject: [PATCH 03/14] linux: update to linux-3.9.6 Signed-off-by: Stephan Raue --- packages/linux/meta | 2 +- .../patches/{3.9.5 => 3.9.6}/linux-003-no_dev_console.patch | 0 .../{3.9.5 => 3.9.6}/linux-010-perf_crosscompiling.patch | 0 .../{3.9.5 => 3.9.6}/linux-052-XBOX_remote_support.patch | 0 .../{3.9.5 => 3.9.6}/linux-053-spinelplus-remote-0.2.patch | 0 ...ton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch | 0 .../linux-055-add_Formosa_eHome_Infrared_Receiver.patch | 0 .../linux-056-add_Adaptec_eHome_Infrared_Receiver.patch | 0 ...57-Removed-MCE-customer-code-restriction-in-rc6-decode.patch | 0 .../linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch | 0 .../{3.9.5 => 3.9.6}/linux-059-remove_some_xpad_pids-0.2.patch | 0 .../{3.9.5 => 3.9.6}/linux-060-add_AUGUST_DVB-T205.patch | 0 .../linux-203-stb0899_enable_low_symbol_rate.patch | 0 packages/linux/patches/{3.9.5 => 3.9.6}/linux-210-dvbsky.patch | 0 .../{3.9.5 => 3.9.6}/linux-212-mantis_stb0899_faster_lock.patch | 0 .../patches/{3.9.5 => 3.9.6}/linux-213-cinergy_s2_usb_r2.patch | 0 .../patches/{3.9.5 => 3.9.6}/linux-221-ngene-octopus.patch | 0 .../{3.9.5 => 3.9.6}/linux-222-stb0899_signal_quality.patch | 0 .../linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch | 0 .../patches/{3.9.5 => 3.9.6}/linux-700-jmicron_1_0_8_5.patch | 0 .../patches/{3.9.5 => 3.9.6}/linux-900-hide_tsc_error.patch | 0 .../linux-950-saa716x_PCIe_interface_chipset.patch | 0 ...6-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch.todo | 0 .../{3.9.5 => 3.9.6}/linux-995-CX24120-13Z_frontend.patch | 0 .../{3.9.5 => 3.9.6}/linux-996-macmini2012-ethernet.patch | 0 .../linux-997-disable-rc6-on-sandybridge-gt1.patch | 0 26 files changed, 1 insertion(+), 1 deletion(-) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-003-no_dev_console.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-010-perf_crosscompiling.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-052-XBOX_remote_support.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-053-spinelplus-remote-0.2.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-055-add_Formosa_eHome_Infrared_Receiver.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-059-remove_some_xpad_pids-0.2.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-060-add_AUGUST_DVB-T205.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-203-stb0899_enable_low_symbol_rate.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-210-dvbsky.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-212-mantis_stb0899_faster_lock.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-213-cinergy_s2_usb_r2.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-221-ngene-octopus.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-222-stb0899_signal_quality.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-700-jmicron_1_0_8_5.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-900-hide_tsc_error.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-950-saa716x_PCIe_interface_chipset.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch.todo (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-995-CX24120-13Z_frontend.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-996-macmini2012-ethernet.patch (100%) rename packages/linux/patches/{3.9.5 => 3.9.6}/linux-997-disable-rc6-on-sandybridge-gt1.patch (100%) diff --git a/packages/linux/meta b/packages/linux/meta index c14f7623cc..dc81a40a7f 100644 --- a/packages/linux/meta +++ b/packages/linux/meta @@ -46,7 +46,7 @@ case "$LINUX" in PKG_URL="http://www.kernel.org/pub/linux/kernel/v3.x/$PKG_NAME-$PKG_VERSION.tar.xz" ;; *) - PKG_VERSION="3.9.5" + PKG_VERSION="3.9.6" PKG_URL="http://www.kernel.org/pub/linux/kernel/v3.x/$PKG_NAME-$PKG_VERSION.tar.xz" ;; esac diff --git a/packages/linux/patches/3.9.5/linux-003-no_dev_console.patch b/packages/linux/patches/3.9.6/linux-003-no_dev_console.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-003-no_dev_console.patch rename to packages/linux/patches/3.9.6/linux-003-no_dev_console.patch diff --git a/packages/linux/patches/3.9.5/linux-010-perf_crosscompiling.patch b/packages/linux/patches/3.9.6/linux-010-perf_crosscompiling.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-010-perf_crosscompiling.patch rename to packages/linux/patches/3.9.6/linux-010-perf_crosscompiling.patch diff --git a/packages/linux/patches/3.9.5/linux-052-XBOX_remote_support.patch b/packages/linux/patches/3.9.6/linux-052-XBOX_remote_support.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-052-XBOX_remote_support.patch rename to packages/linux/patches/3.9.6/linux-052-XBOX_remote_support.patch diff --git a/packages/linux/patches/3.9.5/linux-053-spinelplus-remote-0.2.patch b/packages/linux/patches/3.9.6/linux-053-spinelplus-remote-0.2.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-053-spinelplus-remote-0.2.patch rename to packages/linux/patches/3.9.6/linux-053-spinelplus-remote-0.2.patch diff --git a/packages/linux/patches/3.9.5/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch b/packages/linux/patches/3.9.6/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch rename to packages/linux/patches/3.9.6/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch diff --git a/packages/linux/patches/3.9.5/linux-055-add_Formosa_eHome_Infrared_Receiver.patch b/packages/linux/patches/3.9.6/linux-055-add_Formosa_eHome_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-055-add_Formosa_eHome_Infrared_Receiver.patch rename to packages/linux/patches/3.9.6/linux-055-add_Formosa_eHome_Infrared_Receiver.patch diff --git a/packages/linux/patches/3.9.5/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch b/packages/linux/patches/3.9.6/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch rename to packages/linux/patches/3.9.6/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch diff --git a/packages/linux/patches/3.9.5/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch b/packages/linux/patches/3.9.6/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch rename to packages/linux/patches/3.9.6/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch diff --git a/packages/linux/patches/3.9.5/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch b/packages/linux/patches/3.9.6/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch rename to packages/linux/patches/3.9.6/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch diff --git a/packages/linux/patches/3.9.5/linux-059-remove_some_xpad_pids-0.2.patch b/packages/linux/patches/3.9.6/linux-059-remove_some_xpad_pids-0.2.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-059-remove_some_xpad_pids-0.2.patch rename to packages/linux/patches/3.9.6/linux-059-remove_some_xpad_pids-0.2.patch diff --git a/packages/linux/patches/3.9.5/linux-060-add_AUGUST_DVB-T205.patch b/packages/linux/patches/3.9.6/linux-060-add_AUGUST_DVB-T205.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-060-add_AUGUST_DVB-T205.patch rename to packages/linux/patches/3.9.6/linux-060-add_AUGUST_DVB-T205.patch diff --git a/packages/linux/patches/3.9.5/linux-203-stb0899_enable_low_symbol_rate.patch b/packages/linux/patches/3.9.6/linux-203-stb0899_enable_low_symbol_rate.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-203-stb0899_enable_low_symbol_rate.patch rename to packages/linux/patches/3.9.6/linux-203-stb0899_enable_low_symbol_rate.patch diff --git a/packages/linux/patches/3.9.5/linux-210-dvbsky.patch b/packages/linux/patches/3.9.6/linux-210-dvbsky.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-210-dvbsky.patch rename to packages/linux/patches/3.9.6/linux-210-dvbsky.patch diff --git a/packages/linux/patches/3.9.5/linux-212-mantis_stb0899_faster_lock.patch b/packages/linux/patches/3.9.6/linux-212-mantis_stb0899_faster_lock.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-212-mantis_stb0899_faster_lock.patch rename to packages/linux/patches/3.9.6/linux-212-mantis_stb0899_faster_lock.patch diff --git a/packages/linux/patches/3.9.5/linux-213-cinergy_s2_usb_r2.patch b/packages/linux/patches/3.9.6/linux-213-cinergy_s2_usb_r2.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-213-cinergy_s2_usb_r2.patch rename to packages/linux/patches/3.9.6/linux-213-cinergy_s2_usb_r2.patch diff --git a/packages/linux/patches/3.9.5/linux-221-ngene-octopus.patch b/packages/linux/patches/3.9.6/linux-221-ngene-octopus.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-221-ngene-octopus.patch rename to packages/linux/patches/3.9.6/linux-221-ngene-octopus.patch diff --git a/packages/linux/patches/3.9.5/linux-222-stb0899_signal_quality.patch b/packages/linux/patches/3.9.6/linux-222-stb0899_signal_quality.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-222-stb0899_signal_quality.patch rename to packages/linux/patches/3.9.6/linux-222-stb0899_signal_quality.patch diff --git a/packages/linux/patches/3.9.5/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch b/packages/linux/patches/3.9.6/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch rename to packages/linux/patches/3.9.6/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch diff --git a/packages/linux/patches/3.9.5/linux-700-jmicron_1_0_8_5.patch b/packages/linux/patches/3.9.6/linux-700-jmicron_1_0_8_5.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-700-jmicron_1_0_8_5.patch rename to packages/linux/patches/3.9.6/linux-700-jmicron_1_0_8_5.patch diff --git a/packages/linux/patches/3.9.5/linux-900-hide_tsc_error.patch b/packages/linux/patches/3.9.6/linux-900-hide_tsc_error.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-900-hide_tsc_error.patch rename to packages/linux/patches/3.9.6/linux-900-hide_tsc_error.patch diff --git a/packages/linux/patches/3.9.5/linux-950-saa716x_PCIe_interface_chipset.patch b/packages/linux/patches/3.9.6/linux-950-saa716x_PCIe_interface_chipset.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-950-saa716x_PCIe_interface_chipset.patch rename to packages/linux/patches/3.9.6/linux-950-saa716x_PCIe_interface_chipset.patch diff --git a/packages/linux/patches/3.9.5/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch.todo b/packages/linux/patches/3.9.6/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch.todo similarity index 100% rename from packages/linux/patches/3.9.5/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch.todo rename to packages/linux/patches/3.9.6/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch.todo diff --git a/packages/linux/patches/3.9.5/linux-995-CX24120-13Z_frontend.patch b/packages/linux/patches/3.9.6/linux-995-CX24120-13Z_frontend.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-995-CX24120-13Z_frontend.patch rename to packages/linux/patches/3.9.6/linux-995-CX24120-13Z_frontend.patch diff --git a/packages/linux/patches/3.9.5/linux-996-macmini2012-ethernet.patch b/packages/linux/patches/3.9.6/linux-996-macmini2012-ethernet.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-996-macmini2012-ethernet.patch rename to packages/linux/patches/3.9.6/linux-996-macmini2012-ethernet.patch diff --git a/packages/linux/patches/3.9.5/linux-997-disable-rc6-on-sandybridge-gt1.patch b/packages/linux/patches/3.9.6/linux-997-disable-rc6-on-sandybridge-gt1.patch similarity index 100% rename from packages/linux/patches/3.9.5/linux-997-disable-rc6-on-sandybridge-gt1.patch rename to packages/linux/patches/3.9.6/linux-997-disable-rc6-on-sandybridge-gt1.patch From 0d438c5a431afa789fbaf59bd2b3c4519f08b569 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 15 Jun 2013 19:33:19 +0200 Subject: [PATCH 04/14] ffmpeg: enable gnutls support Signed-off-by: Stephan Raue --- packages/multimedia/ffmpeg/build | 1 + packages/multimedia/ffmpeg/meta | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/multimedia/ffmpeg/build b/packages/multimedia/ffmpeg/build index 16b8b85aee..a5778290ec 100755 --- a/packages/multimedia/ffmpeg/build +++ b/packages/multimedia/ffmpeg/build @@ -154,6 +154,7 @@ cd $PKG_BUILD/ --disable-w32threads \ --disable-x11grab \ --enable-network \ + --enable-gnutls \ --disable-gray \ --enable-swscale-alpha \ $FFMPEG_OPTIM \ diff --git a/packages/multimedia/ffmpeg/meta b/packages/multimedia/ffmpeg/meta index 2d6e3b72b4..6b10b5df92 100644 --- a/packages/multimedia/ffmpeg/meta +++ b/packages/multimedia/ffmpeg/meta @@ -28,8 +28,8 @@ PKG_ARCH="any" PKG_LICENSE="LGPL" PKG_SITE="http://ffmpeg.org" PKG_URL="http://ffmpeg.org/releases/$PKG_NAME-$PKG_VERSION.tar.bz2" -PKG_DEPENDS="yasm zlib bzip2 libvorbis" -PKG_BUILD_DEPENDS="toolchain yasm zlib bzip2 libvorbis" +PKG_DEPENDS="yasm zlib bzip2 libvorbis gnutls" +PKG_BUILD_DEPENDS="toolchain yasm zlib bzip2 libvorbis gnutls" PKG_PRIORITY="optional" PKG_SECTION="multimedia" PKG_SHORTDESC="FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video." From d883923eb20632747f59bad34389f285361f943e Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 15 Jun 2013 23:31:02 +0200 Subject: [PATCH 05/14] xbmc (Gotham): update to xbmc-57f529b, update XVBA/VDPAU patch Signed-off-by: Stephan Raue --- .../mediacenter/xbmc-theme-Confluence/meta | 2 +- packages/mediacenter/xbmc/meta | 2 +- ...1-texturepacker-hostflags-and-rework.patch | 0 ...HONOPTIMIZE_with_external_Python-0.1.patch | 0 ....06-add-builtin-to-set-GUI-Language.patch} | 0 .../patches/31f386c/xbmc-990.08-PR2637.patch | 60 - ...1-texturepacker-hostflags-and-rework.patch | 169 + ...HONOPTIMIZE_with_external_Python-0.1.patch | 19 + ...bmc-453-add_openelec.tv_RSS_news-0.1.patch | 0 ...add_as.xml_busy_dialog_delay_control.patch | 0 ...s-mark_our_wrapped_functions_as_used.patch | 0 .../xbmc-995.01-xvba_support-a284bab.patch} | 7086 ++++++----------- .../xbmc-995.10-disable-alt-tab.patch | 0 .../xbmc-999.01-automake-1.13.patch | 0 14 files changed, 2680 insertions(+), 4658 deletions(-) rename packages/mediacenter/xbmc/patches/{ => 12.2.0}/xbmc-321-texturepacker-hostflags-and-rework.patch (100%) rename packages/mediacenter/xbmc/patches/{ => 12.2.0}/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch (100%) rename packages/mediacenter/xbmc/patches/{xbmc-966a6cc-901-add-builtin-to-set-GUI-Language.patch => 12.2.0/xbmc-990.06-add-builtin-to-set-GUI-Language.patch} (100%) delete mode 100644 packages/mediacenter/xbmc/patches/31f386c/xbmc-990.08-PR2637.patch create mode 100644 packages/mediacenter/xbmc/patches/57f529b/xbmc-321-texturepacker-hostflags-and-rework.patch create mode 100644 packages/mediacenter/xbmc/patches/57f529b/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch rename packages/mediacenter/xbmc/patches/{31f386c => 57f529b}/xbmc-453-add_openelec.tv_RSS_news-0.1.patch (100%) rename packages/mediacenter/xbmc/patches/{31f386c => 57f529b}/xbmc-602-add_as.xml_busy_dialog_delay_control.patch (100%) rename packages/mediacenter/xbmc/patches/{31f386c => 57f529b}/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch (100%) rename packages/mediacenter/xbmc/patches/{31f386c/xbmc-995.01-xvba_support-f828567.patch => 57f529b/xbmc-995.01-xvba_support-a284bab.patch} (81%) rename packages/mediacenter/xbmc/patches/{31f386c => 57f529b}/xbmc-995.10-disable-alt-tab.patch (100%) rename packages/mediacenter/xbmc/patches/{31f386c => 57f529b}/xbmc-999.01-automake-1.13.patch (100%) diff --git a/packages/mediacenter/xbmc-theme-Confluence/meta b/packages/mediacenter/xbmc-theme-Confluence/meta index 33f85c8772..37a944e953 100644 --- a/packages/mediacenter/xbmc-theme-Confluence/meta +++ b/packages/mediacenter/xbmc-theme-Confluence/meta @@ -21,7 +21,7 @@ PKG_NAME="xbmc-theme-Confluence" PKG_VERSION="12.2.0" if [ "$XBMC" = "master" ]; then - PKG_VERSION="31f386c" + PKG_VERSION="57f529b" elif [ "$XBMC" = "xbmc-aml" ]; then PKG_VERSION="aml-frodo-d9119f2" fi diff --git a/packages/mediacenter/xbmc/meta b/packages/mediacenter/xbmc/meta index 6b2f198c3e..604b0c61d0 100644 --- a/packages/mediacenter/xbmc/meta +++ b/packages/mediacenter/xbmc/meta @@ -21,7 +21,7 @@ PKG_NAME="xbmc" PKG_VERSION="12.2.0" if [ "$XBMC" = "master" ]; then - PKG_VERSION="31f386c" + PKG_VERSION="57f529b" elif [ "$XBMC" = "xbmc-aml" ]; then PKG_VERSION="aml-frodo-d9119f2" fi diff --git a/packages/mediacenter/xbmc/patches/xbmc-321-texturepacker-hostflags-and-rework.patch b/packages/mediacenter/xbmc/patches/12.2.0/xbmc-321-texturepacker-hostflags-and-rework.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/xbmc-321-texturepacker-hostflags-and-rework.patch rename to packages/mediacenter/xbmc/patches/12.2.0/xbmc-321-texturepacker-hostflags-and-rework.patch diff --git a/packages/mediacenter/xbmc/patches/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch b/packages/mediacenter/xbmc/patches/12.2.0/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch rename to packages/mediacenter/xbmc/patches/12.2.0/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch diff --git a/packages/mediacenter/xbmc/patches/xbmc-966a6cc-901-add-builtin-to-set-GUI-Language.patch b/packages/mediacenter/xbmc/patches/12.2.0/xbmc-990.06-add-builtin-to-set-GUI-Language.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/xbmc-966a6cc-901-add-builtin-to-set-GUI-Language.patch rename to packages/mediacenter/xbmc/patches/12.2.0/xbmc-990.06-add-builtin-to-set-GUI-Language.patch diff --git a/packages/mediacenter/xbmc/patches/31f386c/xbmc-990.08-PR2637.patch b/packages/mediacenter/xbmc/patches/31f386c/xbmc-990.08-PR2637.patch deleted file mode 100644 index 61ba30e4cc..0000000000 --- a/packages/mediacenter/xbmc/patches/31f386c/xbmc-990.08-PR2637.patch +++ /dev/null @@ -1,60 +0,0 @@ -From d4c34400b9bdebbb1a943603a54fdf207034ddd1 Mon Sep 17 00:00:00 2001 -From: Dag Wieers -Date: Sat, 20 Apr 2013 02:59:47 +0200 -Subject: [PATCH] Increase USB and CEC rescan interval to 5 seconds - -In one of my investigations to see why XBMC performance is so bad (even when idle) I found one of the threads (in my case PeripheralBusCEC) scan a big sysfs tree recursively. On the 1Ghz AppleTV 1 device this would be about 2% of the CPU *every* second. For the USB thread we luckily have Udev events, but for CEC it is using sysfs polling which is quite expensive. It would be better to make use of Udev as well for CEC (where available) however 5 seconds should be fine for everyone. - -In my own builds I even brought it down to 30 seconds. Which means 29 seconds of reduced CPU usage. - -The CEC polling probably should be more restricted to specific sysfs sections, or preferably use Udev as well, when available. - -PS XBMC needs a special idle-state where it can turn down these expensive threads to make sure hardware can go into deeper sleep states. Especially for devices that doesn't do suspend for various reasons this is a requirement. (The ATV1 device for instance gets warm even when idle) If we can combine display-sleep with low-power states and a less expensive main-loop, that would be already quite an improvement without needing a complete refactoring of the code. ---- - xbmc/peripherals/bus/PeripheralBus.cpp | 2 +- - xbmc/peripherals/bus/PeripheralBus.h | 2 +- - xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/xbmc/peripherals/bus/PeripheralBus.cpp b/xbmc/peripherals/bus/PeripheralBus.cpp -index 0e673ee..f0219f1 100644 ---- a/xbmc/peripherals/bus/PeripheralBus.cpp -+++ b/xbmc/peripherals/bus/PeripheralBus.cpp -@@ -27,7 +27,7 @@ - using namespace std; - using namespace PERIPHERALS; - --#define PERIPHERAL_DEFAULT_RESCAN_INTERVAL 1000 -+#define PERIPHERAL_DEFAULT_RESCAN_INTERVAL 5000 - - CPeripheralBus::CPeripheralBus(CPeripherals *manager, PeripheralBusType type) : - CThread("PeripheralBus"), -diff --git a/xbmc/peripherals/bus/PeripheralBus.h b/xbmc/peripherals/bus/PeripheralBus.h -index cc368ac..24e1524 100644 ---- a/xbmc/peripherals/bus/PeripheralBus.h -+++ b/xbmc/peripherals/bus/PeripheralBus.h -@@ -33,7 +33,7 @@ - - /*! - * @class CPeripheralBus -- * This represents a bus on the system. By default, this bus instance will scan for changes every second. -+ * This represents a bus on the system. By default, this bus instance will scan for changes every 5 seconds. - * If this bus only has to be updated after a notification sent by the system, set m_bNeedsPolling to false - * in the constructor, and implement the OnDeviceAdded(), OnDeviceChanged() and OnDeviceRemoved() methods. - * -diff --git a/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp b/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp -index da169c1..0db7423 100644 ---- a/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp -+++ b/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp -@@ -57,7 +57,7 @@ class PERIPHERALS::DllLibCEC : public DllDynamic, DllLibCECInterface - m_dll(new DllLibCEC), - m_cecAdapter(NULL) - { -- m_iRescanTime = 1000; -+ m_iRescanTime = 5000; - if (!m_dll->Load() || !m_dll->IsLoaded()) - { - delete m_dll; --- -1.8.1.6 - diff --git a/packages/mediacenter/xbmc/patches/57f529b/xbmc-321-texturepacker-hostflags-and-rework.patch b/packages/mediacenter/xbmc/patches/57f529b/xbmc-321-texturepacker-hostflags-and-rework.patch new file mode 100644 index 0000000000..93fead20be --- /dev/null +++ b/packages/mediacenter/xbmc/patches/57f529b/xbmc-321-texturepacker-hostflags-and-rework.patch @@ -0,0 +1,169 @@ +diff -Naur xbmc-frodo-0ff0d2e/configure.in xbmc-frodo-0ff0d2e.patch/configure.in +--- xbmc-frodo-0ff0d2e/configure.in 2012-10-11 15:45:44.000000000 +0200 ++++ xbmc-frodo-0ff0d2e.patch/configure.in 2012-10-11 16:49:08.872850880 +0200 +@@ -452,6 +452,12 @@ + [use_texturepacker=$enableval], + [use_texturepacker=auto]) + ++AC_ARG_WITH([texturepacker-root], ++ [AS_HELP_STRING([--with-texturepacker-root], ++ [root dir to search for librarys and includes if building native TexturePacker (default is \$prefix)])], ++ [use_texturepacker_root=$withval], ++ [use_texturepacker_root=$prefix]) ++ + AC_ARG_WITH([lirc-device], + [AS_HELP_STRING([--with-lirc-device=file], + [specify the default LIRC device (default is /dev/lircd)])], +@@ -2000,13 +2006,13 @@ + + USE_TEXTUREPACKER_NATIVE=0 + if test "x$use_texturepacker" != "xno"; then +- final_message="$final_message\n TexturePacker:Yes" + USE_TEXTUREPACKER=1 +- if test "x$use_texturepacker_native" = "xyes"; then ++ if test "x$cross_compiling" = "xyes"; then + USE_TEXTUREPACKER_NATIVE=1 +- if [[ ! -d "$USE_TEXTUREPACKER_NATIVE_ROOT" ]]; then +- USE_TEXTUREPACKER_NATIVE_ROOT= +- fi ++ USE_TEXTUREPACKER_NATIVE_ROOT="$use_texturepacker_root" ++ final_message="$final_message\n TexturePacker:Native ($USE_TEXTUREPACKER_NATIVE_ROOT)" ++ else ++ final_message="$final_message\n TexturePacker:Yes" + fi + else + final_message="$final_message\n TexturePacker:No" +diff -Naur xbmc-frodo-0ff0d2e/lib/libsquish/Makefile.in xbmc-frodo-0ff0d2e.patch/lib/libsquish/Makefile.in +--- xbmc-frodo-0ff0d2e/lib/libsquish/Makefile.in 2012-10-11 15:47:26.000000000 +0200 ++++ xbmc-frodo-0ff0d2e.patch/lib/libsquish/Makefile.in 2012-10-11 16:49:08.873850900 +0200 +@@ -11,26 +11,25 @@ + singlecolourfit.cpp \ + squish.cpp + +-CXXFLAGS+=-I. +- +-LIB=libsquish.a +- +-ifeq (@USE_TEXTUREPACKER_NATIVE@,1) +-NATIVE_LIB=libsquish-native.so +-CLEAN_FILES+=$(NATIVE_LIB) ++LIB = libsquish.a ++NATIVE_LIB = libsquish-native.so ++CLEAN_FILES += $(NATIVE_LIB) ++ ++HOST_CXX ?= g++ ++CXXFLAGS += -I. ++HOST_CXXFLAGS += -I. + + ifeq ($(findstring Darwin,$(shell uname -s)),Darwin) +-NATIVE_ARCH=@DARWIN_NATIVE_ARCH@ ++ HOST_CXXFLAGS += @DARWIN_NATIVE_ARCH@ + endif + +-all: $(LIB) $(NATIVE_LIB) ++$(LIB): $(SRCS) + # TexturePacker links to libsquish and needs to run on build system, so make a native flavor. + $(NATIVE_LIB): $(SRCS) + ifeq ($(findstring Darwin,$(shell uname -s)),Darwin) +- g++ $(NATIVE_ARCH) -I. $(SRCS) -dynamiclib -install_name `pwd`/libsquish-native.so -o $@ ++ $(HOST_CXX) $(HOST_CXXFLAGS) $(SRCS) -dynamiclib -install_name `pwd`/libsquish-native.so -o $@ + else +- g++ -I. $(SRCS) -shared -fPIC -Wl,-soname,`pwd`/libsquish-native.so -o $@ +-endif ++ $(HOST_CXX) $(HOST_CXXFLAGS) $(SRCS) -shared -fPIC -Wl,-soname,`pwd`/libsquish-native.so -o $@ + endif + + include ../../Makefile.include +diff -Naur xbmc-frodo-0ff0d2e/tools/TexturePacker/Makefile.in xbmc-frodo-0ff0d2e.patch/tools/TexturePacker/Makefile.in +--- xbmc-frodo-0ff0d2e/tools/TexturePacker/Makefile.in 2012-10-11 15:47:05.000000000 +0200 ++++ xbmc-frodo-0ff0d2e.patch/tools/TexturePacker/Makefile.in 2012-10-11 16:49:08.874850920 +0200 +@@ -1,56 +1,54 @@ +-DEFINES += -DTARGET_POSIX -DUSE_LZO_PACKING ++DEFINES += -DTARGET_POSIX -DUSE_LZO_PACKING + ifneq ($(or $(findstring powerpc,@ARCH@),$(findstring ppc, @ARCH@)),) +-DEFINES += -DHOST_BIGENDIAN ++DEFINES += -DHOST_BIGENDIAN + endif + +-CXXFLAGS+= \ ++SRCS = \ ++ md5.cpp \ ++ SDL_anigif.cpp \ ++ XBTFWriter.cpp \ ++ XBMCTex.cpp \ ++ @abs_top_srcdir@/xbmc/guilib/XBTF.cpp ++ ++TARGET = TexturePacker ++CLEAN_FILES = $(TARGET) ++ ++all: $(TARGET) ++ ++HOST_CXX ?= g++ ++HOST_ROOT_PATH = @USE_TEXTUREPACKER_NATIVE_ROOT@ ++ ++LIBS += -lSDL_image -lSDL -llzo2 ++LIBS += -L@abs_top_srcdir@/lib/libsquish -lsquish ++HOST_LIBS += -L$(HOST_ROOT_PATH)/lib -lSDL_image -lSDL -llzo2 ++HOST_LIBS += -L@abs_top_srcdir@/lib/libsquish -lsquish-native ++ ++CXXFLAGS += \ + -I. \ + -I@abs_top_srcdir@/lib \ + -I@abs_top_srcdir@/xbmc \ + -I@abs_top_srcdir@/xbmc/linux + +-RPATH=-Wl,-rpath=$(NATIVE_ROOT_PATH)/lib ++HOST_CXXFLAGS += \ ++ -I. \ ++ -I@abs_top_srcdir@/lib \ ++ -I@abs_top_srcdir@/xbmc \ ++ -I@abs_top_srcdir@/xbmc/linux \ ++ -I$(HOST_ROOT_PATH)/include ++ ++RPATH=-Wl,-rpath=$(HOST_ROOT_PATH)/lib + +-ifeq (@USE_TEXTUREPACKER_NATIVE@,1) +-NATIVE_ROOT_PATH=@USE_TEXTUREPACKER_NATIVE_ROOT@ +-ifdef NATIVE_ROOT_PATH + ifeq ($(findstring Darwin,$(shell uname -s)),Darwin) + DEFINES += -DTARGET_DARWIN + NATIVE_ARCH=@DARWIN_NATIVE_ARCH@ + RPATH= + endif +-NATIVE_CXXFLAGS+= -I. \ +- -I$(NATIVE_ROOT_PATH)/include \ +- -I@abs_top_srcdir@/lib \ +- -I@abs_top_srcdir@/xbmc \ +- -I@abs_top_srcdir@/xbmc/linux +-NATIVE_LIBS += -L$(NATIVE_ROOT_PATH)/lib +-endif +-NATIVE_LIBS += -lSDL_image -lSDL -llzo2 +-NATIVE_LIBS += -L@abs_top_srcdir@/lib/libsquish -lsquish-native +-else +-LIBS += -L@abs_top_srcdir@/lib/libsquish -lsquish +-endif +- +-LIBS += -lSDL_image -lSDL -llzo2 +- +-SRCS = \ +- md5.cpp \ +- SDL_anigif.cpp \ +- XBTFWriter.cpp \ +- XBMCTex.cpp \ +- @abs_top_srcdir@/xbmc/guilib/XBTF.cpp +- +- +-TARGET = TexturePacker +-CLEAN_FILES=$(TARGET) +- +-all: $(TARGET) + + ifeq (@USE_TEXTUREPACKER_NATIVE@,1) + # TexturePacker run native on build system, build it with native tools + $(TARGET): $(SRCS) @abs_top_srcdir@/xbmc/guilib/XBTF.h +- g++ $(DEFINES) $(NATIVE_ARCH) $(NATIVE_CXXFLAGS) $(SRCS) $(NATIVE_LIBS) $(RPATH) -o $(TARGET) ++ make -C @abs_top_srcdir@/lib/libsquish libsquish-native.so ++ $(HOST_CXX) $(DEFINES) $(NATIVE_ARCH) $(HOST_CXXFLAGS) $(SRCS) $(HOST_LIBS) $(RPATH) -o $(TARGET) + clean: + rm -f $(TARGET) + else diff --git a/packages/mediacenter/xbmc/patches/57f529b/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch b/packages/mediacenter/xbmc/patches/57f529b/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch new file mode 100644 index 0000000000..fa91209d83 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/57f529b/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch @@ -0,0 +1,19 @@ +diff -Naur xbmc-frodo-5ea1d22/xbmc/interfaces/python/XBPython.cpp xbmc-frodo-5ea1d22.patch/xbmc/interfaces/python/XBPython.cpp +--- xbmc-frodo-5ea1d22/xbmc/interfaces/python/XBPython.cpp 2012-09-05 13:28:20.000000000 +0200 ++++ xbmc-frodo-5ea1d22.patch/xbmc/interfaces/python/XBPython.cpp 2012-09-05 15:50:42.642317031 +0200 +@@ -525,11 +525,10 @@ + // at http://docs.python.org/using/cmdline.html#environment-variables + + #if !defined(TARGET_WINDOWS) && !defined(TARGET_ANDROID) +- /* PYTHONOPTIMIZE is set off intentionally when using external Python. +- Reason for this is because we cannot be sure what version of Python +- was used to compile the various Python object files (i.e. .pyo, +- .pyc, etc.). */ +- // check if we are running as real xbmc.app or just binary ++ // Required for python to find optimized code (pyo) files ++ setenv("PYTHONOPTIMIZE", "1", 1); ++ ++ // check if we are running as real xbmc.app or just binary + if (!CUtil::GetFrameworksPath(true).IsEmpty()) + { + // using external python, it's build looking for xxx/lib/python2.6 diff --git a/packages/mediacenter/xbmc/patches/31f386c/xbmc-453-add_openelec.tv_RSS_news-0.1.patch b/packages/mediacenter/xbmc/patches/57f529b/xbmc-453-add_openelec.tv_RSS_news-0.1.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/31f386c/xbmc-453-add_openelec.tv_RSS_news-0.1.patch rename to packages/mediacenter/xbmc/patches/57f529b/xbmc-453-add_openelec.tv_RSS_news-0.1.patch diff --git a/packages/mediacenter/xbmc/patches/31f386c/xbmc-602-add_as.xml_busy_dialog_delay_control.patch b/packages/mediacenter/xbmc/patches/57f529b/xbmc-602-add_as.xml_busy_dialog_delay_control.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/31f386c/xbmc-602-add_as.xml_busy_dialog_delay_control.patch rename to packages/mediacenter/xbmc/patches/57f529b/xbmc-602-add_as.xml_busy_dialog_delay_control.patch diff --git a/packages/mediacenter/xbmc/patches/31f386c/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch b/packages/mediacenter/xbmc/patches/57f529b/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/31f386c/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch rename to packages/mediacenter/xbmc/patches/57f529b/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch diff --git a/packages/mediacenter/xbmc/patches/31f386c/xbmc-995.01-xvba_support-f828567.patch b/packages/mediacenter/xbmc/patches/57f529b/xbmc-995.01-xvba_support-a284bab.patch similarity index 81% rename from packages/mediacenter/xbmc/patches/31f386c/xbmc-995.01-xvba_support-f828567.patch rename to packages/mediacenter/xbmc/patches/57f529b/xbmc-995.01-xvba_support-a284bab.patch index 0426d18037..b06ae4c37a 100644 --- a/packages/mediacenter/xbmc/patches/31f386c/xbmc-995.01-xvba_support-f828567.patch +++ b/packages/mediacenter/xbmc/patches/57f529b/xbmc-995.01-xvba_support-a284bab.patch @@ -1,2675 +1,1029 @@ -From 5fcb967460605c9fbc6098208d35d8810f39daae Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Mon, 28 May 2012 10:03:31 +0200 -Subject: [PATCH 001/119] VideoRenerers: add buffering +From 88e00e0636826308db97e71b0fa58dc6b9fb0c72 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 18 May 2013 20:17:57 +0200 +Subject: [PATCH 001/105] renderer: replace render buffer indices with queues --- - xbmc/Application.cpp | 3 + - xbmc/cores/IPlayer.h | 2 + - xbmc/cores/VideoRenderers/BaseRenderer.h | 5 +- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 41 ++-- - xbmc/cores/VideoRenderers/LinuxRendererGL.h | 13 +- - xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 8 +- - xbmc/cores/VideoRenderers/LinuxRendererGLES.h | 4 +- - xbmc/cores/VideoRenderers/OverlayRenderer.cpp | 24 +- - xbmc/cores/VideoRenderers/OverlayRenderer.h | 10 +- - xbmc/cores/VideoRenderers/RenderManager.cpp | 296 ++++++++++++++++++++---- - xbmc/cores/VideoRenderers/RenderManager.h | 63 ++++- - xbmc/cores/VideoRenderers/WinRenderer.cpp | 8 +- - xbmc/cores/VideoRenderers/WinRenderer.h | 2 +- - xbmc/cores/dvdplayer/DVDPlayer.cpp | 5 + - xbmc/cores/dvdplayer/DVDPlayer.h | 2 + - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 34 ++- - 16 files changed, 417 insertions(+), 103 deletions(-) + xbmc/cores/VideoRenderers/RenderManager.cpp | 101 +++++++++++++++++----------- + xbmc/cores/VideoRenderers/RenderManager.h | 17 ++--- + 2 files changed, 68 insertions(+), 50 deletions(-) -diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index a079ddf..32d76b7 100644 ---- a/xbmc/Application.cpp -+++ b/xbmc/Application.cpp -@@ -2184,7 +2184,10 @@ void CApplication::Render() - m_lastFrameTime = XbmcThreads::SystemClockMillis(); - - if (flip) -+ { - g_graphicsContext.Flip(dirtyRegions); -+ g_renderManager.NotifyDisplayFlip(); -+ } - CTimeUtils::UpdateFrameTime(flip); - - g_renderManager.UpdateResolution(); -diff --git a/xbmc/cores/IPlayer.h b/xbmc/cores/IPlayer.h -index 6b713dc..9be9e22 100644 ---- a/xbmc/cores/IPlayer.h -+++ b/xbmc/cores/IPlayer.h -@@ -244,6 +244,8 @@ class IPlayer - */ - virtual void GetSubtitleCapabilities(std::vector &subCaps) { subCaps.assign(1,IPC_SUBS_ALL); }; - -+ virtual double GetClock(double& absolute, bool interpolated = true) {return 0; }; -+ - protected: - IPlayerCallback& m_callback; - }; -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index ac1a0c8..95b9735 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.h -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -81,10 +81,13 @@ class CBaseRenderer - void GetVideoRect(CRect &source, CRect &dest); - float GetAspectRatio() const; - -- virtual bool AddVideoPicture(DVDVideoPicture* picture) { return false; } -+ virtual bool AddVideoPicture(DVDVideoPicture* picture, int index) { return false; } - virtual void Flush() {}; - - virtual unsigned int GetProcessorSize() { return 0; } -+ virtual unsigned int GetMaxBufferSize() { return 0; } -+ virtual void SetBufferSize(int numBuffers) { } -+ virtual void ReleaseBuffer(int idx) { } - - virtual bool Supports(ERENDERFEATURE feature) { return false; } - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 267dd40..27a0fc6 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -250,14 +250,6 @@ bool CLinuxRendererGL::ValidateRenderer() - return true; - } - -- --void CLinuxRendererGL::ManageTextures() --{ -- m_NumYV12Buffers = 2; -- //m_iYV12RenderBuffer = 0; -- return; --} -- - bool CLinuxRendererGL::ValidateRenderTarget() - { - if (!m_bValidated) -@@ -618,13 +610,28 @@ void CLinuxRendererGL::Flush() - glFinish(); - m_bValidated = false; - m_fbo.fbo.Cleanup(); -+ m_iYV12RenderBuffer = 0; -+} -+ -+void CLinuxRendererGL::ReleaseBuffer(int idx) -+{ -+ YUVBUFFER &buf = m_buffers[idx]; -+#ifdef HAVE_LIBVDPAU -+ SAFE_RELEASE(buf.vdpau); -+#endif -+#ifdef HAVE_LIBVA -+ buf.vaapi.surface.reset(); -+#endif -+#ifdef TARGET_DARWIN -+ if (buf.cvBufferRef) -+ CVBufferRelease(buf.cvBufferRef); -+#endif - } - - void CLinuxRendererGL::Update(bool bPauseDrawing) - { - if (!m_bConfigured) return; - ManageDisplay(); -- ManageTextures(); - m_scalingMethodGui = (ESCALINGMETHOD)-1; - } - -@@ -641,7 +648,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - } - - ManageDisplay(); -- ManageTextures(); - - g_graphicsContext.BeginPaint(); - -@@ -798,7 +804,6 @@ unsigned int CLinuxRendererGL::PreInit() - m_resolution = RES_DESKTOP; - - m_iYV12RenderBuffer = 0; -- m_NumYV12Buffers = 2; - - m_formats.push_back(RENDER_FMT_YUV420P); - GLint size; -@@ -2481,7 +2486,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) - || status == VA_STATUS_ERROR_INVALID_DISPLAY) - { - va.display->lost(true); -- for(int i = 0; i < NUM_BUFFERS; i++) -+ for(int i = 0; i < m_NumYV12Buffers; i++) - { - m_buffers[i].vaapi.display.reset(); - m_buffers[i].vaapi.surface.reset(); -@@ -3435,26 +3440,26 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) - } - - #ifdef HAVE_LIBVDPAU --void CLinuxRendererGL::AddProcessor(CVDPAU* vdpau) -+void CLinuxRendererGL::AddProcessor(CVDPAU* vdpau, int index) - { -- YUVBUFFER &buf = m_buffers[NextYV12Texture()]; -+ YUVBUFFER &buf = m_buffers[index]; - SAFE_RELEASE(buf.vdpau); - buf.vdpau = (CVDPAU*)vdpau->Acquire(); - } - #endif - - #ifdef HAVE_LIBVA --void CLinuxRendererGL::AddProcessor(VAAPI::CHolder& holder) -+void CLinuxRendererGL::AddProcessor(VAAPI::CHolder& holder, int index) - { -- YUVBUFFER &buf = m_buffers[NextYV12Texture()]; -+ YUVBUFFER &buf = m_buffers[index]; - buf.vaapi.surface = holder.surface; - } - #endif - - #ifdef TARGET_DARWIN --void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef) -+void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef, int index) - { -- YUVBUFFER &buf = m_buffers[NextYV12Texture()]; -+ YUVBUFFER &buf = m_buffers[index]; - if (buf.cvBufferRef) - CVBufferRelease(buf.cvBufferRef); - buf.cvBufferRef = cvBufferRef; -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index 44e69ac..9a151cc 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -45,7 +45,7 @@ - namespace Shaders { class BaseVideoFilterShader; } - namespace VAAPI { struct CHolder; } - --#define NUM_BUFFERS 3 -+#define NUM_BUFFERS 10 - - - #undef ALIGN -@@ -139,15 +139,19 @@ class CLinuxRendererGL : public CBaseRenderer - virtual void UnInit(); - virtual void Reset(); /* resets renderer after seek for example */ - virtual void Flush(); -+ virtual void ReleaseBuffer(int idx); -+ virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } -+ virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } -+ virtual unsigned int GetProcessorSize() { return m_NumYV12Buffers; } - - #ifdef HAVE_LIBVDPAU -- virtual void AddProcessor(CVDPAU* vdpau); -+ virtual void AddProcessor(CVDPAU* vdpau, int index); - #endif - #ifdef HAVE_LIBVA -- virtual void AddProcessor(VAAPI::CHolder& holder); -+ virtual void AddProcessor(VAAPI::CHolder& holder, int index); - #endif - #ifdef TARGET_DARWIN -- virtual void AddProcessor(struct __CVBuffer *cvBufferRef); -+ virtual void AddProcessor(struct __CVBuffer *cvBufferRef, int index); - #endif - - virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); -@@ -169,7 +173,6 @@ class CLinuxRendererGL : public CBaseRenderer - void DrawBlackBars(); - - bool ValidateRenderer(); -- virtual void ManageTextures(); - int NextYV12Texture(); - virtual bool ValidateRenderTarget(); - virtual void LoadShaders(int field=FIELD_FULL); -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -index a6dd363..571d9cc 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -@@ -2005,16 +2005,16 @@ EINTERLACEMETHOD CLinuxRendererGLES::AutoInterlaceMethod() - } - - #ifdef HAVE_LIBOPENMAX --void CLinuxRendererGLES::AddProcessor(COpenMax* openMax, DVDVideoPicture *picture) -+void CLinuxRendererGLES::AddProcessor(COpenMax* openMax, DVDVideoPicture *picture, int index) - { -- YUVBUFFER &buf = m_buffers[NextYV12Texture()]; -+ YUVBUFFER &buf = m_buffers[index]; - buf.openMaxBuffer = picture->openMaxBuffer; - } - #endif - #ifdef HAVE_VIDEOTOOLBOXDECODER --void CLinuxRendererGLES::AddProcessor(struct __CVBuffer *cvBufferRef) -+void CLinuxRendererGLES::AddProcessor(struct __CVBuffer *cvBufferRef, int index) - { -- YUVBUFFER &buf = m_buffers[NextYV12Texture()]; -+ YUVBUFFER &buf = m_buffers[index]; - if (buf.cvBufferRef) - CVBufferRelease(buf.cvBufferRef); - buf.cvBufferRef = cvBufferRef; -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -index ce93e3d..51e84d4 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -@@ -154,10 +154,10 @@ class CLinuxRendererGLES : public CBaseRenderer - virtual std::vector SupportedFormats() { return m_formats; } - - #ifdef HAVE_LIBOPENMAX -- virtual void AddProcessor(COpenMax* openMax, DVDVideoPicture *picture); -+ virtual void AddProcessor(COpenMax* openMax, DVDVideoPicture *picture, int index); - #endif - #ifdef HAVE_VIDEOTOOLBOXDECODER -- virtual void AddProcessor(struct __CVBuffer *cvBufferRef); -+ virtual void AddProcessor(struct __CVBuffer *cvBufferRef, int index); - #endif - - protected: -diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -index 59a4732..faa9dcb 100644 ---- a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -@@ -93,33 +93,32 @@ long COverlayMainThread::Release() - CRenderer::CRenderer() - { - m_render = 0; -- m_decode = (m_render + 1) % 2; - } - - CRenderer::~CRenderer() - { -- for(int i = 0; i < 2; i++) -+ for(int i = 0; i < 10; i++) - Release(m_buffers[i]); - } - --void CRenderer::AddOverlay(CDVDOverlay* o, double pts) -+void CRenderer::AddOverlay(CDVDOverlay* o, double pts, int index) - { - CSingleLock lock(m_section); - - SElement e; - e.pts = pts; - e.overlay_dvd = o->Acquire(); -- m_buffers[m_decode].push_back(e); -+ m_buffers[index].push_back(e); - } - --void CRenderer::AddOverlay(COverlay* o, double pts) -+void CRenderer::AddOverlay(COverlay* o, double pts, int index) - { - CSingleLock lock(m_section); - - SElement e; - e.pts = pts; - e.overlay = o->Acquire(); -- m_buffers[m_decode].push_back(e); -+ m_buffers[index].push_back(e); - } - - void CRenderer::AddCleanup(COverlay* o) -@@ -155,20 +154,23 @@ void CRenderer::Flush() - { - CSingleLock lock(m_section); - -- for(int i = 0; i < 2; i++) -+ for(int i = 0; i < m_iNumBuffers; i++) - Release(m_buffers[i]); - -+ m_render = 0; - Release(m_cleanup); - } - - void CRenderer::Flip() - { - CSingleLock lock(m_section); -+ m_render = (m_render + 1) % m_iNumBuffers; -+} - -- m_render = m_decode; -- m_decode =(m_decode + 1) % 2; -- -- Release(m_buffers[m_decode]); -+void CRenderer::ReleaseBuffer(int idx) -+{ -+ CSingleLock lock(m_section); -+ Release(m_buffers[idx]); - } - - void CRenderer::Render() -diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.h b/xbmc/cores/VideoRenderers/OverlayRenderer.h -index 5790703..becf2c2 100644 ---- a/xbmc/cores/VideoRenderers/OverlayRenderer.h -+++ b/xbmc/cores/VideoRenderers/OverlayRenderer.h -@@ -92,12 +92,14 @@ - CRenderer(); - ~CRenderer(); - -- void AddOverlay(CDVDOverlay* o, double pts); -- void AddOverlay(COverlay* o, double pts); -+ void AddOverlay(CDVDOverlay* o, double pts, int index); -+ void AddOverlay(COverlay* o, double pts, int index); - void AddCleanup(COverlay* o); - void Flip(); - void Render(); - void Flush(); -+ void SetNumBuffers(int numBuffers) { m_iNumBuffers = numBuffers; } -+ void ReleaseBuffer(int idx); - - protected: - -@@ -125,8 +127,8 @@ - void Release(SElementV& list); - - CCriticalSection m_section; -- SElementV m_buffers[2]; -- int m_decode; -+ SElementV m_buffers[10]; -+ int m_iNumBuffers; - int m_render; - - COverlayV m_cleanup; diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index b415c2c..0f2462d 100644 +index a7788d1..afc7223 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -28,6 +28,7 @@ - #include "utils/MathUtils.h" - #include "threads/SingleLock.h" - #include "utils/log.h" -+#include "utils/TimeUtils.h" - - #include "Application.h" - #include "ApplicationMessenger.h" -@@ -232,7 +233,7 @@ CStdString CXBMCRenderManager::GetVSyncState() - return state; +@@ -95,7 +95,7 @@ class CRetakeLock + m_presenttime = 0; + m_presentstep = PRESENT_IDLE; + m_rendermethod = 0; +- m_presentsource = 0; ++ m_presentsource = -1; + m_presentmethod = PRESENT_METHOD_SINGLE; + m_bReconfigured = false; + m_hasCaptures = false; +@@ -105,8 +105,6 @@ class CRetakeLock + memset(&m_errorbuff, 0, ERRORBUFFSIZE); + m_errorindex = 0; + m_QueueSize = 2; +- m_QueueRender = 0; +- m_QueueOutput = 0; + m_QueueSkip = 0; } --bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation) -+bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation, bool buffering) - { - /* make sure any queued frame was fully presented */ - double timeout = m_presenttime + 0.1; -@@ -252,6 +253,9 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi - return false; - } +@@ -287,8 +285,13 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi -+ // set buffering -+ m_bCodecSupportsBuffering = buffering; + m_pRenderer->SetBufferSize(m_QueueSize); + m_pRenderer->Update(); +- m_QueueRender = 0; +- m_QueueOutput = 0; + - bool result = m_pRenderer->Configure(width, height, d_width, d_height, fps, flags, format, extended_format, orientation); - if(result) - { -@@ -269,6 +273,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi ++ m_queued.clear(); ++ m_discard.clear(); ++ m_free.clear(); ++ m_presentsource = -1; ++ for (int i=0; iReleaseBuffer(m_QueueRender); +- m_overlays.Release(m_QueueRender); +- m_QueueRender = (m_QueueRender + 1) % m_QueueSize; +- count++; +- } +- +- if(count > 1) +- m_QueueSkip += count - 1; +- m_pRenderer->FlipPage(m_presentsource); m_presentstep = PRESENT_FRAME; -@@ -351,6 +360,10 @@ unsigned int CXBMCRenderManager::PreInit() + m_presentevent.notifyAll(); + } ++ ++ /* release all previous */ ++ std::deque::iterator it = m_discard.begin(); ++ while(it != m_discard.end()) ++ { ++ // TODO check for fence ++ int idx = *it; ++ it = m_discard.erase(it); ++ m_free.push_back(idx); ++ m_pRenderer->ReleaseBuffer(idx); ++ m_overlays.Release(idx); ++ } + } + } +@@ -433,8 +435,6 @@ unsigned int CXBMCRenderManager::PreInit() UpdateDisplayLatency(); -+ m_bUseBuffering = false; -+ m_bCodecSupportsBuffering = true; -+ ResetRenderBuffer(); -+ + m_QueueSize = 2; +- m_QueueRender = 0; +- m_QueueOutput = 0; + m_QueueSkip = 0; + return m_pRenderer->PreInit(); - } +@@ -696,7 +696,8 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L + m_Queue[source].timestamp = timestamp; + m_Queue[source].presentfield = sync; + m_Queue[source].presentmethod = presentmethod; +- m_QueueOutput = source; ++ m_free.pop_front(); ++ m_queued.push_back(source); -@@ -379,7 +392,9 @@ bool CXBMCRenderManager::Flush() - - CRetakeLock lock(m_sharedSection); - m_pRenderer->Flush(); -+ m_overlays.Flush(); - m_flushEvent.Set(); -+ ResetRenderBuffer(); - } + /* signal to any waiters to check state */ + if(m_presentstep == PRESENT_IDLE) +@@ -763,7 +764,8 @@ void CXBMCRenderManager::Render(bool clear, DWORD flags, DWORD alpha) else - { -@@ -547,25 +562,21 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) - m_pRenderer->SetViewMode(iViewMode); + PresentSingle(clear, flags, alpha); + +- m_overlays.Render(m_presentsource); ++ if (m_presentsource >= 0) ++ m_overlays.Render(m_presentsource); } --void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) -+void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/, int speed /*= 1000*/) + /* simple present method */ +@@ -993,23 +995,23 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) + m_overlays.Release(GetNextDecode()); + + // return buffer level +- return (m_QueueOutput - m_QueueRender + m_QueueSize) % m_QueueSize; ++ return m_queued.size() + m_discard.size();; + } + + int CXBMCRenderManager::GetNextRender() { -- if(timestamp - GetPresentTime() > MAXPRESENTDELAY) -- timestamp = GetPresentTime() + MAXPRESENTDELAY; -- -- /* can't flip, untill timestamp */ -- if(!g_graphicsContext.IsFullScreenVideo()) -- WaitPresentTime(timestamp); -- -- /* make sure any queued frame was fully presented */ -- double timeout = m_presenttime + 1.0; -- while(m_presentstep != PRESENT_IDLE && !bStop) -+ if (!m_bUseBuffering) - { -- if(!m_presentevent.WaitMSec(100) && GetPresentTime() > timeout && !bStop) -+ /* make sure any queued frame was fully presented */ -+ double timeout = m_presenttime + 1.0; -+ while(m_presentstep != PRESENT_IDLE && !bStop) - { -- CLog::Log(LOGWARNING, "CRenderManager::FlipPage - timeout waiting for previous frame"); -- return; -+ if(!m_presentevent.WaitMSec(100) && GetPresentTime() > timeout && !bStop) -+ { -+ CLog::Log(LOGWARNING, "CRenderManager::FlipPage - timeout waiting for previous frame"); -+ return; -+ } - } -- }; -+ } - - if(bStop) - return; -@@ -573,57 +584,66 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L - { CRetakeLock lock(m_sharedSection); - if(!m_pRenderer) return; - -- m_presenttime = timestamp; -- m_presentfield = sync; -- m_presentstep = PRESENT_FLIP; -- m_presentsource = source; -+ double presenttime = timestamp; -+ EFIELDSYNC presentfield = sync; -+ EPRESENTMETHOD presentmethod; -+ - EDEINTERLACEMODE deinterlacemode = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; - EINTERLACEMETHOD interlacemethod = AutoInterlaceMethodInternal(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); - - if (deinterlacemode == VS_DEINTERLACEMODE_OFF) -- m_presentmethod = PRESENT_METHOD_SINGLE; -+ presentmethod = PRESENT_METHOD_SINGLE; - else - { -- if (deinterlacemode == VS_DEINTERLACEMODE_AUTO && m_presentfield == FS_NONE) -- m_presentmethod = PRESENT_METHOD_SINGLE; -+ if (deinterlacemode == VS_DEINTERLACEMODE_AUTO && presentfield == FS_NONE) -+ presentmethod = PRESENT_METHOD_SINGLE; - else - { - bool invert = false; -- if (interlacemethod == VS_INTERLACEMETHOD_RENDER_BLEND) m_presentmethod = PRESENT_METHOD_BLEND; -- else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_WEAVE) m_presentmethod = PRESENT_METHOD_WEAVE; -- else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_WEAVE_INVERTED) { m_presentmethod = PRESENT_METHOD_WEAVE ; invert = true; } -- else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_BOB) m_presentmethod = PRESENT_METHOD_BOB; -- else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_BOB_INVERTED) { m_presentmethod = PRESENT_METHOD_BOB; invert = true; } -- else if (interlacemethod == VS_INTERLACEMETHOD_DXVA_BOB) m_presentmethod = PRESENT_METHOD_BOB; -- else if (interlacemethod == VS_INTERLACEMETHOD_DXVA_BEST) m_presentmethod = PRESENT_METHOD_BOB; -- else m_presentmethod = PRESENT_METHOD_SINGLE; -+ if (interlacemethod == VS_INTERLACEMETHOD_RENDER_BLEND) presentmethod = PRESENT_METHOD_BLEND; -+ else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_WEAVE) presentmethod = PRESENT_METHOD_WEAVE; -+ else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_WEAVE_INVERTED) { presentmethod = PRESENT_METHOD_WEAVE ; invert = true; } -+ else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_BOB) presentmethod = PRESENT_METHOD_BOB; -+ else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_BOB_INVERTED) { presentmethod = PRESENT_METHOD_BOB; invert = true; } -+ else if (interlacemethod == VS_INTERLACEMETHOD_DXVA_BOB) presentmethod = PRESENT_METHOD_BOB; -+ else if (interlacemethod == VS_INTERLACEMETHOD_DXVA_BEST) presentmethod = PRESENT_METHOD_BOB; -+ else presentmethod = PRESENT_METHOD_SINGLE; - - /* default to odd field if we want to deinterlace and don't know better */ -- if (deinterlacemode == VS_DEINTERLACEMODE_FORCE && m_presentfield == FS_NONE) -- m_presentfield = FS_TOP; -+ if (deinterlacemode == VS_DEINTERLACEMODE_FORCE && presentfield == FS_NONE) -+ presentfield = FS_TOP; - - /* invert present field */ - if(invert) - { -- if( m_presentfield == FS_BOT ) -- m_presentfield = FS_TOP; -+ if( presentfield == FS_BOT ) -+ presentfield = FS_TOP; - else -- m_presentfield = FS_BOT; -+ presentfield = FS_BOT; - } - } - } - -+ FlipFreeBuffer(); -+ m_renderBuffers[m_iOutputRenderBuffer].pts = timestamp; -+ m_renderBuffers[m_iOutputRenderBuffer].presentfield = presentfield; -+ m_renderBuffers[m_iOutputRenderBuffer].presentmethod = presentmethod; -+ m_speed = speed; - } - - g_application.NewFrame(); -- /* wait untill render thread have flipped buffers */ -- timeout = m_presenttime + 1.0; -- while(m_presentstep == PRESENT_FLIP && !bStop) -+ -+ if (!m_bUseBuffering) - { -- if(!m_presentevent.WaitMSec(100) && GetPresentTime() > timeout && !bStop) -+ /* wait untill render thread have flipped buffers */ -+ double timeout = m_presenttime + 1.0; -+ while(m_presentstep == PRESENT_FLIP && !bStop) - { -- CLog::Log(LOGWARNING, "CRenderManager::FlipPage - timeout waiting for flip to complete"); -- return; -+ if(!m_presentevent.WaitMSec(100) && GetPresentTime() > timeout && !bStop) -+ { -+ CLog::Log(LOGWARNING, "CRenderManager::FlipPage - timeout waiting for flip to complete"); -+ return; -+ } - } - } - } -@@ -693,8 +713,12 @@ void CXBMCRenderManager::Present() - if (!m_pRenderer) - return; - -+ if (m_presentstep == PRESENT_IDLE) -+ PrepareNextRender(); -+ - if(m_presentstep == PRESENT_FLIP) - { -+ FlipRenderBuffer(); - m_overlays.Flip(); - m_pRenderer->FlipPage(m_presentsource); - m_presentstep = PRESENT_FRAME; -@@ -818,11 +842,11 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) - if (!m_pRenderer) +- if (m_QueueOutput == m_QueueRender) ++ if (m_queued.empty()) return -1; - -- if(m_pRenderer->AddVideoPicture(&pic)) -+ if(m_pRenderer->AddVideoPicture(&pic, (m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers)) - return 1; - - YV12Image image; -- int index = m_pRenderer->GetImage(&image); -+ int index = m_pRenderer->GetImage(&image, (m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers); - - if(index < 0) - return index; -@@ -848,19 +872,19 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) - } - #ifdef HAVE_LIBVDPAU - else if(pic.format == RENDER_FMT_VDPAU) -- m_pRenderer->AddProcessor(pic.vdpau); -+ m_pRenderer->AddProcessor(pic.vdpau, index); - #endif - #ifdef HAVE_LIBOPENMAX - else if(pic.format == RENDER_FMT_OMXEGL) -- m_pRenderer->AddProcessor(pic.openMax, &pic); -+ m_pRenderer->AddProcessor(pic.openMax, &pic, index); - #endif - #ifdef TARGET_DARWIN - else if(pic.format == RENDER_FMT_CVBREF) -- m_pRenderer->AddProcessor(pic.cvBufferRef); -+ m_pRenderer->AddProcessor(pic.cvBufferRef, index); - #endif - #ifdef HAVE_LIBVA - else if(pic.format == RENDER_FMT_VAAPI) -- m_pRenderer->AddProcessor(*pic.vaapi); -+ m_pRenderer->AddProcessor(*pic.vaapi, index); - #endif - m_pRenderer->ReleaseImage(index, false); - -@@ -922,3 +946,179 @@ EINTERLACEMETHOD CXBMCRenderManager::AutoInterlaceMethodInternal(EINTERLACEMETHO - - return mInt; +- return (m_QueueRender + 1) % m_QueueSize; ++ else ++ return m_queued.front(); } -+ -+int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) -+{ -+ CSharedLock lock(m_sharedSection); -+ if (!m_pRenderer) -+ return -1; -+ -+ double maxwait = GetPresentTime() + (float)timeout/1000; -+ while(!HasFreeBuffer() && !bStop) -+ { -+ lock.Leave(); -+ m_flipEvent.WaitMSec(std::min(50, timeout)); -+ if(GetPresentTime() > maxwait && !bStop) + + int CXBMCRenderManager::GetNextDecode() + { +- int outputPlus1 = (m_QueueOutput + 1) % m_QueueSize; +- if (outputPlus1 == m_QueueRender) ++ if (m_free.empty()) + return -1; + else +- return outputPlus1; ++ return m_free.front(); + } + + void CXBMCRenderManager::PrepareNextRender() +@@ -1029,16 +1031,19 @@ void CXBMCRenderManager::PrepareNextRender() + double frametime = 1.0 / GetMaximumFPS(); + + /* see if any future queued frames are already due */ +- int prv; +- int idx = m_QueueOutput; +- while(idx != nxt) ++ std::deque::reverse_iterator curr, prev; ++ int idx; ++ curr = prev = m_queued.rbegin(); ++ ++prev; ++ while (prev != m_queued.rend()) + { +- prv = (idx + m_QueueSize - 1) % m_QueueSize; +- if(clocktime > m_Queue[prv].timestamp /* previous frame is late */ +- && clocktime > m_Queue[idx].timestamp - frametime) /* selected frame is close to it's display time */ ++ if(clocktime > m_Queue[*prev].timestamp /* previous frame is late */ ++ && clocktime > m_Queue[*curr].timestamp - frametime) /* selected frame is close to it's display time */ + break; +- idx = prv; ++ ++curr; ++ ++prev; + } ++ idx = *curr; + + /* in fullscreen we will block after render, but only for MAXPRESENTDELAY */ + bool next; +@@ -1049,11 +1054,23 @@ void CXBMCRenderManager::PrepareNextRender() + + if (next) + { ++ /* skip late frames */ ++ int skip; ++ while((skip = m_queued.front()) != idx) + { -+ if (timeout != 0) -+ CLog::Log(LOGWARNING, "CRenderManager::WaitForBuffer - timeout waiting for buffer"); -+ return -1; -+ } -+ lock.Enter(); -+ } -+ lock.Leave(); -+ -+ if (bStop) -+ return -1; -+ -+ return 1; -+} -+ -+int CXBMCRenderManager::GetNextRenderBufferIndex() -+{ -+ if (m_iOutputRenderBuffer == m_iCurrentRenderBuffer) -+ return -1; -+ return (m_iCurrentRenderBuffer + 1) % m_iNumRenderBuffers; -+} -+ -+void CXBMCRenderManager::FlipRenderBuffer() -+{ -+ m_iCurrentRenderBuffer = GetNextRenderBufferIndex(); -+} -+ -+int CXBMCRenderManager::FlipFreeBuffer() -+{ -+ // See "Render Buffer State Description" in header for information. -+ if (HasFreeBuffer()) -+ { -+ m_bAllRenderBuffersDisplayed = false; -+ m_iOutputRenderBuffer = (m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers; -+ return m_iOutputRenderBuffer; -+ } -+} -+ -+bool CXBMCRenderManager::HasFreeBuffer() -+{ -+ if (!m_bUseBuffering) -+ { -+ if (m_iOutputRenderBuffer != m_iCurrentRenderBuffer) -+ return false; -+ else -+ return true; -+ } -+ -+ int outputPlus1 = (m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers; -+ if ((m_iOutputRenderBuffer == m_iDisplayedRenderBuffer && !m_bAllRenderBuffersDisplayed) -+ || outputPlus1 == m_iCurrentRenderBuffer) -+ return false; -+ else -+ return true; -+} -+ -+void CXBMCRenderManager::ResetRenderBuffer() -+{ -+ m_iNumRenderBuffers = m_pRenderer->GetMaxBufferSize(); -+ m_iNumRenderBuffers = std::min(5, m_iNumRenderBuffers); -+ m_iNumRenderBuffers = std::max(2, m_iNumRenderBuffers); -+ -+ if (!m_bCodecSupportsBuffering) -+ m_iNumRenderBuffers = 2; -+ -+ CLog::Log(LOGNOTICE,"CXBMCRenderManager::ResetRenderBuffer - using %d render buffers", m_iNumRenderBuffers); -+ m_overlays.SetNumBuffers(m_iNumRenderBuffers); -+ m_pRenderer->SetBufferSize(m_iNumRenderBuffers); -+ -+ m_iCurrentRenderBuffer = 0; -+ m_iOutputRenderBuffer = 0; -+ m_iDisplayedRenderBuffer = 0; -+ m_bAllRenderBuffersDisplayed = true; -+ m_sleeptime = 1.0; -+ m_presentPts = DVD_NOPTS_VALUE; -+ m_speed = 0; -+} -+ -+void CXBMCRenderManager::PrepareNextRender() -+{ -+ int idx = GetNextRenderBufferIndex(); -+ if (idx < 0) -+ return; -+ -+ double iClockSleep, iPlayingClock, iCurrentClock; -+ if (g_application.m_pPlayer) -+ iPlayingClock = g_application.m_pPlayer->GetClock(iCurrentClock, false); -+ else -+ iPlayingClock = iCurrentClock = 0; -+ -+ iClockSleep = m_renderBuffers[idx].pts - iPlayingClock; -+ -+ if (m_speed) -+ iClockSleep = iClockSleep * DVD_PLAYSPEED_NORMAL / m_speed; -+ -+ double presenttime = (iCurrentClock + iClockSleep) / DVD_TIME_BASE; -+ double clocktime = iCurrentClock / DVD_TIME_BASE; -+ if(presenttime - clocktime > MAXPRESENTDELAY) -+ presenttime = clocktime + MAXPRESENTDELAY; -+ -+ m_sleeptime = presenttime - clocktime; -+ double frametime = 1 / g_graphicsContext.GetFPS(); -+ -+ if (g_graphicsContext.IsFullScreenVideo() || presenttime <= clocktime + frametime) -+ { -+ m_presentPts = m_renderBuffers[idx].pts; -+ m_presenttime = presenttime; -+ m_presentmethod = m_renderBuffers[idx].presentmethod; -+ m_presentfield = m_renderBuffers[idx].presentfield; -+ m_presentstep = PRESENT_FLIP; -+ m_presentsource = idx; -+ } -+} -+ -+void CXBMCRenderManager::EnableBuffering(bool enable) -+{ -+ CRetakeLock lock(m_sharedSection); -+ -+ if (m_iNumRenderBuffers < 3) -+ return; -+ -+ m_bUseBuffering = enable; -+ if (!m_bUseBuffering) -+ m_iOutputRenderBuffer = m_iCurrentRenderBuffer; -+ -+ CLog::Log(LOGDEBUG, "CXBMCRenderManager::EnableBuffering - %d", m_bUseBuffering); -+} -+ -+void CXBMCRenderManager::DiscardBuffer() -+{ -+ CRetakeLock lock(m_sharedSection); -+ m_iOutputRenderBuffer = m_iCurrentRenderBuffer; -+} -+ -+void CXBMCRenderManager::NotifyDisplayFlip() -+{ -+ CRetakeLock lock(m_sharedSection); -+ if (!m_pRenderer) -+ return; -+ -+ if (m_iNumRenderBuffers >= 3) -+ { -+ int last = m_iDisplayedRenderBuffer; -+ m_iDisplayedRenderBuffer = (m_iCurrentRenderBuffer + m_iNumRenderBuffers - 1) % m_iNumRenderBuffers; -+ -+ // we have caught up with output so all buffers are re-usable -+ if (last != m_iDisplayedRenderBuffer -+ && m_iDisplayedRenderBuffer == m_iOutputRenderBuffer) -+ { -+ m_bAllRenderBuffersDisplayed = true; ++ m_queued.pop_front(); ++ m_discard.push_back(skip); ++ m_QueueSkip++; + } + -+ if (last != m_iDisplayedRenderBuffer -+ && m_iDisplayedRenderBuffer != m_iCurrentRenderBuffer) -+ { -+ m_pRenderer->ReleaseBuffer(m_iDisplayedRenderBuffer); -+ m_overlays.ReleaseBuffer(m_iDisplayedRenderBuffer); -+ } -+ } + m_presenttime = m_Queue[idx].timestamp; + m_presentmethod = m_Queue[idx].presentmethod; + m_presentfield = m_Queue[idx].presentfield; + m_presentstep = PRESENT_FLIP; ++ if(m_presentsource >= 0) ++ m_discard.push_back(m_presentsource); + m_presentsource = idx; ++ m_queued.pop_front(); + m_presentevent.notifyAll(); + } + } +@@ -1062,11 +1079,17 @@ void CXBMCRenderManager::DiscardBuffer() + { + CSharedLock lock(m_sharedSection); + CSingleLock lock2(m_presentlock); +- while(m_QueueOutput != m_QueueRender) + -+ lock.Leave(); -+ m_flipEvent.Set(); -+} ++ while(!m_queued.empty()) ++ { ++ int idx = m_queued.front(); ++ m_queued.pop_front(); ++ m_discard.push_back(idx); ++ } ++ if (m_presentsource >= 0) + { +- m_pRenderer->ReleaseBuffer(m_QueueOutput); +- m_overlays.Release(m_QueueOutput); +- m_QueueOutput = (m_QueueOutput + m_QueueSize - 1) % m_QueueSize; ++ m_discard.push_back(m_presentsource); ++ m_presentsource = -1; + } + if(m_presentstep == PRESENT_READY) + m_presentstep = PRESENT_IDLE; diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index b67629a..141b854 100644 +index d947e9e..03c5ab9 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.h +++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -31,6 +31,7 @@ +@@ -29,6 +29,7 @@ + #include "threads/Thread.h" + #include "settings/VideoSettings.h" #include "OverlayRenderer.h" ++#include class CRenderCapture; -+class CDVDClock; - namespace DXVA { class CProcessor; } - namespace VAAPI { class CSurfaceHolder; } -@@ -65,12 +66,12 @@ class CXBMCRenderManager - void SetViewMode(int iViewMode); - - // Functions called from mplayer -- bool Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation); -+ bool Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation, bool buffering = false); - bool IsConfigured() const; - - int AddVideoPicture(DVDVideoPicture& picture); - -- void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); -+ void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE, int speed = 1000); - unsigned int PreInit(); - void UnInit(); - bool Flush(); -@@ -78,7 +79,7 @@ class CXBMCRenderManager +@@ -107,7 +108,7 @@ class CXBMCRenderManager void AddOverlay(CDVDOverlay* o, double pts) { CSharedLock lock(m_sharedSection); -- m_overlays.AddOverlay(o, pts); -+ m_overlays.AddOverlay(o, pts, (m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers); +- m_overlays.AddOverlay(o, pts, (m_QueueOutput + 1) % m_QueueSize); ++ m_overlays.AddOverlay(o, pts, m_free.front()); } void AddCleanup(OVERLAY::COverlay* o) -@@ -135,6 +136,24 @@ class CXBMCRenderManager - void RegisterRenderUpdateCallBack(const void *ctx, RenderUpdateCallBackFn fn); - void RegisterRenderFeaturesCallBack(const void *ctx, RenderFeaturesCallBackFn fn); - -+ /** -+ * If player uses buffering it has to wait for a buffer before it calls -+ * AddVideoPicture and AddOverlay. It waits for max 50 ms before it returns -1 -+ * in case no buffer is available. Player may call this in a loop and decides -+ * by itself when it wants to drop a frame. -+ * If no buffering is requested in Configure, player does not need to call this, -+ * because FlipPage will block. -+ */ -+ int WaitForBuffer(volatile bool& bStop, int timeout = 100); -+ -+ /** -+ * Called by application right after flip. The buffer which has been rendered to -+ * display becomes available for player to deliver a new frame. -+ */ -+ void NotifyDisplayFlip(); -+ void EnableBuffering(bool enable); -+ void DiscardBuffer(); -+ - protected: - void Render(bool clear, DWORD flags, DWORD alpha); - -@@ -142,6 +161,13 @@ class CXBMCRenderManager - void PresentFields(bool clear, DWORD flags, DWORD alpha); - void PresentBlend(bool clear, DWORD flags, DWORD alpha); - -+ int GetNextRenderBufferIndex(); -+ void FlipRenderBuffer(); -+ int FlipFreeBuffer(); -+ bool HasFreeBuffer(); -+ void ResetRenderBuffer(); -+ void PrepareNextRender(); -+ - EINTERLACEMETHOD AutoInterlaceMethodInternal(EINTERLACEMETHOD mInt); - - bool m_bPauseDrawing; // true if we should pause rendering -@@ -173,6 +199,37 @@ class CXBMCRenderManager +@@ -218,16 +219,6 @@ class CXBMCRenderManager double m_displayLatency; void UpdateDisplayLatency(); -+ // Render Buffer State Description: -+ // -+ // Output: is the buffer about to or having its texture prepared for render (ie from output thread). -+ // Cannot go past the "Displayed" buffer (otherwise we will probably overwrite buffers not yet -+ // displayed or even rendered). -+ // Current: is the current buffer being or having been submitted for render to back buffer. -+ // Cannot go past "Output" buffer (else it would be rendering old output). -+ // Displayed: is the buffer that is now considered to be safely copied from back buffer to front buffer -+ // (we assume that after two swap-buffer flips for the same "Current" render buffer that that -+ // buffer will be safe, but otherwise we consider that only the previous-to-"Current" is guaranteed). -+ -+ int m_iCurrentRenderBuffer; -+ int m_iNumRenderBuffers; -+ int m_iOutputRenderBuffer; -+ int m_iDisplayedRenderBuffer; -+ bool m_bAllRenderBuffersDisplayed; -+ bool m_bUseBuffering; -+ bool m_bCodecSupportsBuffering; -+ int m_speed; -+ CEvent m_flipEvent; -+ -+ struct -+ { -+ double pts; -+ EFIELDSYNC presentfield; -+ EPRESENTMETHOD presentmethod; -+ }m_renderBuffers[5]; -+ -+ double m_sleeptime; -+ double m_presentPts; +- // Render Buffer State Description: +- // +- // Output: is the buffer about to or having its texture prepared for render (ie from output thread). +- // Cannot go past the "Displayed" buffer (otherwise we will probably overwrite buffers not yet +- // displayed or even rendered). +- // Render: is the current buffer being or having been submitted for render to back buffer. +- // Cannot go past "Output" buffer (else it would be rendering old output). +- +- int m_QueueRender; +- int m_QueueOutput; + int m_QueueSize; + int m_QueueSkip; + +@@ -238,6 +229,10 @@ class CXBMCRenderManager + EPRESENTMETHOD presentmethod; + } m_Queue[NUM_BUFFERS]; + ++ std::deque m_free; ++ std::deque m_queued; ++ std::deque m_discard; + double m_presenttime; double m_presentcorr; double m_presenterr; -diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp -index 0f38c9b..66bafbe 100644 ---- a/xbmc/cores/VideoRenderers/WinRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp -@@ -261,12 +261,12 @@ int CWinRenderer::NextYV12Texture() - return -1; - } - --bool CWinRenderer::AddVideoPicture(DVDVideoPicture* picture) -+bool CWinRenderer::AddVideoPicture(DVDVideoPicture* picture, int index) - { - if (m_renderMethod == RENDER_DXVA) - { -- int source = NextYV12Texture(); -- if(source < 0) -+ int source = index; -+ if(source < 0 || NextYV12Texture() < 0) - return false; - - DXVABuffer *buf = (DXVABuffer*)m_VideoBuffers[source]; -@@ -282,7 +282,7 @@ int CWinRenderer::GetImage(YV12Image *image, int source, bool readonly) - if( source == AUTOSOURCE ) - source = NextYV12Texture(); - -- if( source < 0 ) -+ if( source < 0 || NextYV12Texture() < 0) - return -1; - - YUVBuffer *buf = (YUVBuffer*)m_VideoBuffers[source]; -diff --git a/xbmc/cores/VideoRenderers/WinRenderer.h b/xbmc/cores/VideoRenderers/WinRenderer.h -index 3887343..0590336 100644 ---- a/xbmc/cores/VideoRenderers/WinRenderer.h -+++ b/xbmc/cores/VideoRenderers/WinRenderer.h -@@ -159,7 +159,7 @@ class CWinRenderer : public CBaseRenderer - virtual bool Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation); - virtual int GetImage(YV12Image *image, int source = AUTOSOURCE, bool readonly = false); - virtual void ReleaseImage(int source, bool preserve = false); -- virtual bool AddVideoPicture(DVDVideoPicture* picture); -+ virtual bool AddVideoPicture(DVDVideoPicture* picture, int index); - virtual void FlipPage(int source); - virtual unsigned int PreInit(); - virtual void UnInit(); -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 4ab4057..9e02431 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -4162,3 +4162,8 @@ bool CDVDPlayer::CachePVRStream(void) const - !g_PVRManager.IsPlayingRecording() && - g_advancedSettings.m_bPVRCacheInDvdPlayer; - } -+ -+double CDVDPlayer::GetClock(double& absolute, bool interpolated) -+{ -+ return m_clock.GetClock(absolute, interpolated); -+} -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index fa6c99f..a76b1ee 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.h -+++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -246,6 +246,8 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer - virtual bool SwitchChannel(const PVR::CPVRChannel &channel); - virtual bool CachePVRStream(void) const; - -+ virtual double GetClock(double& absolute, bool interpolated = true); -+ - enum ECacheState - { CACHESTATE_DONE = 0 - , CACHESTATE_FULL // player is filling up the demux queue -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index fddfffd..d8a7645 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -262,6 +262,7 @@ void CDVDPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec) - m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0; - m_started = false; - m_codecname = m_pVideoCodec->GetName(); -+ g_renderManager.EnableBuffering(false); - } - - void CDVDPlayerVideo::CloseStream(bool bWaitForBuffers) -@@ -437,6 +438,7 @@ void CDVDPlayerVideo::Process() - picture.iFlags &= ~DVP_FLAG_ALLOCATED; - m_packets.clear(); - m_started = false; -+ g_renderManager.EnableBuffering(false); - } - else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (CDVDPlayerVideo::Flush()) - { -@@ -449,6 +451,7 @@ void CDVDPlayerVideo::Process() - //we need to recalculate the framerate - //TODO: this needs to be set on a streamchange instead - ResetFrameRateCalc(); -+ g_renderManager.EnableBuffering(false); - - m_stalled = true; - m_started = false; -@@ -600,6 +603,8 @@ void CDVDPlayerVideo::Process() - - m_pVideoCodec->Reset(); - m_packets.clear(); -+ picture.iFlags &= ~DVP_FLAG_ALLOCATED; -+ g_renderManager.DiscardBuffer(); - break; - } - -@@ -714,6 +719,7 @@ void CDVDPlayerVideo::Process() - m_codecname = m_pVideoCodec->GetName(); - m_started = true; - m_messageParent.Put(new CDVDMsgInt(CDVDMsg::PLAYER_STARTED, DVDPLAYER_VIDEO)); -+ g_renderManager.EnableBuffering(true); - } - - // guess next frame pts. iDuration is always valid -@@ -1102,47 +1108,61 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - } - - CStdString formatstr; -+ bool buffering = false; - - switch(pPicture->format) - { - case RENDER_FMT_YUV420P: - formatstr = "YV12"; -+ buffering = true; - break; - case RENDER_FMT_YUV420P16: - formatstr = "YV12P16"; -+ buffering = true; - break; - case RENDER_FMT_YUV420P10: - formatstr = "YV12P10"; -+ buffering = true; - break; - case RENDER_FMT_NV12: - formatstr = "NV12"; -+ buffering = true; - break; - case RENDER_FMT_UYVY422: - formatstr = "UYVY"; -+ buffering = true; - break; - case RENDER_FMT_YUYV422: - formatstr = "YUY2"; -+ buffering = true; - break; - case RENDER_FMT_VDPAU: - formatstr = "VDPAU"; -+ buffering = true; - break; - case RENDER_FMT_DXVA: - formatstr = "DXVA"; -+ buffering = false; - break; - case RENDER_FMT_VAAPI: - formatstr = "VAAPI"; -+ buffering = false; - break; - case RENDER_FMT_OMXEGL: - formatstr = "OMXEGL"; -+ buffering = false; - break; - case RENDER_FMT_CVBREF: - formatstr = "BGRA"; -+ buffering = false; - break; - case RENDER_FMT_BYPASS: - formatstr = "BYPASS"; -+ buffering = false; - break; - case RENDER_FMT_NONE: - formatstr = "NONE"; -+ buffering = false; - break; - } - -@@ -1153,7 +1173,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - } - - CLog::Log(LOGDEBUG,"%s - change configuration. %dx%d. framerate: %4.2f. format: %s",__FUNCTION__,pPicture->iWidth, pPicture->iHeight, config_framerate, formatstr.c_str()); -- if(!g_renderManager.Configure(pPicture->iWidth, pPicture->iHeight, pPicture->iDisplayWidth, pPicture->iDisplayHeight, config_framerate, flags, pPicture->format, pPicture->extended_format, m_hints.orientation)) -+ if(!g_renderManager.Configure(pPicture->iWidth, pPicture->iHeight, pPicture->iDisplayWidth, pPicture->iDisplayHeight, config_framerate, flags, pPicture->format, pPicture->extended_format, m_hints.orientation, buffering)) - { - CLog::Log(LOGERROR, "%s - failed to configure renderer", __FUNCTION__); - return EOS_ABORT; -@@ -1337,6 +1357,16 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - mDisplayField = FS_BOT; - } - -+ int buffer = g_renderManager.WaitForBuffer(m_bStop); -+ while (buffer < 0 && !CThread::m_bStop && -+ CDVDClock::GetAbsoluteClock(false) < iCurrentClock + iSleepTime + DVD_MSEC_TO_TIME(500) ) -+ { -+ Sleep(1); -+ buffer = g_renderManager.WaitForBuffer(m_bStop); -+ } -+ if (buffer < 0) -+ return EOS_DROPPED; -+ - ProcessOverlays(pPicture, pts); - AutoCrop(pPicture); - -@@ -1353,7 +1383,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - if (index < 0) - return EOS_DROPPED; - -- g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, mDisplayField); -+ g_renderManager.FlipPage(CThread::m_bStop, pts, -1, mDisplayField, m_speed); - - return result; - #else -- 1.8.1.6 -From aadd9b3795fd4428f7c6afbc09b2a904f59dd4c5 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 16 Feb 2013 08:32:18 +0100 -Subject: [PATCH 002/119] add buffering for GLES +From d869662832c82228929dd9605f7d5ae33ab3bac0 Mon Sep 17 00:00:00 2001 +From: Joakim Plate +Date: Thu, 13 Jun 2013 23:29:45 +0200 +Subject: [PATCH 002/105] renderer: simplify code by always maintaining one + front buffer --- - xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 10 ---------- - xbmc/cores/VideoRenderers/LinuxRendererGLES.h | 6 ++++-- - 2 files changed, 4 insertions(+), 12 deletions(-) + xbmc/cores/VideoRenderers/RenderManager.cpp | 49 ++++++++++++----------------- + 1 file changed, 20 insertions(+), 29 deletions(-) -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -index 571d9cc..3602736 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -@@ -144,13 +144,6 @@ - delete m_dllSwScale; - } - --void CLinuxRendererGLES::ManageTextures() --{ -- m_NumYV12Buffers = 2; -- //m_iYV12RenderBuffer = 0; -- return; --} -- - bool CLinuxRendererGLES::ValidateRenderTarget() - { - if (!m_bValidated) -@@ -416,7 +409,6 @@ void CLinuxRendererGLES::Update(bool bPauseDrawing) - { - if (!m_bConfigured) return; - ManageDisplay(); -- ManageTextures(); - } - - void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha) -@@ -430,7 +422,6 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - if (m_renderMethod & RENDER_BYPASS) - { - ManageDisplay(); -- ManageTextures(); - // if running bypass, then the player might need the src/dst rects - // for sizing video playback on a layer other than the gles layer. - if (m_RenderUpdateCallBackFn) -@@ -470,7 +461,6 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - return; - - ManageDisplay(); -- ManageTextures(); - - g_graphicsContext.BeginPaint(); - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -index 51e84d4..65c30bb 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -@@ -42,7 +42,7 @@ - class COpenMaxVideo; - typedef std::vector Features; - --#define NUM_BUFFERS 3 -+#define NUM_BUFFERS 10 - - - #undef ALIGN -@@ -139,6 +139,9 @@ class CLinuxRendererGLES : public CBaseRenderer - virtual void UnInit(); - virtual void Reset(); /* resets renderer after seek for example */ - virtual void ReorderDrawPoints(); -+ virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } -+ virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } -+ virtual unsigned int GetProcessorSize() { return m_NumYV12Buffers; } - - virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); - -@@ -163,7 +166,6 @@ class CLinuxRendererGLES : public CBaseRenderer - protected: - virtual void Render(DWORD flags, int index); - -- virtual void ManageTextures(); - int NextYV12Texture(); - virtual bool ValidateRenderTarget(); - virtual void LoadShaders(int field=FIELD_FULL); --- -1.8.1.6 - - -From aaf99074524cb59232f232d8489288a0ef0903d4 Mon Sep 17 00:00:00 2001 -From: unknown -Date: Sat, 16 Feb 2013 11:17:02 +0100 -Subject: [PATCH 003/119] WinRenderer: add buffering - ---- - xbmc/cores/VideoRenderers/WinRenderer.cpp | 14 ++++++-------- - xbmc/cores/VideoRenderers/WinRenderer.h | 12 +++++------- - 2 files changed, 11 insertions(+), 15 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp -index 66bafbe..e751590 100644 ---- a/xbmc/cores/VideoRenderers/WinRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp -@@ -111,21 +111,19 @@ static enum PixelFormat PixelFormatFromFormat(ERenderFormat format) - - void CWinRenderer::ManageTextures() - { -- int neededbuffers = 2; -- -- if( m_NumYV12Buffers < neededbuffers ) -+ if( m_NumYV12Buffers < m_neededBuffers ) - { -- for(int i = m_NumYV12Buffers; i neededbuffers ) -+ else if( m_NumYV12Buffers > m_neededBuffers ) - { -- m_NumYV12Buffers = neededbuffers; -+ m_NumYV12Buffers = m_neededBuffers; - m_iYV12RenderBuffer = m_iYV12RenderBuffer % m_NumYV12Buffers; - -- for(int i = m_NumYV12Buffers-1; i>=neededbuffers;i--) -+ for(int i = m_NumYV12Buffers-1; i>=m_neededBuffers;i--) - DeleteYV12Texture(i); - } - } -diff --git a/xbmc/cores/VideoRenderers/WinRenderer.h b/xbmc/cores/VideoRenderers/WinRenderer.h -index 0590336..af30813 100644 ---- a/xbmc/cores/VideoRenderers/WinRenderer.h -+++ b/xbmc/cores/VideoRenderers/WinRenderer.h -@@ -33,13 +33,7 @@ - #include "cores/VideoRenderers/RenderFlags.h" - #include "cores/VideoRenderers/RenderFormats.h" - --//#define MP_DIRECTRENDERING -- --#ifdef MP_DIRECTRENDERING --#define NUM_BUFFERS 3 --#else --#define NUM_BUFFERS 2 --#endif -+#define NUM_BUFFERS 10 - - #define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) - #define CLAMP(a, min, max) ((a) > (max) ? (max) : ( (a) < (min) ? (min) : a )) -@@ -178,6 +172,8 @@ class CWinRenderer : public CBaseRenderer - void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); - - virtual unsigned int GetProcessorSize() { return m_processor.Size(); } -+ virtual void SetBufferSize(int numBuffers) { m_neededBuffers = numBuffers; } -+ virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } - - protected: - virtual void Render(DWORD flags); -@@ -247,6 +243,8 @@ class CWinRenderer : public CBaseRenderer - // the separable HQ scalers need this info, but could the m_destRect be used instead? - unsigned int m_destWidth; - unsigned int m_destHeight; -+ -+ int m_neededBuffers; +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index afc7223..5be41ab 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -86,6 +86,12 @@ class CRetakeLock + CCriticalSection &m_owned; }; - #else --- -1.8.1.6 - - -From 9023c3a907177d7e511905c10c05f8862053c046 Mon Sep 17 00:00:00 2001 -From: unknown -Date: Sat, 16 Feb 2013 11:17:32 +0100 -Subject: [PATCH 004/119] DXVA: activate buffering in renderer - ---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index d8a7645..1c68515 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1142,7 +1142,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - break; - case RENDER_FMT_DXVA: - formatstr = "DXVA"; -- buffering = false; -+ buffering = true; - break; - case RENDER_FMT_VAAPI: - formatstr = "VAAPI"; --- -1.8.1.6 - - -From e7473a4c2fb520e111b08cb4dfd0b87ea12ef78c Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 2 Oct 2012 10:49:09 +0200 -Subject: [PATCH 005/119] linuxrenderer: delete all textures on reconfigure - ---- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 27a0fc6..6cbbc78 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -266,7 +266,7 @@ bool CLinuxRendererGL::ValidateRenderTarget() - // function pointer for texture might change in - // call to LoadShaders - glFinish(); -- for (int i = 0 ; i < m_NumYV12Buffers ; i++) -+ for (int i = 0 ; i < NUM_BUFFERS ; i++) - (this->*m_textureDelete)(i); ++static void requeue(std::deque &trg, std::deque &src) ++{ ++ trg.push_back(src.front()); ++ src.pop_front(); ++} ++ + CXBMCRenderManager::CXBMCRenderManager() + { + m_pRenderer = NULL; +@@ -95,7 +101,7 @@ class CRetakeLock + m_presenttime = 0; + m_presentstep = PRESENT_IDLE; + m_rendermethod = 0; +- m_presentsource = -1; ++ m_presentsource = 0; + m_presentmethod = PRESENT_METHOD_SINGLE; + m_bReconfigured = false; + m_hasCaptures = false; +@@ -289,8 +295,8 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi + m_queued.clear(); + m_discard.clear(); + m_free.clear(); +- m_presentsource = -1; +- for (int i=0; i::iterator it = m_discard.begin(); +- while(it != m_discard.end()) ++ for(std::deque::iterator it = m_discard.begin(); it != m_discard.end(); ) + { + // TODO check for fence +- int idx = *it; ++ m_pRenderer->ReleaseBuffer(*it); ++ m_overlays.Release(*it); ++ m_free.push_back(*it); + it = m_discard.erase(it); +- m_free.push_back(idx); +- m_pRenderer->ReleaseBuffer(idx); +- m_overlays.Release(idx); + } + } + } +@@ -696,8 +700,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L + m_Queue[source].timestamp = timestamp; + m_Queue[source].presentfield = sync; + m_Queue[source].presentmethod = presentmethod; +- m_free.pop_front(); +- m_queued.push_back(source); ++ requeue(m_queued, m_free); + + /* signal to any waiters to check state */ + if(m_presentstep == PRESENT_IDLE) +@@ -764,8 +767,7 @@ void CXBMCRenderManager::Render(bool clear, DWORD flags, DWORD alpha) + else + PresentSingle(clear, flags, alpha); + +- if (m_presentsource >= 0) +- m_overlays.Render(m_presentsource); ++ m_overlays.Render(m_presentsource); + } + + /* simple present method */ +@@ -1055,11 +1057,9 @@ void CXBMCRenderManager::PrepareNextRender() + if (next) + { + /* skip late frames */ +- int skip; +- while((skip = m_queued.front()) != idx) ++ while(m_queued.front() != idx) + { +- m_queued.pop_front(); +- m_discard.push_back(skip); ++ requeue(m_discard, m_queued); + m_QueueSkip++; + } + +@@ -1067,8 +1067,7 @@ void CXBMCRenderManager::PrepareNextRender() + m_presentmethod = m_Queue[idx].presentmethod; + m_presentfield = m_Queue[idx].presentfield; + m_presentstep = PRESENT_FLIP; +- if(m_presentsource >= 0) +- m_discard.push_back(m_presentsource); ++ m_discard.push_back(m_presentsource); + m_presentsource = idx; + m_queued.pop_front(); + m_presentevent.notifyAll(); +@@ -1081,16 +1080,8 @@ void CXBMCRenderManager::DiscardBuffer() + CSingleLock lock2(m_presentlock); + + while(!m_queued.empty()) +- { +- int idx = m_queued.front(); +- m_queued.pop_front(); +- m_discard.push_back(idx); +- } +- if (m_presentsource >= 0) +- { +- m_discard.push_back(m_presentsource); +- m_presentsource = -1; +- } ++ requeue(m_discard, m_queued); ++ + if(m_presentstep == PRESENT_READY) + m_presentstep = PRESENT_IDLE; + m_presentevent.notifyAll(); -- 1.8.1.6 -From aa45e3d00c38c0165881ef266b6481993f462b5e Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Mon, 28 May 2012 10:17:33 +0200 -Subject: [PATCH 006/119] drop frame counter in application, ask render manager +From 39fd0caf3c1a93a28fe77d89cbd8a179daa9a77c Mon Sep 17 00:00:00 2001 +From: Joakim Plate +Date: Thu, 13 Jun 2013 23:39:55 +0200 +Subject: [PATCH 003/105] renderer: remove now pointless GetNext(Decode/Render) + function + +--- + xbmc/cores/VideoRenderers/RenderManager.cpp | 39 +++++++++-------------------- + xbmc/cores/VideoRenderers/RenderManager.h | 2 -- + 2 files changed, 12 insertions(+), 29 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index 5be41ab..6e5f0cb 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -349,11 +349,10 @@ void CXBMCRenderManager::FrameMove() + + if (m_presentstep == PRESENT_FRAME2) + { +- int idx = GetNextRender(); +- if(idx >= 0) ++ if(!m_queued.empty()) + { + double timestamp = GetPresentTime(); +- if(timestamp > m_presenttime + (m_Queue[idx].timestamp - m_presenttime) * 0.5) ++ if(timestamp > m_presenttime + (m_Queue[m_queued.front()].timestamp - m_presenttime) * 0.5) + { + m_presentstep = PRESENT_READY; + m_presentevent.notifyAll(); +@@ -405,7 +404,7 @@ void CXBMCRenderManager::FrameFinish() + + if(m_presentstep == PRESENT_IDLE) + { +- if(GetNextRender() >= 0) ++ if(!m_queued.empty()) + m_presentstep = PRESENT_READY; + } + +@@ -694,8 +693,11 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L + + CSingleLock lock2(m_presentlock); + ++ if(m_free.empty()) ++ return; ++ + if(source < 0) +- source = GetNextDecode(); ++ source = m_free.front(); + + m_Queue[source].timestamp = timestamp; + m_Queue[source].presentfield = sync; +@@ -870,9 +872,9 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) + if (!m_pRenderer) + return -1; + +- int index = GetNextDecode(); +- if(index < 0) ++ if(m_free.empty()) + return -1; ++ int index = m_free.front(); + + if(m_pRenderer->AddVideoPicture(&pic, index)) + return 1; +@@ -982,7 +984,7 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) + CSingleLock lock2(m_presentlock); + + XbmcThreads::EndTime endtime(timeout); +- while(GetNextDecode() < 0) ++ while(m_free.empty()) + { + m_presentevent.wait(lock2, std::min(50, timeout)); + if(endtime.IsTimePast() || bStop) +@@ -994,34 +996,17 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) + } + + // make sure overlay buffer is released, this won't happen on AddOverlay +- m_overlays.Release(GetNextDecode()); ++ m_overlays.Release(m_free.front()); + + // return buffer level + return m_queued.size() + m_discard.size();; + } + +-int CXBMCRenderManager::GetNextRender() +-{ +- if (m_queued.empty()) +- return -1; +- else +- return m_queued.front(); +-} +- +-int CXBMCRenderManager::GetNextDecode() +-{ +- if (m_free.empty()) +- return -1; +- else +- return m_free.front(); +-} +- + void CXBMCRenderManager::PrepareNextRender() + { + CSingleLock lock(m_presentlock); + +- int nxt = GetNextRender(); +- if (nxt < 0) ++ if (m_queued.empty()) + { + CLog::Log(LOGERROR, "CRenderManager::PrepareNextRender - asked to prepare with nothing available"); + m_presentstep = PRESENT_IDLE; +diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h +index 03c5ab9..f693d80 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.h ++++ b/xbmc/cores/VideoRenderers/RenderManager.h +@@ -185,8 +185,6 @@ class CXBMCRenderManager + void PresentFields(bool clear, DWORD flags, DWORD alpha); + void PresentBlend(bool clear, DWORD flags, DWORD alpha); + +- int GetNextRender(); +- int GetNextDecode(); + void PrepareNextRender(); + + EINTERLACEMETHOD AutoInterlaceMethodInternal(EINTERLACEMETHOD mInt); +-- +1.8.1.6 + + +From b9fb6911879bc79213a8bd66db151bb3ad181586 Mon Sep 17 00:00:00 2001 +From: Joakim Plate +Date: Fri, 14 Jun 2013 00:25:37 +0200 +Subject: [PATCH 004/105] renderer: name present buffer structure to be able to + reference it + +--- + xbmc/cores/VideoRenderers/RenderManager.cpp | 7 ++++--- + xbmc/cores/VideoRenderers/RenderManager.h | 2 +- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index 6e5f0cb..179f753 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -699,9 +699,10 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L + if(source < 0) + source = m_free.front(); + +- m_Queue[source].timestamp = timestamp; +- m_Queue[source].presentfield = sync; +- m_Queue[source].presentmethod = presentmethod; ++ SPresent& m = m_Queue[source]; ++ m.timestamp = timestamp; ++ m.presentfield = sync; ++ m.presentmethod = presentmethod; + requeue(m_queued, m_free); + + /* signal to any waiters to check state */ +diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h +index f693d80..6dc2629 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.h ++++ b/xbmc/cores/VideoRenderers/RenderManager.h +@@ -220,7 +220,7 @@ class CXBMCRenderManager + int m_QueueSize; + int m_QueueSkip; + +- struct ++ struct SPresent + { + double timestamp; + EFIELDSYNC presentfield; +-- +1.8.1.6 + + +From 999f40f093961e6bcf1852166165e8a45096cbaa Mon Sep 17 00:00:00 2001 +From: Joakim Plate +Date: Fri, 14 Jun 2013 00:29:39 +0200 +Subject: [PATCH 005/105] renderer: store bypass format in rendermanager instead +The present method will be overwritten on each flippage --- - xbmc/Application.cpp | 50 ++++++----------------------- - xbmc/Application.h | 6 ++-- - xbmc/cores/VideoRenderers/RenderManager.cpp | 11 +++++++ - xbmc/cores/VideoRenderers/RenderManager.h | 1 + - 4 files changed, 23 insertions(+), 45 deletions(-) + xbmc/cores/VideoRenderers/RenderManager.cpp | 5 ++--- + xbmc/cores/VideoRenderers/RenderManager.h | 2 +- + 2 files changed, 3 insertions(+), 4 deletions(-) -diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 32d76b7..f5a6f5e 100644 ---- a/xbmc/Application.cpp -+++ b/xbmc/Application.cpp -@@ -420,8 +420,6 @@ - #endif - m_currentStack = new CFileItemList; - -- m_frameCount = 0; -- - m_bPresentFrame = false; - m_bPlatformDirectories = true; - -@@ -2048,28 +2046,18 @@ float CApplication::GetDimScreenSaverLevel() const - - bool CApplication::WaitFrame(unsigned int timeout) - { -- bool done = false; -- - // Wait for all other frames to be presented -- CSingleLock lock(m_frameMutex); -- //wait until event is set, but modify remaining time -+ m_frameEvent.Reset(); - -- TightConditionVariable > cv(m_frameCond, InversePredicate(m_frameCount)); -- cv.wait(lock,timeout); -- done = m_frameCount == 0; -+ if (!g_renderManager.HasFrame() && !m_frameEvent.WaitMSec(timeout)) -+ return false; - -- return done; -+ return g_renderManager.HasFrame(); - } - - void CApplication::NewFrame() - { -- // We just posted another frame. Keep track and notify. -- { -- CSingleLock lock(m_frameMutex); -- m_frameCount++; -- } -- -- m_frameCond.notifyAll(); -+ m_frameEvent.Set(); - } - - void CApplication::Render() -@@ -2082,7 +2070,6 @@ void CApplication::Render() - - int vsync_mode = CSettings::Get().GetInt("videoscreen.vsync"); - -- bool decrement = false; - bool hasRendered = false; - bool limitFrames = false; - unsigned int singleFrameTime = 10; // default limit 100 fps -@@ -2096,13 +2083,10 @@ void CApplication::Render() - m_bPresentFrame = false; - if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !IsPaused() && g_renderManager.RendererHandlesPresent()) - { -- CSingleLock lock(m_frameMutex); -- -- TightConditionVariable cv(m_frameCond,m_frameCount); -- cv.wait(lock,100); -- -- m_bPresentFrame = m_frameCount > 0; -- decrement = m_bPresentFrame; -+ m_frameEvent.Reset(); -+ m_bPresentFrame = g_renderManager.HasFrame(); -+ if (!m_bPresentFrame && m_frameEvent.WaitMSec(100)) -+ m_bPresentFrame = g_renderManager.HasFrame(); - hasRendered = true; +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index 179f753..0a40f57 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -272,8 +272,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi + lock.Enter(); } - else -@@ -2126,8 +2110,6 @@ void CApplication::Render() - else if (lowfps) - singleFrameTime = 200; // 5 fps, <=200 ms latency to wake up - } -- -- decrement = true; - } - } + lock2.Enter(); +- if( format & RENDER_FMT_BYPASS ) +- m_presentmethod = PRESENT_METHOD_BYPASS; ++ m_format = format; -@@ -2192,13 +2174,6 @@ void CApplication::Render() + int processor = m_pRenderer->GetProcessorSize(); + if(processor) +@@ -312,7 +311,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi - g_renderManager.UpdateResolution(); - g_renderManager.ManageCaptures(); -- -- { -- CSingleLock lock(m_frameMutex); -- if(m_frameCount > 0 && decrement) -- m_frameCount--; -- } -- m_frameCond.notifyAll(); - } - - void CApplication::SetStandAlone(bool value) -@@ -5517,12 +5492,6 @@ bool CApplication::SwitchToFullScreen() - // See if we're playing a video, and are in GUI mode - if ( IsPlayingVideo() && g_windowManager.GetActiveWindow() != WINDOW_FULLSCREEN_VIDEO) - { -- // Reset frame count so that timing is FPS will be correct. -- { -- CSingleLock lock(m_frameMutex); -- m_frameCount = 0; -- } -- - // then switch to fullscreen mode - g_windowManager.ActivateWindow(WINDOW_FULLSCREEN_VIDEO); - return true; -@@ -5755,7 +5724,6 @@ bool CApplication::IsCurrentThread() const - - bool CApplication::IsPresentFrame() + bool CXBMCRenderManager::RendererHandlesPresent() const { -- CSingleLock lock(m_frameMutex); - bool ret = m_bPresentFrame; - - return ret; -diff --git a/xbmc/Application.h b/xbmc/Application.h -index 471199e..69b52d9 100644 ---- a/xbmc/Application.h -+++ b/xbmc/Application.h -@@ -432,10 +432,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs - bool m_bEnableLegacyRes; - bool m_bTestMode; - bool m_bSystemScreenSaverEnable; -- -- int m_frameCount; -- CCriticalSection m_frameMutex; -- XbmcThreads::ConditionVariable m_frameCond; -+ -+ CEvent m_frameEvent; - - VIDEO::CVideoInfoScanner *m_videoInfoScanner; - MUSIC_INFO::CMusicInfoScanner *m_musicInfoScanner; -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 0f2462d..a020837 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -1122,3 +1122,14 @@ void CXBMCRenderManager::NotifyDisplayFlip() - lock.Leave(); - m_flipEvent.Set(); +- return IsConfigured() && m_presentmethod != PRESENT_METHOD_BYPASS; ++ return IsConfigured() && m_format != RENDER_FMT_BYPASS; } -+ -+bool CXBMCRenderManager::HasFrame() -+{ -+ CSharedLock lock(m_sharedSection); -+ if (m_presentstep == PRESENT_IDLE && -+ GetNextRenderBufferIndex() < 0 && -+ m_speed > 0) -+ return false; -+ else -+ return true; -+} + + bool CXBMCRenderManager::IsConfigured() const diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 141b854..c96c9f2 100644 +index 6dc2629..1be4e2f 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.h +++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -151,6 +151,7 @@ class CXBMCRenderManager - * display becomes available for player to deliver a new frame. - */ - void NotifyDisplayFlip(); -+ bool HasFrame(); - void EnableBuffering(bool enable); - void DiscardBuffer(); +@@ -211,7 +211,6 @@ class CXBMCRenderManager + PRESENT_METHOD_BLEND, + PRESENT_METHOD_WEAVE, + PRESENT_METHOD_BOB, +- PRESENT_METHOD_BYPASS, + }; --- -1.8.1.6 - - -From c55578b068f066360535922350c231045bf6a078 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Mon, 28 May 2012 11:02:29 +0200 -Subject: [PATCH 007/119] vaapi: adopt to buffering in renderer - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 2 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 3 ++- - xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h | 1 + - 3 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 6ce6e8b..9111afa 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -109,7 +109,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx - } - - VAAPI::CDecoder* dec = new VAAPI::CDecoder(); -- if(dec->Open(avctx, *cur)) -+ if(dec->Open(avctx, *cur, ctx->m_uSurfacesCount)) - { - ctx->SetHardware(dec); - return *cur; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index 5d10f31..0cd89e8 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -@@ -357,6 +357,7 @@ bool CDecoder::Open(AVCodecContext *avctx, enum PixelFormat fmt, unsigned int su - CHECK(vaCreateConfig(m_display->get(), profile, entrypoint, &attrib, 1, &m_hwaccel->config_id)) - m_config = m_hwaccel->config_id; - -+ m_renderbuffers_count = surfaces; - if (!EnsureContext(avctx)) - return false; - -@@ -388,7 +389,7 @@ bool CDecoder::EnsureContext(AVCodecContext *avctx) - else - m_refs = 2; - } -- return EnsureSurfaces(avctx, m_refs + 3); -+ return EnsureSurfaces(avctx, m_refs + m_renderbuffers_count + 1); - } - - bool CDecoder::EnsureSurfaces(AVCodecContext *avctx, unsigned n_surfaces_count) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h -index 2840c52..1385833 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h -@@ -122,6 +122,7 @@ class CDecoder - static const unsigned m_surfaces_max = 32; - unsigned m_surfaces_count; - VASurfaceID m_surfaces[m_surfaces_max]; -+ unsigned m_renderbuffers_count; - - int m_refs; - std::list m_surfaces_used; --- -1.8.1.6 - - -From 15a9d56521d185b8c6ffbc102c11767159555651 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 16 Feb 2013 20:17:29 +0100 -Subject: [PATCH 008/119] add buffering - some documentation - ---- - xbmc/cores/IPlayer.h | 3 +++ - xbmc/cores/VideoRenderers/RenderManager.h | 40 +++++++++++++++++++++++++++++++ - 2 files changed, 43 insertions(+) - -diff --git a/xbmc/cores/IPlayer.h b/xbmc/cores/IPlayer.h -index 9be9e22..3198aa5 100644 ---- a/xbmc/cores/IPlayer.h -+++ b/xbmc/cores/IPlayer.h -@@ -244,6 +244,9 @@ class IPlayer - */ - virtual void GetSubtitleCapabilities(std::vector &subCaps) { subCaps.assign(1,IPC_SUBS_ALL); }; - -+ /*! -+ \brief called by RenderManager in order to schedule frames -+ */ - virtual double GetClock(double& absolute, bool interpolated = true) {return 0; }; - - protected: -diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index c96c9f2..64e957e 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -66,11 +66,38 @@ class CXBMCRenderManager - void SetViewMode(int iViewMode); - - // Functions called from mplayer -+ /** -+ * Called by video player to configure renderer -+ * @param width width of decoded frame -+ * @param height height of decoded frame -+ * @param d_width displayed width of frame (aspect ratio) -+ * @param d_height displayed height of frame -+ * @param fps frames per second of video -+ * @param flags see RenderFlags.h -+ * @param format see RenderFormats.h -+ * @param extended_format used by DXVA -+ * @param orientation -+ * @param buffering enable buffering in renderer, defaults to false -+ */ - bool Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation, bool buffering = false); - bool IsConfigured() const; - - int AddVideoPicture(DVDVideoPicture& picture); - -+ /** -+ * Called by video player to flip render buffers -+ * If buffering is enabled this method does not block. In case of disabled buffering -+ * this method blocks waiting for the render thread to pass by. -+ * When buffering is used there might be no free buffer available after the call to -+ * this method. Player has to call WaitForBuffer. A free buffer will become -+ * available after the main thread has flipped front / back buffers. -+ * -+ * @param bStop reference to stop flag of calling thread -+ * @param timestamp pts of frame delivered with AddVideoPicture -+ * @param source depreciated -+ * @param sync signals frame, top, or bottom field -+ * @param speed current speed of player, needed for some optimizations like keeping the gui responsive on rewind -+ */ - void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE, int speed = 1000); - unsigned int PreInit(); - void UnInit(); -@@ -151,8 +178,21 @@ class CXBMCRenderManager - * display becomes available for player to deliver a new frame. - */ - void NotifyDisplayFlip(); -+ -+ /** -+ * Called by application (main thread) to query if there is any frame to render -+ */ - bool HasFrame(); -+ -+ /** -+ * Video player can dynamically enable/disable buffering. In situations like -+ * rewind buffering is not ideal. -+ */ - void EnableBuffering(bool enable); -+ -+ /** -+ * Video player call this on flush in oder to discard any queued frames -+ */ - void DiscardBuffer(); - - protected: --- -1.8.1.6 - - -From e53169300582d4b27e74c3c126c183502e7f35e9 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 19 Feb 2013 09:06:22 +0100 -Subject: [PATCH 009/119] move NUM_BUFFERS up to BaseRenderer.h - ---- - xbmc/cores/VideoRenderers/BaseRenderer.h | 3 ++- - xbmc/cores/VideoRenderers/LinuxRendererGL.h | 2 -- - xbmc/cores/VideoRenderers/LinuxRendererGLES.h | 2 -- - xbmc/cores/VideoRenderers/OverlayRenderer.cpp | 2 +- - xbmc/cores/VideoRenderers/OverlayRenderer.h | 3 ++- - xbmc/cores/VideoRenderers/WinRenderer.h | 2 -- - 6 files changed, 5 insertions(+), 9 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index 95b9735..8f31c65 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.h -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -29,12 +29,13 @@ - - #define MAX_PLANES 3 - #define MAX_FIELDS 3 -+#define NUM_BUFFERS 10 - - class CSetting; - - typedef struct YV12Image - { -- BYTE * plane[MAX_PLANES]; -+ uint8_t* plane[MAX_PLANES]; - int planesize[MAX_PLANES]; - unsigned stride[MAX_PLANES]; - unsigned width; -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index 9a151cc..949c502 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -45,8 +45,6 @@ - namespace Shaders { class BaseVideoFilterShader; } - namespace VAAPI { struct CHolder; } - --#define NUM_BUFFERS 10 -- - - #undef ALIGN - #define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -index 65c30bb..9daf1c9 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -@@ -42,8 +42,6 @@ - class COpenMaxVideo; - typedef std::vector Features; - --#define NUM_BUFFERS 10 -- - - #undef ALIGN - #define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) -diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -index faa9dcb..660a3ce 100644 ---- a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -@@ -97,7 +97,7 @@ long COverlayMainThread::Release() - - CRenderer::~CRenderer() - { -- for(int i = 0; i < 10; i++) -+ for(int i = 0; i < NUM_BUFFERS; i++) - Release(m_buffers[i]); - } - -diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.h b/xbmc/cores/VideoRenderers/OverlayRenderer.h -index becf2c2..cf1a8ea 100644 ---- a/xbmc/cores/VideoRenderers/OverlayRenderer.h -+++ b/xbmc/cores/VideoRenderers/OverlayRenderer.h -@@ -23,6 +23,7 @@ - #pragma once - - #include "threads/CriticalSection.h" -+#include "BaseRenderer.h" - - #include - -@@ -127,7 +128,7 @@ - void Release(SElementV& list); - - CCriticalSection m_section; -- SElementV m_buffers[10]; -+ SElementV m_buffers[NUM_BUFFERS]; - int m_iNumBuffers; - int m_render; - -diff --git a/xbmc/cores/VideoRenderers/WinRenderer.h b/xbmc/cores/VideoRenderers/WinRenderer.h -index af30813..2055a96 100644 ---- a/xbmc/cores/VideoRenderers/WinRenderer.h -+++ b/xbmc/cores/VideoRenderers/WinRenderer.h -@@ -33,8 +33,6 @@ - #include "cores/VideoRenderers/RenderFlags.h" - #include "cores/VideoRenderers/RenderFormats.h" - --#define NUM_BUFFERS 10 -- - #define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) - #define CLAMP(a, min, max) ((a) > (max) ? (max) : ( (a) < (min) ? (min) : a )) - --- -1.8.1.6 - - -From a90fbb5641248e244778cd172a268aa417fd0f5b Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 24 Feb 2013 09:55:00 +0100 -Subject: [PATCH 010/119] OverlayRenderer: align buffers with index in - renderManager - ---- - xbmc/cores/VideoRenderers/OverlayRenderer.cpp | 7 +++++-- - xbmc/cores/VideoRenderers/OverlayRenderer.h | 2 +- - xbmc/cores/VideoRenderers/RenderManager.cpp | 6 ++++-- - 3 files changed, 10 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -index 660a3ce..abaaba6 100644 ---- a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -@@ -161,10 +161,13 @@ void CRenderer::Flush() - Release(m_cleanup); - } - --void CRenderer::Flip() -+void CRenderer::Flip(int source) - { - CSingleLock lock(m_section); -- m_render = (m_render + 1) % m_iNumBuffers; -+ if( source >= 0 && source < m_iNumBuffers ) -+ m_render = source; -+ else -+ m_render = (m_render + 1) % m_iNumBuffers; - } - - void CRenderer::ReleaseBuffer(int idx) -diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.h b/xbmc/cores/VideoRenderers/OverlayRenderer.h -index cf1a8ea..83ea575 100644 ---- a/xbmc/cores/VideoRenderers/OverlayRenderer.h -+++ b/xbmc/cores/VideoRenderers/OverlayRenderer.h -@@ -96,7 +96,7 @@ - void AddOverlay(CDVDOverlay* o, double pts, int index); - void AddOverlay(COverlay* o, double pts, int index); - void AddCleanup(COverlay* o); -- void Flip(); -+ void Flip(int source); - void Render(); - void Flush(); - void SetNumBuffers(int numBuffers) { m_iNumBuffers = numBuffers; } -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index a020837..9153182 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -316,7 +316,7 @@ void CXBMCRenderManager::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - if(m_presentstep == PRESENT_FLIP) - { - FlipRenderBuffer(); -- m_overlays.Flip(); -+ m_overlays.Flip(m_presentsource); - m_pRenderer->FlipPage(m_presentsource); - m_presentstep = PRESENT_FRAME; - m_presentevent.Set(); -@@ -719,7 +719,7 @@ void CXBMCRenderManager::Present() - if(m_presentstep == PRESENT_FLIP) - { - FlipRenderBuffer(); -- m_overlays.Flip(); -+ m_overlays.Flip(m_presentsource); - m_pRenderer->FlipPage(m_presentsource); - m_presentstep = PRESENT_FRAME; - m_presentevent.Set(); -@@ -971,6 +971,8 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) - if (bStop) - return -1; - -+ // make sure overlay buffer is released, this won't happen on AddOverlay -+ m_overlays.ReleaseBuffer((m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers); - return 1; - } - --- -1.8.1.6 - - -From 2a4cd14d1fb4d92096aeaa951580f93b7a601e35 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 26 Feb 2013 09:00:21 +0100 -Subject: [PATCH 011/119] add buffering - submit absolute time to render - buffers - ---- - xbmc/cores/IPlayer.h | 5 ----- - xbmc/cores/VideoRenderers/RenderManager.cpp | 18 ++---------------- - xbmc/cores/VideoRenderers/RenderManager.h | 5 ++--- - xbmc/cores/dvdplayer/DVDPlayer.cpp | 5 ----- - xbmc/cores/dvdplayer/DVDPlayer.h | 2 -- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- - 6 files changed, 5 insertions(+), 32 deletions(-) - -diff --git a/xbmc/cores/IPlayer.h b/xbmc/cores/IPlayer.h -index 3198aa5..6b713dc 100644 ---- a/xbmc/cores/IPlayer.h -+++ b/xbmc/cores/IPlayer.h -@@ -244,11 +244,6 @@ class IPlayer - */ - virtual void GetSubtitleCapabilities(std::vector &subCaps) { subCaps.assign(1,IPC_SUBS_ALL); }; - -- /*! -- \brief called by RenderManager in order to schedule frames -- */ -- virtual double GetClock(double& absolute, bool interpolated = true) {return 0; }; -- - protected: - IPlayerCallback& m_callback; - }; -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 9153182..23c9a7d 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -584,7 +584,6 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L - { CRetakeLock lock(m_sharedSection); - if(!m_pRenderer) return; - -- double presenttime = timestamp; - EFIELDSYNC presentfield = sync; - EPRESENTMETHOD presentmethod; - -@@ -1035,7 +1034,6 @@ void CXBMCRenderManager::ResetRenderBuffer() - m_iDisplayedRenderBuffer = 0; - m_bAllRenderBuffersDisplayed = true; - m_sleeptime = 1.0; -- m_presentPts = DVD_NOPTS_VALUE; - m_speed = 0; - } - -@@ -1045,19 +1043,8 @@ void CXBMCRenderManager::PrepareNextRender() - if (idx < 0) - return; - -- double iClockSleep, iPlayingClock, iCurrentClock; -- if (g_application.m_pPlayer) -- iPlayingClock = g_application.m_pPlayer->GetClock(iCurrentClock, false); -- else -- iPlayingClock = iCurrentClock = 0; -- -- iClockSleep = m_renderBuffers[idx].pts - iPlayingClock; -- -- if (m_speed) -- iClockSleep = iClockSleep * DVD_PLAYSPEED_NORMAL / m_speed; -- -- double presenttime = (iCurrentClock + iClockSleep) / DVD_TIME_BASE; -- double clocktime = iCurrentClock / DVD_TIME_BASE; -+ double presenttime = m_renderBuffers[idx].timestamp; -+ double clocktime = GetPresentTime(); - if(presenttime - clocktime > MAXPRESENTDELAY) - presenttime = clocktime + MAXPRESENTDELAY; - -@@ -1066,7 +1053,6 @@ void CXBMCRenderManager::PrepareNextRender() - - if (g_graphicsContext.IsFullScreenVideo() || presenttime <= clocktime + frametime) - { -- m_presentPts = m_renderBuffers[idx].pts; - m_presenttime = presenttime; - m_presentmethod = m_renderBuffers[idx].presentmethod; - m_presentfield = m_renderBuffers[idx].presentfield; -diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 64e957e..c54b626 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -93,7 +93,7 @@ class CXBMCRenderManager - * available after the main thread has flipped front / back buffers. - * - * @param bStop reference to stop flag of calling thread -- * @param timestamp pts of frame delivered with AddVideoPicture -+ * @param timestamp of frame delivered with AddVideoPicture - * @param source depreciated - * @param sync signals frame, top, or bottom field - * @param speed current speed of player, needed for some optimizations like keeping the gui responsive on rewind -@@ -263,13 +263,12 @@ class CXBMCRenderManager - - struct - { -- double pts; -+ double timestamp; - EFIELDSYNC presentfield; - EPRESENTMETHOD presentmethod; - }m_renderBuffers[5]; - - double m_sleeptime; -- double m_presentPts; + double m_displayLatency; +@@ -231,6 +230,7 @@ class CXBMCRenderManager + std::deque m_queued; + std::deque m_discard; ++ ERenderFormat m_format; double m_presenttime; double m_presentcorr; -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 9e02431..4ab4057 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -4162,8 +4162,3 @@ bool CDVDPlayer::CachePVRStream(void) const - !g_PVRManager.IsPlayingRecording() && - g_advancedSettings.m_bPVRCacheInDvdPlayer; - } -- --double CDVDPlayer::GetClock(double& absolute, bool interpolated) --{ -- return m_clock.GetClock(absolute, interpolated); --} -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index a76b1ee..fa6c99f 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.h -+++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -246,8 +246,6 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer - virtual bool SwitchChannel(const PVR::CPVRChannel &channel); - virtual bool CachePVRStream(void) const; - -- virtual double GetClock(double& absolute, bool interpolated = true); -- - enum ECacheState - { CACHESTATE_DONE = 0 - , CACHESTATE_FULL // player is filling up the demux queue -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 1c68515..1d3e17f 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1383,7 +1383,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - if (index < 0) - return EOS_DROPPED; - -- g_renderManager.FlipPage(CThread::m_bStop, pts, -1, mDisplayField, m_speed); -+ g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, mDisplayField, m_speed); - - return result; - #else + double m_presenterr; -- 1.8.1.6 -From 9de684670aa8cafb2d3d1c7afb28525562dd8ad5 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Fri, 1 Mar 2013 08:05:00 +0100 -Subject: [PATCH 012/119] RenderManager: some rework to buffering +From e1ecc4b2f14b7707ce799623ef91204aa247a312 Mon Sep 17 00:00:00 2001 +From: Joakim Plate +Date: Fri, 14 Jun 2013 00:31:58 +0200 +Subject: [PATCH 006/105] renderer: drop copies of variables, use queue data + directly --- - xbmc/cores/VideoRenderers/RenderManager.cpp | 20 +++++++++++--------- - 1 file changed, 11 insertions(+), 9 deletions(-) + xbmc/cores/VideoRenderers/RenderManager.cpp | 35 ++++++++++++++++------------- + xbmc/cores/VideoRenderers/RenderManager.h | 4 +--- + 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 23c9a7d..fbb989b 100644 +index 0a40f57..255f108 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -624,9 +624,11 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L - } +@@ -97,12 +97,9 @@ static void requeue(std::deque &trg, std::deque &src) + m_pRenderer = NULL; + m_bIsStarted = false; - FlipFreeBuffer(); -- m_renderBuffers[m_iOutputRenderBuffer].pts = timestamp; -+ m_renderBuffers[m_iOutputRenderBuffer].timestamp = timestamp; - m_renderBuffers[m_iOutputRenderBuffer].presentfield = presentfield; - m_renderBuffers[m_iOutputRenderBuffer].presentmethod = presentmethod; -+ if (!m_bUseBuffering) -+ PrepareNextRender(); - m_speed = speed; - } - -@@ -841,14 +843,14 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) - if (!m_pRenderer) - return -1; - -- if(m_pRenderer->AddVideoPicture(&pic, (m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers)) -+ int index = (m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers; -+ -+ if(m_pRenderer->AddVideoPicture(&pic, index)) - return 1; - - YV12Image image; -- int index = m_pRenderer->GetImage(&image, (m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers); -- -- if(index < 0) -- return index; -+ if (m_pRenderer->GetImage(&image, index) < 0) -+ return -1; - - if(pic.format == RENDER_FMT_YUV420P - || pic.format == RENDER_FMT_YUV420P10 -@@ -952,14 +954,14 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) - if (!m_pRenderer) - return -1; - -- double maxwait = GetPresentTime() + (float)timeout/1000; -+ XbmcThreads::EndTime endtime(timeout); - while(!HasFreeBuffer() && !bStop) - { - lock.Leave(); - m_flipEvent.WaitMSec(std::min(50, timeout)); -- if(GetPresentTime() > maxwait && !bStop) -+ if(endtime.IsTimePast()) - { -- if (timeout != 0) -+ if (timeout != 0 && !bStop) - CLog::Log(LOGWARNING, "CRenderManager::WaitForBuffer - timeout waiting for buffer"); - return -1; - } --- -1.8.1.6 - - -From 3fa67610140a3017323bb9b3105aa7fe10f82aa6 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Fri, 1 Mar 2013 08:07:07 +0100 -Subject: [PATCH 013/119] dvdplayer: disable buffering unil dropping is - improved - ---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 1d3e17f..5fe3e6f 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1114,35 +1114,35 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - { - case RENDER_FMT_YUV420P: - formatstr = "YV12"; -- buffering = true; -+ buffering = false; - break; - case RENDER_FMT_YUV420P16: - formatstr = "YV12P16"; -- buffering = true; -+ buffering = false; - break; - case RENDER_FMT_YUV420P10: - formatstr = "YV12P10"; -- buffering = true; -+ buffering = false; - break; - case RENDER_FMT_NV12: - formatstr = "NV12"; -- buffering = true; -+ buffering = false; - break; - case RENDER_FMT_UYVY422: - formatstr = "UYVY"; -- buffering = true; -+ buffering = false; - break; - case RENDER_FMT_YUYV422: - formatstr = "YUY2"; -- buffering = true; -+ buffering = false; - break; - case RENDER_FMT_VDPAU: - formatstr = "VDPAU"; -- buffering = true; -+ buffering = false; - break; - case RENDER_FMT_DXVA: - formatstr = "DXVA"; -- buffering = true; -+ buffering = false; - break; - case RENDER_FMT_VAAPI: - formatstr = "VAAPI"; --- -1.8.1.6 - - -From f7d9369b2c080e09f2aa59b9abf7c75efd176f6a Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 2 Mar 2013 12:00:51 +0100 -Subject: [PATCH 014/119] RenderManager: skip very late frames in render buffer - ---- - xbmc/cores/VideoRenderers/RenderManager.cpp | 40 ++++++++++++++++++++++++++--- - 1 file changed, 37 insertions(+), 3 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index fbb989b..1618708 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -53,7 +53,7 @@ - #include "../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h" - #include "../dvdplayer/DVDCodecs/DVDCodecUtils.h" - --#define MAXPRESENTDELAY 0.500 -+#define MAXPRESENTDELAY 0.200 - - /* at any point we want an exclusive lock on rendermanager */ - /* we must make sure we don't have a graphiccontext lock */ -@@ -1045,13 +1045,47 @@ void CXBMCRenderManager::PrepareNextRender() - if (idx < 0) - return; - -- double presenttime = m_renderBuffers[idx].timestamp; - double clocktime = GetPresentTime(); -+ double frametime = 1 / g_graphicsContext.GetFPS(); -+ -+ // look ahead in the queue -+ // if the next frame is already late, skip the one we are about to render -+ // drop buffers if time has jumped back -+ int skipToPos = 0; -+ int count = 1; -+ int i = idx; -+ while (i != m_iOutputRenderBuffer) -+ { -+ int idx_next = (i + 1) % m_iNumRenderBuffers; -+ if (m_renderBuffers[idx_next].timestamp < m_renderBuffers[i].timestamp-frametime || -+ m_renderBuffers[idx_next].timestamp <= (clocktime-frametime)) -+ { -+ skipToPos = count; -+ } -+ count++; -+ i = idx_next; -+ } -+ count = 1; -+ while (idx != m_iOutputRenderBuffer) -+ { -+ int idx_next = (idx + 1) % m_iNumRenderBuffers; -+ if (count <= skipToPos) -+ { -+ FlipRenderBuffer(); -+ idx = idx_next; -+ CLog::Log(LOGDEBUG,"%s - skip frame at render buffer index: %d", __FUNCTION__, idx); -+ } -+ else -+ break; -+ count++; -+ } -+ -+ double presenttime = m_renderBuffers[idx].timestamp; -+ - if(presenttime - clocktime > MAXPRESENTDELAY) - presenttime = clocktime + MAXPRESENTDELAY; - - m_sleeptime = presenttime - clocktime; -- double frametime = 1 / g_graphicsContext.GetFPS(); - - if (g_graphicsContext.IsFullScreenVideo() || presenttime <= clocktime + frametime) - { --- -1.8.1.6 - - -From c6bd40c43c124f9124f3fb43c9ff36d490cd08b1 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 2 Mar 2013 12:10:17 +0100 -Subject: [PATCH 015/119] renderbuffers: drop enable/disable in this iteration - ---- - xbmc/cores/VideoRenderers/RenderManager.cpp | 4 ++++ - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 ---- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 1618708..81964f2 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -274,6 +274,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi - m_presentstep = PRESENT_IDLE; - m_presentevent.Set(); - ResetRenderBuffer(); -+ EnableBuffering(buffering); - } - - return result; -@@ -1102,7 +1103,10 @@ void CXBMCRenderManager::EnableBuffering(bool enable) - CRetakeLock lock(m_sharedSection); - - if (m_iNumRenderBuffers < 3) -+ { -+ m_bUseBuffering = false; - return; -+ } - - m_bUseBuffering = enable; - if (!m_bUseBuffering) -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 5fe3e6f..6c2355e 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -262,7 +262,6 @@ void CDVDPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec) - m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0; - m_started = false; - m_codecname = m_pVideoCodec->GetName(); -- g_renderManager.EnableBuffering(false); +- m_presentfield = FS_NONE; +- m_presenttime = 0; + m_presentstep = PRESENT_IDLE; + m_rendermethod = 0; + m_presentsource = 0; +- m_presentmethod = PRESENT_METHOD_SINGLE; + m_bReconfigured = false; + m_hasCaptures = false; + m_displayLatency = 0.0f; +@@ -112,6 +109,7 @@ static void requeue(std::deque &trg, std::deque &src) + m_errorindex = 0; + m_QueueSize = 2; + m_QueueSkip = 0; ++ m_format = RENDER_FMT_NONE; } - void CDVDPlayerVideo::CloseStream(bool bWaitForBuffers) -@@ -438,7 +437,6 @@ void CDVDPlayerVideo::Process() - picture.iFlags &= ~DVP_FLAG_ALLOCATED; - m_packets.clear(); - m_started = false; -- g_renderManager.EnableBuffering(false); - } - else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (CDVDPlayerVideo::Flush()) + CXBMCRenderManager::~CXBMCRenderManager() +@@ -351,7 +349,9 @@ void CXBMCRenderManager::FrameMove() + if(!m_queued.empty()) + { + double timestamp = GetPresentTime(); +- if(timestamp > m_presenttime + (m_Queue[m_queued.front()].timestamp - m_presenttime) * 0.5) ++ SPresent& m = m_Queue[m_presentsource]; ++ SPresent& q = m_Queue[m_queued.front()]; ++ if(timestamp > m.timestamp + (q.timestamp - m.timestamp) * 0.5) + { + m_presentstep = PRESENT_READY; + m_presentevent.notifyAll(); +@@ -384,15 +384,17 @@ void CXBMCRenderManager::FrameMove() + void CXBMCRenderManager::FrameFinish() + { + /* wait for this present to be valid */ ++ SPresent& m = m_Queue[m_presentsource]; ++ + if(g_graphicsContext.IsFullScreenVideo()) +- WaitPresentTime(m_presenttime); ++ WaitPresentTime(m.timestamp); + + { CSingleLock lock(m_presentlock); + + if(m_presentstep == PRESENT_FRAME) { -@@ -451,7 +449,6 @@ void CDVDPlayerVideo::Process() - //we need to recalculate the framerate - //TODO: this needs to be set on a streamchange instead - ResetFrameRateCalc(); -- g_renderManager.EnableBuffering(false); +- if( m_presentmethod == PRESENT_METHOD_BOB +- || m_presentmethod == PRESENT_METHOD_WEAVE) ++ if( m.presentmethod == PRESENT_METHOD_BOB ++ || m.presentmethod == PRESENT_METHOD_WEAVE) + m_presentstep = PRESENT_FRAME2; + else + m_presentstep = PRESENT_IDLE; +@@ -760,11 +762,13 @@ void CXBMCRenderManager::Render(bool clear, DWORD flags, DWORD alpha) + { + CSharedLock lock(m_sharedSection); - m_stalled = true; - m_started = false; -@@ -719,7 +716,6 @@ void CDVDPlayerVideo::Process() - m_codecname = m_pVideoCodec->GetName(); - m_started = true; - m_messageParent.Put(new CDVDMsgInt(CDVDMsg::PLAYER_STARTED, DVDPLAYER_VIDEO)); -- g_renderManager.EnableBuffering(true); - } +- if( m_presentmethod == PRESENT_METHOD_BOB ) ++ SPresent& m = m_Queue[m_presentsource]; ++ ++ if( m.presentmethod == PRESENT_METHOD_BOB ) + PresentFields(clear, flags, alpha); +- else if( m_presentmethod == PRESENT_METHOD_WEAVE ) ++ else if( m.presentmethod == PRESENT_METHOD_WEAVE ) + PresentFields(clear, flags | RENDER_FLAG_WEAVE, alpha); +- else if( m_presentmethod == PRESENT_METHOD_BLEND ) ++ else if( m.presentmethod == PRESENT_METHOD_BLEND ) + PresentBlend(clear, flags, alpha); + else + PresentSingle(clear, flags, alpha); +@@ -785,17 +789,18 @@ void CXBMCRenderManager::PresentSingle(bool clear, DWORD flags, DWORD alpha) + void CXBMCRenderManager::PresentFields(bool clear, DWORD flags, DWORD alpha) + { + CSingleLock lock(g_graphicsContext); ++ SPresent& m = m_Queue[m_presentsource]; - // guess next frame pts. iDuration is always valid + if(m_presentstep == PRESENT_FRAME) + { +- if( m_presentfield == FS_BOT) ++ if( m.presentfield == FS_BOT) + m_pRenderer->RenderUpdate(clear, flags | RENDER_FLAG_BOT | RENDER_FLAG_FIELD0, alpha); + else + m_pRenderer->RenderUpdate(clear, flags | RENDER_FLAG_TOP | RENDER_FLAG_FIELD0, alpha); + } + else + { +- if( m_presentfield == FS_TOP) ++ if( m.presentfield == FS_TOP) + m_pRenderer->RenderUpdate(clear, flags | RENDER_FLAG_BOT | RENDER_FLAG_FIELD1, alpha); + else + m_pRenderer->RenderUpdate(clear, flags | RENDER_FLAG_TOP | RENDER_FLAG_FIELD1, alpha); +@@ -805,8 +810,9 @@ void CXBMCRenderManager::PresentFields(bool clear, DWORD flags, DWORD alpha) + void CXBMCRenderManager::PresentBlend(bool clear, DWORD flags, DWORD alpha) + { + CSingleLock lock(g_graphicsContext); ++ SPresent& m = m_Queue[m_presentsource]; + +- if( m_presentfield == FS_BOT ) ++ if( m.presentfield == FS_BOT ) + { + m_pRenderer->RenderUpdate(clear, flags | RENDER_FLAG_BOT | RENDER_FLAG_NOOSD, alpha); + m_pRenderer->RenderUpdate(false, flags | RENDER_FLAG_TOP, alpha / 2); +@@ -1048,9 +1054,6 @@ void CXBMCRenderManager::PrepareNextRender() + m_QueueSkip++; + } + +- m_presenttime = m_Queue[idx].timestamp; +- m_presentmethod = m_Queue[idx].presentmethod; +- m_presentfield = m_Queue[idx].presentfield; + m_presentstep = PRESENT_FLIP; + m_discard.push_back(m_presentsource); + m_presentsource = idx; +diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h +index 1be4e2f..83dc50a 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.h ++++ b/xbmc/cores/VideoRenderers/RenderManager.h +@@ -231,13 +231,11 @@ class CXBMCRenderManager + std::deque m_discard; + + ERenderFormat m_format; +- double m_presenttime; ++ + double m_presentcorr; + double m_presenterr; + double m_errorbuff[ERRORBUFFSIZE]; + int m_errorindex; +- EFIELDSYNC m_presentfield; +- EPRESENTMETHOD m_presentmethod; + EPRESENTSTEP m_presentstep; + int m_presentsource; + XbmcThreads::ConditionVariable m_presentevent; -- 1.8.1.6 -From fc794fbd5535fb11915d2dc5e7f6b9f35899ac30 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 2 Mar 2013 12:31:11 +0100 -Subject: [PATCH 016/119] RenderManager: add method SetSpeed +From b263eefd78219d06d096a23ddee9f93c20253aa4 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 14 Jun 2013 16:56:41 +0200 +Subject: [PATCH 007/105] renderer: grab presentlock in AddVideoPicture --- xbmc/cores/VideoRenderers/RenderManager.cpp | 10 +++++++--- - xbmc/cores/VideoRenderers/RenderManager.h | 8 ++++++-- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 3 ++- - 3 files changed, 15 insertions(+), 6 deletions(-) + 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 81964f2..4e241e3 100644 +index 255f108..bff4b3c 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -563,7 +563,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) - m_pRenderer->SetViewMode(iViewMode); - } - --void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/, int speed /*= 1000*/) -+void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) - { - if (!m_bUseBuffering) - { -@@ -630,7 +630,6 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L - m_renderBuffers[m_iOutputRenderBuffer].presentmethod = presentmethod; - if (!m_bUseBuffering) - PrepareNextRender(); -- m_speed = speed; - } - - g_application.NewFrame(); -@@ -1037,7 +1036,7 @@ void CXBMCRenderManager::ResetRenderBuffer() - m_iDisplayedRenderBuffer = 0; - m_bAllRenderBuffersDisplayed = true; - m_sleeptime = 1.0; -- m_speed = 0; -+ m_speed = DVD_PLAYSPEED_NORMAL; - } - - void CXBMCRenderManager::PrepareNextRender() -@@ -1121,6 +1120,11 @@ void CXBMCRenderManager::DiscardBuffer() - m_iOutputRenderBuffer = m_iCurrentRenderBuffer; - } - -+void CXBMCRenderManager::SetSpeed(int speed) -+{ -+ m_speed = speed; -+} -+ - void CXBMCRenderManager::NotifyDisplayFlip() - { - CRetakeLock lock(m_sharedSection); -diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index c54b626..5184825 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -96,9 +96,8 @@ class CXBMCRenderManager - * @param timestamp of frame delivered with AddVideoPicture - * @param source depreciated - * @param sync signals frame, top, or bottom field -- * @param speed current speed of player, needed for some optimizations like keeping the gui responsive on rewind - */ -- void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE, int speed = 1000); -+ void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); - unsigned int PreInit(); - void UnInit(); - bool Flush(); -@@ -195,6 +194,11 @@ class CXBMCRenderManager - */ - void DiscardBuffer(); - -+ /** -+ * notify RenderManager about play speed -+ */ -+ void SetSpeed(int speed); -+ - protected: - void Render(bool clear, DWORD flags, DWORD alpha); - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 6c2355e..cb04017 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -468,6 +468,7 @@ void CDVDPlayerVideo::Process() - m_iNrOfPicturesNotToSkip = 0; - if (m_pVideoCodec) - m_pVideoCodec->SetSpeed(m_speed); -+ g_renderManager.SetSpeed(m_speed); - } - else if (pMsg->IsType(CDVDMsg::PLAYER_STARTED)) - { -@@ -1379,7 +1380,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - if (index < 0) - return EOS_DROPPED; - -- g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, mDisplayField, m_speed); -+ g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, mDisplayField); - - return result; - #else --- -1.8.1.6 - - -From a81b31aa07867d1fd04a5871cd3ee324a6ea244f Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Thu, 4 Apr 2013 10:20:36 +0200 -Subject: [PATCH 017/119] RenderManager: return bufferlevel with WaitForBuffer - ---- - xbmc/cores/VideoRenderers/RenderManager.cpp | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 4e241e3..fca0c8b 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -954,6 +954,7 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) +@@ -878,9 +878,13 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) if (!m_pRenderer) return -1; -+ int bufferlevel = 1; - XbmcThreads::EndTime endtime(timeout); - while(!HasFreeBuffer() && !bStop) - { -@@ -967,6 +968,9 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) - } - lock.Enter(); - } -+ if (m_iNumRenderBuffers >= 3) -+ bufferlevel = (m_iOutputRenderBuffer - m_iCurrentRenderBuffer + m_iNumRenderBuffers) % m_iNumRenderBuffers; -+ - lock.Leave(); +- if(m_free.empty()) +- return -1; +- int index = m_free.front(); ++ int index; ++ { ++ CSingleLock lock(m_presentlock); ++ if (m_free.empty()) ++ return -1; ++ index = m_free.front(); ++ } - if (bStop) -@@ -974,7 +978,8 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) - - // make sure overlay buffer is released, this won't happen on AddOverlay - m_overlays.ReleaseBuffer((m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers); -- return 1; -+ -+ return bufferlevel; - } - - int CXBMCRenderManager::GetNextRenderBufferIndex() + if(m_pRenderer->AddVideoPicture(&pic, index)) + return 1; -- 1.8.1.6 -From 448ba9a2476c1cf4eac5d27118d0636f3d1c81b8 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 5 May 2013 09:21:32 +0200 -Subject: [PATCH 018/119] RenderManager: do not drop in renderbuffers, this - ruins detection of displayed frame +From c3124dc46ff9b71f2cb6fe2dc592006888008023 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Thu, 30 May 2013 10:56:06 +0200 +Subject: [PATCH 008/105] renderer: use fence for determination when a buffer + is ready for reuse --- - xbmc/cores/VideoRenderers/RenderManager.cpp | 32 ----------------------------- - 1 file changed, 32 deletions(-) + xbmc/cores/VideoRenderers/BaseRenderer.h | 1 + + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 32 +++++++++++++++++++++++++++ + xbmc/cores/VideoRenderers/LinuxRendererGL.h | 2 ++ + xbmc/cores/VideoRenderers/RenderManager.cpp | 7 +++++- + 4 files changed, 41 insertions(+), 1 deletion(-) +diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h +index 7e503c5..fe1f577 100644 +--- a/xbmc/cores/VideoRenderers/BaseRenderer.h ++++ b/xbmc/cores/VideoRenderers/BaseRenderer.h +@@ -92,6 +92,7 @@ class CBaseRenderer + virtual unsigned int GetMaxBufferSize() { return 0; } + virtual void SetBufferSize(int numBuffers) { } + virtual void ReleaseBuffer(int idx) { } ++ virtual bool IsProcessed(int idx) { return true; } + + virtual bool Supports(ERENDERFEATURE feature) { return false; } + +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +index 32b8d22..95e6716 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +@@ -128,6 +128,7 @@ + memset(&image , 0, sizeof(image)); + memset(&pbo , 0, sizeof(pbo)); + flipindex = 0; ++ fence = None; + #ifdef HAVE_LIBVDPAU + vdpau = NULL; + #endif +@@ -138,6 +139,8 @@ + + CLinuxRendererGL::YUVBUFFER::~YUVBUFFER() + { ++ if(fence) ++ glDeleteSync(fence); + #ifdef HAVE_LIBVA + delete &vaapi; + #endif +@@ -1205,6 +1208,15 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) + RenderSoftware(renderBuffer, m_currentField); + VerifyGLState(); + } ++ ++ // set fence in order to determine when buffer is ready for reuse ++ // this is the case when the gl has finished processing ++ if(m_buffers[renderBuffer].fence) ++ { ++ glDeleteSync(m_buffers[renderBuffer].fence); ++ m_buffers[renderBuffer].fence = None; ++ } ++ m_buffers[renderBuffer].fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); + } + + void CLinuxRendererGL::RenderSinglePass(int index, int field) +@@ -3395,6 +3407,26 @@ unsigned int CLinuxRendererGL::GetProcessorSize() + return 0; + } + ++bool CLinuxRendererGL::IsProcessed(int idx) ++{ ++ YUVBUFFER &buf = m_buffers[idx]; ++ if(buf.fence) ++ { ++ GLint state; ++ GLsizei length; ++ glGetSynciv(buf.fence, GL_SYNC_STATUS, 1, &length, &state); ++ if(state == GL_SIGNALED) ++ { ++ glDeleteSync(buf.fence); ++ buf.fence = None; ++ return true; ++ } ++ else ++ return false; ++ } ++ return true; ++} ++ + #ifdef HAVE_LIBVDPAU + void CLinuxRendererGL::AddProcessor(CVDPAU* vdpau, int index) + { +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h +index 96b752b..e239b92 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h +@@ -141,6 +141,7 @@ class CLinuxRendererGL : public CBaseRenderer + virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } + virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } + virtual unsigned int GetProcessorSize(); ++ virtual bool IsProcessed(int idx); + + #ifdef HAVE_LIBVDPAU + virtual void AddProcessor(CVDPAU* vdpau, int index); +@@ -278,6 +279,7 @@ class CLinuxRendererGL : public CBaseRenderer + YV12Image image; + unsigned flipindex; /* used to decide if this has been uploaded */ + GLuint pbo[MAX_PLANES]; ++ GLsync fence; + + #ifdef HAVE_LIBVDPAU + CVDPAU* vdpau; diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index fca0c8b..e7e9f48 100644 +index bff4b3c..5cd3f06 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -1053,38 +1053,6 @@ void CXBMCRenderManager::PrepareNextRender() - double clocktime = GetPresentTime(); - double frametime = 1 / g_graphicsContext.GetFPS(); - -- // look ahead in the queue -- // if the next frame is already late, skip the one we are about to render -- // drop buffers if time has jumped back -- int skipToPos = 0; -- int count = 1; -- int i = idx; -- while (i != m_iOutputRenderBuffer) -- { -- int idx_next = (i + 1) % m_iNumRenderBuffers; -- if (m_renderBuffers[idx_next].timestamp < m_renderBuffers[i].timestamp-frametime || -- m_renderBuffers[idx_next].timestamp <= (clocktime-frametime)) -- { -- skipToPos = count; -- } -- count++; -- i = idx_next; -- } -- count = 1; -- while (idx != m_iOutputRenderBuffer) -- { -- int idx_next = (idx + 1) % m_iNumRenderBuffers; -- if (count <= skipToPos) -- { -- FlipRenderBuffer(); -- idx = idx_next; -- CLog::Log(LOGDEBUG,"%s - skip frame at render buffer index: %d", __FUNCTION__, idx); -- } -- else -- break; -- count++; -- } -- - double presenttime = m_renderBuffers[idx].timestamp; - - if(presenttime - clocktime > MAXPRESENTDELAY) --- -1.8.1.6 - - -From 932d3018777b1360ec08eefbdb0c43cc92674818 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 10 Feb 2013 18:40:30 +0100 -Subject: [PATCH 019/119] OMXPlayer: adapt to buffering - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 32 ++++++++++++++++---------------- - xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 + - 2 files changed, 17 insertions(+), 16 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 9613e57..3703f7a 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -342,25 +342,25 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket) - m_dropbase = 0.0f; - #endif - -- // DVDPlayer sleeps until m_iSleepEndTime here before calling FlipPage. -- // Video playback in asynchronous in OMXPlayer, so we don't want to do that here, as it prevents the video fifo from being kept full. -- // So, we keep track of when FlipPage would have been called on DVDPlayer and return early if it is not time. -- // m_iSleepEndTime == DVD_NOPTS_VALUE means we are not waiting to call FlipPage, otherwise it is the time we want to call FlipPage -- if (m_iSleepEndTime == DVD_NOPTS_VALUE) { -- m_iSleepEndTime = iCurrentClock + iSleepTime; -- } -- -- if (!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < m_iSleepEndTime + DVD_MSEC_TO_TIME(500)) -+ // don't output we we have not moved forward -+ double currentMediaTime = m_av_clock->OMXMediaTime(false); -+ if ((currentMediaTime - m_LastOutputTime) < iFrameDuration / 2) - return; - -- double pts_media = m_av_clock->OMXMediaTime(false); -- ProcessOverlays(iGroupId, pts_media); -- -- g_renderManager.FlipPage(CThread::m_bStop, m_iSleepEndTime / DVD_TIME_BASE, -1, FS_NONE); -+ int timeout = 50; -+ if (GetDecoderFreeSpace() > 0.2 * GetDecoderBufferSize()) -+ timeout = 0; -+ int bufferlevel = g_renderManager.WaitForBuffer(m_bStop, timeout); -+ if (bufferlevel < 0) -+ return; - -- m_iSleepEndTime = DVD_NOPTS_VALUE; -+ double pts_overlay = m_av_clock->OMXMediaTime(false) -+ + (bufferlevel+1)* iFrameDuration; -+ ProcessOverlays(iGroupId, pts_overlay); -+ m_LastOutputTime = pts_overlay; - -- //m_av_clock->WaitAbsoluteClock((iCurrentClock + iSleepTime)); -+ double timestamp = (CDVDClock::GetAbsoluteClock(false) + (bufferlevel+1) * iFrameDuration) / DVD_TIME_BASE; -+ g_renderManager.FlipPage(CThread::m_bStop, timestamp, -1, FS_NONE); +@@ -372,11 +372,16 @@ void CXBMCRenderManager::FrameMove() + /* release all previous */ + for(std::deque::iterator it = m_discard.begin(); it != m_discard.end(); ) + { +- // TODO check for fence ++ if (!m_pRenderer->IsProcessed(*it)) ++ { ++ ++it; ++ continue; ++ } + m_pRenderer->ReleaseBuffer(*it); + m_overlays.Release(*it); + m_free.push_back(*it); + it = m_discard.erase(it); ++ m_presentevent.notifyAll(); + } + } } - - void OMXPlayerVideo::Process() -@@ -812,7 +812,7 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height) - - if(!g_renderManager.Configure(width, height, - iDisplayWidth, iDisplayHeight, m_fFrameRate, flags, format, 0, -- m_hints.orientation)) -+ m_hints.orientation, true)) - { - CLog::Log(LOGERROR, "%s - failed to configure renderer", __FUNCTION__); - return; -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h -index 064ff66..c055a97 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.h -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h -@@ -59,6 +59,7 @@ class OMXPlayerVideo : public CThread - double m_iVideoDelay; - int m_speed; - double m_FlipTimeStamp; // time stamp of last flippage. used to play at a forced framerate -+ double m_LastOutputTime; - int m_audio_count; - bool m_stalled; - bool m_started; -- 1.8.1.6 -From d7d38ee5c7b536e3f4aac4ff2bf8b7cb590b2fe6 Mon Sep 17 00:00:00 2001 +From 31c9d071919582d7896c66c54f41b97554fd16f3 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:34:39 +0200 -Subject: [PATCH 020/119] videoplayer: adapt lateness detection and dropping to +Subject: [PATCH 009/105] videoplayer: adapt lateness detection and dropping to buffering --- - xbmc/cores/VideoRenderers/RenderManager.cpp | 17 +- - xbmc/cores/VideoRenderers/RenderManager.h | 11 +- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 14 ++ - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 31 +++ + xbmc/cores/VideoRenderers/RenderManager.cpp | 16 +- + xbmc/cores/VideoRenderers/RenderManager.h | 12 +- + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 15 +- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 31 ++++ .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 7 + - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 227 ++++++++++++++++----- - xbmc/cores/dvdplayer/DVDPlayerVideo.h | 24 +++ - 7 files changed, 283 insertions(+), 48 deletions(-) + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 194 +++++++++++++++++---- + xbmc/cores/dvdplayer/DVDPlayerVideo.h | 23 +++ + 7 files changed, 260 insertions(+), 38 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index e7e9f48..1735ff8 100644 +index 5cd3f06..318a7fd 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -563,7 +563,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) +@@ -299,6 +299,8 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi + m_bIsStarted = true; + m_bReconfigured = true; + m_presentstep = PRESENT_IDLE; ++ m_presentpts = DVD_NOPTS_VALUE; ++ m_sleeptime = 1.0; + m_presentevent.notifyAll(); + + CLog::Log(LOGDEBUG, "CXBMCRenderManager::Configure - %d", m_QueueSize); +@@ -643,7 +645,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) m_pRenderer->SetViewMode(iViewMode); } -void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) +void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, double pts /* = 0 */, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) { - if (!m_bUseBuffering) - { -@@ -625,6 +625,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L - } + { CSharedLock lock(m_sharedSection); - FlipFreeBuffer(); -+ m_renderBuffers[m_iOutputRenderBuffer].pts = pts; - m_renderBuffers[m_iOutputRenderBuffer].timestamp = timestamp; - m_renderBuffers[m_iOutputRenderBuffer].presentfield = presentfield; - m_renderBuffers[m_iOutputRenderBuffer].presentmethod = presentmethod; -@@ -1042,6 +1043,7 @@ void CXBMCRenderManager::ResetRenderBuffer() - m_bAllRenderBuffersDisplayed = true; - m_sleeptime = 1.0; - m_speed = DVD_PLAYSPEED_NORMAL; -+ m_presentPts = DVD_NOPTS_VALUE; +@@ -709,6 +711,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L + m.timestamp = timestamp; + m.presentfield = sync; + m.presentmethod = presentmethod; ++ m.pts = pts; + requeue(m_queued, m_free); + + /* signal to any waiters to check state */ +@@ -1067,6 +1070,8 @@ void CXBMCRenderManager::PrepareNextRender() + m_discard.push_back(m_presentsource); + m_presentsource = idx; + m_queued.pop_front(); ++ m_sleeptime = m_Queue[idx].timestamp - clocktime; ++ m_presentpts = m_Queue[idx].pts; + m_presentevent.notifyAll(); + } } - - void CXBMCRenderManager::PrepareNextRender() -@@ -1062,6 +1064,7 @@ void CXBMCRenderManager::PrepareNextRender() - - if (g_graphicsContext.IsFullScreenVideo() || presenttime <= clocktime + frametime) - { -+ m_presentPts = m_renderBuffers[idx].pts; - m_presenttime = presenttime; - m_presentmethod = m_renderBuffers[idx].presentmethod; - m_presentfield = m_renderBuffers[idx].presentfield; -@@ -1128,6 +1131,18 @@ void CXBMCRenderManager::NotifyDisplayFlip() - m_flipEvent.Set(); +@@ -1083,3 +1088,12 @@ void CXBMCRenderManager::DiscardBuffer() + m_presentstep = PRESENT_IDLE; + m_presentevent.notifyAll(); } - ++ +bool CXBMCRenderManager::GetStats(double &sleeptime, double &pts, int &bufferLevel) +{ -+ CSharedLock lock(m_sharedSection); ++ CSingleLock lock(m_presentlock); + sleeptime = m_sleeptime; -+ pts = m_presentPts; -+ if (m_iNumRenderBuffers < 3) -+ bufferLevel = -1; -+ else -+ bufferLevel = (m_iOutputRenderBuffer - m_iCurrentRenderBuffer + m_iNumRenderBuffers) % m_iNumRenderBuffers; ++ pts = m_presentpts; ++ bufferLevel = m_queued.size() + m_discard.size(); + return true; +} -+ - bool CXBMCRenderManager::HasFrame() - { - CSharedLock lock(m_sharedSection); diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 5184825..8140447 100644 +index 83dc50a..c387796 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.h +++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -94,10 +94,11 @@ class CXBMCRenderManager +@@ -97,10 +97,11 @@ class CXBMCRenderManager * * @param bStop reference to stop flag of calling thread * @param timestamp of frame delivered with AddVideoPicture @@ -2682,8 +1036,8 @@ index 5184825..8140447 100644 unsigned int PreInit(); void UnInit(); bool Flush(); -@@ -184,6 +185,12 @@ class CXBMCRenderManager - bool HasFrame(); +@@ -175,6 +176,12 @@ class CXBMCRenderManager + int WaitForBuffer(volatile bool& bStop, int timeout = 100); /** + * Can be called by player for lateness detection. This is done best by @@ -2692,29 +1046,31 @@ index 5184825..8140447 100644 + bool GetStats(double &sleeptime, double &pts, int &bufferLevel); + + /** - * Video player can dynamically enable/disable buffering. In situations like - * rewind buffering is not ideal. + * Video player call this on flush in oder to discard any queued frames */ -@@ -267,12 +274,14 @@ class CXBMCRenderManager + void DiscardBuffer(); +@@ -221,6 +228,7 @@ class CXBMCRenderManager - struct + struct SPresent { -+ double pts; - double timestamp; - EFIELDSYNC presentfield; ++ double pts; + double timestamp; + EFIELDSYNC presentfield; EPRESENTMETHOD presentmethod; - }m_renderBuffers[5]; +@@ -232,6 +240,8 @@ class CXBMCRenderManager - double m_sleeptime; -+ double m_presentPts; + ERenderFormat m_format; - double m_presenttime; ++ double m_sleeptime; ++ double m_presentpts; double m_presentcorr; + double m_presenterr; + double m_errorbuff[ERRORBUFFSIZE]; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 2c46b0b..5931e2f 100644 +index 5704704..ee943a0 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -110,6 +110,10 @@ struct DVDVideoUserData +@@ -109,6 +109,10 @@ struct DVDVideoUserData #define DVP_FLAG_NOSKIP 0x00000010 // indicate this picture should never be dropped #define DVP_FLAG_DROPPED 0x00000020 // indicate that this picture has been dropped in decoder stage, will have no data @@ -2725,7 +1081,7 @@ index 2c46b0b..5931e2f 100644 // DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2! #define DVP_QSCALE_UNKNOWN 0 -@@ -127,6 +131,9 @@ struct DVDVideoUserData +@@ -126,6 +130,9 @@ struct DVDVideoUserData #define VC_PICTURE 0x00000004 // the decoder got a picture, call Decode(NULL, 0) again to parse the rest of the data #define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data #define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again @@ -2735,10 +1091,16 @@ index 2c46b0b..5931e2f 100644 class CDVDVideoCodec { public: -@@ -243,4 +250,11 @@ class CDVDVideoCodec - { +@@ -243,10 +250,16 @@ class CDVDVideoCodec return 0; } + +- + /** + * Number of references to old pictures that are allowed to + * be retained when calling decode on the next demux packet + */ + virtual unsigned GetAllowedReferences() { return 0; } + + virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) + { @@ -2748,10 +1110,10 @@ index 2c46b0b..5931e2f 100644 + virtual void SetCodecControl(int flags) {} }; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 9111afa..5cd4bbd 100644 +index 7881e58..b197ec8 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -146,6 +146,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx +@@ -163,6 +163,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx m_iLastKeyframe = 0; m_dts = DVD_NOPTS_VALUE; m_started = false; @@ -2759,7 +1121,7 @@ index 9111afa..5cd4bbd 100644 } CDVDVideoCodecFFmpeg::~CDVDVideoCodecFFmpeg() -@@ -323,6 +324,14 @@ void CDVDVideoCodecFFmpeg::SetDropState(bool bDrop) +@@ -340,6 +341,14 @@ void CDVDVideoCodecFFmpeg::SetDropState(bool bDrop) { if( m_pCodecContext ) { @@ -2774,7 +1136,7 @@ index 9111afa..5cd4bbd 100644 // i don't know exactly how high this should be set // couldn't find any good docs on it. think it varies // from codec to codec on what it does -@@ -524,6 +533,7 @@ int CDVDVideoCodecFFmpeg::Decode(BYTE* pData, int iSize, double dts, double pts) +@@ -541,6 +550,7 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p void CDVDVideoCodecFFmpeg::Reset() { m_started = false; @@ -2782,7 +1144,7 @@ index 9111afa..5cd4bbd 100644 m_iLastKeyframe = m_pCodecContext->has_b_frames; m_dllAvCodec.avcodec_flush_buffers(m_pCodecContext); -@@ -622,6 +632,22 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) +@@ -643,6 +653,22 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) else pDvdVideoPicture->pts = DVD_NOPTS_VALUE; @@ -2805,7 +1167,7 @@ index 9111afa..5cd4bbd 100644 if(!m_started) pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; -@@ -851,3 +877,8 @@ unsigned CDVDVideoCodecFFmpeg::GetConvergeCount() +@@ -880,3 +906,8 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() else return 0; } @@ -2815,27 +1177,27 @@ index 9111afa..5cd4bbd 100644 + m_codecControlFlags = flags; +} diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index 75135ef..1d64356 100644 +index fe6bbaa..c7ae207 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -@@ -45,6 +45,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - virtual bool GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture* picture) = 0; +@@ -46,6 +46,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec virtual int Check (AVCodecContext* avctx) = 0; virtual void Reset () {} + virtual unsigned GetAllowedReferences() { return 0; } + virtual bool CanSkipDeint() {return false; } virtual const std::string Name() = 0; virtual CCriticalSection* Section() { return NULL; } }; -@@ -61,6 +62,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - virtual unsigned int SetFilters(unsigned int filters); +@@ -63,6 +64,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec virtual const char* GetName() { return m_name.c_str(); }; // m_name is never changed after open virtual unsigned GetConvergeCount(); + virtual unsigned GetAllowedReferences(); + virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) {pts=m_decoderPts; skippedDeint=m_skippedDeint; if (m_pFrame) interlaced = m_pFrame->interlaced_frame; return true;} + virtual void SetCodecControl(int flags); bool IsHardwareAllowed() { return !m_bSoftware; } IHardwareDecoder * GetHardware() { return m_pHardware; }; -@@ -122,4 +125,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec +@@ -124,4 +127,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec double m_dts; bool m_started; std::vector m_formats; @@ -2845,10 +1207,10 @@ index 75135ef..1d64356 100644 + int m_codecControlFlags; }; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index cb04017..094da04 100644 +index 749195f..4c1e9dd 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -326,8 +326,10 @@ void CDVDPlayerVideo::Process() +@@ -322,8 +322,10 @@ void CDVDPlayerVideo::Process() int iDropped = 0; //frames dropped in a row bool bRequestDrop = false; @@ -2859,7 +1221,7 @@ index cb04017..094da04 100644 while (!m_bStop) { -@@ -437,6 +439,7 @@ void CDVDPlayerVideo::Process() +@@ -433,6 +435,7 @@ void CDVDPlayerVideo::Process() picture.iFlags &= ~DVP_FLAG_ALLOCATED; m_packets.clear(); m_started = false; @@ -2867,7 +1229,7 @@ index cb04017..094da04 100644 } else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (CDVDPlayerVideo::Flush()) { -@@ -449,6 +452,7 @@ void CDVDPlayerVideo::Process() +@@ -445,6 +448,7 @@ void CDVDPlayerVideo::Process() //we need to recalculate the framerate //TODO: this needs to be set on a streamchange instead ResetFrameRateCalc(); @@ -2875,19 +1237,18 @@ index cb04017..094da04 100644 m_stalled = true; m_started = false; -@@ -466,9 +470,11 @@ void CDVDPlayerVideo::Process() +@@ -462,8 +466,10 @@ void CDVDPlayerVideo::Process() m_speed = static_cast(pMsg)->m_value; if(m_speed == DVD_PLAYSPEED_PAUSE) m_iNrOfPicturesNotToSkip = 0; + if (m_pVideoCodec) m_pVideoCodec->SetSpeed(m_speed); - g_renderManager.SetSpeed(m_speed); + m_droppingStats.Reset(); } else if (pMsg->IsType(CDVDMsg::PLAYER_STARTED)) { -@@ -514,6 +520,28 @@ void CDVDPlayerVideo::Process() +@@ -509,6 +515,28 @@ void CDVDPlayerVideo::Process() m_iNrOfPicturesNotToSkip = 1; } @@ -2913,18 +1274,10 @@ index cb04017..094da04 100644 + iDropped++; + } + - #ifdef PROFILE - bRequestDrop = false; - #else -@@ -523,6 +551,7 @@ void CDVDPlayerVideo::Process() - bRequestDrop = false; - m_iDroppedRequest = 0; - m_iLateFrames = 0; -+ m_droppingStats.m_requestOutputDrop = false; - } - #endif - -@@ -570,15 +599,8 @@ void CDVDPlayerVideo::Process() + if (m_messageQueue.GetDataSize() == 0 + || m_speed < 0) + { +@@ -561,15 +589,8 @@ void CDVDPlayerVideo::Process() } m_videoStats.AddSampleBytes(pPacket->iSize); @@ -2942,7 +1295,7 @@ index cb04017..094da04 100644 // loop while no error while (!m_bStop) -@@ -1275,50 +1297,30 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1207,33 +1228,12 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) m_FlipTimeStamp += max(0.0, iSleepTime); m_FlipTimeStamp += iFrameDuration; @@ -2953,8 +1306,7 @@ index cb04017..094da04 100644 - - // ask decoder to drop frames next round, as we are very late - if(m_iLateFrames > 10) -+ if ((m_droppingStats.m_requestOutputDrop && !(pPicture->iFlags & DVP_FLAG_NOSKIP)) -+ || (pPicture->iFlags & DVP_FLAG_DROPPED)) ++ if ((pPicture->iFlags & DVP_FLAG_DROPPED)) { - if (!(pPicture->iFlags & DVP_FLAG_NOSKIP)) - { @@ -2965,51 +1317,23 @@ index cb04017..094da04 100644 - result |= EOS_VERYLATE; - m_pullupCorrection.Flush(); //dropped frames mess up the pattern, so just flush it - } -- -- //if we requested 5 drops in a row and we're still late, drop on output -- //this keeps a/v sync if the decoder can't drop, or we're still calculating the framerate -- if (m_iDroppedRequest > 5) -- { -- m_iDroppedRequest--; //decrease so we only drop half the frames -- return result | EOS_DROPPED; -- } - m_iDroppedRequest++; - } - } - else - { - m_iDroppedRequest = 0; -+ m_droppingStats.AddOutputDropGain(pts, 1/m_fFrameRate); -+ m_droppingStats.m_requestOutputDrop = false; -+ CLog::Log(LOGDEBUG,"%s - dropped in output", __FUNCTION__); -+ return result | EOS_DROPPED; - } - - if( m_speed < 0 ) - { -- if( iClockSleep < -DVD_MSEC_TO_TIME(200) -- && !(pPicture->iFlags & DVP_FLAG_NOSKIP) ) -+ double decoderPts = m_droppingStats.m_lastDecoderPts; -+ double renderPts = m_droppingStats.m_lastRenderPts; -+ if (pts > renderPts) -+ { -+ if (decoderPts >= renderPts) -+ { -+ Sleep(200); -+ } - return result | EOS_DROPPED; -+ } - } - -- if( (pPicture->iFlags & DVP_FLAG_DROPPED) ) -- return result | EOS_DROPPED; +- } - -- if( m_speed != DVD_PLAYSPEED_NORMAL && limited ) -+ if( m_speed != DVD_PLAYSPEED_NORMAL && m_speed >= 0 && limited ) - { - m_droptime += iFrameDuration; - #ifndef PROFILE -@@ -1380,7 +1382,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +- if( (pPicture->iFlags & DVP_FLAG_DROPPED) ) ++ m_droppingStats.AddOutputDropGain(pts, 1/m_fFrameRate); ++ CLog::Log(LOGDEBUG,"%s - dropped in output", __FUNCTION__); + return result | EOS_DROPPED; ++ } + + // set fieldsync if picture is interlaced + EFIELDSYNC mDisplayField = FS_NONE; +@@ -1266,7 +1266,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) if (index < 0) return EOS_DROPPED; @@ -3018,7 +1342,7 @@ index cb04017..094da04 100644 return result; #else -@@ -1679,3 +1681,136 @@ void CDVDPlayerVideo::CalcFrameRate() +@@ -1566,3 +1566,127 @@ void CDVDPlayerVideo::CalcFrameRate() m_iFrameRateCount = 0; } } @@ -3114,14 +1438,7 @@ index cb04017..094da04 100644 + if (m_iNrOfPicturesNotToSkip <= 0) + { + result |= EOS_VERYLATE; -+ -+ // drop in output -+ if (m_droppingStats.m_dropRequests > 7 && g_graphicsContext.IsFullScreenVideo()) -+ { -+ m_droppingStats.m_dropRequests--; //decrease so we only drop half the frames -+ m_droppingStats.m_requestOutputDrop = true; -+ } -+ else if (bNewFrame) ++ if (bNewFrame) + m_droppingStats.m_dropRequests++; + } + } @@ -3130,7 +1447,6 @@ index cb04017..094da04 100644 + { + m_droppingStats.m_dropRequests = 0; + m_droppingStats.m_lateFrames = 0; -+ m_droppingStats.m_requestOutputDrop = false; + } + m_droppingStats.m_lastRenderPts = iRenderPts; + return result; @@ -3144,7 +1460,6 @@ index cb04017..094da04 100644 + m_lastRenderPts = 0; + m_lateFrames = 0; + m_dropRequests = 0; -+ m_requestOutputDrop = false; +} + +void CDroppingStats::AddOutputDropGain(double pts, double frametime) @@ -3156,10 +1471,10 @@ index cb04017..094da04 100644 + m_totalGain += frametime; +} diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -index d1c9b94..5310522 100644 +index bf484ea..3669cc1 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -@@ -37,6 +37,26 @@ +@@ -37,6 +37,25 @@ #define VIDEO_PICTURE_QUEUE_SIZE 1 @@ -3179,14 +1494,13 @@ index d1c9b94..5310522 100644 + double m_lastRenderPts; + unsigned int m_lateFrames; + unsigned int m_dropRequests; -+ bool m_requestOutputDrop; +}; + + class CDVDPlayerVideo : public CThread { public: -@@ -110,6 +130,7 @@ class CDVDPlayerVideo : public CThread +@@ -104,6 +123,7 @@ class CDVDPlayerVideo : public CThread #define EOS_ABORT 1 #define EOS_DROPPED 2 #define EOS_VERYLATE 4 @@ -3194,7 +1508,7 @@ index d1c9b94..5310522 100644 void AutoCrop(DVDVideoPicture* pPicture); void AutoCrop(DVDVideoPicture *pPicture, RECT &crop); -@@ -135,6 +156,7 @@ class CDVDPlayerVideo : public CThread +@@ -129,6 +149,7 @@ class CDVDPlayerVideo : public CThread void ResetFrameRateCalc(); void CalcFrameRate(); @@ -3202,7 +1516,7 @@ index d1c9b94..5310522 100644 double m_fFrameRate; //framerate of the video currently playing bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps -@@ -195,5 +217,7 @@ class CDVDPlayerVideo : public CThread +@@ -181,5 +202,7 @@ class CDVDPlayerVideo : public CThread CPullupCorrection m_pullupCorrection; std::list m_packets; @@ -3214,45 +1528,22 @@ index d1c9b94..5310522 100644 1.8.1.6 -From 136f108db478ab4eaf47ceed761a439344fa5c10 Mon Sep 17 00:00:00 2001 +From b91985629642c325f9ff5103b1daa977176c65ae Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Sep 2012 16:05:21 +0200 -Subject: [PATCH 021/119] video player: present correct pts to user for a/v +Subject: [PATCH 010/105] video player: present correct pts to user for a/v sync (after buffering in renderer) --- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 41 ++++++++++++++++++++------------- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 25 +++++++++++++++++++++++++ xbmc/cores/dvdplayer/DVDPlayerVideo.h | 2 +- - 2 files changed, 26 insertions(+), 17 deletions(-) + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 094da04..069c8d8 100644 +index 4c1e9dd..ba99804 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1281,22 +1281,6 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - else - iSleepTime = iFrameSleep + (iClockSleep - iFrameSleep) / m_autosync; - --#ifdef PROFILE /* during profiling, try to play as fast as possible */ -- iSleepTime = 0; --#endif -- -- // present the current pts of this frame to user, and include the actual -- // presentation delay, to allow him to adjust for it -- if( m_stalled ) -- m_iCurrentPts = DVD_NOPTS_VALUE; -- else -- m_iCurrentPts = pts - max(0.0, iSleepTime); -- -- // timestamp when we think next picture should be displayed based on current duration -- m_FlipTimeStamp = iCurrentClock; -- m_FlipTimeStamp += max(0.0, iSleepTime); -- m_FlipTimeStamp += iFrameDuration; -- - if ((m_droppingStats.m_requestOutputDrop && !(pPicture->iFlags & DVP_FLAG_NOSKIP)) - || (pPicture->iFlags & DVP_FLAG_DROPPED)) - { -@@ -1601,6 +1585,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() +@@ -1486,6 +1486,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() g_advancedSettings.m_videoFpsDetect == 0; } @@ -3275,7 +1566,7 @@ index 094da04..069c8d8 100644 #define MAXFRAMERATEDIFF 0.01 #define MAXFRAMESERR 1000 -@@ -1719,6 +1719,15 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) +@@ -1604,6 +1620,15 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) else iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; @@ -3292,10 +1583,10 @@ index 094da04..069c8d8 100644 && bNewFrame && m_bAllowDrop diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -index 5310522..f395897 100644 +index 3669cc1..9477a6b 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -@@ -108,7 +108,7 @@ class CDVDPlayerVideo : public CThread +@@ -101,7 +101,7 @@ class CDVDPlayerVideo : public CThread bool InitializedOutputDevice(); @@ -3308,10 +1599,10 @@ index 5310522..f395897 100644 1.8.1.6 -From b3d1da6beb4e18ab24d5c560099db48df8c20377 Mon Sep 17 00:00:00 2001 +From facade51ccafe7aadb7968df83c387ff7df589af Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 16 Feb 2013 18:25:53 +0100 -Subject: [PATCH 022/119] videoplayer: some rework and documentation +Subject: [PATCH 011/105] videoplayer: some rework and documentation --- .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 29 ++++++++++++++++++++-- @@ -3321,10 +1612,10 @@ Subject: [PATCH 022/119] videoplayer: some rework and documentation 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 5931e2f..ac126fe 100644 +index ee943a0..7abbd7e 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -132,7 +132,6 @@ struct DVDVideoUserData +@@ -131,7 +131,6 @@ struct DVDVideoUserData #define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data #define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again #define VC_DROPPED 0x00000020 // needed to identify if a picture was dropped @@ -3332,9 +1623,9 @@ index 5931e2f..ac126fe 100644 class CDVDVideoCodec { -@@ -251,10 +250,36 @@ class CDVDVideoCodec - return 0; - } +@@ -256,10 +255,36 @@ class CDVDVideoCodec + */ + virtual unsigned GetAllowedReferences() { return 0; } - virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) + /** @@ -3371,10 +1662,10 @@ index 5931e2f..ac126fe 100644 virtual void SetCodecControl(int flags) {} }; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 5cd4bbd..b750fb8 100644 +index b197ec8..547ede9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -878,6 +878,17 @@ unsigned CDVDVideoCodecFFmpeg::GetConvergeCount() +@@ -907,6 +907,17 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() return 0; } @@ -3393,23 +1684,23 @@ index 5cd4bbd..b750fb8 100644 { m_codecControlFlags = flags; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index 1d64356..2826543 100644 +index c7ae207..81b9af9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -@@ -62,7 +62,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - virtual unsigned int SetFilters(unsigned int filters); +@@ -64,7 +64,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec virtual const char* GetName() { return m_name.c_str(); }; // m_name is never changed after open virtual unsigned GetConvergeCount(); + virtual unsigned GetAllowedReferences(); - virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) {pts=m_decoderPts; skippedDeint=m_skippedDeint; if (m_pFrame) interlaced = m_pFrame->interlaced_frame; return true;} + virtual bool GetCodecStats(double &pts, int &skippedDeint, int &interlaced); virtual void SetCodecControl(int flags); bool IsHardwareAllowed() { return !m_bSoftware; } diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 069c8d8..e7de828 100644 +index ba99804..56b32b9 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1696,7 +1696,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) +@@ -1597,7 +1597,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) int iBufferLevel; // get decoder stats @@ -3422,105 +1713,16 @@ index 069c8d8..e7de828 100644 1.8.1.6 -From fa5ef76cbd3b36d6885bc21c930960cf2a4b5ef5 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Fri, 1 Mar 2013 09:57:16 +0100 -Subject: [PATCH 023/119] Revert "dvdplayer: disable buffering unit dropping is - improves" - -This reverts commit de1caf5686c1fb53cb7ab11b356e6c22770740db. ---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index e7de828..c7c6797 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1133,35 +1133,35 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - { - case RENDER_FMT_YUV420P: - formatstr = "YV12"; -- buffering = false; -+ buffering = true; - break; - case RENDER_FMT_YUV420P16: - formatstr = "YV12P16"; -- buffering = false; -+ buffering = true; - break; - case RENDER_FMT_YUV420P10: - formatstr = "YV12P10"; -- buffering = false; -+ buffering = true; - break; - case RENDER_FMT_NV12: - formatstr = "NV12"; -- buffering = false; -+ buffering = true; - break; - case RENDER_FMT_UYVY422: - formatstr = "UYVY"; -- buffering = false; -+ buffering = true; - break; - case RENDER_FMT_YUYV422: - formatstr = "YUY2"; -- buffering = false; -+ buffering = true; - break; - case RENDER_FMT_VDPAU: - formatstr = "VDPAU"; -- buffering = false; -+ buffering = true; - break; - case RENDER_FMT_DXVA: - formatstr = "DXVA"; -- buffering = false; -+ buffering = true; - break; - case RENDER_FMT_VAAPI: - formatstr = "VAAPI"; --- -1.8.1.6 - - -From a30524650e42635fba4b392cf3c8074599b7291c Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Thu, 4 Apr 2013 15:44:20 +0200 -Subject: [PATCH 024/119] OMXPlayerVideo: adapt to change in FlipPage - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 3703f7a..890dd38 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -360,7 +360,7 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket) - m_LastOutputTime = pts_overlay; - - double timestamp = (CDVDClock::GetAbsoluteClock(false) + (bufferlevel+1) * iFrameDuration) / DVD_TIME_BASE; -- g_renderManager.FlipPage(CThread::m_bStop, timestamp, -1, FS_NONE); -+ g_renderManager.FlipPage(CThread::m_bStop, timestamp, 0.0, -1, FS_NONE); - } - - void OMXPlayerVideo::Process() --- -1.8.1.6 - - -From 0eafd6782fd19fe620c3f6af7cd851e4e55472f3 Mon Sep 17 00:00:00 2001 +From 1dabfa0fb962e464370dbc59898002261cf7f50a Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 7 Apr 2012 09:19:00 +0200 -Subject: [PATCH 025/119] vdpau: redesign +Subject: [PATCH 012/105] vdpau: redesign --- language/English/strings.po | 12 +- system/settings/settings.xml | 10 + system/shaders/yuv2rgb_basic.glsl | 12 + - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 203 +- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 200 +- xbmc/cores/VideoRenderers/LinuxRendererGL.h | 13 +- xbmc/cores/VideoRenderers/RenderFormats.h | 1 + xbmc/cores/VideoRenderers/RenderManager.cpp | 3 +- @@ -3529,9 +1731,9 @@ Subject: [PATCH 025/119] vdpau: redesign .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 4 +- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 6 +- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 1 - - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3838 ++++++++++++++------ - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 672 +++- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 + + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3843 ++++++++++++++------ + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 675 +++- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + xbmc/settings/AdvancedSettings.cpp | 8 +- xbmc/settings/AdvancedSettings.h | 4 +- xbmc/utils/ActorProtocol.cpp | 253 ++ @@ -3539,15 +1741,15 @@ Subject: [PATCH 025/119] vdpau: redesign xbmc/utils/Makefile.in | 1 + xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 2 +- xbmc/windowing/X11/WinSystemX11.h | 1 + - 22 files changed, 3915 insertions(+), 1224 deletions(-) + 22 files changed, 3911 insertions(+), 1230 deletions(-) create mode 100644 xbmc/utils/ActorProtocol.cpp create mode 100644 xbmc/utils/ActorProtocol.h diff --git a/language/English/strings.po b/language/English/strings.po -index de5b1b5..57c805b 100644 +index 86210a7..e6c87e9 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5768,7 +5768,15 @@ msgctxt "#13435" +@@ -5771,7 +5771,15 @@ msgctxt "#13435" msgid "Enable HQ Scalers for scalings above" msgstr "" @@ -3564,7 +1766,7 @@ index de5b1b5..57c805b 100644 #: system/settings/settings.xml msgctxt "#13500" -@@ -6842,7 +6850,7 @@ msgid "Software Blend" +@@ -6846,7 +6854,7 @@ msgid "Software Blend" msgstr "" msgctxt "#16325" @@ -3574,14 +1776,14 @@ index de5b1b5..57c805b 100644 #empty strings from id 16326 to 16399 diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 043c0ad..18ce36d 100644 +index 6e32551..15e9a75 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -375,6 +375,16 @@ 2 true -+ ++ + HAVE_LIBVDPAU + 2 + true @@ -3618,10 +1820,10 @@ index c8c8a2e..0799a4b 100644 #if(XBMC_texture_rectangle) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 6cbbc78..6593418 100644 +index 95e6716..88c7e5f 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -705,6 +705,18 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -679,6 +679,18 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) glDisable(GL_POLYGON_STIPPLE); } @@ -3640,7 +1842,7 @@ index 6cbbc78..6593418 100644 else Render(flags, index); -@@ -785,11 +797,6 @@ void CLinuxRendererGL::FlipPage(int source) +@@ -759,11 +771,6 @@ void CLinuxRendererGL::FlipPage(int source) m_buffers[m_iYV12RenderBuffer].flipindex = ++m_flipindex; @@ -3652,7 +1854,7 @@ index 6cbbc78..6593418 100644 return; } -@@ -1116,6 +1123,12 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -1090,6 +1097,12 @@ void CLinuxRendererGL::LoadShaders(int field) m_textureCreate = &CLinuxRendererGL::CreateVDPAUTexture; m_textureDelete = &CLinuxRendererGL::DeleteVDPAUTexture; } @@ -3665,7 +1867,7 @@ index 6cbbc78..6593418 100644 else if (m_format == RENDER_FMT_VAAPI) { m_textureUpload = &CLinuxRendererGL::UploadVAAPITexture; -@@ -1191,7 +1204,10 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1165,7 +1178,10 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) m_currentField = FIELD_FULL; // call texture load function @@ -3676,7 +1878,7 @@ index 6cbbc78..6593418 100644 if (m_renderMethod & RENDER_GLSL) { -@@ -1557,17 +1573,12 @@ void CLinuxRendererGL::RenderFromFBO() +@@ -1540,17 +1556,12 @@ void CLinuxRendererGL::RenderFromFBO() void CLinuxRendererGL::RenderVDPAU(int index, int field) { #ifdef HAVE_LIBVDPAU @@ -3696,7 +1898,7 @@ index 6cbbc78..6593418 100644 // Try some clamping or wrapping glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); -@@ -1625,8 +1636,6 @@ void CLinuxRendererGL::RenderVDPAU(int index, int field) +@@ -1608,8 +1619,6 @@ void CLinuxRendererGL::RenderVDPAU(int index, int field) if (m_pVideoFilterShader) m_pVideoFilterShader->Disable(); @@ -3705,7 +1907,7 @@ index 6cbbc78..6593418 100644 glBindTexture (m_textureTarget, 0); glDisable(m_textureTarget); #endif -@@ -2311,12 +2320,14 @@ void CLinuxRendererGL::DeleteVDPAUTexture(int index) +@@ -2286,12 +2295,14 @@ void CLinuxRendererGL::DeleteVDPAUTexture(int index) { #ifdef HAVE_LIBVDPAU YUVPLANE &plane = m_buffers[index].fields[0][0]; @@ -3720,10 +1922,11 @@ index 6cbbc78..6593418 100644 #endif } -@@ -2350,11 +2361,152 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) +@@ -2324,10 +2335,147 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) void CLinuxRendererGL::UploadVDPAUTexture(int index) { #ifdef HAVE_LIBVDPAU +- glPixelStorei(GL_UNPACK_ALIGNMENT,1); //what's this for? + VDPAU::CVdpauRenderPicture *vdpau = m_buffers[index].vdpau; + + unsigned int flipindex = m_buffers[index].flipindex; @@ -3732,14 +1935,12 @@ index 6cbbc78..6593418 100644 + + if (!vdpau || !vdpau->valid) + { -+ m_eventTexturesDone[index]->Set(); + m_skipRender = true; + return; + } + + fields[0][1].id = vdpau->texture[0]; + -+ m_eventTexturesDone[index]->Set(); +#endif +} + @@ -3791,8 +1992,6 @@ index 6cbbc78..6593418 100644 + glGenTextures(1, &plane.id); + glDisable(m_textureTarget); + - m_eventTexturesDone[index]->Set(); -- glPixelStorei(GL_UNPACK_ALIGNMENT,1); //what's this for? #endif + return true; } @@ -3809,7 +2008,6 @@ index 6cbbc78..6593418 100644 + + if (!vdpau || !vdpau->valid) + { -+ m_eventTexturesDone[index]->Set(); + m_skipRender = true; + return; + } @@ -3868,13 +2066,12 @@ index 6cbbc78..6593418 100644 + CalculateTextureSourceRects(index, 3); + glDisable(m_textureTarget); + -+ m_eventTexturesDone[index]->Set(); +#endif +} void CLinuxRendererGL::DeleteVAAPITexture(int index) { -@@ -3292,12 +3444,13 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) +@@ -3250,12 +3398,13 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) if(method == VS_INTERLACEMETHOD_AUTO) return true; @@ -3892,7 +2089,7 @@ index 6cbbc78..6593418 100644 #endif return false; } -@@ -3390,14 +3543,7 @@ EINTERLACEMETHOD CLinuxRendererGL::AutoInterlaceMethod() +@@ -3348,14 +3497,7 @@ EINTERLACEMETHOD CLinuxRendererGL::AutoInterlaceMethod() return VS_INTERLACEMETHOD_NONE; if(m_renderMethod & RENDER_VDPAU) @@ -3907,7 +2104,15 @@ index 6cbbc78..6593418 100644 if(Supports(VS_INTERLACEMETHOD_RENDER_BOB)) return VS_INTERLACEMETHOD_RENDER_BOB; -@@ -3440,11 +3586,12 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) +@@ -3400,6 +3542,7 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) + unsigned int CLinuxRendererGL::GetProcessorSize() + { + if(m_format == RENDER_FMT_VDPAU ++ || m_format == RENDER_FMT_VDPAU_420 + || m_format == RENDER_FMT_VAAPI + || m_format == RENDER_FMT_CVBREF) + return 1; +@@ -3428,11 +3571,12 @@ bool CLinuxRendererGL::IsProcessed(int idx) } #ifdef HAVE_LIBVDPAU @@ -3923,7 +2128,7 @@ index 6cbbc78..6593418 100644 #endif diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index 949c502..0b91257 100644 +index e239b92..d72eb64 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h @@ -39,12 +39,11 @@ @@ -3940,8 +2145,8 @@ index 949c502..0b91257 100644 #undef ALIGN #define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) -@@ -143,7 +142,7 @@ class CLinuxRendererGL : public CBaseRenderer - virtual unsigned int GetProcessorSize() { return m_NumYV12Buffers; } +@@ -144,7 +143,7 @@ class CLinuxRendererGL : public CBaseRenderer + virtual bool IsProcessed(int idx); #ifdef HAVE_LIBVDPAU - virtual void AddProcessor(CVDPAU* vdpau, int index); @@ -3949,7 +2154,7 @@ index 949c502..0b91257 100644 #endif #ifdef HAVE_LIBVA virtual void AddProcessor(VAAPI::CHolder& holder, int index); -@@ -194,6 +193,10 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -195,6 +194,10 @@ class CLinuxRendererGL : public CBaseRenderer void DeleteVDPAUTexture(int index); bool CreateVDPAUTexture(int index); @@ -3960,7 +2165,7 @@ index 949c502..0b91257 100644 void UploadVAAPITexture(int index); void DeleteVAAPITexture(int index); bool CreateVAAPITexture(int index); -@@ -220,6 +223,7 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -221,6 +224,7 @@ class CLinuxRendererGL : public CBaseRenderer void RenderSinglePass(int renderBuffer, int field); // single pass glsl renderer void RenderSoftware(int renderBuffer, int field); // single pass s/w yuv2rgb renderer void RenderVDPAU(int renderBuffer, int field); // render using vdpau hardware @@ -3968,8 +2173,8 @@ index 949c502..0b91257 100644 void RenderVAAPI(int renderBuffer, int field); // render using vdpau hardware struct -@@ -280,7 +284,7 @@ class CLinuxRendererGL : public CBaseRenderer - GLuint pbo[MAX_PLANES]; +@@ -282,7 +286,7 @@ class CLinuxRendererGL : public CBaseRenderer + GLsync fence; #ifdef HAVE_LIBVDPAU - CVDPAU* vdpau; @@ -3998,10 +2203,10 @@ index 4e8d7e9..6ed62be 100644 RENDER_FMT_UYVY422, RENDER_FMT_YUYV422, diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 1735ff8..13facce 100644 +index 318a7fd..0ad88ce 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -873,7 +873,8 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -921,7 +921,8 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) CDVDCodecUtils::CopyDXVA2Picture(&image, &pic); } #ifdef HAVE_LIBVDPAU @@ -4012,7 +2217,7 @@ index 1735ff8..13facce 100644 #endif #ifdef HAVE_LIBOPENMAX diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 8140447..8b1a8b7 100644 +index c387796..2c5ccf4 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.h +++ b/xbmc/cores/VideoRenderers/RenderManager.h @@ -35,7 +35,7 @@ @@ -4038,7 +2243,7 @@ index 5b58f61..95f4a1e 100644 CLog::Log(LOGERROR, "GL: BaseYUV2RGBGLSLShader - unsupported format %d", m_format); diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index ac126fe..2bf79fe 100644 +index 7abbd7e..13a2648 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h @@ -34,7 +34,7 @@ @@ -4060,10 +2265,10 @@ index ac126fe..2bf79fe 100644 struct { VAAPI::CHolder* vaapi; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index b750fb8..b17261b 100644 +index 547ede9..6569d9c 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -72,11 +72,11 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx +@@ -75,11 +75,11 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx while(*cur != PIX_FMT_NONE) { #ifdef HAVE_LIBVDPAU @@ -4079,7 +2284,7 @@ index b750fb8..b17261b 100644 ctx->SetHardware(vdp); return *cur; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index 2826543..272fc6c 100644 +index 81b9af9..fd8b863 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h @@ -29,7 +29,6 @@ @@ -4091,7 +2296,7 @@ index 2826543..272fc6c 100644 class CDVDVideoCodecFFmpeg : public CDVDVideoCodec diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 3ad5f78..d5d7595 100644 +index 03d40f2..000d2cb 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -33,11 +33,16 @@ @@ -4136,7 +2341,7 @@ index 3ad5f78..d5d7595 100644 static struct SInterlaceMapping { -@@ -69,113 +76,30 @@ +@@ -69,114 +76,30 @@ , {VS_INTERLACEMETHOD_VDPAU_TEMPORAL_HALF , VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL} , {VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL , VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL} , {VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL_HALF, VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL} @@ -4257,6 +2462,7 @@ index 3ad5f78..d5d7595 100644 - vdp_video_mixer_query_feature_support = NULL; - vdp_video_mixer_destroy = NULL; - vdp_video_mixer_render = NULL; +- m_hwContext.bitstream_buffers_allocated = 0; -} - -bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int surfaces) @@ -4264,7 +2470,7 @@ index 3ad5f78..d5d7595 100644 { if(avctx->coded_width == 0 || avctx->coded_height == 0) -@@ -183,6 +107,8 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -184,6 +107,8 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su CLog::Log(LOGWARNING,"(VDPAU) no width/height available, can't init"); return false; } @@ -4273,7 +2479,7 @@ index 3ad5f78..d5d7595 100644 if ((avctx->codec_id == CODEC_ID_MPEG4) && !g_advancedSettings.m_videoAllowMpeg4VDPAU) return false; -@@ -197,8 +123,6 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -198,8 +123,6 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su error = "dlerror() returned NULL"; CLog::Log(LOGNOTICE,"(VDPAU) Unable to get handle to libvdpau: %s", error); @@ -4282,7 +2488,7 @@ index 3ad5f78..d5d7595 100644 return false; } } -@@ -207,8 +131,9 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -208,8 +131,9 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su return false; InitVDPAUProcs(); @@ -4293,7 +2499,7 @@ index 3ad5f78..d5d7595 100644 { SpewHardwareAvailable(); -@@ -226,28 +151,26 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -227,28 +151,26 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su /* attempt to create a decoder with this width/height, some sizes are not supported by hw */ VdpStatus vdp_st; @@ -4329,7 +2535,7 @@ index 3ad5f78..d5d7595 100644 avctx->slice_flags=SLICE_FLAG_CODED_ORDER|SLICE_FLAG_ALLOW_FIELD; avctx->hwaccel_context = &m_hwContext; avctx->thread_count = 1; -@@ -258,17 +181,20 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -259,17 +181,20 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su return false; } @@ -4352,7 +2558,7 @@ index 3ad5f78..d5d7595 100644 while (!m_videoSurfaces.empty()) { -@@ -286,191 +212,120 @@ void CVDPAU::Close() +@@ -287,191 +212,120 @@ void CVDPAU::Close() } g_Windowing.Unregister(this); @@ -4607,7 +2813,7 @@ index 3ad5f78..d5d7595 100644 state = m_DisplayState; } -@@ -484,16 +339,13 @@ int CVDPAU::Check(AVCodecContext* avctx) +@@ -485,16 +339,13 @@ int CVDPAU::Check(AVCodecContext* avctx) } else { @@ -4626,7 +2832,7 @@ index 3ad5f78..d5d7595 100644 FiniVDPAUOutput(); FiniVDPAUProcs(); -@@ -508,7 +360,7 @@ int CVDPAU::Check(AVCodecContext* avctx) +@@ -509,7 +360,7 @@ int CVDPAU::Check(AVCodecContext* avctx) return 0; } @@ -4635,7 +2841,7 @@ index 3ad5f78..d5d7595 100644 { if (format == AV_PIX_FMT_VDPAU) return true; -@@ -516,90 +368,28 @@ bool CVDPAU::IsVDPAUFormat(PixelFormat format) +@@ -517,90 +368,28 @@ bool CVDPAU::IsVDPAUFormat(PixelFormat format) return false; } @@ -4737,7 +2943,7 @@ index 3ad5f78..d5d7595 100644 for(SInterlaceMapping* p = g_interlace_mapping; p->method != VS_INTERLACEMETHOD_NONE; p++) { if(p->method == method) -@@ -608,162 +398,12 @@ bool CVDPAU::Supports(EINTERLACEMETHOD method) +@@ -609,162 +398,12 @@ bool CVDPAU::Supports(EINTERLACEMETHOD method) return false; } @@ -4903,7 +3109,7 @@ index 3ad5f78..d5d7595 100644 { char* error; -@@ -773,151 +413,115 @@ void CVDPAU::InitVDPAUProcs() +@@ -774,151 +413,115 @@ void CVDPAU::InitVDPAUProcs() if (error) { CLog::Log(LOGERROR,"(VDPAU) - %s in %s",error,__FUNCTION__); @@ -5115,7 +3321,7 @@ index 3ad5f78..d5d7595 100644 render->surface = VDP_INVALID_HANDLE; } if (CheckStatus(vdp_st, __LINE__)) -@@ -925,10 +529,9 @@ void CVDPAU::FiniVDPAUOutput() +@@ -926,10 +529,9 @@ void CVDPAU::FiniVDPAUOutput() } } @@ -5129,7 +3335,7 @@ index 3ad5f78..d5d7595 100644 { switch (codec) { -@@ -940,7 +543,7 @@ void CVDPAU::ReadFormatOf( AVCodecID codec +@@ -941,7 +543,7 @@ void CVDPAU::ReadFormatOf( AVCodecID codec vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG2_MAIN; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; @@ -5138,16 +3344,20 @@ index 3ad5f78..d5d7595 100644 vdp_decoder_profile = VDP_DECODER_PROFILE_H264_HIGH; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; -@@ -952,8 +555,6 @@ void CVDPAU::ReadFormatOf( AVCodecID codec +@@ -953,12 +555,10 @@ void CVDPAU::ReadFormatOf( AVCodecID codec vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; --#if (defined PIX_FMT_VDPAU_MPEG4_IN_AVUTIL) && \ -- (defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP) +-#if (defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP) case AV_CODEC_ID_MPEG4: vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; vdp_chroma_type = VDP_CHROMA_TYPE_420; -@@ -966,170 +567,78 @@ void CVDPAU::ReadFormatOf( AVCodecID codec + break; +-#endif + default: + vdp_decoder_profile = 0; + vdp_chroma_type = 0; +@@ -966,170 +566,78 @@ void CVDPAU::ReadFormatOf( AVCodecID codec } } @@ -5366,7 +3576,7 @@ index 3ad5f78..d5d7595 100644 { VdpStatus rv; CLog::Log(LOGNOTICE,"VDPAU Decoder capabilities:"); -@@ -1139,7 +648,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1139,7 +647,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L { VdpBool is_supported = false; uint32_t max_level, max_macroblocks, max_width, max_height; @@ -5375,7 +3585,7 @@ index 3ad5f78..d5d7595 100644 &is_supported, &max_level, &max_macroblocks, &max_width, &max_height); if(rv == VDP_STATUS_OK && is_supported) { -@@ -1148,13 +657,13 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1148,13 +656,13 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L } } CLog::Log(LOGNOTICE,"------------------------------------"); @@ -5392,7 +3602,7 @@ index 3ad5f78..d5d7595 100644 } \ } while(false) -@@ -1178,7 +687,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1178,7 +686,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L } @@ -5401,7 +3611,7 @@ index 3ad5f78..d5d7595 100644 { // find render state in queue bool found(false); -@@ -1205,34 +714,33 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render) +@@ -1205,34 +713,33 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render) return true; } @@ -5451,7 +3661,7 @@ index 3ad5f78..d5d7595 100644 } } -@@ -1241,21 +749,22 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1241,21 +748,22 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) { // create a new surface VdpDecoderProfile profile; @@ -5477,7 +3687,7 @@ index 3ad5f78..d5d7595 100644 avctx->coded_width, avctx->coded_height, &render->surface); -@@ -1277,18 +786,6 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1277,18 +785,6 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) pic->linesize[0] = pic->linesize[1] = pic->linesize[2] = 0; @@ -5496,7 +3706,7 @@ index 3ad5f78..d5d7595 100644 pic->type= FF_BUFFER_TYPE_USER; render->state |= FF_VDPAU_STATE_USED_FOR_REFERENCE; -@@ -1296,15 +793,16 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1296,15 +792,16 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) return 0; } @@ -5516,7 +3726,7 @@ index 3ad5f78..d5d7595 100644 render=(vdpau_render_state*)pic->data[0]; if(!render) -@@ -1313,6 +811,8 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1313,6 +810,8 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) return; } @@ -5525,7 +3735,7 @@ index 3ad5f78..d5d7595 100644 for(i=0; i<4; i++) pic->data[i]= NULL; -@@ -1326,29 +826,26 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1326,29 +825,26 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) render->state &= ~FF_VDPAU_STATE_USED_FOR_REFERENCE; } @@ -5564,7 +3774,7 @@ index 3ad5f78..d5d7595 100644 if(src->linesize[0] || src->linesize[1] || src->linesize[2] || offset[0] || offset[1] || offset[2]) -@@ -1378,59 +875,41 @@ void CVDPAU::FFDrawSlice(struct AVCodecContext *s, +@@ -1378,67 +874,50 @@ void CVDPAU::FFDrawSlice(struct AVCodecContext *s, if(s->codec_id == AV_CODEC_ID_H264) max_refs = vdp->m_hwContext.info.h264.num_ref_frames; @@ -5639,9 +3849,10 @@ index 3ad5f78..d5d7595 100644 if(pFrame) { // we have a new frame from decoder -@@ -1438,7 +917,10 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) - if(!render) // old style ffmpeg gave data on plane 0 - render = (vdpau_render_state*)pFrame->data[0]; +- vdpau_render_state * render = (vdpau_render_state*)pFrame->data[2]; +- if(!render) // old style ffmpeg gave data on plane 0 +- render = (vdpau_render_state*)pFrame->data[0]; ++ vdpau_render_state * render = (vdpau_render_state*)pFrame->data[0]; if(!render) + { + CLog::Log(LOGERROR, "CVDPAU::Decode: no valid frame"); @@ -5650,7 +3861,7 @@ index 3ad5f78..d5d7595 100644 // ffmpeg vc-1 decoder does not flush, make sure the data buffer is still valid if (!IsSurfaceValid(render)) -@@ -1447,258 +929,166 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -1447,258 +926,166 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) return VC_BUFFER; } @@ -5698,11 +3909,11 @@ index 3ad5f78..d5d7595 100644 } + msg->Release(); + } ++ ++ m_bufferStats.Get(decoded, processed, render); - if (mode == VS_DEINTERLACEMODE_FORCE - || (mode == VS_DEINTERLACEMODE_AUTO && m_DVDVideoPics.front().iFlags & DVP_FLAG_INTERLACED)) -+ m_bufferStats.Get(decoded, processed, render); -+ + uint64_t startTime = CurrentHostCounter(); + while (!retval) + { @@ -5925,14 +4136,14 @@ index 3ad5f78..d5d7595 100644 - if (m_DisplayState != VDPAU_OPEN) - return false; - } -- ++ CSingleLock lock(m_DecoderSection); + - *picture = m_DVDVideoPics.front(); - // if this is the first field of an interlaced frame, we'll need - // this same picture for the second field later - if (m_mixerstep != 1) - m_DVDVideoPics.pop(); -+ CSingleLock lock(m_DecoderSection); - +- - picture->format = RENDER_FMT_VDPAU; - picture->iFlags &= DVP_FLAG_DROPPED; - picture->iWidth = OutWidth; @@ -6019,7 +4230,7 @@ index 3ad5f78..d5d7595 100644 if(m_DisplayState == VDPAU_OPEN) { -@@ -1716,4 +1106,2424 @@ bool CVDPAU::CheckStatus(VdpStatus vdp_st, int line) +@@ -1716,4 +1103,2424 @@ bool CVDPAU::CheckStatus(VdpStatus vdp_st, int line) return false; } @@ -8445,7 +6656,7 @@ index 3ad5f78..d5d7595 100644 + #endif diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -index 70f8097..86ffe6f 100644 +index 87e8797..5bee48b 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h @@ -1,5 +1,3 @@ @@ -8488,7 +6699,7 @@ index 70f8097..86ffe6f 100644 #include #include #define GLX_GLXEXT_PROTOTYPES -@@ -37,122 +58,31 @@ +@@ -37,124 +58,31 @@ #include "settings/VideoSettings.h" #include "guilib/DispResource.h" #include "threads/Event.h" @@ -8533,6 +6744,8 @@ index 70f8097..86ffe6f 100644 - - virtual const std::string Name() { return "vdpau"; } - +- virtual unsigned GetAllowedReferences() { return 2; /* this is a lie, we can only do one, but we block on decode to get the surface */ } +- - bool MakePixmap(int width, int height); - bool MakePixmapGL(); - @@ -8629,7 +6842,7 @@ index 70f8097..86ffe6f 100644 VdpOutputSurfacePutBitsYCbCr * vdp_output_surface_put_bits_y_cb_cr; VdpOutputSurfacePutBitsNative * vdp_output_surface_put_bits_native; -@@ -162,15 +92,15 @@ class CVDPAU +@@ -164,15 +92,15 @@ class CVDPAU VdpOutputSurfaceRenderOutputSurface * vdp_output_surface_render_output_surface; VdpOutputSurfacePutBitsIndexed * vdp_output_surface_put_bits_indexed; @@ -8653,7 +6866,7 @@ index 70f8097..86ffe6f 100644 VdpPresentationQueueTargetDestroy * vdp_presentation_queue_target_destroy; VdpPresentationQueueCreate * vdp_presentation_queue_create; -@@ -183,65 +113,463 @@ class CVDPAU +@@ -185,65 +113,464 @@ class CVDPAU VdpGetErrorString * vdp_get_error_string; @@ -8672,20 +6885,24 @@ index 70f8097..86ffe6f 100644 - VdpOutputSurface outputSurface; - VdpOutputSurface presentSurface; +}; ++ ++//----------------------------------------------------------------------------- ++// VDPAU data structs ++//----------------------------------------------------------------------------- - VdpDecoder decoder; - VdpVideoMixer videoMixer; - VdpRect outRect; - VdpRect outRectVid; -+//----------------------------------------------------------------------------- -+// VDPAU data structs -+//----------------------------------------------------------------------------- ++class CDecoder; - static void* dl_handle; - VdpStatus (*dl_vdp_device_create_x11)(Display* display, int screen, VdpDevice* device, VdpGetProcAddress **get_proc_address); - VdpStatus (*dl_vdp_get_proc_address)(VdpDevice device, VdpFuncId function_id, void** function_pointer); - VdpStatus (*dl_vdp_preemption_callback_register)(VdpDevice device, VdpPreemptionCallback callback, void* context); -+class CDecoder; ++/** ++ * Buffer statistics used to control number of frames in queue ++ */ - int surfaceNum; - int presentSurfaceNum; @@ -8696,10 +6913,6 @@ index 70f8097..86ffe6f 100644 - Display* m_Display; - bool vdpauConfigured; - uint32_t *m_BlackBar; -+/** -+ * Buffer statistics used to control number of frames in queue -+ */ - +class CVdpauBufferStats +{ +public: @@ -8728,13 +6941,13 @@ index 70f8097..86ffe6f 100644 +private: + CCriticalSection m_sec; +}; - ++ +/** + * CVdpauConfig holds all configuration parameters needed by vdpau + * The structure is sent to the internal classes CMixer and COutput + * for init. + */ -+ + +struct CVdpauConfig +{ + int surfaceWidth; @@ -8841,7 +7054,7 @@ index 70f8097..86ffe6f 100644 + PICTURE, + }; +}; -+ + +/** + * Embeds the vdpau video mixer + * Embedded by COutput class, gets decoded frames from COutput, processes @@ -9098,6 +7311,7 @@ index 70f8097..86ffe6f 100644 + virtual void Close(); + virtual long Release(); + virtual bool CanSkipDeint(); ++ virtual unsigned GetAllowedReferences() { return 5; } + + virtual int Check(AVCodecContext* avctx); + virtual const std::string Name() { return "vdpau"; } @@ -9157,7 +7371,7 @@ index 70f8097..86ffe6f 100644 // OnLostDevice triggers transition from all states to LOST // internal errors trigger transition from OPEN to RESET -@@ -252,9 +580,25 @@ class CVDPAU +@@ -254,9 +581,25 @@ class CVDPAU , VDPAU_LOST , VDPAU_ERROR } m_DisplayState; @@ -9188,25 +7402,22 @@ index 70f8097..86ffe6f 100644 + +} diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index c7c6797..f248833 100644 +index 56b32b9..3c30d0b 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1159,6 +1159,10 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - formatstr = "VDPAU"; - buffering = true; - break; -+ case RENDER_FMT_VDPAU_420: -+ formatstr = "VDPAU_420"; -+ buffering = true; -+ break; - case RENDER_FMT_DXVA: - formatstr = "DXVA"; - buffering = true; +@@ -1009,6 +1009,7 @@ static std::string GetRenderFormatName(ERenderFormat format) + case RENDER_FMT_UYVY422: return "UYVY"; + case RENDER_FMT_YUYV422: return "YUY2"; + case RENDER_FMT_VDPAU: return "VDPAU"; ++ case RENDER_FMT_VDPAU_420: return "VDPAU_420"; + case RENDER_FMT_DXVA: return "DXVA"; + case RENDER_FMT_VAAPI: return "VAAPI"; + case RENDER_FMT_OMXEGL: return "OMXEGL"; diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 95a4451..1185caf 100644 +index 3189ad9..d3206e5 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -153,7 +153,7 @@ void CAdvancedSettings::Initialize() +@@ -161,7 +161,7 @@ void CAdvancedSettings::Initialize() m_videoIgnoreSecondsAtStart = 3*60; m_videoIgnorePercentAtEnd = 8.0f; m_videoPlayCountMinimumPercent = 90.0f; @@ -9215,7 +7426,7 @@ index 95a4451..1185caf 100644 m_videoNonLinStretchRatio = 0.5f; m_videoEnableHighQualityHwScalers = false; m_videoAutoScaleMaxFps = 30.0f; -@@ -161,6 +161,8 @@ void CAdvancedSettings::Initialize() +@@ -169,6 +169,8 @@ void CAdvancedSettings::Initialize() m_videoAllowMpeg4VAAPI = false; m_videoDisableBackgroundDeinterlace = false; m_videoCaptureUseOcclusionQuery = -1; //-1 is auto detect @@ -9224,7 +7435,7 @@ index 95a4451..1185caf 100644 m_DXVACheckCompatibility = false; m_DXVACheckCompatibilityPresent = false; m_DXVAForceProcessorRenderer = true; -@@ -564,7 +566,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -573,7 +575,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetString(pElement,"cleandatetime", m_videoCleanDateTimeRegExp); XMLUtils::GetString(pElement,"ppffmpegdeinterlacing",m_videoPPFFmpegDeint); XMLUtils::GetString(pElement,"ppffmpegpostprocessing",m_videoPPFFmpegPostProc); @@ -9233,7 +7444,7 @@ index 95a4451..1185caf 100644 XMLUtils::GetFloat(pElement, "nonlinearstretchratio", m_videoNonLinStretchRatio, 0.01f, 1.0f); XMLUtils::GetBoolean(pElement,"enablehighqualityhwscalers", m_videoEnableHighQualityHwScalers); XMLUtils::GetFloat(pElement,"autoscalemaxfps",m_videoAutoScaleMaxFps, 0.0f, 1000.0f); -@@ -573,6 +575,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -582,6 +584,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetBoolean(pElement,"allowmpeg4vaapi",m_videoAllowMpeg4VAAPI); XMLUtils::GetBoolean(pElement, "disablebackgrounddeinterlace", m_videoDisableBackgroundDeinterlace); XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1); @@ -9243,10 +7454,10 @@ index 95a4451..1185caf 100644 TiXmlElement* pAdjustRefreshrate = pElement->FirstChildElement("adjustrefreshrate"); if (pAdjustRefreshrate) diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index c810074..060862b 100644 +index dc0c854..d41cbcf 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h -@@ -146,6 +146,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler +@@ -147,6 +147,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler int m_videoPercentSeekBackwardBig; CStdString m_videoPPFFmpegDeint; CStdString m_videoPPFFmpegPostProc; @@ -9255,7 +7466,7 @@ index c810074..060862b 100644 bool m_musicUseTimeSeeking; int m_musicTimeSeekForward; int m_musicTimeSeekBackward; -@@ -161,7 +163,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler +@@ -162,7 +164,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler CStdString m_audioHost; bool m_audioApplyDrc; @@ -9617,10 +7828,10 @@ index 0000000..e7108ac + +} diff --git a/xbmc/utils/Makefile.in b/xbmc/utils/Makefile.in -index 529be0e..5a97638 100644 +index 694a9bd..1b69c56 100644 --- a/xbmc/utils/Makefile.in +++ b/xbmc/utils/Makefile.in -@@ -72,6 +72,7 @@ SRCS += Vector.cpp +@@ -70,6 +70,7 @@ SRCS += Vector.cpp SRCS += Weather.cpp SRCS += XBMCTinyXML.cpp SRCS += XMLUtils.cpp @@ -9657,10 +7868,10 @@ index e425327..3dae22c 100644 1.8.1.6 -From 4041502a2d324caf9efd44e1484b5c3eedb14ccc Mon Sep 17 00:00:00 2001 +From 705746efcbbd587ae1f47fe5ffc941266202b7f0 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 09:52:17 +0100 -Subject: [PATCH 026/119] vdpau: make interop gl default and remove setting, +Subject: [PATCH 013/105] vdpau: make interop gl default and remove setting, rename and intvert interop yuv --- @@ -9669,10 +7880,10 @@ Subject: [PATCH 026/119] vdpau: make interop gl default and remove setting, 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 57c805b..4055b43 100644 +index e6c87e9..d18e34f 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5769,14 +5769,10 @@ msgid "Enable HQ Scalers for scalings above" +@@ -5772,14 +5772,10 @@ msgid "Enable HQ Scalers for scalings above" msgstr "" msgctxt "#13436" @@ -9690,7 +7901,7 @@ index 57c805b..4055b43 100644 #: system/settings/settings.xml msgctxt "#13500" diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index d5d7595..98ff193 100644 +index 000d2cb..63a462d 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -384,12 +384,15 @@ bool CDecoder::Supports(EINTERLACEMETHOD method) @@ -9710,7 +7921,7 @@ index d5d7595..98ff193 100644 for(SInterlaceMapping* p = g_interlace_mapping; p->method != VS_INTERLACEMETHOD_NONE; p++) { if(p->method == method) -@@ -1872,7 +1875,7 @@ void CMixer::SetDeinterlacing() +@@ -1869,7 +1872,7 @@ void CMixer::SetDeinterlacing() SetDeintSkipChroma(); @@ -9719,7 +7930,7 @@ index d5d7595..98ff193 100644 } void CMixer::SetDeintSkipChroma() -@@ -2064,7 +2067,7 @@ void CMixer::Init() +@@ -2061,7 +2064,7 @@ void CMixer::Init() m_vdpError = false; m_config.upscale = g_advancedSettings.m_videoVDPAUScaling; @@ -9728,7 +7939,7 @@ index d5d7595..98ff193 100644 CreateVdpauMixer(); } -@@ -2174,11 +2177,12 @@ void CMixer::InitCycle() +@@ -2171,11 +2174,12 @@ void CMixer::InitCycle() DVP_FLAG_INTERLACED); m_config.useInteropYuv = false; } @@ -9742,7 +7953,7 @@ index d5d7595..98ff193 100644 } else { -@@ -3210,7 +3214,7 @@ bool COutput::GLInit() +@@ -3207,7 +3211,7 @@ bool COutput::GLInit() glVDPAUGetSurfaceivNV = NULL; #endif @@ -9751,7 +7962,7 @@ index d5d7595..98ff193 100644 #ifdef GL_NV_vdpau_interop if (glewIsSupported("GL_NV_vdpau_interop")) -@@ -3242,8 +3246,7 @@ bool COutput::GLInit() +@@ -3239,8 +3243,7 @@ bool COutput::GLInit() #endif { m_config.usePixmaps = true; @@ -9765,10 +7976,10 @@ index d5d7595..98ff193 100644 1.8.1.6 -From a5af1bc990be23e176198f7de164d92ccbec96e2 Mon Sep 17 00:00:00 2001 +From a6e4f2d43298810d5919332bbe1000302f36d0a3 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 18:34:47 +0100 -Subject: [PATCH 027/119] vdpau: drop studio level conversion +Subject: [PATCH 014/105] vdpau: drop studio level conversion --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 4 +- @@ -9776,10 +7987,10 @@ Subject: [PATCH 027/119] vdpau: drop studio level conversion 2 files changed, 6 insertions(+), 92 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 6593418..895b5c1 100644 +index 88c7e5f..a904572 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -3360,7 +3360,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3314,7 +3314,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) { if(feature == RENDERFEATURE_BRIGHTNESS) { @@ -9788,7 +7999,7 @@ index 6593418..895b5c1 100644 return true; if (m_renderMethod & RENDER_VAAPI) -@@ -3373,7 +3373,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3327,7 +3327,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if(feature == RENDERFEATURE_CONTRAST) { @@ -9798,7 +8009,7 @@ index 6593418..895b5c1 100644 if (m_renderMethod & RENDER_VAAPI) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 98ff193..70c6a9c 100644 +index 63a462d..2a6d64d 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -58,15 +58,6 @@ @@ -9817,7 +8028,7 @@ index 98ff193..70c6a9c 100644 static struct SInterlaceMapping { const EINTERLACEMETHOD method; -@@ -1639,74 +1630,6 @@ void CMixer::PostProcOff() +@@ -1636,74 +1627,6 @@ void CMixer::PostProcOff() DisableHQScaling(); } @@ -9892,7 +8103,7 @@ index 98ff193..70c6a9c 100644 void CMixer::SetColor() { VdpStatus vdp_st; -@@ -1726,19 +1649,10 @@ void CMixer::SetColor() +@@ -1723,19 +1646,10 @@ void CMixer::SetColor() //vdp_st = vdp_generate_csc_matrix(&m_Procamp, VDP_COLOR_STANDARD_ITUR_BT_601, &m_CSCMatrix); VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; @@ -9920,10 +8131,10 @@ index 98ff193..70c6a9c 100644 1.8.1.6 -From 446fde01e3e8a6bdc6bb4b9a5e7109624a5035fa Mon Sep 17 00:00:00 2001 +From 038d9cdeb2b568ffbe070fee621d36a0e6379893 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 20:28:49 +0100 -Subject: [PATCH 028/119] vdpau: observe ffmpeg tags for color space +Subject: [PATCH 015/105] vdpau: observe ffmpeg tags for color space --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 38 ++++++++++++++++++-------- @@ -9931,10 +8142,10 @@ Subject: [PATCH 028/119] vdpau: observe ffmpeg tags for color space 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 70c6a9c..125244a 100644 +index 2a6d64d..b565e4a 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -932,6 +932,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -929,6 +929,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); pic.render = render; @@ -9942,7 +8153,7 @@ index 70c6a9c..125244a 100644 m_bufferStats.IncDecoded(); m_vdpauOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); -@@ -1538,10 +1539,6 @@ void CMixer::InitCSCMatrix(int Width) +@@ -1535,10 +1536,6 @@ void CMixer::InitCSCMatrix(int Width) m_Procamp.contrast = 1.0; m_Procamp.saturation = 1.0; m_Procamp.hue = 0; @@ -9953,7 +8164,7 @@ index 70c6a9c..125244a 100644 } void CMixer::CheckFeatures() -@@ -1552,11 +1549,13 @@ void CMixer::CheckFeatures() +@@ -1549,11 +1546,13 @@ void CMixer::CheckFeatures() m_Upscale = m_config.upscale; } if (m_Brightness != CMediaSettings::Get().GetCurrentVideoSettings().m_Brightness || @@ -9968,7 +8179,7 @@ index 70c6a9c..125244a 100644 } if (m_NoiseReduction != CMediaSettings::Get().GetCurrentVideoSettings().m_NoiseReduction) { -@@ -1640,13 +1639,27 @@ void CMixer::SetColor() +@@ -1637,13 +1636,27 @@ void CMixer::SetColor() m_Procamp.contrast = (float)((CMediaSettings::Get().GetCurrentVideoSettings().m_Contrast)+50) / 100; VdpColorStandard colorStandard; @@ -10003,7 +8214,7 @@ index 70c6a9c..125244a 100644 VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -@@ -1977,6 +1990,7 @@ void CMixer::Init() +@@ -1974,6 +1987,7 @@ void CMixer::Init() m_Sharpness = 0.0; m_DeintMode = 0; m_Deint = 0; @@ -10012,7 +8223,7 @@ index 70c6a9c..125244a 100644 m_vdpError = false; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -index 86ffe6f..d304254 100644 +index 5bee48b..ef99383 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h @@ -334,6 +334,7 @@ class CMixer : private CThread @@ -10027,20 +8238,20 @@ index 86ffe6f..d304254 100644 1.8.1.6 -From 8894dfa34d4e826aab0b3c0591d185f52d74ee95 Mon Sep 17 00:00:00 2001 +From 470140a62a85cbb0b06ddde88223a612a1195eb8 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 27 Jan 2013 12:10:19 +0100 -Subject: [PATCH 029/119] vdpau: switch off de-interlacing on ff +Subject: [PATCH 016/105] vdpau: switch off de-interlacing on ff --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 125244a..feb7d8e 100644 +index b565e4a..a21d436 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2068,8 +2068,9 @@ void CMixer::InitCycle() +@@ -2065,8 +2065,9 @@ void CMixer::InitCycle() EINTERLACEMETHOD method = GetDeinterlacingMethod(); bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED; @@ -10056,18 +8267,18 @@ index 125244a..feb7d8e 100644 1.8.1.6 -From 7d58534876ef8c07b986cf35fd98613bc25f2345 Mon Sep 17 00:00:00 2001 +From 1a39dd0932221c8bba1d135c43fdfd5c3a8c6375 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 2 Feb 2013 13:17:09 +0100 -Subject: [PATCH 030/119] vdpau: fix mp4 part2 decoding, activate by default +Subject: [PATCH 017/105] vdpau: fix mp4 part2 decoding, activate by default --- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 4 +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3 +-- xbmc/settings/AdvancedSettings.cpp | 2 +- - 2 files changed, 2 insertions(+), 4 deletions(-) + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index feb7d8e..b345d96 100644 +index a21d436..fe00c40 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -131,10 +131,9 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int @@ -10082,19 +8293,11 @@ index feb7d8e..b345d96 100644 if(profile) { if (!CDVDCodecUtils::IsVP3CompatibleWidth(avctx->coded_width)) -@@ -553,7 +552,6 @@ void CDecoder::ReadFormatOf( AVCodecID codec - vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; - vdp_chroma_type = VDP_CHROMA_TYPE_420; - break; --#endif - default: - vdp_decoder_profile = 0; - vdp_chroma_type = 0; diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 1185caf..b8c4ad7 100644 +index d3206e5..55c1b49 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -157,7 +157,7 @@ void CAdvancedSettings::Initialize() +@@ -165,7 +165,7 @@ void CAdvancedSettings::Initialize() m_videoNonLinStretchRatio = 0.5f; m_videoEnableHighQualityHwScalers = false; m_videoAutoScaleMaxFps = 30.0f; @@ -10107,10 +8310,10 @@ index 1185caf..b8c4ad7 100644 1.8.1.6 -From 022ca6d4f9ea585f65379dde2ce0b6befea1c0ce Mon Sep 17 00:00:00 2001 +From a386dd00b3dd3b8aa91fdc8f289017a059295a00 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 2 Mar 2013 15:19:19 +0100 -Subject: [PATCH 031/119] vdpau: re-add limited range conversion +Subject: [PATCH 018/105] vdpau: re-add limited range conversion --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 4 +- @@ -10118,10 +8321,10 @@ Subject: [PATCH 031/119] vdpau: re-add limited range conversion 2 files changed, 85 insertions(+), 5 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 895b5c1..6593418 100644 +index a904572..88c7e5f 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -3360,7 +3360,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3314,7 +3314,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) { if(feature == RENDERFEATURE_BRIGHTNESS) { @@ -10130,7 +8333,7 @@ index 895b5c1..6593418 100644 return true; if (m_renderMethod & RENDER_VAAPI) -@@ -3373,7 +3373,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3327,7 +3327,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if(feature == RENDERFEATURE_CONTRAST) { @@ -10140,7 +8343,7 @@ index 895b5c1..6593418 100644 if (m_renderMethod & RENDER_VAAPI) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index b345d96..71fc431 100644 +index fe00c40..1c32ecb 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -71,6 +71,9 @@ @@ -10153,7 +8356,7 @@ index b345d96..71fc431 100644 //since libvdpau 0.4, vdp_device_create_x11() installs a callback on the Display*, //if we unload libvdpau with dlclose(), we segfault on XCloseDisplay, //so we just keep a static handle to libvdpau around -@@ -1627,6 +1630,73 @@ void CMixer::PostProcOff() +@@ -1625,6 +1628,73 @@ void CMixer::PostProcOff() DisableHQScaling(); } @@ -10227,7 +8430,7 @@ index b345d96..71fc431 100644 void CMixer::SetColor() { VdpStatus vdp_st; -@@ -1660,9 +1730,19 @@ void CMixer::SetColor() +@@ -1658,9 +1728,19 @@ void CMixer::SetColor() } VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; @@ -10254,10 +8457,10 @@ index b345d96..71fc431 100644 1.8.1.6 -From 9d9cc10035bc8ad076e44e670b37b8d6ed022adc Mon Sep 17 00:00:00 2001 +From 1e90ddaf59b68c0074169e93e2d96982ccd798be Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 25 Sep 2012 12:14:15 +0200 -Subject: [PATCH 032/119] linuxrenderer: drop method RenderMultiPass +Subject: [PATCH 019/105] linuxrenderer: drop method RenderMultiPass --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 9 ++------- @@ -10265,10 +8468,10 @@ Subject: [PATCH 032/119] linuxrenderer: drop method RenderMultiPass 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 6593418..fe3a8f5 100644 +index 88c7e5f..3a2278d 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -1221,7 +1221,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1195,7 +1195,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) break; case RQ_MULTIPASS: @@ -10278,7 +8481,7 @@ index 6593418..fe3a8f5 100644 VerifyGLState(); break; } -@@ -1344,12 +1345,6 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) +@@ -1327,12 +1328,6 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) VerifyGLState(); } @@ -10292,10 +8495,10 @@ index 6593418..fe3a8f5 100644 { YUVPLANES &planes = m_buffers[index].fields[field]; diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index 0b91257..cca2659 100644 +index d72eb64..6b9046d 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -217,7 +217,6 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -218,7 +218,6 @@ class CLinuxRendererGL : public CBaseRenderer void CalculateTextureSourceRects(int source, int num_planes); // renderers @@ -10307,10 +8510,10 @@ index 0b91257..cca2659 100644 1.8.1.6 -From b806e7b77e537187540e7ff97c538a1473817f8c Mon Sep 17 00:00:00 2001 +From 8d13740c9ab4650f41b88b8fa81c02967757bdbb Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 25 Sep 2012 13:20:47 +0200 -Subject: [PATCH 033/119] linuxrenderer: implement progressive weave for vdpau +Subject: [PATCH 020/105] linuxrenderer: implement progressive weave for vdpau --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 55 +++++++++++++++++++-------- @@ -10318,10 +8521,10 @@ Subject: [PATCH 033/119] linuxrenderer: implement progressive weave for vdpau 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index fe3a8f5..c3aef83 100644 +index 3a2278d..3d9f22a 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -705,18 +705,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -679,18 +679,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) glDisable(GL_POLYGON_STIPPLE); } @@ -10340,7 +8543,7 @@ index fe3a8f5..c3aef83 100644 else Render(flags, index); -@@ -1216,13 +1204,21 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1190,13 +1178,21 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) { case RQ_LOW: case RQ_SINGLEPASS: @@ -10365,7 +8568,7 @@ index fe3a8f5..c3aef83 100644 VerifyGLState(); break; } -@@ -1345,7 +1341,7 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) +@@ -1328,7 +1324,7 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) VerifyGLState(); } @@ -10374,7 +8577,7 @@ index fe3a8f5..c3aef83 100644 { YUVPLANES &planes = m_buffers[index].fields[field]; -@@ -1447,6 +1443,8 @@ void CLinuxRendererGL::RenderToFBO(int index, int field) +@@ -1430,6 +1426,8 @@ void CLinuxRendererGL::RenderToFBO(int index, int field) } m_fbo.width *= planes[0].pixpertex_x; m_fbo.height *= planes[0].pixpertex_y; @@ -10383,7 +8586,7 @@ index fe3a8f5..c3aef83 100644 // 1st Pass to video frame size glBegin(GL_QUADS); -@@ -1565,6 +1563,31 @@ void CLinuxRendererGL::RenderFromFBO() +@@ -1548,6 +1546,31 @@ void CLinuxRendererGL::RenderFromFBO() VerifyGLState(); } @@ -10416,10 +8619,10 @@ index fe3a8f5..c3aef83 100644 { #ifdef HAVE_LIBVDPAU diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index cca2659..bc9c2c0 100644 +index 6b9046d..4494eca 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -217,12 +217,12 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -218,12 +218,12 @@ class CLinuxRendererGL : public CBaseRenderer void CalculateTextureSourceRects(int source, int num_planes); // renderers @@ -10438,17 +8641,17 @@ index cca2659..bc9c2c0 100644 1.8.1.6 -From 83f78b0ef7017560f37fe4d684a9118b902d942b Mon Sep 17 00:00:00 2001 +From 04aab92691bdfa7a8176e0e2ef51d5ca8cad40db Mon Sep 17 00:00:00 2001 From: fritsch Date: Thu, 28 Mar 2013 10:38:37 +0100 -Subject: [PATCH 034/119] VDPAU: silence compiler warnings +Subject: [PATCH 021/105] VDPAU: silence compiler warnings --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 71fc431..3d986b1 100644 +index 1c32ecb..d651be9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -252,7 +252,7 @@ long CDecoder::Release() @@ -10460,7 +8663,7 @@ index 71fc431..3d986b1 100644 } long CDecoder::ReleasePicReference() -@@ -1428,8 +1428,8 @@ void CMixer::StateMachine(int signal, Protocol *port, Message *msg) +@@ -1426,8 +1426,8 @@ void CMixer::StateMachine(int signal, Protocol *port, Message *msg) void CMixer::Process() { @@ -10471,7 +8674,7 @@ index 71fc431..3d986b1 100644 bool gotMsg; m_state = M_TOP_UNCONFIGURED; -@@ -1534,7 +1534,6 @@ void CMixer::CreateVdpauMixer() +@@ -1532,7 +1532,6 @@ void CMixer::CreateVdpauMixer() void CMixer::InitCSCMatrix(int Width) { @@ -10479,7 +8682,7 @@ index 71fc431..3d986b1 100644 m_Procamp.struct_version = VDP_PROCAMP_VERSION; m_Procamp.brightness = 0.0; m_Procamp.contrast = 1.0; -@@ -2665,8 +2664,8 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) +@@ -2663,8 +2662,8 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) void COutput::Process() { @@ -10490,7 +8693,7 @@ index 71fc431..3d986b1 100644 bool gotMsg; m_state = O_TOP_UNCONFIGURED; -@@ -2877,7 +2876,6 @@ CVdpauRenderPicture* COutput::ProcessMixerPicture() +@@ -2875,7 +2874,6 @@ CVdpauRenderPicture* COutput::ProcessMixerPicture() pixmap->DVDPic = pic.DVDPic; pixmap->id = i; m_bufferPool.notVisiblePixmaps.push_back(pixmap); @@ -10498,7 +8701,7 @@ index 71fc431..3d986b1 100644 m_config.vdpProcs.vdp_presentation_queue_display(pixmap->vdp_flip_queue, pixmap->surface,0,0,0); } -@@ -3035,7 +3033,7 @@ bool COutput::EnsureBufferPool() +@@ -3033,7 +3031,7 @@ bool COutput::EnsureBufferPool() { // create pixmpas VdpauBufferPool::Pixmaps pixmap; @@ -10507,7 +8710,7 @@ index 71fc431..3d986b1 100644 for (unsigned int i = 0; i < numPixmaps; i++) { pixmap.pixmap = None; -@@ -3289,7 +3287,7 @@ void COutput::GLMapSurfaces() +@@ -3287,7 +3285,7 @@ void COutput::GLMapSurfaces() if (m_config.videoSurfaces->size() != m_bufferPool.glVideoSurfaceMap.size()) { CSingleLock lock(*m_config.videoSurfaceSec); @@ -10516,7 +8719,7 @@ index 71fc431..3d986b1 100644 { if ((*m_config.videoSurfaces)[i]->surface == VDP_INVALID_HANDLE) continue; -@@ -3337,7 +3335,7 @@ void COutput::GLMapSurfaces() +@@ -3335,7 +3333,7 @@ void COutput::GLMapSurfaces() if (m_bufferPool.glOutputSurfaceMap.size() != m_bufferPool.numOutputSurfaces) { VdpauBufferPool::GLVideoSurface glSurface; @@ -10525,7 +8728,7 @@ index 71fc431..3d986b1 100644 { glSurface.sourceRgb = m_bufferPool.outputSurfaces[i]; glGenTextures(1, glSurface.texture); -@@ -3461,7 +3459,6 @@ bool COutput::CheckStatus(VdpStatus vdp_st, int line) +@@ -3459,7 +3457,6 @@ bool COutput::CheckStatus(VdpStatus vdp_st, int line) bool COutput::CreateGlxContext() { GLXContext glContext; @@ -10537,10 +8740,10 @@ index 71fc431..3d986b1 100644 1.8.1.6 -From 8fefdc075783e193ccada09d3e8d2ec5a6debbf2 Mon Sep 17 00:00:00 2001 +From bdcb116aaf97de94383de3ef56e29d24eb8b5ea2 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 25 Feb 2013 08:47:10 +0100 -Subject: [PATCH 035/119] vdpau: release more resources on pre-cleanup +Subject: [PATCH 022/105] vdpau: release more resources on pre-cleanup --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 72 +++++++++++++++++++++++--- @@ -10548,10 +8751,10 @@ Subject: [PATCH 035/119] vdpau: release more resources on pre-cleanup 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 3d986b1..1ffac51 100644 +index d651be9..624d4aa 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1172,6 +1172,11 @@ void CMixer::Dispose() +@@ -1170,6 +1170,11 @@ void CMixer::Dispose() m_dataPort.Purge(); } @@ -10563,7 +8766,7 @@ index 3d986b1..1ffac51 100644 void CMixer::OnStartup() { CLog::Log(LOGNOTICE, "CMixer::OnStartup: Output Thread created"); -@@ -2561,6 +2566,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) +@@ -2559,6 +2564,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) return; case COutputControlProtocol::PRECLEANUP: Flush(); @@ -10571,7 +8774,7 @@ index 3d986b1..1ffac51 100644 msg->Reply(COutputControlProtocol::ACC); return; default: -@@ -2767,15 +2773,18 @@ bool COutput::Uninit() +@@ -2765,15 +2771,18 @@ bool COutput::Uninit() void COutput::Flush() { @@ -10596,7 +8799,7 @@ index 3d986b1..1ffac51 100644 Message *msg; while (m_mixer.m_dataPort.ReceiveInMessage(&msg)) -@@ -3113,6 +3122,57 @@ void COutput::ReleaseBufferPool() +@@ -3111,6 +3120,57 @@ void COutput::ReleaseBufferPool() } } @@ -10655,7 +8858,7 @@ index 3d986b1..1ffac51 100644 { for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -index d304254..08c90c7 100644 +index ef99383..39047b5 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h @@ -286,6 +286,7 @@ class CMixer : private CThread @@ -10678,10 +8881,10 @@ index d304254..08c90c7 100644 1.8.1.6 -From 734d40c71377b14c33c56d99465201def1a6b619 Mon Sep 17 00:00:00 2001 +From bbbb3011193183da3023f16b73ecaab29919ec4f Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 6 Mar 2013 07:35:10 +0100 -Subject: [PATCH 036/119] vdpau: set deinterlacing method to auto, if default +Subject: [PATCH 023/105] vdpau: set deinterlacing method to auto, if default method not supported --- @@ -10689,10 +8892,10 @@ Subject: [PATCH 036/119] vdpau: set deinterlacing method to auto, if default 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 1ffac51..85161b1 100644 +index 624d4aa..e20a36d 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2197,13 +2197,15 @@ void CMixer::InitCycle() +@@ -2195,13 +2195,15 @@ void CMixer::InitCycle() } else { @@ -10713,10 +8916,10 @@ index 1ffac51..85161b1 100644 1.8.1.6 -From 476bfc2608e9f468b4909d101ec1be1ccf4547a2 Mon Sep 17 00:00:00 2001 +From e5ecba1f99024cbec145c0d16ed88f197ca1da1a Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 21 Apr 2013 09:19:34 +0200 -Subject: [PATCH 037/119] vdpau: fix deadlock if decoder is closed while +Subject: [PATCH 024/105] vdpau: fix deadlock if decoder is closed while refresh rate changes --- @@ -10724,7 +8927,7 @@ Subject: [PATCH 037/119] vdpau: fix deadlock if decoder is closed while 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 85161b1..a8cdd22 100644 +index e20a36d..bb3cfb8 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -183,6 +183,8 @@ void CDecoder::Close() @@ -10754,10 +8957,36 @@ index 85161b1..a8cdd22 100644 1.8.1.6 -From 887b922896618cc506be88a65fae42438bb1af16 Mon Sep 17 00:00:00 2001 +From 766dfea6c5bbd292c25bc399660ad39d44adb2dd Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 1 Jun 2013 11:21:19 +0200 +Subject: [PATCH 025/105] renderer: bump buffers to 5 + +--- + xbmc/cores/VideoRenderers/BaseRenderer.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h +index fe1f577..527ecf1 100644 +--- a/xbmc/cores/VideoRenderers/BaseRenderer.h ++++ b/xbmc/cores/VideoRenderers/BaseRenderer.h +@@ -29,7 +29,7 @@ + + #define MAX_PLANES 3 + #define MAX_FIELDS 3 +-#define NUM_BUFFERS 3 ++#define NUM_BUFFERS 5 + + class CSetting; + +-- +1.8.1.6 + + +From 597129f194ea92e8fa2809098ed2ea4727cd765e Mon Sep 17 00:00:00 2001 From: wsnipex Date: Sun, 4 Nov 2012 14:05:52 +0100 -Subject: [PATCH 038/119] configure: add --enable-pvraddons-with-dependencies +Subject: [PATCH 026/105] configure: add --enable-pvraddons-with-dependencies switch for intree building of PVR Addons --- @@ -10765,7 +8994,7 @@ Subject: [PATCH 038/119] configure: add --enable-pvraddons-with-dependencies 1 file changed, 12 insertions(+) diff --git a/configure.in b/configure.in -index cc5c08f..aaaf994 100644 +index e6658b6..ccf6399 100644 --- a/configure.in +++ b/configure.in @@ -548,6 +548,14 @@ AC_ARG_ENABLE([external-ffmpeg], @@ -10783,7 +9012,7 @@ index cc5c08f..aaaf994 100644 if test "x$host_vendor" != "xapple"; then DEFAULT_COMPILE_FLAGS="-fPIC -DPIC -D_REENTRANT" -@@ -2842,12 +2850,16 @@ XB_CONFIG_MODULE([pvr-addons], [ +@@ -2780,12 +2788,16 @@ XB_CONFIG_MODULE([pvr-addons], [ if test "$USE_EXTERNAL_FFMPEG" = 1; then PVR_EXT_FFMPEG="--enable-external-ffmpeg" fi @@ -10804,10 +9033,10 @@ index cc5c08f..aaaf994 100644 1.8.1.6 -From 0c489ab36f0d4f0f6493707c9a7ad9d12a7215de Mon Sep 17 00:00:00 2001 +From 1992c8989244ccb269cd03ee30f0ff0697b51359 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:41:31 +0200 -Subject: [PATCH 039/119] videoplayer: update frametime, it might change due to +Subject: [PATCH 027/105] videoplayer: update frametime, it might change due to fps detection --- @@ -10815,12 +9044,12 @@ Subject: [PATCH 039/119] videoplayer: update frametime, it might change due to 1 file changed, 2 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index f248833..450f50f 100644 +index 3c30d0b..347e888 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -734,6 +734,8 @@ void CDVDPlayerVideo::Process() - CDVDCodecUtils::FreePicture(pTempYUVPackedPicture); - #endif +@@ -707,6 +707,8 @@ void CDVDPlayerVideo::Process() + + int iResult = OutputPicture(&picture, pts); + frametime = (double)DVD_TIME_BASE/m_fFrameRate; + @@ -10831,10 +9060,10 @@ index f248833..450f50f 100644 1.8.1.6 -From d75afa12e8a69cc900aa84d2a384ce6309bd8c28 Mon Sep 17 00:00:00 2001 +From f423275747e314946c12938de3113aa9f6612f94 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:43:06 +0200 -Subject: [PATCH 040/119] videoplayer: give streams with invalid fps a chance +Subject: [PATCH 028/105] videoplayer: give streams with invalid fps a chance for fps detection --- @@ -10842,10 +9071,10 @@ Subject: [PATCH 040/119] videoplayer: give streams with invalid fps a chance 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 450f50f..132d8ec 100644 +index 347e888..1a17145 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1631,7 +1631,7 @@ void CDVDPlayerVideo::CalcFrameRate() +@@ -1529,7 +1529,7 @@ void CDVDPlayerVideo::CalcFrameRate() double frameduration = m_pullupCorrection.GetFrameDuration(); if (frameduration == DVD_NOPTS_VALUE || @@ -10858,10 +9087,10 @@ index 450f50f..132d8ec 100644 1.8.1.6 -From 21a353b482921c3e1120281860f04d3d57def55f Mon Sep 17 00:00:00 2001 +From 27549dcb7a903e9e9b36768db6250530f3a57dd3 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:49:05 +0200 -Subject: [PATCH 041/119] dvdplayer: allow rewinding at end of stream, do a +Subject: [PATCH 029/105] dvdplayer: allow rewinding at end of stream, do a seek after rewind --- @@ -10869,10 +9098,10 @@ Subject: [PATCH 041/119] dvdplayer: allow rewinding at end of stream, do a 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 4ab4057..d6bb85b 100644 +index 22bc1e8..fefb6f9 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1561,7 +1561,7 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1555,7 +1555,7 @@ void CDVDPlayer::HandlePlaySpeed() } else if (m_CurrentVideo.id >= 0 @@ -10881,7 +9110,7 @@ index 4ab4057..d6bb85b 100644 && m_SpeedState.lastpts != m_dvdPlayerVideo.GetCurrentPts() && m_SpeedState.lasttime != GetTime()) { -@@ -2227,6 +2227,12 @@ void CDVDPlayer::HandleMessages() +@@ -2221,6 +2221,12 @@ void CDVDPlayer::HandleMessages() pvrinputstream->Pause( speed == 0 ); } @@ -10898,10 +9127,10 @@ index 4ab4057..d6bb85b 100644 1.8.1.6 -From 93fa6ce5b5b4062e5d744e76aa48423d22dde9ab Mon Sep 17 00:00:00 2001 +From 705294ff0e4ec9ca302255f3535ae30d38758ea3 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:22:05 +0200 -Subject: [PATCH 042/119] X11: ditch SDL for video and window events +Subject: [PATCH 030/105] X11: ditch SDL for video and window events --- xbmc/Application.cpp | 2 +- @@ -10917,10 +9146,10 @@ Subject: [PATCH 042/119] X11: ditch SDL for video and window events create mode 100644 xbmc/windowing/WinEventsX11.h diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index f5a6f5e..5a56954 100644 +index 39182fc..d052473 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -832,7 +832,7 @@ bool CApplication::CreateGUI() +@@ -828,7 +828,7 @@ bool CApplication::CreateGUI() uint32_t sdlFlags = 0; @@ -10930,10 +9159,10 @@ index f5a6f5e..5a56954 100644 #endif diff --git a/xbmc/system.h b/xbmc/system.h -index 1bd0c98..a291a59 100644 +index 3fadcc4..bf7d378 100644 --- a/xbmc/system.h +++ b/xbmc/system.h -@@ -164,16 +164,21 @@ +@@ -171,16 +171,21 @@ #define HAS_GL #ifdef HAVE_X11 #define HAS_GLX @@ -12385,10 +10614,10 @@ index 3dae22c..25faaef 100644 1.8.1.6 -From f1967e4773b0a8e88f414ac3a3aab753561a2694 Mon Sep 17 00:00:00 2001 +From 6274671f6f3a8bcbf4a469720eb3e62a37c981a5 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:24:22 +0200 -Subject: [PATCH 043/119] X11: Add xbmc icon +Subject: [PATCH 031/105] X11: Add xbmc icon --- xbmc/windowing/X11/WinSystemX11.cpp | 126 +++++++++++++++++++++++++++++++++++- @@ -12577,10 +10806,10 @@ index 25faaef..c1e6cf1 100644 1.8.1.6 -From 29da3ebb266c0e113262fb97e64d1b3035190a42 Mon Sep 17 00:00:00 2001 +From c648d79cc836808afa03e2f1117d4d87f96ae528 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 14:11:26 +0200 -Subject: [PATCH 044/119] X11: add SDL joystick until we have a better solution +Subject: [PATCH 032/105] X11: add SDL joystick until we have a better solution --- xbmc/windowing/WinEventsX11.cpp | 26 ++++++++++++++++++++++++++ @@ -12634,10 +10863,10 @@ index 5a8bbb8..5bc1de0 100644 1.8.1.6 -From 5a62a71c274d0583ee812e8f445ab21cdb7ea392 Mon Sep 17 00:00:00 2001 +From a016adb93e353b58669d300224ab20d493625097 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 12:35:55 +0200 -Subject: [PATCH 045/119] X11: factor out code handling device reset +Subject: [PATCH 033/105] X11: factor out code handling device reset notification --- @@ -12701,10 +10930,10 @@ index c1e6cf1..041ea55 100644 1.8.1.6 -From 5a5343c46e6a34ff303d313c2c8d94278a4a63bd Mon Sep 17 00:00:00 2001 +From f99125e0e4ac175c81c3fb73527b9f6dc179cce5 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:02:00 +0200 -Subject: [PATCH 046/119] X11: move xrandr events to WinEventsX11 +Subject: [PATCH 034/105] X11: move xrandr events to WinEventsX11 --- xbmc/windowing/WinEventsX11.cpp | 42 +++++++++++++++++++++++++++++++++++++ @@ -12848,10 +11077,10 @@ index fd51dc0..d495443 100644 1.8.1.6 -From 100c22852da39218c0436903e0bae4e439f41e95 Mon Sep 17 00:00:00 2001 +From d458dda426306558f216e1bee0f5877d753750de Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 12 Apr 2012 15:43:56 +0200 -Subject: [PATCH 047/119] xrandr: remove method RestoreState +Subject: [PATCH 035/105] xrandr: remove method RestoreState --- xbmc/windowing/X11/WinSystemX11.cpp | 13 +++++++++++-- @@ -12885,7 +11114,7 @@ index d495443..d7afc3f 100644 if (m_dpy) diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index 9069436..5b2421a 100644 +index 30c1909..b4c95f8 100644 --- a/xbmc/windowing/X11/XRandR.cpp +++ b/xbmc/windowing/X11/XRandR.cpp @@ -139,25 +139,6 @@ void CXRandR::SaveState() @@ -12930,10 +11159,10 @@ index e3450fe..cf22fbf 100644 1.8.1.6 -From 271ea08a5c08193dee013108078aed594cd81f21 Mon Sep 17 00:00:00 2001 +From cbb8d9a0752516f541fbd93630a5f3ae6de03e27 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 13:17:10 +0200 -Subject: [PATCH 048/119] xrandr: observe orientation +Subject: [PATCH 036/105] xrandr: observe orientation --- xbmc/windowing/X11/WinSystemX11.cpp | 89 ++++++++++++++++++++++++++++++------- @@ -13115,7 +11344,7 @@ index 041ea55..0d4436b 100644 bool m_minimized; bool m_bIgnoreNextFocusMessage; diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index 5b2421a..2204667 100644 +index b4c95f8..e2576b2 100644 --- a/xbmc/windowing/X11/XRandR.cpp +++ b/xbmc/windowing/X11/XRandR.cpp @@ -98,6 +98,13 @@ bool CXRandR::Query(bool force) @@ -13148,10 +11377,10 @@ index cf22fbf..71ffab4 100644 1.8.1.6 -From 0ca07c3901cef4921f8bbc23a1682c50c4d29f65 Mon Sep 17 00:00:00 2001 +From c22d37a26225d66c37e3ce6157caf29da2a59780 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:54:15 +0200 -Subject: [PATCH 049/119] xrandr: allow getting info for multiple screen's +Subject: [PATCH 037/105] xrandr: allow getting info for multiple screen's Refactored by: Joakim Plate --- @@ -13160,7 +11389,7 @@ Refactored by: Joakim Plate 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index 2204667..75c84ea 100644 +index e2576b2..97b1e32 100644 --- a/xbmc/windowing/X11/XRandR.cpp +++ b/xbmc/windowing/X11/XRandR.cpp @@ -39,6 +39,7 @@ @@ -13326,28 +11555,28 @@ index 71ffab4..26c2653 100644 1.8.1.6 -From efa6bc978496ce57d5e2fbba21fc3e3bc276eb2e Mon Sep 17 00:00:00 2001 +From 9b85a1e4902fa6b0eeff0f8067f9686c1f78fa50 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:44:00 +0200 -Subject: [PATCH 050/119] X11: fix multi-head setups +Subject: [PATCH 038/105] X11: fix multi-head setups --- language/English/strings.po | 4 +- - system/settings/settings.xml | 10 ++ + system/settings/settings.xml | 11 ++ xbmc/rendering/gl/RenderSystemGL.h | 1 + - xbmc/settings/DisplaySettings.cpp | 42 +++++- + xbmc/settings/DisplaySettings.cpp | 44 +++++- xbmc/settings/DisplaySettings.h | 2 + xbmc/settings/Settings.cpp | 6 + xbmc/windowing/WinEventsX11.cpp | 7 + xbmc/windowing/X11/WinSystemX11.cpp | 260 +++++++++++++++++++++--------------- xbmc/windowing/X11/WinSystemX11.h | 10 +- - 9 files changed, 225 insertions(+), 117 deletions(-) + 9 files changed, 229 insertions(+), 116 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 4055b43..757a411 100644 +index d18e34f..3029d7e 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -997,7 +997,9 @@ msgctxt "#245" +@@ -1000,7 +1000,9 @@ msgctxt "#245" msgid "Sizing: (%i,%i)->(%i,%i) (Zoom x%2.2f) AR:%2.2f:1 (Pixels: %2.2f:1) (VShift: %2.2f)" msgstr "" @@ -13359,10 +11588,10 @@ index 4055b43..757a411 100644 msgctxt "#247" msgid "Scripts" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 18ce36d..97523b1 100644 +index 15e9a75..9c63476 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -1846,6 +1846,15 @@ +@@ -1841,6 +1841,15 @@
@@ -13378,10 +11607,18 @@ index 18ce36d..97523b1 100644 0 0 -@@ -1866,6 +1875,7 @@ - +@@ -1862,6 +1871,7 @@ -1 + ++ + + + +@@ -1879,6 +1889,7 @@ + -1 + + + @@ -13399,53 +11636,44 @@ index 5c7a288..f3fd4fb 100644 virtual void SetViewPort(CRect& viewPort); virtual void GetViewPort(CRect& viewPort); diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp -index e6ea24a..6da868a 100644 +index 7b77337..6d1c6b1 100644 --- a/xbmc/settings/DisplaySettings.cpp +++ b/xbmc/settings/DisplaySettings.cpp -@@ -198,7 +198,8 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) +@@ -198,13 +198,19 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) + const std::string &settingId = setting->GetId(); if (settingId == "videoscreen.resolution" || - settingId == "videoscreen.screen" || -- settingId == "videoscreen.screenmode") -+ settingId == "videoscreen.screenmode" || +- settingId == "videoscreen.screen") ++ settingId == "videoscreen.screen" || + settingId == "videoscreen.monitor") { - // check if this is the revert call for a failed OnSettingChanging - // in which case we don't want to ask the user again -@@ -212,6 +213,11 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) - newRes = GetResolutionForScreen(); - else if (settingId == "videoscreen.screenmode") - newRes = GetResolutionFromString(((CSettingString*)setting)->GetValue()); -+ else if (settingId == "videoscreen.monitor") -+ { -+ g_Windowing.UpdateResolutions(); -+ newRes = GetResolutionForScreen(); -+ } + RESOLUTION newRes = RES_DESKTOP; + if (settingId == "videoscreen.resolution") + newRes = (RESOLUTION)((CSettingInt*)setting)->GetValue(); + else if (settingId == "videoscreen.screen") + newRes = GetResolutionForScreen(); ++ else if (settingId == "videoscreen.monitor") ++ { ++ g_Windowing.UpdateResolutions(); ++ newRes = GetResolutionForScreen(); ++ } - // We need to change and save videoscreen.screenmode which will - // trigger another call to this OnSettingChanging() which should not -@@ -220,8 +226,10 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) - bool save = settingId != "videoscreen.screenmode"; - if (save) - m_ignoreSettingChanging.insert(make_pair("videoscreen.screenmode", true)); -+ -+ bool outputChanged = !g_Windowing.IsCurrentOutput(CSettings::Get().GetString("videoscreen.monitor")); - SetCurrentResolution(newRes, save); -- g_graphicsContext.SetVideoResolution(newRes); -+ g_graphicsContext.SetVideoResolution(newRes, outputChanged); + string screenmode = GetStringFromResolution(newRes); + CSettings::Get().SetString("videoscreen.screenmode", screenmode); +@@ -215,7 +221,11 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) + RESOLUTION newRes = GetResolutionFromString(((CSettingString*)setting)->GetValue()); - // check if the old or the new resolution was/is windowed - // in which case we don't show any prompt to the user -@@ -245,7 +253,7 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) - m_ignoreSettingChanging.erase(make_pair(settingId, false)); - } + SetCurrentResolution(newRes, false); +- g_graphicsContext.SetVideoResolution(newRes); ++ bool outputChanged = false; ++#if defined(HAS_GLX) ++ outputChanged = !g_Windowing.IsCurrentOutput(CSettings::Get().GetString("videoscreen.monitor")); ++#endif ++ g_graphicsContext.SetVideoResolution(newRes, outputChanged); -- if (settingId == "videoscreen.screen") -+ if (settingId == "videoscreen.screen" || settingId == "videoscreen.monitor") - m_ignoreSettingChanging.insert(make_pair("videoscreen.resolution", true)); - } - else -@@ -577,6 +585,10 @@ void CDisplaySettings::SettingOptionsScreensFiller(const CSetting *setting, std: + // check if the old or the new resolution was/is windowed + // in which case we don't show any prompt to the user +@@ -571,6 +581,10 @@ void CDisplaySettings::SettingOptionsScreensFiller(const CSetting *setting, std: if (g_advancedSettings.m_canWindowed) list.push_back(make_pair(g_localizeStrings.Get(242), DM_WINDOWED)); @@ -13456,7 +11684,7 @@ index e6ea24a..6da868a 100644 for (int idx = 0; idx < g_Windowing.GetNumScreens(); idx++) { int screen = CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP + idx).iScreen; -@@ -592,6 +604,7 @@ void CDisplaySettings::SettingOptionsScreensFiller(const CSetting *setting, std: +@@ -585,6 +599,7 @@ void CDisplaySettings::SettingOptionsScreensFiller(const CSetting *setting, std: RESOLUTION_INFO resInfo = CDisplaySettings::Get().GetResolutionInfo(res); current = resInfo.iScreen; } @@ -13464,13 +11692,14 @@ index e6ea24a..6da868a 100644 } void CDisplaySettings::SettingOptionsVerticalSyncsFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t) -@@ -603,3 +616,26 @@ void CDisplaySettings::SettingOptionsVerticalSyncsFiller(const CSetting *setting +@@ -596,3 +611,28 @@ void CDisplaySettings::SettingOptionsVerticalSyncsFiller(const CSetting *setting list.push_back(make_pair(g_localizeStrings.Get(13107), VSYNC_VIDEO)); list.push_back(make_pair(g_localizeStrings.Get(13108), VSYNC_ALWAYS)); } + +void CDisplaySettings::SettingOptionsMonitorsFiller(const CSetting *setting, std::vector< std::pair > &list, std::string ¤t) +{ ++#if defined(HAS_GLX) + std::vector monitors; + g_Windowing.GetConnectedOutputs(&monitors); + for (unsigned int i=0; i > &list, int ¤t); static void SettingOptionsScreensFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t); static void SettingOptionsVerticalSyncsFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t); @@ -13512,10 +11742,10 @@ index 96d0cb0..2795b9e 100644 protected: CDisplaySettings(); diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index f98cb4d..30e1780 100644 +index 3c8ff5e..fdbc34e 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp -@@ -367,6 +367,7 @@ void CSettings::Uninitialize() +@@ -365,6 +365,7 @@ void CSettings::Uninitialize() m_settingsManager->UnregisterSettingOptionsFiller("rendermethods"); m_settingsManager->UnregisterSettingOptionsFiller("resolutions"); m_settingsManager->UnregisterSettingOptionsFiller("screens"); @@ -13523,7 +11753,7 @@ index f98cb4d..30e1780 100644 m_settingsManager->UnregisterSettingOptionsFiller("shutdownstates"); m_settingsManager->UnregisterSettingOptionsFiller("startupwindows"); m_settingsManager->UnregisterSettingOptionsFiller("streamlanguages"); -@@ -663,6 +664,7 @@ void CSettings::InitializeOptionFillers() +@@ -668,6 +669,7 @@ void CSettings::InitializeOptionFillers() m_settingsManager->RegisterSettingOptionsFiller("rendermethods", CBaseRenderer::SettingOptionsRenderMethodsFiller); m_settingsManager->RegisterSettingOptionsFiller("resolutions", CDisplaySettings::SettingOptionsResolutionsFiller); m_settingsManager->RegisterSettingOptionsFiller("screens", CDisplaySettings::SettingOptionsScreensFiller); @@ -13531,7 +11761,7 @@ index f98cb4d..30e1780 100644 m_settingsManager->RegisterSettingOptionsFiller("shutdownstates", CPowerManager::SettingOptionsShutdownStatesFiller); m_settingsManager->RegisterSettingOptionsFiller("startupwindows", ADDON::CSkinInfo::SettingOptionsStartupWindowsFiller); m_settingsManager->RegisterSettingOptionsFiller("streamlanguages", CLangInfo::SettingOptionsStreamLanguagesFiller); -@@ -690,6 +692,9 @@ void CSettings::InitializeConditions() +@@ -695,6 +697,9 @@ void CSettings::InitializeConditions() #ifdef HAS_GL m_settingsManager->AddCondition("has_gl"); #endif @@ -14097,10 +12327,10 @@ index 0d4436b..0336b3b 100644 1.8.1.6 -From 19f4335efd1fbb1e155110adf80903a90c36fe9c Mon Sep 17 00:00:00 2001 +From 1a640666efd77d03fe2de7d885cb34a6b3525c8f Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:36:32 +0200 -Subject: [PATCH 051/119] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 039/105] X11: remove all DefaultScreen and RootWindow macros --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -14168,10 +12398,10 @@ index 1bea366..cc39720 100644 1.8.1.6 -From 81f1975277eb8edb7a14f67099e34aed34b01748 Mon Sep 17 00:00:00 2001 +From 847808bbcca7c4db170ac22f86063f3951161fd9 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:45:22 +0200 -Subject: [PATCH 052/119] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 040/105] X11: remove all DefaultScreen and RootWindow macros (VideoRefClock) Note this is on a separate display connection. @@ -14180,7 +12410,7 @@ Note this is on a separate display connection. 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xbmc/video/VideoReferenceClock.cpp b/xbmc/video/VideoReferenceClock.cpp -index cc20523..b70af17 100644 +index ca239cf..687e3ff 100644 --- a/xbmc/video/VideoReferenceClock.cpp +++ b/xbmc/video/VideoReferenceClock.cpp @@ -270,7 +270,7 @@ bool CVideoReferenceClock::SetupGLX() @@ -14243,10 +12473,10 @@ index cc20523..b70af17 100644 1.8.1.6 -From dc4c774773571201015f795d08d6830c9bf6f58e Mon Sep 17 00:00:00 2001 +From 325ad5dedac7cfa5e4d2ec1a9163a24834fc466e Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 20 Jun 2012 17:37:11 +0200 -Subject: [PATCH 053/119] X11: recreate gl context after output has changed +Subject: [PATCH 041/105] X11: recreate gl context after output has changed --- xbmc/windowing/X11/WinSystemX11.cpp | 24 ++++++++++++++---------- @@ -14397,10 +12627,10 @@ index cc39720..dda7b14 100644 1.8.1.6 -From 0b0fc11aea1e2318ad738541d11f711e8e775652 Mon Sep 17 00:00:00 2001 +From 937bd9f84d402e517b8f683841571b352a4d1733 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:06:25 +0200 -Subject: [PATCH 054/119] X11: hook video reference clock in windowing +Subject: [PATCH 042/105] X11: hook video reference clock in windowing --- xbmc/video/VideoReferenceClock.cpp | 71 +++++++++++++++++++++++++++----------- @@ -14408,7 +12638,7 @@ Subject: [PATCH 054/119] X11: hook video reference clock in windowing 2 files changed, 63 insertions(+), 21 deletions(-) diff --git a/xbmc/video/VideoReferenceClock.cpp b/xbmc/video/VideoReferenceClock.cpp -index b70af17..9b217d4 100644 +index 687e3ff..4287e8f 100644 --- a/xbmc/video/VideoReferenceClock.cpp +++ b/xbmc/video/VideoReferenceClock.cpp @@ -135,12 +135,23 @@ @@ -14461,11 +12691,11 @@ index b70af17..9b217d4 100644 + } + m_xrrEvent = false; + } - #elif defined(_WIN32) && defined(HAS_DX) + #elif defined(TARGET_WINDOWS) && defined(HAS_DX) CleanupD3D(); #elif defined(TARGET_DARWIN) @@ -222,6 +247,9 @@ void CVideoReferenceClock::Process() - #if defined(_WIN32) && defined(HAS_DX) + #if defined(TARGET_WINDOWS) && defined(HAS_DX) g_Windowing.Unregister(&m_D3dCallback); #endif +#if defined(HAS_GLX) @@ -14554,7 +12784,7 @@ index b70af17..9b217d4 100644 //the refreshrate can be wrong on nvidia drivers, so read it from nvidia-settings when it's available diff --git a/xbmc/video/VideoReferenceClock.h b/xbmc/video/VideoReferenceClock.h -index ace9bf5..5db85e5 100644 +index 1791570..bcabc9f 100644 --- a/xbmc/video/VideoReferenceClock.h +++ b/xbmc/video/VideoReferenceClock.h @@ -30,6 +30,7 @@ @@ -14562,7 +12792,7 @@ index ace9bf5..5db85e5 100644 #include #include + #include "guilib/DispResource.h" - #elif defined(_WIN32) && defined(HAS_DX) + #elif defined(TARGET_WINDOWS) && defined(HAS_DX) #include #include "guilib/D3DResource.h" @@ -56,9 +57,13 @@ class CD3DCallback : public ID3DResource @@ -14605,10 +12835,10 @@ index ace9bf5..5db85e5 100644 1.8.1.6 -From 11c81f96812c411bf5b5a63db6c25b8c542e2138 Mon Sep 17 00:00:00 2001 +From 4ea6518fb04ef3672366d7a48642ac0461869032 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 21 Jun 2012 17:26:51 +0200 -Subject: [PATCH 055/119] X11: fix video calibrations +Subject: [PATCH 043/105] X11: fix video calibrations --- xbmc/windowing/WinSystem.h | 1 + @@ -14617,11 +12847,11 @@ Subject: [PATCH 055/119] X11: fix video calibrations 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/xbmc/windowing/WinSystem.h b/xbmc/windowing/WinSystem.h -index 0c62f9f..cb766f0 100644 +index f1a9d6f..7a812b2 100644 --- a/xbmc/windowing/WinSystem.h +++ b/xbmc/windowing/WinSystem.h @@ -103,6 +103,7 @@ class CWinSystemBase - std::vector ScreenResolutions(int screen); + std::vector ScreenResolutions(int screen, float refreshrate); std::vector RefreshRates(int screen, int width, int height, uint32_t dwFlags); REFRESHRATE DefaultRefreshRate(int screen, std::vector rates); + virtual bool HasCalibration(const RESOLUTION_INFO &resInfo) { return true; }; @@ -14700,10 +12930,10 @@ index 2227320..630c0e2 100644 1.8.1.6 -From d2b91d0d5cf41d306fd7909ccc81cf472375f421 Mon Sep 17 00:00:00 2001 +From a22d9433ead7964315a90496d959528d0c20d3f3 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:00:26 +0200 -Subject: [PATCH 056/119] X11: deactivate screen saver on startup +Subject: [PATCH 044/105] X11: deactivate screen saver on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 29 +++++++++++++++++++++++++++++ @@ -14773,10 +13003,10 @@ index 630c0e2..f78f613 100644 1.8.1.6 -From 64a59462203f8c71c9edbaff582887f06d5ec867 Mon Sep 17 00:00:00 2001 +From 8078c2ec977e187ebd203d3cf44758cfc5bce0d5 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:10:09 +0200 -Subject: [PATCH 057/119] X11: change method of going full-screen +Subject: [PATCH 045/105] X11: change method of going full-screen --- xbmc/windowing/X11/WinSystemX11.cpp | 9 ++++++++- @@ -14820,10 +13050,10 @@ index c643177..e1e1096 100644 1.8.1.6 -From edccf8950c4de2496013fcda45830fae1793d3ff Mon Sep 17 00:00:00 2001 +From 7735b3d52583702a043a4d8d1033437a40aca6c8 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Jun 2012 19:12:39 +0200 -Subject: [PATCH 058/119] X11: reset key repeat and key modifier on focus lost +Subject: [PATCH 046/105] X11: reset key repeat and key modifier on focus lost and gain --- @@ -14855,10 +13085,10 @@ index c58067b..c9f8a20 100644 1.8.1.6 -From c747791c178bf7af44cf486b07bc5e46e769c3f0 Mon Sep 17 00:00:00 2001 +From 443a3f6ae52ab5d5e497fce83624290024878282 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:18:46 +0200 -Subject: [PATCH 059/119] X11: replace custom utf8 to unicode with charset +Subject: [PATCH 047/105] X11: replace custom utf8 to unicode with charset convertor (squash to x11 events) --- @@ -15075,10 +13305,10 @@ index 6100933..72955ad 100644 1.8.1.6 -From 49d240c787cc2b333a333af908a68dfe6d8b477f Mon Sep 17 00:00:00 2001 +From 8361e40ae3d7e25769b43611561847a64b2e1f5c Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:23:54 +0200 -Subject: [PATCH 060/119] X11: fixed invalid usage of sizeof() (squash into x11 +Subject: [PATCH 048/105] X11: fixed invalid usage of sizeof() (squash into x11 changes) --- @@ -15142,10 +13372,10 @@ index 72955ad..102a076 100644 1.8.1.6 -From 3a76cd58a2162be26167d752cde8c835b17362a3 Mon Sep 17 00:00:00 2001 +From e7be23e2aa41168332f2cdd52cc208f2dcff1855 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 9 Jun 2012 18:23:53 +0200 -Subject: [PATCH 061/119] add missing keys to xbmc keytable +Subject: [PATCH 049/105] add missing keys to xbmc keytable --- xbmc/input/XBMC_keytable.cpp | 2 ++ @@ -15168,17 +13398,17 @@ index f18e9b1..066cd77 100644 1.8.1.6 -From a6dd2b6a678c9fb113c374baee70f5c0889a39c5 Mon Sep 17 00:00:00 2001 +From 33dfa2f353b540be795dd6522ff29331b6ba75b9 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 16 Mar 2012 15:57:51 +0100 -Subject: [PATCH 062/119] videorefclock: temp deactivate of nv settings +Subject: [PATCH 050/105] videorefclock: temp deactivate of nv settings --- xbmc/video/VideoReferenceClock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/video/VideoReferenceClock.cpp b/xbmc/video/VideoReferenceClock.cpp -index 9b217d4..de1729b 100644 +index 4287e8f..21f59b8 100644 --- a/xbmc/video/VideoReferenceClock.cpp +++ b/xbmc/video/VideoReferenceClock.cpp @@ -135,7 +135,7 @@ @@ -15194,17 +13424,17 @@ index 9b217d4..de1729b 100644 1.8.1.6 -From 50ab7c0a1e5f50c43fdf55eeb603d852ef5435bf Mon Sep 17 00:00:00 2001 +From 8abf5ad26e2e89960693e88a98e91fb339a73131 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 09:09:09 +0200 -Subject: [PATCH 063/119] videorefclock: ask graphics context for refresh rate +Subject: [PATCH 051/105] videorefclock: ask graphics context for refresh rate --- xbmc/video/VideoReferenceClock.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/video/VideoReferenceClock.cpp b/xbmc/video/VideoReferenceClock.cpp -index de1729b..6f2ed8e 100644 +index 21f59b8..0156b2c 100644 --- a/xbmc/video/VideoReferenceClock.cpp +++ b/xbmc/video/VideoReferenceClock.cpp @@ -30,6 +30,7 @@ @@ -15228,10 +13458,10 @@ index de1729b..6f2ed8e 100644 1.8.1.6 -From eff133970fde507b64af9b6699f734afb0279429 Mon Sep 17 00:00:00 2001 +From 47bb9cb1a96653dc1cdf7b0b105d40f444014cc2 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 9 Jul 2012 14:00:18 +0200 -Subject: [PATCH 064/119] X11: fix icon texture after +Subject: [PATCH 052/105] X11: fix icon texture after cc5ed3c2474084ebc0373a3046410e6f766e03f4 --- @@ -15339,10 +13569,10 @@ index e1e1096..ace57ff 100644 1.8.1.6 -From 47e2fc787fe2e87928ab2ac30c574b5684be10a3 Mon Sep 17 00:00:00 2001 +From f7f4b3652498da8f3617e7fd90fd18ffb14ed6af Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 10 Jul 2012 11:14:12 +0200 -Subject: [PATCH 065/119] X11: check for window manager +Subject: [PATCH 053/105] X11: check for window manager --- xbmc/windowing/X11/WinSystemX11.cpp | 74 ++++++++++++++++++++++++++++++++++++- @@ -15463,10 +13693,10 @@ index f78f613..f479c27 100644 1.8.1.6 -From 1e14c0e054ea09e9b6e88a6d0d60c399ae22b3f0 Mon Sep 17 00:00:00 2001 +From 10a6acbb4465393c41150c5094bc86346bb81f86 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 12 Jul 2012 11:11:47 +0200 -Subject: [PATCH 066/119] X11: dont set window on xrandr if no mode available +Subject: [PATCH 054/105] X11: dont set window on xrandr if no mode available --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++----- @@ -15503,10 +13733,10 @@ index 188864b..076ed82 100644 1.8.1.6 -From d9f4faad2c2d79d9960b7e3bd1a82598b1d16ed9 Mon Sep 17 00:00:00 2001 +From b2bc899b89ff60b71237909b32ffc6e5cb725f5a Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 26 Jul 2012 09:34:28 +0200 -Subject: [PATCH 067/119] X11: fix crash after a resolution change on startup +Subject: [PATCH 055/105] X11: fix crash after a resolution change on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 3 ++- @@ -15530,10 +13760,10 @@ index 076ed82..ee339d9 100644 1.8.1.6 -From 92f7a95e9bacaab4a3f9279c9585da3636fb3e3a Mon Sep 17 00:00:00 2001 +From 0079064cba196ef272acde11886a0505fc60b58a Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 15 Sep 2012 18:27:29 +0200 -Subject: [PATCH 068/119] X11: lock graphics context in NotifyXRREvent +Subject: [PATCH 056/105] X11: lock graphics context in NotifyXRREvent --- xbmc/windowing/X11/WinSystemX11.cpp | 2 ++ @@ -15556,10 +13786,10 @@ index ee339d9..d2dcccd 100644 1.8.1.6 -From 031c7eb4338c17b1177f8d2a8432d63f1805eb66 Mon Sep 17 00:00:00 2001 +From 1536bbf3d27cea035431bcb97f6e3f79b6bece79 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 8 Oct 2011 16:45:13 +0200 -Subject: [PATCH 069/119] ffmpeg: add xvba hwaccel +Subject: [PATCH 057/105] ffmpeg: add xvba hwaccel --- lib/ffmpeg/configure | 11 ++ @@ -16408,13 +14638,13 @@ index 1c00ac4..6437e29 100644 1.8.1.6 -From 929d133a27cd461b1adca40589d7cc304e801baa Mon Sep 17 00:00:00 2001 +From b41b65badc8908db3490b1850b1a5069210b34eb Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 12 Apr 2012 12:09:31 +0200 -Subject: [PATCH 070/119] xvba: add decoder +Subject: [PATCH 058/105] xvba: add decoder --- - configure.in | 48 + + configure.in | 47 + language/English/strings.po | 12 +- system/settings/settings.xml | 5 + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 216 +- @@ -16423,29 +14653,29 @@ Subject: [PATCH 070/119] xvba: add decoder xbmc/cores/VideoRenderers/RenderManager.cpp | 4 + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 4 + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 16 + - xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in | 4 + + xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in | 3 + xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 2367 ++++++++++++++++++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h | 382 ++++ - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 + + xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h | 383 ++++ + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + xbmc/settings/VideoSettings.h | 2 + xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 1 + - 15 files changed, 3075 insertions(+), 6 deletions(-) + 15 files changed, 3070 insertions(+), 7 deletions(-) create mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp create mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h diff --git a/configure.in b/configure.in -index aaaf994..1b7f0a6 100644 +index ccf6399..f8ee40b 100644 --- a/configure.in +++ b/configure.in -@@ -141,6 +141,8 @@ vaapi_not_found="== Could not find libva. VAAPI support disabled. ==" +@@ -143,6 +143,8 @@ vaapi_not_found="== Could not find libva. VAAPI support disabled. ==" vaapi_disabled="== VAAPI support manually disabled. ==" crystalhd_not_found="== Could not find libcrystalhd. CrystalHD support disabled. ==" crystalhd_disabled="== CrystalHD support manually disabled. ==" +xvba_not_found="== Could not find amdxvba.h. XVBA support disabled. ==" +xvba_disabled="== XVBA support manually disabled. ==" - vdadecoder_enabled="== VDADecoder support enabled. ==" - vdadecoder_disabled="== VDADecoder support manually disabled. ==" vtbdecoder_enabled="== VTBDecoder support enabled. ==" + vtbdecoder_disabled="== VTBDecoder support manually disabled. ==" + openmax_disabled="== OpenMax support manually disabled. ==" @@ -262,6 +264,12 @@ AC_ARG_ENABLE([crystalhd], [enable CrystalHD decoding (default is auto)])], [use_crystalhd=$enableval], @@ -16457,9 +14687,9 @@ index aaaf994..1b7f0a6 100644 + [use_xvba=$enableval], + [use_xvba=auto]) - AC_ARG_ENABLE([vdadecoder], - [AS_HELP_STRING([--enable-vdadecoder], -@@ -1829,6 +1837,38 @@ else + AC_ARG_ENABLE([vtbdecoder], + [AS_HELP_STRING([--enable-vtbdecoder], +@@ -1788,6 +1796,37 @@ else USE_CRYSTALHD=0 fi @@ -16494,11 +14724,10 @@ index aaaf994..1b7f0a6 100644 + USE_XVBA=0 +fi + -+ - # VDADecoder - if test "x$use_vdadecoder" != "xno"; then + # VTBDecoder + if test "x$use_vtbdecoder" != "xno"; then if test "$host_vendor" = "apple" ; then -@@ -2046,6 +2086,12 @@ else +@@ -1985,6 +2024,12 @@ else final_message="$final_message\n CrystalHD:\tNo" fi @@ -16508,10 +14737,10 @@ index aaaf994..1b7f0a6 100644 + final_message="$final_message\n XVBA:\t\tNo" +fi + - if test "x$use_vdadecoder" != "xno"; then - final_message="$final_message\n VDADecoder:\tYes" + if test "x$use_vtbdecoder" != "xno"; then + final_message="$final_message\n VTBDecoder:\tYes" else -@@ -2515,6 +2561,7 @@ AC_SUBST(USE_OPENGLES) +@@ -2454,6 +2499,7 @@ AC_SUBST(USE_OPENGLES) AC_SUBST(USE_VDPAU) AC_SUBST(USE_VAAPI) AC_SUBST(USE_CRYSTALHD) @@ -16519,7 +14748,7 @@ index aaaf994..1b7f0a6 100644 AC_SUBST(USE_LIBSMBCLIENT) AC_SUBST(USE_LIBNFS) AC_SUBST(USE_LIBAFPCLIENT) -@@ -2697,6 +2744,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [ +@@ -2635,6 +2681,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [ `if test "x$use_vdpau" != "xno"; then echo --enable-vdpau; else echo --disable-vdpau; fi` \ `if test "x$use_vaapi" != "xno"; then echo --enable-vaapi; else echo --disable-vaapi; fi` \ `if test "$use_optimizations" != "no"; then echo --enable-optimizations; else echo --disable-optimizations; fi` \ @@ -16528,10 +14757,10 @@ index aaaf994..1b7f0a6 100644 --enable-pthreads \ --enable-runtime-cpudetect \ diff --git a/language/English/strings.po b/language/English/strings.po -index 757a411..52ee97a 100644 +index 3029d7e..8ffd225 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5774,7 +5774,11 @@ msgctxt "#13436" +@@ -5777,7 +5777,11 @@ msgctxt "#13436" msgid "Prefer VDPAU Video Mixer" msgstr "" @@ -16544,7 +14773,7 @@ index 757a411..52ee97a 100644 #: system/settings/settings.xml msgctxt "#13500" -@@ -6851,7 +6855,11 @@ msgctxt "#16325" +@@ -6855,7 +6859,11 @@ msgctxt "#16325" msgid "VDPAU - Bob" msgstr "" @@ -16558,10 +14787,10 @@ index 757a411..52ee97a 100644 msgctxt "#16400" msgid "Post-processing" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 97523b1..3d95d9c 100644 +index 9c63476..a863dae 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -415,6 +415,11 @@ +@@ -410,6 +410,11 @@ 2 true @@ -16574,7 +14803,7 @@ index 97523b1..3d95d9c 100644 HAS_GL 4 diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index c3aef83..6714b26 100644 +index 3d9f22a..c663423 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp @@ -65,6 +65,9 @@ @@ -16587,9 +14816,9 @@ index c3aef83..6714b26 100644 #ifdef TARGET_DARWIN #include "osx/CocoaInterface.h" -@@ -131,6 +134,9 @@ - #ifdef HAVE_LIBVDPAU - vdpau = NULL; +@@ -135,6 +138,9 @@ + #ifdef TARGET_DARWIN_OSX + cvBufferRef = NULL; #endif +#ifdef HAVE_LIBXVBA + xvba = NULL; @@ -16597,7 +14826,7 @@ index c3aef83..6714b26 100644 } CLinuxRendererGL::YUVBUFFER::~YUVBUFFER() -@@ -619,6 +625,9 @@ void CLinuxRendererGL::ReleaseBuffer(int idx) +@@ -604,6 +610,9 @@ void CLinuxRendererGL::ReleaseBuffer(int idx) #ifdef HAVE_LIBVDPAU SAFE_RELEASE(buf.vdpau); #endif @@ -16607,7 +14836,7 @@ index c3aef83..6714b26 100644 #ifdef HAVE_LIBVA buf.vaapi.surface.reset(); #endif -@@ -895,7 +904,7 @@ void CLinuxRendererGL::UpdateVideoFilter() +@@ -869,7 +878,7 @@ void CLinuxRendererGL::UpdateVideoFilter() case VS_SCALINGMETHOD_LINEAR: SetTextureFilter(m_scalingMethod == VS_SCALINGMETHOD_NEAREST ? GL_NEAREST : GL_LINEAR); m_renderQuality = RQ_SINGLEPASS; @@ -16616,7 +14845,7 @@ index c3aef83..6714b26 100644 { m_pVideoFilterShader = new StretchFilterShader(); if (!m_pVideoFilterShader->CompileAndLink()) -@@ -981,6 +990,11 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -955,6 +964,11 @@ void CLinuxRendererGL::LoadShaders(int field) CLog::Log(LOGNOTICE, "GL: Using CVBREF render method"); m_renderMethod = RENDER_CVREF; } @@ -16628,7 +14857,7 @@ index c3aef83..6714b26 100644 else { int requestedMethod = CSettings::Get().GetInt("videoplayer.rendermethod"); -@@ -1129,6 +1143,12 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -1103,6 +1117,12 @@ void CLinuxRendererGL::LoadShaders(int field) m_textureCreate = &CLinuxRendererGL::CreateCVRefTexture; m_textureDelete = &CLinuxRendererGL::DeleteCVRefTexture; } @@ -16641,7 +14870,7 @@ index c3aef83..6714b26 100644 else { // setup default YV12 texture handlers -@@ -1241,6 +1261,13 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1215,6 +1235,13 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) RenderVAAPI(renderBuffer, m_currentField); } #endif @@ -16655,7 +14884,7 @@ index c3aef83..6714b26 100644 else { // RENDER_CVREF uses the same render as the default case -@@ -1748,6 +1775,77 @@ void CLinuxRendererGL::RenderVAAPI(int index, int field) +@@ -1731,6 +1758,77 @@ void CLinuxRendererGL::RenderVAAPI(int index, int field) #endif } @@ -16733,7 +14962,7 @@ index c3aef83..6714b26 100644 void CLinuxRendererGL::RenderSoftware(int index, int field) { // used for textues uploaded from rgba or CVPixelBuffers. -@@ -2799,6 +2897,91 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) +@@ -2764,6 +2862,88 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) return true; } @@ -16766,7 +14995,6 @@ index c3aef83..6714b26 100644 + + glGenTextures(1, &plane.id); + -+ m_eventTexturesDone[index]->Set(); +#endif + return true; +} @@ -16782,7 +15010,6 @@ index c3aef83..6714b26 100644 + + if (!xvba || !xvba->valid) + { -+ m_eventTexturesDone[index]->Set(); + m_skipRender = true; + return; + } @@ -16818,14 +15045,13 @@ index c3aef83..6714b26 100644 + plane.rect.x2 /= plane.texwidth; + } + -+ m_eventTexturesDone[index]->Set(); +#endif +} + void CLinuxRendererGL::UploadYUV422PackedTexture(int source) { YUVBUFFER& buf = m_buffers[source]; -@@ -3384,6 +3567,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3338,6 +3518,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (m_renderMethod & RENDER_VAAPI) return false; @@ -16835,7 +15061,7 @@ index c3aef83..6714b26 100644 return (m_renderMethod & RENDER_GLSL) || (m_renderMethod & RENDER_ARB) || ((m_renderMethod & RENDER_SW) && glewIsSupported("GL_ARB_imaging") == GL_TRUE); -@@ -3397,6 +3583,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3351,6 +3534,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (m_renderMethod & RENDER_VAAPI) return false; @@ -16845,7 +15071,7 @@ index c3aef83..6714b26 100644 return (m_renderMethod & RENDER_GLSL) || (m_renderMethod & RENDER_ARB) || ((m_renderMethod & RENDER_SW) && glewIsSupported("GL_ARB_imaging") == GL_TRUE); -@@ -3420,7 +3609,8 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3374,7 +3560,8 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (feature == RENDERFEATURE_NONLINSTRETCH) { if (((m_renderMethod & RENDER_GLSL) && !(m_renderMethod & RENDER_POT)) || @@ -16855,7 +15081,7 @@ index c3aef83..6714b26 100644 return true; } -@@ -3492,6 +3682,16 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) +@@ -3446,6 +3633,16 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) return false; } @@ -16872,7 +15098,7 @@ index c3aef83..6714b26 100644 #ifdef TARGET_DARWIN // YADIF too slow for HD but we have no methods to fall back // to something that works so just turn it off. -@@ -3541,7 +3741,7 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method) +@@ -3495,7 +3692,7 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method) return false; if ((glewIsSupported("GL_EXT_framebuffer_object") && (m_renderMethod & RENDER_GLSL)) || @@ -16881,7 +15107,17 @@ index c3aef83..6714b26 100644 { // spline36 and lanczos3 are only allowed through advancedsettings.xml if(method != VS_SCALINGMETHOD_SPLINE36 -@@ -3633,4 +3833,14 @@ void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef, int index) +@@ -3562,7 +3759,8 @@ unsigned int CLinuxRendererGL::GetProcessorSize() + if(m_format == RENDER_FMT_VDPAU + || m_format == RENDER_FMT_VDPAU_420 + || m_format == RENDER_FMT_VAAPI +- || m_format == RENDER_FMT_CVBREF) ++ || m_format == RENDER_FMT_CVBREF ++ || m_format == RENDER_FMT_XVBA) + return 1; + else + return 0; +@@ -3618,4 +3816,14 @@ void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef, int index) } #endif @@ -16897,7 +15133,7 @@ index c3aef83..6714b26 100644 + #endif diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index bc9c2c0..0cd19f5 100644 +index 4494eca..161c43f 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h @@ -44,6 +44,8 @@ @@ -16917,7 +15153,7 @@ index bc9c2c0..0cd19f5 100644 }; enum RenderQuality -@@ -150,7 +153,9 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -151,7 +154,9 @@ class CLinuxRendererGL : public CBaseRenderer #ifdef TARGET_DARWIN virtual void AddProcessor(struct __CVBuffer *cvBufferRef, int index); #endif @@ -16928,7 +15164,7 @@ index bc9c2c0..0cd19f5 100644 virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); // Feature support -@@ -209,6 +214,10 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -210,6 +215,10 @@ class CLinuxRendererGL : public CBaseRenderer void DeleteYUV422PackedTexture(int index); bool CreateYUV422PackedTexture(int index); @@ -16939,7 +15175,7 @@ index bc9c2c0..0cd19f5 100644 void UploadRGBTexture(int index); void ToRGBFrame(YV12Image* im, unsigned flipIndexPlane, unsigned flipIndexBuf); void ToRGBFields(YV12Image* im, unsigned flipIndexPlaneTop, unsigned flipIndexPlaneBot, unsigned flipIndexBuf); -@@ -224,6 +233,7 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -225,6 +234,7 @@ class CLinuxRendererGL : public CBaseRenderer void RenderVDPAU(int renderBuffer, int field); // render using vdpau hardware void RenderProgressiveWeave(int renderBuffer, int field); // render using vdpau hardware void RenderVAAPI(int renderBuffer, int field); // render using vdpau hardware @@ -16947,7 +15183,7 @@ index bc9c2c0..0cd19f5 100644 struct { -@@ -291,6 +301,9 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -293,6 +303,9 @@ class CLinuxRendererGL : public CBaseRenderer #ifdef TARGET_DARWIN_OSX struct __CVBuffer *cvBufferRef; #endif @@ -16970,10 +15206,10 @@ index 6ed62be..70ae9bf 100644 #endif diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 13facce..0b22a2b 100644 +index 0ad88ce..2834708 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -889,6 +889,10 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -937,6 +937,10 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) else if(pic.format == RENDER_FMT_VAAPI) m_pRenderer->AddProcessor(*pic.vaapi, index); #endif @@ -16985,7 +15221,7 @@ index 13facce..0b22a2b 100644 return index; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 2bf79fe..4d7dbb1 100644 +index 13a2648..347f09b 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h @@ -35,6 +35,7 @@ @@ -17007,12 +15243,12 @@ index 2bf79fe..4d7dbb1 100644 struct { COpenMax *openMax; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index b17261b..fc24228 100644 +index 6569d9c..6f7565a 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -57,6 +57,9 @@ - #ifdef HAVE_LIBVA - #include "VAAPI.h" +@@ -60,6 +60,9 @@ + #ifdef TARGET_DARWIN_OSX + #include "VDA.h" #endif +#ifdef HAVE_LIBXVBA +#include "XVBA.h" @@ -17020,7 +15256,7 @@ index b17261b..fc24228 100644 using namespace boost; -@@ -98,6 +101,19 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx +@@ -101,6 +104,19 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx dec->Release(); } #endif @@ -17041,20 +15277,19 @@ index b17261b..fc24228 100644 // mpeg4 vaapi decoding is disabled if(*cur == PIX_FMT_VAAPI_VLD && CSettings::Get().GetBool("videoplayer.usevaapi") diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in -index 157b6b3..dbdfc28 100644 +index 979e3ce..cacc876 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in -@@ -14,6 +14,10 @@ ifeq (@USE_CRYSTALHD@,1) - SRCS += CrystalHD.cpp - SRCS += DVDVideoCodecCrystalHD.cpp +@@ -22,6 +22,9 @@ SRCS += OpenMax.cpp + SRCS += OpenMaxVideo.cpp + SRCS += DVDVideoCodecOpenMax.cpp endif +ifeq (@USE_XVBA@,1) -+SRCS+= XVBA.cpp \ -+ ++SRCS += XVBA.cpp +endif - ifeq (@USE_VDA@,1) - SRCS += DVDVideoCodecVDA.cpp - endif + + ifeq (@USE_LIBAMCODEC@,1) + SRCS += AMLCodec.cpp diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp new file mode 100644 index 0000000..43a331f @@ -19430,10 +17665,10 @@ index 0000000..43a331f +#endif diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h new file mode 100644 -index 0000000..f38444c +index 0000000..3bd0cea --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h -@@ -0,0 +1,382 @@ +@@ -0,0 +1,383 @@ +/* + * Copyright (C) 2005-2011 Team XBMC + * http://www.xbmc.org @@ -19767,6 +18002,7 @@ index 0000000..f38444c + virtual const std::string Name() { return "xvba"; } + virtual bool CanSkipDeint(); + virtual void SetSpeed(int speed); ++ virtual unsigned GetAllowedReferences() { return 5; } + + bool Supports(EINTERLACEMETHOD method); + long ReleasePicReference(); @@ -19817,25 +18053,22 @@ index 0000000..f38444c + +} diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 132d8ec..32112b2 100644 +index 1a17145..41e64a5 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1189,6 +1189,10 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - formatstr = "NONE"; - buffering = false; - break; -+ case RENDER_FMT_XVBA: -+ formatstr = "XVBA"; -+ buffering = true; -+ break; - } - - if(m_bAllowFullscreen) +@@ -1017,6 +1017,7 @@ static std::string GetRenderFormatName(ERenderFormat format) + case RENDER_FMT_OMXEGL: return "OMXEGL"; + case RENDER_FMT_CVBREF: return "BGRA"; + case RENDER_FMT_BYPASS: return "BYPASS"; ++ case RENDER_FMT_XVBA: return "XVBA"; + case RENDER_FMT_NONE: return "NONE"; + } + return "UNKNOWN"; diff --git a/xbmc/settings/VideoSettings.h b/xbmc/settings/VideoSettings.h -index 3ca4c8b..ae6221c 100644 +index b7c4116..a370bd8 100644 --- a/xbmc/settings/VideoSettings.h +++ b/xbmc/settings/VideoSettings.h -@@ -65,6 +65,8 @@ enum EINTERLACEMETHOD +@@ -63,6 +63,8 @@ enum EINTERLACEMETHOD VS_INTERLACEMETHOD_SW_BLEND = 20, VS_INTERLACEMETHOD_AUTO_ION = 21, @@ -19860,10 +18093,10 @@ index 40d8c61..9cb1c5c 100644 1.8.1.6 -From e54bdce789c480ea281962d97aa0939074d96475 Mon Sep 17 00:00:00 2001 +From de0ddf6dbec51bbe93244f222f493a81b5e3e353 Mon Sep 17 00:00:00 2001 From: fritsch Date: Sun, 4 Nov 2012 16:24:10 +0100 -Subject: [PATCH 071/119] xvba: add string for available decoders - we are +Subject: [PATCH 059/105] xvba: add string for available decoders - we are important so make sure we are there --- @@ -19871,11 +18104,11 @@ Subject: [PATCH 071/119] xvba: add string for available decoders - we are 1 file changed, 5 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index 100cb22..445ba9b 100644 +index 9ad29f9..95cdb31 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -@@ -179,6 +179,11 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne - #elif defined(_LINUX) && !defined(TARGET_DARWIN) +@@ -177,6 +177,11 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne + #elif defined(TARGET_POSIX) && !defined(TARGET_DARWIN) hwSupport += "VAAPI:no "; #endif +#if defined(HAVE_LIBXVBA) && defined(TARGET_LINUX) @@ -19890,17 +18123,17 @@ index 100cb22..445ba9b 100644 1.8.1.6 -From 206fe543145e024a26939afe8c917942413b2a92 Mon Sep 17 00:00:00 2001 +From a0430996f24cd9d1b4e38e38d8e76d6b770db556 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 16 Jun 2012 12:46:30 +0200 -Subject: [PATCH 072/119] xvba: do not use vaapi if xvba is present +Subject: [PATCH 060/105] xvba: do not use vaapi if xvba is present --- xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index 0cd89e8..db251bc 100644 +index dd96ce8..3943d52 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp @@ -261,6 +261,15 @@ void CDecoder::Close() @@ -19923,20 +18156,20 @@ index 0cd89e8..db251bc 100644 1.8.1.6 -From 148440a33770139fab7f87830395dd9d89a9f5a3 Mon Sep 17 00:00:00 2001 +From e9d091c51648ba8a70a1c14e2c8f7e55db43f580 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 23 Aug 2012 19:39:49 +0200 -Subject: [PATCH 073/119] ffmpeg: add av_find_default_stream_index to interface +Subject: [PATCH 061/105] ffmpeg: add av_find_default_stream_index to interface --- lib/DllAvFormat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h -index 791dc01..51d24a4 100644 +index c3029db..4bccc8d 100644 --- a/lib/DllAvFormat.h +++ b/lib/DllAvFormat.h -@@ -103,6 +103,7 @@ class DllAvFormatInterface +@@ -99,6 +99,7 @@ class DllAvFormatInterface virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options)=0; virtual int av_write_trailer(AVFormatContext *s)=0; virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt)=0; @@ -19944,7 +18177,7 @@ index 791dc01..51d24a4 100644 }; #if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) -@@ -159,6 +160,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface +@@ -155,6 +156,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options) { return ::avformat_write_header (s, options); } virtual int av_write_trailer(AVFormatContext *s) { return ::av_write_trailer(s); } virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt) { return ::av_write_frame(s, pkt); } @@ -19952,7 +18185,7 @@ index 791dc01..51d24a4 100644 // DLL faking. virtual bool ResolveExports() { return true; } -@@ -226,6 +228,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface +@@ -222,6 +224,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface DEFINE_METHOD2(int, avformat_write_header , (AVFormatContext *p1, AVDictionary **p2)) DEFINE_METHOD1(int, av_write_trailer, (AVFormatContext *p1)) DEFINE_METHOD2(int, av_write_frame , (AVFormatContext *p1, AVPacket *p2)) @@ -19960,7 +18193,7 @@ index 791dc01..51d24a4 100644 BEGIN_METHOD_RESOLVE() RESOLVE_METHOD_RENAME(av_register_all, av_register_all_dont_call) RESOLVE_METHOD_RENAME(avformat_network_init, avformat_network_init_dont_call) -@@ -261,6 +264,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface +@@ -257,6 +260,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface RESOLVE_METHOD(avformat_write_header) RESOLVE_METHOD(av_write_trailer) RESOLVE_METHOD(av_write_frame) @@ -19972,10 +18205,393 @@ index 791dc01..51d24a4 100644 1.8.1.6 -From e8f44825d04fa25bb499ef33515af7a52c791224 Mon Sep 17 00:00:00 2001 +From 6b70e01e45612ce359194b8d34b36b18f789f3b2 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sat, 13 Apr 2013 11:30:39 +0200 +Subject: [PATCH 062/105] XVBA: revisit draw functions + +--- + lib/ffmpeg/libavcodec/xvba_h264.c | 2 +- + lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c +index ae45f3a..309d928 100644 +--- a/lib/ffmpeg/libavcodec/xvba_h264.c ++++ b/lib/ffmpeg/libavcodec/xvba_h264.c +@@ -160,7 +160,7 @@ static int end_frame(AVCodecContext *avctx) + h->got_first_iframe = 1; + } + +- ff_draw_horiz_band(h->avctx, &h->dsp, h->cur_pic_ptr, NULL, 0, h->avctx->height, h->picture_structure, h->first_field, 0, 0, 0, 0); ++ ff_h264_draw_horiz_band(h, 0, h->avctx->height); + + return 0; + } +diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c +index bf3d9c2..ff35a28 100644 +--- a/lib/ffmpeg/libavcodec/xvba_vc1.c ++++ b/lib/ffmpeg/libavcodec/xvba_vc1.c +@@ -142,7 +142,7 @@ static int end_frame(AVCodecContext *avctx) + break; + } + +- ff_draw_horiz_band(s->avctx, &s->dsp, s->current_picture_ptr, s->last_picture_ptr, 0, s->avctx->height, s->picture_structure, s->first_field, (s->unrestricted_mv && !s->intra_only), s->low_delay, s->v_edge_pos, s->h_edge_pos); ++ ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); + + return 0; + } +-- +1.8.1.6 + + +From f8ef893aa3984e12e1ef2b67dd6b7490171b5c9d Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sat, 13 Apr 2013 12:06:02 +0200 +Subject: [PATCH 063/105] (ffmpeg): Make XVBA codec available + +--- + lib/ffmpeg/libavcodec/vc1dec.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/ffmpeg/libavcodec/vc1dec.c b/lib/ffmpeg/libavcodec/vc1dec.c +index 2130c74..4d611f9 100644 +--- a/lib/ffmpeg/libavcodec/vc1dec.c ++++ b/lib/ffmpeg/libavcodec/vc1dec.c +@@ -5807,6 +5807,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, + #if CONFIG_VDPAU + AV_PIX_FMT_VDPAU, + #endif ++#if CONFIG_XVBA ++ AV_PIX_FMT_XVBA_VLD, ++#endif + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE + }; +-- +1.8.1.6 + + +From e3b231d11e8444d99a2ef5d31fa04e3446f04dc4 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sat, 13 Apr 2013 16:38:50 +0200 +Subject: [PATCH 064/105] ffmpeg: XVBA-VC1 use v->second_field instead of + !s->first_field to make VC1 interlaced working + +--- + lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c +index ff35a28..04e7983 100644 +--- a/lib/ffmpeg/libavcodec/xvba_vc1.c ++++ b/lib/ffmpeg/libavcodec/xvba_vc1.c +@@ -99,7 +99,7 @@ static int end_frame(AVCodecContext *avctx) + pic_descriptor->sps_info.vc1.psf = v->psf; + // what about if it is a frame (page 31) + // looked at xvba-driver +- pic_descriptor->sps_info.vc1.second_field = !s->first_field; ++ pic_descriptor->sps_info.vc1.second_field = v->second_field; + pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; + + // VC-1 explicit parameters see page 30 of sdk +-- +1.8.1.6 + + +From 29f72f6d5cf41af8063713b0fa33fa659c6ed9fa Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sat, 27 Apr 2013 17:36:15 +0200 +Subject: [PATCH 065/105] XVBA: Only set second_field when we are interlaced + and an interlaced field + +--- + lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c +index 04e7983..eb90c12 100644 +--- a/lib/ffmpeg/libavcodec/xvba_vc1.c ++++ b/lib/ffmpeg/libavcodec/xvba_vc1.c +@@ -99,7 +99,7 @@ static int end_frame(AVCodecContext *avctx) + pic_descriptor->sps_info.vc1.psf = v->psf; + // what about if it is a frame (page 31) + // looked at xvba-driver +- pic_descriptor->sps_info.vc1.second_field = v->second_field; ++ pic_descriptor->sps_info.vc1.second_field = v->interlace && v->second_field && (v->fcm == ILACE_FIELD); + pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; + + // VC-1 explicit parameters see page 30 of sdk +-- +1.8.1.6 + + +From 4c070d9226cee75752cf93dc2889984073e31e28 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sat, 27 Apr 2013 22:08:50 +0200 +Subject: [PATCH 066/105] xvba: translate picture_structure to a value xvba + understands + +--- + lib/ffmpeg/libavcodec/xvba.c | 11 +++++++++++ + lib/ffmpeg/libavcodec/xvba_h264.c | 4 +++- + lib/ffmpeg/libavcodec/xvba_internal.h | 1 + + lib/ffmpeg/libavcodec/xvba_vc1.c | 4 +++- + 4 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c +index be29e5d..566922e 100644 +--- a/lib/ffmpeg/libavcodec/xvba.c ++++ b/lib/ffmpeg/libavcodec/xvba.c +@@ -31,6 +31,7 @@ + #include "xvba.h" + #include "xvba_internal.h" + #include "avcodec.h" ++#include "mpegvideo.h" + + int ff_xvba_translate_profile(int profile) { + +@@ -50,6 +51,16 @@ int ff_xvba_translate_profile(int profile) { + return -1; + } + ++// See page 25 of the documentation ++int ff_xvba_translate_picture_structure(int picture_structure) { ++ if(picture_structure == PICT_TOP_FIELD) ++ return 0; ++ else if (picture_structure == PICT_BOTTOM_FIELD) ++ return 1; ++ else //PICT_FRAME by default ++ return 3; ++} ++ + void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size) { + + render->buffers = av_fast_realloc( +diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c +index 309d928..20ba2f2 100644 +--- a/lib/ffmpeg/libavcodec/xvba_h264.c ++++ b/lib/ffmpeg/libavcodec/xvba_h264.c +@@ -87,7 +87,9 @@ static int end_frame(AVCodecContext *avctx) + pic_descriptor->level = avctx->level; + pic_descriptor->width_in_mb = h->mb_width; + pic_descriptor->height_in_mb = h->mb_height; +- pic_descriptor->picture_structure = h->picture_structure; ++ ++ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(h->picture_structure); ++ + pic_descriptor->chroma_format = h->chroma_format_idc ? h->chroma_format_idc : 1; + pic_descriptor->avc_intra_flag = (h->slice_type == AV_PICTURE_TYPE_I) ? 1 : 0; + pic_descriptor->avc_reference = (h->cur_pic_ptr->f.reference & 3) ? 1 : 0; +diff --git a/lib/ffmpeg/libavcodec/xvba_internal.h b/lib/ffmpeg/libavcodec/xvba_internal.h +index 9653f85..18faa3e 100644 +--- a/lib/ffmpeg/libavcodec/xvba_internal.h ++++ b/lib/ffmpeg/libavcodec/xvba_internal.h +@@ -21,4 +21,5 @@ + */ + + int ff_xvba_translate_profile(int profile); ++int ff_xvba_translate_picture_structure(int picture_structure); + void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size); +diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c +index eb90c12..c98dba5 100644 +--- a/lib/ffmpeg/libavcodec/xvba_vc1.c ++++ b/lib/ffmpeg/libavcodec/xvba_vc1.c +@@ -78,7 +78,9 @@ static int end_frame(AVCodecContext *avctx) + pic_descriptor->width_in_mb = s->mb_width; + pic_descriptor->height_in_mb = s->mb_height; + } +- pic_descriptor->picture_structure = s->picture_structure; ++ ++ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(s->picture_structure); ++ + // xvba-video set this to 1 only 4:2:0 supported + // doc says: if not set, choose 1 - we try this + pic_descriptor->chroma_format = 1; +-- +1.8.1.6 + + +From f1802c0faa0e57a76620a1ee35d2b3438c942013 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Tue, 30 Apr 2013 21:18:55 +0200 +Subject: [PATCH 067/105] ffmpeg xvba: fix vc1 field interlace + +--- + lib/ffmpeg/libavcodec/xvba.c | 4 ++-- + lib/ffmpeg/libavcodec/xvba.h | 1 + + lib/ffmpeg/libavcodec/xvba_vc1.c | 1 + + 3 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c +index 566922e..c6ff2fe 100644 +--- a/lib/ffmpeg/libavcodec/xvba.c ++++ b/lib/ffmpeg/libavcodec/xvba.c +@@ -53,9 +53,9 @@ int ff_xvba_translate_profile(int profile) { + + // See page 25 of the documentation + int ff_xvba_translate_picture_structure(int picture_structure) { +- if(picture_structure == PICT_TOP_FIELD) ++ if(picture_structure == PICT_BOTTOM_FIELD) + return 0; +- else if (picture_structure == PICT_BOTTOM_FIELD) ++ else if (picture_structure == PICT_TOP_FIELD) + return 1; + else //PICT_FRAME by default + return 3; +diff --git a/lib/ffmpeg/libavcodec/xvba.h b/lib/ffmpeg/libavcodec/xvba.h +index 9f9ff0c..e590faf 100644 +--- a/lib/ffmpeg/libavcodec/xvba.h ++++ b/lib/ffmpeg/libavcodec/xvba.h +@@ -66,6 +66,7 @@ struct xvba_render_state { + unsigned int num_slices; + struct xvba_bitstream_buffers *buffers; + uint32_t buffers_alllocated; ++ int psf; + }; + + #endif /* AVCODEC_XVBA_H */ +diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c +index c98dba5..e7a85a7 100644 +--- a/lib/ffmpeg/libavcodec/xvba_vc1.c ++++ b/lib/ffmpeg/libavcodec/xvba_vc1.c +@@ -143,6 +143,7 @@ static int end_frame(AVCodecContext *avctx) + pic_descriptor->future_surface = last->surface; + break; + } ++ render->psf = v->psf; + + ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); + +-- +1.8.1.6 + + +From 00da49aacf45f78fc0223319cf9c0e09b9e18641 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Tue, 30 Apr 2013 21:19:07 +0200 +Subject: [PATCH 068/105] xvba: fix vc1 field interlace + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp +index 43a331f..568632f 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp +@@ -1000,6 +1000,9 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *avctx, + { + startCodeSize = 4; + uint8_t sdf = 0x0d; ++ if (render->picture_descriptor->sps_info.vc1.second_field) ++ sdf = 0x0c; ++ + memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, + startCode, 3); + memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location+3, +-- +1.8.1.6 + + +From 097eaa543ef9731e10fd63cdf481eda225762640 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Tue, 30 Apr 2013 21:40:55 +0200 +Subject: [PATCH 069/105] xvba: vc1 - honor psf + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp +index 568632f..1db9363 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp +@@ -1181,6 +1181,7 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) + + render->state |= FF_XVBA_STATE_USED_FOR_REFERENCE; + render->state &= ~FF_XVBA_STATE_DECODED; ++ render->psf = 0; + pic->reordered_opaque= avctx->reordered_opaque; + + return 0; +@@ -1225,6 +1226,8 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame) + memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); + ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); + pic.render = render; ++ if (render->psf) ++ pic.DVDPic.iFlags &= ~DVP_FLAG_INTERLACED; + m_bufferStats.IncDecoded(); + m_xvbaOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); + +-- +1.8.1.6 + + +From 59d0e6d2cd9053a9a321cb3fc419c86637c68d1f Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sat, 4 May 2013 10:31:32 +0200 +Subject: [PATCH 070/105] xvba: squash me, settings + +--- + xbmc/settings/Settings.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp +index fdbc34e..efdde63 100644 +--- a/xbmc/settings/Settings.cpp ++++ b/xbmc/settings/Settings.cpp +@@ -738,6 +738,9 @@ void CSettings::InitializeConditions() + #ifdef HAVE_LIBVDPAU + m_settingsManager->AddCondition("have_libvdpau"); + #endif ++#ifdef HAVE_LIBXVBA ++ m_settingsManager->AddCondition("have_libxvba"); ++#endif + #ifdef HAVE_VIDEOTOOLBOXDECODER + m_settingsManager->AddCondition("have_videotoolboxdecoder"); + if (g_sysinfo.HasVideoToolBoxDecoder()) +-- +1.8.1.6 + + +From 0aac10c8dc26f3eff6cddf791cfa481d706d5a6e Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Fri, 24 May 2013 12:02:02 +0200 +Subject: [PATCH 071/105] XVBA: Limit video to 2048x1152 as this is the max all + blocks can handle + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp +index 1db9363..54d7aea 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp +@@ -340,10 +340,12 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned + // it seems that xvba does not support anything > 2k + // return false, for files that are larger + // if you are unlucky, this would kill your decoder +- // we limit to 2048x1536(+8) now - as this was tested working ++ // we limit to 2048x1152 now - as this was reported by ckoenig the UVD OSS ++ // engineer to be the maximum technically possible for all hardware with UVD. ++ // Some chips can do a bit more, but we use the safe default. + int surfaceWidth = (avctx->coded_width+15) & ~15; + int surfaceHeight = (avctx->coded_height+15) & ~15; +- if(surfaceHeight > 1544 || surfaceWidth > 2048) ++ if(surfaceHeight > 1152 || surfaceWidth > 2048) + { + CLog::Log(LOGERROR, "Surface too large, decoder skipped: surfaceWidth %u, surfaceHeight %u", + surfaceWidth, surfaceHeight); +-- +1.8.1.6 + + +From a0194a86e40a2964869bc8c4cbd11f99359185ab Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 16:06:39 +0200 -Subject: [PATCH 074/119] dvdplayer: observe pts counter overflow +Subject: [PATCH 072/105] dvdplayer: observe pts counter overflow --- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 198 ++++++++++++++++++++- @@ -19983,10 +18599,10 @@ Subject: [PATCH 074/119] dvdplayer: observe pts counter overflow 2 files changed, 201 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index bf0d58e..8317d97 100644 +index 098e6e2..fb8fa02 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -18,13 +18,13 @@ +@@ -18,7 +18,6 @@ * */ @@ -19994,14 +18610,15 @@ index bf0d58e..8317d97 100644 #ifndef __STDC_CONSTANT_MACROS #define __STDC_CONSTANT_MACROS #endif - #ifndef __STDC_LIMIT_MACROS +@@ -26,6 +25,7 @@ #define __STDC_LIMIT_MACROS #endif + #ifdef TARGET_POSIX +#include "system.h" - #ifdef _LINUX #include "stdint.h" #endif -@@ -481,6 +481,9 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + #include "DVDDemuxFFmpeg.h" +@@ -489,6 +489,9 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) CreateStreams(); @@ -20011,7 +18628,7 @@ index bf0d58e..8317d97 100644 return true; } -@@ -583,6 +586,12 @@ double CDVDDemuxFFmpeg::ConvertTimestamp(int64_t pts, int den, int num) +@@ -629,6 +632,12 @@ double CDVDDemuxFFmpeg::ConvertTimestamp(int64_t pts, int den, int num) if (pts == (int64_t)AV_NOPTS_VALUE) return DVD_NOPTS_VALUE; @@ -20024,7 +18641,7 @@ index bf0d58e..8317d97 100644 // do calculations in floats as they can easily overflow otherwise // we don't care for having a completly exact timestamp anyway double timestamp = (double)pts * num / den; -@@ -721,6 +730,24 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -768,6 +777,24 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() m_pkt.pkt.pts = AV_NOPTS_VALUE; } @@ -20049,7 +18666,7 @@ index bf0d58e..8317d97 100644 // copy contents into our own packet pPacket->iSize = m_pkt.pkt.size; -@@ -850,10 +877,20 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) +@@ -897,10 +924,20 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) int ret; { CSingleLock lock(m_critSection); @@ -20070,7 +18687,7 @@ index bf0d58e..8317d97 100644 } if(m_iCurrentPts == DVD_NOPTS_VALUE) -@@ -872,6 +909,165 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) +@@ -919,6 +956,165 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) return (ret >= 0); } @@ -20237,10 +18854,10 @@ index bf0d58e..8317d97 100644 { CSingleLock lock(m_critSection); diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -index 568dc87..8a2c219 100644 +index b78094e..17d2f7a 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -@@ -99,6 +99,7 @@ class CDVDDemuxFFmpeg : public CDVDDemux +@@ -100,6 +100,7 @@ class CDVDDemuxFFmpeg : public CDVDDemux DemuxPacket* Read(); bool SeekTime(int time, bool backwords = false, double* startpts = NULL); @@ -20248,7 +18865,7 @@ index 568dc87..8a2c219 100644 bool SeekByte(int64_t pos); int GetStreamLength(); CDemuxStream* GetStream(int iStreamId); -@@ -156,5 +157,8 @@ class CDVDDemuxFFmpeg : public CDVDDemux +@@ -158,5 +159,8 @@ class CDVDDemuxFFmpeg : public CDVDDemux AVPacket pkt; // packet ffmpeg returned int result; // result from av_read_packet }m_pkt; @@ -20261,10 +18878,10 @@ index 568dc87..8a2c219 100644 1.8.1.6 -From 884018e01472b73daf55e7a18fd20169e0098f1b Mon Sep 17 00:00:00 2001 +From ccb5803c137d470b60b1ac82754629e55e1978b6 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 2 Oct 2012 13:02:10 +0200 -Subject: [PATCH 075/119] dvdplayer: avoid short screen flicker caused by +Subject: [PATCH 073/105] dvdplayer: avoid short screen flicker caused by unnecessary reconfigure of renderer --- @@ -20272,35 +18889,35 @@ Subject: [PATCH 075/119] dvdplayer: avoid short screen flicker caused by 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 32112b2..2675af9 100644 +index 41e64a5..74b4391 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1045,7 +1045,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - || m_output.height != pPicture->iHeight - || m_output.dwidth != pPicture->iDisplayWidth - || m_output.dheight != pPicture->iDisplayHeight -- || m_output.framerate != config_framerate +@@ -1095,7 +1095,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) + || ( m_output.height != pPicture->iHeight ) + || ( m_output.dwidth != pPicture->iDisplayWidth ) + || ( m_output.dheight != pPicture->iDisplayHeight ) +- || ( m_output.framerate != config_framerate ) + || (!m_bFpsInvalid && fmod(m_output.framerate, config_framerate) != 0.0 ) - || m_output.color_format != (unsigned int)pPicture->format - || m_output.extended_format != pPicture->extended_format - || ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified -@@ -1212,7 +1212,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - m_output.height = pPicture->iHeight; - m_output.dwidth = pPicture->iDisplayWidth; - m_output.dheight = pPicture->iDisplayHeight; -- m_output.framerate = config_framerate; -+ m_output.framerate = config_framerate == 0.0 ? g_graphicsContext.GetFPS() : config_framerate; - m_output.color_format = pPicture->format; + || ( m_output.color_format != (unsigned int)pPicture->format ) + || ( m_output.extended_format != pPicture->extended_format ) + || ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified +@@ -1148,7 +1148,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) + m_output.height = pPicture->iHeight; + m_output.dwidth = pPicture->iDisplayWidth; + m_output.dheight = pPicture->iDisplayHeight; +- m_output.framerate = config_framerate; ++ m_output.framerate = config_framerate == 0.0 ? g_graphicsContext.GetFPS() : config_framerate; + m_output.color_format = pPicture->format; m_output.extended_format = pPicture->extended_format; - m_output.color_matrix = pPicture->color_matrix; + m_output.color_matrix = pPicture->color_matrix; -- 1.8.1.6 -From 57c77cdbc14b77dab52bb8ab89a9efde4a87d009 Mon Sep 17 00:00:00 2001 +From 50b58f7a676c94df3fecfeb4feca994e2d346798 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Oct 2012 12:05:50 +0200 -Subject: [PATCH 076/119] vdpau: advanced settings for auto deinterlacing +Subject: [PATCH 074/105] vdpau: advanced settings for auto deinterlacing --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- @@ -20309,10 +18926,10 @@ Subject: [PATCH 076/119] vdpau: advanced settings for auto deinterlacing 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index a8cdd22..8631884 100644 +index bb3cfb8..1aeef6a 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1802,10 +1802,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) +@@ -1800,10 +1800,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) if (method == VS_INTERLACEMETHOD_AUTO) { int deint = -1; @@ -20328,10 +18945,10 @@ index a8cdd22..8631884 100644 if (deint != -1) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index b8c4ad7..2ffdff3 100644 +index 55c1b49..f0afc74 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -161,6 +161,8 @@ void CAdvancedSettings::Initialize() +@@ -169,6 +169,8 @@ void CAdvancedSettings::Initialize() m_videoAllowMpeg4VAAPI = false; m_videoDisableBackgroundDeinterlace = false; m_videoCaptureUseOcclusionQuery = -1; //-1 is auto detect @@ -20340,7 +18957,7 @@ index b8c4ad7..2ffdff3 100644 m_videoVDPAUtelecine = false; m_videoVDPAUdeintSkipChromaHD = false; m_DXVACheckCompatibility = false; -@@ -575,6 +577,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -584,6 +586,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetBoolean(pElement,"allowmpeg4vaapi",m_videoAllowMpeg4VAAPI); XMLUtils::GetBoolean(pElement, "disablebackgrounddeinterlace", m_videoDisableBackgroundDeinterlace); XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1); @@ -20350,10 +18967,10 @@ index b8c4ad7..2ffdff3 100644 XMLUtils::GetBoolean(pElement,"vdpauHDdeintSkipChroma",m_videoVDPAUdeintSkipChromaHD); diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index 060862b..6c6ce80 100644 +index d41cbcf..10adbb9 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h -@@ -146,6 +146,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler +@@ -147,6 +147,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler int m_videoPercentSeekBackwardBig; CStdString m_videoPPFFmpegDeint; CStdString m_videoPPFFmpegPostProc; @@ -20366,21 +18983,21 @@ index 060862b..6c6ce80 100644 1.8.1.6 -From c124d500cbbd7a0152c6f66cbd2c8eb1bc606fb0 Mon Sep 17 00:00:00 2001 +From 4cbd3ba1f53fbfc791dd087de4e01c3f071d36f1 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 2 Nov 2012 13:20:03 +0100 -Subject: [PATCH 077/119] player: fix rewind +Subject: [PATCH 075/105] player: fix rewind --- xbmc/cores/dvdplayer/DVDMessage.h | 5 ++++- xbmc/cores/dvdplayer/DVDPlayer.cpp | 30 +++++++++++++++++++----------- xbmc/cores/dvdplayer/DVDPlayer.h | 7 ++++--- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 10 ++++++---- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 +++- xbmc/cores/dvdplayer/DVDPlayerVideo.h | 1 + - 5 files changed, 34 insertions(+), 19 deletions(-) + 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDMessage.h b/xbmc/cores/dvdplayer/DVDMessage.h -index 0dac948..6de5207 100644 +index 3f65ced..ad434d2 100644 --- a/xbmc/cores/dvdplayer/DVDMessage.h +++ b/xbmc/cores/dvdplayer/DVDMessage.h @@ -220,7 +220,7 @@ class CDVDMsgPlayerSetState : public CDVDMsg @@ -20417,10 +19034,10 @@ index 0dac948..6de5207 100644 class CDVDMsgPlayerSeekChapter : public CDVDMsg diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index d6bb85b..4a9f99b 100644 +index fefb6f9..85f1a58 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1562,11 +1562,13 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1556,11 +1556,13 @@ void CDVDPlayer::HandlePlaySpeed() } else if (m_CurrentVideo.id >= 0 && (m_CurrentVideo.inited == true || GetPlaySpeed() < 0) // allow rewind at end of file @@ -20435,7 +19052,7 @@ index d6bb85b..4a9f99b 100644 // check how much off clock video is when ff/rw:ing // a problem here is that seeking isn't very accurate // and since the clock will be resynced after seek -@@ -1585,7 +1587,7 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1579,7 +1581,7 @@ void CDVDPlayer::HandlePlaySpeed() { CLog::Log(LOGDEBUG, "CDVDPlayer::Process - Seeking to catch up"); int64_t iTime = (int64_t)DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset + 500000.0 * m_playSpeed / DVD_PLAYSPEED_NORMAL); @@ -20444,7 +19061,7 @@ index d6bb85b..4a9f99b 100644 } } } -@@ -2073,7 +2075,7 @@ void CDVDPlayer::HandleMessages() +@@ -2067,7 +2069,7 @@ void CDVDPlayer::HandleMessages() else m_StateInput.dts = start; @@ -20453,7 +19070,7 @@ index d6bb85b..4a9f99b 100644 } else CLog::Log(LOGWARNING, "error while seeking"); -@@ -2212,9 +2214,10 @@ void CDVDPlayer::HandleMessages() +@@ -2206,9 +2208,10 @@ void CDVDPlayer::HandleMessages() double offset; offset = CDVDClock::GetAbsoluteClock() - m_State.timestamp; offset *= m_playSpeed / DVD_PLAYSPEED_NORMAL; @@ -20465,7 +19082,7 @@ index d6bb85b..4a9f99b 100644 m_State.timestamp = CDVDClock::GetAbsoluteClock(); } -@@ -2230,7 +2233,8 @@ void CDVDPlayer::HandleMessages() +@@ -2224,7 +2227,8 @@ void CDVDPlayer::HandleMessages() // do a seek after rewind, clock is not in sync with current pts if (m_playSpeed < 0 && speed >= 0) { @@ -20475,7 +19092,7 @@ index d6bb85b..4a9f99b 100644 } // if playspeed is different then DVD_PLAYSPEED_NORMAL or DVD_PLAYSPEED_PAUSE -@@ -3178,7 +3182,7 @@ bool CDVDPlayer::CloseTeletextStream(bool bWaitForBuffers) +@@ -3173,7 +3177,7 @@ bool CDVDPlayer::CloseTeletextStream(bool bWaitForBuffers) return true; } @@ -20484,7 +19101,7 @@ index d6bb85b..4a9f99b 100644 { double startpts; if(accurate) -@@ -3190,19 +3194,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3185,19 +3189,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) if(startpts != DVD_NOPTS_VALUE) startpts -= m_offset_pts; @@ -20512,7 +19129,7 @@ index d6bb85b..4a9f99b 100644 m_CurrentTeletext.dts = DVD_NOPTS_VALUE; m_CurrentTeletext.startpts = startpts; -@@ -3246,7 +3254,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3241,7 +3249,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) m_CurrentTeletext.started = false; } @@ -20522,10 +19139,10 @@ index d6bb85b..4a9f99b 100644 UpdatePlayState(0); diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index fa6c99f..6ca43d4 100644 +index ceb9996..dad94c9 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -304,7 +304,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer +@@ -303,7 +303,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer bool GetCachingTimes(double& play_left, double& cache_left, double& file_offset); @@ -20534,7 +19151,7 @@ index fa6c99f..6ca43d4 100644 void HandleMessages(); void HandlePlaySpeed(); -@@ -353,8 +353,9 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer +@@ -352,8 +352,9 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer int m_playSpeed; struct SSpeedState { @@ -20547,27 +19164,10 @@ index fa6c99f..6ca43d4 100644 int m_errorCount; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 2675af9..91ecece 100644 +index 74b4391..11e0b26 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1302,13 +1302,13 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - - if( m_speed < 0 ) - { -- double decoderPts = m_droppingStats.m_lastDecoderPts; -+ double inputPts = m_droppingStats.m_lastPts; - double renderPts = m_droppingStats.m_lastRenderPts; - if (pts > renderPts) - { -- if (decoderPts >= renderPts) -+ if (inputPts >= renderPts) - { -- Sleep(200); -+ Sleep(50); - } - return result | EOS_DROPPED; - } -@@ -1605,7 +1605,7 @@ double CDVDPlayerVideo::GetCurrentPts() +@@ -1500,7 +1500,7 @@ double CDVDPlayerVideo::GetCurrentPts() if( m_stalled ) iRenderPts = DVD_NOPTS_VALUE; @@ -20576,7 +19176,7 @@ index 2675af9..91ecece 100644 iRenderPts = iRenderPts - max(0.0, iSleepTime); return iRenderPts; -@@ -1705,6 +1705,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) +@@ -1600,6 +1600,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) int iSkippedDeint = 0; int iBufferLevel; @@ -20586,7 +19186,7 @@ index 2675af9..91ecece 100644 if (!m_pVideoCodec->GetCodecStats(iDecoderPts, iSkippedDeint, interlaced)) iDecoderPts = pts; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -index f395897..c9bf2f4 100644 +index 9477a6b..41e72c8 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h @@ -51,6 +51,7 @@ class CDroppingStats @@ -20596,22 +19196,22 @@ index f395897..c9bf2f4 100644 + double m_lastPts; unsigned int m_lateFrames; unsigned int m_dropRequests; - bool m_requestOutputDrop; + }; -- 1.8.1.6 -From d0b9b32b013f21e26a1a6aa914c102cfeeed4690 Mon Sep 17 00:00:00 2001 +From 234a032a70b18a2e11afac671d8f97cf9c4afadb Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 23 Nov 2012 17:41:12 +0100 -Subject: [PATCH 078/119] xrandr: fix query for multiple screens +Subject: [PATCH 076/105] xrandr: fix query for multiple screens --- xbmc/windowing/X11/XRandR.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index 75c84ea..2343ec0 100644 +index 97b1e32..a3d3543 100644 --- a/xbmc/windowing/X11/XRandR.cpp +++ b/xbmc/windowing/X11/XRandR.cpp @@ -57,12 +57,14 @@ bool CXRandR::Query(bool force) @@ -20645,10 +19245,10 @@ index 75c84ea..2343ec0 100644 1.8.1.6 -From 940827c15372ccf9bc2e39f9ab3bed7255a44b5d Mon Sep 17 00:00:00 2001 +From 3eaa7c7f1063f559e5ac2e5a4bc99382177bd18c Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Dec 2012 15:46:55 +0100 -Subject: [PATCH 079/119] X11: add debug log to print out refresh after xrr +Subject: [PATCH 077/105] X11: add debug log to print out refresh after xrr event --- @@ -20676,10 +19276,10 @@ index d2dcccd..7403785 100644 1.8.1.6 -From fe386755396379845cc90ed73f24dea261596f2c Mon Sep 17 00:00:00 2001 +From 46f3774c71c82f05347985da908f7cae23b183d7 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 11 Dec 2012 11:08:13 +0100 -Subject: [PATCH 080/119] X11: dont call XCloseDisplay on shutdown, it crashes +Subject: [PATCH 078/105] X11: dont call XCloseDisplay on shutdown, it crashes when powered doen by cec on ATI --- @@ -20704,17 +19304,17 @@ index 7403785..0e39867 100644 1.8.1.6 -From 163b9fda52729cc99219aa9da69f1fad94c019ae Mon Sep 17 00:00:00 2001 +From bf8b48724fee058a177410fc6d39eff15d050c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Coutant?= Date: Wed, 12 Dec 2012 19:49:47 +0100 -Subject: [PATCH 081/119] x11: support for multiple x screens +Subject: [PATCH 079/105] x11: support for multiple x screens --- xbmc/windowing/X11/XRandR.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index 2343ec0..9fcaec5 100644 +index a3d3543..8846bc6 100644 --- a/xbmc/windowing/X11/XRandR.cpp +++ b/xbmc/windowing/X11/XRandR.cpp @@ -92,7 +92,7 @@ bool CXRandR::Query(bool force, int screennum) @@ -20730,10 +19330,10 @@ index 2343ec0..9fcaec5 100644 1.8.1.6 -From e18e6a2f02e0831ccb2ff3466db131ff5b6ef3cd Mon Sep 17 00:00:00 2001 +From a6fd4f03aa7b1a677dc614d29881042c3211cbb2 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 24 Dec 2012 16:02:42 +0100 -Subject: [PATCH 082/119] pvr: increase changes counter of stream on stream +Subject: [PATCH 080/105] pvr: increase changes counter of stream on stream change, cosmetics after dd307930d39d92f145a01a16600cd00e01ec39be --- @@ -20767,10 +19367,10 @@ index 2c10a7b..6ea1f23 100644 1.8.1.6 -From af6eb861ea0c1d2a9ceec32556046bbc9ad2a183 Mon Sep 17 00:00:00 2001 +From 44b87dd56ac6550acce9b6000ff190c89f8c17f6 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 17 Jan 2013 16:03:22 +0100 -Subject: [PATCH 083/119] X11: add keymapping for XF86XK_Sleep +Subject: [PATCH 081/105] X11: add keymapping for XF86XK_Sleep --- xbmc/windowing/WinEventsX11.cpp | 1 + @@ -20792,21 +19392,21 @@ index 4a5aab4..da5d412 100644 1.8.1.6 -From c7f47065bfc3392d97ddc2e38b37ce49a19a4ea5 Mon Sep 17 00:00:00 2001 +From bbb47f08c0e9773d2ca2ec2dd7b3760fbc384654 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 21 Jan 2013 09:00:19 +0100 -Subject: [PATCH 084/119] X11: remove toggle full screen after resume +Subject: [PATCH 082/105] X11: remove toggle full screen after resume --- xbmc/powermanagement/PowerManager.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp -index 3e68ba8..65a63b1 100644 +index f2a063f..f1e3c4f 100644 --- a/xbmc/powermanagement/PowerManager.cpp +++ b/xbmc/powermanagement/PowerManager.cpp @@ -260,11 +260,6 @@ void CPowerManager::OnWake() - #if defined(_WIN32) + #if defined(TARGET_WINDOWS) ShowWindow(g_hWnd,SW_RESTORE); SetForegroundWindow(g_hWnd); -#elif !defined(TARGET_DARWIN_OSX) @@ -20821,17 +19421,17 @@ index 3e68ba8..65a63b1 100644 1.8.1.6 -From a7e26441e09112f7d79038f51e1d6a3d00fc3d80 Mon Sep 17 00:00:00 2001 +From b56fae395a63564a5a48ffae2d9d5535b36d226a Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:02 +0100 -Subject: [PATCH 085/119] xrandr: set screen on mode change command +Subject: [PATCH 083/105] xrandr: set screen on mode change command --- xbmc/windowing/X11/XRandR.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index 9fcaec5..b91178e 100644 +index 8846bc6..e6d6240 100644 --- a/xbmc/windowing/X11/XRandR.cpp +++ b/xbmc/windowing/X11/XRandR.cpp @@ -246,7 +246,7 @@ bool CXRandR::SetMode(XOutput output, XMode mode) @@ -20847,10 +19447,10 @@ index 9fcaec5..b91178e 100644 1.8.1.6 -From ed0241c13b3c938ab19fd0f3ada0e37c83447e9d Mon Sep 17 00:00:00 2001 +From 4740374a74ef4bd9a79b8441db7364432ce37df2 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:39 +0100 -Subject: [PATCH 086/119] X11: recreate glx context when output changes +Subject: [PATCH 084/105] X11: recreate glx context when output changes --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -20901,55 +19501,10 @@ index f479c27..7345c06 100644 1.8.1.6 -From 8cb06db3fc7f3971217de43704167cdfe7b558c5 Mon Sep 17 00:00:00 2001 -From: unknown -Date: Fri, 18 Jan 2013 15:16:38 +0100 -Subject: [PATCH 087/119] multi-screen: fix compilation on windows - ---- - xbmc/settings/DisplaySettings.cpp | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp -index 6da868a..05ee52f 100644 ---- a/xbmc/settings/DisplaySettings.cpp -+++ b/xbmc/settings/DisplaySettings.cpp -@@ -227,7 +227,10 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) - if (save) - m_ignoreSettingChanging.insert(make_pair("videoscreen.screenmode", true)); - -- bool outputChanged = !g_Windowing.IsCurrentOutput(CSettings::Get().GetString("videoscreen.monitor")); -+ bool outputChanged = false; -+#if defined(HAS_GLX) -+ outputChanged = !g_Windowing.IsCurrentOutput(CSettings::Get().GetString("videoscreen.monitor")); -+#endif - SetCurrentResolution(newRes, save); - g_graphicsContext.SetVideoResolution(newRes, outputChanged); - -@@ -619,6 +622,7 @@ void CDisplaySettings::SettingOptionsVerticalSyncsFiller(const CSetting *setting - - void CDisplaySettings::SettingOptionsMonitorsFiller(const CSetting *setting, std::vector< std::pair > &list, std::string ¤t) - { -+#if defined(HAS_GLX) - std::vector monitors; - g_Windowing.GetConnectedOutputs(&monitors); - for (unsigned int i=0; i Date: Fri, 14 Dec 2012 14:19:15 +0100 -Subject: [PATCH 088/119] pvr: do not show selection dialog for a single menu +Subject: [PATCH 085/105] pvr: do not show selection dialog for a single menu hook --- @@ -20957,10 +19512,10 @@ Subject: [PATCH 088/119] pvr: do not show selection dialog for a single menu 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp -index 16fad44..1c95c76 100644 +index 2b43bcb..d07f23d 100644 --- a/xbmc/pvr/addons/PVRClients.cpp +++ b/xbmc/pvr/addons/PVRClients.cpp -@@ -728,16 +728,19 @@ void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat) +@@ -728,16 +728,19 @@ void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, const CF if (GetConnectedClient(iClientID, client) && client->HaveMenuHooks(cat)) { hooks = client->GetMenuHooks(); @@ -20986,16 +19541,16 @@ index 16fad44..1c95c76 100644 - int selection = pDialog->GetSelectedLabel(); if (selection >= 0) - client->CallMenuHook(hooks->at(selection)); + client->CallMenuHook(hooks->at(selection), item); } -- 1.8.1.6 -From a1011197da33db5eaff1832fac651065a8ece9eb Mon Sep 17 00:00:00 2001 +From 7f7891ed08b742ef94a5d9a70680bace632d2cb8 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 3 Feb 2013 08:17:16 +0100 -Subject: [PATCH 089/119] X11: use default screen parameters if no output +Subject: [PATCH 086/105] X11: use default screen parameters if no output connected --- @@ -21099,10 +19654,10 @@ index d865cd7..97975dd 100644 1.8.1.6 -From 7476c9438f545a732ff8ddf214648b75c203e174 Mon Sep 17 00:00:00 2001 +From b491257c7c6c3cadd52552af52c81280b2d09da6 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 23 Mar 2013 15:13:32 +0100 -Subject: [PATCH 090/119] X11: create parent window +Subject: [PATCH 087/105] X11: create parent window --- xbmc/windowing/X11/WinSystemX11.cpp | 69 +++++++++++++++++++++++-------------- @@ -21368,10 +19923,10 @@ index 7345c06..770ae84 100644 1.8.1.6 -From 16c90e8a9c6b6b9bb935e51c1feaca30fff2b56f Mon Sep 17 00:00:00 2001 +From f83e6f35df169ecef7dc37e52395cb7a3f0eba44 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 12:30:12 +0100 -Subject: [PATCH 091/119] X11: use system key repeat rate instead of hardcoded +Subject: [PATCH 088/105] X11: use system key repeat rate instead of hardcoded one, taken from 58fd64b194e38b73b5f3132744bab35e994e7441 --- @@ -21573,10 +20128,10 @@ index 102a076..5b1f3fa 100644 1.8.1.6 -From e4d70da9a0b41780bc7d2be016caff33e4a146b4 Mon Sep 17 00:00:00 2001 +From 42f5e2a5f225b13ec703d005c40768fe6c809734 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 16:04:48 +0100 -Subject: [PATCH 092/119] linux: use CLOCK_MONOTONIC_RAW as this is not subject +Subject: [PATCH 089/105] linux: use CLOCK_MONOTONIC_RAW as this is not subject to NTP --- @@ -21614,57 +20169,54 @@ index 8304ef6..ba27257 100644 1.8.1.6 -From eb5661d7b3d7d291f5cc49cc877372cc806d1387 Mon Sep 17 00:00:00 2001 +From 17e7da272722e9b2e15ac32981ad0588f3bb50e4 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 15:18:53 +0100 -Subject: [PATCH 093/119] OMXPlayer: some caching fixes for pvr +Subject: [PATCH 090/105] OMXPlayer: some caching fixes for pvr --- xbmc/cores/omxplayer/OMXPlayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index 82d0024..ace2ce6 100644 +index 31739ad..0ac3d5f 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp -@@ -2328,7 +2328,8 @@ void COMXPlayer::HandleMessages() +@@ -2353,7 +2353,8 @@ void COMXPlayer::HandleMessages() // 1. disable audio // 2. skip frames and adjust their pts or the clock m_playSpeed = speed; - m_caching = CACHESTATE_DONE; + if (m_caching != CACHESTATE_PVR && m_playSpeed != DVD_PLAYSPEED_NORMAL) -+ SetCaching(CACHESTATE_DONE); - m_av_clock.SetSpeed(speed); ++ m_caching = CACHESTATE_DONE; + m_clock.SetSpeed(speed); m_av_clock.OMXSetSpeed(speed); - m_player_audio.SetSpeed(speed); + m_omxPlayerAudio.SetSpeed(speed); -- 1.8.1.6 -From 6c14ad0a7e86a3add030787d9671b8caa83872c1 Mon Sep 17 00:00:00 2001 +From eb8a9f51678369d9fa89e0f863a3c8bbd3d0900f Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 20:50:59 +0100 -Subject: [PATCH 094/119] fix incorrect display of fps when dr kicks in +Subject: [PATCH 091/105] fix incorrect display of fps when dr kicks in --- xbmc/Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 5a56954..15aff64 100644 +index d052473..4a174a5 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2163,13 +2163,14 @@ void CApplication::Render() +@@ -2139,10 +2139,11 @@ void CApplication::Render() if (frameTime < singleFrameTime) Sleep(singleFrameTime - frameTime); } - m_lastFrameTime = XbmcThreads::SystemClockMillis(); if (flip) - { g_graphicsContext.Flip(dirtyRegions); - g_renderManager.NotifyDisplayFlip(); - } + + m_lastFrameTime = XbmcThreads::SystemClockMillis(); CTimeUtils::UpdateFrameTime(flip); @@ -21674,17 +20226,17 @@ index 5a56954..15aff64 100644 1.8.1.6 -From 868dfff102c11d23775c6cdf7f977e6e605505ef Mon Sep 17 00:00:00 2001 +From 249ddebfc12651d4a39c53b956183e941f35f1ed Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 8 Apr 2013 11:18:31 +0200 -Subject: [PATCH 095/119] squash to dropping control +Subject: [PATCH 092/105] squash to dropping control --- 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 91ecece..b87666c 100644 +index 11e0b26..3f915ce 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -39,6 +39,7 @@ @@ -21699,307 +20251,10 @@ index 91ecece..b87666c 100644 1.8.1.6 -From 2daf7ef20c94eae7ba1fdcb993dc35ca8efc3b1c Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 6 Apr 2013 18:10:57 +0200 -Subject: [PATCH 096/119] enable dirty regions for video full screen - ---- - xbmc/Application.cpp | 13 ++----- - xbmc/cores/VideoRenderers/BaseRenderer.h | 1 + - xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 8 +++++ - xbmc/cores/VideoRenderers/LinuxRendererGLES.h | 1 + - xbmc/cores/VideoRenderers/OverlayRenderer.cpp | 14 ++++++++ - xbmc/cores/VideoRenderers/OverlayRenderer.h | 1 + - xbmc/cores/VideoRenderers/RenderManager.cpp | 45 +++++++++++++------------ - xbmc/cores/VideoRenderers/RenderManager.h | 3 +- - xbmc/video/windows/GUIWindowFullScreen.cpp | 15 +++++++-- - xbmc/video/windows/GUIWindowFullScreen.h | 2 ++ - 10 files changed, 68 insertions(+), 35 deletions(-) - -diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 15aff64..09c6ce5 100644 ---- a/xbmc/Application.cpp -+++ b/xbmc/Application.cpp -@@ -2008,14 +2008,6 @@ bool CApplication::RenderNoPresent() - // dont show GUI when playing full screen video - if (g_graphicsContext.IsFullScreenVideo()) - { -- if (m_bPresentFrame && IsPlaying() && !IsPaused()) -- { -- ResetScreenSaver(); -- g_renderManager.Present(); -- } -- else -- g_renderManager.RenderUpdate(true); -- - // close window overlays - CGUIDialog *overlay = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OVERLAY); - if (overlay) overlay->Close(true); -@@ -2087,7 +2079,6 @@ void CApplication::Render() - m_bPresentFrame = g_renderManager.HasFrame(); - if (!m_bPresentFrame && m_frameEvent.WaitMSec(100)) - m_bPresentFrame = g_renderManager.HasFrame(); -- hasRendered = true; - } - else - { -@@ -2154,7 +2145,7 @@ void CApplication::Render() - flip = true; - - //fps limiter, make sure each frame lasts at least singleFrameTime milliseconds -- if (limitFrames || !flip) -+ if (limitFrames || !(flip || m_bPresentFrame)) - { - if (!limitFrames) - singleFrameTime = 40; //if not flipping, loop at 25 fps -@@ -2167,12 +2158,12 @@ void CApplication::Render() - if (flip) - { - g_graphicsContext.Flip(dirtyRegions); -- g_renderManager.NotifyDisplayFlip(); - } - - m_lastFrameTime = XbmcThreads::SystemClockMillis(); - CTimeUtils::UpdateFrameTime(flip); - -+ g_renderManager.NotifyDisplayFlip(); - g_renderManager.UpdateResolution(); - g_renderManager.ManageCaptures(); - } -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index 8f31c65..3dc1f0a 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.h -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -89,6 +89,7 @@ class CBaseRenderer - virtual unsigned int GetMaxBufferSize() { return 0; } - virtual void SetBufferSize(int numBuffers) { } - virtual void ReleaseBuffer(int idx) { } -+ virtual bool HasFrame() { return true; } - - virtual bool Supports(ERENDERFEATURE feature) { return false; } - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -index 3602736..fe70afd 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -@@ -2013,5 +2013,13 @@ void CLinuxRendererGLES::AddProcessor(struct __CVBuffer *cvBufferRef, int index) - } - #endif - -+bool CLinuxRendererGLES::HasFrame() -+{ -+ if (m_format == RENDER_FMT_BYPASS) -+ return false; -+ else -+ return true; -+} -+ - #endif - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -index 9daf1c9..cc66d7c 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h -@@ -140,6 +140,7 @@ class CLinuxRendererGLES : public CBaseRenderer - virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } - virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } - virtual unsigned int GetProcessorSize() { return m_NumYV12Buffers; } -+ virtual bool HasFrame(); - - virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); - -diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -index abaaba6..455ced4 100644 ---- a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -@@ -176,6 +176,20 @@ void CRenderer::ReleaseBuffer(int idx) - Release(m_buffers[idx]); - } - -+bool CRenderer::HasOverlay() -+{ -+ bool hasOverlay = false; -+ -+ CSingleLock lock(m_section); -+ -+ SElementV& list = m_buffers[m_render]; -+ for(SElementV::iterator it = list.begin(); it != list.end(); ++it) -+ { -+ hasOverlay = true; -+ } -+ return hasOverlay; -+} -+ - void CRenderer::Render() - { - CSingleLock lock(m_section); -diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.h b/xbmc/cores/VideoRenderers/OverlayRenderer.h -index 83ea575..ae009ec 100644 ---- a/xbmc/cores/VideoRenderers/OverlayRenderer.h -+++ b/xbmc/cores/VideoRenderers/OverlayRenderer.h -@@ -101,6 +101,7 @@ - void Flush(); - void SetNumBuffers(int numBuffers) { m_iNumBuffers = numBuffers; } - void ReleaseBuffer(int idx); -+ bool HasOverlay(); - - protected: - -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 0b22a2b..29fc323 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -307,22 +307,7 @@ void CXBMCRenderManager::Update(bool bPauseDrawing) - - void CXBMCRenderManager::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - { -- { CRetakeLock lock(m_sharedSection); -- if (!m_pRenderer) -- return; -- -- if (m_presentstep == PRESENT_IDLE) -- PrepareNextRender(); -- -- if(m_presentstep == PRESENT_FLIP) -- { -- FlipRenderBuffer(); -- m_overlays.Flip(m_presentsource); -- m_pRenderer->FlipPage(m_presentsource); -- m_presentstep = PRESENT_FRAME; -- m_presentevent.Set(); -- } -- } -+ Prepare(); - - if (g_advancedSettings.m_videoDisableBackgroundDeinterlace) - { -@@ -709,11 +694,11 @@ void CXBMCRenderManager::Render(bool clear, DWORD flags, DWORD alpha) - m_overlays.Render(); - } - --void CXBMCRenderManager::Present() -+bool CXBMCRenderManager::Prepare() - { - { CRetakeLock lock(m_sharedSection); - if (!m_pRenderer) -- return; -+ return false; - - if (m_presentstep == PRESENT_IDLE) - PrepareNextRender(); -@@ -728,11 +713,29 @@ void CXBMCRenderManager::Present() - } - } - -+ if (m_presentstep != PRESENT_IDLE) -+ { -+ if (m_pRenderer->HasFrame() || m_overlays.HasOverlay()) -+ return true; -+ else -+ m_presentstep = PRESENT_IDLE; -+ } -+ return false; -+} -+ -+void CXBMCRenderManager::Present(bool wait) -+{ -+ if (!m_pRenderer) -+ return; -+ - Render(true, 0, 255); - -- /* wait for this present to be valid */ -- if(g_graphicsContext.IsFullScreenVideo()) -- WaitPresentTime(m_presenttime); -+ if (wait) -+ { -+ /* wait for this present to be valid */ -+ if(g_graphicsContext.IsFullScreenVideo()) -+ WaitPresentTime(m_presenttime); -+ } - - m_presentevent.Set(); - } -diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 8b1a8b7..2be0cd4 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -155,7 +155,8 @@ class CXBMCRenderManager - // Supported pixel formats, can be called before configure - std::vector SupportedFormats(); - -- void Present(); -+ bool Prepare(); -+ void Present(bool wait); - void Recover(); // called after resolution switch if something special is needed - - CSharedSection& GetSection() { return m_sharedSection; }; -diff --git a/xbmc/video/windows/GUIWindowFullScreen.cpp b/xbmc/video/windows/GUIWindowFullScreen.cpp -index 559a04c..fcffd7f 100644 ---- a/xbmc/video/windows/GUIWindowFullScreen.cpp -+++ b/xbmc/video/windows/GUIWindowFullScreen.cpp -@@ -419,6 +419,7 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message) - else - m_subsLayout = NULL; - -+ MarkDirtyRegion(); - return true; - } - case GUI_MSG_WINDOW_DEINIT: -@@ -745,15 +746,23 @@ void CGUIWindowFullScreen::FrameMove() - - void CGUIWindowFullScreen::Process(unsigned int currentTime, CDirtyRegionList &dirtyregion) - { -+ bool lastRender = m_hasRendered; -+ m_hasRendered = g_renderManager.Prepare(); -+ -+ if (m_hasRendered || lastRender) -+ MarkDirtyRegion(); -+ -+ CGUIWindow::Process(currentTime, dirtyregion); -+ - // TODO: This isn't quite optimal - ideally we'd only be dirtying up the actual video render rect - // which is probably the job of the renderer as it can more easily track resizing etc. -- MarkDirtyRegion(); -- CGUIWindow::Process(currentTime, dirtyregion); - m_renderRegion.SetRect(0, 0, (float)g_graphicsContext.GetWidth(), (float)g_graphicsContext.GetHeight()); - } - - void CGUIWindowFullScreen::Render() - { -+ bool wait = g_application.IsPlaying() && !g_application.IsPaused(); -+ g_renderManager.Present(wait); - if (g_application.m_pPlayer) - RenderTTFSubtitles(); - CGUIWindow::Render(); -@@ -945,5 +954,7 @@ void CGUIWindowFullScreen::ToggleOSD() - pOSD->Close(); - else - pOSD->DoModal(); -+ -+ MarkDirtyRegion(); - } - } -diff --git a/xbmc/video/windows/GUIWindowFullScreen.h b/xbmc/video/windows/GUIWindowFullScreen.h -index c42a095..0171c5e 100644 ---- a/xbmc/video/windows/GUIWindowFullScreen.h -+++ b/xbmc/video/windows/GUIWindowFullScreen.h -@@ -84,4 +84,6 @@ class CGUIWindowFullScreen : public CGUIWindow - - CCriticalSection m_fontLock; - CGUITextLayout* m_subsLayout; -+ -+ bool m_hasRendered; - }; --- -1.8.1.6 - - -From 8ef2a6a29305f379fe518bca0f1193b211193a61 Mon Sep 17 00:00:00 2001 +From a3ddcdb193a73cef9979c8a4bb9416904aa8c058 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Apr 2013 12:33:46 +0200 -Subject: [PATCH 097/119] pvr: try SwtichChannel when selecting a channel via +Subject: [PATCH 093/105] pvr: try SwtichChannel when selecting a channel via EPG --- @@ -22034,10 +20289,10 @@ index 6b999e4..256a295 100644 1.8.1.6 -From 5a3e2bac7e11ff3be43f0d373d10edc0878d4d75 Mon Sep 17 00:00:00 2001 +From c96b79e91757be2fa5814e2f3aff00c3741c7331 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 13 Apr 2013 08:32:06 +0200 -Subject: [PATCH 098/119] X11: fix mouse coverage +Subject: [PATCH 094/105] X11: fix mouse coverage --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++++--- @@ -22103,360 +20358,10 @@ index 770ae84..084f546 100644 1.8.1.6 -From 8caf7dce6a5ba8e78d9dd2d839a0ba05b60891ce Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 13 Apr 2013 11:30:39 +0200 -Subject: [PATCH 099/119] XVBA: revisit draw functions - ---- - lib/ffmpeg/libavcodec/xvba_h264.c | 2 +- - lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c -index ae45f3a..309d928 100644 ---- a/lib/ffmpeg/libavcodec/xvba_h264.c -+++ b/lib/ffmpeg/libavcodec/xvba_h264.c -@@ -160,7 +160,7 @@ static int end_frame(AVCodecContext *avctx) - h->got_first_iframe = 1; - } - -- ff_draw_horiz_band(h->avctx, &h->dsp, h->cur_pic_ptr, NULL, 0, h->avctx->height, h->picture_structure, h->first_field, 0, 0, 0, 0); -+ ff_h264_draw_horiz_band(h, 0, h->avctx->height); - - return 0; - } -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index bf3d9c2..ff35a28 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -142,7 +142,7 @@ static int end_frame(AVCodecContext *avctx) - break; - } - -- ff_draw_horiz_band(s->avctx, &s->dsp, s->current_picture_ptr, s->last_picture_ptr, 0, s->avctx->height, s->picture_structure, s->first_field, (s->unrestricted_mv && !s->intra_only), s->low_delay, s->v_edge_pos, s->h_edge_pos); -+ ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); - - return 0; - } --- -1.8.1.6 - - -From a57374350dc25fb6d14d9e421272bddc4695ad90 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 13 Apr 2013 12:06:02 +0200 -Subject: [PATCH 100/119] (ffmpeg): Make XVBA codec available - ---- - lib/ffmpeg/libavcodec/vc1dec.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/ffmpeg/libavcodec/vc1dec.c b/lib/ffmpeg/libavcodec/vc1dec.c -index 2130c74..4d611f9 100644 ---- a/lib/ffmpeg/libavcodec/vc1dec.c -+++ b/lib/ffmpeg/libavcodec/vc1dec.c -@@ -5807,6 +5807,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, - #if CONFIG_VDPAU - AV_PIX_FMT_VDPAU, - #endif -+#if CONFIG_XVBA -+ AV_PIX_FMT_XVBA_VLD, -+#endif - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_NONE - }; --- -1.8.1.6 - - -From bc4c880799c8581d18d243ceed415089ae09fd93 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 13 Apr 2013 16:38:50 +0200 -Subject: [PATCH 101/119] ffmpeg: XVBA-VC1 use v->second_field instead of - !s->first_field to make VC1 interlaced working - ---- - lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index ff35a28..04e7983 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -99,7 +99,7 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->sps_info.vc1.psf = v->psf; - // what about if it is a frame (page 31) - // looked at xvba-driver -- pic_descriptor->sps_info.vc1.second_field = !s->first_field; -+ pic_descriptor->sps_info.vc1.second_field = v->second_field; - pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; - - // VC-1 explicit parameters see page 30 of sdk --- -1.8.1.6 - - -From 80b58011872ef911874ca581a99e7de27d29b8d3 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 27 Apr 2013 17:36:15 +0200 -Subject: [PATCH 102/119] XVBA: Only set second_field when we are interlaced - and an interlaced field - ---- - lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index 04e7983..eb90c12 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -99,7 +99,7 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->sps_info.vc1.psf = v->psf; - // what about if it is a frame (page 31) - // looked at xvba-driver -- pic_descriptor->sps_info.vc1.second_field = v->second_field; -+ pic_descriptor->sps_info.vc1.second_field = v->interlace && v->second_field && (v->fcm == ILACE_FIELD); - pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; - - // VC-1 explicit parameters see page 30 of sdk --- -1.8.1.6 - - -From d295b564fa66700497819f0d6d166b4b052c0582 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 27 Apr 2013 22:08:50 +0200 -Subject: [PATCH 103/119] xvba: translate picture_structure to a value xvba - understands - ---- - lib/ffmpeg/libavcodec/xvba.c | 11 +++++++++++ - lib/ffmpeg/libavcodec/xvba_h264.c | 4 +++- - lib/ffmpeg/libavcodec/xvba_internal.h | 1 + - lib/ffmpeg/libavcodec/xvba_vc1.c | 4 +++- - 4 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c -index be29e5d..566922e 100644 ---- a/lib/ffmpeg/libavcodec/xvba.c -+++ b/lib/ffmpeg/libavcodec/xvba.c -@@ -31,6 +31,7 @@ - #include "xvba.h" - #include "xvba_internal.h" - #include "avcodec.h" -+#include "mpegvideo.h" - - int ff_xvba_translate_profile(int profile) { - -@@ -50,6 +51,16 @@ int ff_xvba_translate_profile(int profile) { - return -1; - } - -+// See page 25 of the documentation -+int ff_xvba_translate_picture_structure(int picture_structure) { -+ if(picture_structure == PICT_TOP_FIELD) -+ return 0; -+ else if (picture_structure == PICT_BOTTOM_FIELD) -+ return 1; -+ else //PICT_FRAME by default -+ return 3; -+} -+ - void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size) { - - render->buffers = av_fast_realloc( -diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c -index 309d928..20ba2f2 100644 ---- a/lib/ffmpeg/libavcodec/xvba_h264.c -+++ b/lib/ffmpeg/libavcodec/xvba_h264.c -@@ -87,7 +87,9 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->level = avctx->level; - pic_descriptor->width_in_mb = h->mb_width; - pic_descriptor->height_in_mb = h->mb_height; -- pic_descriptor->picture_structure = h->picture_structure; -+ -+ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(h->picture_structure); -+ - pic_descriptor->chroma_format = h->chroma_format_idc ? h->chroma_format_idc : 1; - pic_descriptor->avc_intra_flag = (h->slice_type == AV_PICTURE_TYPE_I) ? 1 : 0; - pic_descriptor->avc_reference = (h->cur_pic_ptr->f.reference & 3) ? 1 : 0; -diff --git a/lib/ffmpeg/libavcodec/xvba_internal.h b/lib/ffmpeg/libavcodec/xvba_internal.h -index 9653f85..18faa3e 100644 ---- a/lib/ffmpeg/libavcodec/xvba_internal.h -+++ b/lib/ffmpeg/libavcodec/xvba_internal.h -@@ -21,4 +21,5 @@ - */ - - int ff_xvba_translate_profile(int profile); -+int ff_xvba_translate_picture_structure(int picture_structure); - void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size); -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index eb90c12..c98dba5 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -78,7 +78,9 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->width_in_mb = s->mb_width; - pic_descriptor->height_in_mb = s->mb_height; - } -- pic_descriptor->picture_structure = s->picture_structure; -+ -+ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(s->picture_structure); -+ - // xvba-video set this to 1 only 4:2:0 supported - // doc says: if not set, choose 1 - we try this - pic_descriptor->chroma_format = 1; --- -1.8.1.6 - - -From 6bfd0e31bd795ef359728e7f18feee14587ceb5b Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 30 Apr 2013 21:18:55 +0200 -Subject: [PATCH 104/119] ffmpeg xvba: fix vc1 field interlace - ---- - lib/ffmpeg/libavcodec/xvba.c | 4 ++-- - lib/ffmpeg/libavcodec/xvba.h | 1 + - lib/ffmpeg/libavcodec/xvba_vc1.c | 1 + - 3 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c -index 566922e..c6ff2fe 100644 ---- a/lib/ffmpeg/libavcodec/xvba.c -+++ b/lib/ffmpeg/libavcodec/xvba.c -@@ -53,9 +53,9 @@ int ff_xvba_translate_profile(int profile) { - - // See page 25 of the documentation - int ff_xvba_translate_picture_structure(int picture_structure) { -- if(picture_structure == PICT_TOP_FIELD) -+ if(picture_structure == PICT_BOTTOM_FIELD) - return 0; -- else if (picture_structure == PICT_BOTTOM_FIELD) -+ else if (picture_structure == PICT_TOP_FIELD) - return 1; - else //PICT_FRAME by default - return 3; -diff --git a/lib/ffmpeg/libavcodec/xvba.h b/lib/ffmpeg/libavcodec/xvba.h -index 9f9ff0c..e590faf 100644 ---- a/lib/ffmpeg/libavcodec/xvba.h -+++ b/lib/ffmpeg/libavcodec/xvba.h -@@ -66,6 +66,7 @@ struct xvba_render_state { - unsigned int num_slices; - struct xvba_bitstream_buffers *buffers; - uint32_t buffers_alllocated; -+ int psf; - }; - - #endif /* AVCODEC_XVBA_H */ -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index c98dba5..e7a85a7 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -143,6 +143,7 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->future_surface = last->surface; - break; - } -+ render->psf = v->psf; - - ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); - --- -1.8.1.6 - - -From 2bc202fa8c404885869cfa0d2548485e1596c560 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 30 Apr 2013 21:19:07 +0200 -Subject: [PATCH 105/119] xvba: fix vc1 field interlace - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 43a331f..568632f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -1000,6 +1000,9 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *avctx, - { - startCodeSize = 4; - uint8_t sdf = 0x0d; -+ if (render->picture_descriptor->sps_info.vc1.second_field) -+ sdf = 0x0c; -+ - memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, - startCode, 3); - memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location+3, --- -1.8.1.6 - - -From d1ae97c9fcbb26a6f592e65a9562bd61cfcbdda2 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 30 Apr 2013 21:40:55 +0200 -Subject: [PATCH 106/119] xvba: vc1 - honor psf - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 568632f..1db9363 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -1181,6 +1181,7 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) - - render->state |= FF_XVBA_STATE_USED_FOR_REFERENCE; - render->state &= ~FF_XVBA_STATE_DECODED; -+ render->psf = 0; - pic->reordered_opaque= avctx->reordered_opaque; - - return 0; -@@ -1225,6 +1226,8 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame) - memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); - ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); - pic.render = render; -+ if (render->psf) -+ pic.DVDPic.iFlags &= ~DVP_FLAG_INTERLACED; - m_bufferStats.IncDecoded(); - m_xvbaOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); - --- -1.8.1.6 - - -From 2bfcb7cd09abdd9cece27079d71192387d3cd4cb Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 4 May 2013 10:31:32 +0200 -Subject: [PATCH 107/119] xvba: squash me, settings - ---- - xbmc/settings/Settings.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index 30e1780..b313c88 100644 ---- a/xbmc/settings/Settings.cpp -+++ b/xbmc/settings/Settings.cpp -@@ -738,6 +738,9 @@ void CSettings::InitializeConditions() - #ifdef HAVE_LIBVDPAU - m_settingsManager->AddCondition("have_libvdpau"); - #endif -+#ifdef HAVE_LIBXVBA -+ m_settingsManager->AddCondition("have_libxvba"); -+#endif - #ifdef HAVE_VIDEOTOOLBOXDECODER - m_settingsManager->AddCondition("have_videotoolboxdecoder"); - if (g_sysinfo.HasVideoToolBoxDecoder()) --- -1.8.1.6 - - -From caad1d1f16ad513eb491f078596c0577eff32e6a Mon Sep 17 00:00:00 2001 +From 7c7915b660e810f5d3adfbb47ea69e9cffa9d922 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 8 May 2013 13:14:58 +0200 -Subject: [PATCH 108/119] X11: fix incorrectly used screen num in desktop +Subject: [PATCH 095/105] X11: fix incorrectly used screen num in desktop resolution --- @@ -22491,10 +20396,10 @@ index bf95bc7..0221036 100644 1.8.1.6 -From fe3c26767ad9d36eae4c22810ae1e3f95263a0c2 Mon Sep 17 00:00:00 2001 +From d19e317f7a05fd53e211cbbefc86b0eb6c25c673 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 9 May 2013 12:07:09 +0200 -Subject: [PATCH 109/119] X11: do not overwrite user selected monitor with +Subject: [PATCH 096/105] X11: do not overwrite user selected monitor with fallback --- @@ -22619,213 +20524,18 @@ index 084f546..30f5fa0 100644 1.8.1.6 -From eaff060913827267eddd9c3ee795f92e8f2b65d6 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sat, 11 May 2013 13:27:12 +0200 -Subject: [PATCH 110/119] advance render buffers if video is playing but not - showed - ---- - xbmc/cores/VideoRenderers/RenderManager.cpp | 14 ++++++++++++++ - xbmc/cores/VideoRenderers/RenderManager.h | 1 + - 2 files changed, 15 insertions(+) - -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 29fc323..98fff42 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -275,6 +275,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi - m_presentevent.Set(); - ResetRenderBuffer(); - EnableBuffering(buffering); -+ m_bHasPrepared = false; - } - - return result; -@@ -700,6 +701,8 @@ bool CXBMCRenderManager::Prepare() - if (!m_pRenderer) - return false; - -+ m_bHasPrepared = true; -+ - if (m_presentstep == PRESENT_IDLE) - PrepareNextRender(); - -@@ -1115,6 +1118,16 @@ void CXBMCRenderManager::NotifyDisplayFlip() - if (!m_pRenderer) - return; - -+ if (!m_bIsStarted) -+ return; -+ -+ // advance buffers in case of video is not shown -+ if (!m_bHasPrepared) -+ { -+ if (Prepare()) -+ m_presentstep = PRESENT_IDLE; -+ } -+ - if (m_iNumRenderBuffers >= 3) - { - int last = m_iDisplayedRenderBuffer; -@@ -1135,6 +1148,7 @@ void CXBMCRenderManager::NotifyDisplayFlip() - } - } - -+ m_bHasPrepared = false; - lock.Leave(); - m_flipEvent.Set(); - } -diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 2be0cd4..9685349 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -272,6 +272,7 @@ class CXBMCRenderManager - bool m_bCodecSupportsBuffering; - int m_speed; - CEvent m_flipEvent; -+ bool m_bHasPrepared; - - struct - { --- -1.8.1.6 - - -From 66cd55e24e7253d908e8987f7565d72097d0f928 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sat, 11 May 2013 17:12:12 +0200 -Subject: [PATCH 111/119] X11: multi-head improvement - poll for desired output - if we do not get an xrr event - ---- - xbmc/windowing/WinEventsX11.cpp | 6 ++++++ - xbmc/windowing/WinEventsX11.h | 1 + - xbmc/windowing/X11/WinSystemX11.cpp | 33 +++++++++++++++++++++++++++++---- - xbmc/windowing/X11/WinSystemX11.h | 2 +- - 4 files changed, 37 insertions(+), 5 deletions(-) - -diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp -index 9caeabf..6696920 100644 ---- a/xbmc/windowing/WinEventsX11.cpp -+++ b/xbmc/windowing/WinEventsX11.cpp -@@ -204,6 +204,7 @@ bool CWinEventsX11::Init(Display *dpy, Window win) - WinEvents->m_wmDeleteMessage = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - WinEvents->m_structureChanged = false; - WinEvents->m_xrrEventPending = false; -+ WinEvents->m_xrrPollTimer.Set(3000); - - // open input method - char *old_locale = NULL, *old_modifiers = NULL; -@@ -582,6 +583,11 @@ bool CWinEventsX11::MessagePump() - g_Windowing.NotifyXRREvent(); - WinEvents->m_xrrEventPending = false; - } -+ else if (WinEvents && WinEvents->m_xrrPollTimer.IsTimePast()) -+ { -+ g_Windowing.NotifyXRREvent(true); -+ WinEvents->m_xrrPollTimer.Set(3000); -+ } - #endif - - #ifdef HAS_SDL_JOYSTICK -diff --git a/xbmc/windowing/WinEventsX11.h b/xbmc/windowing/WinEventsX11.h -index 5b1f3fa..d4a4b47 100644 ---- a/xbmc/windowing/WinEventsX11.h -+++ b/xbmc/windowing/WinEventsX11.h -@@ -54,5 +54,6 @@ class CWinEventsX11 : public CWinEventsBase - bool m_structureChanged; - int m_RREventBase; - XbmcThreads::EndTime m_xrrFailSafeTimer; -+ XbmcThreads::EndTime m_xrrPollTimer; - bool m_xrrEventPending; - }; -diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index e768c44..61f4115 100644 ---- a/xbmc/windowing/X11/WinSystemX11.cpp -+++ b/xbmc/windowing/X11/WinSystemX11.cpp -@@ -253,8 +253,21 @@ void CWinSystemX11::UpdateResolutions() - if(g_xrandr.Query(true)) - { - m_userOutput = CSettings::Get().GetString("videoscreen.monitor"); -+ - // check if the monitor is connected -- XOutput *out = g_xrandr.GetOutput(m_userOutput); -+ // might take a while when connected to a receiver -+ XbmcThreads::EndTime timeout(3000); -+ XOutput *out = NULL; -+ while (!timeout.IsTimePast()) -+ { -+ out = g_xrandr.GetOutput(m_userOutput); -+ if (out) -+ break; -+ -+ Sleep(500); -+ if (!g_xrandr.Query(true)) -+ break; -+ } - if (!out) - { - // choose first output -@@ -667,14 +680,26 @@ void CWinSystemX11::CheckDisplayEvents() - #endif - } - --void CWinSystemX11::NotifyXRREvent() -+void CWinSystemX11::NotifyXRREvent(bool poll) - { -- CLog::Log(LOGDEBUG, "%s - notify display reset event", __FUNCTION__); -+ // we may not get an event if desired monitor becomes available -+ // hence we need to poll -+ if (poll) -+ { -+ CStdString output = CSettings::Get().GetString("videoscreen.monitor"); -+ if (output.Equals(m_currentOutput)) -+ return; -+ g_xrandr.Query(true); -+ if (!g_xrandr.IsOutputConnected(output)) -+ return; -+ } -+ -+ CLog::Log(LOGDEBUG, "%s - notify display reset event, poll: %d", __FUNCTION__, poll); - m_windowDirty = true; - - CSingleLock lock(g_graphicsContext); - -- if (!g_xrandr.Query(true)) -+ if (!g_xrandr.Query(!poll)) - { - CLog::Log(LOGERROR, "WinSystemX11::RefreshWindow - failed to query xrandr"); - return; -diff --git a/xbmc/windowing/X11/WinSystemX11.h b/xbmc/windowing/X11/WinSystemX11.h -index 30f5fa0..9c7ecdd 100644 ---- a/xbmc/windowing/X11/WinSystemX11.h -+++ b/xbmc/windowing/X11/WinSystemX11.h -@@ -68,7 +68,7 @@ class CWinSystemX11 : public CWinSystemBase - Display* GetDisplay() { return m_dpy; } - GLXWindow GetWindow() { return m_glWindow; } - GLXContext GetGlxContext() { return m_glContext; } -- void NotifyXRREvent(); -+ void NotifyXRREvent(bool poll = false); - void GetConnectedOutputs(std::vector *outputs); - bool IsCurrentOutput(CStdString output); - void NotifyMouseCoverage(bool covered); --- -1.8.1.6 - - -From 2b95152b7d6471203b979a9f9a1833081d760460 Mon Sep 17 00:00:00 2001 +From d40bf02db479fe9afa00709b95666824f41dc665 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 12 May 2013 10:50:30 +0200 -Subject: [PATCH 112/119] xrandr: add turn on/off to wrapper +Subject: [PATCH 097/105] xrandr: add turn on/off to wrapper --- - xbmc/windowing/X11/XRandR.cpp | 76 ++++++++++++++++++++++++++++++++++++++----- - xbmc/windowing/X11/XRandR.h | 2 ++ - 2 files changed, 69 insertions(+), 9 deletions(-) + xbmc/windowing/X11/XRandR.cpp | 78 +++++++++++++++++++++++++++++++++++++++---- + xbmc/windowing/X11/XRandR.h | 6 ++-- + 2 files changed, 75 insertions(+), 9 deletions(-) diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index b91178e..a3022c9 100644 +index e6d6240..b76c4f6 100644 --- a/xbmc/windowing/X11/XRandR.cpp +++ b/xbmc/windowing/X11/XRandR.cpp @@ -28,6 +28,7 @@ @@ -22834,27 +20544,50 @@ index b91178e..a3022c9 100644 #include "../xbmc/utils/log.h" +#include "threads/SystemClock.h" - #if defined(__FreeBSD__) + #if defined(TARGET_FREEBSD) #include -@@ -123,7 +124,6 @@ bool CXRandR::Query(bool force, int screennum) - if (!xoutput.isConnected) - continue; +@@ -44,7 +45,7 @@ + Query(); + } -- bool hascurrent = false; - for (TiXmlElement* mode = output->FirstChildElement("mode"); mode; mode = mode->NextSiblingElement("mode")) - { - XMode xmode; -@@ -135,17 +135,75 @@ bool CXRandR::Query(bool force, int screennum) - xmode.isPreferred = (strcasecmp(mode->Attribute("preferred"), "true") == 0); +-bool CXRandR::Query(bool force) ++bool CXRandR::Query(bool force, bool ignoreoff) + { + if (!force) + if (m_bInit) +@@ -61,13 +62,13 @@ bool CXRandR::Query(bool force) + bool success = false; + for(unsigned int screennum=0; screennumAttribute("current"), "true") == 0); xoutput.modes.push_back(xmode); -- if (xmode.isCurrent) -+ } -+ m_outputs.push_back(xoutput); -+ } -+ return m_outputs.size() > 0; -+} -+ + if (xmode.isCurrent) +- { + hascurrent = true; +- } + } +- if (hascurrent) ++ if (hascurrent || !ignoreoff) + m_outputs.push_back(xoutput); + else + CLog::Log(LOGWARNING, "CXRandR::Query - output %s has no current mode, assuming disconnected", xoutput.name.c_str()); +@@ -148,6 +147,71 @@ bool CXRandR::Query(bool force, int screennum) + return m_outputs.size() > 0; + } + +bool CXRandR::TurnOffOutput(CStdString name) +{ + CStdString cmd; @@ -22888,21 +20621,15 @@ index b91178e..a3022c9 100644 + if (m_outputs[j].name == output->name) + { + for (unsigned int i = 0; i < m_outputs[j].modes.size(); i++) - { -- hascurrent = true; ++ { + if (m_outputs[j].modes[i].isPreferred) + { + mode = m_outputs[j].modes[i]; + break; + } - } - } -- if (hascurrent) -- m_outputs.push_back(xoutput); -- else -- CLog::Log(LOGWARNING, "CXRandR::Query - output %s has no current mode, assuming disconnected", xoutput.name.c_str()); - } -- return m_outputs.size() > 0; ++ } ++ } ++ } + + if (!mode.isPreferred) + return false; @@ -22924,10 +20651,12 @@ index b91178e..a3022c9 100644 + } + + return false; - } - ++} ++ std::vector CXRandR::GetModes(void) -@@ -161,7 +219,7 @@ void CXRandR::SaveState() + { + Query(); +@@ -161,7 +225,7 @@ void CXRandR::SaveState() bool CXRandR::SetMode(XOutput output, XMode mode) { @@ -22937,9 +20666,20 @@ index b91178e..a3022c9 100644 Query(); diff --git a/xbmc/windowing/X11/XRandR.h b/xbmc/windowing/X11/XRandR.h -index 26c2653..c70b3b1 100644 +index 26c2653..2741879 100644 --- a/xbmc/windowing/X11/XRandR.h +++ b/xbmc/windowing/X11/XRandR.h +@@ -94,8 +94,8 @@ class CXRandR + { + public: + CXRandR(bool query=false); +- bool Query(bool force=false); +- bool Query(bool force, int screennum); ++ bool Query(bool force=false, bool ignoreoff=true); ++ bool Query(bool force, int screennum, bool ignoreoff=true); + std::vector GetModes(void); + XMode GetCurrentMode(CStdString outputName); + XOutput *GetOutput(CStdString outputName); @@ -104,6 +104,8 @@ class CXRandR void SaveState(); void SetNumScreens(unsigned int num); @@ -22953,222 +20693,10 @@ index 26c2653..c70b3b1 100644 1.8.1.6 -From d1c2a83508b2bf6d99d6517bcd8468d00cb11cf6 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sun, 12 May 2013 10:51:02 +0200 -Subject: [PATCH 113/119] X11: add setting to switch off unused monitor - ---- - language/English/strings.po | 9 +++++++-- - system/settings/settings.xml | 6 ++++++ - xbmc/settings/DisplaySettings.cpp | 4 ++++ - xbmc/windowing/X11/WinSystemX11.cpp | 17 +++++++++++++++++ - 4 files changed, 34 insertions(+), 2 deletions(-) - -diff --git a/language/English/strings.po b/language/English/strings.po -index 52ee97a..ae7e117 100644 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -6232,7 +6232,7 @@ msgctxt "#14071" - msgid "Allow file renaming and deletion" - msgstr "" - --#empty strings from id 14072 to 14073 -+#empty strings from id 14073 to 14073 - - msgctxt "#14074" - msgid "Set timezone" -@@ -6364,7 +6364,12 @@ msgctxt "#14100" - msgid "Stop ripping CD" - msgstr "" - --#empty strings from id 14101 to 15014 -+#: xbmc/settings/settings.xml -+msgctxt "#14101" -+msgid "Swtich off other Monitor" -+msgstr "" -+ -+#empty strings from id 14102 to 15014 - - #: xbmc/dialogs/GUIDialogFavourites.cpp - msgctxt "#15015" -diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 3d95d9c..8170afe 100644 ---- a/system/settings/settings.xml -+++ b/system/settings/settings.xml -@@ -1860,6 +1860,11 @@ - - - -+ -+ HAS_GLX -+ 0 -+ false -+ - - 0 - 0 -@@ -1909,6 +1914,7 @@ - - - -+ !HAS_GLX - 1 - false - -diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp -index 05ee52f..28a4abe 100644 ---- a/xbmc/settings/DisplaySettings.cpp -+++ b/xbmc/settings/DisplaySettings.cpp -@@ -262,6 +262,10 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) - else - m_ignoreSettingChanging.erase(make_pair(settingId, true)); - } -+ else if (settingId == "videoscreen.monitorsingle") -+ { -+ g_Windowing.UpdateResolutions(); -+ } - - return true; - } -diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 61f4115..5d08a9b 100644 ---- a/xbmc/windowing/X11/WinSystemX11.cpp -+++ b/xbmc/windowing/X11/WinSystemX11.cpp -@@ -250,6 +250,7 @@ void CWinSystemX11::UpdateResolutions() - #if defined(HAS_XRANDR) - int numScreens = XScreenCount(m_dpy); - g_xrandr.SetNumScreens(numScreens); -+ - if(g_xrandr.Query(true)) - { - m_userOutput = CSettings::Get().GetString("videoscreen.monitor"); -@@ -274,6 +275,22 @@ void CWinSystemX11::UpdateResolutions() - m_userOutput = g_xrandr.GetModes()[0].name; - out = g_xrandr.GetOutput(m_userOutput); - } -+ -+ // switch on output -+ g_xrandr.TurnOnOutput(m_userOutput); -+ -+ // switch off other outputs if desired -+ if (CSettings::Get().GetBool("videoscreen.monitorsingle")) -+ { -+ std::vector outputs = g_xrandr.GetModes(); -+ for (int i=0; iisRotated; - if (!m_bIsRotated) --- -1.8.1.6 - - -From 13f8fe01b7b0bd89688184410c54691c477383ee Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Wed, 15 May 2013 08:04:45 +0200 -Subject: [PATCH 114/119] X11: multi-head - query number of screens when - polling for output - ---- - xbmc/windowing/X11/WinSystemX11.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 5d08a9b..1926806 100644 ---- a/xbmc/windowing/X11/WinSystemX11.cpp -+++ b/xbmc/windowing/X11/WinSystemX11.cpp -@@ -706,6 +706,8 @@ void CWinSystemX11::NotifyXRREvent(bool poll) - CStdString output = CSettings::Get().GetString("videoscreen.monitor"); - if (output.Equals(m_currentOutput)) - return; -+ int numScreens = XScreenCount(m_dpy); -+ g_xrandr.SetNumScreens(numScreens); - g_xrandr.Query(true); - if (!g_xrandr.IsOutputConnected(output)) - return; --- -1.8.1.6 - - -From 064fbc2cdbb501a97473556f6a6c3e3986627140 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Wed, 15 May 2013 09:13:14 +0200 -Subject: [PATCH 115/119] xrandr: set screen when switching off monitor - ---- - xbmc/windowing/X11/XRandR.cpp | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index a3022c9..5fc8d63 100644 ---- a/xbmc/windowing/X11/XRandR.cpp -+++ b/xbmc/windowing/X11/XRandR.cpp -@@ -143,10 +143,14 @@ bool CXRandR::Query(bool force, int screennum) - - bool CXRandR::TurnOffOutput(CStdString name) - { -+ XOutput *output = GetOutput(name); -+ if (!output) -+ return false; -+ - CStdString cmd; - cmd = getenv("XBMC_BIN_HOME"); - cmd += "/xbmc-xrandr"; -- cmd.AppendFormat(" --output %s --off", name.c_str()); -+ cmd.AppendFormat(" --screen %d --output %s --off", output->screen, name.c_str()); - - int status = system(cmd.c_str()); - if (status == -1) --- -1.8.1.6 - - -From 47b56b7d5ac178507227f79f46b16b8d23f3e80b Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Wed, 15 May 2013 09:14:34 +0200 -Subject: [PATCH 116/119] X11: ignore mouse move event form other windows - ---- - xbmc/windowing/WinEventsX11.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp -index 6696920..69066ac 100644 ---- a/xbmc/windowing/WinEventsX11.cpp -+++ b/xbmc/windowing/WinEventsX11.cpp -@@ -319,7 +319,7 @@ bool CWinEventsX11::MessagePump() - memset(&xevent, 0, sizeof (XEvent)); - XNextEvent(WinEvents->m_display, &xevent); - -- if (XFilterEvent(&xevent, None)) -+ if (XFilterEvent(&xevent, WinEvents->m_window)) - continue; - - switch (xevent.type) -@@ -520,6 +520,8 @@ bool CWinEventsX11::MessagePump() - - case MotionNotify: - { -+ if (xevent.xmotion.window != WinEvents->m_window) -+ break; - XBMC_Event newEvent; - memset(&newEvent, 0, sizeof(newEvent)); - newEvent.type = XBMC_MOUSEMOTION; --- -1.8.1.6 - - -From d9006870fbb54ec040cc2c23195db501bd9023c1 Mon Sep 17 00:00:00 2001 +From d92dfda6e2f00703e5bd8685e98fd29c586497dd Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 19 May 2013 12:55:35 +0200 -Subject: [PATCH 117/119] xrandr: add GetPreferredMode to wrapper +Subject: [PATCH 098/105] xrandr: add GetPreferredMode to wrapper --- xbmc/windowing/X11/XRandR.cpp | 23 +++++++++++++++++++++++ @@ -23176,10 +20704,10 @@ Subject: [PATCH 117/119] xrandr: add GetPreferredMode to wrapper 2 files changed, 24 insertions(+) diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index 5fc8d63..cab89a8 100644 +index b76c4f6..380a194 100644 --- a/xbmc/windowing/X11/XRandR.cpp +++ b/xbmc/windowing/X11/XRandR.cpp -@@ -345,6 +345,29 @@ XMode CXRandR::GetCurrentMode(CStdString outputName) +@@ -347,6 +347,29 @@ XMode CXRandR::GetCurrentMode(CStdString outputName) return result; } @@ -23210,11 +20738,11 @@ index 5fc8d63..cab89a8 100644 { Query(); diff --git a/xbmc/windowing/X11/XRandR.h b/xbmc/windowing/X11/XRandR.h -index c70b3b1..c67b489 100644 +index 2741879..24ad1d0 100644 --- a/xbmc/windowing/X11/XRandR.h +++ b/xbmc/windowing/X11/XRandR.h @@ -98,6 +98,7 @@ class CXRandR - bool Query(bool force, int screennum); + bool Query(bool force, int screennum, bool ignoreoff=true); std::vector GetModes(void); XMode GetCurrentMode(CStdString outputName); + XMode GetPreferredMode(CStdString outputName); @@ -23225,36 +20753,154 @@ index c70b3b1..c67b489 100644 1.8.1.6 -From 3d6b8b349de196f6be371a3917a02c6b1c36fbc8 Mon Sep 17 00:00:00 2001 +From f7b9460909f4ffbc6ac980188b33325f4696f2ff Mon Sep 17 00:00:00 2001 From: Rainer Hochecker -Date: Sun, 19 May 2013 12:57:21 +0200 -Subject: [PATCH 118/119] X11: squash to multi-head improvements +Date: Sat, 11 May 2013 17:12:12 +0200 +Subject: [PATCH 099/105] X11: multi-head improvement - poll for desired output + if we do not get an xrr event --- - xbmc/windowing/X11/WinSystemX11.cpp | 28 +++++++++++++++++++++++++--- - xbmc/windowing/X11/WinSystemX11.h | 1 + - 2 files changed, 26 insertions(+), 3 deletions(-) + language/English/strings.po | 9 +++- + system/settings/settings.xml | 6 +++ + xbmc/settings/DisplaySettings.cpp | 4 ++ + xbmc/windowing/WinEventsX11.cpp | 6 +++ + xbmc/windowing/WinEventsX11.h | 1 + + xbmc/windowing/X11/WinSystemX11.cpp | 83 +++++++++++++++++++++++++++++++++---- + xbmc/windowing/X11/WinSystemX11.h | 2 +- + xbmc/windowing/X11/XRandR.cpp | 6 ++- + 8 files changed, 105 insertions(+), 12 deletions(-) +diff --git a/language/English/strings.po b/language/English/strings.po +index 8ffd225..9e847a1 100644 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -6236,7 +6236,7 @@ msgctxt "#14071" + msgid "Allow file renaming and deletion" + msgstr "" + +-#empty strings from id 14072 to 14073 ++#empty strings from id 14073 to 14073 + + msgctxt "#14074" + msgid "Set timezone" +@@ -6368,7 +6368,12 @@ msgctxt "#14100" + msgid "Stop ripping CD" + msgstr "" + +-#empty strings from id 14101 to 15014 ++#: xbmc/settings/settings.xml ++msgctxt "#14101" ++msgid "Swtich off other Monitor" ++msgstr "" ++ ++#empty strings from id 14102 to 15014 + + #: xbmc/dialogs/GUIDialogFavourites.cpp + msgctxt "#15015" +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index a863dae..1102691 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -1855,6 +1855,11 @@ + + + ++ ++ HAS_GLX ++ 0 ++ false ++ + + 0 + 0 +@@ -1906,6 +1911,7 @@ + + + ++ !HAS_GLX + 1 + false + +diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp +index 6d1c6b1..9185982 100644 +--- a/xbmc/settings/DisplaySettings.cpp ++++ b/xbmc/settings/DisplaySettings.cpp +@@ -244,6 +244,10 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) + m_resolutionChangeAborted = false; + } + } ++ else if (settingId == "videoscreen.monitorsingle") ++ { ++ g_Windowing.UpdateResolutions(); ++ } + + return true; + } +diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp +index 9caeabf..879d8f2 100644 +--- a/xbmc/windowing/WinEventsX11.cpp ++++ b/xbmc/windowing/WinEventsX11.cpp +@@ -204,6 +204,7 @@ bool CWinEventsX11::Init(Display *dpy, Window win) + WinEvents->m_wmDeleteMessage = XInternAtom(dpy, "WM_DELETE_WINDOW", False); + WinEvents->m_structureChanged = false; + WinEvents->m_xrrEventPending = false; ++ WinEvents->m_xrrPollTimer.Set(3000); + + // open input method + char *old_locale = NULL, *old_modifiers = NULL; +@@ -582,6 +583,11 @@ bool CWinEventsX11::MessagePump() + g_Windowing.NotifyXRREvent(); + WinEvents->m_xrrEventPending = false; + } ++ else if (!g_application.IsPlaying() && WinEvents && WinEvents->m_xrrPollTimer.IsTimePast()) ++ { ++ g_Windowing.NotifyXRREvent(true); ++ WinEvents->m_xrrPollTimer.Set(3000); ++ } + #endif + + #ifdef HAS_SDL_JOYSTICK +diff --git a/xbmc/windowing/WinEventsX11.h b/xbmc/windowing/WinEventsX11.h +index 5b1f3fa..d4a4b47 100644 +--- a/xbmc/windowing/WinEventsX11.h ++++ b/xbmc/windowing/WinEventsX11.h +@@ -54,5 +54,6 @@ class CWinEventsX11 : public CWinEventsBase + bool m_structureChanged; + int m_RREventBase; + XbmcThreads::EndTime m_xrrFailSafeTimer; ++ XbmcThreads::EndTime m_xrrPollTimer; + bool m_xrrEventPending; + }; diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 1926806..d08d2c0 100644 +index e768c44..6b1ed87 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp -@@ -60,6 +60,7 @@ - m_dpyLostTime = 0; - m_invisibleCursor = 0; - m_bIsInternalXrr = false; -+ m_ignoreOutputSetToOff = false; - - XSetErrorHandler(XErrorHandler); - } -@@ -263,7 +264,16 @@ void CWinSystemX11::UpdateResolutions() - { - out = g_xrandr.GetOutput(m_userOutput); - if (out) -- break; +@@ -250,18 +250,62 @@ void CWinSystemX11::UpdateResolutions() + #if defined(HAS_XRANDR) + int numScreens = XScreenCount(m_dpy); + g_xrandr.SetNumScreens(numScreens); +- if(g_xrandr.Query(true)) ++ ++ bool switchOnOff = CSettings::Get().GetBool("videoscreen.monitorsingle"); ++ m_userOutput = CSettings::Get().GetString("videoscreen.monitor"); ++ if (m_userOutput.Equals("Default")) ++ switchOnOff = false; ++ ++ if(g_xrandr.Query(true, !switchOnOff)) + { +- m_userOutput = CSettings::Get().GetString("videoscreen.monitor"); + // check if the monitor is connected +- XOutput *out = g_xrandr.GetOutput(m_userOutput); ++ // might take a while when connected to a receiver ++ XbmcThreads::EndTime timeout(3000); ++ XOutput *out = NULL; ++ while (!m_userOutput.Equals("Default") && !timeout.IsTimePast()) ++ { ++ out = g_xrandr.GetOutput(m_userOutput); ++ if (out) + { + XMode mode = g_xrandr.GetCurrentMode(m_userOutput); -+ if (mode.isCurrent || !m_ignoreOutputSetToOff) ++ if (mode.isCurrent || switchOnOff) + break; + else + { @@ -23262,59 +20908,89 @@ index 1926806..d08d2c0 100644 + break; + } + } - - Sleep(500); - if (!g_xrandr.Query(true)) -@@ -277,7 +287,8 @@ void CWinSystemX11::UpdateResolutions() ++ ++ Sleep(500); ++ if (!g_xrandr.Query(true, !switchOnOff)) ++ break; ++ } + if (!out) + { +- // choose first output + m_userOutput = g_xrandr.GetModes()[0].name; + out = g_xrandr.GetOutput(m_userOutput); } - - // switch on output -- g_xrandr.TurnOnOutput(m_userOutput); -+ if(!m_ignoreOutputSetToOff) ++ ++ // switch on output ++ if(switchOnOff) + g_xrandr.TurnOnOutput(m_userOutput); - - // switch off other outputs if desired - if (CSettings::Get().GetBool("videoscreen.monitorsingle")) -@@ -292,6 +303,8 @@ void CWinSystemX11::UpdateResolutions() - } - ++ ++ // switch off other outputs if desired ++ if (switchOnOff) ++ { ++ std::vector outputs = g_xrandr.GetModes(); ++ for (int i=0; iisRotated; if (!m_bIsRotated) UpdateDesktopResolution(CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP), 0, mode.w, mode.h, mode.hz); -@@ -410,6 +423,7 @@ bool CWinSystemX11::HasCalibration(const RESOLUTION_INFO &resInfo) +@@ -380,7 +424,9 @@ bool CWinSystemX11::HasCalibration(const RESOLUTION_INFO &resInfo) void CWinSystemX11::GetConnectedOutputs(std::vector *outputs) { vector outs; + g_xrandr.Query(true); outs = g_xrandr.GetModes(); ++ outputs->push_back("Default"); for(unsigned int i=0; ipush_back(outs[i].name); +@@ -667,14 +713,34 @@ void CWinSystemX11::CheckDisplayEvents() + #endif + } + +-void CWinSystemX11::NotifyXRREvent() ++void CWinSystemX11::NotifyXRREvent(bool poll) + { +- CLog::Log(LOGDEBUG, "%s - notify display reset event", __FUNCTION__); ++ // we may not get an event if desired monitor becomes available ++ // hence we need to poll ++ if (poll) ++ { ++ CStdString output = CSettings::Get().GetString("videoscreen.monitor"); ++ if (output.Equals(m_currentOutput) || m_userOutput.Equals("Default")) ++ return; ++ ++ int numScreens = XScreenCount(m_dpy); ++ g_xrandr.SetNumScreens(numScreens); ++ g_xrandr.Query(true); ++ if (!g_xrandr.IsOutputConnected(output)) ++ return; + + // if output is turned off by user, respect it + XMode mode = g_xrandr.GetCurrentMode(output); + if (!mode.isCurrent) + return; - } ++ } ++ ++ CLog::Log(LOGDEBUG, "%s - notify display reset event, poll: %d", __FUNCTION__, poll); + m_windowDirty = true; - CLog::Log(LOGDEBUG, "%s - notify display reset event, poll: %d", __FUNCTION__, poll); -@@ -727,7 +746,9 @@ void CWinSystemX11::NotifyXRREvent(bool poll) - // if external event update resolutions - if (!m_bIsInternalXrr) + CSingleLock lock(g_graphicsContext); + +- if (!g_xrandr.Query(true)) ++ if (!g_xrandr.Query(!poll)) { -+ m_ignoreOutputSetToOff = true; - UpdateResolutions(); -+ m_ignoreOutputSetToOff = false; - } - m_bIsInternalXrr = false; - -@@ -745,7 +766,8 @@ void CWinSystemX11::NotifyXRREvent(bool poll) + CLog::Log(LOGERROR, "WinSystemX11::RefreshWindow - failed to query xrandr"); + return; +@@ -701,7 +767,8 @@ void CWinSystemX11::NotifyXRREvent() bool found(false); for (i = RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); ++i) { @@ -23325,50 +21001,268 @@ index 1926806..d08d2c0 100644 found = true; break; diff --git a/xbmc/windowing/X11/WinSystemX11.h b/xbmc/windowing/X11/WinSystemX11.h -index 9c7ecdd..c1c9b25 100644 +index 30f5fa0..9c7ecdd 100644 --- a/xbmc/windowing/X11/WinSystemX11.h +++ b/xbmc/windowing/X11/WinSystemX11.h -@@ -98,6 +98,7 @@ class CWinSystemX11 : public CWinSystemBase - bool m_windowDirty; - bool m_bIsInternalXrr; - bool m_newGlContext; -+ bool m_ignoreOutputSetToOff; +@@ -68,7 +68,7 @@ class CWinSystemX11 : public CWinSystemBase + Display* GetDisplay() { return m_dpy; } + GLXWindow GetWindow() { return m_glWindow; } + GLXContext GetGlxContext() { return m_glContext; } +- void NotifyXRREvent(); ++ void NotifyXRREvent(bool poll = false); + void GetConnectedOutputs(std::vector *outputs); + bool IsCurrentOutput(CStdString output); + void NotifyMouseCoverage(bool covered); +diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp +index 380a194..650a6ef 100644 +--- a/xbmc/windowing/X11/XRandR.cpp ++++ b/xbmc/windowing/X11/XRandR.cpp +@@ -149,10 +149,14 @@ bool CXRandR::Query(bool force, int screennum, bool ignoreoff) - private: - bool IsSuitableVisual(XVisualInfo *vInfo); + bool CXRandR::TurnOffOutput(CStdString name) + { ++ XOutput *output = GetOutput(name); ++ if (!output) ++ return false; ++ + CStdString cmd; + cmd = getenv("XBMC_BIN_HOME"); + cmd += "/xbmc-xrandr"; +- cmd.AppendFormat(" --output %s --off", name.c_str()); ++ cmd.AppendFormat(" --screen %d --output %s --off", output->screen, name.c_str()); + + int status = system(cmd.c_str()); + if (status == -1) -- 1.8.1.6 -From f828567c1c2203fe9e8e2aa3a81cff4de9d7761f Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Fri, 24 May 2013 12:02:02 +0200 -Subject: [PATCH 119/119] XVBA: Limit video to 2048x1152 as this is the max all - blocks can handle +From 76d65994815eeb4ee713cea1f81fff9240963bd5 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Wed, 15 May 2013 09:14:34 +0200 +Subject: [PATCH 100/105] X11: ignore mouse move event form other windows --- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) + xbmc/windowing/WinEventsX11.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 1db9363..54d7aea 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -340,10 +340,12 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - // it seems that xvba does not support anything > 2k - // return false, for files that are larger - // if you are unlucky, this would kill your decoder -- // we limit to 2048x1536(+8) now - as this was tested working -+ // we limit to 2048x1152 now - as this was reported by ckoenig the UVD OSS -+ // engineer to be the maximum technically possible for all hardware with UVD. -+ // Some chips can do a bit more, but we use the safe default. - int surfaceWidth = (avctx->coded_width+15) & ~15; - int surfaceHeight = (avctx->coded_height+15) & ~15; -- if(surfaceHeight > 1544 || surfaceWidth > 2048) -+ if(surfaceHeight > 1152 || surfaceWidth > 2048) - { - CLog::Log(LOGERROR, "Surface too large, decoder skipped: surfaceWidth %u, surfaceHeight %u", - surfaceWidth, surfaceHeight); +diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp +index 879d8f2..2ec9b6f 100644 +--- a/xbmc/windowing/WinEventsX11.cpp ++++ b/xbmc/windowing/WinEventsX11.cpp +@@ -319,7 +319,7 @@ bool CWinEventsX11::MessagePump() + memset(&xevent, 0, sizeof (XEvent)); + XNextEvent(WinEvents->m_display, &xevent); + +- if (XFilterEvent(&xevent, None)) ++ if (XFilterEvent(&xevent, WinEvents->m_window)) + continue; + + switch (xevent.type) +@@ -520,6 +520,8 @@ bool CWinEventsX11::MessagePump() + + case MotionNotify: + { ++ if (xevent.xmotion.window != WinEvents->m_window) ++ break; + XBMC_Event newEvent; + memset(&newEvent, 0, sizeof(newEvent)); + newEvent.type = XBMC_MOUSEMOTION; +-- +1.8.1.6 + + +From 0a185e523678e7c4c621fd777a2bb588410b67d5 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sun, 2 Jun 2013 14:53:45 +0200 +Subject: [PATCH 101/105] vdpau: fix segfault caused by uninitialized member + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index 1aeef6a..4543d3e 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -90,6 +90,7 @@ + m_vdpauConfig.videoSurfaceSec = &m_videoSurfaceSec; + + m_vdpauConfigured = false; ++ m_hwContext.bitstream_buffers_allocated = 0; + m_DisplayState = VDPAU_OPEN; + } + +-- +1.8.1.6 + + +From ca43f3469f690b9e8a4dd818e2349618c760fb51 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Tue, 11 Jun 2013 16:13:45 +0200 +Subject: [PATCH 102/105] vdpau: sync video mixer + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index 4543d3e..93c1782 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -2350,6 +2350,21 @@ void CMixer::ProcessPicture() + NULL); + CheckStatus(vdp_st, __LINE__); + ++ // sync mixer, read blocks until output surface is written ++ { ++ uint32_t data[16]; ++ VdpRect rect; ++ rect.x0 = rect.y0 = 0; ++ rect.x1 = rect.y1 = 1; ++ uint32_t *pdata[] = {data}; ++ uint32_t pitches[] = {4}; ++ ++ vdp_st = m_config.vdpProcs.vdp_output_surface_get_bits_native(m_processPicture.outputSurface, ++ &rect, ++ (void**)pdata, ++ pitches); ++ } ++ + if (m_mixerfield != VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME) + { + // in order to clip top and bottom lines when de-interlacing +-- +1.8.1.6 + + +From f7b1f3a1dbf3e1a5440980e105b2b8ccd892b62d Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Tue, 11 Jun 2013 16:20:29 +0200 +Subject: [PATCH 103/105] renderer: allow some lateness within vblank interval + +--- + xbmc/cores/VideoRenderers/RenderManager.cpp | 12 ++++++++++-- + xbmc/cores/VideoRenderers/RenderManager.h | 1 + + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index 2834708..3ea7240 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -396,6 +396,8 @@ void CXBMCRenderManager::FrameFinish() + if(g_graphicsContext.IsFullScreenVideo()) + WaitPresentTime(m.timestamp); + ++ m_clock_framefinish = GetPresentTime(); ++ + { CSingleLock lock(m_presentlock); + + if(m_presentstep == PRESENT_FRAME) +@@ -1039,6 +1041,12 @@ void CXBMCRenderManager::PrepareNextRender() + + double clocktime = GetPresentTime(); + double frametime = 1.0 / GetMaximumFPS(); ++ double correction = 0.0; ++ int fps = g_VideoReferenceClock.GetRefreshRate(); ++ if((fps > 0) && g_graphicsContext.IsFullScreenVideo() && (clocktime != m_clock_framefinish)) ++ { ++ correction = frametime; ++ } + + /* see if any future queued frames are already due */ + std::deque::reverse_iterator curr, prev; +@@ -1047,8 +1055,8 @@ void CXBMCRenderManager::PrepareNextRender() + ++prev; + while (prev != m_queued.rend()) + { +- if(clocktime > m_Queue[*prev].timestamp /* previous frame is late */ +- && clocktime > m_Queue[*curr].timestamp - frametime) /* selected frame is close to it's display time */ ++ if(clocktime > m_Queue[*prev].timestamp + correction /* previous frame is late */ ++ && clocktime > m_Queue[*curr].timestamp - frametime + correction) /* selected frame is close to it's display time */ + break; + ++curr; + ++prev; +diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h +index 2c5ccf4..90f8af9 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.h ++++ b/xbmc/cores/VideoRenderers/RenderManager.h +@@ -251,6 +251,7 @@ class CXBMCRenderManager + XbmcThreads::ConditionVariable m_presentevent; + CCriticalSection m_presentlock; + CEvent m_flushEvent; ++ double m_clock_framefinish; + + + OVERLAY::CRenderer m_overlays; +-- +1.8.1.6 + + +From d465f05c1849e39448dec13e1106679e01944301 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 14 Jun 2013 09:23:22 +0200 +Subject: [PATCH 104/105] vdpau: calculate timestamp of second field when doing + deinterlacing + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index 93c1782..ace5d49 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -2314,7 +2314,9 @@ void CMixer::ProcessPicture() + futu_surfaces[0] = m_mixerInput[1].render->surface; + futu_surfaces[1] = m_mixerInput[1].render->surface; + +- m_processPicture.DVDPic.pts = DVD_NOPTS_VALUE; ++ m_processPicture.DVDPic.pts = m_mixerInput[1].DVDPic.pts + ++ (m_mixerInput[0].DVDPic.pts - ++ m_mixerInput[1].DVDPic.pts) / 2; + m_processPicture.DVDPic.dts = DVD_NOPTS_VALUE; + } + m_processPicture.DVDPic.iRepeatPicture = 0.0; +-- +1.8.1.6 + + +From a284bab6839df46627cf20546013c24590dc9c03 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 14 Jun 2013 10:46:58 +0200 +Subject: [PATCH 105/105] vdpau: comment debug log: long decoding time + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index ace5d49..0c4b4d0 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -874,7 +874,7 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s, + return; + } + +- uint64_t startTime = CurrentHostCounter(); ++// uint64_t startTime = CurrentHostCounter(); + uint16_t decoded, processed, rend; + vdp->m_bufferStats.Get(decoded, processed, rend); + vdp_st = vdp->m_vdpauConfig.vdpProcs.vdp_decoder_render(vdp->m_vdpauConfig.vdpDecoder, +@@ -883,9 +883,9 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s, + vdp->m_hwContext.bitstream_buffers_used, + vdp->m_hwContext.bitstream_buffers); + vdp->CheckStatus(vdp_st, __LINE__); +- uint64_t diff = CurrentHostCounter() - startTime; +- if (diff*1000/CurrentHostFrequency() > 30) +- CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); ++// uint64_t diff = CurrentHostCounter() - startTime; ++// if (diff*1000/CurrentHostFrequency() > 30) ++// CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); + + } + -- 1.8.1.6 diff --git a/packages/mediacenter/xbmc/patches/31f386c/xbmc-995.10-disable-alt-tab.patch b/packages/mediacenter/xbmc/patches/57f529b/xbmc-995.10-disable-alt-tab.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/31f386c/xbmc-995.10-disable-alt-tab.patch rename to packages/mediacenter/xbmc/patches/57f529b/xbmc-995.10-disable-alt-tab.patch diff --git a/packages/mediacenter/xbmc/patches/31f386c/xbmc-999.01-automake-1.13.patch b/packages/mediacenter/xbmc/patches/57f529b/xbmc-999.01-automake-1.13.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/31f386c/xbmc-999.01-automake-1.13.patch rename to packages/mediacenter/xbmc/patches/57f529b/xbmc-999.01-automake-1.13.patch From 94a5bfbcd147a988014c7eb687ba8dc1b91b33a0 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sun, 16 Jun 2013 00:31:03 +0300 Subject: [PATCH 06/14] vdr-addon: bump --- packages/addons/service/multimedia/vdr-addon/changelog.txt | 3 +++ packages/addons/service/multimedia/vdr-addon/meta | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/addons/service/multimedia/vdr-addon/changelog.txt b/packages/addons/service/multimedia/vdr-addon/changelog.txt index b4231be586..6999ae657d 100644 --- a/packages/addons/service/multimedia/vdr-addon/changelog.txt +++ b/packages/addons/service/multimedia/vdr-addon/changelog.txt @@ -1,3 +1,6 @@ +3.0.11 +- fix epg/live charset issue + 3.0.10 - improve suspend/resume diff --git a/packages/addons/service/multimedia/vdr-addon/meta b/packages/addons/service/multimedia/vdr-addon/meta index ed5a862813..ede6c9dc02 100644 --- a/packages/addons/service/multimedia/vdr-addon/meta +++ b/packages/addons/service/multimedia/vdr-addon/meta @@ -21,7 +21,7 @@ PKG_NAME="vdr-addon" PKG_VERSION="3.0" -PKG_REV="10" +PKG_REV="11" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.openelec.tv" From 1fab3c990c9e4e11519eb105c23ad951b5fd6051 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 15 Jun 2013 23:35:39 +0200 Subject: [PATCH 07/14] projects/RPi: update RPi kernel patch Signed-off-by: Stephan Raue --- projects/RPi/linux/linux.arm.conf | 4 +- ...tch => linux-01-RPi_support-975bd78.patch} | 1814 ++++++----------- 2 files changed, 616 insertions(+), 1202 deletions(-) rename projects/RPi/patches/linux/{linux-01-RPi_support-5ded0f9.patch => linux-01-RPi_support-975bd78.patch} (98%) diff --git a/projects/RPi/linux/linux.arm.conf b/projects/RPi/linux/linux.arm.conf index 754946206c..3e8b90bbb8 100644 --- a/projects/RPi/linux/linux.arm.conf +++ b/projects/RPi/linux/linux.arm.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 3.9.2 Kernel Configuration +# Linux/arm 3.9.6 Kernel Configuration # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -58,7 +58,6 @@ CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_HARDIRQS_SW_RESEND=y -# CONFIG_ALWAYS_USE_PERSISTENT_CLOCK is not set CONFIG_KTIME_SCALAR=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BUILD=y @@ -282,6 +281,7 @@ CONFIG_BCM2708_GPIO=y CONFIG_BCM2708_VCMEM=y # CONFIG_BCM2708_NOL2CACHE is not set CONFIG_BCM2708_DMAER=y +CONFIG_BCM2708_SPIDEV=y # # Processor Type diff --git a/projects/RPi/patches/linux/linux-01-RPi_support-5ded0f9.patch b/projects/RPi/patches/linux/linux-01-RPi_support-975bd78.patch similarity index 98% rename from projects/RPi/patches/linux/linux-01-RPi_support-5ded0f9.patch rename to projects/RPi/patches/linux/linux-01-RPi_support-975bd78.patch index 547d2b272e..832a64cdcd 100644 --- a/projects/RPi/patches/linux/linux-01-RPi_support-5ded0f9.patch +++ b/projects/RPi/patches/linux/linux-01-RPi_support-975bd78.patch @@ -1,7 +1,7 @@ -From cbf7cb1e733f0b7c117d55519ffaab6513b3db93 Mon Sep 17 00:00:00 2001 +From 9adaf647f55ded1a82f11539341dd7fd9cf95941 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 01/95] Add dwc_otg driver +Subject: [PATCH 01/98] Add dwc_otg driver Signed-off-by: popcornmix --- @@ -45178,10 +45178,10 @@ index 0000000..abcf284 1.8.1.6 -From f85fdade5cdd7807608bfec780a40c70ddf920a9 Mon Sep 17 00:00:00 2001 +From 28f316fee7b79e44dc3c2be12d1f0098e3c0336f Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Wed, 8 May 2013 11:59:48 +0100 -Subject: [PATCH 02/95] Main bcm2708 linux port +Date: Sun, 12 May 2013 12:24:19 +0100 +Subject: [PATCH 02/98] Main bcm2708 linux port Signed-off-by: popcornmix --- @@ -45189,32 +45189,32 @@ Signed-off-by: popcornmix arch/arm/Kconfig.debug | 8 + arch/arm/Makefile | 1 + arch/arm/configs/bcmrpi_cutdown_defconfig | 474 +++++++ - arch/arm/configs/bcmrpi_defconfig | 510 +++++++ + arch/arm/configs/bcmrpi_defconfig | 510 ++++++++ arch/arm/configs/bcmrpi_emergency_defconfig | 532 ++++++++ arch/arm/mach-bcm2708/Kconfig | 34 + arch/arm/mach-bcm2708/Makefile | 8 + arch/arm/mach-bcm2708/Makefile.boot | 3 + - arch/arm/mach-bcm2708/armctrl.c | 208 +++ + arch/arm/mach-bcm2708/armctrl.c | 208 ++++ arch/arm/mach-bcm2708/armctrl.h | 27 + - arch/arm/mach-bcm2708/bcm2708.c | 638 +++++++++ + arch/arm/mach-bcm2708/bcm2708.c | 638 ++++++++++ arch/arm/mach-bcm2708/bcm2708.h | 51 + arch/arm/mach-bcm2708/bcm2708_gpio.c | 339 +++++ arch/arm/mach-bcm2708/clock.c | 61 + arch/arm/mach-bcm2708/clock.h | 24 + arch/arm/mach-bcm2708/dma.c | 397 ++++++ - arch/arm/mach-bcm2708/include/mach/arm_control.h | 419 ++++++ + arch/arm/mach-bcm2708/include/mach/arm_control.h | 419 +++++++ arch/arm/mach-bcm2708/include/mach/arm_power.h | 60 + arch/arm/mach-bcm2708/include/mach/clkdev.h | 7 + arch/arm/mach-bcm2708/include/mach/debug-macro.S | 22 + arch/arm/mach-bcm2708/include/mach/dma.h | 84 ++ - arch/arm/mach-bcm2708/include/mach/entry-macro.S | 69 + + arch/arm/mach-bcm2708/include/mach/entry-macro.S | 69 ++ arch/arm/mach-bcm2708/include/mach/frc.h | 38 + arch/arm/mach-bcm2708/include/mach/gpio.h | 18 + arch/arm/mach-bcm2708/include/mach/hardware.h | 28 + arch/arm/mach-bcm2708/include/mach/io.h | 27 + arch/arm/mach-bcm2708/include/mach/irqs.h | 196 +++ arch/arm/mach-bcm2708/include/mach/memory.h | 57 + - arch/arm/mach-bcm2708/include/mach/platform.h | 220 +++ + arch/arm/mach-bcm2708/include/mach/platform.h | 220 ++++ arch/arm/mach-bcm2708/include/mach/power.h | 26 + arch/arm/mach-bcm2708/include/mach/system.h | 53 + arch/arm/mach-bcm2708/include/mach/timex.h | 23 + @@ -45230,11 +45230,11 @@ Signed-off-by: popcornmix arch/arm/tools/mach-types | 1 + drivers/mmc/host/Kconfig | 21 + drivers/mmc/host/Makefile | 1 + - drivers/mmc/host/sdhci-bcm2708.c | 1555 ++++++++++++++++++++++ - drivers/mmc/host/sdhci.c | 288 ++-- - drivers/mmc/host/sdhci.h | 42 + + drivers/mmc/host/sdhci-bcm2708.c | 1425 ++++++++++++++++++++++ + drivers/mmc/host/sdhci.c | 209 +++- + drivers/mmc/host/sdhci.h | 37 + include/linux/mmc/sdhci.h | 2 + - 49 files changed, 7666 insertions(+), 89 deletions(-) + 49 files changed, 7470 insertions(+), 71 deletions(-) create mode 100644 arch/arm/configs/bcmrpi_cutdown_defconfig create mode 100644 arch/arm/configs/bcmrpi_defconfig create mode 100644 arch/arm/configs/bcmrpi_emergency_defconfig @@ -51462,10 +51462,10 @@ index c380e3c..497b3a5 100644 obj-$(CONFIG_MMC_OMAP) += omap.o diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c new file mode 100644 -index 0000000..4b23c8b +index 0000000..e79723d --- /dev/null +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -0,0 +1,1555 @@ +@@ -0,0 +1,1425 @@ +/* + * sdhci-bcm2708.c Support for SDHCI device on BCM2708 + * Copyright (c) 2010 Broadcom @@ -51501,7 +51501,6 @@ index 0000000..4b23c8b +#include +#include +#include -+#include + +#include "sdhci.h" + @@ -51544,11 +51543,6 @@ index 0000000..4b23c8b +/* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */ +#define BCM2708_EMMC_CLOCK_FREQ 80000000 + -+#define POWER_OFF 0 -+#define POWER_LAZY_OFF 1 -+#define POWER_ON 2 -+ -+ +/*****************************************************************************\ + * * + * Debug * @@ -51904,10 +51898,6 @@ index 0000000..4b23c8b + /* tracking scatter gather progress */ + unsigned sg_ix; /* scatter gather list index */ + unsigned sg_done; /* bytes in current sg_ix done */ -+ /* power management */ -+ BCM_POWER_HANDLE_T power_handle; -+ unsigned char power_state; /* enable/disable power state */ -+ unsigned char power_mode; /* last set power mode */ +#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA + unsigned char dma_wanted; /* DMA transfer requested */ + unsigned char dma_waits; /* wait states in DMAs */ @@ -52567,7 +52557,6 @@ index 0000000..4b23c8b + + if (host) { + struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); -+ int power_state = host_priv->power_state; + return sprintf(buf, + "present: yes\n" + "power: %s\n" @@ -52577,10 +52566,7 @@ index 0000000..4b23c8b +#else + "dma: unconfigured\n", +#endif -+ power_state == POWER_ON? "on": -+ power_state == POWER_OFF? "off": -+ power_state == POWER_LAZY_OFF? "lazy-off": -+ "", ++ "always on", + host->clock +#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA + , (host->flags & SDHCI_USE_PLATDMA)? "on": "off" @@ -52629,110 +52615,6 @@ index 0000000..4b23c8b +#endif + + -+/* Click forwards one step towards fully on */ -+static int sdhci_bcm2708_enable(struct sdhci_host *host) -+{ -+ int rc; -+ struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); -+ -+ if (host_priv->power_state == POWER_OFF) { -+ /* warning: may schedule - don't call in irq mode */ -+ rc = bcm_power_request(host_priv->power_handle, -+ BCM_POWER_SDCARD); -+ -+ if (rc == 0) { -+ mmc_power_restore_host(host->mmc); -+ host_priv->power_state = POWER_ON; -+ } else if (rc != -EINTR) -+ printk(KERN_ERR "%s: mmc power up request failed - " -+ "rc %d\n", -+ mmc_hostname(host->mmc), rc); -+ } else { -+ host_priv->power_state = POWER_ON; -+ rc = 0; -+ } -+ -+ return rc; -+} -+ -+/* Click backwards one step towards fully off */ -+static int sdhci_bcm2708_disable(struct sdhci_host *host, int lazy) -+{ -+ int rc; -+ struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); -+ -+ if ((host_priv->power_state == POWER_ON) && lazy) { -+ host_priv->power_state = POWER_LAZY_OFF; -+ return BCM2708_SDHCI_SLEEP_TIMEOUT; -+ } -+ -+ /* warning: may schedule - don't call in irq mode */ -+ rc = bcm_power_request(host_priv->power_handle, BCM_POWER_NONE); -+ -+ if (rc == 0) -+ host_priv->power_state = POWER_OFF; -+ else if (rc != -EINTR) -+ printk(KERN_ERR "%s: mmc power down request failed - rc %d\n", -+ mmc_hostname(host->mmc), rc); -+ -+ return rc; -+} -+ -+static int sdhci_bcm2708_set_plat_power(struct sdhci_host *host, -+ int power_mode) -+{ -+ struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); -+ int rc; -+ -+ do { -+ rc = mmc_host_enable(host->mmc); -+ } while (-EINTR == rc); -+ -+ if (rc == 0) do { -+ if (rc == 0 && power_mode != host_priv->power_mode) -+ { -+ switch (power_mode) -+ { -+ case MMC_POWER_OFF: -+ rc = bcm_power_request(host_priv->power_handle, -+ BCM_POWER_NONE); -+ break; -+ -+ case MMC_POWER_UP: -+ rc = bcm_power_request(host_priv->power_handle, -+ BCM_POWER_SDCARD); -+ /* -+ * We need an extra 10ms delay of 10ms before we -+ * can apply clock after applying power -+ */ -+ if (rc == 0) -+ mdelay(10); -+ break; -+ -+ case MMC_POWER_ON: -+ mdelay(10); -+ /* do_send_init_stream = 1; */ -+ break; -+ } -+ -+ if (rc == 0) -+ host_priv->power_mode = power_mode; -+ } -+ } while (-EINTR == rc); -+ -+ if (rc == 0) do { -+ if (rc == 0) { -+ if (power_mode == MMC_POWER_OFF) -+ rc = mmc_host_disable(host->mmc); -+ else -+ rc = mmc_host_lazy_disable(host->mmc); -+ } -+ -+ } while (-EINTR == rc); -+ -+ return rc; -+} -+ +/*****************************************************************************\ + * * + * Device quirk functions. Implemented as local ops because the flags * @@ -52782,10 +52664,6 @@ index 0000000..4b23c8b + //.get_min_clock = NULL, + .get_timeout_clock = sdhci_bcm2708_get_timeout_clock, + -+ .enable = sdhci_bcm2708_enable, -+ .disable = sdhci_bcm2708_disable, -+ .set_plat_power = sdhci_bcm2708_set_plat_power, -+ +#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA + // Platform DMA operations + .pdma_able = sdhci_bcm2708_platdma_dmaable, @@ -52804,7 +52682,7 @@ index 0000000..4b23c8b + * * +\*****************************************************************************/ + -+static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) ++static int sdhci_bcm2708_probe(struct platform_device *pdev) +{ + struct sdhci_host *host; + struct resource *iomem; @@ -52863,11 +52741,6 @@ index 0000000..4b23c8b + + host_priv = SDHCI_HOST_PRIV(host); + -+ host_priv->power_state = POWER_ON; -+ ret = bcm_power_open(&host_priv->power_handle); -+ if (ret != 0) -+ goto err_power; -+ +#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA + host_priv->dma_wanted = 0; +#ifdef CHECK_DMA_USE @@ -52938,8 +52811,6 @@ index 0000000..4b23c8b + host_priv->cb_handle); +err_alloc_cb: +#endif -+ bcm_power_close(host_priv->power_handle); -+err_power: + iounmap(host->ioaddr); +err_remap: + release_mem_region(iomem->start, resource_size(iomem)); @@ -52950,7 +52821,7 @@ index 0000000..4b23c8b + return ret; +} + -+static int __devexit sdhci_bcm2708_remove(struct platform_device *pdev) ++static int sdhci_bcm2708_remove(struct platform_device *pdev) +{ + struct sdhci_host *host = platform_get_drvdata(pdev); + struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -52972,7 +52843,6 @@ index 0000000..4b23c8b + dma_free_writecombine(&pdev->dev, SZ_4K, host_priv->cb_base, + host_priv->cb_handle); +#endif -+ bcm_power_close(host_priv->power_handle); + sdhci_remove_host(host, dead); + iounmap(host->ioaddr); + release_mem_region(iomem->start, resource_size(iomem)); @@ -52988,7 +52858,7 @@ index 0000000..4b23c8b + .owner = THIS_MODULE, + }, + .probe = sdhci_bcm2708_probe, -+ .remove = __devexit_p(sdhci_bcm2708_remove), ++ .remove = sdhci_bcm2708_remove, + +#ifdef CONFIG_PM + .suspend = sdhci_bcm2708_suspend, @@ -53022,17 +52892,17 @@ index 0000000..4b23c8b +MODULE_ALIAS("platform:"DRIVER_NAME); + diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index 51bbba4..79f9efd 100644 +index 51bbba4..71e2696 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c -@@ -29,6 +29,7 @@ +@@ -28,6 +28,7 @@ + #include #include #include - #include +#include + #include #include "sdhci.h" - @@ -315,7 +316,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host) u32 uninitialized_var(scratch); u8 *buf; @@ -53183,17 +53053,12 @@ index 51bbba4..79f9efd 100644 if (host->version >= SDHCI_SPEC_200) { ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); ctrl &= ~SDHCI_CTRL_DMA_MASK; -- if ((host->flags & SDHCI_REQ_USE_DMA) && -- (host->flags & SDHCI_USE_ADMA)) -- ctrl |= SDHCI_CTRL_ADMA32; -- else -- ctrl |= SDHCI_CTRL_SDMA; + if (! (host->flags & SDHCI_USE_PLATDMA)) { -+ if ((host->flags & SDHCI_REQ_USE_DMA) && -+ (host->flags & SDHCI_USE_ADMA)) -+ ctrl |= SDHCI_CTRL_ADMA32; -+ else -+ ctrl |= SDHCI_CTRL_SDMA; + if ((host->flags & SDHCI_REQ_USE_DMA) && + (host->flags & SDHCI_USE_ADMA)) + ctrl |= SDHCI_CTRL_ADMA32; + else + ctrl |= SDHCI_CTRL_SDMA; + } sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); } @@ -53259,51 +53124,7 @@ index 51bbba4..79f9efd 100644 sdhci_prepare_data(host, cmd); -@@ -1299,6 +1313,35 @@ static int sdhci_set_power(struct sdhci_host *host, unsigned short power) - return power; - } - -+/* Power on or off the circuitary supporting the register set */ -+static int sdhci_set_plat_power(struct sdhci_host *host, int power_mode) -+{ -+ if (host->ops->set_plat_power) -+ return host->ops->set_plat_power(host, power_mode); -+ else -+ return 0; -+} -+ -+/* Click forwards one step towards fully on */ -+static int sdhci_enable(struct mmc_host *mmc) -+{ -+ struct sdhci_host *host; -+ -+ host = mmc_priv(mmc); -+ -+ return host->ops->enable? host->ops->enable(host): 0; -+} -+ -+/* Click backwards one step towards fully off */ -+static int sdhci_disable(struct mmc_host *mmc, int lazy) -+{ -+ struct sdhci_host *host; -+ -+ host = mmc_priv(mmc); -+ -+ return host->ops->disable? host->ops->disable(host, lazy): 0; -+} -+ - /*****************************************************************************\ - * * - * MMC callbacks * -@@ -1398,6 +1441,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) - unsigned long flags; - int vdd_bit = -1; - u8 ctrl; -+ int rc; - - spin_lock_irqsave(&host->lock, flags); - -@@ -1470,7 +1514,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1470,7 +1484,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) else ctrl &= ~SDHCI_CTRL_HISPD; @@ -53312,57 +53133,30 @@ index 51bbba4..79f9efd 100644 u16 clk, ctrl_2; /* In case of UHS-I modes, set High Speed Enable */ -@@ -1478,7 +1522,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) - (ios->timing == MMC_TIMING_UHS_SDR50) || - (ios->timing == MMC_TIMING_UHS_SDR104) || - (ios->timing == MMC_TIMING_UHS_DDR50) || -- (ios->timing == MMC_TIMING_UHS_SDR25)) -+ (ios->timing == MMC_TIMING_UHS_SDR25) || -+ (ios->timing == MMC_TIMING_UHS_SDR12)) - ctrl |= SDHCI_CTRL_HISPD; - - ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); -@@ -1570,6 +1615,12 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) - - mmiowb(); - spin_unlock_irqrestore(&host->lock, flags); -+ -+ if (ios->power_mode == MMC_POWER_OFF) { -+ do -+ rc = sdhci_set_plat_power(host, ios->power_mode); -+ while (rc == -EINTR); -+ } - } - - static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) -@@ -2132,7 +2183,7 @@ static void sdhci_timeout_timer(unsigned long data) +@@ -2132,7 +2146,7 @@ static void sdhci_timeout_timer(unsigned long data) if (host->mrq) { pr_err("%s: Timeout waiting for hardware " - "interrupt.\n", mmc_hostname(host->mmc)); -+ "interrupt - cmd%d.\n", mmc_hostname(host->mmc), host->last_cmdop); ++ "interrupt - cmd%d.\n", mmc_hostname(host->mmc), host->last_cmdop); sdhci_dumpregs(host); if (host->data) { -@@ -2177,10 +2228,13 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) +@@ -2177,10 +2191,13 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) BUG_ON(intmask == 0); if (!host->cmd) { -- pr_err("%s: Got command interrupt 0x%08x even " -- "though no command operation was in progress.\n", -- mmc_hostname(host->mmc), (unsigned)intmask); -- sdhci_dumpregs(host); + if (!(host->ops->extra_ints)) { -+ pr_err("%s: Got command interrupt 0x%08x even " -+ "though no command operation was in progress.\n", -+ mmc_hostname(host->mmc), (unsigned)intmask); -+ sdhci_dumpregs(host); + pr_err("%s: Got command interrupt 0x%08x even " + "though no command operation was in progress.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + sdhci_dumpregs(host); + } else + DBG("cmd irq 0x%08x cmd complete\n", (unsigned)intmask); return; } -@@ -2250,6 +2304,19 @@ static void sdhci_show_adma_error(struct sdhci_host *host) +@@ -2250,6 +2267,19 @@ static void sdhci_show_adma_error(struct sdhci_host *host) static void sdhci_show_adma_error(struct sdhci_host *host) { } #endif @@ -53382,21 +53176,15 @@ index 51bbba4..79f9efd 100644 static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) { u32 command; -@@ -2278,24 +2345,40 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) - return; +@@ -2279,23 +2309,39 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) } } -- -- pr_err("%s: Got data interrupt 0x%08x even " -- "though no data operation was in progress.\n", -- mmc_hostname(host->mmc), (unsigned)intmask); -- sdhci_dumpregs(host); -+ + + if (!(host->ops->extra_ints)) { -+ pr_err("%s: Got data interrupt 0x%08x even " -+ "though no data operation was in progress.\n", -+ mmc_hostname(host->mmc), (unsigned)intmask); -+ sdhci_dumpregs(host); + pr_err("%s: Got data interrupt 0x%08x even " + "though no data operation was in progress.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + sdhci_dumpregs(host); + } else + DBG("data irq 0x%08x but no data\n", (unsigned)intmask); @@ -53406,8 +53194,6 @@ index 51bbba4..79f9efd 100644 if (intmask & SDHCI_INT_DATA_TIMEOUT) host->data->error = -ETIMEDOUT; - else if (intmask & SDHCI_INT_DATA_END_BIT) -- host->data->error = -EILSEQ; -- else if ((intmask & SDHCI_INT_DATA_CRC) && + else if (intmask & SDHCI_INT_DATA_END_BIT) { + DBG("end error in cmd %d\n", host->last_cmdop); + if (host->ops->spurious_crc_acmd51 && @@ -53415,12 +53201,11 @@ index 51bbba4..79f9efd 100644 + DBG("ignoring spurious data_end_bit error\n"); + intmask = SDHCI_INT_DATA_AVAIL|SDHCI_INT_DATA_END; + } else -+ host->data->error = -EILSEQ; + host->data->error = -EILSEQ; +- else if ((intmask & SDHCI_INT_DATA_CRC) && + } else if ((intmask & SDHCI_INT_DATA_CRC) && SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)) - != MMC_BUS_TEST_R) -- host->data->error = -EILSEQ; -- else if (intmask & SDHCI_INT_ADMA_ERROR) { + != MMC_BUS_TEST_R) { + DBG("crc error in cmd %d\n", host->last_cmdop); + if (host->ops->spurious_crc_acmd51 && @@ -53428,13 +53213,14 @@ index 51bbba4..79f9efd 100644 + DBG("ignoring spurious data_crc_bit error\n"); + intmask = SDHCI_INT_DATA_AVAIL|SDHCI_INT_DATA_END; + } else { -+ host->data->error = -EILSEQ; + host->data->error = -EILSEQ; +- else if (intmask & SDHCI_INT_ADMA_ERROR) { + } + } else if (intmask & SDHCI_INT_ADMA_ERROR) { pr_err("%s: ADMA error\n", mmc_hostname(host->mmc)); sdhci_show_adma_error(host); host->data->error = -EIO; -@@ -2303,11 +2386,18 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) +@@ -2303,11 +2349,18 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) host->ops->adma_workaround(host, intmask); } @@ -53457,7 +53243,7 @@ index 51bbba4..79f9efd 100644 /* * We currently don't do anything fancy with DMA -@@ -2336,18 +2426,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) +@@ -2336,18 +2389,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) sdhci_writel(host, dmanow, SDHCI_DMA_ADDRESS); } @@ -53478,7 +53264,7 @@ index 51bbba4..79f9efd 100644 } } -@@ -2403,6 +2483,22 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) +@@ -2403,6 +2446,22 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) tasklet_schedule(&host->card_tasklet); } @@ -53501,7 +53287,7 @@ index 51bbba4..79f9efd 100644 if (intmask & SDHCI_INT_CMD_MASK) { sdhci_writel(host, intmask & SDHCI_INT_CMD_MASK, SDHCI_INT_STATUS); -@@ -2417,7 +2513,13 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) +@@ -2417,7 +2476,13 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK); @@ -53516,23 +53302,17 @@ index 51bbba4..79f9efd 100644 if (intmask & SDHCI_INT_BUS_POWER) { pr_err("%s: Card is consuming too much power!\n", -@@ -2537,7 +2639,14 @@ int sdhci_resume_host(struct sdhci_host *host) +@@ -2537,7 +2602,8 @@ int sdhci_resume_host(struct sdhci_host *host) { int ret; - if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) { -+ if (host->vmmc) { -+ int ret = regulator_enable(host->vmmc); -+ if (ret) -+ return ret; -+ } -+ + if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA | + SDHCI_USE_PLATDMA)) { if (host->ops->enable_dma) host->ops->enable_dma(host); } -@@ -2753,14 +2862,16 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -2753,14 +2819,16 @@ int sdhci_add_host(struct sdhci_host *host) host->flags &= ~SDHCI_USE_ADMA; } @@ -53551,29 +53331,20 @@ index 51bbba4..79f9efd 100644 } } } -@@ -2871,7 +2982,7 @@ int sdhci_add_host(struct sdhci_host *host) - /* Auto-CMD23 stuff only works in ADMA or PIO. */ - if ((host->version >= SDHCI_SPEC_300) && - ((host->flags & SDHCI_USE_ADMA) || -- !(host->flags & SDHCI_USE_SDMA))) { -+ !(host->flags & SDHCI_USE_SDMA) )) { - host->flags |= SDHCI_AUTO_CMD23; - DBG("%s: Auto-CMD23 available\n", mmc_hostname(mmc)); - } else { -@@ -3043,6 +3154,12 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -3043,6 +3111,12 @@ int sdhci_add_host(struct sdhci_host *host) SDHCI_MAX_CURRENT_MULTIPLIER; } + if(host->ops->voltage_broken) { + ocr_avail |= MMC_VDD_32_33 | MMC_VDD_33_34; -+ // Cannot support UHS modes is we are stuck at 3.3V; ++ // Cannot support UHS modes if we are stuck at 3.3V; + mmc->caps &= ~(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50); + } + mmc->ocr_avail = ocr_avail; mmc->ocr_avail_sdio = ocr_avail; if (host->ocr_avail_sdio) -@@ -3173,6 +3290,7 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -3173,6 +3247,7 @@ int sdhci_add_host(struct sdhci_host *host) pr_info("%s: SDHCI controller on %s [%s] using %s\n", mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)), @@ -53582,19 +53353,14 @@ index 51bbba4..79f9efd 100644 (host->flags & SDHCI_USE_SDMA) ? "DMA" : "PIO"); diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h -index 379e09d..45592d2 100644 +index 379e09d..f90574e 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h -@@ -289,6 +289,25 @@ struct sdhci_ops { +@@ -289,6 +289,20 @@ struct sdhci_ops { void (*platform_reset_enter)(struct sdhci_host *host, u8 mask); void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); + -+ int (*enable)(struct sdhci_host *mmc); -+ int (*disable)(struct sdhci_host *mmc, int lazy); -+ int (*set_plat_power)(struct sdhci_host *mmc, -+ int power_mode); -+ + int (*pdma_able)(struct sdhci_host *host, + struct mmc_data *data); + void (*pdma_avail)(struct sdhci_host *host, @@ -53611,7 +53377,7 @@ index 379e09d..45592d2 100644 void (*hw_reset)(struct sdhci_host *host); void (*platform_suspend)(struct sdhci_host *host); void (*platform_resume)(struct sdhci_host *host); -@@ -399,6 +418,29 @@ static inline void *sdhci_priv(struct sdhci_host *host) +@@ -399,6 +413,29 @@ static inline void *sdhci_priv(struct sdhci_host *host) extern void sdhci_enable_irq_wakeups(struct sdhci_host *host); #endif @@ -53665,10 +53431,10 @@ index b838ffc..f3a39c1 100644 1.8.1.6 -From ecad00d36ce5d320c249f468ede434324ccae6ab Mon Sep 17 00:00:00 2001 +From 3ec376874ce56f9b64b278064092f74607f4fd2c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 03/95] bcm2708 watchdog driver +Subject: [PATCH 03/98] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -54102,10 +53868,10 @@ index 0000000..dd33c35 1.8.1.6 -From 1bb23e111d60adab8df63ef766d2f3bc185778af Mon Sep 17 00:00:00 2001 +From e83f74d1ca02a8742e9f41caf92ac824ef99a032 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:55:09 +0100 -Subject: [PATCH 04/95] bcm2708 framebuffer driver +Subject: [PATCH 04/98] bcm2708 framebuffer driver Signed-off-by: popcornmix --- @@ -57140,10 +56906,10 @@ index 3c14e43..7626beb 100644 1.8.1.6 -From eba16ea8bf19dee42d87a9cfac55f88aca4e3fd8 Mon Sep 17 00:00:00 2001 +From 606042e379283d4d340e0d40db74d728d5d13e5d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 27 Mar 2013 23:10:07 +0000 -Subject: [PATCH 05/95] bcm2708 vchiq driver +Subject: [PATCH 05/98] bcm2708 vchiq driver Signed-off-by: popcornmix --- @@ -69585,10 +69351,10 @@ index 0000000..b6bfa21 1.8.1.6 -From e80667986ce0db068d72fe1aae8a37a48ae19a45 Mon Sep 17 00:00:00 2001 +From 94c300082a474195796a4cac65aa45aab5c009c7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 28 Mar 2013 00:10:21 +0000 -Subject: [PATCH 06/95] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 06/98] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix --- @@ -70885,10 +70651,10 @@ index 0000000..bdc9d79 1.8.1.6 -From a53cbc1c13befbe10a0c06ff81d0cb9f0c699b14 Mon Sep 17 00:00:00 2001 +From bb3c5c906a825358602227bb17942c89ee923488 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 07/95] Allow mac address to be set in smsc95xx +Subject: [PATCH 07/98] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -70982,10 +70748,10 @@ index e6d2dea..9709314 100644 1.8.1.6 -From e2b023487bff9ca672ebd8b75900417bc5b3e341 Mon Sep 17 00:00:00 2001 +From e9157bffdd8a900961e094a57560b049b1e7e91b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 08/95] bcm2708: alsa sound driver +Subject: [PATCH 08/98] bcm2708: alsa sound driver Signed-off-by: popcornmix --- @@ -73308,10 +73074,10 @@ index 0000000..af3e6eb 1.8.1.6 -From b8ef5a6c27eca1b32bb541968068922336a5019c Mon Sep 17 00:00:00 2001 +From a0481fb6e7ae7fc6dcaf0d5019f41d815a3d3fb1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Apr 2012 00:30:15 +0100 -Subject: [PATCH 09/95] Fix (hopefully) for DWC_MEMCPY kernel panics. Thanks to +Subject: [PATCH 09/98] Fix (hopefully) for DWC_MEMCPY kernel panics. Thanks to Naren Sankar for finding this --- @@ -73352,10 +73118,10 @@ index a5f8546..5261d2a 100644 1.8.1.6 -From f500dc5269e80976df4073121ef1f0b5db499597 Mon Sep 17 00:00:00 2001 +From 4393f5d06d89e551ca6f45ec13a0f316b74827e5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:36:22 +0000 -Subject: [PATCH 10/95] added support for TT in the USB driver. Thanks Naren +Subject: [PATCH 10/98] added support for TT in the USB driver. Thanks Naren --- drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 3 +++ @@ -73379,10 +73145,10 @@ index 5261d2a..e7b90c8 100644 1.8.1.6 -From 27c5263d74dc511e0d3da51f1ef560a6911155ef Mon Sep 17 00:00:00 2001 +From 1cb7438324989a2b903eb9f023ae9c6677fa45ad Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 May 2012 23:09:44 +0100 -Subject: [PATCH 11/95] Use dwc_alloc_atomic. Thanks bootc +Subject: [PATCH 11/98] Use dwc_alloc_atomic. Thanks bootc --- drivers/usb/host/dwc_otg/dwc_otg_hcd.h | 4 ++-- @@ -73414,20 +73180,20 @@ index 9459c4c..f6e7870 100644 1.8.1.6 -From 3a5fa8d50770bf02c6238e36d45df663b12a6d71 Mon Sep 17 00:00:00 2001 +From f1f2dd31f46173c0b3a51128228287dc57dc6c45 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 May 2012 23:12:13 +0100 -Subject: [PATCH 12/95] possible fix for sdcard missing status. Thank naren +Subject: [PATCH 12/98] possible fix for sdcard missing status. Thank naren --- drivers/mmc/host/sdhci-bcm2708.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 4b23c8b..cae6be9 100644 +index e79723d..a405114 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -1291,6 +1291,14 @@ static unsigned int sdhci_bcm2708_uhs_broken(struct sdhci_host *host) +@@ -1173,6 +1173,14 @@ static unsigned int sdhci_bcm2708_uhs_broken(struct sdhci_host *host) return 1; } @@ -73442,7 +73208,7 @@ index 4b23c8b..cae6be9 100644 /***************************************************************************** \ * * * Device ops * -@@ -1328,6 +1336,7 @@ static unsigned int sdhci_bcm2708_uhs_broken(struct sdhci_host *host) +@@ -1206,6 +1214,7 @@ static unsigned int sdhci_bcm2708_uhs_broken(struct sdhci_host *host) .spurious_crc_acmd51 = sdhci_bcm2708_quirk_spurious_crc, .voltage_broken = sdhci_bcm2708_quirk_voltage_broken, .uhs_broken = sdhci_bcm2708_uhs_broken, @@ -73454,10 +73220,10 @@ index 4b23c8b..cae6be9 100644 1.8.1.6 -From f30daa0ddaa2d5a73d577a9c74accbad541fe4dd Mon Sep 17 00:00:00 2001 +From 74d53fb6bb5cf56625b365f2f55379829a6f6988 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 15 May 2012 15:24:40 +0100 -Subject: [PATCH 13/95] Fix for DWC OTG HCD URB Dequeue has NULL URB panic. +Subject: [PATCH 13/98] Fix for DWC OTG HCD URB Dequeue has NULL URB panic. Thanks Naren --- @@ -73488,20 +73254,20 @@ index e7b90c8..2a3b689 100644 1.8.1.6 -From a5a8f6129d7ab8c167625ec4458ee2171f5c47e0 Mon Sep 17 00:00:00 2001 +From da62791a191199ccdbfe0212dd9c37469e86c2c1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 May 2012 14:44:19 +0100 -Subject: [PATCH 14/95] sdcard patch improvements from naren +Subject: [PATCH 14/98] sdcard patch improvements from naren --- drivers/mmc/host/sdhci-bcm2708.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index cae6be9..7136998 100644 +index a405114..ae8edf7 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -896,8 +896,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, +@@ -886,8 +886,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, We get CRC and DEND errors unless we wait for the SD controller to finish reading/writing to the card. */ u32 state_mask; @@ -73511,7 +73277,7 @@ index cae6be9..7136998 100644 DBG("PDMA over - sync card\n"); if (data->flags & MMC_DATA_READ) -@@ -905,17 +904,12 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, +@@ -895,17 +894,12 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, else state_mask = SDHCI_DOING_WRITE; @@ -73534,7 +73300,7 @@ index cae6be9..7136998 100644 if (timeout <= 0) printk(KERN_ERR"%s: final %s to SD card still " "running\n", -@@ -1293,10 +1287,7 @@ static unsigned int sdhci_bcm2708_uhs_broken(struct sdhci_host *host) +@@ -1175,10 +1169,7 @@ static unsigned int sdhci_bcm2708_uhs_broken(struct sdhci_host *host) static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) { @@ -73550,10 +73316,10 @@ index cae6be9..7136998 100644 1.8.1.6 -From 6f202485e8e16c3c101d8b91d53941a0657f594d Mon Sep 17 00:00:00 2001 +From 442f0344ea45c7c435f9d94000928ebf8a8a383e Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 4 Jun 2012 04:27:48 +0200 -Subject: [PATCH 15/95] sdhci-bcm2708: speed up DMA sync +Subject: [PATCH 15/98] sdhci-bcm2708: speed up DMA sync Experiments show that it doesn't really take that long to sync, so we can reduce the poll interval slightly. Might improve performance a bit. @@ -73562,10 +73328,10 @@ can reduce the poll interval slightly. Might improve performance a bit. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 7136998..9aebdfb 100644 +index ae8edf7..a6bdc25 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -907,7 +907,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, +@@ -897,7 +897,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, while (0 != (sdhci_bcm2708_raw_readl(host, SDHCI_PRESENT_STATE) & state_mask) && --timeout > 0) { @@ -73578,10 +73344,10 @@ index 7136998..9aebdfb 100644 1.8.1.6 -From 59cb62fdde3180c862640ca04e048d93f2684f41 Mon Sep 17 00:00:00 2001 +From 2b2d2523b69e6a58232ed87fb5eb940c94391b65 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 11 Jun 2012 18:52:04 +0200 -Subject: [PATCH 16/95] sdhci-bcm2708: remove custom clock handling +Subject: [PATCH 16/98] sdhci-bcm2708: remove custom clock handling The custom clock handling code is redundant and buggy. The MMC/SDHCI subsystem does a better job than it, so remove it for good. @@ -73590,10 +73356,10 @@ subsystem does a better job than it, so remove it for good. 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 9aebdfb..c964911 100644 +index a6bdc25..0ed4d85 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -359,68 +359,9 @@ void sdhci_bcm2708_writeb(struct sdhci_host *host, u8 val, int reg) +@@ -353,68 +353,9 @@ void sdhci_bcm2708_writeb(struct sdhci_host *host, u8 val, int reg) static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host) { @@ -73663,7 +73429,7 @@ index 9aebdfb..c964911 100644 /*****************************************************************************\ * * * DMA Operation * -@@ -1307,11 +1248,7 @@ static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) +@@ -1189,11 +1130,7 @@ static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) #else #error The BCM2708 SDHCI driver needs CONFIG_MMC_SDHCI_IO_ACCESSORS to be set #endif @@ -73673,16 +73439,16 @@ index 9aebdfb..c964911 100644 - //.get_min_clock = NULL, - .get_timeout_clock = sdhci_bcm2708_get_timeout_clock, - .enable = sdhci_bcm2708_enable, - .disable = sdhci_bcm2708_disable, + #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA + // Platform DMA operations -- 1.8.1.6 -From ebbaeed930adbbeb799435391350c1328c531718 Mon Sep 17 00:00:00 2001 +From 0c8ada1f84794bdb016d841acda291d71c8f038c Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 11 Jun 2012 18:53:59 +0200 -Subject: [PATCH 17/95] sdhci-bcm2708: add additional quirks +Subject: [PATCH 17/98] sdhci-bcm2708: add additional quirks Some additional quirks are needed for correct operation. There's no SDHCI capabilities register documented, and it always reads @@ -73694,10 +73460,10 @@ high-speed mode, so add it as well. 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index c964911..16c918b 100644 +index 0ed4d85..3001836 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -1311,7 +1311,9 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) +@@ -1189,7 +1189,9 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev) host->quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | @@ -73712,10 +73478,10 @@ index c964911..16c918b 100644 1.8.1.6 -From d9e1f976f047f65a2ecbe5ca0cc18cb0a53db40d Mon Sep 17 00:00:00 2001 +From 992870434932c3acf2e029c120f0a84084f95ded Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 11 Jun 2012 18:57:13 +0200 -Subject: [PATCH 18/95] sdhci-bcm2708: add allow_highspeed parameter +Subject: [PATCH 18/98] sdhci-bcm2708: add allow_highspeed parameter Add a parameter to disable high-speed mode for the few cards that still might have problems. High-speed mode is enabled by default. @@ -73724,10 +73490,10 @@ still might have problems. High-speed mode is enabled by default. 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 16c918b..a8aae16 100644 +index 3001836..c64de21 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -135,6 +135,8 @@ static inline unsigned long int since_ns(hptime_t t) +@@ -129,6 +129,8 @@ static inline unsigned long int since_ns(hptime_t t) return (unsigned long)((hptime() - t) * HPTIME_CLK_NS); } @@ -73736,7 +73502,7 @@ index 16c918b..a8aae16 100644 #if 0 static void hptime_test(void) { -@@ -1381,7 +1383,8 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) +@@ -1254,7 +1256,8 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev) host_priv->dma_chan, host_priv->dma_chan_base, host_priv->dma_irq); @@ -73746,7 +73512,7 @@ index 16c918b..a8aae16 100644 #endif ret = sdhci_add_host(host); -@@ -1487,8 +1490,12 @@ static void __exit sdhci_drv_exit(void) +@@ -1357,8 +1360,12 @@ static void __exit sdhci_drv_exit(void) module_init(sdhci_drv_init); module_exit(sdhci_drv_exit); @@ -73763,10 +73529,10 @@ index 16c918b..a8aae16 100644 1.8.1.6 -From 0669f11bbea66d22b713cc9f117bdd55fd64420e Mon Sep 17 00:00:00 2001 +From 12e7971b93d012e4375ab6b94f4175a05d3488c5 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 11 Jun 2012 18:58:40 +0200 -Subject: [PATCH 19/95] sdhci-bcm2708: assume 50 MHz eMMC clock +Subject: [PATCH 19/98] sdhci-bcm2708: assume 50 MHz eMMC clock 80 MHz clock isnt't suited well to be dividable to get SD clocks of 25 MHz (default mode) or 50 MHz (high speed mode). 50 MHz are perfect to @@ -73776,26 +73542,26 @@ drive the SD interface at ideal frequencies. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index a8aae16..64b956b 100644 +index c64de21..d174938 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -74,7 +74,7 @@ +@@ -73,7 +73,7 @@ #define BCM2708_SDHCI_SLEEP_TIMEOUT 1000 /* msecs */ /* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */ -#define BCM2708_EMMC_CLOCK_FREQ 80000000 +#define BCM2708_EMMC_CLOCK_FREQ 50000000 - #define POWER_OFF 0 - #define POWER_LAZY_OFF 1 + /*****************************************************************************\ + * * -- 1.8.1.6 -From 3b3c7f3af59e848e3fd77d4b04407fe4f239f0fd Mon Sep 17 00:00:00 2001 +From 09e8e1b162764431ec65ca0e90907d7ea62cb2a1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 Jun 2012 22:31:55 +0100 -Subject: [PATCH 20/95] Allow emmc clock to be specified as command line +Subject: [PATCH 20/98] Allow emmc clock to be specified as command line parameter --- @@ -73803,10 +73569,10 @@ Subject: [PATCH 20/95] Allow emmc clock to be specified as command line 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 64b956b..0241261 100644 +index d174938..0ee983c 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -136,6 +136,7 @@ static inline unsigned long int since_ns(hptime_t t) +@@ -130,6 +130,7 @@ static inline unsigned long int since_ns(hptime_t t) } static bool allow_highspeed = 1; @@ -73814,7 +73580,7 @@ index 64b956b..0241261 100644 #if 0 static void hptime_test(void) -@@ -361,7 +362,7 @@ void sdhci_bcm2708_writeb(struct sdhci_host *host, u8 val, int reg) +@@ -355,7 +356,7 @@ void sdhci_bcm2708_writeb(struct sdhci_host *host, u8 val, int reg) static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host) { @@ -73823,7 +73589,7 @@ index 64b956b..0241261 100644 } /*****************************************************************************\ -@@ -1491,6 +1492,7 @@ static void __exit sdhci_drv_exit(void) +@@ -1361,6 +1362,7 @@ static void __exit sdhci_drv_exit(void) module_exit(sdhci_drv_exit); module_param(allow_highspeed, bool, 0444); @@ -73831,7 +73597,7 @@ index 64b956b..0241261 100644 MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); MODULE_AUTHOR("Broadcom "); -@@ -1498,4 +1500,6 @@ static void __exit sdhci_drv_exit(void) +@@ -1368,4 +1370,6 @@ static void __exit sdhci_drv_exit(void) MODULE_ALIAS("platform:"DRIVER_NAME); MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes"); @@ -73842,10 +73608,10 @@ index 64b956b..0241261 100644 1.8.1.6 -From ca89e3b94174cc1da6b6b2df4be628352a18d44f Mon Sep 17 00:00:00 2001 +From 6170b6726f14cc5a50b4707da7266b2eb2df7d05 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 Jun 2012 22:35:38 +0100 -Subject: [PATCH 21/95] sdhci-bcm2708: raise DMA sync timeout +Subject: [PATCH 21/98] sdhci-bcm2708: raise DMA sync timeout Commit d64b84c by accident reduced the maximum overall DMA sync timeout. The maximum overall timeout was reduced from 100ms to 30ms, @@ -73859,10 +73625,10 @@ enough for most cards. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 0241261..13abbc9 100644 +index 0ee983c..b0cdd7d 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -840,7 +840,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, +@@ -830,7 +830,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, We get CRC and DEND errors unless we wait for the SD controller to finish reading/writing to the card. */ u32 state_mask; @@ -73875,10 +73641,10 @@ index 0241261..13abbc9 100644 1.8.1.6 -From f4c976470e366c01c2fd172cfeb4d495107002d0 Mon Sep 17 00:00:00 2001 +From d0693090be715641994f1c52bd1dba2de9b27385 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 17 Jun 2012 00:14:54 +0100 -Subject: [PATCH 22/95] Explicitly set usb host channels to 8, as in the spec +Subject: [PATCH 22/98] Explicitly set usb host channels to 8, as in the spec --- drivers/usb/host/dwc_otg/dwc_otg_core_if.h | 3 ++- @@ -73902,10 +73668,10 @@ index 4a78b03..25aae5e 100644 1.8.1.6 -From 2ec0d2172a0b6cf2a459bc9d7c469ae2c6c6f1f9 Mon Sep 17 00:00:00 2001 +From 5c0ed036f9488c743eca5260f2b5d8f421766383 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 22 Jun 2012 12:55:39 +0100 -Subject: [PATCH 23/95] Fix unintended line swap that cause cause memory leak +Subject: [PATCH 23/98] Fix unintended line swap that cause cause memory leak in USB driver --- @@ -73930,20 +73696,20 @@ index 2a3b689..970b065 100644 1.8.1.6 -From a1146c3f5c1e2cf715d587400f8e71af795de43c Mon Sep 17 00:00:00 2001 +From 8da8147a7fb91311225e41cc77e87e90b1093750 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 22 Jun 2012 12:57:42 +0100 -Subject: [PATCH 24/95] Use ndelay rather than udelay. Thanks lb +Subject: [PATCH 24/98] Use ndelay rather than udelay. Thanks lb --- drivers/mmc/host/sdhci-bcm2708.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 13abbc9..1d8751c 100644 +index b0cdd7d..7bba950 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -255,14 +255,14 @@ static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg) +@@ -249,14 +249,14 @@ static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg) if (now == last_write_hpt || now == last_write_hpt+1) { /* we can't guarantee any significant time has * passed - we'll have to wait anyway ! */ @@ -73960,7 +73726,7 @@ index 13abbc9..1d8751c 100644 } last_write_hpt = now; } -@@ -278,13 +278,13 @@ static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg) +@@ -272,13 +272,13 @@ static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg) ier &= ~SDHCI_INT_DATA_TIMEOUT; writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE); timeout_disabled = true; @@ -73980,10 +73746,10 @@ index 13abbc9..1d8751c 100644 1.8.1.6 -From 86edb5235ecd9e3ba69e3a97a02b40e6376394c0 Mon Sep 17 00:00:00 2001 +From 27786e9017d099826200db1a7acaa1621a5c77bb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Jun 2012 15:54:11 +0100 -Subject: [PATCH 25/95] Fixed issue with some keyboards giving too much data +Subject: [PATCH 25/98] Fixed issue with some keyboards giving too much data resulting in overrun of the input buffer and memory corruption causing an OOPS. We should be checking for the fact that we might get more data than we want. Thanks Naren. @@ -74080,10 +73846,10 @@ index 970b065..05fd421 100644 1.8.1.6 -From d64807509c4d97befc91c9b5066b7e1cb7b6e78d Mon Sep 17 00:00:00 2001 +From 4d31e006ac48fc386ab69092e732374d582b774e Mon Sep 17 00:00:00 2001 From: Bryan Kemp Date: Sat, 7 Jul 2012 16:24:07 -0500 -Subject: [PATCH 26/95] Updating dwc_otg driver to fix issue releasing pcm +Subject: [PATCH 26/98] Updating dwc_otg driver to fix issue releasing pcm stream see: https://github.com/raspberrypi/firmware/issues/51 --- @@ -74154,10 +73920,10 @@ index 05fd421..e9f4f31 100644 1.8.1.6 -From f6a7f1be06b9dcf9d6c66ab4601ff337cb74274f Mon Sep 17 00:00:00 2001 +From 5619f2d372973e30fdd752be7f904919301a11d9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:44:40 +0100 -Subject: [PATCH 27/95] Backport of Chris Boot's i2c and spi drivers. +Subject: [PATCH 27/98] Backport of Chris Boot's i2c and spi drivers. --- arch/arm/configs/bcmrpi_cutdown_defconfig | 10 + @@ -75446,10 +75212,10 @@ index 0000000..9f1580e 1.8.1.6 -From 2413e776a3cc5e0e090a758a4f618a7543ccc449 Mon Sep 17 00:00:00 2001 +From d9d613b3060f515227befa1ceaa847a8ddd8d9cb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 19 Jul 2012 16:00:28 +0100 -Subject: [PATCH 28/95] Add SPI_SPI_DEV module +Subject: [PATCH 28/98] Add SPI_SPI_DEV module --- arch/arm/configs/bcmrpi_defconfig | 1 + @@ -75471,10 +75237,10 @@ index 6219df3..31f5afaa 100644 1.8.1.6 -From 97ae9d4ff362beb78e4e8beddd2172e89fd9cf3e Mon Sep 17 00:00:00 2001 +From bc0c859db722bb88915e1987fa02bec82f3d32d2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 13 Jul 2012 18:34:18 +0100 -Subject: [PATCH 29/95] Fix for quitting X hang. Interrupted mailbox reads are +Subject: [PATCH 29/98] Fix for quitting X hang. Interrupted mailbox reads are not something we can reliably recover from, so down_interruptable is not a safe call. @@ -75509,20 +75275,20 @@ index 799a0ac..3874051 100644 1.8.1.6 -From 3fb82a6a148cc1c7ba4333ea6efd02b7f218049d Mon Sep 17 00:00:00 2001 +From 5faeab13f46472006aaadd441c9a2f340d45d9e5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 17 Jul 2012 00:48:27 +0100 -Subject: [PATCH 30/95] Add sync_after_dma module parameter +Subject: [PATCH 30/98] Add sync_after_dma module parameter --- drivers/mmc/host/sdhci-bcm2708.c | 60 +++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 1d8751c..1d50cc6 100644 +index 7bba950..3792b9f 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -52,7 +52,6 @@ +@@ -51,7 +51,6 @@ #undef CONFIG_MMC_SDHCI_BCM2708_DMA #define CONFIG_MMC_SDHCI_BCM2708_DMA y @@ -75530,7 +75296,7 @@ index 1d8751c..1d50cc6 100644 #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA /* #define CHECK_DMA_USE */ #endif -@@ -137,6 +136,7 @@ static inline unsigned long int since_ns(hptime_t t) +@@ -131,6 +130,7 @@ static inline unsigned long int since_ns(hptime_t t) static bool allow_highspeed = 1; static int emmc_clock_freq = BCM2708_EMMC_CLOCK_FREQ; @@ -75538,7 +75304,7 @@ index 1d8751c..1d50cc6 100644 #if 0 static void hptime_test(void) -@@ -832,34 +832,34 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, +@@ -822,34 +822,34 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, SDHCI_INT_SPACE_AVAIL); } } else { @@ -75599,7 +75365,7 @@ index 1d8751c..1d50cc6 100644 if (host_priv->complete) { (*host_priv->complete)(host); DBG("PDMA %s complete\n", -@@ -1315,7 +1315,9 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) +@@ -1193,7 +1193,9 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev) SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | SDHCI_QUIRK_MISSING_CAPS | @@ -75610,7 +75376,7 @@ index 1d8751c..1d50cc6 100644 #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA host->flags = SDHCI_USE_PLATDMA; -@@ -1493,6 +1495,7 @@ static void __exit sdhci_drv_exit(void) +@@ -1363,6 +1365,7 @@ static void __exit sdhci_drv_exit(void) module_param(allow_highspeed, bool, 0444); module_param(emmc_clock_freq, int, 0444); @@ -75618,7 +75384,7 @@ index 1d8751c..1d50cc6 100644 MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); MODULE_AUTHOR("Broadcom "); -@@ -1501,5 +1504,6 @@ static void __exit sdhci_drv_exit(void) +@@ -1371,5 +1374,6 @@ static void __exit sdhci_drv_exit(void) MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes"); MODULE_PARM_DESC(emmc_clock_freq, "Specify the speed of emmc clock"); @@ -75629,31 +75395,32 @@ index 1d8751c..1d50cc6 100644 1.8.1.6 -From 715e9dc9c5f12fc5fccccdb785c80354722e2477 Mon Sep 17 00:00:00 2001 -From: Grigori Goronzy -Date: Thu, 21 Jun 2012 00:57:59 +0200 -Subject: [PATCH 31/95] sdhci-bcm2708: use extension FIFO to buffer DMA +From 9e07f7687de1fb42f8f4350784c14e95bd4f3c32 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 12 May 2013 12:25:52 +0100 +Subject: [PATCH 31/98] sdhci-bcm2708: use extension FIFO to buffer DMA transfers The additional FIFO might speed up transfers in some cases. --- - drivers/mmc/host/sdhci-bcm2708.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) + drivers/mmc/host/sdhci-bcm2708.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 1d50cc6..882ae42 100644 +index 3792b9f..326b962 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -79,6 +79,8 @@ - #define POWER_LAZY_OFF 1 - #define POWER_ON 2 +@@ -74,6 +74,9 @@ + /* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */ + #define BCM2708_EMMC_CLOCK_FREQ 50000000 +#define REG_EXRDFIFO_EN 0x80 +#define REG_EXRDFIFO_CFG 0x84 - ++ /*****************************************************************************\ * * -@@ -967,10 +969,12 @@ static ssize_t attr_dma_store(struct device *_dev, + * Debug * +@@ -957,10 +960,12 @@ static ssize_t attr_dma_store(struct device *_dev, int on = simple_strtol(buf, NULL, 0); if (on) { host->flags |= SDHCI_USE_PLATDMA; @@ -75666,7 +75433,7 @@ index 1d50cc6..882ae42 100644 printk(KERN_INFO "%s: DMA disabled\n", mmc_hostname(host->mmc)); } -@@ -1399,6 +1403,12 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) +@@ -1272,6 +1277,12 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev) ret = device_create_file(&pdev->dev, &dev_attr_dma_wait); ret = device_create_file(&pdev->dev, &dev_attr_status); @@ -75683,10 +75450,10 @@ index 1d50cc6..882ae42 100644 1.8.1.6 -From 0c5d137e83057b37e17412567ef2d0fd21fb8b1c Mon Sep 17 00:00:00 2001 +From 4579648f2f33a93931e1cb27df5afd8f59955aef Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 20:04:12 +0100 -Subject: [PATCH 32/95] sdhci-bcm2708: use multiblock-type transfers for single +Subject: [PATCH 32/98] sdhci-bcm2708: use multiblock-type transfers for single blocks There are issues with both single block reads (missed completion) @@ -75713,10 +75480,10 @@ index 5bab73b..8df187c 100644 * token, not a STOP_TRANSMISSION request. */ diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 882ae42..ad44fbe 100644 +index 326b962..c6d6bb0 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -1392,6 +1392,9 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) +@@ -1266,6 +1266,9 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev) if (allow_highspeed) host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; @@ -75742,10 +75509,10 @@ index d6f20cc..860bff9 100644 1.8.1.6 -From d53faa0d797c999d91ad2ef5df057baae948f87d Mon Sep 17 00:00:00 2001 +From 3046166886536f258d853f8dcaabc23e5926ca9d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 Aug 2012 19:02:14 +0100 -Subject: [PATCH 33/95] Add module parameter for missing_status quirk. +Subject: [PATCH 33/98] Add module parameter for missing_status quirk. sdhci-bcm2708.missing_status=0 may improve interrupt latency --- @@ -75753,10 +75520,10 @@ Subject: [PATCH 33/95] Add module parameter for missing_status quirk. 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index ad44fbe..1ac1e64 100644 +index c6d6bb0..8243593 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -139,6 +139,7 @@ static inline unsigned long int since_ns(hptime_t t) +@@ -134,6 +134,7 @@ static inline unsigned long int since_ns(hptime_t t) static bool allow_highspeed = 1; static int emmc_clock_freq = BCM2708_EMMC_CLOCK_FREQ; static bool sync_after_dma = 1; @@ -75764,7 +75531,7 @@ index ad44fbe..1ac1e64 100644 #if 0 static void hptime_test(void) -@@ -1271,7 +1272,6 @@ static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) +@@ -1150,7 +1151,6 @@ static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) .spurious_crc_acmd51 = sdhci_bcm2708_quirk_spurious_crc, .voltage_broken = sdhci_bcm2708_quirk_voltage_broken, .uhs_broken = sdhci_bcm2708_uhs_broken, @@ -75772,7 +75539,7 @@ index ad44fbe..1ac1e64 100644 }; /*****************************************************************************\ -@@ -1310,6 +1310,9 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) +@@ -1189,6 +1189,9 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev) ret = PTR_ERR(host); goto err; } @@ -75782,7 +75549,7 @@ index ad44fbe..1ac1e64 100644 host->hw_name = "BCM2708_Arasan"; host->ops = &sdhci_bcm2708_ops; -@@ -1509,6 +1512,7 @@ static void __exit sdhci_drv_exit(void) +@@ -1380,6 +1383,7 @@ static void __exit sdhci_drv_exit(void) module_param(allow_highspeed, bool, 0444); module_param(emmc_clock_freq, int, 0444); module_param(sync_after_dma, bool, 0444); @@ -75790,7 +75557,7 @@ index ad44fbe..1ac1e64 100644 MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); MODULE_AUTHOR("Broadcom "); -@@ -1518,5 +1522,6 @@ static void __exit sdhci_drv_exit(void) +@@ -1389,5 +1393,6 @@ static void __exit sdhci_drv_exit(void) MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes"); MODULE_PARM_DESC(emmc_clock_freq, "Specify the speed of emmc clock"); MODULE_PARM_DESC(sync_after_dma, "Block in driver until dma complete"); @@ -75801,20 +75568,20 @@ index ad44fbe..1ac1e64 100644 1.8.1.6 -From 919d96f78e7bd8a62d63fee97a8701dafdc93f64 Mon Sep 17 00:00:00 2001 +From d3c4bf4da40415ed87bb27a08a9c88a423f84248 Mon Sep 17 00:00:00 2001 From: ddv2005 Date: Sun, 5 Aug 2012 10:42:12 -0400 -Subject: [PATCH 34/95] Fix spinlock recursion in sdhci-bcm2708.c +Subject: [PATCH 34/98] Fix spinlock recursion in sdhci-bcm2708.c --- drivers/mmc/host/sdhci-bcm2708.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 1ac1e64..e2eab34 100644 +index 8243593..7a703c2 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -652,11 +652,11 @@ static void schci_bcm2708_dma_go(struct sdhci_host *host) +@@ -643,11 +643,11 @@ static void schci_bcm2708_dma_go(struct sdhci_host *host) sdhci_bcm2708_platdma_reset(struct sdhci_host *host, struct mmc_data *data) { struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); @@ -75828,7 +75595,7 @@ index 1ac1e64..e2eab34 100644 if (host_priv->dma_wanted) { if (NULL == data) { -@@ -736,7 +736,7 @@ static void schci_bcm2708_dma_go(struct sdhci_host *host) +@@ -727,7 +727,7 @@ static void schci_bcm2708_dma_go(struct sdhci_host *host) #endif } @@ -75837,7 +75604,7 @@ index 1ac1e64..e2eab34 100644 } -@@ -749,11 +749,11 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, +@@ -740,11 +740,11 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, int sg_len; int sg_ix; int sg_todo; @@ -75851,7 +75618,7 @@ index 1ac1e64..e2eab34 100644 data = host->data; #ifdef CHECK_DMA_USE -@@ -778,7 +778,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, +@@ -769,7 +769,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, if (NULL == data) { DBG("PDMA unused completion - status 0x%X\n", dma_cs); @@ -75860,7 +75627,7 @@ index 1ac1e64..e2eab34 100644 return; } sg = data->sg; -@@ -871,7 +871,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, +@@ -862,7 +862,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, SDHCI_INT_SPACE_AVAIL); } } @@ -75873,10 +75640,10 @@ index 1ac1e64..e2eab34 100644 1.8.1.6 -From 8e771d01ea375a187fd510f836a4cb83abd74f3d Mon Sep 17 00:00:00 2001 +From 70772a7eeb670f5e92079ec07d0369bc9e92aae8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 13:34:40 +0000 -Subject: [PATCH 35/95] Update Synopsys USB OTG driver to v2.94a and disable +Subject: [PATCH 35/98] Update Synopsys USB OTG driver to v2.94a and disable CRYPTOLIB --- @@ -110562,10 +110329,10 @@ index e8220ad..8dc648b 100644 1.8.1.6 -From bd620a2625e4d0cdf924c8100d14095d59b367ad Mon Sep 17 00:00:00 2001 +From 9214ddc59aa8f08d877c9ee1a84f491788562e2e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 19 Aug 2012 11:58:01 +0100 -Subject: [PATCH 36/95] Merged in microframe scheduler, currently disabled. +Subject: [PATCH 36/98] Merged in microframe scheduler, currently disabled. Enable with dwc_otg.microframe_schedule=1 --- @@ -111298,10 +111065,10 @@ index 903a902..08c1669 100644 1.8.1.6 -From b0b228f4abd55993e03e6a1b56431bdc57f93c93 Mon Sep 17 00:00:00 2001 +From 0eb490f3c7878b058da12a996573fc2b57a53817 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Aug 2012 18:49:44 +0100 -Subject: [PATCH 37/95] Read memory size for vc_mem through mailbox property +Subject: [PATCH 37/98] Read memory size for vc_mem through mailbox property channel --- @@ -111472,10 +111239,10 @@ index 67c10ee..775c213 100644 1.8.1.6 -From 4a3b8b15bf9c309dc66b63faec89aef2dd55f48b Mon Sep 17 00:00:00 2001 +From 02d7648325d15cbccbdb57cba620d7ed8fa9621b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 22 Aug 2012 12:43:36 +0100 -Subject: [PATCH 38/95] Update to dwc_otg 3.00. Seems to be a very minor update +Subject: [PATCH 38/98] Update to dwc_otg 3.00. Seems to be a very minor update (mostly adding support for a newer version of hardware) --- @@ -113927,10 +113694,10 @@ index 8dc648b..0572642 100644 1.8.1.6 -From caaf0b3cf7f2dc22ea6d5bcc775e05406a1e63dc Mon Sep 17 00:00:00 2001 +From 48f266f03ce22587aca96efb123ddc1912d99533 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 39/95] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 39/98] enabling the realtime clock 1-wire chip DS1307 and 1-wire on GPIO4 (as a module) --- @@ -113993,10 +113760,10 @@ index 510be0b..d61e747 100644 1.8.1.6 -From d66cb6a6d2487d01bdfd744531af3da8181c8006 Mon Sep 17 00:00:00 2001 +From 0a0fb275d0e029be4749eea14fee73523af7ef6d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 24 Aug 2012 23:25:13 +0100 -Subject: [PATCH 40/95] Turn on microframe_schedule by default. Can still be +Subject: [PATCH 40/98] Turn on microframe_schedule by default. Can still be disabled on command line --- @@ -114020,32 +113787,32 @@ index 8ddc9ae..e7f99e1 100644 1.8.1.6 -From 9a1ed9ad7559a9fff4fdba6ad19b3aa78995dc82 Mon Sep 17 00:00:00 2001 +From 11b684d148ae600198a9fbf8ae709c43e96c0d2f Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Wed, 1 May 2013 20:53:06 +0100 -Subject: [PATCH 41/95] Add low-latency mode to sdcard driver. Enable with - sdhci-bcm2708.enable_llm=1. Thanks ddv2005. +Date: Sun, 12 May 2013 12:27:48 +0100 +Subject: [PATCH 41/98] Add low-latency mode to sdcard driver. Disable with + sdhci-bcm2708.enable_llm=0. Thanks ddv2005. --- - drivers/mmc/host/sdhci-bcm2708.c | 17 +++-- - drivers/mmc/host/sdhci.c | 155 +++++++++++++++++++++++++++++---------- + drivers/mmc/host/sdhci-bcm2708.c | 17 ++-- + drivers/mmc/host/sdhci.c | 165 ++++++++++++++++++++++++++++++--------- drivers/mmc/host/sdhci.h | 6 ++ include/linux/mmc/sdhci.h | 1 + - 4 files changed, 135 insertions(+), 44 deletions(-) + 4 files changed, 145 insertions(+), 44 deletions(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index e2eab34..d0acde7 100644 +index 7a703c2..7ce2829 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -140,6 +140,7 @@ static inline unsigned long int since_ns(hptime_t t) +@@ -135,6 +135,7 @@ static inline unsigned long int since_ns(hptime_t t) static int emmc_clock_freq = BCM2708_EMMC_CLOCK_FREQ; static bool sync_after_dma = 1; static bool missing_status = 1; -+bool enable_llm = 0; ++bool enable_llm = 1; #if 0 static void hptime_test(void) -@@ -880,12 +881,11 @@ static irqreturn_t sdhci_bcm2708_dma_irq(int irq, void *dev_id) +@@ -871,12 +872,11 @@ static irqreturn_t sdhci_bcm2708_dma_irq(int irq, void *dev_id) struct sdhci_host *host = dev_id; struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); u32 dma_cs; /* control and status register */ @@ -114059,7 +113826,7 @@ index e2eab34..d0acde7 100644 dma_cs = readl(host_priv->dma_chan_base + BCM2708_DMA_CS); -@@ -926,8 +926,7 @@ static irqreturn_t sdhci_bcm2708_dma_irq(int irq, void *dev_id) +@@ -917,8 +917,7 @@ static irqreturn_t sdhci_bcm2708_dma_irq(int irq, void *dev_id) result = IRQ_HANDLED; } @@ -114069,7 +113836,7 @@ index e2eab34..d0acde7 100644 return result; } -@@ -1314,9 +1313,12 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) +@@ -1193,9 +1192,12 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev) sdhci_bcm2708_ops.missing_status = sdhci_bcm2708_missing_status; } @@ -114082,7 +113849,7 @@ index e2eab34..d0acde7 100644 host->quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | -@@ -1382,12 +1384,13 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) +@@ -1256,12 +1258,13 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev) } host_priv->dma_chan = ret; @@ -114098,7 +113865,7 @@ index e2eab34..d0acde7 100644 DBG("DMA CBs %p handle %08X DMA%d %p DMA IRQ %d\n", host_priv->cb_base, (unsigned)host_priv->cb_handle, host_priv->dma_chan, host_priv->dma_chan_base, -@@ -1513,6 +1516,7 @@ static void __exit sdhci_drv_exit(void) +@@ -1384,6 +1387,7 @@ static void __exit sdhci_drv_exit(void) module_param(emmc_clock_freq, int, 0444); module_param(sync_after_dma, bool, 0444); module_param(missing_status, bool, 0444); @@ -114106,7 +113873,7 @@ index e2eab34..d0acde7 100644 MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); MODULE_AUTHOR("Broadcom "); -@@ -1523,5 +1527,6 @@ static void __exit sdhci_drv_exit(void) +@@ -1394,5 +1398,6 @@ static void __exit sdhci_drv_exit(void) MODULE_PARM_DESC(emmc_clock_freq, "Specify the speed of emmc clock"); MODULE_PARM_DESC(sync_after_dma, "Block in driver until dma complete"); MODULE_PARM_DESC(missing_status, "Use the missing status quirk"); @@ -114114,10 +113881,10 @@ index e2eab34..d0acde7 100644 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index 79f9efd..8da17c0 100644 +index 71e2696..c9dcd22 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c -@@ -124,6 +124,79 @@ static void sdhci_dumpregs(struct sdhci_host *host) +@@ -124,6 +124,91 @@ static void sdhci_dumpregs(struct sdhci_host *host) * Low level functions * * * \*****************************************************************************/ @@ -114126,6 +113893,7 @@ index 79f9efd..8da17c0 100644 +void sdhci_spin_lock(struct sdhci_host *host) +{ + spin_lock(&host->lock); ++#ifdef CONFIG_PREEMPT + if(enable_llm) + { + disable_irq_nosync(host->irq); @@ -114133,22 +113901,26 @@ index 79f9efd..8da17c0 100644 + disable_irq_nosync(host->second_irq); + local_irq_enable(); + } ++#endif +} + +void sdhci_spin_unlock(struct sdhci_host *host) +{ ++#ifdef CONFIG_PREEMPT + if(enable_llm) + { + local_irq_disable(); -+ enable_irq(host->irq); + if(host->second_irq) + enable_irq(host->second_irq); ++ enable_irq(host->irq); + } ++#endif + spin_unlock(&host->lock); +} + +void sdhci_spin_lock_irqsave(struct sdhci_host *host,unsigned long *flags) +{ ++#ifdef CONFIG_PREEMPT + if(enable_llm) + { + while(sdhci_locked) @@ -114162,52 +113934,49 @@ index 79f9efd..8da17c0 100644 + local_irq_enable(); + } + else ++#endif + spin_lock_irqsave(&host->lock,*flags); +} + +void sdhci_spin_unlock_irqrestore(struct sdhci_host *host,unsigned long flags) +{ ++#ifdef CONFIG_PREEMPT + if(enable_llm) + { + local_irq_disable(); -+ enable_irq(host->irq); + if(host->second_irq) + enable_irq(host->second_irq); ++ enable_irq(host->irq); + } ++#endif + spin_unlock_irqrestore(&host->lock,flags); +} + +static void sdhci_spin_enable_schedule(struct sdhci_host *host) +{ ++#ifdef CONFIG_PREEMPT + if(enable_llm) + { + sdhci_locked = 1; + preempt_enable(); + } ++#endif +} + +static void sdhci_spin_disable_schedule(struct sdhci_host *host) +{ ++#ifdef CONFIG_PREEMPT + if(enable_llm) + { + preempt_disable(); + sdhci_locked = 0; + } ++#endif +} static void sdhci_clear_set_irqs(struct sdhci_host *host, u32 clear, u32 set) { -@@ -208,7 +281,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) - return; - } - timeout--; -+ sdhci_spin_enable_schedule(host); - mdelay(1); -+ sdhci_spin_disable_schedule(host); - } - - if (host->ops->platform_reset_exit) -@@ -289,7 +364,7 @@ static void sdhci_led_control(struct led_classdev *led, +@@ -289,7 +374,7 @@ static void sdhci_led_control(struct led_classdev *led, struct sdhci_host *host = container_of(led, struct sdhci_host, led); unsigned long flags; @@ -114216,7 +113985,7 @@ index 79f9efd..8da17c0 100644 if (host->runtime_suspended) goto out; -@@ -299,7 +374,7 @@ static void sdhci_led_control(struct led_classdev *led, +@@ -299,7 +384,7 @@ static void sdhci_led_control(struct led_classdev *led, else sdhci_activate_led(host); out: @@ -114225,7 +113994,7 @@ index 79f9efd..8da17c0 100644 } #endif -@@ -1007,7 +1082,9 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) +@@ -1007,7 +1092,9 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) return; } timeout--; @@ -114235,7 +114004,7 @@ index 79f9efd..8da17c0 100644 } DBG("send cmd %d - wait 0x%X irq 0x%x\n", cmd->opcode, mask, sdhci_readl(host, SDHCI_INT_STATUS)); -@@ -1234,7 +1311,9 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) +@@ -1234,7 +1321,9 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) return; } timeout--; @@ -114245,7 +114014,7 @@ index 79f9efd..8da17c0 100644 } clk |= SDHCI_CLOCK_CARD_EN; -@@ -1359,7 +1438,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1330,7 +1419,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) sdhci_runtime_pm_get(host); @@ -114254,7 +114023,7 @@ index 79f9efd..8da17c0 100644 WARN_ON(host->mrq != NULL); -@@ -1417,9 +1496,9 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1388,9 +1477,9 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) mmc->card->type == MMC_TYPE_MMC ? MMC_SEND_TUNING_BLOCK_HS200 : MMC_SEND_TUNING_BLOCK; @@ -114266,7 +114035,7 @@ index 79f9efd..8da17c0 100644 /* Restore original mmc_request structure */ host->mrq = mrq; -@@ -1433,7 +1512,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1404,7 +1493,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) } mmiowb(); @@ -114275,9 +114044,9 @@ index 79f9efd..8da17c0 100644 } static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) -@@ -1443,10 +1522,10 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1413,10 +1502,10 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) + int vdd_bit = -1; u8 ctrl; - int rc; - spin_lock_irqsave(&host->lock, flags); + sdhci_spin_lock_irqsave(host, &flags); @@ -114288,7 +114057,7 @@ index 79f9efd..8da17c0 100644 if (host->vmmc && ios->power_mode == MMC_POWER_OFF) mmc_regulator_set_ocr(host->mmc, host->vmmc, 0); return; -@@ -1473,9 +1552,9 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1443,9 +1532,9 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) vdd_bit = sdhci_set_power(host, ios->vdd); if (host->vmmc && vdd_bit != -1) { @@ -114300,16 +114069,16 @@ index 79f9efd..8da17c0 100644 } if (host->ops->platform_send_init_74_clocks) -@@ -1614,7 +1693,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1583,7 +1672,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); mmiowb(); - spin_unlock_irqrestore(&host->lock, flags); + sdhci_spin_unlock_irqrestore(host, flags); + } - if (ios->power_mode == MMC_POWER_OFF) { - do -@@ -1637,7 +1716,7 @@ static int sdhci_check_ro(struct sdhci_host *host) + static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) +@@ -1600,7 +1689,7 @@ static int sdhci_check_ro(struct sdhci_host *host) unsigned long flags; int is_readonly; @@ -114318,7 +114087,7 @@ index 79f9efd..8da17c0 100644 if (host->flags & SDHCI_DEVICE_DEAD) is_readonly = 0; -@@ -1647,7 +1726,7 @@ static int sdhci_check_ro(struct sdhci_host *host) +@@ -1610,7 +1699,7 @@ static int sdhci_check_ro(struct sdhci_host *host) is_readonly = !(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_WRITE_PROTECT); @@ -114327,7 +114096,7 @@ index 79f9efd..8da17c0 100644 /* This quirk needs to be replaced by a callback-function later */ return host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT ? -@@ -1720,9 +1799,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) +@@ -1683,9 +1772,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) struct sdhci_host *host = mmc_priv(mmc); unsigned long flags; @@ -114339,7 +114108,7 @@ index 79f9efd..8da17c0 100644 } static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, -@@ -2066,7 +2145,7 @@ static void sdhci_card_event(struct mmc_host *mmc) +@@ -2029,7 +2118,7 @@ static void sdhci_card_event(struct mmc_host *mmc) struct sdhci_host *host = mmc_priv(mmc); unsigned long flags; @@ -114348,7 +114117,7 @@ index 79f9efd..8da17c0 100644 /* Check host->mrq first in case we are runtime suspended */ if (host->mrq && -@@ -2083,7 +2162,7 @@ static void sdhci_card_event(struct mmc_host *mmc) +@@ -2046,7 +2135,7 @@ static void sdhci_card_event(struct mmc_host *mmc) tasklet_schedule(&host->finish_tasklet); } @@ -114357,7 +114126,7 @@ index 79f9efd..8da17c0 100644 } static const struct mmc_host_ops sdhci_ops = { -@@ -2121,14 +2200,14 @@ static void sdhci_tasklet_finish(unsigned long param) +@@ -2084,14 +2173,14 @@ static void sdhci_tasklet_finish(unsigned long param) host = (struct sdhci_host*)param; @@ -114374,7 +114143,7 @@ index 79f9efd..8da17c0 100644 return; } -@@ -2166,7 +2245,7 @@ static void sdhci_tasklet_finish(unsigned long param) +@@ -2129,7 +2218,7 @@ static void sdhci_tasklet_finish(unsigned long param) #endif mmiowb(); @@ -114383,7 +114152,7 @@ index 79f9efd..8da17c0 100644 mmc_request_done(host->mmc, mrq); sdhci_runtime_pm_put(host); -@@ -2179,7 +2258,7 @@ static void sdhci_timeout_timer(unsigned long data) +@@ -2142,7 +2231,7 @@ static void sdhci_timeout_timer(unsigned long data) host = (struct sdhci_host*)data; @@ -114392,7 +114161,7 @@ index 79f9efd..8da17c0 100644 if (host->mrq) { pr_err("%s: Timeout waiting for hardware " -@@ -2200,7 +2279,7 @@ static void sdhci_timeout_timer(unsigned long data) +@@ -2163,7 +2252,7 @@ static void sdhci_timeout_timer(unsigned long data) } mmiowb(); @@ -114401,7 +114170,7 @@ index 79f9efd..8da17c0 100644 } static void sdhci_tuning_timer(unsigned long data) -@@ -2210,11 +2289,11 @@ static void sdhci_tuning_timer(unsigned long data) +@@ -2173,11 +2262,11 @@ static void sdhci_tuning_timer(unsigned long data) host = (struct sdhci_host *)data; @@ -114415,7 +114184,7 @@ index 79f9efd..8da17c0 100644 } /*****************************************************************************\ -@@ -2438,10 +2517,10 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) +@@ -2401,10 +2490,10 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) u32 intmask, unexpected = 0; int cardint = 0, max_loops = 16; @@ -114428,7 +114197,7 @@ index 79f9efd..8da17c0 100644 pr_warning("%s: got irq while runtime suspended\n", mmc_hostname(host->mmc)); return IRQ_HANDLED; -@@ -2545,7 +2624,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) +@@ -2508,7 +2597,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) if (intmask && --max_loops) goto again; out: @@ -114437,7 +114206,7 @@ index 79f9efd..8da17c0 100644 if (unexpected) { pr_err("%s: Unexpected interrupt 0x%08x.\n", -@@ -2713,15 +2792,15 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host) +@@ -2670,15 +2759,15 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host) host->flags &= ~SDHCI_NEEDS_RETUNING; } @@ -114457,7 +114226,7 @@ index 79f9efd..8da17c0 100644 return ret; } -@@ -2747,16 +2826,16 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) +@@ -2704,16 +2793,16 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) sdhci_do_start_signal_voltage_switch(host, &host->mmc->ios); if ((host_flags & SDHCI_PV_ENABLED) && !(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN)) { @@ -114477,7 +114246,7 @@ index 79f9efd..8da17c0 100644 host->runtime_suspended = false; -@@ -2767,7 +2846,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) +@@ -2724,7 +2813,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) /* Enable Card Detection */ sdhci_enable_card_detection(host); @@ -114486,7 +114255,7 @@ index 79f9efd..8da17c0 100644 return ret; } -@@ -3254,7 +3333,7 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -3211,7 +3300,7 @@ int sdhci_add_host(struct sdhci_host *host) host->tuning_timer.function = sdhci_tuning_timer; } @@ -114495,7 +114264,7 @@ index 79f9efd..8da17c0 100644 mmc_hostname(mmc), host); if (ret) { pr_err("%s: Failed to request IRQ %d: %d\n", -@@ -3318,7 +3397,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) +@@ -3275,7 +3364,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) unsigned long flags; if (dead) { @@ -114504,7 +114273,7 @@ index 79f9efd..8da17c0 100644 host->flags |= SDHCI_DEVICE_DEAD; -@@ -3330,7 +3409,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) +@@ -3287,7 +3376,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) tasklet_schedule(&host->finish_tasklet); } @@ -114514,10 +114283,10 @@ index 79f9efd..8da17c0 100644 sdhci_disable_card_detection(host); diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h -index 45592d2..9932ae8 100644 +index f90574e..cc393af 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h -@@ -446,4 +446,10 @@ static inline void *sdhci_priv(struct sdhci_host *host) +@@ -441,4 +441,10 @@ static inline void *sdhci_priv(struct sdhci_host *host) extern int sdhci_runtime_resume_host(struct sdhci_host *host); #endif @@ -114544,37 +114313,10 @@ index f3a39c1..58bfab0 100644 1.8.1.6 -From a03921149702b50c7504a67cc69c75b312689f97 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 31 Aug 2012 12:53:51 +0100 -Subject: [PATCH 42/95] Enable low latency mode by default in sdcard driver. - Can be disabled with sdhci-bcm2708.enable_llm=0 - ---- - drivers/mmc/host/sdhci-bcm2708.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index d0acde7..2703103 100644 ---- a/drivers/mmc/host/sdhci-bcm2708.c -+++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -140,7 +140,7 @@ static inline unsigned long int since_ns(hptime_t t) - static int emmc_clock_freq = BCM2708_EMMC_CLOCK_FREQ; - static bool sync_after_dma = 1; - static bool missing_status = 1; --bool enable_llm = 0; -+bool enable_llm = 1; - - #if 0 - static void hptime_test(void) --- -1.8.1.6 - - -From d9951935d16acffeb8442751e5b910305404cca6 Mon Sep 17 00:00:00 2001 +From 78459294cc7f7f6d78851b7b343aad0a4b94982d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 12:02:03 +0100 -Subject: [PATCH 43/95] Add FIQ patch to dwc_otg driver. Enable with +Subject: [PATCH 42/98] Add FIQ patch to dwc_otg driver. Enable with dwc_otg.fiq_fix_enable=1. Should give about 10% more ARM performance. Thanks to Gordon and Costas @@ -115734,10 +115476,10 @@ index a7e9076..bb1c42d 100644 1.8.1.6 -From 790f4ed6331cc3328eb7d7510458459160bad414 Mon Sep 17 00:00:00 2001 +From 27cb36d5d42e9121b7f79e631e0e3190dd886a40 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 12 Apr 2013 23:58:47 +0100 -Subject: [PATCH 46/95] Add verious user config requests. +Subject: [PATCH 45/98] Add verious user config requests. CONFIG_DEVTMPFS_MOUNT, CONFIG_NFS_V4_1=y CONFIG_NFSD_V3_ACL=y CONFIG_NFSD_V4=y, drbd and IPSEC modules @@ -116147,10 +115889,10 @@ index 31f5afaa..ef43466 100644 1.8.1.6 -From 3f20000a1d7914490fb412d0c30601d1fafbb759 Mon Sep 17 00:00:00 2001 +From ac3412470183a71d5c5b762fb6c81c6b9ee31193 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Sep 2012 14:49:16 +0100 -Subject: [PATCH 47/95] Don't believe KDIR is required when building as part of +Subject: [PATCH 46/98] Don't believe KDIR is required when building as part of kernel --- @@ -116178,10 +115920,10 @@ index 203c7ea..63e3485 100644 1.8.1.6 -From 736f10345c26243dc1b29371135dd9f440f15972 Mon Sep 17 00:00:00 2001 +From c91242c1f74e5dfde52fc6180508f4f0115aebdf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Sep 2012 15:17:53 +0100 -Subject: [PATCH 48/95] Avoid dynamic memory allocation for channel lock in USB +Subject: [PATCH 47/98] Avoid dynamic memory allocation for channel lock in USB driver. Thanks ddv2005. --- @@ -116288,10 +116030,10 @@ index f1658fa..21e8f09 100644 1.8.1.6 -From 68ca431893f399302cd3869ee509628f92cc95f5 Mon Sep 17 00:00:00 2001 +From 7e235aaefd873d791af85bdb26beae2db6235773 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 12:04:44 +0100 -Subject: [PATCH 49/95] Add cpufreq driver +Subject: [PATCH 48/98] Add cpufreq driver --- arch/arm/Kconfig | 1 + @@ -116819,10 +116561,10 @@ index 0000000..aa6fc66 1.8.1.6 -From c18c17004d6f1d7f72d8a12ec9494e883a43abf9 Mon Sep 17 00:00:00 2001 +From 6bfd6f15475d8c57145fcefa1513c1de8ae4cb47 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 8 Apr 2013 21:12:48 +0100 -Subject: [PATCH 50/95] Add NAK holdoff scheme. Enabled by default, disable +Subject: [PATCH 49/98] Add NAK holdoff scheme. Enabled by default, disable with dwc_otg.nak_holdoff_enable=0. Thanks gsh --- @@ -117032,10 +116774,10 @@ index ac10323..e6b2a7b 100644 1.8.1.6 -From 04a378c1036eb1c92290b7268144c4f94e07d05c Mon Sep 17 00:00:00 2001 +From d793bfa36883079927d2b4ac45e0824b408e4cd9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 51/95] Added hwmon/thermal driver for reporting core +Subject: [PATCH 50/98] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian --- @@ -117559,10 +117301,10 @@ index 0000000..f1ecdb2 1.8.1.6 -From 7268e463bed7aede375481f6ed48c70b315df6bc Mon Sep 17 00:00:00 2001 +From 6a7dd4bc5dde74ca7a769aa0fa3a7bd6213552a5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 12 Apr 2013 23:59:27 +0100 -Subject: [PATCH 52/95] Add config options for thermal sensor, L2TP, +Subject: [PATCH 51/98] Add config options for thermal sensor, L2TP, RT2800USB_UNKNOWN, and various I2C and SPI RTCs. Tidy of thermal driver. --- @@ -117730,10 +117472,10 @@ index f1ecdb2..3f9a733 100644 1.8.1.6 -From dbb27e6e511589e6d951a4fc6dd90ae4c87aaccf Mon Sep 17 00:00:00 2001 +From 3c1fc05cfc59dd1be85600f2bca94d7700e70d25 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 28 Mar 2013 01:19:54 +0000 -Subject: [PATCH 53/95] 2708fb: Remove some unnecessary dmesg output. +Subject: [PATCH 52/98] 2708fb: Remove some unnecessary dmesg output. --- drivers/video/bcm2708_fb.c | 34 +++++++++++++++++++--------------- @@ -117860,10 +117602,10 @@ index c82dd90..08d9238 100644 1.8.1.6 -From fa830efc9affbb36f0ef96b97e337dc76c7b6a78 Mon Sep 17 00:00:00 2001 +From 083eb06994b92388ff59bfb7e708606cc297638f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 28 Mar 2013 01:20:34 +0000 -Subject: [PATCH 54/95] cpufreq: Remove some unnecessary dmesg output. +Subject: [PATCH 53/98] cpufreq: Remove some unnecessary dmesg output. --- drivers/cpufreq/bcm2835-cpufreq.c | 2 +- @@ -117886,10 +117628,10 @@ index aa6fc66..6ff1edb 100755 1.8.1.6 -From b69b507614b12eb36d6c9ab9c69bc83a7d3d0e00 Mon Sep 17 00:00:00 2001 +From 0c20134fb009a06049dd26b994a70085002cf4cc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 17 Sep 2012 22:57:29 +0100 -Subject: [PATCH 55/95] Switch to powersave governor. We'll enable ondemand in +Subject: [PATCH 54/98] Switch to powersave governor. We'll enable ondemand in the distribution --- @@ -117917,10 +117659,10 @@ index d11f688..c1afa47 100644 1.8.1.6 -From 69c9c89722e48fec53c8e7260b77bdaf6d39b99f Mon Sep 17 00:00:00 2001 +From c5cea896a470a53f8d427b035233e465cb0105e9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Apr 2013 12:16:36 +0100 -Subject: [PATCH 56/95] Enable multiple ALSA channels +Subject: [PATCH 55/98] Enable multiple ALSA channels --- arch/arm/mach-bcm2708/bcm2708.c | 54 ++++++++++++++++++++++++++++++++++++----- @@ -117995,10 +117737,10 @@ index 2875cd2..27e9553 100644 1.8.1.6 -From 3f3eccd9a846adf02d10ad69465943a65739bb3b Mon Sep 17 00:00:00 2001 +From 79058dfc58b650b2b8759e27491c96337b23cb6c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Oct 2012 20:08:19 +0100 -Subject: [PATCH 57/95] set i2c speed via module-parameter or menuconfig. +Subject: [PATCH 56/98] set i2c speed via module-parameter or menuconfig. Thanks FrankBoesing --- @@ -118073,10 +117815,10 @@ index 7cae615..3391889 100644 1.8.1.6 -From 1f7f1d615177aaba6bae39baf3e0c074307c7c71 Mon Sep 17 00:00:00 2001 +From dd419344111e0c10e560adf4ed069b74ab67e531 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Oct 2012 21:31:48 +0100 -Subject: [PATCH 58/95] Allow the number of cycles delay between sdcard +Subject: [PATCH 57/98] Allow the number of cycles delay between sdcard peripheral writes to be specified on command line with sdhci-bcm2708.cycle_delay @@ -118085,10 +117827,10 @@ Subject: [PATCH 58/95] Allow the number of cycles delay between sdcard 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 2703103..80e4228 100644 +index 7ce2829..ffd7310 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -82,6 +82,8 @@ +@@ -77,6 +77,8 @@ #define REG_EXRDFIFO_EN 0x80 #define REG_EXRDFIFO_CFG 0x84 @@ -118097,7 +117839,7 @@ index 2703103..80e4228 100644 /*****************************************************************************\ * * * Debug * -@@ -254,7 +256,7 @@ static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg) +@@ -249,7 +251,7 @@ static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg) /* host->clock is the clock freq in Hz */ static hptime_t last_write_hpt; hptime_t now = hptime(); @@ -118106,7 +117848,7 @@ index 2703103..80e4228 100644 if (now == last_write_hpt || now == last_write_hpt+1) { /* we can't guarantee any significant time has -@@ -1517,6 +1519,7 @@ static void __exit sdhci_drv_exit(void) +@@ -1388,6 +1390,7 @@ static void __exit sdhci_drv_exit(void) module_param(sync_after_dma, bool, 0444); module_param(missing_status, bool, 0444); module_param(enable_llm, bool, 0444); @@ -118118,10 +117860,10 @@ index 2703103..80e4228 100644 1.8.1.6 -From b220aacb415f9c27ba17cbf0bf1a9141f32f9b2a Mon Sep 17 00:00:00 2001 +From 074b0842b2feeb4bf924b4642217206ba10ce1b8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Apr 2013 14:37:25 +0100 -Subject: [PATCH 59/95] Fix vc-mem by using module parameters +Subject: [PATCH 58/98] Fix vc-mem by using module parameters --- arch/arm/mach-bcm2708/bcm2708.c | 12 ++--- @@ -118356,10 +118098,10 @@ index ae1810c..5c56b31 100644 1.8.1.6 -From 13f54027174a3fb2798bbddaaea57f95e072ae84 Mon Sep 17 00:00:00 2001 +From e2a149d5cb1132424aa8eb7841e9c4001e46a65d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 5 Oct 2012 22:44:47 +0100 -Subject: [PATCH 60/95] Support dummy vc-mem ioctl used by vcdbg +Subject: [PATCH 59/98] Support dummy vc-mem ioctl used by vcdbg --- arch/arm/mach-bcm2708/include/mach/vc_mem.h | 1 + @@ -118407,10 +118149,10 @@ index 5c56b31..f12cb49 100644 1.8.1.6 -From 67bb97a7ddc0c18b18738c8d8cba6954f3668c85 Mon Sep 17 00:00:00 2001 +From 1a618d1167c4fd3b5ae1009d901bd37582dc4df0 Mon Sep 17 00:00:00 2001 From: dero Date: Mon, 19 Nov 2012 12:46:06 +0100 -Subject: [PATCH 61/95] Lazy CRC quirk: Implemented retrying mechanisms for SD +Subject: [PATCH 60/98] Lazy CRC quirk: Implemented retrying mechanisms for SD SSR and SCR, disabled missing_status and spurious CRC ACMD51 quirks by default (should be fixed by the retrying-mechanishm) @@ -118582,10 +118324,10 @@ index 9e645e1..1ee6cf3 100644 /* * Fetch and process SD Status register. diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 80e4228..4d6c616 100644 +index ffd7310..3556ed3 100644 --- a/drivers/mmc/host/sdhci-bcm2708.c +++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -142,6 +142,7 @@ static inline unsigned long int since_ns(hptime_t t) +@@ -137,6 +137,7 @@ static inline unsigned long int since_ns(hptime_t t) static int emmc_clock_freq = BCM2708_EMMC_CLOCK_FREQ; static bool sync_after_dma = 1; static bool missing_status = 1; @@ -118593,7 +118335,7 @@ index 80e4228..4d6c616 100644 bool enable_llm = 1; #if 0 -@@ -1220,7 +1221,7 @@ static unsigned int sdhci_bcm2708_quirk_extra_ints(struct sdhci_host *host) +@@ -1103,7 +1104,7 @@ static unsigned int sdhci_bcm2708_quirk_extra_ints(struct sdhci_host *host) return 1; } @@ -118602,7 +118344,7 @@ index 80e4228..4d6c616 100644 { return 1; } -@@ -1270,7 +1271,6 @@ static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) +@@ -1149,7 +1150,6 @@ static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) .pdma_reset = sdhci_bcm2708_platdma_reset, #endif .extra_ints = sdhci_bcm2708_quirk_extra_ints, @@ -118610,7 +118352,7 @@ index 80e4228..4d6c616 100644 .voltage_broken = sdhci_bcm2708_quirk_voltage_broken, .uhs_broken = sdhci_bcm2708_uhs_broken, }; -@@ -1315,6 +1315,11 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) +@@ -1194,6 +1194,11 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev) sdhci_bcm2708_ops.missing_status = sdhci_bcm2708_missing_status; } @@ -118622,7 +118364,7 @@ index 80e4228..4d6c616 100644 printk("sdhci: %s low-latency mode\n",enable_llm?"Enable":"Disable"); host->hw_name = "BCM2708_Arasan"; -@@ -1518,6 +1523,7 @@ static void __exit sdhci_drv_exit(void) +@@ -1389,6 +1394,7 @@ static void __exit sdhci_drv_exit(void) module_param(emmc_clock_freq, int, 0444); module_param(sync_after_dma, bool, 0444); module_param(missing_status, bool, 0444); @@ -118630,7 +118372,7 @@ index 80e4228..4d6c616 100644 module_param(enable_llm, bool, 0444); module_param(cycle_delay, int, 0444); -@@ -1530,6 +1536,7 @@ static void __exit sdhci_drv_exit(void) +@@ -1401,6 +1407,7 @@ static void __exit sdhci_drv_exit(void) MODULE_PARM_DESC(emmc_clock_freq, "Specify the speed of emmc clock"); MODULE_PARM_DESC(sync_after_dma, "Block in driver until dma complete"); MODULE_PARM_DESC(missing_status, "Use the missing status quirk"); @@ -118642,578 +118384,10 @@ index 80e4228..4d6c616 100644 1.8.1.6 -From fdcef746471a1baddb8a5e09f7778491de6d9bb1 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 12 Apr 2013 22:41:19 +0100 -Subject: [PATCH 62/95] mmc:sdhci-bcm2708.c:Fix up issues with rebase - ---- - drivers/mmc/host/sdhci-bcm2708.c | 137 ++------------------------------------- - 1 file changed, 4 insertions(+), 133 deletions(-) - -diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 4d6c616..3556ed3 100644 ---- a/drivers/mmc/host/sdhci-bcm2708.c -+++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -33,7 +33,6 @@ - #include - #include - #include --#include - - #include "sdhci.h" - -@@ -75,10 +74,6 @@ - /* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */ - #define BCM2708_EMMC_CLOCK_FREQ 50000000 - --#define POWER_OFF 0 --#define POWER_LAZY_OFF 1 --#define POWER_ON 2 -- - #define REG_EXRDFIFO_EN 0x80 - #define REG_EXRDFIFO_CFG 0x84 - -@@ -387,10 +382,6 @@ struct sdhci_bcm2708_priv { - /* tracking scatter gather progress */ - unsigned sg_ix; /* scatter gather list index */ - unsigned sg_done; /* bytes in current sg_ix done */ -- /* power management */ -- BCM_POWER_HANDLE_T power_handle; -- unsigned char power_state; /* enable/disable power state */ -- unsigned char power_mode; /* last set power mode */ - #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA - unsigned char dma_wanted; /* DMA transfer requested */ - unsigned char dma_waits; /* wait states in DMAs */ -@@ -1044,7 +1035,6 @@ static ssize_t attr_status_show(struct device *_dev, - - if (host) { - struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); -- int power_state = host_priv->power_state; - return sprintf(buf, - "present: yes\n" - "power: %s\n" -@@ -1054,10 +1044,7 @@ static ssize_t attr_status_show(struct device *_dev, - #else - "dma: unconfigured\n", - #endif -- power_state == POWER_ON? "on": -- power_state == POWER_OFF? "off": -- power_state == POWER_LAZY_OFF? "lazy-off": -- "", -+ "always on", - host->clock - #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA - , (host->flags & SDHCI_USE_PLATDMA)? "on": "off" -@@ -1106,110 +1093,6 @@ static int sdhci_bcm2708_resume(struct platform_device *dev) - #endif - - --/* Click forwards one step towards fully on */ --static int sdhci_bcm2708_enable(struct sdhci_host *host) --{ -- int rc; -- struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); -- -- if (host_priv->power_state == POWER_OFF) { -- /* warning: may schedule - don't call in irq mode */ -- rc = bcm_power_request(host_priv->power_handle, -- BCM_POWER_SDCARD); -- -- if (rc == 0) { -- mmc_power_restore_host(host->mmc); -- host_priv->power_state = POWER_ON; -- } else if (rc != -EINTR) -- printk(KERN_ERR "%s: mmc power up request failed - " -- "rc %d\n", -- mmc_hostname(host->mmc), rc); -- } else { -- host_priv->power_state = POWER_ON; -- rc = 0; -- } -- -- return rc; --} -- --/* Click backwards one step towards fully off */ --static int sdhci_bcm2708_disable(struct sdhci_host *host, int lazy) --{ -- int rc; -- struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); -- -- if ((host_priv->power_state == POWER_ON) && lazy) { -- host_priv->power_state = POWER_LAZY_OFF; -- return BCM2708_SDHCI_SLEEP_TIMEOUT; -- } -- -- /* warning: may schedule - don't call in irq mode */ -- rc = bcm_power_request(host_priv->power_handle, BCM_POWER_NONE); -- -- if (rc == 0) -- host_priv->power_state = POWER_OFF; -- else if (rc != -EINTR) -- printk(KERN_ERR "%s: mmc power down request failed - rc %d\n", -- mmc_hostname(host->mmc), rc); -- -- return rc; --} -- --static int sdhci_bcm2708_set_plat_power(struct sdhci_host *host, -- int power_mode) --{ -- struct sdhci_bcm2708_priv *host_priv = SDHCI_HOST_PRIV(host); -- int rc; -- -- do { -- rc = mmc_host_enable(host->mmc); -- } while (-EINTR == rc); -- -- if (rc == 0) do { -- if (rc == 0 && power_mode != host_priv->power_mode) -- { -- switch (power_mode) -- { -- case MMC_POWER_OFF: -- rc = bcm_power_request(host_priv->power_handle, -- BCM_POWER_NONE); -- break; -- -- case MMC_POWER_UP: -- rc = bcm_power_request(host_priv->power_handle, -- BCM_POWER_SDCARD); -- /* -- * We need an extra 10ms delay of 10ms before we -- * can apply clock after applying power -- */ -- if (rc == 0) -- mdelay(10); -- break; -- -- case MMC_POWER_ON: -- mdelay(10); -- /* do_send_init_stream = 1; */ -- break; -- } -- -- if (rc == 0) -- host_priv->power_mode = power_mode; -- } -- } while (-EINTR == rc); -- -- if (rc == 0) do { -- if (rc == 0) { -- if (power_mode == MMC_POWER_OFF) -- rc = mmc_host_disable(host->mmc); -- else -- rc = mmc_host_lazy_disable(host->mmc); -- } -- -- } while (-EINTR == rc); -- -- return rc; --} -- - /*****************************************************************************\ - * * - * Device quirk functions. Implemented as local ops because the flags * -@@ -1260,10 +1143,6 @@ static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) - #endif - .get_max_clock = sdhci_bcm2708_get_max_clock, - -- .enable = sdhci_bcm2708_enable, -- .disable = sdhci_bcm2708_disable, -- .set_plat_power = sdhci_bcm2708_set_plat_power, -- - #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA - // Platform DMA operations - .pdma_able = sdhci_bcm2708_platdma_dmaable, -@@ -1281,7 +1160,7 @@ static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) - * * - \*****************************************************************************/ - --static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) -+static int sdhci_bcm2708_probe(struct platform_device *pdev) - { - struct sdhci_host *host; - struct resource *iomem; -@@ -1355,11 +1234,6 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) - - host_priv = SDHCI_HOST_PRIV(host); - -- host_priv->power_state = POWER_ON; -- ret = bcm_power_open(&host_priv->power_handle); -- if (ret != 0) -- goto err_power; -- - #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA - host_priv->dma_wanted = 0; - #ifdef CHECK_DMA_USE -@@ -1441,8 +1315,6 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) - host_priv->cb_handle); - err_alloc_cb: - #endif -- bcm_power_close(host_priv->power_handle); --err_power: - iounmap(host->ioaddr); - err_remap: - release_mem_region(iomem->start, resource_size(iomem)); -@@ -1453,7 +1325,7 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) - return ret; - } - --static int __devexit sdhci_bcm2708_remove(struct platform_device *pdev) -+static int sdhci_bcm2708_remove(struct platform_device *pdev) - { - struct sdhci_host *host = platform_get_drvdata(pdev); - struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); -@@ -1475,7 +1347,6 @@ static int __devexit sdhci_bcm2708_remove(struct platform_device *pdev) - dma_free_writecombine(&pdev->dev, SZ_4K, host_priv->cb_base, - host_priv->cb_handle); - #endif -- bcm_power_close(host_priv->power_handle); - sdhci_remove_host(host, dead); - iounmap(host->ioaddr); - release_mem_region(iomem->start, resource_size(iomem)); -@@ -1491,7 +1362,7 @@ static int __devexit sdhci_bcm2708_remove(struct platform_device *pdev) - .owner = THIS_MODULE, - }, - .probe = sdhci_bcm2708_probe, -- .remove = __devexit_p(sdhci_bcm2708_remove), -+ .remove = sdhci_bcm2708_remove, - - #ifdef CONFIG_PM - .suspend = sdhci_bcm2708_suspend, --- -1.8.1.6 - - -From c430bc8ffc9625615504183a8cfdd9408bbcab7a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 12 Apr 2013 22:41:31 +0100 -Subject: [PATCH 63/95] mmc:sdhci.c:Fix up issues with rebase - ---- - drivers/mmc/host/sdhci.c | 103 ++++++++++++++++------------------------------- - 1 file changed, 35 insertions(+), 68 deletions(-) - -diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index 8da17c0..c9dcd22 100644 ---- a/drivers/mmc/host/sdhci.c -+++ b/drivers/mmc/host/sdhci.c -@@ -28,8 +28,8 @@ - #include - #include - #include --#include - #include -+#include - - #include "sdhci.h" - -@@ -129,6 +129,7 @@ static void sdhci_dumpregs(struct sdhci_host *host) - void sdhci_spin_lock(struct sdhci_host *host) - { - spin_lock(&host->lock); -+#ifdef CONFIG_PREEMPT - if(enable_llm) - { - disable_irq_nosync(host->irq); -@@ -136,22 +137,26 @@ void sdhci_spin_lock(struct sdhci_host *host) - disable_irq_nosync(host->second_irq); - local_irq_enable(); - } -+#endif - } - - void sdhci_spin_unlock(struct sdhci_host *host) - { -+#ifdef CONFIG_PREEMPT - if(enable_llm) - { - local_irq_disable(); -- enable_irq(host->irq); - if(host->second_irq) - enable_irq(host->second_irq); -+ enable_irq(host->irq); - } -+#endif - spin_unlock(&host->lock); - } - - void sdhci_spin_lock_irqsave(struct sdhci_host *host,unsigned long *flags) - { -+#ifdef CONFIG_PREEMPT - if(enable_llm) - { - while(sdhci_locked) -@@ -165,37 +170,44 @@ void sdhci_spin_lock_irqsave(struct sdhci_host *host,unsigned long *flags) - local_irq_enable(); - } - else -+#endif - spin_lock_irqsave(&host->lock,*flags); - } - - void sdhci_spin_unlock_irqrestore(struct sdhci_host *host,unsigned long flags) - { -+#ifdef CONFIG_PREEMPT - if(enable_llm) - { - local_irq_disable(); -- enable_irq(host->irq); - if(host->second_irq) - enable_irq(host->second_irq); -+ enable_irq(host->irq); - } -+#endif - spin_unlock_irqrestore(&host->lock,flags); - } - - static void sdhci_spin_enable_schedule(struct sdhci_host *host) - { -+#ifdef CONFIG_PREEMPT - if(enable_llm) - { - sdhci_locked = 1; - preempt_enable(); - } -+#endif - } - - static void sdhci_spin_disable_schedule(struct sdhci_host *host) - { -+#ifdef CONFIG_PREEMPT - if(enable_llm) - { - preempt_disable(); - sdhci_locked = 0; - } -+#endif - } - - static void sdhci_clear_set_irqs(struct sdhci_host *host, u32 clear, u32 set) -@@ -281,9 +293,7 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) - return; - } - timeout--; -- sdhci_spin_enable_schedule(host); - mdelay(1); -- sdhci_spin_disable_schedule(host); - } - - if (host->ops->platform_reset_exit) -@@ -925,11 +935,11 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) - ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); - ctrl &= ~SDHCI_CTRL_DMA_MASK; - if (! (host->flags & SDHCI_USE_PLATDMA)) { -- if ((host->flags & SDHCI_REQ_USE_DMA) && -- (host->flags & SDHCI_USE_ADMA)) -- ctrl |= SDHCI_CTRL_ADMA32; -- else -- ctrl |= SDHCI_CTRL_SDMA; -+ if ((host->flags & SDHCI_REQ_USE_DMA) && -+ (host->flags & SDHCI_USE_ADMA)) -+ ctrl |= SDHCI_CTRL_ADMA32; -+ else -+ ctrl |= SDHCI_CTRL_SDMA; - } - sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); - } -@@ -1392,35 +1402,6 @@ static int sdhci_set_power(struct sdhci_host *host, unsigned short power) - return power; - } - --/* Power on or off the circuitary supporting the register set */ --static int sdhci_set_plat_power(struct sdhci_host *host, int power_mode) --{ -- if (host->ops->set_plat_power) -- return host->ops->set_plat_power(host, power_mode); -- else -- return 0; --} -- --/* Click forwards one step towards fully on */ --static int sdhci_enable(struct mmc_host *mmc) --{ -- struct sdhci_host *host; -- -- host = mmc_priv(mmc); -- -- return host->ops->enable? host->ops->enable(host): 0; --} -- --/* Click backwards one step towards fully off */ --static int sdhci_disable(struct mmc_host *mmc, int lazy) --{ -- struct sdhci_host *host; -- -- host = mmc_priv(mmc); -- -- return host->ops->disable? host->ops->disable(host, lazy): 0; --} -- - /*****************************************************************************\ - * * - * MMC callbacks * -@@ -1520,7 +1501,6 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) - unsigned long flags; - int vdd_bit = -1; - u8 ctrl; -- int rc; - - sdhci_spin_lock_irqsave(host, &flags); - -@@ -1601,8 +1581,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) - (ios->timing == MMC_TIMING_UHS_SDR50) || - (ios->timing == MMC_TIMING_UHS_SDR104) || - (ios->timing == MMC_TIMING_UHS_DDR50) || -- (ios->timing == MMC_TIMING_UHS_SDR25) || -- (ios->timing == MMC_TIMING_UHS_SDR12)) -+ (ios->timing == MMC_TIMING_UHS_SDR25)) - ctrl |= SDHCI_CTRL_HISPD; - - ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); -@@ -1694,12 +1673,6 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) - - mmiowb(); - sdhci_spin_unlock_irqrestore(host, flags); -- -- if (ios->power_mode == MMC_POWER_OFF) { -- do -- rc = sdhci_set_plat_power(host, ios->power_mode); -- while (rc == -EINTR); -- } - } - - static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) -@@ -2262,7 +2235,7 @@ static void sdhci_timeout_timer(unsigned long data) - - if (host->mrq) { - pr_err("%s: Timeout waiting for hardware " -- "interrupt - cmd%d.\n", mmc_hostname(host->mmc), host->last_cmdop); -+ "interrupt - cmd%d.\n", mmc_hostname(host->mmc), host->last_cmdop); - sdhci_dumpregs(host); - - if (host->data) { -@@ -2308,10 +2281,10 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) - - if (!host->cmd) { - if (!(host->ops->extra_ints)) { -- pr_err("%s: Got command interrupt 0x%08x even " -- "though no command operation was in progress.\n", -- mmc_hostname(host->mmc), (unsigned)intmask); -- sdhci_dumpregs(host); -+ pr_err("%s: Got command interrupt 0x%08x even " -+ "though no command operation was in progress.\n", -+ mmc_hostname(host->mmc), (unsigned)intmask); -+ sdhci_dumpregs(host); - } else - DBG("cmd irq 0x%08x cmd complete\n", (unsigned)intmask); - return; -@@ -2424,12 +2397,12 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) - return; - } - } -- -+ - if (!(host->ops->extra_ints)) { -- pr_err("%s: Got data interrupt 0x%08x even " -- "though no data operation was in progress.\n", -- mmc_hostname(host->mmc), (unsigned)intmask); -- sdhci_dumpregs(host); -+ pr_err("%s: Got data interrupt 0x%08x even " -+ "though no data operation was in progress.\n", -+ mmc_hostname(host->mmc), (unsigned)intmask); -+ sdhci_dumpregs(host); - } else - DBG("data irq 0x%08x but no data\n", (unsigned)intmask); - -@@ -2445,7 +2418,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) - DBG("ignoring spurious data_end_bit error\n"); - intmask = SDHCI_INT_DATA_AVAIL|SDHCI_INT_DATA_END; - } else -- host->data->error = -EILSEQ; -+ host->data->error = -EILSEQ; - } else if ((intmask & SDHCI_INT_DATA_CRC) && - SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)) - != MMC_BUS_TEST_R) { -@@ -2455,7 +2428,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) - DBG("ignoring spurious data_crc_bit error\n"); - intmask = SDHCI_INT_DATA_AVAIL|SDHCI_INT_DATA_END; - } else { -- host->data->error = -EILSEQ; -+ host->data->error = -EILSEQ; - } - } else if (intmask & SDHCI_INT_ADMA_ERROR) { - pr_err("%s: ADMA error\n", mmc_hostname(host->mmc)); -@@ -2718,12 +2691,6 @@ int sdhci_resume_host(struct sdhci_host *host) - { - int ret; - -- if (host->vmmc) { -- int ret = regulator_enable(host->vmmc); -- if (ret) -- return ret; -- } -- - if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA | - SDHCI_USE_PLATDMA)) { - if (host->ops->enable_dma) -@@ -3061,7 +3028,7 @@ int sdhci_add_host(struct sdhci_host *host) - /* Auto-CMD23 stuff only works in ADMA or PIO. */ - if ((host->version >= SDHCI_SPEC_300) && - ((host->flags & SDHCI_USE_ADMA) || -- !(host->flags & SDHCI_USE_SDMA) )) { -+ !(host->flags & SDHCI_USE_SDMA))) { - host->flags |= SDHCI_AUTO_CMD23; - DBG("%s: Auto-CMD23 available\n", mmc_hostname(mmc)); - } else { -@@ -3235,7 +3202,7 @@ int sdhci_add_host(struct sdhci_host *host) - - if(host->ops->voltage_broken) { - ocr_avail |= MMC_VDD_32_33 | MMC_VDD_33_34; -- // Cannot support UHS modes is we are stuck at 3.3V; -+ // Cannot support UHS modes if we are stuck at 3.3V; - mmc->caps &= ~(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50); - } - --- -1.8.1.6 - - -From a4e8cd4b90e40e8266765681ed908a6610d80342 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 12 Apr 2013 22:41:37 +0100 -Subject: [PATCH 64/95] mmc:sdhci.h:Fix up issues with rebase - ---- - drivers/mmc/host/sdhci.h | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h -index 9932ae8..cc393af 100644 ---- a/drivers/mmc/host/sdhci.h -+++ b/drivers/mmc/host/sdhci.h -@@ -290,11 +290,6 @@ struct sdhci_ops { - void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); - int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); - -- int (*enable)(struct sdhci_host *mmc); -- int (*disable)(struct sdhci_host *mmc, int lazy); -- int (*set_plat_power)(struct sdhci_host *mmc, -- int power_mode); -- - int (*pdma_able)(struct sdhci_host *host, - struct mmc_data *data); - void (*pdma_avail)(struct sdhci_host *host, --- -1.8.1.6 - - -From aa4b2f9b06e60345c694712a4f376851cd880d6e Mon Sep 17 00:00:00 2001 +From 49b4cd75acc6fdba028c3b72a03915fb783b8211 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 28 Mar 2013 00:10:32 +0000 -Subject: [PATCH 65/95] bcm2708: Add vc_cma driver to enable use of CMA +Subject: [PATCH 61/98] bcm2708: Add vc_cma driver to enable use of CMA --- arch/arm/mach-bcm2708/bcm2708.c | 18 ++++++++++++++++++ @@ -119274,10 +118448,10 @@ index e010515..9d38d40 100644 1.8.1.6 -From 7709e8d5b95d65d2fdbb3cfe59f6de073a3c8c37 Mon Sep 17 00:00:00 2001 +From 7e2ac45d61bfd7ff39b0cd8e78f11612454385c7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Oct 2012 22:00:43 +0100 -Subject: [PATCH 66/95] Fix reboot with new restart method of machine driver +Subject: [PATCH 62/98] Fix reboot with new restart method of machine driver --- arch/arm/mach-bcm2708/bcm2708.c | 18 +++++++++++++++++- @@ -119355,10 +118529,10 @@ index bc9d458..2d0b821 100644 1.8.1.6 -From a7db2e2fd4b67f16a00c039f3cf7e2e5bdcef561 Mon Sep 17 00:00:00 2001 +From fbee956ee0bc629a53f5dd0b5a312a7bb9353410 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Sun, 4 Nov 2012 15:55:01 +0000 -Subject: [PATCH 67/95] Make sure we wait for the reset to finish +Subject: [PATCH 63/98] Make sure we wait for the reset to finish --- drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 2 ++ @@ -119381,10 +118555,10 @@ index 3e762e2..e8c91e7 100644 1.8.1.6 -From 3132dd7b0bfcd1944784b2605d5e24e25a07b54f Mon Sep 17 00:00:00 2001 +From cfbcc471ffd6711ae93b0132b5edca0c0904bc9b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 19 Nov 2012 18:27:05 +0000 -Subject: [PATCH 68/95] Add Simon Hall's dma helper module, useful in future +Subject: [PATCH 64/98] Add Simon Hall's dma helper module, useful in future for X acceleration --- @@ -120722,10 +119896,10 @@ index 0000000..5cb1335 1.8.1.6 -From 16555ecdf4dc9f49b3d860d483833fdad349f8a2 Mon Sep 17 00:00:00 2001 +From fac111f0dc6579857b79a262115eb6acc79b9c6d Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 69/95] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 65/98] lirc: added support for RaspberryPi GPIO --- drivers/staging/media/lirc/Kconfig | 6 + @@ -121460,10 +120634,10 @@ index 0000000..96acab0 1.8.1.6 -From be52bbc167b78f6642b40002fc8908b3c76a6eb9 Mon Sep 17 00:00:00 2001 +From 8e255c899b8c1730b788f50c9ecdd92b6c43f04d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 25 Nov 2012 18:28:09 +0000 -Subject: [PATCH 70/95] Allow mailbox driver to be called from user code though +Subject: [PATCH 66/98] Allow mailbox driver to be called from user code though ioctl --- @@ -121700,10 +120874,10 @@ index 468fdef..09b78b5 100644 1.8.1.6 -From 21c737667da2695cb7adda165b00449c4d83bb40 Mon Sep 17 00:00:00 2001 +From 6dc85542e98a396a1551cfed9b01095d50fdc24e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Dec 2012 18:23:03 +0000 -Subject: [PATCH 71/95] Default to dwc_otp.lpm_enable=0 +Subject: [PATCH 67/98] Default to dwc_otp.lpm_enable=0 --- drivers/usb/host/dwc_otg/dwc_otg_driver.c | 2 +- @@ -121726,10 +120900,10 @@ index d353a9a..cea8fcb 100644 1.8.1.6 -From f2abd325f8c72fa1921bdc93003370d0019cdf52 Mon Sep 17 00:00:00 2001 +From 45ee86129a3d878d3a720f3e68eb4239d8c28efa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Dec 2012 19:04:27 +0000 -Subject: [PATCH 72/95] Increase default coherent pool so vchiq starts up +Subject: [PATCH 68/98] Increase default coherent pool so vchiq starts up --- arch/arm/mach-bcm2708/bcm2708.c | 4 +--- @@ -121754,10 +120928,10 @@ index 9f456e9..87fd348 100644 1.8.1.6 -From cd3e9b7bd25fc1e3f109fd853a6b2739aa20fd4c Mon Sep 17 00:00:00 2001 +From 9f14fd75602667beb25a144603b663831780c631 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Jan 2013 21:34:59 +0000 -Subject: [PATCH 73/95] Add mutex around bcm_mailbox_property function +Subject: [PATCH 69/98] Add mutex around bcm_mailbox_property function --- arch/arm/mach-bcm2708/vcio.c | 5 ++++- @@ -121797,10 +120971,10 @@ index 09b78b5..599eb63 100644 1.8.1.6 -From dba2a1dcb5f53765afac6612b1bcb06c9849a399 Mon Sep 17 00:00:00 2001 +From 034485623b4918ed4ce8bd8c15304603856d0045 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 9 Jan 2013 16:12:04 +0000 -Subject: [PATCH 74/95] dwc_otg: fix bug in dwc_otg_hcd.c resulting in silent +Subject: [PATCH 70/98] dwc_otg: fix bug in dwc_otg_hcd.c resulting in silent kernel memory corruption, escalating to OOPS under high USB load. --- @@ -121837,10 +121011,10 @@ index e6b2a7b..b337e1b 100644 1.8.1.6 -From 7e8a9d827cabf0db6a14bd5b4a276211e6fbd692 Mon Sep 17 00:00:00 2001 +From 0ef244165c885638ea672ba55d90a4050fb1da19 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 21 Jan 2013 23:03:53 +0000 -Subject: [PATCH 75/95] Return error value from bcm2708_setup_state. Thanks +Subject: [PATCH 71/98] Return error value from bcm2708_setup_state. Thanks notro --- @@ -121863,10 +121037,10 @@ index 9f1580e..8513704 100644 1.8.1.6 -From 2429e28f4db39405773b896e7925860218e44d26 Mon Sep 17 00:00:00 2001 +From 26e96b922bd30cddbd8c1e3aa0dea36d30821ccd Mon Sep 17 00:00:00 2001 From: Kamal Mostafa Date: Mon, 22 Oct 2012 15:52:44 -0700 -Subject: [PATCH 76/95] spi/spi-bcm2708: respect per-transfer SPI clock +Subject: [PATCH 72/98] spi/spi-bcm2708: respect per-transfer SPI clock speed_hz value The bcm2708 SPI driver's bcm2708_process_transfer() was ignoring the @@ -121911,10 +121085,10 @@ index 8513704..b74aa32 100644 1.8.1.6 -From 7622149459557ba0bc886c9c24281948d8ebc2db Mon Sep 17 00:00:00 2001 +From da0350f552bfc8e782bfc8b746518110bee8e222 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 22:29:01 +0000 -Subject: [PATCH 77/95] Add hwrng (hardware random number generator) driver +Subject: [PATCH 73/98] Add hwrng (hardware random number generator) driver Conflicts: --- @@ -122094,10 +121268,10 @@ index 0000000..1ffa7d7 1.8.1.6 -From 8a9e31362a133355f8ec4e9ea30d7453bae8e6e0 Mon Sep 17 00:00:00 2001 +From 0ebf6b6ca0724d536616d8a168a2f7cf6ed8331d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 Feb 2013 17:04:13 +0000 -Subject: [PATCH 78/95] Add missing newlines to log messages +Subject: [PATCH 74/98] Add missing newlines to log messages --- drivers/cpufreq/bcm2835-cpufreq.c | 20 ++++++++++---------- @@ -122196,10 +121370,10 @@ index 6ff1edb..5a19212 100755 1.8.1.6 -From 8d3d6ccc8198707a3667fb3931a4ea91bc1ca87f Mon Sep 17 00:00:00 2001 +From d280bebfd970d43982a5df78227353b6393dc46d Mon Sep 17 00:00:00 2001 From: Technion Date: Mon, 11 Feb 2013 22:08:53 +1100 -Subject: [PATCH 79/95] Changed wording on logging. Previously, we received +Subject: [PATCH 75/98] Changed wording on logging. Previously, we received errors like this: mmc0: could read SD Status register (SSR) at the 3th attempt A more sensible response is now returned. A typo also fixed in comments. @@ -122234,10 +121408,10 @@ index 1ee6cf3..90228f9 100644 1.8.1.6 -From e3f52010f19b564e4f22763cc10ef472c594b8bb Mon Sep 17 00:00:00 2001 +From a3c046d9b88330827ac8f35ebf940ef0a1e07cde Mon Sep 17 00:00:00 2001 From: P33M Date: Fri, 15 Feb 2013 22:36:47 +0000 -Subject: [PATCH 80/95] dwc_otg: Fix unsafe access of QTD during URB enqueue +Subject: [PATCH 76/98] dwc_otg: Fix unsafe access of QTD during URB enqueue In dwc_otg_hcd_urb_enqueue during qtd creation, it was possible that the transaction could complete almost immediately after the qtd was assigned @@ -122324,10 +121498,10 @@ index b337e1b..b3e6e52 100644 1.8.1.6 -From 6421e90373006e1eba37590565dc0ba7dc9d5ff7 Mon Sep 17 00:00:00 2001 +From cc70157a7e0854b99eb41599e6381c9ed06f8155 Mon Sep 17 00:00:00 2001 From: P33M Date: Fri, 15 Feb 2013 22:38:40 +0000 -Subject: [PATCH 81/95] dwc_otg: Fix incorrect URB allocation error handling +Subject: [PATCH 77/98] dwc_otg: Fix incorrect URB allocation error handling If the memory allocation for a dwc_otg_urb failed, the kernel would OOPS because for some reason a member of the *unallocated* struct was set to @@ -122368,10 +121542,10 @@ index e653d84..fcec97f 100644 1.8.1.6 -From b9b308e7fa83703d2be04c04c9a42392eef9effb Mon Sep 17 00:00:00 2001 +From ecdda43eb0dbfc2e15de6039cd2adac412f1c68d Mon Sep 17 00:00:00 2001 From: pjennings Date: Wed, 20 Feb 2013 17:51:43 -0600 -Subject: [PATCH 82/95] Added inverted transmitter support +Subject: [PATCH 78/98] Added inverted transmitter support --- drivers/staging/media/lirc/lirc_rpi.c | 17 +++++++++++------ @@ -122452,10 +121626,10 @@ index 96acab0..5bb0dfe 100644 1.8.1.6 -From 28387c3a462a968228d0e6a22f89fb13680d0b50 Mon Sep 17 00:00:00 2001 +From 75e337fd44be6fb8ba6d71b88ce12c7ecd26eb5e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 24 Feb 2013 16:30:57 +0000 -Subject: [PATCH 83/95] Add retry on error and tidy of temperature driver +Subject: [PATCH 79/98] Add retry on error and tidy of temperature driver --- drivers/thermal/bcm2835-thermal.c | 78 ++++++++++++++------------------------- @@ -122582,10 +121756,10 @@ index 3f9a733..85fceb5 100644 1.8.1.6 -From 0b28dfd60c43cd1a263bfe0722e8ed6ca368c0ae Mon Sep 17 00:00:00 2001 +From 4fde193a1a885d33c6466f3d7d5981fd4cc49ba2 Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 28 Feb 2013 16:52:51 +0000 -Subject: [PATCH 84/95] dwc_otg: fix potential use-after-free case in interrupt +Subject: [PATCH 80/98] dwc_otg: fix potential use-after-free case in interrupt handler If a transaction had previously aborted, certain interrupts are @@ -122617,10 +121791,10 @@ index e8c91e7..0c81a64 100644 1.8.1.6 -From e84447e71ebb957d21e69999b54cae65d7b60d16 Mon Sep 17 00:00:00 2001 +From e0b79f66bcdc2084db2a2b3cc043e62200b2166e Mon Sep 17 00:00:00 2001 From: P33M Date: Sun, 3 Mar 2013 14:45:53 +0000 -Subject: [PATCH 85/95] dwc_otg: add handling of SPLIT transaction data toggle +Subject: [PATCH 81/98] dwc_otg: add handling of SPLIT transaction data toggle errors Previously a data toggle error on packets from a USB1.1 device behind @@ -122675,10 +121849,10 @@ index 0c81a64..16e8c6c 100644 1.8.1.6 -From 8c91077b39b262d7d7b04d5e74cadf40055d6a4f Mon Sep 17 00:00:00 2001 +From 76b262fd78916bd714f9a07887b2429afc035d53 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 21:14:28 +0100 -Subject: [PATCH 86/95] Add bitbanging pullups, use them for w1-gpio +Subject: [PATCH 82/98] Add bitbanging pullups, use them for w1-gpio Allows parasite power to work, uses module option pullup=1 --- @@ -122817,10 +121991,10 @@ index e10acc2..667fdd5 100644 1.8.1.6 -From 9e0a44ca8629762becbcd8cfc91fce2880cc8ce5 Mon Sep 17 00:00:00 2001 +From 4ef8f2e537f6da3b8a7fec148ec5f977aad3e4c9 Mon Sep 17 00:00:00 2001 From: notro Date: Sat, 26 Jan 2013 20:38:03 +0100 -Subject: [PATCH 87/95] spi-bcm2708: add 9-bit support using LoSSI mode +Subject: [PATCH 83/98] spi-bcm2708: add 9-bit support using LoSSI mode --- drivers/spi/spi-bcm2708.c | 30 ++++++++++++++++++++++++++++-- @@ -122890,10 +122064,10 @@ index b74aa32..abaa5a6 100644 1.8.1.6 -From deebe69082b9df25018ea89a5817d164e0aae387 Mon Sep 17 00:00:00 2001 +From ed2b56cca472c3580dd4dd0d9923e18b184361b8 Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 21 Mar 2013 19:36:17 +0000 -Subject: [PATCH 88/95] dwc_otg: implement tasklet for returning URBs to +Subject: [PATCH 84/98] dwc_otg: implement tasklet for returning URBs to usbcore hcd layer The dwc_otg driver interrupt handler for transfer completion will spend @@ -123135,10 +122309,10 @@ index 9702f81..7bb133a 100644 1.8.1.6 -From f3706de4a993683d123fbadad2b14a3d9b5196e8 Mon Sep 17 00:00:00 2001 +From 36674c3936fdf6cbbdaeceb04c44503ece90dfb1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 27 Mar 2013 20:23:39 +0000 -Subject: [PATCH 89/95] dwc_otg: Fix build issue with usb_gadget_probe_driver +Subject: [PATCH 85/98] dwc_otg: Fix build issue with usb_gadget_probe_driver --- drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c | 22 +++------------------- @@ -123204,10 +122378,10 @@ index 903e670..a591d89 100644 1.8.1.6 -From 66a26e9f64b85ac9d8cde6ddcc123f98d232907e Mon Sep 17 00:00:00 2001 +From fc6f746d8e48c3c405b97ec241217fba7b55c873 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Apr 2012 00:31:37 +0100 -Subject: [PATCH 90/95] Update config files for f2fs and 3.8 kernel +Subject: [PATCH 86/98] Update config files for f2fs and 3.8 kernel --- arch/arm/configs/bcmrpi_cutdown_defconfig | 504 ---------------------------- @@ -124837,10 +124011,10 @@ index 0000000..10b84df 1.8.1.6 -From b7d81237d4a4e0c72de823db7a77dafebe40be17 Mon Sep 17 00:00:00 2001 +From 94a90cc4da9d051ef0fa192bb11145e126bc716d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Apr 2013 15:36:01 +0100 -Subject: [PATCH 92/95] Add v6wbi_flush_kern_tlb_range to allow zsmalloc to be +Subject: [PATCH 88/98] Add v6wbi_flush_kern_tlb_range to allow zsmalloc to be built as a module --- @@ -124863,10 +124037,10 @@ index 60d3b73..cba4d28 100644 1.8.1.6 -From af21f81d58195d0712fd047a86429b80dfb3b461 Mon Sep 17 00:00:00 2001 +From a75e8f6e0f095a39b6bd1babb70d19b23f6dd8bc Mon Sep 17 00:00:00 2001 From: P33M Date: Mon, 22 Apr 2013 00:08:36 +0100 -Subject: [PATCH 93/95] dwc_otg: fix NAK holdoff and allow on split +Subject: [PATCH 89/98] dwc_otg: fix NAK holdoff and allow on split transactions only This corrects a bug where if a single active non-periodic endpoint @@ -124936,10 +124110,10 @@ index 91eefecd..eaa8f38 100644 1.8.1.6 -From 9f5ffefb664c9ac66735944afb0e6eea51527e93 Mon Sep 17 00:00:00 2001 +From 5ce1da4709ccd13ba0e9f511af9cbb920b1f0b73 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 26 Apr 2013 10:08:31 -0700 -Subject: [PATCH 94/95] Merge pull request #286 from +Subject: [PATCH 90/98] Merge pull request #286 from martinezjavier/rpi-3.6.y-dev add mmap support and some cleanups to bcm2835 ALSA driver @@ -125420,10 +124594,10 @@ index b966e28..08c763d 100755 1.8.1.6 -From 5ded0f9a6a8cdefc25dc893afecda51367d9ed25 Mon Sep 17 00:00:00 2001 +From d9b38d9b00566541b5cb3f53e1f1645e6e42e16d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 7 May 2013 22:20:24 +0100 -Subject: [PATCH 95/95] Add quick config. +Subject: [PATCH 91/98] Add quick config. This is designed for quick compiling when developing. No modules are needed and it includes all Pi specific drivers @@ -125817,3 +124991,243 @@ index 10b84df..e5efe75 100644 -- 1.8.1.6 + +From 438fe3becc355a5381fa89ca0d488f66c142d2d0 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 10 May 2013 19:42:38 +0100 +Subject: [PATCH 92/98] mmc: suppress sdcard warnings we are happy about by + default + +--- + drivers/mmc/host/sdhci-bcm2708.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index 3556ed3..c2409b9 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -139,6 +139,7 @@ static inline unsigned long int since_ns(hptime_t t) + static bool missing_status = 1; + static bool spurious_crc_acmd51 = 0; + bool enable_llm = 1; ++bool extra_messages = 0; + + #if 0 + static void hptime_test(void) +@@ -672,13 +673,16 @@ static void schci_bcm2708_dma_go(struct sdhci_host *host) + cs = readl(host_priv->dma_chan_base + BCM2708_DMA_CS); + + if (!(BCM2708_DMA_ACTIVE & cs)) +- printk(KERN_INFO "%s: missed completion of " ++ { ++ if (extra_messages) ++ printk(KERN_INFO "%s: missed completion of " + "cmd %d DMA (%d/%d [%d]/[%d]) - " + "ignoring it\n", + mmc_hostname(host->mmc), + host->last_cmdop, + host_priv->sg_done, sg_todo, + host_priv->sg_ix+1, sg_len); ++ } + else + printk(KERN_INFO "%s: resetting ongoing cmd %d" + "DMA before %d/%d [%d]/[%d] complete\n", +@@ -903,7 +907,8 @@ static irqreturn_t sdhci_bcm2708_dma_irq(int irq, void *dev_id) + + if (!host_priv->dma_wanted) { + /* ignore this interrupt - it was reset */ +- printk(KERN_INFO "%s: DMA IRQ %X ignored - " ++ if (extra_messages) ++ printk(KERN_INFO "%s: DMA IRQ %X ignored - " + "results were reset\n", + mmc_hostname(host->mmc), dma_cs); + #ifdef CHECK_DMA_USE +@@ -1397,6 +1402,7 @@ static void __exit sdhci_drv_exit(void) + module_param(spurious_crc_acmd51, bool, 0444); + module_param(enable_llm, bool, 0444); + module_param(cycle_delay, int, 0444); ++module_param(extra_messages, bool, 0444); + + MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); + MODULE_AUTHOR("Broadcom "); +@@ -1409,5 +1415,6 @@ static void __exit sdhci_drv_exit(void) + MODULE_PARM_DESC(missing_status, "Use the missing status quirk"); + MODULE_PARM_DESC(spurious_crc_acmd51, "Use the spurious crc quirk for reading SCR (ACMD51)"); + MODULE_PARM_DESC(enable_llm, "Enable low-latency mode"); ++MODULE_PARM_DESC(extra_messages, "Enable more sdcard warning messages"); + + +-- +1.8.1.6 + + +From ff0b79fd73e0980dc50df6809f183e0221a74fec Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 14 May 2013 11:42:25 +0100 +Subject: [PATCH 93/98] Allow reboot=q on command line to set a flag that + bootcode.bin can use to boot from alternate partition + +--- + arch/arm/mach-bcm2708/bcm2708.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c +index 87fd348..1ed4d73 100644 +--- a/arch/arm/mach-bcm2708/bcm2708.c ++++ b/arch/arm/mach-bcm2708/bcm2708.c +@@ -629,6 +629,15 @@ static void bcm2708_restart(char mode, const char *cmd) + uint32_t pm_rstc, pm_wdog; + uint32_t timeout = 10; + ++ /* For quick reset notification add reboot=q to cmdline ++ */ ++ if(mode == 'q') ++ { ++ uint32_t pm_rsts = readl(__io_address(PM_RSTS)); ++ pm_rsts = PM_PASSWORD | pm_rsts | PM_RSTS_HADWRQ_SET; ++ writel(pm_rsts, __io_address(PM_RSTS)); ++ } ++ + /* Setup watchdog for reset */ + pm_rstc = readl(__io_address(PM_RSTC)); + +-- +1.8.1.6 + + +From c0fb35980968ba9c2dd21e0ff3a096bd97a8cdd6 Mon Sep 17 00:00:00 2001 +From: hutorny +Date: Mon, 13 May 2013 10:26:14 +0300 +Subject: [PATCH 95/98] Update bcm2708.c to use CONFIG_BCM2708_SPIDEV rather + than CONFIG_SPI + +--- + arch/arm/mach-bcm2708/Kconfig | 7 +++++++ + arch/arm/mach-bcm2708/bcm2708.c | 4 ++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mach-bcm2708/Kconfig b/arch/arm/mach-bcm2708/Kconfig +index 2a24db6..1dfd0a4 100644 +--- a/arch/arm/mach-bcm2708/Kconfig ++++ b/arch/arm/mach-bcm2708/Kconfig +@@ -38,4 +38,11 @@ config BCM2708_DMAER + help + Enable DMA helper for accelerating X composition + ++config BCM2708_SPIDEV ++ bool "Bind spidev to SPI0 master" ++ depends on MACH_BCM2708 ++ depends on SPI ++ default y ++ help ++ Binds spidev driver to the SPI0 master + endmenu +diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c +index 1ed4d73..68c577a 100644 +--- a/arch/arm/mach-bcm2708/bcm2708.c ++++ b/arch/arm/mach-bcm2708/bcm2708.c +@@ -545,7 +545,7 @@ struct platform_device bcm2708_powerman_device = { + .resource = bcm2708_spi_resources, + }; + +-#ifdef CONFIG_SPI ++#ifdef CONFIG_BCM2708_SPIDEV + static struct spi_board_info bcm2708_spi_devices[] = { + #ifdef CONFIG_SPI_SPIDEV + { +@@ -715,7 +715,7 @@ void __init bcm2708_init(void) + system_rev = boardrev; + system_serial_low = serial; + +-#ifdef CONFIG_SPI ++#ifdef CONFIG_BCM2708_SPIDEV + spi_register_board_info(bcm2708_spi_devices, + ARRAY_SIZE(bcm2708_spi_devices)); + #endif +-- +1.8.1.6 + + +From c44ae247fcaa54491bde50555625e1e81605e1cb Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 8 Jun 2013 22:14:13 +0100 +Subject: [PATCH 97/98] Only init gpio pins of selected i2c bus + +--- + drivers/i2c/busses/i2c-bcm2708.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c +index 3391889..edc90c0 100644 +--- a/drivers/i2c/busses/i2c-bcm2708.c ++++ b/drivers/i2c/busses/i2c-bcm2708.c +@@ -97,7 +97,7 @@ struct bcm2708_i2c { + * + * FIXME: This is a hack. Use pinmux / pinctrl. + */ +-static void bcm2708_i2c_init_pinmode(void) ++static void bcm2708_i2c_init_pinmode(int id) + { + #define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3)) + #define SET_GPIO_ALT(g,a) *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3)) +@@ -105,8 +105,10 @@ static void bcm2708_i2c_init_pinmode(void) + int pin; + u32 *gpio = ioremap(0x20200000, SZ_16K); + ++ BUG_ON(id != 0 && id != 1); + /* BSC0 is on GPIO 0 & 1, BSC1 is on GPIO 2 & 3 */ +- for (pin = 0; pin <= 3; pin++) { ++ for (pin = id*2+0; pin <= id*2+1; pin++) { ++printk("bcm2708_i2c_init_pinmode(%d,%d)\n", id, pin); + INP_GPIO(pin); /* set mode to GPIO input first */ + SET_GPIO_ALT(pin, 0); /* set mode to ALT 0 */ + } +@@ -279,7 +281,7 @@ static int bcm2708_i2c_probe(struct platform_device *pdev) + return PTR_ERR(clk); + } + +- bcm2708_i2c_init_pinmode(); ++ bcm2708_i2c_init_pinmode(pdev->id); + + bi = kzalloc(sizeof(*bi), GFP_KERNEL); + if (!bi) +-- +1.8.1.6 + + +From 975bd78d089fda92d1db126cf1cb199237f2142b Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 13 Jun 2013 16:46:54 +0100 +Subject: [PATCH 98/98] Avoid responding to unexpected I2C interrupts + +--- + drivers/i2c/busses/i2c-bcm2708.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c +index edc90c0..33f4e7d 100644 +--- a/drivers/i2c/busses/i2c-bcm2708.c ++++ b/drivers/i2c/busses/i2c-bcm2708.c +@@ -175,6 +175,11 @@ static irqreturn_t bcm2708_i2c_interrupt(int irq, void *dev_id) + + spin_lock(&bi->lock); + ++ /* we may see camera interrupts on the "other" I2C channel ++ Just return if we've not sent anything */ ++ if (!bi->nmsgs || !bi->msg ) ++ goto early_exit; ++ + s = bcm2708_rd(bi, BSC_S); + + if (s & (BSC_S_CLKT | BSC_S_ERR)) { +@@ -208,6 +213,7 @@ static irqreturn_t bcm2708_i2c_interrupt(int irq, void *dev_id) + handled = false; + } + ++early_exit: + spin_unlock(&bi->lock); + + return handled ? IRQ_HANDLED : IRQ_NONE; +-- +1.8.1.6 + From ccc3f0dbbd205c595f6f3f1b95f0d78639bac58f Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sun, 16 Jun 2013 18:42:55 +0300 Subject: [PATCH 08/14] service.openelec.settings: update to service.openelec.settings-0.1.21 --- packages/mediacenter/service.openelec.settings/meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mediacenter/service.openelec.settings/meta b/packages/mediacenter/service.openelec.settings/meta index 40d0446606..b0fac56034 100644 --- a/packages/mediacenter/service.openelec.settings/meta +++ b/packages/mediacenter/service.openelec.settings/meta @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="service.openelec.settings" -PKG_VERSION="0.1.20" +PKG_VERSION="0.1.21" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="prop." From bc5192c7db5a89034a67567c1a0fdc8c68bd1e9d Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 16 Jun 2013 19:33:51 +0200 Subject: [PATCH 09/14] xbmc: dont build with LTO support, this should fix #2370 Signed-off-by: Stephan Raue --- packages/mediacenter/xbmc/build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/mediacenter/xbmc/build b/packages/mediacenter/xbmc/build index 33870f44f8..8f79cb8555 100755 --- a/packages/mediacenter/xbmc/build +++ b/packages/mediacenter/xbmc/build @@ -239,6 +239,9 @@ fi # xbmc fails to build with LTO optimization if build without GOLD support [ ! "$GOLD_SUPPORT" = "yes" ] && strip_lto +# Todo: XBMC segfaults on exit when building with LTO support + strip_lto + # dont build parallel # MAKEFLAGS=-j1 From 4039994e8350f7150cf3e05b7086742ab4c1ac71 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 16 Jun 2013 22:13:33 +0200 Subject: [PATCH 10/14] avahi: enable 'disallow-other-stacks' see http://forums.gentoo.org/viewtopic-p-7322172.html#7322172 Signed-off-by: Stephan Raue --- packages/network/avahi/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/network/avahi/install b/packages/network/avahi/install index d46f33b589..9c5e607ee0 100755 --- a/packages/network/avahi/install +++ b/packages/network/avahi/install @@ -33,6 +33,8 @@ add_group avahiautoipd 496 mkdir -p $INSTALL/etc/avahi cp $PKG_BUILD/avahi-autoipd/avahi-autoipd.action $INSTALL/etc/avahi cp $PKG_BUILD/avahi-daemon/avahi-daemon.conf $INSTALL/etc/avahi + # for some reason avai can fail to start see: http://forums.gentoo.org/viewtopic-p-7322172.html#7322172 + sed -e "s,^.*disallow-other-stacks=.*$,disallow-other-stacks=yes,g" -i $INSTALL/etc/avahi/avahi-daemon.conf cp $PKG_BUILD/avahi-dnsconfd/avahi-dnsconfd.action $INSTALL/etc/avahi cp $PKG_BUILD/avahi-daemon/hosts $INSTALL/etc/avahi From c14d0eec6bdacaf2565527b4302d8780491aea51 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 17 Jun 2013 01:56:34 +0200 Subject: [PATCH 11/14] xf86-video-nvidia: update to xf86-video-nvidia-319.23 Signed-off-by: Stephan Raue --- packages/x11/driver/xf86-video-nvidia/meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/x11/driver/xf86-video-nvidia/meta b/packages/x11/driver/xf86-video-nvidia/meta index a71c4561f6..16cae2d7ad 100644 --- a/packages/x11/driver/xf86-video-nvidia/meta +++ b/packages/x11/driver/xf86-video-nvidia/meta @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="xf86-video-nvidia" -PKG_VERSION="310.44" +PKG_VERSION="319.23" PKG_REV="1" PKG_ARCH="i386 x86_64" PKG_LICENSE="nonfree" From f39be24b32576223a9394032ae4fd52915a5424d Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 17 Jun 2013 04:24:23 +0200 Subject: [PATCH 12/14] projects/RPi/filesystem: add project based OpenSSL config file Signed-off-by: Stephan Raue --- .../RPi/filesystem/etc/profile.d/openssl.conf | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 projects/RPi/filesystem/etc/profile.d/openssl.conf diff --git a/projects/RPi/filesystem/etc/profile.d/openssl.conf b/projects/RPi/filesystem/etc/profile.d/openssl.conf new file mode 100644 index 0000000000..d250cd5d22 --- /dev/null +++ b/projects/RPi/filesystem/etc/profile.d/openssl.conf @@ -0,0 +1,30 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ +# Core (OpenSSL) environment variable. +# +# This file contains non-OpenELEC evironment variables as well as OpenELEC +# evironment variables that are not user defined. +# +# set OpenSSL for armv6, see also: +# http://archlinuxarm.org/forum/viewtopic.php?f=15&t=1694&start=20#p20813 +# https://github.com/archlinuxarm/PKGBUILDs/issues/242#issuecomment-8426407 +################################################################################ + +export OPENSSL_armcap=6 \ No newline at end of file From 8be207ba01598e8a00efd73d672fac02b85cefd4 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 17 Jun 2013 23:19:28 +0200 Subject: [PATCH 13/14] config/version: set addon version to 3.1, set OS version to 3.2 Signed-off-by: Stephan Raue --- config/version | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/version b/config/version index dd35aba728..09f0d87840 100644 --- a/config/version +++ b/config/version @@ -2,8 +2,8 @@ OPENELEC_VERSION="devel" # OS_VERSION: OS Version - OS_VERSION="3.0" + OS_VERSION="3.2" # ADDON_VERSION: Addon version - ADDON_VERSION="3.0" + ADDON_VERSION="3.1" From e71e2c2ef169c80ca62007bfda92f5a5bc6e53e4 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 17 Jun 2013 23:31:30 +0200 Subject: [PATCH 14/14] packages/addons/*: bump addon versions for OpenELEC-3.2 Signed-off-by: Stephan Raue --- packages/addons/driver/hdhomerun/changelog.txt | 2 ++ packages/addons/driver/hdhomerun/meta | 4 ++-- packages/addons/driver/imon-mce/changelog.txt | 2 ++ packages/addons/driver/sundtek-mediatv/changelog.txt | 2 ++ packages/addons/driver/sundtek-mediatv/meta | 4 ++-- packages/addons/multimedia/makemkv/changelog.txt | 3 +++ packages/addons/multimedia/makemkv/meta | 2 +- packages/addons/multimedia/w_scan/changelog.txt | 3 +++ packages/addons/multimedia/w_scan/meta | 2 +- packages/addons/networking/backup/rsync/changelog.txt | 3 +++ packages/addons/networking/backup/rsync/meta | 2 +- packages/addons/networking/testing/iperf/changelog.txt | 3 +++ packages/addons/networking/testing/iperf/meta | 2 +- .../service/downloadmanager/SABnzbd-Suite/changelog.txt | 3 +++ packages/addons/service/downloadmanager/SABnzbd-Suite/meta | 4 ++-- packages/addons/service/downloadmanager/pyload/changelog.txt | 3 +++ packages/addons/service/downloadmanager/pyload/meta | 2 +- .../addons/service/downloadmanager/transmission/changelog.txt | 3 +++ packages/addons/service/downloadmanager/transmission/meta | 2 +- packages/addons/service/multimedia/boblightd/changelog.txt | 3 +++ packages/addons/service/multimedia/boblightd/meta | 2 +- packages/addons/service/multimedia/tvheadend/changelog.txt | 3 +++ packages/addons/service/multimedia/tvheadend/meta | 2 +- packages/addons/service/multimedia/vdr-addon/changelog.txt | 3 +++ packages/addons/service/multimedia/vdr-addon/meta | 4 ++-- packages/addons/service/softcam/oscam/changelog.txt | 3 +++ packages/addons/service/softcam/oscam/meta | 2 +- packages/addons/service/system/pcscd-addon/changelog.txt | 3 +++ packages/addons/service/system/pcscd-addon/meta | 4 ++-- packages/addons/service/web/maraschino/changelog.txt | 3 +++ packages/addons/shell/console/screen/changelog.txt | 3 +++ packages/addons/shell/console/screen/meta | 2 +- 32 files changed, 68 insertions(+), 20 deletions(-) diff --git a/packages/addons/driver/hdhomerun/changelog.txt b/packages/addons/driver/hdhomerun/changelog.txt index c6a364ad93..89c36a01e1 100644 --- a/packages/addons/driver/hdhomerun/changelog.txt +++ b/packages/addons/driver/hdhomerun/changelog.txt @@ -1,3 +1,5 @@ +3.1.1 + rebuild for OpenELEC-3.2 3.0.5 rebuild 3.0.4 diff --git a/packages/addons/driver/hdhomerun/meta b/packages/addons/driver/hdhomerun/meta index ead0402b7e..7d47b8165b 100644 --- a/packages/addons/driver/hdhomerun/meta +++ b/packages/addons/driver/hdhomerun/meta @@ -19,8 +19,8 @@ ################################################################################ PKG_NAME="hdhomerun" -PKG_VERSION="3.0" -PKG_REV="5" +PKG_VERSION="3.2" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.silicondust.com/products/hdhomerun/dvbt/" diff --git a/packages/addons/driver/imon-mce/changelog.txt b/packages/addons/driver/imon-mce/changelog.txt index a4fc636b96..4c40ae42f0 100644 --- a/packages/addons/driver/imon-mce/changelog.txt +++ b/packages/addons/driver/imon-mce/changelog.txt @@ -1,3 +1,5 @@ +3.1.1 + rebuild for OpenELEC-3.2 3.0.1 - bump addon version diff --git a/packages/addons/driver/sundtek-mediatv/changelog.txt b/packages/addons/driver/sundtek-mediatv/changelog.txt index 33eb26ef0e..9dbd332241 100644 --- a/packages/addons/driver/sundtek-mediatv/changelog.txt +++ b/packages/addons/driver/sundtek-mediatv/changelog.txt @@ -1,3 +1,5 @@ +3.1.1 + rebuild for OpenELEC-3.2 3.0.6 rebuild 3.0.5 diff --git a/packages/addons/driver/sundtek-mediatv/meta b/packages/addons/driver/sundtek-mediatv/meta index 64265f0d07..3775a7ded8 100644 --- a/packages/addons/driver/sundtek-mediatv/meta +++ b/packages/addons/driver/sundtek-mediatv/meta @@ -19,8 +19,8 @@ ################################################################################ PKG_NAME="sundtek-mediatv" -PKG_VERSION="3.0" -PKG_REV="6" +PKG_VERSION="3.1" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="nonfree" PKG_SITE="http://support.sundtek.com/" diff --git a/packages/addons/multimedia/makemkv/changelog.txt b/packages/addons/multimedia/makemkv/changelog.txt index 02da3b4c2e..4fd7b8a47e 100644 --- a/packages/addons/multimedia/makemkv/changelog.txt +++ b/packages/addons/multimedia/makemkv/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.6 - update to makemkv-1.8.3 diff --git a/packages/addons/multimedia/makemkv/meta b/packages/addons/multimedia/makemkv/meta index 06674154e4..250d7521e3 100644 --- a/packages/addons/multimedia/makemkv/meta +++ b/packages/addons/multimedia/makemkv/meta @@ -20,7 +20,7 @@ PKG_NAME="makemkv" PKG_VERSION="1.8.3" -PKG_REV="6" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="http://www.makemkv.com/forum2/viewforum.php?f=3" diff --git a/packages/addons/multimedia/w_scan/changelog.txt b/packages/addons/multimedia/w_scan/changelog.txt index c25ff73ce9..474e3b7866 100644 --- a/packages/addons/multimedia/w_scan/changelog.txt +++ b/packages/addons/multimedia/w_scan/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.2 - update to w_scan-20121111 diff --git a/packages/addons/multimedia/w_scan/meta b/packages/addons/multimedia/w_scan/meta index fc7427b0c2..198f438248 100644 --- a/packages/addons/multimedia/w_scan/meta +++ b/packages/addons/multimedia/w_scan/meta @@ -20,7 +20,7 @@ PKG_NAME="w_scan" PKG_VERSION="20121111" -PKG_REV="2" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://wirbel.htpc-forum.de/w_scan/index2.html" diff --git a/packages/addons/networking/backup/rsync/changelog.txt b/packages/addons/networking/backup/rsync/changelog.txt index 5ef54bc790..a220058e48 100644 --- a/packages/addons/networking/backup/rsync/changelog.txt +++ b/packages/addons/networking/backup/rsync/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.2 - rebuild against static libpopt diff --git a/packages/addons/networking/backup/rsync/meta b/packages/addons/networking/backup/rsync/meta index 3af5a33fed..4ffdf10cd0 100644 --- a/packages/addons/networking/backup/rsync/meta +++ b/packages/addons/networking/backup/rsync/meta @@ -20,7 +20,7 @@ PKG_NAME="rsync" PKG_VERSION="3.0.9" -PKG_REV="2" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="http://www.samba.org/ftp/rsync/rsync.html" diff --git a/packages/addons/networking/testing/iperf/changelog.txt b/packages/addons/networking/testing/iperf/changelog.txt index c053248905..50c293bb56 100644 --- a/packages/addons/networking/testing/iperf/changelog.txt +++ b/packages/addons/networking/testing/iperf/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.2 - rebuild diff --git a/packages/addons/networking/testing/iperf/meta b/packages/addons/networking/testing/iperf/meta index 848adaef78..e8726f04bd 100644 --- a/packages/addons/networking/testing/iperf/meta +++ b/packages/addons/networking/testing/iperf/meta @@ -20,7 +20,7 @@ PKG_NAME="iperf" PKG_VERSION="2.0.5" -PKG_REV="2" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="http://sourceforge.net/projects/iperf/" diff --git a/packages/addons/service/downloadmanager/SABnzbd-Suite/changelog.txt b/packages/addons/service/downloadmanager/SABnzbd-Suite/changelog.txt index a841c7991a..8da5b9a91d 100644 --- a/packages/addons/service/downloadmanager/SABnzbd-Suite/changelog.txt +++ b/packages/addons/service/downloadmanager/SABnzbd-Suite/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.9 - update to CouchPotatoServe-5c0d8a7 - update to Headphones-452cf15 diff --git a/packages/addons/service/downloadmanager/SABnzbd-Suite/meta b/packages/addons/service/downloadmanager/SABnzbd-Suite/meta index 17c9351a60..23030e17ab 100644 --- a/packages/addons/service/downloadmanager/SABnzbd-Suite/meta +++ b/packages/addons/service/downloadmanager/SABnzbd-Suite/meta @@ -19,8 +19,8 @@ ################################################################################ PKG_NAME="SABnzbd-Suite" -PKG_VERSION="3.0" -PKG_REV="9" +PKG_VERSION="3.1" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="http://www.openelec.tv" diff --git a/packages/addons/service/downloadmanager/pyload/changelog.txt b/packages/addons/service/downloadmanager/pyload/changelog.txt index 6a6c32320d..fcec956f24 100644 --- a/packages/addons/service/downloadmanager/pyload/changelog.txt +++ b/packages/addons/service/downloadmanager/pyload/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.2 - pycrypto is installed per default now diff --git a/packages/addons/service/downloadmanager/pyload/meta b/packages/addons/service/downloadmanager/pyload/meta index 24cd5ce201..72d754a2ea 100644 --- a/packages/addons/service/downloadmanager/pyload/meta +++ b/packages/addons/service/downloadmanager/pyload/meta @@ -20,7 +20,7 @@ PKG_NAME="pyload" PKG_VERSION="0.4.9" -PKG_REV="2" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="http://pyload.org/" diff --git a/packages/addons/service/downloadmanager/transmission/changelog.txt b/packages/addons/service/downloadmanager/transmission/changelog.txt index 9442c47998..6725621bbb 100644 --- a/packages/addons/service/downloadmanager/transmission/changelog.txt +++ b/packages/addons/service/downloadmanager/transmission/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.5 - config cleanup (peer limits) diff --git a/packages/addons/service/downloadmanager/transmission/meta b/packages/addons/service/downloadmanager/transmission/meta index bedb600908..ac331728cd 100644 --- a/packages/addons/service/downloadmanager/transmission/meta +++ b/packages/addons/service/downloadmanager/transmission/meta @@ -20,7 +20,7 @@ PKG_NAME="transmission" PKG_VERSION="2.77" -PKG_REV="5" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="http://www.transmissionbt.com/" diff --git a/packages/addons/service/multimedia/boblightd/changelog.txt b/packages/addons/service/multimedia/boblightd/changelog.txt index 8072097a8b..c5921e1187 100644 --- a/packages/addons/service/multimedia/boblightd/changelog.txt +++ b/packages/addons/service/multimedia/boblightd/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.4 - update to boblightd-467 diff --git a/packages/addons/service/multimedia/boblightd/meta b/packages/addons/service/multimedia/boblightd/meta index 6bf262c928..e3350b1412 100644 --- a/packages/addons/service/multimedia/boblightd/meta +++ b/packages/addons/service/multimedia/boblightd/meta @@ -20,7 +20,7 @@ PKG_NAME="boblightd" PKG_VERSION="467" -PKG_REV="4" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://code.google.com/p/boblight" diff --git a/packages/addons/service/multimedia/tvheadend/changelog.txt b/packages/addons/service/multimedia/tvheadend/changelog.txt index 67acaa1f2b..d93fa8200e 100644 --- a/packages/addons/service/multimedia/tvheadend/changelog.txt +++ b/packages/addons/service/multimedia/tvheadend/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.11 - improve suspend/resume diff --git a/packages/addons/service/multimedia/tvheadend/meta b/packages/addons/service/multimedia/tvheadend/meta index 6db2ca25f5..1089e9cd2f 100644 --- a/packages/addons/service/multimedia/tvheadend/meta +++ b/packages/addons/service/multimedia/tvheadend/meta @@ -20,7 +20,7 @@ PKG_NAME="tvheadend" PKG_VERSION="3.4" -PKG_REV="11" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.lonelycoder.com/hts/tvheadend_overview.html" diff --git a/packages/addons/service/multimedia/vdr-addon/changelog.txt b/packages/addons/service/multimedia/vdr-addon/changelog.txt index 6999ae657d..dcab2954a7 100644 --- a/packages/addons/service/multimedia/vdr-addon/changelog.txt +++ b/packages/addons/service/multimedia/vdr-addon/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.11 - fix epg/live charset issue diff --git a/packages/addons/service/multimedia/vdr-addon/meta b/packages/addons/service/multimedia/vdr-addon/meta index ede6c9dc02..f8a44abc38 100644 --- a/packages/addons/service/multimedia/vdr-addon/meta +++ b/packages/addons/service/multimedia/vdr-addon/meta @@ -20,8 +20,8 @@ ################################################################################ PKG_NAME="vdr-addon" -PKG_VERSION="3.0" -PKG_REV="11" +PKG_VERSION="3.1" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.openelec.tv" diff --git a/packages/addons/service/softcam/oscam/changelog.txt b/packages/addons/service/softcam/oscam/changelog.txt index 5cfabd511a..f3270c8096 100644 --- a/packages/addons/service/softcam/oscam/changelog.txt +++ b/packages/addons/service/softcam/oscam/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.12 - update to oscam-8695 - improve suspend/resume diff --git a/packages/addons/service/softcam/oscam/meta b/packages/addons/service/softcam/oscam/meta index 0d1509a15d..f367cb0839 100644 --- a/packages/addons/service/softcam/oscam/meta +++ b/packages/addons/service/softcam/oscam/meta @@ -21,7 +21,7 @@ PKG_NAME="oscam" PKG_VERSION="8695" -PKG_REV="12" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.streamboard.tv/oscam/wiki" diff --git a/packages/addons/service/system/pcscd-addon/changelog.txt b/packages/addons/service/system/pcscd-addon/changelog.txt index 03b4372bd1..a38067b444 100644 --- a/packages/addons/service/system/pcscd-addon/changelog.txt +++ b/packages/addons/service/system/pcscd-addon/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.5 - update to libccid-1.4.10 diff --git a/packages/addons/service/system/pcscd-addon/meta b/packages/addons/service/system/pcscd-addon/meta index 9ff0d0bda7..394ab12474 100755 --- a/packages/addons/service/system/pcscd-addon/meta +++ b/packages/addons/service/system/pcscd-addon/meta @@ -20,8 +20,8 @@ ################################################################################ PKG_NAME="pcscd-addon" -PKG_VERSION="3.0" -PKG_REV="5" +PKG_VERSION="3.1" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.openelec.tv" diff --git a/packages/addons/service/web/maraschino/changelog.txt b/packages/addons/service/web/maraschino/changelog.txt index 13e4d293e5..fcc726e795 100644 --- a/packages/addons/service/web/maraschino/changelog.txt +++ b/packages/addons/service/web/maraschino/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.1 - bump addon version - update to maraschino-1681187 diff --git a/packages/addons/shell/console/screen/changelog.txt b/packages/addons/shell/console/screen/changelog.txt index 71fff95db9..a1383d1e90 100644 --- a/packages/addons/shell/console/screen/changelog.txt +++ b/packages/addons/shell/console/screen/changelog.txt @@ -1,3 +1,6 @@ +3.1.1 +- rebuild for OpenELEC-3.2 + 3.0.2 - rebuild diff --git a/packages/addons/shell/console/screen/meta b/packages/addons/shell/console/screen/meta index 2c50f7be7f..d7bead6d6d 100644 --- a/packages/addons/shell/console/screen/meta +++ b/packages/addons/shell/console/screen/meta @@ -20,7 +20,7 @@ PKG_NAME="screen" PKG_VERSION="4.0.3" -PKG_REV="2" +PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.gnu.org/software/screen/"