mirror of
https://abf.rosa.ru/djam/mesa.git
synced 2025-02-24 15:12:56 +00:00
Sync to 2014.1
This commit is contained in:
commit
90f53bd922
17 changed files with 738 additions and 1918 deletions
3
.abf.yml
3
.abf.yml
|
@ -1,3 +1,2 @@
|
||||||
sources:
|
sources:
|
||||||
"MesaGLUT-7.11.2.tar.bz2": 2e6e730204800a0748b301a5f58b86332699788b
|
MesaLib-10.3.3.tar.bz2: 82048401ab72f6ca38780ada6c8998b020cef0f5
|
||||||
"MesaLib-7.11.2.tar.bz2": 5981ac2de8438e5f4a1f3561f2044d700c5f0de9
|
|
||||||
|
|
12
0002-mesa-10.0-nv50-fix-build.patch
Normal file
12
0002-mesa-10.0-nv50-fix-build.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
diff -uNr mesa-20131201.orig/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp mesa-20131201/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
|
||||||
|
--- mesa-20131201.orig/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp 2013-12-01 11:29:21.000000000 +0400
|
||||||
|
+++ mesa-20131201/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp 2013-12-01 16:05:06.488417551 +0400
|
||||||
|
@@ -739,7 +739,7 @@
|
||||||
|
if (!i)
|
||||||
|
i = new_Instruction(pol.context(), op, dType);
|
||||||
|
#ifndef NDEBUG // non-conformant assert, so this is required
|
||||||
|
- assert(typeid(*i) == typeid(*this));
|
||||||
|
+ //assert(typeid(*i) == typeid(*this));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pol.set<Instruction>(this, i);
|
|
@ -1,25 +0,0 @@
|
||||||
From b4ed9bb79c7911047294ba8ae081039927283dae Mon Sep 17 00:00:00 2001
|
|
||||||
From: Paulo Zanoni <pzanoni@mandriva.com>
|
|
||||||
Date: Thu, 6 Jan 2011 16:31:54 -0200
|
|
||||||
Subject: [PATCH] Mips support
|
|
||||||
|
|
||||||
---
|
|
||||||
include/GL/internal/sarea.h | 2 ++
|
|
||||||
1 files changed, 2 insertions(+), 0 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/include/GL/internal/sarea.h b/include/GL/internal/sarea.h
|
|
||||||
index a0d6084..369f589 100644
|
|
||||||
--- a/include/GL/internal/sarea.h
|
|
||||||
+++ b/include/GL/internal/sarea.h
|
|
||||||
@@ -44,6 +44,8 @@
|
|
||||||
#define SAREA_MAX 0x2000
|
|
||||||
#elif defined(__ia64__)
|
|
||||||
#define SAREA_MAX 0x10000 /* 64kB */
|
|
||||||
+#elif defined(__mips__)
|
|
||||||
+#define SAREA_MAX getpagesize()
|
|
||||||
#else
|
|
||||||
/* Intel 830M driver needs at least 8k SAREA */
|
|
||||||
#define SAREA_MAX 0x2000
|
|
||||||
--
|
|
||||||
1.7.1
|
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
From eafaed0287424361736ae21f67c798a0be1c2cb7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Colin Guthrie <cguthrie@mandriva.org>
|
|
||||||
Date: Tue, 23 Dec 2008 21:01:46 +0000
|
|
||||||
Subject: [PATCH 903/903] Fix NULL pointer dereference in viaXMesaWindowMoved (fdo#12097)
|
|
||||||
|
|
||||||
---
|
|
||||||
src/mesa/drivers/dri/unichrome/via_context.c | 2 +-
|
|
||||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
|
|
||||||
index 6eb19ac..efe2217 100644
|
|
||||||
--- a/src/mesa/drivers/dri/unichrome/via_context.c
|
|
||||||
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
|
|
||||||
@@ -730,7 +730,7 @@ void viaXMesaWindowMoved(struct via_context *vmesa)
|
|
||||||
struct via_renderbuffer * read_buffer;
|
|
||||||
GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
|
|
||||||
|
|
||||||
- if (!drawable)
|
|
||||||
+ if (!drawable || !vmesa->glCtx->DrawBuffer)
|
|
||||||
return;
|
|
||||||
|
|
||||||
draw_buffer = (struct via_renderbuffer *) drawable->driverPrivate;
|
|
||||||
--
|
|
||||||
1.6.2.4
|
|
||||||
|
|
52
Mesa-dev-gallivm-force-sse-instructions-for-llvm-3.5.patch
Normal file
52
Mesa-dev-gallivm-force-sse-instructions-for-llvm-3.5.patch
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
|
||||||
|
index 55aa8b9..f2f8906 100644
|
||||||
|
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
|
||||||
|
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
|
||||||
|
@@ -479,10 +479,38 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
|
||||||
|
if (util_cpu_caps.has_f16c) {
|
||||||
|
MAttrs.push_back("+f16c");
|
||||||
|
}
|
||||||
|
- builder.setMAttrs(MAttrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if HAVE_LLVM >= 0x0305
|
||||||
|
+ /*
|
||||||
|
+ * llvm 3.5 no longer supports cpuid based autodetect.
|
||||||
|
+ * This breaks on "qemu -cpu qemu32" which is detected as pentium2 by llvm's
|
||||||
|
+ * sys::getHostCPUName(), but does support sse2.
|
||||||
|
+ *
|
||||||
|
+ * For this reason force the use of sse extensions when available, so our
|
||||||
|
+ * understanding of the cpu is in sync with llvm's.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+ else if (util_cpu_caps.has_sse4_2)
|
||||||
|
+ MAttrs.push_back("+sse42");
|
||||||
|
+ else if (util_cpu_caps.has_sse4_1)
|
||||||
|
+ MAttrs.push_back("+sse41");
|
||||||
|
+ else if (util_cpu_caps.has_ssse3)
|
||||||
|
+ MAttrs.push_back("+ssse3");
|
||||||
|
+ else if (util_cpu_caps.has_sse3)
|
||||||
|
+ MAttrs.push_back("+sse3");
|
||||||
|
+ else if (util_cpu_caps.has_sse2)
|
||||||
|
+ MAttrs.push_back("+sse2");
|
||||||
|
+ else if (util_cpu_caps.has_sse)
|
||||||
|
+ MAttrs.push_back("+sse");
|
||||||
|
+ else if (util_cpu_caps.has_mmx)
|
||||||
|
+ MAttrs.push_back("+sse");
|
||||||
|
+
|
||||||
|
+ if (util_cpu_caps.has_3dnow_ext)
|
||||||
|
+ MAttrs.push_back("+3dnowa");
|
||||||
|
+ else if (util_cpu_caps.has_3dnow)
|
||||||
|
+ MAttrs.push_back("+3dnow");
|
||||||
|
+
|
||||||
|
StringRef MCPU = llvm::sys::getHostCPUName();
|
||||||
|
/*
|
||||||
|
* The cpu bits are no longer set automatically, so need to set mcpu manually.
|
||||||
|
@@ -498,6 +526,7 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
|
||||||
|
*/
|
||||||
|
builder.setMCPU(MCPU);
|
||||||
|
#endif
|
||||||
|
+ builder.setMAttrs(MAttrs);
|
||||||
|
|
||||||
|
ShaderMemoryManager *MM = new ShaderMemoryManager();
|
||||||
|
*OutCode = MM->getGeneratedCode();
|
|
@ -1,328 +0,0 @@
|
||||||
--- a/src/gallium/auxiliary/gallivm/lp_bld_type.c
|
|
||||||
+++ b/src/gallium/auxiliary/gallivm/lp_bld_type.c
|
|
||||||
@@ -325,8 +325,10 @@ lp_typekind_name(LLVMTypeKind t)
|
|
||||||
return "LLVMArrayTypeKind";
|
|
||||||
case LLVMPointerTypeKind:
|
|
||||||
return "LLVMPointerTypeKind";
|
|
||||||
+#if HAVE_LLVM < 0x0300
|
|
||||||
case LLVMOpaqueTypeKind:
|
|
||||||
return "LLVMOpaqueTypeKind";
|
|
||||||
+#endif
|
|
||||||
case LLVMVectorTypeKind:
|
|
||||||
return "LLVMVectorTypeKind";
|
|
||||||
case LLVMMetadataTypeKind:
|
|
||||||
--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp 2011-10-15 08:43:58.000000000 +0800
|
|
||||||
+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp 2011-12-05 17:19:25.000000000 +0800
|
|
||||||
@@ -25,19 +25,27 @@
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
+#include <stddef.h>
|
|
||||||
+
|
|
||||||
#include <llvm-c/Core.h>
|
|
||||||
#include <llvm/Target/TargetMachine.h>
|
|
||||||
-#include <llvm/Target/TargetRegistry.h>
|
|
||||||
-#include <llvm/Target/TargetSelect.h>
|
|
||||||
#include <llvm/Target/TargetInstrInfo.h>
|
|
||||||
#include <llvm/Support/raw_ostream.h>
|
|
||||||
#include <llvm/Support/MemoryObject.h>
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+#include <llvm/Support/TargetRegistry.h>
|
|
||||||
+#include <llvm/Support/TargetSelect.h>
|
|
||||||
+#else /* HAVE_LLVM < 0x0300 */
|
|
||||||
+#include <llvm/Target/TargetRegistry.h>
|
|
||||||
+#include <llvm/Target/TargetSelect.h>
|
|
||||||
+#endif /* HAVE_LLVM < 0x0300 */
|
|
||||||
+
|
|
||||||
#if HAVE_LLVM >= 0x0209
|
|
||||||
#include <llvm/Support/Host.h>
|
|
||||||
-#else
|
|
||||||
+#else /* HAVE_LLVM < 0x0209 */
|
|
||||||
#include <llvm/System/Host.h>
|
|
||||||
-#endif
|
|
||||||
+#endif /* HAVE_LLVM < 0x0209 */
|
|
||||||
|
|
||||||
#if HAVE_LLVM >= 0x0207
|
|
||||||
#include <llvm/MC/MCDisassembler.h>
|
|
||||||
@@ -180,7 +188,11 @@
|
|
||||||
* Initialize all used objects.
|
|
||||||
*/
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0301
|
|
||||||
+ std::string Triple = sys::getDefaultTargetTriple();
|
|
||||||
+#else
|
|
||||||
std::string Triple = sys::getHostTriple();
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
std::string Error;
|
|
||||||
const Target *T = TargetRegistry::lookupTarget(Triple, Error);
|
|
||||||
@@ -193,14 +205,23 @@
|
|
||||||
|
|
||||||
InitializeAllDisassemblers();
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ OwningPtr<const MCAsmInfo> AsmInfo(T->createMCAsmInfo(Triple));
|
|
||||||
+#else
|
|
||||||
OwningPtr<const MCAsmInfo> AsmInfo(T->createAsmInfo(Triple));
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
if (!AsmInfo) {
|
|
||||||
debug_printf("error: no assembly info for target %s\n", Triple.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), "");
|
|
||||||
+ OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler(*STI));
|
|
||||||
+#else
|
|
||||||
OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler());
|
|
||||||
+#endif
|
|
||||||
if (!DisAsm) {
|
|
||||||
debug_printf("error: no disassembler for target %s\n", Triple.c_str());
|
|
||||||
return;
|
|
||||||
@@ -213,7 +234,11 @@
|
|
||||||
#else
|
|
||||||
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
|
||||||
#endif
|
|
||||||
-#if HAVE_LLVM >= 0x0208
|
|
||||||
+
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ OwningPtr<MCInstPrinter> Printer(
|
|
||||||
+ T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *STI));
|
|
||||||
+#elif HAVE_LLVM >= 0x0208
|
|
||||||
OwningPtr<MCInstPrinter> Printer(
|
|
||||||
T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo));
|
|
||||||
#else
|
|
||||||
@@ -253,7 +278,11 @@
|
|
||||||
|
|
||||||
if (!DisAsm->getInstruction(Inst, Size, memoryObject,
|
|
||||||
pc,
|
|
||||||
- nulls())) {
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ nulls(), nulls())) {
|
|
||||||
+#else
|
|
||||||
+ nulls())) {
|
|
||||||
+#endif
|
|
||||||
debug_printf("invalid\n");
|
|
||||||
pc += 1;
|
|
||||||
}
|
|
||||||
@@ -276,7 +305,9 @@
|
|
||||||
* Print the instruction.
|
|
||||||
*/
|
|
||||||
|
|
||||||
-#if HAVE_LLVM >= 0x208
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ Printer->printInst(&Inst, Out, "");
|
|
||||||
+#elif HAVE_LLVM >= 0x208
|
|
||||||
Printer->printInst(&Inst, Out);
|
|
||||||
#else
|
|
||||||
Printer->printInst(&Inst);
|
|
||||||
@@ -289,7 +320,11 @@
|
|
||||||
|
|
||||||
pc += Size;
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ const MCInstrDesc &TID = TII->get(Inst.getOpcode());
|
|
||||||
+#else
|
|
||||||
const TargetInstrDesc &TID = TII->get(Inst.getOpcode());
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Keep track of forward jumps to a nearby address.
|
|
||||||
--- a/src/gallium/auxiliary/draw/draw_llvm.c
|
|
||||||
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
|
|
||||||
@@ -96,7 +96,7 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *var);
|
|
||||||
* Create LLVM type for struct draw_jit_texture
|
|
||||||
*/
|
|
||||||
static LLVMTypeRef
|
|
||||||
-create_jit_texture_type(struct gallivm_state *gallivm)
|
|
||||||
+create_jit_texture_type(struct gallivm_state *gallivm, const char *struct_name)
|
|
||||||
{
|
|
||||||
LLVMTargetDataRef target = gallivm->target;
|
|
||||||
LLVMTypeRef texture_type;
|
|
||||||
@@ -120,13 +120,21 @@ create_jit_texture_type(struct gallivm_state *gallivm)
|
|
||||||
elem_types[DRAW_JIT_TEXTURE_BORDER_COLOR] =
|
|
||||||
LLVMArrayType(LLVMFloatTypeInContext(gallivm->context), 4);
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ texture_type = LLVMStructCreateNamed(gallivm->context, struct_name);
|
|
||||||
+ LLVMStructSetBody(texture_type, elem_types,
|
|
||||||
+ Elements(elem_types), 0);
|
|
||||||
+#else
|
|
||||||
texture_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
|
||||||
Elements(elem_types), 0);
|
|
||||||
|
|
||||||
+ LLVMAddTypeName(gallivm->module, struct_name, texture_type);
|
|
||||||
+
|
|
||||||
/* Make sure the target's struct layout cache doesn't return
|
|
||||||
* stale/invalid data.
|
|
||||||
*/
|
|
||||||
LLVMInvalidateStructLayout(gallivm->target, texture_type);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, width,
|
|
||||||
target, texture_type,
|
|
||||||
@@ -176,7 +184,7 @@ create_jit_texture_type(struct gallivm_state *gallivm)
|
|
||||||
*/
|
|
||||||
static LLVMTypeRef
|
|
||||||
create_jit_context_type(struct gallivm_state *gallivm,
|
|
||||||
- LLVMTypeRef texture_type)
|
|
||||||
+ LLVMTypeRef texture_type, const char *struct_name)
|
|
||||||
{
|
|
||||||
LLVMTargetDataRef target = gallivm->target;
|
|
||||||
LLVMTypeRef float_type = LLVMFloatTypeInContext(gallivm->context);
|
|
||||||
@@ -189,11 +197,17 @@ create_jit_context_type(struct gallivm_state *gallivm,
|
|
||||||
elem_types[3] = LLVMPointerType(float_type, 0); /* viewport */
|
|
||||||
elem_types[4] = LLVMArrayType(texture_type,
|
|
||||||
PIPE_MAX_VERTEX_SAMPLERS); /* textures */
|
|
||||||
-
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ context_type = LLVMStructCreateNamed(gallivm->context, struct_name);
|
|
||||||
+ LLVMStructSetBody(context_type, elem_types,
|
|
||||||
+ Elements(elem_types), 0);
|
|
||||||
+#else
|
|
||||||
context_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
|
||||||
Elements(elem_types), 0);
|
|
||||||
+ LLVMAddTypeName(gallivm->module, struct_name, context_type);
|
|
||||||
|
|
||||||
LLVMInvalidateStructLayout(gallivm->target, context_type);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, vs_constants,
|
|
||||||
target, context_type, 0);
|
|
||||||
@@ -215,7 +229,7 @@ create_jit_context_type(struct gallivm_state *gallivm,
|
|
||||||
* Create LLVM type for struct pipe_vertex_buffer
|
|
||||||
*/
|
|
||||||
static LLVMTypeRef
|
|
||||||
-create_jit_vertex_buffer_type(struct gallivm_state *gallivm)
|
|
||||||
+create_jit_vertex_buffer_type(struct gallivm_state *gallivm, const char *struct_name)
|
|
||||||
{
|
|
||||||
LLVMTargetDataRef target = gallivm->target;
|
|
||||||
LLVMTypeRef elem_types[3];
|
|
||||||
@@ -225,10 +239,17 @@ create_jit_vertex_buffer_type(struct gallivm_state *gallivm)
|
|
||||||
elem_types[1] = LLVMInt32TypeInContext(gallivm->context);
|
|
||||||
elem_types[2] = LLVMPointerType(LLVMInt8TypeInContext(gallivm->context), 0); /* vs_constants */
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ vb_type = LLVMStructCreateNamed(gallivm->context, struct_name);
|
|
||||||
+ LLVMStructSetBody(vb_type, elem_types,
|
|
||||||
+ Elements(elem_types), 0);
|
|
||||||
+#else
|
|
||||||
vb_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
|
||||||
Elements(elem_types), 0);
|
|
||||||
+ LLVMAddTypeName(gallivm->module, struct_name, vb_type);
|
|
||||||
|
|
||||||
LLVMInvalidateStructLayout(gallivm->target, vb_type);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
LP_CHECK_MEMBER_OFFSET(struct pipe_vertex_buffer, stride,
|
|
||||||
target, vb_type, 0);
|
|
||||||
@@ -258,10 +279,17 @@ create_jit_vertex_header(struct gallivm_state *gallivm, int data_elems)
|
|
||||||
elem_types[1] = LLVMArrayType(LLVMFloatTypeInContext(gallivm->context), 4);
|
|
||||||
elem_types[2] = LLVMArrayType(elem_types[1], data_elems);
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ vertex_header = LLVMStructCreateNamed(gallivm->context, struct_name);
|
|
||||||
+ LLVMStructSetBody(vertex_header, elem_types,
|
|
||||||
+ Elements(elem_types), 0);
|
|
||||||
+#else
|
|
||||||
vertex_header = LLVMStructTypeInContext(gallivm->context, elem_types,
|
|
||||||
Elements(elem_types), 0);
|
|
||||||
+ LLVMAddTypeName(gallivm->module, struct_name, vertex_header);
|
|
||||||
|
|
||||||
LLVMInvalidateStructLayout(gallivm->target, vertex_header);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* these are bit-fields and we can't take address of them
|
|
||||||
LP_CHECK_MEMBER_OFFSET(struct vertex_header, clipmask,
|
|
||||||
@@ -284,8 +312,6 @@ create_jit_vertex_header(struct gallivm_state *gallivm, int data_elems)
|
|
||||||
target, vertex_header,
|
|
||||||
DRAW_JIT_VERTEX_DATA);
|
|
||||||
|
|
||||||
- LLVMAddTypeName(gallivm->module, struct_name, vertex_header);
|
|
||||||
-
|
|
||||||
return vertex_header;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -299,19 +325,15 @@ create_jit_types(struct draw_llvm *llvm)
|
|
||||||
struct gallivm_state *gallivm = llvm->gallivm;
|
|
||||||
LLVMTypeRef texture_type, context_type, buffer_type, vb_type;
|
|
||||||
|
|
||||||
- texture_type = create_jit_texture_type(gallivm);
|
|
||||||
- LLVMAddTypeName(gallivm->module, "texture", texture_type);
|
|
||||||
+ texture_type = create_jit_texture_type(gallivm, "texture");
|
|
||||||
|
|
||||||
- context_type = create_jit_context_type(gallivm, texture_type);
|
|
||||||
- LLVMAddTypeName(gallivm->module, "draw_jit_context", context_type);
|
|
||||||
+ context_type = create_jit_context_type(gallivm, texture_type, "draw_jit_context");
|
|
||||||
llvm->context_ptr_type = LLVMPointerType(context_type, 0);
|
|
||||||
|
|
||||||
buffer_type = LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 8), 0);
|
|
||||||
- LLVMAddTypeName(gallivm->module, "buffer", buffer_type);
|
|
||||||
llvm->buffer_ptr_type = LLVMPointerType(buffer_type, 0);
|
|
||||||
|
|
||||||
- vb_type = create_jit_vertex_buffer_type(gallivm);
|
|
||||||
- LLVMAddTypeName(gallivm->module, "pipe_vertex_buffer", vb_type);
|
|
||||||
+ vb_type = create_jit_vertex_buffer_type(gallivm, "pipe_vertex_buffer");
|
|
||||||
llvm->vb_ptr_type = LLVMPointerType(vb_type, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
--- a/src/gallium/drivers/llvmpipe/lp_jit.c
|
|
||||||
+++ b/src/gallium/drivers/llvmpipe/lp_jit.c
|
|
||||||
@@ -68,10 +68,17 @@ lp_jit_create_types(struct llvmpipe_context *lp)
|
|
||||||
elem_types[LP_JIT_TEXTURE_BORDER_COLOR] =
|
|
||||||
LLVMArrayType(LLVMFloatTypeInContext(lc), 4);
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ texture_type = LLVMStructCreateNamed(gallivm->context, "texture");
|
|
||||||
+ LLVMStructSetBody(texture_type, elem_types,
|
|
||||||
+ Elements(elem_types), 0);
|
|
||||||
+#else
|
|
||||||
texture_type = LLVMStructTypeInContext(lc, elem_types,
|
|
||||||
Elements(elem_types), 0);
|
|
||||||
+ LLVMAddTypeName(gallivm->module, "texture", texture_type);
|
|
||||||
|
|
||||||
LLVMInvalidateStructLayout(gallivm->target, texture_type);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, width,
|
|
||||||
gallivm->target, texture_type,
|
|
||||||
@@ -112,8 +119,6 @@ lp_jit_create_types(struct llvmpipe_context *lp)
|
|
||||||
|
|
||||||
LP_CHECK_STRUCT_SIZE(struct lp_jit_texture,
|
|
||||||
gallivm->target, texture_type);
|
|
||||||
-
|
|
||||||
- LLVMAddTypeName(gallivm->module, "texture", texture_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* struct lp_jit_context */
|
|
||||||
@@ -129,11 +134,19 @@ lp_jit_create_types(struct llvmpipe_context *lp)
|
|
||||||
elem_types[LP_JIT_CTX_TEXTURES] = LLVMArrayType(texture_type,
|
|
||||||
PIPE_MAX_SAMPLERS);
|
|
||||||
|
|
||||||
+#if HAVE_LLVM >= 0x0300
|
|
||||||
+ context_type = LLVMStructCreateNamed(gallivm->context, "context");
|
|
||||||
+ LLVMStructSetBody(context_type, elem_types,
|
|
||||||
+ Elements(elem_types), 0);
|
|
||||||
+#else
|
|
||||||
context_type = LLVMStructTypeInContext(lc, elem_types,
|
|
||||||
Elements(elem_types), 0);
|
|
||||||
|
|
||||||
LLVMInvalidateStructLayout(gallivm->target, context_type);
|
|
||||||
|
|
||||||
+ LLVMAddTypeName(gallivm->module, "context", context_type);
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_context, constants,
|
|
||||||
gallivm->target, context_type,
|
|
||||||
LP_JIT_CTX_CONSTANTS);
|
|
||||||
@@ -155,8 +168,6 @@ lp_jit_create_types(struct llvmpipe_context *lp)
|
|
||||||
LP_CHECK_STRUCT_SIZE(struct lp_jit_context,
|
|
||||||
gallivm->target, context_type);
|
|
||||||
|
|
||||||
- LLVMAddTypeName(gallivm->module, "context", context_type);
|
|
||||||
-
|
|
||||||
lp->jit_context_ptr_type = LLVMPointerType(context_type, 0);
|
|
||||||
}
|
|
||||||
|
|
24
README.xvmc.urpmi
Normal file
24
README.xvmc.urpmi
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
Note that XvMC-related components are provided as is, without any warranty.
|
||||||
|
We do not offer official support for that yet.
|
||||||
|
|
||||||
|
The backends supporting XvMC for some Gallium drivers (r600 and nouveau) are
|
||||||
|
installed by default.
|
||||||
|
|
||||||
|
To actually enable that support, however, you may need to create XvMCConfig
|
||||||
|
file in /etc/X11/ directory.
|
||||||
|
|
||||||
|
You can use the following as a template of XvMCConfig file. Uncomment the
|
||||||
|
appropriate line below, according to the driver you are actually using and
|
||||||
|
the bitness of your setup.
|
||||||
|
|
||||||
|
-------------------------------- cut here ---------------------------------
|
||||||
|
# Driver for AMD Radeon r600+ video cards - 64 bit
|
||||||
|
# /usr/lib64/libXvMCr600.so.1
|
||||||
|
# Driver for AMD Radeon r600+ video cards - 32 bit
|
||||||
|
# /usr/lib/libXvMCr600.so.1
|
||||||
|
|
||||||
|
# Driver for NVidia (nouveau) - 64 bit
|
||||||
|
# /usr/lib64/libXvMCnouveau.so.1
|
||||||
|
# Driver for NVidia (nouveau) - 32 bit
|
||||||
|
# /usr/lib/libXvMCnouveau.so.1
|
||||||
|
-------------------------------- cut here ---------------------------------
|
|
@ -1,38 +0,0 @@
|
||||||
busIdStringLength is a CARD32 and needs to be bounds checked before adding
|
|
||||||
one to it to come up with the total size to allocate, to avoid integer
|
|
||||||
overflow leading to underallocation and writing data from the network past
|
|
||||||
the end of the allocated buffer.
|
|
||||||
|
|
||||||
Reported-by: Ilja Van Sprundel <ivansprundel at ioactive.com>
|
|
||||||
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
|
|
||||||
---
|
|
||||||
src/glx/XF86dri.c | 7 ++++++-
|
|
||||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/glx/XF86dri.c b/src/glx/XF86dri.c
|
|
||||||
index b1cdc9b..8f53bd7 100644
|
|
||||||
--- a/src/glx/XF86dri.c
|
|
||||||
+++ b/src/glx/XF86dri.c
|
|
||||||
@@ -43,6 +43,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
#include <X11/extensions/Xext.h>
|
|
||||||
#include <X11/extensions/extutil.h>
|
|
||||||
#include "xf86dristr.h"
|
|
||||||
+#include <limits.h>
|
|
||||||
|
|
||||||
static XExtensionInfo _xf86dri_info_data;
|
|
||||||
static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
|
|
||||||
@@ -202,7 +202,11 @@ XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA,
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rep.length) {
|
|
||||||
- if (!(*busIdString = (char *) Xcalloc(rep.busIdStringLength + 1, 1))) {
|
|
||||||
+ if (rep.busIdStringLength < INT_MAX)
|
|
||||||
+ *busIdString = (char *) Xcalloc(rep.busIdStringLength + 1, 1);
|
|
||||||
+ else
|
|
||||||
+ *busIdString = NULL;
|
|
||||||
+ if (*busIdString == NULL) {
|
|
||||||
_XEatData(dpy, ((rep.busIdStringLength + 3) & ~3));
|
|
||||||
UnlockDisplay(dpy);
|
|
||||||
SyncHandle();
|
|
||||||
--
|
|
||||||
1.7.9.2
|
|
|
@ -1,32 +0,0 @@
|
||||||
clientDriverNameLength is a CARD32 and needs to be bounds checked before
|
|
||||||
adding one to it to come up with the total size to allocate, to avoid
|
|
||||||
integer overflow leading to underallocation and writing data from the
|
|
||||||
network past the end of the allocated buffer.
|
|
||||||
|
|
||||||
Reported-by: Ilja Van Sprundel <ivansprundel at ioactive.com>
|
|
||||||
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
|
|
||||||
---
|
|
||||||
src/glx/XF86dri.c | 8 +++++---
|
|
||||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/glx/XF86dri.c b/src/glx/XF86dri.c
|
|
||||||
index 8f53bd7..56e3557 100644
|
|
||||||
--- a/src/glx/XF86dri.c
|
|
||||||
+++ b/src/glx/XF86dri.c
|
|
||||||
@@ -305,9 +305,11 @@ XF86DRIGetClientDriverName(Display * dpy
|
|
||||||
*ddxDriverPatchVersion = rep.ddxDriverPatchVersion;
|
|
||||||
|
|
||||||
if (rep.length) {
|
|
||||||
- if (!
|
|
||||||
- (*clientDriverName =
|
|
||||||
- (char *) Xcalloc(rep.clientDriverNameLength + 1, 1))) {
|
|
||||||
+ if (rep.clientDriverNameLength < INT_MAX)
|
|
||||||
+ *clientDriverName = (char *) Xcalloc(rep.clientDriverNameLength + 1, 1);
|
|
||||||
+ else
|
|
||||||
+ *clientDriverName = NULL;
|
|
||||||
+ if (*clientDriverName == NULL) {
|
|
||||||
_XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3));
|
|
||||||
UnlockDisplay(dpy);
|
|
||||||
SyncHandle();
|
|
||||||
--
|
|
||||||
1.7.9.2
|
|
0
make-git-snapshot.sh
Executable file → Normal file
0
make-git-snapshot.sh
Executable file → Normal file
13
mesa-10.2-evergreen-big-endian.patch
Normal file
13
mesa-10.2-evergreen-big-endian.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
|
||||||
|
index fabc52c..c276016 100644
|
||||||
|
--- a/src/gallium/drivers/r600/r600_state_common.c
|
||||||
|
+++ b/src/gallium/drivers/r600/r600_state_common.c
|
||||||
|
@@ -2258,7 +2258,7 @@ uint32_t r600_translate_colorformat(enum chip_class chip, enum pipe_format forma
|
||||||
|
|
||||||
|
uint32_t r600_colorformat_endian_swap(uint32_t colorformat)
|
||||||
|
{
|
||||||
|
- if (R600_BIG_ENDIAN) {
|
||||||
|
+ if (0 && R600_BIG_ENDIAN) {
|
||||||
|
switch(colorformat) {
|
||||||
|
/* 8-bit buffers. */
|
||||||
|
case V_0280A0_COLOR_4_4:
|
23
mesa-10.3-do-install-libxvmcgallium.patch
Normal file
23
mesa-10.3-do-install-libxvmcgallium.patch
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
diff -Naur Mesa-10.3.3.orig/src/gallium/targets/xvmc/Makefile.am Mesa-10.3.3/src/gallium/targets/xvmc/Makefile.am
|
||||||
|
--- Mesa-10.3.3.orig/src/gallium/targets/xvmc/Makefile.am 2014-11-08 19:03:25.000000000 +0300
|
||||||
|
+++ Mesa-10.3.3/src/gallium/targets/xvmc/Makefile.am 2014-11-12 15:49:46.546681639 +0300
|
||||||
|
@@ -97,5 +97,4 @@
|
||||||
|
$${dest_dir}/$${k}.$(XVMC_MAJOR); \
|
||||||
|
ln -sf $${l} \
|
||||||
|
$${dest_dir}/$${k}; \
|
||||||
|
- done; \
|
||||||
|
- $(RM) -f $${dest_dir}/libXvMCgallium.*
|
||||||
|
+ done;
|
||||||
|
diff -Naur Mesa-10.3.3.orig/src/gallium/targets/xvmc/Makefile.in Mesa-10.3.3/src/gallium/targets/xvmc/Makefile.in
|
||||||
|
--- Mesa-10.3.3.orig/src/gallium/targets/xvmc/Makefile.in 2014-11-08 19:43:53.000000000 +0300
|
||||||
|
+++ Mesa-10.3.3/src/gallium/targets/xvmc/Makefile.in 2014-11-12 15:50:00.260160271 +0300
|
||||||
|
@@ -1018,8 +1018,7 @@
|
||||||
|
$${dest_dir}/$${k}.$(XVMC_MAJOR); \
|
||||||
|
ln -sf $${l} \
|
||||||
|
$${dest_dir}/$${k}; \
|
||||||
|
- done; \
|
||||||
|
- $(RM) -f $${dest_dir}/libXvMCgallium.*
|
||||||
|
+ done;
|
||||||
|
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
36
mesa-9.2-hardware-float.patch
Normal file
36
mesa-9.2-hardware-float.patch
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
|
||||||
|
index 5ec1df6..a0406fc 100644
|
||||||
|
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
|
||||||
|
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
|
||||||
|
@@ -306,6 +306,13 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
|
||||||
|
if (!format_desc)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
+ if ((bind & PIPE_BIND_RENDER_TARGET) &&
|
||||||
|
+ format != PIPE_FORMAT_R9G9B9E5_FLOAT &&
|
||||||
|
+ format != PIPE_FORMAT_R11G11B10_FLOAT &&
|
||||||
|
+ util_format_is_float(format)) {
|
||||||
|
+ return FALSE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
assert(target == PIPE_BUFFER ||
|
||||||
|
target == PIPE_TEXTURE_1D ||
|
||||||
|
target == PIPE_TEXTURE_1D_ARRAY ||
|
||||||
|
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
|
||||||
|
index 937035e..2f5e571 100644
|
||||||
|
--- a/src/gallium/drivers/softpipe/sp_screen.c
|
||||||
|
+++ b/src/gallium/drivers/softpipe/sp_screen.c
|
||||||
|
@@ -291,6 +291,13 @@ softpipe_is_format_supported( struct pipe_screen *screen,
|
||||||
|
if (!format_desc)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
+ if ((bind & PIPE_BIND_RENDER_TARGET) &&
|
||||||
|
+ format != PIPE_FORMAT_R9G9B9E5_FLOAT &&
|
||||||
|
+ format != PIPE_FORMAT_R11G11B10_FLOAT &&
|
||||||
|
+ util_format_is_float(format)) {
|
||||||
|
+ return FALSE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (sample_count > 1)
|
||||||
|
return FALSE;
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Copyright 2005 by Red Hat, Inc.
|
|
||||||
# Author: Mike A. Harris <mharris@redhat.com>
|
|
||||||
#
|
|
||||||
# License: MIT/X11
|
|
||||||
# <FIXME: Insert legal terms here>
|
|
||||||
|
|
||||||
# redhat-mesa-driver-install:
|
|
||||||
#
|
|
||||||
# The purpose of this script is to address some inadequacies of the current
|
|
||||||
# Mesa 6.3.2 upstream install script. We ship DRI on some OS/arch
|
|
||||||
# combinations, and disable it on other combinations, so we need a simple
|
|
||||||
# way to control wether or not DRI modules will get installed, and an easy
|
|
||||||
# way of specifying which drivers we'll ship on a particular OS/arch
|
|
||||||
# combination.
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
|
||||||
# NOTE: FC5's current kernel has the following DRM modules. Some of them
|
|
||||||
# shouldn't be there at all (ppc64), some don't make much sense (via on
|
|
||||||
# ppc). We'll have to talk to kernel folk to get the ones disabled that
|
|
||||||
# don't make sense, or which we don't want to ship for some reason or
|
|
||||||
# another.
|
|
||||||
#
|
|
||||||
# for a in i586 i686 ia64 ppc ppc64 s390x x86_64 ; do (echo -n "${a}:" \
|
|
||||||
# rpm -qlp <path to kernel src.rpm with all arch components replaced by $a) | \
|
|
||||||
# grep /drm/ | sed -e 's;.*/;;g' |xargs echo ) ;done
|
|
||||||
#
|
|
||||||
# i586: drm.ko i810.ko i830.ko i915.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
|
|
||||||
# i686: drm.ko i810.ko i830.ko i915.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
|
|
||||||
# ia64: drm.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
|
|
||||||
# ppc: drm.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
|
|
||||||
# ppc64: drm.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
|
|
||||||
# s390x:
|
|
||||||
# x86_64: drm.ko i810.ko i830.ko i915.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
|
|
||||||
#---------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Define list of all of the DRI drivers Mesa builds by default.
|
|
||||||
DRI_DRIVERS_ALL="ffb i810 i830 i915 mach64 mga r128 r200 r300 radeon s3v savage sis tdfx trident unichrome"
|
|
||||||
|
|
||||||
# Current build architecture, passed by rpm spec
|
|
||||||
if [ $# -gt 0 ] ; then
|
|
||||||
echo "Usage: ${0##*/}"
|
|
||||||
echo " Be sure to set 'DRIMODULE_SRCDIR=<libdir>' first"
|
|
||||||
echo " Be sure to set 'DRIMODULE_DESTDIR=<moduledir>' first"
|
|
||||||
echo " Be sure to set 'DRI_DRIVERS=<drivers>' first"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z $DRIMODULE_SRCDIR ] ; then
|
|
||||||
echo "Error: DRIMODULE_SRCDIR not set in environment"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
if [ -z $DRIMODULE_DESTDIR ] ; then
|
|
||||||
echo "Error: DRIMODULE_DESTDIR not set in environment"
|
|
||||||
exit
|
|
||||||
else
|
|
||||||
[ ! -d $DRIMODULE_DESTDIR ] && mkdir -p $DRIMODULE_DESTDIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
#DRIMODULE_DESTDIR=${1##DRIMODULE_DESTDIR=}
|
|
||||||
ARCH=$1
|
|
||||||
|
|
||||||
if [ -z "$DRI_DRIVERS" ]; then
|
|
||||||
DRI_DRIVERS="$DRI_DRIVERS_ALL"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install DRI drivers
|
|
||||||
for driver in $DRI_DRIVERS ; do
|
|
||||||
set -vx
|
|
||||||
install -m 0755 $DRIMODULE_SRCDIR/${driver}_dri.so $DRIMODULE_DESTDIR/
|
|
||||||
set -
|
|
||||||
done
|
|
8
mesa.rpmlintrc
Normal file
8
mesa.rpmlintrc
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# libXvMCr600.so.1.0.0 and libXvMCnouveau.so.1.0.0 are actually the hard
|
||||||
|
# links to libXvMCgallium.so.1.0.0 and have its soname. This confuses the
|
||||||
|
# build system.
|
||||||
|
addFilter("E: invalid-ldconfig-symlink")
|
||||||
|
|
||||||
|
# dri-drivers is a collection of special shared objects rather than a
|
||||||
|
# single shared library.
|
||||||
|
addFilter("E: incoherent-version-in-name")
|
|
@ -1,222 +0,0 @@
|
||||||
From 3069a7eaa5d83e7f41616347ba244c0dc0d944ae Mon Sep 17 00:00:00 2001
|
|
||||||
From: Christoph Bumiller <e0425955@student.tuwien.ac.at>
|
|
||||||
Date: Thu, 07 Jul 2011 12:58:29 +0000
|
|
||||||
Subject: nv50,nvc0: use screen instead of context for flush notifier
|
|
||||||
|
|
||||||
Context may become NULL and we still have to be able to flush
|
|
||||||
pending fences.
|
|
||||||
---
|
|
||||||
diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c
|
|
||||||
index ceb83f6..ac3e361 100644
|
|
||||||
--- a/src/gallium/drivers/nv50/nv50_context.c
|
|
||||||
+++ b/src/gallium/drivers/nv50/nv50_context.c
|
|
||||||
@@ -60,13 +60,13 @@ nv50_texture_barrier(struct pipe_context *pipe)
|
|
||||||
void
|
|
||||||
nv50_default_flush_notify(struct nouveau_channel *chan)
|
|
||||||
{
|
|
||||||
- struct nv50_context *nv50 = chan->user_private;
|
|
||||||
+ struct nv50_screen *screen = chan->user_private;
|
|
||||||
|
|
||||||
- if (!nv50)
|
|
||||||
+ if (!screen)
|
|
||||||
return;
|
|
||||||
|
|
||||||
- nouveau_fence_update(&nv50->screen->base, TRUE);
|
|
||||||
- nouveau_fence_next(&nv50->screen->base);
|
|
||||||
+ nouveau_fence_update(&screen->base, TRUE);
|
|
||||||
+ nouveau_fence_next(&screen->base);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
@@ -100,10 +100,8 @@ nv50_destroy(struct pipe_context *pipe)
|
|
||||||
|
|
||||||
draw_destroy(nv50->draw);
|
|
||||||
|
|
||||||
- if (nv50->screen->cur_ctx == nv50) {
|
|
||||||
- nv50->screen->base.channel->user_private = NULL;
|
|
||||||
+ if (nv50->screen->cur_ctx == nv50)
|
|
||||||
nv50->screen->cur_ctx = NULL;
|
|
||||||
- }
|
|
||||||
|
|
||||||
FREE(nv50);
|
|
||||||
}
|
|
||||||
@@ -140,7 +138,6 @@ nv50_create(struct pipe_screen *pscreen, void *priv)
|
|
||||||
|
|
||||||
if (!screen->cur_ctx)
|
|
||||||
screen->cur_ctx = nv50;
|
|
||||||
- screen->base.channel->user_private = nv50;
|
|
||||||
screen->base.channel->flush_notify = nv50_default_flush_notify;
|
|
||||||
|
|
||||||
nv50_init_query_functions(nv50);
|
|
||||||
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
|
|
||||||
index cc921d0..4cda303 100644
|
|
||||||
--- a/src/gallium/drivers/nv50/nv50_screen.c
|
|
||||||
+++ b/src/gallium/drivers/nv50/nv50_screen.c
|
|
||||||
@@ -215,6 +215,7 @@ nv50_screen_destroy(struct pipe_screen *pscreen)
|
|
||||||
nouveau_fence_wait(screen->base.fence.current);
|
|
||||||
nouveau_fence_ref (NULL, &screen->base.fence.current);
|
|
||||||
}
|
|
||||||
+ screen->base.channel->user_private = NULL;
|
|
||||||
|
|
||||||
nouveau_bo_ref(NULL, &screen->code);
|
|
||||||
nouveau_bo_ref(NULL, &screen->tls_bo);
|
|
||||||
@@ -300,6 +301,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
|
|
||||||
FAIL_SCREEN_INIT("nouveau_screen_init failed: %d\n", ret);
|
|
||||||
|
|
||||||
chan = screen->base.channel;
|
|
||||||
+ chan->user_private = screen;
|
|
||||||
|
|
||||||
pscreen->winsys = ws;
|
|
||||||
pscreen->destroy = nv50_screen_destroy;
|
|
||||||
diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c
|
|
||||||
index 11561f5..d29c1e9 100644
|
|
||||||
--- a/src/gallium/drivers/nv50/nv50_state_validate.c
|
|
||||||
+++ b/src/gallium/drivers/nv50/nv50_state_validate.c
|
|
||||||
@@ -282,8 +282,7 @@ nv50_switch_pipe_context(struct nv50_context *ctx_to)
|
|
||||||
if (!ctx_to->zsa)
|
|
||||||
ctx_to->dirty &= ~NV50_NEW_ZSA;
|
|
||||||
|
|
||||||
- ctx_to->screen->base.channel->user_private = ctx_to->screen->cur_ctx =
|
|
||||||
- ctx_to;
|
|
||||||
+ ctx_to->screen->cur_ctx = ctx_to;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct state_validate {
|
|
||||||
diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c
|
|
||||||
index bb08941..f23008a 100644
|
|
||||||
--- a/src/gallium/drivers/nv50/nv50_vbo.c
|
|
||||||
+++ b/src/gallium/drivers/nv50/nv50_vbo.c
|
|
||||||
@@ -389,11 +389,11 @@ nv50_prim_gl(unsigned prim)
|
|
||||||
static void
|
|
||||||
nv50_draw_vbo_flush_notify(struct nouveau_channel *chan)
|
|
||||||
{
|
|
||||||
- struct nv50_context *nv50 = chan->user_private;
|
|
||||||
+ struct nv50_screen *screen = chan->user_private;
|
|
||||||
|
|
||||||
- nouveau_fence_update(&nv50->screen->base, TRUE);
|
|
||||||
+ nouveau_fence_update(&screen->base, TRUE);
|
|
||||||
|
|
||||||
- nv50_bufctx_emit_relocs(nv50);
|
|
||||||
+ nv50_bufctx_emit_relocs(screen->cur_ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
@@ -650,7 +650,6 @@ nv50_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
|
||||||
nv50_state_validate(nv50);
|
|
||||||
|
|
||||||
chan->flush_notify = nv50_draw_vbo_flush_notify;
|
|
||||||
- chan->user_private = nv50;
|
|
||||||
|
|
||||||
if (nv50->vbo_fifo) {
|
|
||||||
nv50_push_vbo(nv50, info);
|
|
||||||
diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c
|
|
||||||
index 2679b7f..983db23 100644
|
|
||||||
--- a/src/gallium/drivers/nvc0/nvc0_context.c
|
|
||||||
+++ b/src/gallium/drivers/nvc0/nvc0_context.c
|
|
||||||
@@ -89,10 +89,8 @@ nvc0_destroy(struct pipe_context *pipe)
|
|
||||||
|
|
||||||
draw_destroy(nvc0->draw);
|
|
||||||
|
|
||||||
- if (nvc0->screen->cur_ctx == nvc0) {
|
|
||||||
- nvc0->screen->base.channel->user_private = NULL;
|
|
||||||
+ if (nvc0->screen->cur_ctx == nvc0)
|
|
||||||
nvc0->screen->cur_ctx = NULL;
|
|
||||||
- }
|
|
||||||
|
|
||||||
FREE(nvc0);
|
|
||||||
}
|
|
||||||
@@ -100,13 +98,13 @@ nvc0_destroy(struct pipe_context *pipe)
|
|
||||||
void
|
|
||||||
nvc0_default_flush_notify(struct nouveau_channel *chan)
|
|
||||||
{
|
|
||||||
- struct nvc0_context *nvc0 = chan->user_private;
|
|
||||||
+ struct nvc0_screen *screen = chan->user_private;
|
|
||||||
|
|
||||||
- if (!nvc0)
|
|
||||||
+ if (!screen)
|
|
||||||
return;
|
|
||||||
|
|
||||||
- nouveau_fence_update(&nvc0->screen->base, TRUE);
|
|
||||||
- nouveau_fence_next(&nvc0->screen->base);
|
|
||||||
+ nouveau_fence_update(&screen->base, TRUE);
|
|
||||||
+ nouveau_fence_next(&screen->base);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct pipe_context *
|
|
||||||
@@ -141,7 +139,6 @@ nvc0_create(struct pipe_screen *pscreen, void *priv)
|
|
||||||
|
|
||||||
if (!screen->cur_ctx)
|
|
||||||
screen->cur_ctx = nvc0;
|
|
||||||
- screen->base.channel->user_private = nvc0;
|
|
||||||
screen->base.channel->flush_notify = nvc0_default_flush_notify;
|
|
||||||
|
|
||||||
nvc0_init_query_functions(nvc0);
|
|
||||||
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
|
|
||||||
index 34bf0f0..1bd7fa9 100644
|
|
||||||
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
|
|
||||||
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
|
|
||||||
@@ -198,8 +198,11 @@ nvc0_screen_destroy(struct pipe_screen *pscreen)
|
|
||||||
{
|
|
||||||
struct nvc0_screen *screen = nvc0_screen(pscreen);
|
|
||||||
|
|
||||||
- nouveau_fence_wait(screen->base.fence.current);
|
|
||||||
- nouveau_fence_ref(NULL, &screen->base.fence.current);
|
|
||||||
+ if (screen->base.fence.current) {
|
|
||||||
+ nouveau_fence_wait(screen->base.fence.current);
|
|
||||||
+ nouveau_fence_ref(NULL, &screen->base.fence.current);
|
|
||||||
+ }
|
|
||||||
+ screen->base.channel->user_private = NULL;
|
|
||||||
|
|
||||||
nouveau_bo_ref(NULL, &screen->text);
|
|
||||||
nouveau_bo_ref(NULL, &screen->tls);
|
|
||||||
@@ -358,6 +361,7 @@ nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
chan = screen->base.channel;
|
|
||||||
+ chan->user_private = screen;
|
|
||||||
|
|
||||||
pscreen->winsys = ws;
|
|
||||||
pscreen->destroy = nvc0_screen_destroy;
|
|
||||||
diff --git a/src/gallium/drivers/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nvc0/nvc0_state_validate.c
|
|
||||||
index 9b2a281..f300f37 100644
|
|
||||||
--- a/src/gallium/drivers/nvc0/nvc0_state_validate.c
|
|
||||||
+++ b/src/gallium/drivers/nvc0/nvc0_state_validate.c
|
|
||||||
@@ -428,8 +428,7 @@ nvc0_switch_pipe_context(struct nvc0_context *ctx_to)
|
|
||||||
if (!ctx_to->zsa)
|
|
||||||
ctx_to->dirty &= ~NVC0_NEW_ZSA;
|
|
||||||
|
|
||||||
- ctx_to->screen->base.channel->user_private = ctx_to->screen->cur_ctx =
|
|
||||||
- ctx_to;
|
|
||||||
+ ctx_to->screen->cur_ctx = ctx_to;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct state_validate {
|
|
||||||
diff --git a/src/gallium/drivers/nvc0/nvc0_vbo.c b/src/gallium/drivers/nvc0/nvc0_vbo.c
|
|
||||||
index 4107910..8a5bf8d 100644
|
|
||||||
--- a/src/gallium/drivers/nvc0/nvc0_vbo.c
|
|
||||||
+++ b/src/gallium/drivers/nvc0/nvc0_vbo.c
|
|
||||||
@@ -367,11 +367,11 @@ nvc0_prim_gl(unsigned prim)
|
|
||||||
static void
|
|
||||||
nvc0_draw_vbo_flush_notify(struct nouveau_channel *chan)
|
|
||||||
{
|
|
||||||
- struct nvc0_context *nvc0 = chan->user_private;
|
|
||||||
+ struct nvc0_screen *screen = chan->user_private;
|
|
||||||
|
|
||||||
- nouveau_fence_update(&nvc0->screen->base, TRUE);
|
|
||||||
+ nouveau_fence_update(&screen->base, TRUE);
|
|
||||||
|
|
||||||
- nvc0_bufctx_emit_relocs(nvc0);
|
|
||||||
+ nvc0_bufctx_emit_relocs(screen->cur_ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
@@ -587,7 +587,6 @@ nvc0_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
|
||||||
nvc0_state_validate(nvc0);
|
|
||||||
|
|
||||||
chan->flush_notify = nvc0_draw_vbo_flush_notify;
|
|
||||||
- chan->user_private = nvc0;
|
|
||||||
|
|
||||||
if (nvc0->vbo_fifo) {
|
|
||||||
nvc0_push_vbo(nvc0, info);
|
|
||||||
--
|
|
||||||
cgit v0.9.0.2-2-gbebe
|
|
Loading…
Add table
Reference in a new issue