From 50a31e871a75f64326579f7ed32069846377f6f8 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Fri, 27 Jul 2012 15:33:54 +0200 Subject: [PATCH] xbmc: add patch to fix ASIC hang, this should fix #315 Signed-off-by: Stephan Raue --- ...11.0.1-999.002-268d6a0-fix_ASIC_hang.patch | 99 +++++++++++++++++++ ...11.0.1-999.002-268d6a0-fix_ASIC_hang.patch | 99 +++++++++++++++++++ 2 files changed, 198 insertions(+) create mode 100644 packages/mediacenter/xbmc/patches/xbmc-11.0.1-999.002-268d6a0-fix_ASIC_hang.patch create mode 100644 packages/mediacenter/xbmc/patches/xbmc-pvr-11.0.1-999.002-268d6a0-fix_ASIC_hang.patch diff --git a/packages/mediacenter/xbmc/patches/xbmc-11.0.1-999.002-268d6a0-fix_ASIC_hang.patch b/packages/mediacenter/xbmc/patches/xbmc-11.0.1-999.002-268d6a0-fix_ASIC_hang.patch new file mode 100644 index 0000000000..9f209e8e04 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/xbmc-11.0.1-999.002-268d6a0-fix_ASIC_hang.patch @@ -0,0 +1,99 @@ +From 268d6a01b6a7dea0d53b042c246c95e87f4fc3d8 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Thu, 26 Jul 2012 15:43:24 +0200 +Subject: [PATCH] move deleting gl textures to TextureManager, fixes asic hang + on AMD + +--- + xbmc/Application.cpp | 4 ++-- + xbmc/guilib/GUIFontTTFGL.cpp | 3 ++- + xbmc/guilib/TextureManager.cpp | 13 +++++++++++++ + xbmc/guilib/TextureManager.h | 2 ++ + 4 files changed, 19 insertions(+), 3 deletions(-) + +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index 71d8a4e..b66459a 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -2231,8 +2231,6 @@ void CApplication::Render() + + g_Windowing.EndRender(); + +- g_TextureManager.FreeUnusedTextures(); +- + // reset our info cache - we do this at the end of Render so that it is + // fresh for the next process(), or after a windowclose animation (where process() + // isn't called) +@@ -2270,6 +2268,8 @@ void CApplication::Render() + } + CTimeUtils::UpdateFrameTime(flip); + ++ g_TextureManager.FreeUnusedTextures(); ++ + g_renderManager.UpdateResolution(); + g_renderManager.ManageCaptures(); + } +diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp +index 87e07ca..6c93eb8 100644 +--- a/xbmc/guilib/GUIFontTTFGL.cpp ++++ b/xbmc/guilib/GUIFontTTFGL.cpp +@@ -24,6 +24,7 @@ + #include "GUIFontTTFGL.h" + #include "GUIFontManager.h" + #include "Texture.h" ++#include "TextureManager.h" + #include "GraphicContext.h" + #include "gui3d.h" + #include "utils/log.h" +@@ -234,7 +235,7 @@ void CGUIFontTTFGL::DeleteHardwareTexture() + if (m_bTextureLoaded) + { + if (glIsTexture(m_nTexture)) +- glDeleteTextures(1, (GLuint*) &m_nTexture); ++ g_TextureManager.ReleaseHwTexture(m_nTexture); + m_bTextureLoaded = false; + } + } +diff --git a/xbmc/guilib/TextureManager.cpp b/xbmc/guilib/TextureManager.cpp +index 9ef7889..ccd0d03 100644 +--- a/xbmc/guilib/TextureManager.cpp ++++ b/xbmc/guilib/TextureManager.cpp +@@ -457,6 +457,19 @@ void CGUITextureManager::FreeUnusedTextures() + for (ivecTextures i = m_unusedTextures.begin(); i != m_unusedTextures.end(); ++i) + delete *i; + m_unusedTextures.clear(); ++ ++#if defined(HAS_GL) || defined(HAS_GLES) ++ for (unsigned int i = 0; i < m_unusedHwTextures.size(); ++i) ++ { ++ glDeleteTextures(1, (GLuint*) &m_unusedHwTextures[i]); ++ } ++#endif ++ m_unusedHwTextures.clear(); ++} ++ ++void CGUITextureManager::ReleaseHwTexture(unsigned int texture) ++{ ++ m_unusedHwTextures.push_back(texture); + } + + void CGUITextureManager::Cleanup() +diff --git a/xbmc/guilib/TextureManager.h b/xbmc/guilib/TextureManager.h +index dd47f48..001f470 100644 +--- a/xbmc/guilib/TextureManager.h ++++ b/xbmc/guilib/TextureManager.h +@@ -124,9 +124,11 @@ class CGUITextureManager + void RemoveTexturePath(const CStdString &texturePath); ///< Remove a path from the paths to check when loading media + + void FreeUnusedTextures(); ///< Free textures (called from app thread only) ++ void ReleaseHwTexture(unsigned int texture); + protected: + std::vector m_vecTextures; + std::vector m_unusedTextures; ++ std::vector m_unusedHwTextures; + typedef std::vector::iterator ivecTextures; + // we have 2 texture bundles (one for the base textures, one for the theme) + CTextureBundle m_TexBundle[2]; +-- +1.7.10 + diff --git a/packages/mediacenter/xbmc/patches/xbmc-pvr-11.0.1-999.002-268d6a0-fix_ASIC_hang.patch b/packages/mediacenter/xbmc/patches/xbmc-pvr-11.0.1-999.002-268d6a0-fix_ASIC_hang.patch new file mode 100644 index 0000000000..9f209e8e04 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/xbmc-pvr-11.0.1-999.002-268d6a0-fix_ASIC_hang.patch @@ -0,0 +1,99 @@ +From 268d6a01b6a7dea0d53b042c246c95e87f4fc3d8 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Thu, 26 Jul 2012 15:43:24 +0200 +Subject: [PATCH] move deleting gl textures to TextureManager, fixes asic hang + on AMD + +--- + xbmc/Application.cpp | 4 ++-- + xbmc/guilib/GUIFontTTFGL.cpp | 3 ++- + xbmc/guilib/TextureManager.cpp | 13 +++++++++++++ + xbmc/guilib/TextureManager.h | 2 ++ + 4 files changed, 19 insertions(+), 3 deletions(-) + +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index 71d8a4e..b66459a 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -2231,8 +2231,6 @@ void CApplication::Render() + + g_Windowing.EndRender(); + +- g_TextureManager.FreeUnusedTextures(); +- + // reset our info cache - we do this at the end of Render so that it is + // fresh for the next process(), or after a windowclose animation (where process() + // isn't called) +@@ -2270,6 +2268,8 @@ void CApplication::Render() + } + CTimeUtils::UpdateFrameTime(flip); + ++ g_TextureManager.FreeUnusedTextures(); ++ + g_renderManager.UpdateResolution(); + g_renderManager.ManageCaptures(); + } +diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp +index 87e07ca..6c93eb8 100644 +--- a/xbmc/guilib/GUIFontTTFGL.cpp ++++ b/xbmc/guilib/GUIFontTTFGL.cpp +@@ -24,6 +24,7 @@ + #include "GUIFontTTFGL.h" + #include "GUIFontManager.h" + #include "Texture.h" ++#include "TextureManager.h" + #include "GraphicContext.h" + #include "gui3d.h" + #include "utils/log.h" +@@ -234,7 +235,7 @@ void CGUIFontTTFGL::DeleteHardwareTexture() + if (m_bTextureLoaded) + { + if (glIsTexture(m_nTexture)) +- glDeleteTextures(1, (GLuint*) &m_nTexture); ++ g_TextureManager.ReleaseHwTexture(m_nTexture); + m_bTextureLoaded = false; + } + } +diff --git a/xbmc/guilib/TextureManager.cpp b/xbmc/guilib/TextureManager.cpp +index 9ef7889..ccd0d03 100644 +--- a/xbmc/guilib/TextureManager.cpp ++++ b/xbmc/guilib/TextureManager.cpp +@@ -457,6 +457,19 @@ void CGUITextureManager::FreeUnusedTextures() + for (ivecTextures i = m_unusedTextures.begin(); i != m_unusedTextures.end(); ++i) + delete *i; + m_unusedTextures.clear(); ++ ++#if defined(HAS_GL) || defined(HAS_GLES) ++ for (unsigned int i = 0; i < m_unusedHwTextures.size(); ++i) ++ { ++ glDeleteTextures(1, (GLuint*) &m_unusedHwTextures[i]); ++ } ++#endif ++ m_unusedHwTextures.clear(); ++} ++ ++void CGUITextureManager::ReleaseHwTexture(unsigned int texture) ++{ ++ m_unusedHwTextures.push_back(texture); + } + + void CGUITextureManager::Cleanup() +diff --git a/xbmc/guilib/TextureManager.h b/xbmc/guilib/TextureManager.h +index dd47f48..001f470 100644 +--- a/xbmc/guilib/TextureManager.h ++++ b/xbmc/guilib/TextureManager.h +@@ -124,9 +124,11 @@ class CGUITextureManager + void RemoveTexturePath(const CStdString &texturePath); ///< Remove a path from the paths to check when loading media + + void FreeUnusedTextures(); ///< Free textures (called from app thread only) ++ void ReleaseHwTexture(unsigned int texture); + protected: + std::vector m_vecTextures; + std::vector m_unusedTextures; ++ std::vector m_unusedHwTextures; + typedef std::vector::iterator ivecTextures; + // we have 2 texture bundles (one for the base textures, one for the theme) + CTextureBundle m_TexBundle[2]; +-- +1.7.10 +