mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Mesa: add patch to fix crashing with intel driver
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
2c7b172ee5
commit
de8d9b2c7e
@ -0,0 +1,73 @@
|
|||||||
|
From 8f13c69e7658df3a97e388f210dae175639d6d8d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Wilson <chris@chris-wilson.co.uk>
|
||||||
|
Date: Fri, 16 Jul 2010 12:24:53 +0100
|
||||||
|
Subject: [PATCH] intel: Fix invalidate before initialisation
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
|
||||||
|
Bug 29091 - 1.9RC5 server crash when starting GLX 1.3 app with mesa 7.8
|
||||||
|
Intel dri2 driver.
|
||||||
|
https://bugs.freedesktop.org/show_bug.cgi?id=29091
|
||||||
|
|
||||||
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
||||||
|
---
|
||||||
|
src/mesa/drivers/dri/common/dri_util.c | 2 +-
|
||||||
|
src/mesa/drivers/dri/intel/intel_screen.c | 19 +++++++++++++++----
|
||||||
|
2 files changed, 16 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
|
||||||
|
index 75c9882..9a9bfed 100644
|
||||||
|
--- a/src/mesa/drivers/dri/common/dri_util.c
|
||||||
|
+++ b/src/mesa/drivers/dri/common/dri_util.c
|
||||||
|
@@ -432,7 +432,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,
|
||||||
|
*/
|
||||||
|
(void) attrs;
|
||||||
|
|
||||||
|
- pdp = malloc(sizeof *pdp);
|
||||||
|
+ pdp = calloc(1, sizeof *pdp);
|
||||||
|
if (!pdp) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
|
||||||
|
index 6e4bb64..083b7bb 100644
|
||||||
|
--- a/src/mesa/drivers/dri/intel/intel_screen.c
|
||||||
|
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
|
||||||
|
@@ -102,10 +102,21 @@ static const __DRItexBufferExtension intelTexBufferExtension = {
|
||||||
|
intelSetTexBuffer2,
|
||||||
|
};
|
||||||
|
|
||||||
|
+static inline struct intel_context *
|
||||||
|
+to_intel_context(__DRIdrawable *drawable)
|
||||||
|
+{
|
||||||
|
+ if (drawable->driContextPriv == NULL)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ return drawable->driContextPriv->driverPrivate;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
intelDRI2Flush(__DRIdrawable *drawable)
|
||||||
|
{
|
||||||
|
- struct intel_context *intel = drawable->driContextPriv->driverPrivate;
|
||||||
|
+ struct intel_context *intel = to_intel_context(drawable);
|
||||||
|
+ if (!intel)
|
||||||
|
+ return;
|
||||||
|
|
||||||
|
if (intel->gen < 4)
|
||||||
|
INTEL_FIREVERTICES(intel);
|
||||||
|
@@ -117,9 +128,9 @@ intelDRI2Flush(__DRIdrawable *drawable)
|
||||||
|
static void
|
||||||
|
intelDRI2Invalidate(__DRIdrawable *drawable)
|
||||||
|
{
|
||||||
|
- struct intel_context *intel = drawable->driContextPriv->driverPrivate;
|
||||||
|
-
|
||||||
|
- intel->using_dri2_swapbuffers = GL_TRUE;
|
||||||
|
+ struct intel_context *intel = to_intel_context(drawable);
|
||||||
|
+ if (intel)
|
||||||
|
+ intel->using_dri2_swapbuffers = GL_TRUE;
|
||||||
|
dri2InvalidateDrawable(drawable);
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.1
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user