xbmc: add patch to fix ASIC hang, this should fix #315

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-07-27 15:33:54 +02:00
parent 1dcd225a06
commit 50a31e871a
2 changed files with 198 additions and 0 deletions

View File

@ -0,0 +1,99 @@
From 268d6a01b6a7dea0d53b042c246c95e87f4fc3d8 Mon Sep 17 00:00:00 2001
From: xbmc <fernetmenta@online.de>
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<CTextureMap*> m_vecTextures;
std::vector<CTextureMap*> m_unusedTextures;
+ std::vector<unsigned int> m_unusedHwTextures;
typedef std::vector<CTextureMap*>::iterator ivecTextures;
// we have 2 texture bundles (one for the base textures, one for the theme)
CTextureBundle m_TexBundle[2];
--
1.7.10

View File

@ -0,0 +1,99 @@
From 268d6a01b6a7dea0d53b042c246c95e87f4fc3d8 Mon Sep 17 00:00:00 2001
From: xbmc <fernetmenta@online.de>
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<CTextureMap*> m_vecTextures;
std::vector<CTextureMap*> m_unusedTextures;
+ std::vector<unsigned int> m_unusedHwTextures;
typedef std::vector<CTextureMap*>::iterator ivecTextures;
// we have 2 texture bundles (one for the base textures, one for the theme)
CTextureBundle m_TexBundle[2];
--
1.7.10