[Mesa-dev] [PATCH 1/3] nv50/ir: support different unordered_set implementations
If build with C++11 standard, use std::unordered_set. Otherwise if build on old Android version with stlport, use std::tr1::unordered_set with a wrapper class. Otherwise use std::tr1::unordered_set. Signed-off-by: Chih-Wei Huang --- Android.common.mk | 1 + src/gallium/auxiliary/Android.mk | 2 -- src/gallium/drivers/nouveau/codegen/nv50_ir.h | 15 +++-- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 4 +-- .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 4 +-- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 5 ++- .../drivers/nouveau/codegen/unordered_set.h| 37 ++ 7 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 src/gallium/drivers/nouveau/codegen/unordered_set.h diff --git a/Android.common.mk b/Android.common.mk index d662d60..de11e52 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -78,6 +78,7 @@ endif LOCAL_CPPFLAGS += \ $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \ + -std=c++11 \ -Wno-error=non-virtual-dtor \ -Wno-non-virtual-dtor diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk index 86430eb..dbaeef6 100644 --- a/src/gallium/auxiliary/Android.mk +++ b/src/gallium/auxiliary/Android.mk @@ -40,8 +40,6 @@ ifeq ($(MESA_ENABLE_LLVM),true) LOCAL_SRC_FILES += \ $(GALLIVM_SOURCES) \ $(GALLIVM_CPP_SOURCES) - -LOCAL_CPPFLAGS := -std=c++11 endif # We need libmesa_glsl to get NIR's generated include directories. diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h index 529dcb9..a060ba3 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h @@ -29,7 +29,16 @@ #include #include #include +#if __cplusplus >= 201103L +#include +using std::unordered_set; +#elif defined(ANDROID) // Android release before lollipop +#include "codegen/unordered_set.h" +using std::isfinite; +#else #include +using std::tr1::unordered_set; +#endif #include "codegen/nv50_ir_util.h" #include "codegen/nv50_ir_graph.h" @@ -583,10 +592,10 @@ public: static inline Value *get(Iterator&); - std::tr1::unordered_set uses; + unordered_set uses; std::list defs; - typedef std::tr1::unordered_set::iterator UseIterator; - typedef std::tr1::unordered_set::const_iterator UseCIterator; + typedef unordered_set::iterator UseIterator; + typedef unordered_set::const_iterator UseCIterator; typedef std::list::iterator DefIterator; typedef std::list::const_iterator DefCIterator; diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp index 7a5d1ce..eccb09c 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -224,7 +224,7 @@ NVC0LegalizePostRA::findFirstUses( const Instruction *texi, const Instruction *insn, std::list &uses, - std::tr1::unordered_set& visited) + unordered_set& visited) { for (int d = 0; insn->defExists(d); ++d) { Value *v = insn->getDef(d); @@ -323,7 +323,7 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn) if (!uses) return false; for (size_t i = 0; i < texes.size(); ++i) { - std::tr1::unordered_set visited; + unordered_set visited; findFirstUses(texes[i], texes[i], uses[i], visited); } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h index 260e101..8c3dcbc 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h @@ -20,8 +20,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include - #include "codegen/nv50_ir.h" #include "codegen/nv50_ir_build_util.h" @@ -73,7 +71,7 @@ private: inline bool insnDominatedBy(const Instruction *, const Instruction *) const; void findFirstUses(const Instruction *tex, const Instruction *def, std::list&, - std::tr1::unordered_set&); + unordered_set&); void findOverwritingDefs(const Instruction *tex, Instruction *insn, const BasicBlock *term, std::list&); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp index 898653c..219d5f1 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp @@ -25,7 +25,6 @@ #include #include -#include namespace nv50_ir { @@ -1551,7 +1550,7 @@ SpillCodeInserter::run(const std::list& lst)
[Mesa-dev] [PATCH 0/3] Updated Android patches
Most of the Android patches I submitted last time were merged. The omitted patches are updated to address the review comments I got so far. Tested OK with Android-x86 lollipop-x86 and kitkat-x86 branches. Chih-Wei Huang (3): nv50/ir: support different unordered_set implementations android: avoid building errors with stlport egl/main: expose the EGL_RECORDABLE_ANDROID extension Android.common.mk | 1 + src/egl/main/eglconfig.c | 5 ++- src/egl/main/eglconfig.h | 2 ++ src/gallium/auxiliary/Android.mk | 2 -- src/gallium/auxiliary/util/u_math.h| 2 ++ src/gallium/drivers/nouveau/codegen/nv50_ir.h | 15 +++-- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 4 +-- .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 4 +-- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 5 ++- .../drivers/nouveau/codegen/unordered_set.h| 37 ++ src/util/list.h| 2 ++ 11 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 src/gallium/drivers/nouveau/codegen/unordered_set.h -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] egl/main: expose the EGL_RECORDABLE_ANDROID extension
Signed-off-by: Chih-Wei Huang --- src/egl/main/eglconfig.c | 5 - src/egl/main/eglconfig.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index cf65c69..d9971ed 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -245,7 +245,10 @@ static const struct { /* extensions */ { EGL_Y_INVERTED_NOK,ATTRIB_TYPE_BOOLEAN, ATTRIB_CRITERION_EXACT, -EGL_DONT_CARE } +EGL_DONT_CARE }, + { EGL_RECORDABLE_ANDROID,ATTRIB_TYPE_BOOLEAN, +ATTRIB_CRITERION_EXACT, +EGL_DONT_CARE }, }; diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index 84cb227..7121b3d 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -86,6 +86,7 @@ struct _egl_config /* extensions */ EGLint YInvertedNOK; + EGLint RecordableAndroid; }; @@ -133,6 +134,7 @@ _eglOffsetOfConfig(EGLint attr) ATTRIB_MAP(EGL_CONFORMANT,Conformant); /* extensions */ ATTRIB_MAP(EGL_Y_INVERTED_NOK,YInvertedNOK); + ATTRIB_MAP(EGL_RECORDABLE_ANDROID,RecordableAndroid); #undef ATTRIB_MAP default: return -1; -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 12/15] nv50/ir: optimize the use of std::tr1::unordered_set
2015-05-21 0:10 GMT+08:00 Ilia Mirkin : >> >> If this is required for compatibility reasons with old Android systems I >> suggest you wrap it under a preprocessor conditional like: >> >> #if __cplusplus >= 201103L >> using std::unordered_set; >> #elif building-on-old-android-version-with-broken-stlport >> using my-funky-wrapper-for-std-unordered-set; >> #else >> using std::tr1::unordered_set; >> #endif > > Chih-Wei, I think this is the right way to go as well. Could you > rework your nv50/ir patches into one that does it this way? Sounds > like the "#elif funky-wrapper" bit isn't actually needed anymore > either, as you're going with a C++11-only approach? Sorry for not update in time. I'm too busy recently. Just sent the updated patch as Ilia's suggestion. Thank you for all the comments. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] android: avoid building errors with stlport
The gallium debugging helpers have defined the assert macro. It causes some errors when build with Android stlport. To workaround it, do not include assert.h if the assert macro has been defined. Signed-off-by: Chih-Wei Huang --- src/gallium/auxiliary/util/u_math.h | 2 ++ src/util/list.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 3b4040f..f075f1a 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -42,7 +42,9 @@ #include "pipe/p_compiler.h" #include "c99_math.h" +#ifndef assert #include +#endif #include #include diff --git a/src/util/list.h b/src/util/list.h index 9460347..0ba883a 100644 --- a/src/util/list.h +++ b/src/util/list.h @@ -40,7 +40,9 @@ #include #include +#ifndef assert #include +#endif struct list_head -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 08/15] egl/main: let EGL_RECORDABLE_ANDROID be a valid attrib
2015-06-09 4:17 GMT+08:00 Eric Anholt : > Chih-Wei Huang writes: >> --- >> src/egl/main/eglconfig.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h >> index 84cb227..7121b3d 100644 >> --- a/src/egl/main/eglconfig.h >> +++ b/src/egl/main/eglconfig.h >> @@ -86,6 +86,7 @@ struct _egl_config >> >> /* extensions */ >> EGLint YInvertedNOK; >> + EGLint RecordableAndroid; >> }; >> >> >> @@ -133,6 +134,7 @@ _eglOffsetOfConfig(EGLint attr) >> ATTRIB_MAP(EGL_CONFORMANT,Conformant); >> /* extensions */ >> ATTRIB_MAP(EGL_Y_INVERTED_NOK,YInvertedNOK); >> + ATTRIB_MAP(EGL_RECORDABLE_ANDROID,RecordableAndroid); >> #undef ATTRIB_MAP >> default: >>return -1; > > This should be associated with exposing the EGL_ANDROID_recordable > extension, right? Sorry for reply late. I just sent an update patch. But not sure if it's what you expect. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] nv50/ir: support different unordered_set implementations
2015-06-20 1:01 GMT+08:00 Ilia Mirkin : > Wouldn't it be simpler to just have > > codegen/unordered_set.h > > which in turn has all the odd logic? I'm definitely a tad unhappy > about adding "using" in a header, but if the using goes inside the > nv50_ir namespace, I'm less weirded out by it. And then effectively > all 3 become nv50_ir::unordered_set, instead of the current situation > with 2 ::unordered_set and 1 nv50_ir::unordered_set. Well, I think the style is suggested by Francisco. Let me make sure. Do you hope me to move all #if ... #elif ... #else logic into codegen/unordered_set.h, and keep the "using" in nv50_ir namespace only? > By the way, I'm about to add some unordered_map usage. Is this going > to explode the world for android as well? Something like Probably... Will try it once it pushed. > https://github.com/imirkin/mesa/commit/c6dc6fd6ad19f152a53c58bac93c9aadd6958ae7 > but I'm still making sure I have a full understanding of the > underlying issue, so might be a little while before I push. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 1/3] nv50/ir: support different unordered_set implementations
If build with C++11 standard, use std::unordered_set. Otherwise if build on old Android version with stlport, use std::tr1::unordered_set with a wrapper class. Otherwise use std::tr1::unordered_set. Signed-off-by: Chih-Wei Huang --- Android.common.mk | 2 +- src/gallium/drivers/nouveau/codegen/nv50_ir.h | 8 ++-- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 4 +- .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 4 +- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 5 +-- .../drivers/nouveau/codegen/unordered_set.h| 48 ++ 6 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 src/gallium/drivers/nouveau/codegen/unordered_set.h diff --git a/Android.common.mk b/Android.common.mk index d662d60..35dcda2 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -77,7 +77,7 @@ LOCAL_CFLAGS += \ endif LOCAL_CPPFLAGS += \ - $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \ + $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-std=c++11) \ -Wno-error=non-virtual-dtor \ -Wno-non-virtual-dtor diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h index 529dcb9..03cd569 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h @@ -29,8 +29,8 @@ #include #include #include -#include +#include "codegen/unordered_set.h" #include "codegen/nv50_ir_util.h" #include "codegen/nv50_ir_graph.h" @@ -583,10 +583,10 @@ public: static inline Value *get(Iterator&); - std::tr1::unordered_set uses; + unordered_set uses; std::list defs; - typedef std::tr1::unordered_set::iterator UseIterator; - typedef std::tr1::unordered_set::const_iterator UseCIterator; + typedef unordered_set::iterator UseIterator; + typedef unordered_set::const_iterator UseCIterator; typedef std::list::iterator DefIterator; typedef std::list::const_iterator DefCIterator; diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp index 7a5d1ce..eccb09c 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -224,7 +224,7 @@ NVC0LegalizePostRA::findFirstUses( const Instruction *texi, const Instruction *insn, std::list &uses, - std::tr1::unordered_set& visited) + unordered_set& visited) { for (int d = 0; insn->defExists(d); ++d) { Value *v = insn->getDef(d); @@ -323,7 +323,7 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn) if (!uses) return false; for (size_t i = 0; i < texes.size(); ++i) { - std::tr1::unordered_set visited; + unordered_set visited; findFirstUses(texes[i], texes[i], uses[i], visited); } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h index 260e101..8c3dcbc 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h @@ -20,8 +20,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include - #include "codegen/nv50_ir.h" #include "codegen/nv50_ir_build_util.h" @@ -73,7 +71,7 @@ private: inline bool insnDominatedBy(const Instruction *, const Instruction *) const; void findFirstUses(const Instruction *tex, const Instruction *def, std::list&, - std::tr1::unordered_set&); + unordered_set&); void findOverwritingDefs(const Instruction *tex, Instruction *insn, const BasicBlock *term, std::list&); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp index 898653c..219d5f1 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp @@ -25,7 +25,6 @@ #include #include -#include namespace nv50_ir { @@ -1551,7 +1550,7 @@ SpillCodeInserter::run(const std::list& lst) // Keep track of which instructions to delete later. Deleting them // inside the loop is unsafe since a single instruction may have // multiple destinations that all need to be spilled (like OP_SPLIT). - std::tr1::unordered_set to_del; + unordered_set to_del; for (Value::DefIterator d = lval->defs.begin(); d != lval->defs.end(); ++d) { @@ -1593,7 +1592,7 @@ SpillCodeInserter::run(const std::list& lst) } } - for (std::tr1::unordered_set::const_iterator it = to_del.begin(); + for (unordered_set::const_iterator it = to_del.begin();
Re: [Mesa-dev] [PATCH v2 1/3] nv50/ir: support different unordered_set implementations
2015-06-20 2:05 GMT+08:00 Ilia Mirkin : > The nouveau bits are > > Reviewed-by: Ilia Mirkin > > If someone can say something non-negative-sounding about the > Android.mk change, happy to push this out. [I assume there's some > reason why it's part of this change.] About the Android.mk change, originally I hope to use _USING_LIBCXX to distinguish building with libcxx or stlport. But now I think it's unnecessary since stlport is not c++11 compliant. So just use c++11 to distinguish the two cases. Nobody else uses _USING_LIBCXX. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 1/3] nv50/ir: support different unordered_set implementations
2015-06-20 9:04 GMT+08:00 Chih-Wei Huang : > 2015-06-20 3:12 GMT+08:00 Emil Velikov : >> Hi Chih-Wei, >> On 19 June 2015 at 19:00, Chih-Wei Huang wrote: > >>> diff --git a/Android.common.mk b/Android.common.mk >>> index d662d60..35dcda2 100644 >>> --- a/Android.common.mk >>> +++ b/Android.common.mk >>> @@ -77,7 +77,7 @@ LOCAL_CFLAGS += \ >>> endif >>> >>> LOCAL_CPPFLAGS += \ >>> - $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \ >>> + $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-std=c++11) \ >> Please expand like elsewhere in the build. Additionally this is a C++ >> only flag, so LOCAL_CPPFLAGS does not sound like the right place. >> Shame that the Android folk did not like (f'd up) the standard >> CXXFLAGS. > > Seems you misread it. > LOCAL_CPPFLAGS is the C++ only flag. > >> ifeq MESA_LOLLIPOP_BUILD... >> LOCAL_C??FLAGS += \ >> -std=c++11 >> endif > > Personally I like the compact format. > But if you prefer the style, I can update it. After re-thinking the style, I hope to keep as it is. Actually the style is already accepted in my last patch. This patch only changed the unused -D_USING_LIBCXX to more appropriate -std=c++11. I consider the $(if ) operator of makefile to be analogous to ? : operator of C/C++. I know some people dislike ? : operator, but most programmers won't reject it since it make the code more elegant. I also see the ? : operator is used in Mesa's code extensively. In short, I think the patch is good and no plan to update it. Could you merge it? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 09/11] android: dri: correctly set HAVE_LIBDRM
Emil Velikov 於 西元2015年07月09日 01:07 寫道: > Set the macro if we're not building swrast alone. > > Cc: Chih-Wei Huang > Cc: Eric Anholt > Signed-off-by: Emil Velikov > --- > src/gallium/targets/dri/Android.mk | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/src/gallium/targets/dri/Android.mk > b/src/gallium/targets/dri/Android.mk > index 5ba129b..bccc91a 100644 > --- a/src/gallium/targets/dri/Android.mk > +++ b/src/gallium/targets/dri/Android.mk > @@ -35,17 +35,15 @@ endif > > LOCAL_SRC_FILES := target.c > > -LOCAL_CFLAGS := -DDRI_TARGET -DHAVE_LIBDRM > +LOCAL_CFLAGS := -DDRI_TARGET > > LOCAL_SHARED_LIBRARIES := \ > libdl \ > libglapi \ > libexpat \ > > -# swrast only? > -ifeq ($(MESA_GPU_DRIVERS),swrast) > -LOCAL_CFLAGS += -D__NOT_HAVE_DRM_H > -else > +ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),) > +LOCAL_CFLAGS += -DHAVE_LIBDRM > LOCAL_SHARED_LIBRARIES += libdrm > endif Looks good to me. Reviewed-by: Chih-Wei Huang ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] Fix the incorrect path of sse_minmax.c
Signed-off-by: Chih-Wei Huang --- src/mesa/Android.libmesa_dricore.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/Android.libmesa_dricore.mk b/src/mesa/Android.libmesa_dricore.mk index 2e308b8..fef76c8 100644 --- a/src/mesa/Android.libmesa_dricore.mk +++ b/src/mesa/Android.libmesa_dricore.mk @@ -50,7 +50,7 @@ endif # MESA_ENABLE_ASM ifeq ($(ARCH_X86_HAVE_SSE4_1),true) LOCAL_SRC_FILES += \ main/streaming-load-memcpy.c \ - mesa/main/sse_minmax.c + main/sse_minmax.c LOCAL_CFLAGS := \ -msse4.1 \ -DUSE_SSE41 -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] android: gallium_dri: fix a linking error
Link with libmesa_dricore to get '_mesa_uint_array_min_max' from sse_minmax.c if defined USE_SSE41. Signed-off-by: Chih-Wei Huang --- src/gallium/targets/dri/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk index a33d7f8..2354323 100644 --- a/src/gallium/targets/dri/Android.mk +++ b/src/gallium/targets/dri/Android.mk @@ -106,6 +106,7 @@ LOCAL_STATIC_LIBRARIES := \ libmesa_st_mesa \ libmesa_glsl \ libmesa_dri_common \ + libmesa_dricore \ libmesa_megadriver_stub \ libmesa_gallium \ libmesa_util \ -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/3] Patches for Android 6.0
Here are some patches to fix building errors on Android 6.0 Marshmallow. Tested OK with Android-x86 marshmallow-x86 branch. Chih-Wei Huang (3): nv50/ir: use C++11 standard std::unordered_map if possible android: gallium_dri: fix a linking error nouveau: nv30: include the header of ffs prototype src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 20 +--- src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c | 1 + src/gallium/targets/dri/Android.mk | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/3] nv50/ir: use C++11 standard std::unordered_map if possible
Note Android version before Lollipop is not supported. Signed-off-by: Chih-Wei Huang --- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp index 400b9f0..7859c8e 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp @@ -25,10 +25,24 @@ #include #include +#if __cplusplus >= 201103L +#include +#else #include +#endif namespace nv50_ir { +#if __cplusplus >= 201103L +using std::hash; +using std::unordered_map; +#elif !defined(ANDROID) +using std::tr1::hash; +using std::tr1::unordered_map; +#else +#error Android release before Lollipop is not supported! +#endif + #define MAX_REGISTER_FILE_SIZE 256 class RegisterSet @@ -349,12 +363,12 @@ RegAlloc::PhiMovesPass::needNewElseBlock(BasicBlock *b, BasicBlock *p) struct PhiMapHash { size_t operator()(const std::pair& val) const { - return std::tr1::hash()(val.first) * 31 + - std::tr1::hash()(val.second); + return hash()(val.first) * 31 + + hash()(val.second); } }; -typedef std::tr1::unordered_map< +typedef unordered_map< std::pair, Value *, PhiMapHash> PhiMap; // Critical edges need to be split up so that work can be inserted along -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] nouveau: nv30: include the header of ffs prototype
It fixes a building error of the android 6.0 64-bit target. Signed-off-by: Chih-Wei Huang --- src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c index 5757eb1..dbbb8ba 100644 --- a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c +++ b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c @@ -1,3 +1,4 @@ +#include #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] nv50/ir: use C++11 standard std::unordered_map if possible
2015-10-16 0:11 GMT+08:00 Ilia Mirkin : > This patch and the nv30 one are both > > Reviewed-by: Ilia Mirkin Thank you for the review. > I guess adding a cc: stable makes sense for these too? Or are further > fixes required that would make building 11.0.x impractical? Ah, yes. They apply to 11.0.x as well. Thank you for reminding. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] android: avoid using libdrm with host modules
2016-11-02 23:42 GMT+08:00 Emil Velikov : > > Skimming through the outstanding patches for yours [1] I've tagged > some [2] as superseded since the functionality has already landed. Let > me know the status of the rest when you've got the chance. Sorry I forgot to reply. > [1] https://patchwork.freedesktop.org/project/mesa/patches/?submitter=15395 > > [2] > https://patchwork.freedesktop.org/patch/52321/ > https://patchwork.freedesktop.org/patch/52323/ > https://patchwork.freedesktop.org/patch/52337/ Yes, they are superseded and unnecessary. > https://patchwork.freedesktop.org/patch/61946/ Not sure about this now. I guess it's also unnecessary. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Revert "mesa_glinterop: remove inclusion of GLX header"
2016-10-04 7:03 GMT+08:00 Vinson Lee : > This reverts commit 8472045b16b3e4621553fe451a20a9ba9f0d44b6. > > Conflicts: > > include/GL/mesa_glinterop.h > > This patch fixes this build error with GCC 4.4. > > Compiling src/glx/dri_common_interop.c ... > In file included from src/glx/dri_common_interop.c:33: > include/GL/mesa_glinterop.h:62: error: redefinition of typedef ‘GLXContext’ > include/GL/glx.h:165: note: previous declaration of ‘GLXContext’ was here > > Fixes: 8472045b16b3 ("mesa_glinterop: remove inclusion of GLX header") > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96770 > Signed-off-by: Vinson Lee > --- > include/GL/mesa_glinterop.h |5 + > 1 files changed, 1 insertions(+), 4 deletions(-) > > diff --git a/include/GL/mesa_glinterop.h b/include/GL/mesa_glinterop.h > index 383d7f9..c6a967e 100644 > --- a/include/GL/mesa_glinterop.h > +++ b/include/GL/mesa_glinterop.h > @@ -52,15 +52,12 @@ > > #include > #include > +#include > > #ifdef __cplusplus > extern "C" { > #endif > > -/* Forward declarations to avoid inclusion of GL/glx.h */ > -typedef struct _XDisplay Display; > -typedef struct __GLXcontextRec *GLXContext; > - > /* Forward declarations to avoid inclusion of EGL/egl.h */ > typedef void *EGLDisplay; > typedef void *EGLContext; > -- NACK. The patch breaks Android build (at least). ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa_glinterop: allow building without X and related headers
2016-10-13 1:49 GMT+08:00 Emil Velikov : > This commit effectively reverts c10dcb2ce837922c6ee4e191e6d6202098a5ee10 > and fixes the typedef redefinition which inspired it. > > In order to prevent requiring X packages at build time earlier commit > forward declared the required X/GLX typedefs. Since that approach > introduced typedef redefinition (a C11 feature) it was reverted. > > To avoid the redefinition while _not_ mandating X and related headers > forward declare the structs and use those through the header. > > As anyone uses the mesa interop header they ensure that the X (or others > in terms of EGL) headers are included, which ensures that everything is > resolved within the compilation unit. > > Cc: Vinson Lee > Cc: "12.0" > Cc: Tapani Pälli > Cc: Chih-Wei Huang > Fixes: c10dcb2ce837 ("Revert "mesa_glinterop: remove inclusion of GLX > header"") > Fixes: 8472045b16b3 ("mesa_glinterop: remove inclusion of GLX header") > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96770 > Signed-off-by: Emil Velikov > --- > TL;DR; Yay typedefs, because they make things so much better ;-) > > Tapani/Chih-Wei, this should fix the breakage that you are seing. Please > let me know if it sorts things on your end. > > Vison, this should resolve things on your end as well. A confirmation > would be great. > --- > include/GL/mesa_glinterop.h | 13 - > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/include/GL/mesa_glinterop.h b/include/GL/mesa_glinterop.h > index c6a967e..173476a 100644 > --- a/include/GL/mesa_glinterop.h > +++ b/include/GL/mesa_glinterop.h > @@ -52,12 +52,15 @@ > > #include > #include > -#include > > #ifdef __cplusplus > extern "C" { > #endif > > +/* Forward declarations to avoid inclusion of GL/glx.h */ > +struct _XDisplay; > +struct __GLXcontextRec; > + > /* Forward declarations to avoid inclusion of EGL/egl.h */ > typedef void *EGLDisplay; > typedef void *EGLContext; > @@ -243,7 +246,7 @@ struct mesa_glinterop_export_out { > * \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error > */ > int > -MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context, > +MesaGLInteropGLXQueryDeviceInfo(struct _XDisplay *dpy, struct > __GLXcontextRec *context, > struct mesa_glinterop_device_info *out); > > > @@ -268,7 +271,7 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, > EGLContext context, > * \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error > */ > int > -MesaGLInteropGLXExportObject(Display *dpy, GLXContext context, > +MesaGLInteropGLXExportObject(struct _XDisplay *dpy, struct __GLXcontextRec > *context, > struct mesa_glinterop_export_in *in, > struct mesa_glinterop_export_out *out); > > @@ -283,11 +286,11 @@ MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext > context, > struct mesa_glinterop_export_out *out); > > > -typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(Display *dpy, > GLXContext context, > +typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(struct _XDisplay *dpy, > struct __GLXcontextRec *context, > struct > mesa_glinterop_device_info *out); > typedef int (PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, > EGLContext context, > struct > mesa_glinterop_device_info *out); > -typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(Display *dpy, GLXContext > context, > +typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(struct _XDisplay *dpy, > struct __GLXcontextRec *context, >struct > mesa_glinterop_export_in *in, >struct > mesa_glinterop_export_out *out); > typedef int (PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, EGLContext > context, > -- > 2.10.0 > Build OK on Android 7.0. Thanks! BTW, the typedef EGLDisplay and EGLContext has similar redefinition issues. Should we fix them in the same way? [ 95% 667/699] target C: libGLES_mesa <= external/mesa/src/egl/drivers/dri2/egl_dri2.c In file included from external/mesa/src/egl/drivers/dri2/egl_dri2.c:58: In file included from external/mesa/src/egl/drivers/dri2/egl_dri2.h:73: In file included from external/mesa/src/egl/main/eglconfig.h:39: In file included from external/mesa/src/egl/main/egltypedefs.h:34: external/mesa/include/EGL/egl.h:55:15: warning: redefinition of typedef 'EGLDisplay' is a C11 feature [-Wtyp
Re: [Mesa-dev] [PATCH] android: fix a build issue with libmesa_st_mesa_32
2016-08-29 16:52 GMT+08:00 Tapani Pälli : > make sure nir_opcodes.h is in LOCAL_GENERATED_SOURCES otherwise > build fails with: > > "In file included from > external/mesa/src/mesa/state_tracker/st_glsl_to_nir.cpp:44: > external/mesa/src/compiler/nir/nir.h:42:10: fatal error: 'nir_opcodes.h' file > not found" Could you explain how to reproduce this error? Someone also reported a similar error to us recently. However, from my debugging I can't see how it happens. Any file which includes nir_opcodes.h should get this dependency from its .P file: $OUT/obj/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/state_tracker/st_glsl_to_nir.P $OUT/obj_x86/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/state_tracker/st_glsl_to_nir.P cwhuang@icm05:~/git/marshmallow-x86$ grep nir_opcodes.h $OUT/obj/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/state_tracker/st_glsl_to_nir.P out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_nir_intermediates/nir/nir_opcodes.h \ out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_nir_intermediates/nir/nir_opcodes.h : cwhuang@icm05:~/git/marshmallow-x86$ grep nir_opcodes.h $OUT/obj_x86/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/state_tracker/st_glsl_to_nir.P out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_nir_intermediates/nir/nir_opcodes.h \ out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_nir_intermediates/nir/nir_opcodes.h : So I can't reproduce this issue. Please refer to the discussion: https://groups.google.com/d/msg/android-x86/EwCIlPer1i8/M439AaULCQAJ > Signed-off-by: Tapani Pälli > --- > src/mesa/Android.libmesa_st_mesa.mk | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/mesa/Android.libmesa_st_mesa.mk > b/src/mesa/Android.libmesa_st_mesa.mk > index 785b6de..e70f51e 100644 > --- a/src/mesa/Android.libmesa_st_mesa.mk > +++ b/src/mesa/Android.libmesa_st_mesa.mk > @@ -63,6 +63,8 @@ LOCAL_C_INCLUDES := \ > LOCAL_WHOLE_STATIC_LIBRARIES += \ > libmesa_program > > +LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H) > + > LOCAL_STATIC_LIBRARIES += libmesa_nir > > include $(LOCAL_PATH)/Android.gen.mk > -- -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] android: avoid using libdrm with host modules
Note LOCAL_CFLAGS and LOCAL_SHARED_LIBRARIES in Android.common.mk are used by both host and target modules. However, commit 112e988 moved libdrm related flags to common. It causes the errors like: error: 'out/host/linux-x86/obj32/SHARED_LIBRARIES/libdrm_intermediates/export_includes', needed by 'out/host/linux-x86/obj32/EXECUTABLES/mesa_gen_matypes_intermediates/import_includes', missing and no known rule to make it No reason to use libdrm with host modules. Signed-off-by: Chih-Wei Huang --- Android.common.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Android.common.mk b/Android.common.mk index dee22da..9f64c22 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -82,11 +82,13 @@ LOCAL_CFLAGS += \ -D__STDC_LIMIT_MACROS endif +ifneq ($(LOCAL_IS_HOST_MODULE),true) # add libdrm if there are hardware drivers ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),) LOCAL_CFLAGS += -DHAVE_LIBDRM LOCAL_SHARED_LIBRARIES += libdrm endif +endif LOCAL_CPPFLAGS += \ $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \ -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [RFC] mesa: drop current draw/read buffer when ctx is released
2016-10-28 22:09 GMT+08:00 Rob Herring : > +Mauro, Chih-Wei > > On Fri, Oct 28, 2016 at 7:22 AM, Rob Clark wrote: >> On Fri, Oct 28, 2016 at 1:24 AM, Tapani Pälli wrote: >>> On 10/27/2016 01:48 PM, Rob Clark wrote: On Thu, Oct 27, 2016 at 2:59 AM, Tapani Pälli wrote: > > On 10/27/2016 12:16 AM, Rob Clark wrote: >> >> So, not quite sure if this is the *correct* solution, but it is at least >> *a* solution to a problem with android wallpaper vs mesa that I've been >> debugging. Basically, what happens is: > > > Could you tell more how to trigger this, is this with some particular > live > wallpaper and has this been working before (regression)? For me at least > these default wallpapers have been working ok. Actually, it is the default static wallpaper that is problematic. And IIRC, it has never worked, at least not with any of the gallium drivers (freedreno, virgl, vc4, etc). Live-wallpaper did work, but does not appear to exist in AOSP builds anymore. If this works with i965 on android, I'd be curious how. Or if you're android build had some mesa patches that are not upstream? >>> >>> >>> I can confirm that default wallpaper is working on i965. Our Mesa tree >>> currently looks like this: >>> >>> https://github.com/android-ia/external-mesa >>> >>> It's now quite a bit behind though because we were dealing with some >>> non-graphics issues and are planning to rebase soon. >> >> I suppose it is possible that it is triggered by something different >> that mesa/st does vs dri/i965? Although I find it odd that >> dri2_make_current() would drop the reference to the EGLSurface when >> unbinding ctx, but _mesa_make_current() would not drop the reference >> to the corresponding gl_framebuffer. >> >> Maybe the classic driver is holding an extra reference to the >> EGLSurface so the _eglPutSurface() call in dri2_make_current() does >> not actually drop the last refcnt? Which would ensure when the window >> surface is created it ends up with a different address.. >> >> but, I wonder if you could try w/ Rob Herring's tree.. this is what we >> are using for the upstream kernel + AOSP builds[1]: >> >> https://github.com/robherring/mesa/commits/android-m >> >> I guess in theory we should both need the same patches on top of >> mesa.. although also I guess we should also just try to get to the >> point where we can both use upstream mesa tree directly. > > Looks like we have some similar patches for gralloc headers and using > render node (since I picked up Tomasz's patches). > >> [1] see: >> https://github.com/robherring/generic_device/wiki/KConfig-based-Multi-platform-Android-Device-(and-Mesa-graphics) >> >> Btw, I guess in theory the qemu/x86 build from rob's generic_device >> stuff should also work on real hw, so I think we should be able to >> test exact same build that is failing with gallium/virgl with i965. >> But I don't have any real hw for that. > > Mauro or Chih-Wei should be able to answer this (being do static > wallpapers work in i965?). Yes, it works i i965. But it does break on some gallium drivers sometimes. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] android: anv: fix generated files depedencies
Mauro Rossi 於 2019年3月4日 週一 上午3:58寫道: > > Fix anv_extrypoints.{c,h} and anv_extensions.{c,h} missing dependencies > Rename the variable labels according to targets and python scripts > Align the building rules as per Automake for simplification > > Fixes building errors during rebuils due to missing dependencies > > Fixes: 9a508b7 ("android: anv/extensions: fix generated sources build") > Fixes: dd088d4bec7 ("anv/extensions: Generate a header file with extension > tables") > Signed-off-by: Mauro Rossi > Cc: "19.0" > --- > src/intel/Android.vulkan.mk | 38 +++-- > 1 file changed, 24 insertions(+), 14 deletions(-) > > diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk > index 04c9d5b3e4..2e99ac6294 100644 > --- a/src/intel/Android.vulkan.mk > +++ b/src/intel/Android.vulkan.mk > @@ -23,9 +23,10 @@ LOCAL_PATH := $(call my-dir) > include $(CLEAR_VARS) > include $(LOCAL_PATH)/Makefile.sources > > -VK_ENTRYPOINTS_SCRIPT := $(MESA_PYTHON2) > $(LOCAL_PATH)/vulkan/anv_entrypoints_gen.py > - > -VK_EXTENSIONS_SCRIPT := $(MESA_PYTHON2) > $(LOCAL_PATH)/vulkan/anv_extensions_gen.py > +ANV_ENTRYPOINTS_GEN_SCRIPT := $(LOCAL_PATH)/vulkan/anv_entrypoints_gen.py > +ANV_EXTENSIONS_GEN_SCRIPT := $(LOCAL_PATH)/vulkan/anv_extensions_gen.py > +ANV_EXTENSIONS_SCRIPT := $(LOCAL_PATH)/vulkan/anv_extensions.py > +VULKAN_API_XML := $(MESA_TOP)/src/vulkan/registry/vk.xml > > VULKAN_COMMON_INCLUDES := \ > $(MESA_TOP)/include \ > @@ -64,10 +65,13 @@ $(intermediates)/vulkan/dummy.c: > @echo "Gen Dummy: $(PRIVATE_MODULE) <= $(notdir $(@))" > $(hide) touch $@ > > -$(intermediates)/vulkan/anv_entrypoints.h: $(intermediates)/vulkan/dummy.c > - $(VK_ENTRYPOINTS_SCRIPT) \ > +$(intermediates)/vulkan/anv_entrypoints.h: $(intermediates)/vulkan/dummy.c \ I know it was not introduced in this patch. However, it makes no sense to let the header depend on a generated empty file. This should be removed. > + $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ > + $(ANV_EXTENSIONS_SCRIPT) \ > + $(VULKAN_API_XML) > + $(MESA_PYTHON2) $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ > --outdir $(dir $@) \ > - --xml $(MESA_TOP)/src/vulkan/registry/vk.xml > + --xml $(VULKAN_API_XML) > > LOCAL_EXPORT_C_INCLUDE_DIRS := \ > $(intermediates) > @@ -241,22 +245,28 @@ LOCAL_GENERATED_SOURCES += > $(intermediates)/vulkan/anv_entrypoints.c > LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_extensions.c > LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_extensions.h > > -$(intermediates)/vulkan/anv_entrypoints.c: > +$(intermediates)/vulkan/anv_entrypoints.c: $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ > + $(ANV_EXTENSIONS_SCRIPT) \ > + $(VULKAN_API_XML) > @mkdir -p $(dir $@) > - $(VK_ENTRYPOINTS_SCRIPT) \ > + $(MESA_PYTHON2) $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ > --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \ > --outdir $(dir $@) > > -$(intermediates)/vulkan/anv_extensions.c: > +$(intermediates)/vulkan/anv_extensions.c: $(ANV_EXTENSIONS_GEN_SCRIPT) \ > + $(ANV_EXTENSIONS_SCRIPT) \ > + $(VULKAN_API_XML) > @mkdir -p $(dir $@) > - $(VK_EXTENSIONS_SCRIPT) \ > - --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \ > + $(MESA_PYTHON2) $(ANV_EXTENSIONS_GEN_SCRIPT) \ > + --xml $(VULKAN_API_XML) \ > --out-c $@ > > -$(intermediates)/vulkan/anv_extensions.h: > +$(intermediates)/vulkan/anv_extensions.h: $(ANV_EXTENSIONS_GEN_SCRIPT) \ > + $(ANV_EXTENSIONS_SCRIPT) \ > + $(VULKAN_API_XML) > @mkdir -p $(dir $@) > - $(VK_EXTENSIONS_SCRIPT) \ > - --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \ > + $(MESA_PYTHON2) $(ANV_EXTENSIONS_GEN_SCRIPT) \ > + --xml $(VULKAN_API_XML) \ > --out-h $@ > > LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) > -- -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] android: anv: fix generated files depedencies
Tapani Pälli 於 2019年3月5日 週二 下午4:48寫道: > > On 3/5/19 9:26 AM, Chih-Wei Huang wrote: > > Mauro Rossi 於 2019年3月4日 週一 上午3:58寫道: > >> > >> Fix anv_extrypoints.{c,h} and anv_extensions.{c,h} missing dependencies > >> Rename the variable labels according to targets and python scripts > >> Align the building rules as per Automake for simplification > >> > >> Fixes building errors during rebuils due to missing dependencies > >> > >> Fixes: 9a508b7 ("android: anv/extensions: fix generated sources build") > >> Fixes: dd088d4bec7 ("anv/extensions: Generate a header file with extension > >> tables") > >> Signed-off-by: Mauro Rossi > >> Cc: "19.0" > >> --- > >> src/intel/Android.vulkan.mk | 38 +++-- > >> 1 file changed, 24 insertions(+), 14 deletions(-) > >> > >> diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk > >> index 04c9d5b3e4..2e99ac6294 100644 > >> --- a/src/intel/Android.vulkan.mk > >> +++ b/src/intel/Android.vulkan.mk > >> @@ -23,9 +23,10 @@ LOCAL_PATH := $(call my-dir) > >> include $(CLEAR_VARS) > >> include $(LOCAL_PATH)/Makefile.sources > >> > >> -VK_ENTRYPOINTS_SCRIPT := $(MESA_PYTHON2) > >> $(LOCAL_PATH)/vulkan/anv_entrypoints_gen.py > >> - > >> -VK_EXTENSIONS_SCRIPT := $(MESA_PYTHON2) > >> $(LOCAL_PATH)/vulkan/anv_extensions_gen.py > >> +ANV_ENTRYPOINTS_GEN_SCRIPT := $(LOCAL_PATH)/vulkan/anv_entrypoints_gen.py > >> +ANV_EXTENSIONS_GEN_SCRIPT := $(LOCAL_PATH)/vulkan/anv_extensions_gen.py > >> +ANV_EXTENSIONS_SCRIPT := $(LOCAL_PATH)/vulkan/anv_extensions.py > >> +VULKAN_API_XML := $(MESA_TOP)/src/vulkan/registry/vk.xml > >> > >> VULKAN_COMMON_INCLUDES := \ > >> $(MESA_TOP)/include \ > >> @@ -64,10 +65,13 @@ $(intermediates)/vulkan/dummy.c: > >> @echo "Gen Dummy: $(PRIVATE_MODULE) <= $(notdir $(@))" > >> $(hide) touch $@ > >> > >> -$(intermediates)/vulkan/anv_entrypoints.h: $(intermediates)/vulkan/dummy.c > >> - $(VK_ENTRYPOINTS_SCRIPT) \ > >> +$(intermediates)/vulkan/anv_entrypoints.h: > >> $(intermediates)/vulkan/dummy.c \ > > > > I know it was not introduced in this patch. > > However, it makes no sense to let the header depend on a generated empty > > file. > > This should be removed. > > dummy.c is there to meet the Android build system's rules .. comment in > this file says: I understand that. I meant the header anv_entrypoints.h doesn't need to depend on the generated dummy.c. That's clear. > # libmesa_anv_entrypoints with header and dummy.c > # > # This static library is built to pull entrypoints header > # for multiple gen specific build targets below. The c file > # is generated separately for libmesa_vulkan_common to avoid > # duplicate symbols when linking the anv libraries. > > we have same hack applied also in following files within Mesa tree: > > src/mesa/Android.libmesa_git_sha1.mk > src/intel/Android.genxml.mk > src/broadcom/Android.genxml.mk > > > >> + $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ > >> + $(ANV_EXTENSIONS_SCRIPT) \ > >> + $(VULKAN_API_XML) > >> + $(MESA_PYTHON2) $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ > >> --outdir $(dir $@) \ > >> - --xml $(MESA_TOP)/src/vulkan/registry/vk.xml > >> + --xml $(VULKAN_API_XML) > >> > >> LOCAL_EXPORT_C_INCLUDE_DIRS := \ > >> $(intermediates) > >> @@ -241,22 +245,28 @@ LOCAL_GENERATED_SOURCES += > >> $(intermediates)/vulkan/anv_entrypoints.c > >> LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_extensions.c > >> LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_extensions.h > >> > >> -$(intermediates)/vulkan/anv_entrypoints.c: > >> +$(intermediates)/vulkan/anv_entrypoints.c: $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ > >> + $(ANV_EXTENSIONS_SCRIPT) \ > >> + $(VULKAN_API_XML) > >> @mkdir -p $(dir $@) > >> - $(VK_ENTRYPOINTS_SCRIPT) \ > >> + $(MESA_PYTHON2) $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ > >> --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \ > >> --outdir $(
Re: [Mesa-dev] Pending issues of lollipop-x86
CC to mesa-dev for help. 2015-09-25 22:12 GMT+08:00 Chih-Wei Huang : > 2015-09-25 16:21 GMT+08:00 Chih-Wei Huang : >> Actually I'm testing your mesa 11.0 branch >> to see if it is acceptable. >> The major issue I found is the >> Camera and Youtube crashing in mesa. > > OK, I can almost confirm this is a known issue > I reported to mesa devs before. > It is caused by this commit: > > commit c636284ee8ee95bb3f3ad31aaf26a9512ec5006c > Author: Chad Versace > Date: Tue May 5 19:05:32 2015 -0700 > > i965/sync: Implement DRI2_Fence extension > > By reverting it the crashing is gone. > > However, I still hope we can find > a correct fix. After some debugging, it crashed in dri2_client_wait_sync() of ...src/egl/drivers/dri2/egl_dri2.c The ctx returned by _eglGetCurrentContext() is NULL. static EGLint dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, EGLint flags, EGLTime timeout) { _EGLContext *ctx = _eglGetCurrentContext(); ==> ctx is NULL if (dri2_dpy->fence->client_wait_sync(dri2_ctx->dri_context, <== OOPS! dri2_sync->fence, wait_flags, timeout)) Why does _eglGetCurrentContext() return NULL? Any recommended fix? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965: store reference to the context within struct brw_fence
a 2015-09-30 5:36 GMT+08:00 Chad Versace : > On Mon 28 Sep 2015, Marek Olšák wrote: >> On Mon, Sep 28, 2015 at 1:29 PM, Emil Velikov >> wrote: >> > As the spec allows for {server,client}_wait_sync to be called without >> > currently bound context, while our implementation requires context >> > pointer. >> > >> > UNTESTED. >> > >> > Cc: Chad Versace >> > Cc: Marek Olšák >> > Cc: Chih-Wei Huang >> > Cc: Mauro Rossi >> > Cc: 10.6 11.0 >> > Signed-off-by: Emil Velikov >> > --- >> > >> > Upon second thought I'm leaning that we should move this to the API >> > specific library (i.e. libEGL) rather than keeping it here. It will give >> > us remove API specific from the DRI extension, plus it'll give us better >> > mix'n'match (loader+dri module) compatibility. >> > >> > How do you guys feel on the topic ? >> >> I don't think there is anything to move into libEGL. st/dri doesn't >> add a context pointer to the fence, instead it adds a screen pointer, >> which is a different thing. > > I agree with Mark here. Even if there was something you could move into > libEGL, I don't it could be done safely. It needs to remain in the > driver. > >> This i965 fix is probably not thread-safe, because eglClientWaitSync >> can be called from another thread and contexts typically contain no >> locks. > > Emil, the fix is not thread-safe because drm_intel_gem_bo_wait() mutates > the bo. Thread-safety matters because some Chromium Ozone code that's > cooking does call eglCreateSync and eglClientWaitSync from different > threads. > > If you add a mutex to struct brw_fence, and lock it for the duration of > brw_fence_client_wait() and brw_fence_is_completed(), then I think > that's sufficient for ensuring thread-safety. Any update? I can confirm the patch (+ 2 Marek's patches) fix the crashing in android-x86. But I don't know whether if the thread-safe issue affect us. Since I'm going to release lollipop-x86 soon and the camera crashing is a must fix bug. I'll just apply the patch to the lollipop-x86 if no further update in 1-2 day(s). -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] android: enable building static version of libdrm
Rob Herring 於 西元2016年01月14日 00:20 寫道: From: Sumit Semwal Android needs libdrm built statically for recovery; enable that as well. Signed-off-by: Sumit Semwal Signed-off-by: Rob Herring Cc: Chih-Wei Huang Cc: Emil Velikov --- Android.mk | 19 +++ 1 file changed, 19 insertions(+) diff --git a/Android.mk b/Android.mk index 90cdcb3..1d8cd65 100644 --- a/Android.mk +++ b/Android.mk @@ -27,6 +27,8 @@ include $(CLEAR_VARS) # Import variables LIBDRM_{,H_,INCLUDE_H_,INCLUDE_VMWGFX_H_}FILES include $(LOCAL_PATH)/Makefile.sources +#static library for the device (recovery) +include $(CLEAR_VARS) LOCAL_MODULE := libdrm LOCAL_MODULE_TAGS := optional @@ -41,7 +43,24 @@ LOCAL_C_INCLUDES := \ LOCAL_CFLAGS := \ -DHAVE_VISIBILITY=1 \ -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 +include $(BUILD_STATIC_LIBRARY) + +# Shared library for the device +include $(CLEAR_VARS) +LOCAL_MODULE := libdrm +LOCAL_MODULE_TAGS := optional +LOCAL_SRC_FILES := $(LIBDRM_FILES) +LOCAL_EXPORT_C_INCLUDE_DIRS := \ +$(LOCAL_PATH) \ +$(LOCAL_PATH)/include/drm + +LOCAL_C_INCLUDES := \ +$(LOCAL_PATH)/include/drm + +LOCAL_CFLAGS := \ +-DHAVE_VISIBILITY=1 \ +-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 include $(BUILD_SHARED_LIBRARY) include $(call all-makefiles-under,$(LOCAL_PATH)) Looks good to me. We have applied an equivalent patch to our marshmallow-x86 porting. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] Android DRM/Mesa porting (Was: need-help: how to change to newest mesa in android-x86?)
(Rename the subject to address the topic properly) First of all, I'm glad to invite more experts to join the devel group, including Rob Herring (kernel developer), Emil Velikov (Mesa maintainer), Rob Clark (Mesa developer), and Sean Paul (main drm_hwcomposer author) I also recall we have Chia-I Wu (olv), the original drm_gralloc author in the list. Thanks to Sean who just opened the latest drm_hwcomposer to public: https://chromium.googlesource.com/chromiumos/drm_hwcomposer Contributing instructions: https://sites.google.com/a/chromium.org/dev/contributing-to-drm_hwcomposer Quoted from Rob Herring's email: " ... my goal here is to try to unify Android DRM support and the various implementations of gralloc and hwc. It's necessary in order to get any Android specific features in DRM upstream. I'm looking at other HALs too, and trying to unify them and address any gaps in upstream kernel interfaces. I'm also looking at device configuration and how to improve that. That seems to be something that android-x86 gets right in supporting multiple platforms in a single build with run-time configuration..." Great! Let's make it. 2016-01-16 5:30 GMT+08:00 Rob Herring : > On Fri, Jan 15, 2016 at 3:10 PM, Dave Airlie wrote: >>> >>> well, nothing specific, but for example early on we had some confusion >>> in drm_gralloc (when adding dmabuf fd support) about who close()d the >>> fd's. Resulting in same fd getting closed twice (although some >>> completely unrelated file handle might have snuck into that slot >>> between the two close()s). >>> >>> Or you could end up w/ the same sort of thing for gem handles (which >>> are unique to the drm device fd, so if you open() the device multiple >>> times..). I did initially have some confusion about this, w/ multiple >>> fd_bo's (or pipe_resource's) being created for a given gem handle, and >>> first one that gets deleted takes away the backing store that both >>> userspace references where using. >>> >>> You might want to look at freedreno_drm_winsys.c and the crazy things >>> it does.. I suspect virgl might need similar hacks. That is really >>> one part of two, that ensures that we share the same pipe_screen, and >>> therefore (from libdrm) fd_device, for a given drm device fd. The >>> other part is that fd_device has hashtables to deal w/ double import >>> of gem buffers. >> >> I think Rob Clark might be on the right track here. >> >> it sounds like the host is sending double deletes for some objects, which >> sounds like a possible reference counting bug in the host. >> >> So possibly something drm_gralloc, but it could be a bug in mesa, though >> I haven't triggered anything like this yet. > > Okay, I'll start digging there. > >> >> I'd be more willing to look at this if/when there is an easy to >> produce android-x86 >> image that I could just drop newer mesa/drm_gralloc into, I suppose I could >> look >> at ARM images, but I'm not really setup for cross dev, and I've a few >> other things to >> be doing. > > I've got a minimal build that is recent mesa and 4.4 kernel (only a > couple of patches on top of each) and runs in a VM (or arm64). It is > as easy as it gets with Android and rebuilding the world, but that's > not saying too much. Instructions are here[1]. > > Rob > > [1] > https://github.com/robherring/generic_device/wiki/Android-with-DRM-mesa-graphics -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] About drm_hwcomposer (Was Re: About the PixelFormat mappings in drm_gralloc)
CC to the android-x86 devel list so more developers can follow. 2016-01-21 6:19 GMT+08:00 Rob Clark : > On Wed, Jan 20, 2016 at 4:59 PM, Rob Herring wrote: >> Hi Sean, >> >> On Thu, Jan 14, 2016 at 1:15 PM, Sean Paul wrote: >>> >>> >>> On Thu, Jan 14, 2016 at 9:47 AM, Chih-Wei Huang >>> wrote: >>>> >>>> Hello Sean, >>>> My last try of drm_hwcomposer failed due to >>>> my limited time and knowledge. >>>> >>>> Fortunately more developers join us >>>> to work on this topic now, including >>>> Rob Herring (kernel drm developer), >>>> Rob Clark and Emil Velikov (Mesa developers) >>>> We are working on drm_hwcomposer >>>> for virtio-gpu, the emulated GPU for QEMU. >>>> >>>> If you don't mind, I would invite you to join >>>> our devel group for the discussion. >>> >>> >>> [adding Emil, Rob, and Rob] >>> >>> Hi, >>> Ok, I've signed up for the android-x86 list. I don't anticipate seeing all >>> posts, so please cc me on threads needing feedback. >>> >>> We also just today open-sourced drm_hwcomposer on the chromium gerrit >>> instance, such that we'll be doing all of our development in the open on >>> that repo. >>> >>> The repo is here: >>> https://chromium.googlesource.com/chromiumos/drm_hwcomposer >>> >>> Contributing instructions are here: >>> https://sites.google.com/a/chromium.org/dev/contributing-to-drm_hwcomposer >> >> Thanks for the pointer. This is essentially what I'm based on. >> >> Is there a testing target we need to use for submitting patches? Pixel >> C? The first problem is the use of the pre mainline atomic functions, Dear Sean, I echo Rob's words. We planned to use kernel 4.4 and libdrm 2.4.66+ for marshmallow-x86. Do you have an updated drm_gralloc that can work with libdrm 2.4.66+? Or do you hope me to submit a patch for it? >> so using mainline kernel and libdrm are a problem. What is your plan >> to handle that? >> It also no longer works with the drm_gralloc in AOSP due to missing >> GRALLOC_MODULE_PERFORM_GET_USAGE support, so is there any plan to also >> host drm_gralloc? > > Just my own $0.02, but I would really like to move drm_gralloc into > mesa.. or at least the gallium pipe-driver part. > > Having gralloc essentially being a sort of state-tracker is great for > a lot of reasons.. ie. don't have to add new gralloc specific code for > new drivers like freedreno/vc4/etnaviv, and also by sharing a common > pipe_screen we can avoid some refcnt'ing / handle lifecycle issues. > > But that also means using API's which aren't really intended to be > exposed outside of mesa. Ie. gallium is not intended to be consumed > as a stable API from external state trackers. > > I know that chromium had started adding support for some other > non-mesa drivers. I'm not sure how best to handle that. Maybe what > makes most sense is to just copy/paste some code into mesa, and leave > external drm_gralloc just for blob drivers.. > > (I was kinda hoping Emil would someday tackle moving the code into > mesa, since whenever I mess with mesa build system I make a mess of > things :-P) > > BR, > -R > >> Anything you can share about planned changes/features you are working >> on so we can better coordinate work Linaro is doing here. >> >> Rob -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe
2016-03-31 0:09 GMT+08:00 Rob Herring : > On Tue, Mar 29, 2016 at 2:49 PM, Jaap Jan Meijer wrote: >> >> First of all, thanks for the hard work! >> >> Only one problem I noticed so far: when enabling virgl in drm_gralloc but >> without support in MESA, MESA / drm_gralloc (?) will just crash during >> initialization. I don't think it's that important but when I'm only using >> i915 it shouldn't really need to crash because of this? > > The only thing I can see is if load_pipe_screen is NULL, but > gallium_dri.so is present. Not completely sure if that is possible, > but I've pushed a fix to check load_pipe_screen to my android-m > branch. Thanks for the fix. I'll apply it. But Jaap uses i915 which is a classical driver. I doubt if it's related to the gallium_dri.so. Jaap, did you use a 64-bit kernel to test? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe
2016-04-01 2:40 GMT+08:00 Jaap Jan Meijer : > Op donderdag 31 maart 2016 13:02:36 UTC+2 schreef Chih-Wei Huang: > Thanks for the patch, I tested it on both x86 and x64 kernels and it doesn't > crash anymore, previously it did on both. > >> Thanks for the fix. I'll apply it. >> But Jaap uses i915 which is a classical driver. >> I doubt if it's related to the gallium_dri.so. >> >> Jaap, did you use a 64-bit kernel to test? > > You are right but because of the driver selection strategy chosen in > gralloc_drm.c it will always first try the pipe driver whenever it is > enabled. As I've said I didn't encounter the crashing so I don't think it's an issue. If you didn't enable any pipe driver, it won't try to call gralloc_drm_drv_create_for_pipe (ENABLE_PIPE is not set). If you enabled a pipe driver, load_pipe_screen should exist and it won't crash. I suspect you changed BOARD_GPU_DRIVERS but didn't rebuild both drm_gralloc and mesa properly so the GPU configuration mismatched. This is considered a flaw of the makefiles however it's not easy to be fixed. As a rule of thumb, if you changed BOARD_GPU_DRIVERS, you should clean both drm_gralloc and mesa object files manually to ensure they are rebuilt properly. Anyway, I agree Robh's patch is a safe guard to avoid some possible issues. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe
2016-04-02 4:42 GMT+08:00 Rob Herring : > > Here's an initial gralloc implementation based on my GBM map/unmap support: > > https://github.com/robherring/gbm_gralloc > > It's based on drm_gralloc, but heavily re-written to collapse some > unnecessary layers. Thank you for it. What GPU have you tested with it? Since it doesn't implement the GRALLOC_HARDWARE_FB0 case in gbm_mod_open, I guess it still needs the drm_hwcomposer. Right? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe
2016-04-04 0:53 GMT+08:00 Chih-Wei Huang : > 2016-04-02 4:42 GMT+08:00 Rob Herring : >> >> Here's an initial gralloc implementation based on my GBM map/unmap support: >> >> https://github.com/robherring/gbm_gralloc >> >> It's based on drm_gralloc, but heavily re-written to collapse some >> unnecessary layers. It required a shared library libgbm. So I guess we have to add an Android.mk for libgbm in mesa? Do you already have a patch? Besides, the module name is still gralloc.drm. How about call it gralloc.gbm? That means it can coexist with the current gralloc.drm module so the transition to it will be easier. Agree? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe
2016-04-04 6:25 GMT+08:00 Rob Herring : > On Sun, Apr 3, 2016 at 12:29 PM, Chih-Wei Huang > wrote: >> Besides, the module name is still gralloc.drm. >> How about call it gralloc.gbm? > > Eventually yes, but for now it is more convenient for my development > to keep the name the same. > >> That means it can coexist with the current >> gralloc.drm module so the transition to it >> will be easier. Agree? > > It's not binary compatible, only source compatible ATM, so they can't > really coexist yet. The gralloc implementation specific dependencies The co-existence means to put the two gralloc implementations in the same image and select which one to be used by GPU at runtime. This is carried out by our init.sh like case "$(cat /proc/fb | head -1)" in *virtiodrmfb) set_property ro.hardware.gralloc gbm set_property ro.hardware.hwcomposer drm ;; 0*inteldrmfb|0*radeondrmfb|0*nouveaufb|0*svgadrmfb) set_property ro.hardware.gralloc drm set_drm_mode ;; ... esac They don't need to be binary or source compatible, I think. I guess the first supported GPU is virgl. Right? When could we expect it's ready to test? > in mesa and hwc is something I'm looking at. They consist of > retrieving the prime FD for a handle and retrieving the DRM device FD. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe
2016-04-07 13:30 GMT+08:00 Rob Herring : > On Wed, Apr 6, 2016 at 11:12 AM, Chih-Wei Huang > wrote: > >> I guess the first supported GPU is virgl. Right? > > Yes. Any gallium driver really. The classic mesa drivers will need > their own additions for GBM map/unmap. > >> When could we expect it's ready to test? > > Not sure. Definitely not until the GBM interface is set. There's not > really much reason for android-x86 to move to it until it gets flushed > out. Could you provide me the patches of mesa? I'm glad to test it. Thanks! -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] glsl: android: add back missing generated glcpp include path
2016-04-16 1:21 GMT+08:00 Emil Velikov : > On 14 April 2016 at 20:40, Rob Herring wrote: >> Commit 4db8f15a2576 ("glsl: move the android build scripts a level up") >> dropped a generated include path for glcpp. Add it back adjusting for the >> new location. >> >> Cc: Emil Velikov >> Signed-off-by: Rob Herring >> --- >> src/compiler/Android.glsl.gen.mk | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/src/compiler/Android.glsl.gen.mk >> b/src/compiler/Android.glsl.gen.mk >> index b0df8a1..b2ea12c 100644 >> --- a/src/compiler/Android.glsl.gen.mk >> +++ b/src/compiler/Android.glsl.gen.mk >> @@ -33,6 +33,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) >> >> LOCAL_C_INCLUDES += \ >> $(intermediates)/glsl \ >> + $(intermediates)/glsl/glcpp \ > Strange neither Autotools nor Scons needs this. What is the (somewhat) > absolute path of the glcpp and glsl files (both generated and > distribution). Probably they are generated in the same source dir? Android generates these files in the $(intermediates) dir. Without the patch we got external/mesa/src/compiler/glsl/glcpp/glcpp-lex.l:30:25: fatal error: glcpp-parse.h: No such file or directory #include "glcpp-parse.h" ^ compilation terminated. make: *** [out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libmesa_glsl_intermediates/glsl/glcpp/glcpp-lex.o] Error 1 The series of patches are Tested-by: Chih-Wei Huang ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] Latest Mesa is broken on Android-x86?
I just tried the commit d3c98c73d on i965 GPU but it became black screen on surfaceflinger starting. Just hope to know if anyone has tested and can confirm that. Or it's a stupid mistake I made. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 0/3] Support for Android RGBX/RGBA formats
2016-04-20 3:38 GMT+08:00 Rob Herring : > The RGBX/RGBA pixel formats used in the Android EGL don't get configs > created due to the missing formats in the DRI state tracker. This series > adds the necessary formats for configs and DRI images. Support in GBM is > also added as it will be needed soon for Android. > > AFAICT, this has been a long standing bug in Android-x86 which was > worked around with the patch "GLSurfaceView: Be less picky about > EGLConfig alpha sizes". With this series, this patch is no longer needed > and several other bugs like wallpaper not getting displayed are fixed. Sounds great! Thanks a lot for the fix. I'm always curious why they are not supported for such a long time. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 0/3] Support for Android RGBX/RGBA formats
2016-04-21 21:42 GMT+08:00 Emil Velikov : > > On 19 April 2016 at 20:38, Rob Herring wrote: >> The RGBX/RGBA pixel formats used in the Android EGL don't get configs >> created due to the missing formats in the DRI state tracker. This series >> adds the necessary formats for configs and DRI images. Support in GBM is >> also added as it will be needed soon for Android. >> >> AFAICT, this has been a long standing bug in Android-x86 which was >> worked around with the patch "GLSurfaceView: Be less picky about >> EGLConfig alpha sizes". With this series, this patch is no longer needed >> and several other bugs like wallpaper not getting displayed are fixed. >> > In the past similar changes has caused unexpected bugs and/or pert > regressions. > > Although I doubt we'll notice them with the patches on the ML, thus > I've pushed the lot to get some wider testing. > Please keep an eye for fires ;-) Could these be back-ported to 11.2? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 0/3] Support for Android RGBX/RGBA formats
2016-04-24 21:50 GMT+08:00 Emil Velikov : > On 24 April 2016 at 14:20, Marek Olšák wrote: >> On Sun, Apr 24, 2016 at 3:09 PM, Marek Olšák wrote: >>> On Sun, Apr 24, 2016 at 2:16 PM, Marek Olšák wrote: >>>> On Fri, Apr 22, 2016 at 12:41 PM, Chih-Wei Huang >>>> wrote: >>>>> 2016-04-21 21:42 GMT+08:00 Emil Velikov : >>>>>> >>>>>> On 19 April 2016 at 20:38, Rob Herring wrote: >>>>>>> The RGBX/RGBA pixel formats used in the Android EGL don't get configs >>>>>>> created due to the missing formats in the DRI state tracker. This series >>>>>>> adds the necessary formats for configs and DRI images. Support in GBM is >>>>>>> also added as it will be needed soon for Android. >>>>>>> >>>>>>> AFAICT, this has been a long standing bug in Android-x86 which was >>>>>>> worked around with the patch "GLSurfaceView: Be less picky about >>>>>>> EGLConfig alpha sizes". With this series, this patch is no longer needed >>>>>>> and several other bugs like wallpaper not getting displayed are fixed. >>>>>>> >>>>>> In the past similar changes has caused unexpected bugs and/or pert >>>>>> regressions. >>>>>> >>>>>> Although I doubt we'll notice them with the patches on the ML, thus >>>>>> I've pushed the lot to get some wider testing. >>>>>> Please keep an eye for fires ;-) >>>>> >>>>> Could these be back-ported to 11.2? >>>> >>>> DEFINITELY NOT. >>>> >>>> It's too risky and it has already broken GLX. >>> >>> OK so the problem is libGL ignores the red/green/blue mask, therefore >>> it doesn't distinguish between BGRA and RGBA. Also, DRI always assumes >>> it's BGRA on the X server side. This patch series also ignores the >>> red/green/blue mask for imported buffers. That's why DRI2 mostly >>> works. I haven't tested DRI3. >>> >>> libGL could be fixed not to expose RGBA visuals, but that's >>> insufficient, because Mesa drivers must be loadable by older libGL >>> too. >>> >>> The bottom line is st/dri can't expose RGBA, because it would break >>> Mesa with old libGL. >>> > Speaking of which... I while back I was asking/proposing that we > deprecate 'too old' loader (libGL) <> dri modules combos. Something > like ~3 year difference came to mind (functionality based). Do we have > (m)any people who explicitly test dri module from today and libGL form > 5-6, 10 years ago ? >>> > Ack. Thanks for looking into it Marek ! > > Emil > How do you feel on the topic ? > >>> Unless you guys come up with a solution, I'll have to revert the st/dri >>> change. >> >> FYI, I've decided to revert the st/dri commit now to fix the KDE >> issue. Why not just limit this commit to Android only? The RGBA is possibly only used by Android? Android-x86 community has waited such a fix for a very long time. Don't just drop it because it breaks others. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 02/12] android: make the code be compatible with stlport
The android's stlport doesn't have tr1/unordered_set but unordered_set. Signed-off-by: Chih-Wei Huang --- src/egl/main/Android.mk | 5 +++-- src/gallium/drivers/nouveau/codegen/nv50_ir.h | 5 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/egl/main/Android.mk b/src/egl/main/Android.mk index 12b66d0..29c978b 100644 --- a/src/egl/main/Android.mk +++ b/src/egl/main/Android.mk @@ -100,7 +100,6 @@ endif ifneq ($(filter nouveau, $(MESA_GPU_DRIVERS)),) gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau LOCAL_SHARED_LIBRARIES += libdrm_nouveau -LOCAL_SHARED_LIBRARIES += libstlport endif # r300g/r600g/radeonsi @@ -113,7 +112,6 @@ endif # r300g ifneq ($(filter r600g radeonsi, $(MESA_GPU_DRIVERS)),) ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),) gallium_DRIVERS += libmesa_pipe_r600 -LOCAL_SHARED_LIBRARIES += libstlport endif # r600g ifneq ($(filter radeonsi, $(MESA_GPU_DRIVERS)),) gallium_DRIVERS += libmesa_pipe_radeonsi @@ -121,6 +119,9 @@ endif # radeonsi gallium_DRIVERS += libmesa_pipe_radeon endif # r600g || radeonsi endif # r300g || r600g || radeonsi +ifneq ($(filter nouveau r600g, $(MESA_GPU_DRIVERS)),) +LOCAL_SHARED_LIBRARIES += libstlport +endif # vmwgfx ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h index f4d52b7..6a17e61 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h @@ -29,7 +29,12 @@ #include #include #include +#ifdef ANDROID +#include // from stlport +using std::isfinite; +#else #include +#endif #include "codegen/nv50_ir_util.h" #include "codegen/nv50_ir_graph.h" -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 06/12] android: add rules to build gallium_dri
Signed-off-by: Chih-Wei Huang --- src/gallium/Android.mk | 7 +- src/gallium/targets/dri/Android.mk | 110 +++ src/gallium/winsys/sw/dri/Android.mk | 35 ++ src/gallium/winsys/sw/kms-dri/Android.mk | 37 +++ 4 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 src/gallium/targets/dri/Android.mk create mode 100644 src/gallium/winsys/sw/dri/Android.mk create mode 100644 src/gallium/winsys/sw/kms-dri/Android.mk diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk index aaa07bc..a9c34d9 100644 --- a/src/gallium/Android.mk +++ b/src/gallium/Android.mk @@ -33,7 +33,9 @@ SUBDIRS := auxiliary # # swrast -SUBDIRS += winsys/sw/android drivers/softpipe +ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),) +SUBDIRS += winsys/sw/dri winsys/sw/kms-dri drivers/softpipe +endif # freedreno ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),) @@ -79,6 +81,7 @@ ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),) SUBDIRS += winsys/svga/drm drivers/svga endif -SUBDIRS += state_trackers/dri +# Gallium state trackers and target for dri +SUBDIRS += state_trackers/dri targets/dri include $(call all-named-subdir-makefiles,$(SUBDIRS)) diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk new file mode 100644 index 000..7c7642f --- /dev/null +++ b/src/gallium/targets/dri/Android.mk @@ -0,0 +1,110 @@ +# Mesa 3-D graphics library +# +# Copyright (C) 2015 Chih-Wei Huang +# Copyright (C) 2015 Android-x86 Open Source Project +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := gallium_dri + +ifeq ($(MESA_LOLLIPOP_BUILD),true) +LOCAL_MODULE_RELATIVE_PATH := $(notdir $(MESA_DRI_MODULE_PATH)) +else +LOCAL_MODULE_PATH := $(MESA_DRI_MODULE_PATH) +endif + +LOCAL_SRC_FILES := target.c + +LOCAL_CFLAGS := -DDRI_TARGET -DHAVE_LIBDRM + +LOCAL_SHARED_LIBRARIES := \ + libdl \ + libglapi \ + libexpat \ + +# swrast only? +ifeq ($(MESA_GPU_DRIVERS),swrast) +LOCAL_CFLAGS += -D__NOT_HAVE_DRM_H +else +LOCAL_SHARED_LIBRARIES += libdrm +endif + +ifneq ($(filter freedreno,$(MESA_GPU_DRIVERS)),) +LOCAL_CFLAGS += -DGALLIUM_FREEDRENO +gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno +LOCAL_SHARED_LIBRARIES += libdrm_freedreno +endif +ifneq ($(filter i915g,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_winsys_i915 libmesa_pipe_i915 +LOCAL_SHARED_LIBRARIES += libdrm_intel +LOCAL_CFLAGS += -DGALLIUM_I915 +endif +ifneq ($(filter ilo,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_winsys_intel libmesa_pipe_ilo +LOCAL_SHARED_LIBRARIES += libdrm_intel +LOCAL_CFLAGS += -DGALLIUM_ILO +endif +ifneq ($(filter nouveau,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau +LOCAL_CFLAGS += -DGALLIUM_NOUVEAU +LOCAL_SHARED_LIBRARIES += libdrm_nouveau libstlport +endif +ifneq ($(filter r%,$(MESA_GPU_DRIVERS)),) +ifneq ($(filter r300g,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_pipe_r300 +LOCAL_CFLAGS += -DGALLIUM_R300 +endif +ifneq ($(filter r600g,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_pipe_r600 +LOCAL_SHARED_LIBRARIES += libstlport +LOCAL_CFLAGS += -DGALLIUM_R600 +endif +ifneq ($(filter radeonsi,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_pipe_radeonsi +LOCAL_CFLAGS += -DGALLIUM_RADEONSI +endif +gallium_DRIVERS += libmesa_winsys_radeon libmesa_pipe_radeon +LOCAL_SHARED_LIBRARIES += libdrm_radeon +endif +ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_dri libmesa_winsys_sw_kms_dri +LOCAL_CFLAGS += -DGALLIUM_SOFTPIPE +endif +ifneq ($(filter vmwgfx,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_winsys_svga libmesa_pipe_svga +LOCAL_CFLAGS += -DGALLIUM_VMWGFX +endif + +LOCAL_STATIC_LIBRARIES := \ + $(gallium_DRIVERS) \ + libmesa_st_dri \ + libmesa_st_mesa \
[Mesa-dev] [PATCH 01/12] nv50/ir: optimize the use of std::tr1::unordered_set
Instead of using unordered_set directly, the patch changes to use unordered_set and adds a wrapper template class to convert the iterators to the expected user-defined type. This avoid instantiating the template multiple times and make it be more compatible with stlport. Signed-off-by: Chih-Wei Huang --- src/gallium/drivers/nouveau/codegen/nv50_ir.h | 28 +++--- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 4 ++-- .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 4 +--- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 5 ++-- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h index 529dcb9..f4d52b7 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h @@ -451,6 +451,28 @@ struct Storage #define NV50_IR_INTERP_OFFSET (2 << 2) #define NV50_IR_INTERP_SAMPLEID(3 << 2) +typedef std::tr1::unordered_set voidptr_unordered_set; + +template +class ptr_unordered_set : public voidptr_unordered_set { + public: +typedef voidptr_unordered_set _base; +typedef _base::iterator _biterator; + +class iterator : public _biterator { + public: +iterator(const _biterator & i) : _biterator(i) {} +V *operator*() { return reinterpret_cast(*_biterator(*this)); } +const V *operator*() const { return reinterpret_cast(*_biterator(*this)); } +}; +typedef const iterator const_iterator; + +iterator begin() { return _base::begin(); } +iterator end() { return _base::end(); } +const_iterator begin() const { return _base::begin(); } +const_iterator end() const { return _base::end(); } +}; + // do we really want this to be a class ? class Modifier { @@ -583,10 +605,10 @@ public: static inline Value *get(Iterator&); - std::tr1::unordered_set uses; + ptr_unordered_set uses; std::list defs; - typedef std::tr1::unordered_set::iterator UseIterator; - typedef std::tr1::unordered_set::const_iterator UseCIterator; + typedef ptr_unordered_set::iterator UseIterator; + typedef ptr_unordered_set::const_iterator UseCIterator; typedef std::list::iterator DefIterator; typedef std::list::const_iterator DefCIterator; diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp index b61f3c4..669d292 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -224,7 +224,7 @@ NVC0LegalizePostRA::findFirstUses( const Instruction *texi, const Instruction *insn, std::list &uses, - std::tr1::unordered_set& visited) + ptr_unordered_set& visited) { for (int d = 0; insn->defExists(d); ++d) { Value *v = insn->getDef(d); @@ -318,7 +318,7 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn) if (!uses) return false; for (size_t i = 0; i < texes.size(); ++i) { - std::tr1::unordered_set visited; + ptr_unordered_set visited; findFirstUses(texes[i], texes[i], uses[i], visited); } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h index 260e101..17b6f6f 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h @@ -20,8 +20,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include - #include "codegen/nv50_ir.h" #include "codegen/nv50_ir_build_util.h" @@ -73,7 +71,7 @@ private: inline bool insnDominatedBy(const Instruction *, const Instruction *) const; void findFirstUses(const Instruction *tex, const Instruction *def, std::list&, - std::tr1::unordered_set&); + ptr_unordered_set&); void findOverwritingDefs(const Instruction *tex, Instruction *insn, const BasicBlock *term, std::list&); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp index 898653c..03acba7 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp @@ -25,7 +25,6 @@ #include #include -#include namespace nv50_ir { @@ -1551,7 +1550,7 @@ SpillCodeInserter::run(const std::list& lst) // Keep track of which instructions to delete later. Deleting them // inside the loop is unsafe since a single instruction may have // multiple destinations that all need to be spilled (like OP_SPLIT). - std::tr1::unordered_set to_del; + ptr_unordered_set to_del; for (Value::DefIterator d = lval->defs.begin(
[Mesa-dev] [PATCH 04/12] android: export more dirs from libmesa_dri_common
The include paths of libmesa_dri_common are also used by modules that need libmesa_dri_common. Signed-off-by: Chih-Wei Huang --- src/mesa/drivers/dri/common/Android.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/common/Android.mk b/src/mesa/drivers/dri/common/Android.mk index a7fcd6d..c003c94 100644 --- a/src/mesa/drivers/dri/common/Android.mk +++ b/src/mesa/drivers/dri/common/Android.mk @@ -39,7 +39,9 @@ intermediates := $(call local-generated-sources-dir) LOCAL_C_INCLUDES := \ $(MESA_DRI_C_INCLUDES) -LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates) +LOCAL_EXPORT_C_INCLUDE_DIRS := \ +$(LOCAL_PATH) \ +$(intermediates) # swrast only ifeq ($(MESA_GPU_DRIVERS),swrast) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 07/12] android: enable the rules to build gallium st/dri
The libmesa_dri_common and libmesa_egl_dri2 should not be limited to the classical drivers only. Allow them to be built with the gallium drivers. Signed-off-by: Chih-Wei Huang --- Android.mk | 6 +- src/egl/main/Android.mk | 8 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Android.mk b/Android.mk index b19419b..6a09a9d 100644 --- a/Android.mk +++ b/Android.mk @@ -89,13 +89,9 @@ SUBDIRS := \ src/glsl \ src/mesa \ src/util \ - src/egl/main - -ifeq ($(strip $(MESA_BUILD_CLASSIC)),true) -SUBDIRS += \ + src/egl/main \ src/egl/drivers/dri2 \ src/mesa/drivers/dri -endif ifeq ($(strip $(MESA_BUILD_GALLIUM)),true) SUBDIRS += src/gallium diff --git a/src/egl/main/Android.mk b/src/egl/main/Android.mk index 29c978b..611034c 100644 --- a/src/egl/main/Android.mk +++ b/src/egl/main/Android.mk @@ -62,10 +62,10 @@ ifneq ($(MESA_GPU_DRIVERS),swrast) LOCAL_SHARED_LIBRARIES += libdrm endif -ifeq ($(strip $(MESA_BUILD_CLASSIC)),true) LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2 LOCAL_STATIC_LIBRARIES += libmesa_egl_dri2 +ifeq ($(strip $(MESA_BUILD_CLASSIC)),true) # require i915_dri and/or i965_dri LOCAL_REQUIRED_MODULES += \ $(addsuffix _dri, $(filter i915 i965, $(MESA_GPU_DRIVERS))) @@ -75,9 +75,6 @@ ifeq ($(strip $(MESA_BUILD_GALLIUM)),true) gallium_DRIVERS := -# swrast -gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_android - # freedreno ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),) gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno @@ -138,8 +135,6 @@ endif # * libmesa_glsl depends on libmesa_glsl_utils # LOCAL_STATIC_LIBRARIES := \ - libmesa_egl_gallium \ - libmesa_st_egl \ $(gallium_DRIVERS) \ libmesa_st_mesa \ libmesa_util \ @@ -148,6 +143,7 @@ LOCAL_STATIC_LIBRARIES := \ libmesa_gallium \ $(LOCAL_STATIC_LIBRARIES) +LOCAL_REQUIRED_MODULES += gallium_dri endif # MESA_BUILD_GALLIUM LOCAL_STATIC_LIBRARIES := \ -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 09/12] egl/main: let EGL_RECORDABLE_ANDROID be a valid attrib
Signed-off-by: Chih-Wei Huang --- src/egl/main/eglconfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index 84cb227..7121b3d 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -86,6 +86,7 @@ struct _egl_config /* extensions */ EGLint YInvertedNOK; + EGLint RecordableAndroid; }; @@ -133,6 +134,7 @@ _eglOffsetOfConfig(EGLint attr) ATTRIB_MAP(EGL_CONFORMANT,Conformant); /* extensions */ ATTRIB_MAP(EGL_Y_INVERTED_NOK,YInvertedNOK); + ATTRIB_MAP(EGL_RECORDABLE_ANDROID,RecordableAndroid); #undef ATTRIB_MAP default: return -1; -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 00/12] More Android patches
This is another series of patches for Android. Summary of the changes: * Fix nouveau driver build with Android stlport. * Add gallium_dri.so for Android. This fixes gallium support since 5564c36. * Enable radeonsi driver for Android. * Miscellaneous fixes. Chih-Wei Huang (12): nv50/ir: optimize the use of std::tr1::unordered_set android: make the code be compatible with stlport android: loader: export the path to be included android: export more dirs from libmesa_dri_common android: add rules to build gallium/state_trackers/dri android: add rules to build gallium_dri android: enable the rules to build gallium st/dri android: clean up the makefile of libGLES_mesa egl/main: let EGL_RECORDABLE_ANDROID be a valid attrib android: fix building errors with stlport android: generate files by $(call es-gen) android: enable the radeonsi driver Android.common.mk | 8 ++ Android.mk | 8 +- src/egl/drivers/dri2/Android.mk| 1 - src/egl/main/Android.mk| 86 +-- src/egl/main/eglconfig.h | 2 + src/gallium/Android.common.mk | 8 ++ src/gallium/Android.mk | 10 +- src/gallium/auxiliary/Android.mk | 8 ++ src/gallium/drivers/nouveau/codegen/nv50_ir.h | 33 +- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 4 +- .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 4 +- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 5 +- src/gallium/drivers/radeon/Android.mk | 4 + src/gallium/state_trackers/dri/Android.mk | 64 +++ src/gallium/targets/dri/Android.mk | 120 + src/gallium/winsys/sw/dri/Android.mk | 35 ++ src/gallium/winsys/sw/kms-dri/Android.mk | 37 +++ src/loader/Android.mk | 2 + src/mesa/Android.gen.mk| 16 ++- src/mesa/drivers/dri/common/Android.mk | 4 +- src/util/list.h| 4 + 21 files changed, 356 insertions(+), 107 deletions(-) create mode 100644 src/gallium/state_trackers/dri/Android.mk create mode 100644 src/gallium/targets/dri/Android.mk create mode 100644 src/gallium/winsys/sw/dri/Android.mk create mode 100644 src/gallium/winsys/sw/kms-dri/Android.mk -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 05/12] android: add rules to build gallium/state_trackers/dri
Signed-off-by: Chih-Wei Huang --- src/gallium/Android.mk| 5 ++- src/gallium/state_trackers/dri/Android.mk | 64 +++ 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 src/gallium/state_trackers/dri/Android.mk diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk index b2662ff..aaa07bc 100644 --- a/src/gallium/Android.mk +++ b/src/gallium/Android.mk @@ -79,5 +79,6 @@ ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),) SUBDIRS += winsys/svga/drm drivers/svga endif -mkfiles := $(patsubst %,$(GALLIUM_TOP)/%/Android.mk,$(SUBDIRS)) -include $(mkfiles) +SUBDIRS += state_trackers/dri + +include $(call all-named-subdir-makefiles,$(SUBDIRS)) diff --git a/src/gallium/state_trackers/dri/Android.mk b/src/gallium/state_trackers/dri/Android.mk new file mode 100644 index 000..188e4a1 --- /dev/null +++ b/src/gallium/state_trackers/dri/Android.mk @@ -0,0 +1,64 @@ +# Mesa 3-D graphics library +# +# Copyright (C) 2015 Chih-Wei Huang +# Copyright (C) 2015 Android-x86 Open Source Project +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +LOCAL_PATH := $(call my-dir) + +include $(LOCAL_PATH)/Makefile.sources + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(common_SOURCES) + +LOCAL_CFLAGS := \ + -DGALLIUM_STATIC_TARGETS=1 \ + +LOCAL_C_INCLUDES := \ + $(MESA_TOP)/src/mapi \ + $(MESA_TOP)/src/mesa \ + +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(LOCAL_PATH) \ + $(LOCAL_C_INCLUDES) \ + +LOCAL_STATIC_LIBRARIES := \ + libmesa_dri_common \ + +ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),) +LOCAL_CFLAGS += -DGALLIUM_SOFTPIPE +LOCAL_SRC_FILES += $(drisw_SOURCES) +endif + +# swrast only? +ifeq ($(MESA_GPU_DRIVERS),swrast) +LOCAL_CFLAGS += -D__NOT_HAVE_DRM_H +else +LOCAL_SRC_FILES += $(dri2_SOURCES) +LOCAL_SHARED_LIBRARIES := libdrm +endif + +LOCAL_MODULE := libmesa_st_dri + +LOCAL_GENERATED_SOURCES := $(MESA_DRI_OPTIONS_H) + +include $(GALLIUM_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 12/12] android: enable the radeonsi driver
Based on the nice work of Paulo Sergio Travaglia . The main modifications are: - Include paths for LLVM header files and shared/static libraries - Set C++ flag "c++11" to avoid compiling errors on LLVM header files - Set defines for LLVM - Add GALLIVM source files - Changes path of libelf library for lollipop Signed-off-by: Chih-Wei Huang --- Android.common.mk | 8 Android.mk| 2 ++ src/gallium/Android.common.mk | 8 src/gallium/auxiliary/Android.mk | 8 src/gallium/drivers/radeon/Android.mk | 4 src/gallium/targets/dri/Android.mk| 10 ++ 6 files changed, 40 insertions(+) diff --git a/Android.common.mk b/Android.common.mk index edf52d6..43766bf 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -68,6 +68,14 @@ LOCAL_CFLAGS += \ endif endif +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_CFLAGS += \ + -DHAVE_LLVM=0x0305 -DLLVM_VERSION_PATCH=2 \ + -D__STDC_CONSTANT_MACROS \ + -D__STDC_FORMAT_MACROS \ + -D__STDC_LIMIT_MACROS +endif + LOCAL_CPPFLAGS += \ -Wno-error=non-virtual-dtor \ -Wno-non-virtual-dtor diff --git a/Android.mk b/Android.mk index 6a09a9d..64930ac 100644 --- a/Android.mk +++ b/Android.mk @@ -80,6 +80,8 @@ else MESA_BUILD_GALLIUM := false endif +MESA_ENABLE_LLVM := $(if $(filter radeonsi,$(gallium_drivers)),true,false) + # add subdirectories ifneq ($(strip $(MESA_GPU_DRIVERS)),) diff --git a/src/gallium/Android.common.mk b/src/gallium/Android.common.mk index 782510f..7c6c7ac 100644 --- a/src/gallium/Android.common.mk +++ b/src/gallium/Android.common.mk @@ -29,4 +29,12 @@ LOCAL_C_INCLUDES += \ $(GALLIUM_TOP)/winsys \ $(GALLIUM_TOP)/drivers +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_C_INCLUDES += \ + external/llvm/include \ + external/llvm/device/include \ + external/libcxx/include \ + external/elfutils/$(if $(filter true,$(MESA_LOLLIPOP_BUILD)),0.153/)libelf +endif + include $(MESA_COMMON_MK) diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk index 96a2125..2d91752 100644 --- a/src/gallium/auxiliary/Android.mk +++ b/src/gallium/auxiliary/Android.mk @@ -35,6 +35,14 @@ LOCAL_SRC_FILES := \ LOCAL_C_INCLUDES := \ $(GALLIUM_TOP)/auxiliary/util +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_SRC_FILES += \ + $(GALLIVM_SOURCES) \ + $(GALLIVM_CPP_SOURCES) + +LOCAL_CPPFLAGS := -std=c++11 +endif + LOCAL_MODULE := libmesa_gallium # generate sources diff --git a/src/gallium/drivers/radeon/Android.mk b/src/gallium/drivers/radeon/Android.mk index d615792..6997a6d 100644 --- a/src/gallium/drivers/radeon/Android.mk +++ b/src/gallium/drivers/radeon/Android.mk @@ -30,6 +30,10 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(C_SOURCES) +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_SRC_FILES += $(LLVM_C_FILES) +endif + LOCAL_SHARED_LIBRARIES := libdrm libdrm_radeon LOCAL_MODULE := libmesa_pipe_radeon diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk index 7c7642f..e9b9ac4 100644 --- a/src/gallium/targets/dri/Android.mk +++ b/src/gallium/targets/dri/Android.mk @@ -81,6 +81,7 @@ LOCAL_CFLAGS += -DGALLIUM_R600 endif ifneq ($(filter radeonsi,$(MESA_GPU_DRIVERS)),) gallium_DRIVERS += libmesa_pipe_radeonsi +LOCAL_SHARED_LIBRARIES += libLLVM LOCAL_CFLAGS += -DGALLIUM_RADEONSI endif gallium_DRIVERS += libmesa_winsys_radeon libmesa_pipe_radeon @@ -106,5 +107,14 @@ LOCAL_STATIC_LIBRARIES := \ libmesa_util \ libmesa_loader \ +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_STATIC_LIBRARIES += \ + libLLVMR600CodeGen \ + libLLVMR600Desc \ + libLLVMR600Info \ + libLLVMR600AsmPrinter \ + libelf +endif + include $(GALLIUM_COMMON_MK) include $(BUILD_SHARED_LIBRARY) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 08/12] android: clean up the makefile of libGLES_mesa
Most of the logic for the gallium drivers has been moved to src/gallium/targets/dri/Android.mk. Signed-off-by: Chih-Wei Huang --- src/egl/main/Android.mk | 79 ++--- 1 file changed, 2 insertions(+), 77 deletions(-) diff --git a/src/egl/main/Android.mk b/src/egl/main/Android.mk index 611034c..60de211 100644 --- a/src/egl/main/Android.mk +++ b/src/egl/main/Android.mk @@ -43,8 +43,6 @@ LOCAL_CFLAGS := \ -D_EGL_DRIVER_SEARCH_DIR=\"/system/lib/egl\" \ -D_EGL_OS_UNIX=1 -LOCAL_STATIC_LIBRARIES := - LOCAL_SHARED_LIBRARIES := \ libglapi \ libdl \ @@ -63,7 +61,7 @@ LOCAL_SHARED_LIBRARIES += libdrm endif LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2 -LOCAL_STATIC_LIBRARIES += libmesa_egl_dri2 +LOCAL_STATIC_LIBRARIES := libmesa_egl_dri2 ifeq ($(strip $(MESA_BUILD_CLASSIC)),true) # require i915_dri and/or i965_dri @@ -72,83 +70,10 @@ LOCAL_REQUIRED_MODULES += \ endif # MESA_BUILD_CLASSIC ifeq ($(strip $(MESA_BUILD_GALLIUM)),true) - -gallium_DRIVERS := - -# freedreno -ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno -LOCAL_SHARED_LIBRARIES += libdrm_freedreno -endif - -# i915g -ifneq ($(filter i915g, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_i915 libmesa_pipe_i915 -LOCAL_SHARED_LIBRARIES += libdrm_intel -endif - -# ilo -ifneq ($(filter ilo, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_intel libmesa_pipe_ilo -LOCAL_SHARED_LIBRARIES += libdrm_intel -endif - -# nouveau -ifneq ($(filter nouveau, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau -LOCAL_SHARED_LIBRARIES += libdrm_nouveau -endif - -# r300g/r600g/radeonsi -ifneq ($(filter r300g r600g radeonsi, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_radeon -LOCAL_SHARED_LIBRARIES += libdrm_radeon -ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_pipe_r300 -endif # r300g -ifneq ($(filter r600g radeonsi, $(MESA_GPU_DRIVERS)),) -ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_pipe_r600 -endif # r600g -ifneq ($(filter radeonsi, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_pipe_radeonsi -endif # radeonsi -gallium_DRIVERS += libmesa_pipe_radeon -endif # r600g || radeonsi -endif # r300g || r600g || radeonsi -ifneq ($(filter nouveau r600g, $(MESA_GPU_DRIVERS)),) -LOCAL_SHARED_LIBRARIES += libstlport -endif - -# vmwgfx -ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_svga libmesa_pipe_svga -endif - -# -# Notes about the order here: -# -# * libmesa_st_egl depends on libmesa_winsys_sw_android in $(gallium_DRIVERS) -# * libmesa_pipe_r300 in $(gallium_DRIVERS) depends on libmesa_st_mesa and -#libmesa_glsl -# * libmesa_st_mesa depends on libmesa_glsl -# * libmesa_glsl depends on libmesa_glsl_utils -# -LOCAL_STATIC_LIBRARIES := \ - $(gallium_DRIVERS) \ - libmesa_st_mesa \ - libmesa_util \ - libmesa_glsl \ - libmesa_glsl_utils \ - libmesa_gallium \ - $(LOCAL_STATIC_LIBRARIES) - LOCAL_REQUIRED_MODULES += gallium_dri endif # MESA_BUILD_GALLIUM -LOCAL_STATIC_LIBRARIES := \ - $(LOCAL_STATIC_LIBRARIES) \ - libmesa_loader +LOCAL_STATIC_LIBRARIES += libmesa_loader LOCAL_MODULE := libGLES_mesa ifeq ($(MESA_LOLLIPOP_BUILD),true) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 10/12] android: fix building errors with stlport
In Android the nouveau driver is built with stlport by including libstlport.mk. However, it changes the include paths order to be in favor of external/stlport/stlport. The assert.h defined in it is chosen that causes the building errors on compiling C code. Strictly speaking, stlport should only be added to C++'s include paths. However, the Android build system doesn't support 'LOCAL_CPP_INCLUDES'. Workaround the problem by GCC's #include_next so the bionic's assert.h will be chosen. Signed-off-by: Chih-Wei Huang --- src/util/list.h | 4 1 file changed, 4 insertions(+) diff --git a/src/util/list.h b/src/util/list.h index 9460347..3f979cfb 100644 --- a/src/util/list.h +++ b/src/util/list.h @@ -40,7 +40,11 @@ #include #include +#ifdef ANDROID +#include_next +#else #include +#endif struct list_head -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 03/12] android: loader: export the path to be included
Signed-off-by: Chih-Wei Huang --- src/egl/drivers/dri2/Android.mk | 1 - src/loader/Android.mk | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/egl/drivers/dri2/Android.mk b/src/egl/drivers/dri2/Android.mk index 5931ce8..d4d809b 100644 --- a/src/egl/drivers/dri2/Android.mk +++ b/src/egl/drivers/dri2/Android.mk @@ -45,7 +45,6 @@ endif LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/mapi \ $(MESA_TOP)/src/egl/main \ - $(MESA_TOP)/src/loader \ $(DRM_GRALLOC_TOP) LOCAL_STATIC_LIBRARIES := \ diff --git a/src/loader/Android.mk b/src/loader/Android.mk index 8e215de..92d9fd2 100644 --- a/src/loader/Android.mk +++ b/src/loader/Android.mk @@ -40,6 +40,8 @@ else LOCAL_SHARED_LIBRARIES := libdrm endif +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) + LOCAL_MODULE := libmesa_loader include $(MESA_COMMON_MK) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 11/12] android: generate files by $(call es-gen)
Use the pre-defined macro es-gen to generate new added files instead of writing new rules manually. The handmade rules that may generate the files before the directory is created result in such an error: /bin/bash: out/target/product/x86/gen/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/main/format_pack.c: No such file or directory make: *** [out/target/product/x86/gen/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/main/format_pack.c] Error 1 Signed-off-by: Chih-Wei Huang --- src/mesa/Android.gen.mk | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/mesa/Android.gen.mk b/src/mesa/Android.gen.mk index cc97954..145f259 100644 --- a/src/mesa/Android.gen.mk +++ b/src/mesa/Android.gen.mk @@ -115,9 +115,11 @@ $(intermediates)/main/api_exec.c: $(dispatch_deps) GET_HASH_GEN := $(LOCAL_PATH)/main/get_hash_generator.py +$(intermediates)/main/get_hash.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(GET_HASH_GEN) +$(intermediates)/main/get_hash.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml $(intermediates)/main/get_hash.h: $(glapi)/gl_and_es_API.xml \ $(LOCAL_PATH)/main/get_hash_params.py $(GET_HASH_GEN) - @$(MESA_PYTHON2) $(GET_HASH_GEN) -f $< > $@ + $(call es-gen) FORMAT_INFO := $(LOCAL_PATH)/main/format_info.py format_info_deps := \ @@ -125,8 +127,10 @@ format_info_deps := \ $(LOCAL_PATH)/main/format_parser.py \ $(FORMAT_INFO) +$(intermediates)/main/format_info.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(FORMAT_INFO) +$(intermediates)/main/format_info.h: PRIVATE_XML := $(intermediates)/main/format_info.h: $(format_info_deps) - @$(MESA_PYTHON2) $(FORMAT_INFO) $< > $@ + $(call es-gen, $<) FORMAT_PACK := $(LOCAL_PATH)/main/format_pack.py format_pack_deps := \ @@ -134,8 +138,10 @@ format_pack_deps := \ $(LOCAL_PATH)/main/format_parser.py \ $(FORMAT_PACK) +$(intermediates)/main/format_pack.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(FORMAT_PACK) +$(intermediates)/main/format_pack.c: PRIVATE_XML := $(intermediates)/main/format_pack.c: $(format_pack_deps) - $(hide) $(MESA_PYTHON2) $(FORMAT_PACK) $< > $@ + $(call es-gen, $<) FORMAT_UNPACK := $(LOCAL_PATH)/main/format_unpack.py format_unpack_deps := \ @@ -143,5 +149,7 @@ format_unpack_deps := \ $(LOCAL_PATH)/main/format_parser.py \ $(FORMAT_UNPACK) +$(intermediates)/main/format_unpack.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(FORMAT_UNPACK) +$(intermediates)/main/format_unpack.c: PRIVATE_XML := $(intermediates)/main/format_unpack.c: $(format_unpack_deps) - $(hide) $(MESA_PYTHON2) $(FORMAT_UNPACK) $< > $@ + $(call es-gen, $<) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 01/12] nv50/ir: optimize the use of std::tr1::unordered_set
2015-05-16 2:46 GMT+08:00 Ilia Mirkin : > Please elaborate why this is necessary. I have, in the past, had > requests to move to the C++11 std::unordered_set -- would that work > for you? I'd be happy with a #if c++11 is available, use > std::unordered_set. Otherwise use std::tr1::unordered_set. Hi Ilia, Thank you for the review. The basic goal is to make it be compatible with stlport. The stlport (of Android) seems to be buggy to instantiate unordered_set. I just got a lot of strange errors. But instantiating unordered_set (or any built-in type) is fine. So the patch avoids instantiating unordered_set. I didn't see your request in the past (I'm new to the list) But in Android lollipop seems we can use libcxx to replace stlport. I'll try this approach later. Thank you! > On Fri, May 15, 2015 at 2:42 PM, Chih-Wei Huang > wrote: >> Instead of using unordered_set directly, the patch >> changes to use unordered_set and adds a wrapper template class >> to convert the iterators to the expected user-defined type. >> >> This avoid instantiating the template multiple times and make it be >> more compatible with stlport. >> >> Signed-off-by: Chih-Wei Huang >> --- >> src/gallium/drivers/nouveau/codegen/nv50_ir.h | 28 >> +++--- >> .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 4 ++-- >> .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 4 +--- >> src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 5 ++-- >> 4 files changed, 30 insertions(+), 11 deletions(-) >> >> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h >> b/src/gallium/drivers/nouveau/codegen/nv50_ir.h >> index 529dcb9..f4d52b7 100644 >> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h >> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h >> @@ -451,6 +451,28 @@ struct Storage >> #define NV50_IR_INTERP_OFFSET (2 << 2) >> #define NV50_IR_INTERP_SAMPLEID(3 << 2) >> >> +typedef std::tr1::unordered_set voidptr_unordered_set; >> + >> +template >> +class ptr_unordered_set : public voidptr_unordered_set { >> + public: >> +typedef voidptr_unordered_set _base; >> +typedef _base::iterator _biterator; >> + >> +class iterator : public _biterator { >> + public: >> +iterator(const _biterator & i) : _biterator(i) {} >> +V *operator*() { return reinterpret_cast(*_biterator(*this)); } >> +const V *operator*() const { return reinterpret_cast> *>(*_biterator(*this)); } >> +}; >> +typedef const iterator const_iterator; >> + >> +iterator begin() { return _base::begin(); } >> +iterator end() { return _base::end(); } >> +const_iterator begin() const { return _base::begin(); } >> +const_iterator end() const { return _base::end(); } >> +}; >> + >> // do we really want this to be a class ? >> class Modifier >> { >> @@ -583,10 +605,10 @@ public: >> >> static inline Value *get(Iterator&); >> >> - std::tr1::unordered_set uses; >> + ptr_unordered_set uses; >> std::list defs; >> - typedef std::tr1::unordered_set::iterator UseIterator; >> - typedef std::tr1::unordered_set::const_iterator UseCIterator; >> + typedef ptr_unordered_set::iterator UseIterator; >> + typedef ptr_unordered_set::const_iterator UseCIterator; >> typedef std::list::iterator DefIterator; >> typedef std::list::const_iterator DefCIterator; >> >> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp >> b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp >> index b61f3c4..669d292 100644 >> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp >> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp >> @@ -224,7 +224,7 @@ NVC0LegalizePostRA::findFirstUses( >>const Instruction *texi, >>const Instruction *insn, >>std::list &uses, >> - std::tr1::unordered_set& visited) >> + ptr_unordered_set& visited) >> { >> for (int d = 0; insn->defExists(d); ++d) { >>Value *v = insn->getDef(d); >> @@ -318,7 +318,7 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn) >> if (!uses) >>return false; >> for (size_t i = 0; i < texes.size(); ++i) { >> - std::tr1::unordered_set visited; >> + ptr_unordered_set visited; >>findFirstUses(texes[i], texes[i], uses[i], visited); >> } >> >> diff --git a/src/gallium/drivers/nouveau
Re: [Mesa-dev] [PATCH 01/12] nv50/ir: optimize the use of std::tr1::unordered_set
2015-05-18 1:46 GMT+08:00 Chih-Wei Huang : > 2015-05-16 2:46 GMT+08:00 Ilia Mirkin : >> Please elaborate why this is necessary. I have, in the past, had >> requests to move to the C++11 std::unordered_set -- would that work >> for you? I'd be happy with a #if c++11 is available, use >> std::unordered_set. Otherwise use std::tr1::unordered_set. > > Hi Ilia, > Thank you for the review. > The basic goal is to make it be compatible with stlport. > The stlport (of Android) seems to be buggy to > instantiate unordered_set. > I just got a lot of strange errors. > But instantiating unordered_set > (or any built-in type) is fine. > So the patch avoids instantiating > unordered_set. > > I didn't see your request in the past > (I'm new to the list) > But in Android lollipop seems we can use libcxx > to replace stlport. I'll try this approach later. I've succeeded to replace stlport by libcxx. But since libcxx is only available since Android 5.0, I need to tweak the makefiles more if we hope to keep mesa be compatible with earlier Android release. In my experiment of using libcxx with c++11, I believe this patch is more necessary. Because we can use a central point to control (i.e., nv50_ir.h) whether to use std::unordered_set or std::tr1::unordered_set, like #if __cplusplus >= 201103L #include typedef std::unordered_set voidptr_unordered_set; #else #include typedef std::tr1::unordered_set voidptr_unordered_set; #endif template class ptr_unordered_set : public voidptr_unordered_set { ... }; Besides, the patch makes the generated code smaller because of instantiating unordered_set just one time. The size of gallium_dri.so is 10565764 without this patch, and is 10561668 with this patch. How do you think about it? I'll submit the v2 patches after clean them up. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 03/15] android: add rules to build gallium/state_trackers/dri
Signed-off-by: Chih-Wei Huang --- src/gallium/Android.mk| 5 ++- src/gallium/state_trackers/dri/Android.mk | 64 +++ 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 src/gallium/state_trackers/dri/Android.mk diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk index b2662ff..aaa07bc 100644 --- a/src/gallium/Android.mk +++ b/src/gallium/Android.mk @@ -79,5 +79,6 @@ ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),) SUBDIRS += winsys/svga/drm drivers/svga endif -mkfiles := $(patsubst %,$(GALLIUM_TOP)/%/Android.mk,$(SUBDIRS)) -include $(mkfiles) +SUBDIRS += state_trackers/dri + +include $(call all-named-subdir-makefiles,$(SUBDIRS)) diff --git a/src/gallium/state_trackers/dri/Android.mk b/src/gallium/state_trackers/dri/Android.mk new file mode 100644 index 000..188e4a1 --- /dev/null +++ b/src/gallium/state_trackers/dri/Android.mk @@ -0,0 +1,64 @@ +# Mesa 3-D graphics library +# +# Copyright (C) 2015 Chih-Wei Huang +# Copyright (C) 2015 Android-x86 Open Source Project +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +LOCAL_PATH := $(call my-dir) + +include $(LOCAL_PATH)/Makefile.sources + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(common_SOURCES) + +LOCAL_CFLAGS := \ + -DGALLIUM_STATIC_TARGETS=1 \ + +LOCAL_C_INCLUDES := \ + $(MESA_TOP)/src/mapi \ + $(MESA_TOP)/src/mesa \ + +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(LOCAL_PATH) \ + $(LOCAL_C_INCLUDES) \ + +LOCAL_STATIC_LIBRARIES := \ + libmesa_dri_common \ + +ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),) +LOCAL_CFLAGS += -DGALLIUM_SOFTPIPE +LOCAL_SRC_FILES += $(drisw_SOURCES) +endif + +# swrast only? +ifeq ($(MESA_GPU_DRIVERS),swrast) +LOCAL_CFLAGS += -D__NOT_HAVE_DRM_H +else +LOCAL_SRC_FILES += $(dri2_SOURCES) +LOCAL_SHARED_LIBRARIES := libdrm +endif + +LOCAL_MODULE := libmesa_st_dri + +LOCAL_GENERATED_SOURCES := $(MESA_DRI_OPTIONS_H) + +include $(GALLIUM_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 09/15] android: generate files by $(call es-gen)
Use the pre-defined macro es-gen to generate new added files instead of writing new rules manually. The handmade rules that may generate the files before the directory is created result in such an error: /bin/bash: out/target/product/x86/gen/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/main/format_pack.c: No such file or directory make: *** [out/target/product/x86/gen/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/main/format_pack.c] Error 1 Signed-off-by: Chih-Wei Huang --- src/mesa/Android.gen.mk | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/mesa/Android.gen.mk b/src/mesa/Android.gen.mk index cc97954..145f259 100644 --- a/src/mesa/Android.gen.mk +++ b/src/mesa/Android.gen.mk @@ -115,9 +115,11 @@ $(intermediates)/main/api_exec.c: $(dispatch_deps) GET_HASH_GEN := $(LOCAL_PATH)/main/get_hash_generator.py +$(intermediates)/main/get_hash.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(GET_HASH_GEN) +$(intermediates)/main/get_hash.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml $(intermediates)/main/get_hash.h: $(glapi)/gl_and_es_API.xml \ $(LOCAL_PATH)/main/get_hash_params.py $(GET_HASH_GEN) - @$(MESA_PYTHON2) $(GET_HASH_GEN) -f $< > $@ + $(call es-gen) FORMAT_INFO := $(LOCAL_PATH)/main/format_info.py format_info_deps := \ @@ -125,8 +127,10 @@ format_info_deps := \ $(LOCAL_PATH)/main/format_parser.py \ $(FORMAT_INFO) +$(intermediates)/main/format_info.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(FORMAT_INFO) +$(intermediates)/main/format_info.h: PRIVATE_XML := $(intermediates)/main/format_info.h: $(format_info_deps) - @$(MESA_PYTHON2) $(FORMAT_INFO) $< > $@ + $(call es-gen, $<) FORMAT_PACK := $(LOCAL_PATH)/main/format_pack.py format_pack_deps := \ @@ -134,8 +138,10 @@ format_pack_deps := \ $(LOCAL_PATH)/main/format_parser.py \ $(FORMAT_PACK) +$(intermediates)/main/format_pack.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(FORMAT_PACK) +$(intermediates)/main/format_pack.c: PRIVATE_XML := $(intermediates)/main/format_pack.c: $(format_pack_deps) - $(hide) $(MESA_PYTHON2) $(FORMAT_PACK) $< > $@ + $(call es-gen, $<) FORMAT_UNPACK := $(LOCAL_PATH)/main/format_unpack.py format_unpack_deps := \ @@ -143,5 +149,7 @@ format_unpack_deps := \ $(LOCAL_PATH)/main/format_parser.py \ $(FORMAT_UNPACK) +$(intermediates)/main/format_unpack.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(FORMAT_UNPACK) +$(intermediates)/main/format_unpack.c: PRIVATE_XML := $(intermediates)/main/format_unpack.c: $(format_unpack_deps) - $(hide) $(MESA_PYTHON2) $(FORMAT_UNPACK) $< > $@ + $(call es-gen, $<) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 10/15] android: enable the radeonsi driver
Based on the nice work of Paulo Sergio Travaglia . The main modifications are: - Include paths for LLVM header files and shared/static libraries - Set C++ flag "c++11" to avoid compiling errors on LLVM header files - Set defines for LLVM - Add GALLIVM source files - Changes path of libelf library for lollipop Signed-off-by: Chih-Wei Huang --- Android.common.mk | 8 Android.mk| 2 ++ src/gallium/Android.common.mk | 8 src/gallium/auxiliary/Android.mk | 8 src/gallium/drivers/radeon/Android.mk | 4 src/gallium/targets/dri/Android.mk| 10 ++ 6 files changed, 40 insertions(+) diff --git a/Android.common.mk b/Android.common.mk index edf52d6..43766bf 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -68,6 +68,14 @@ LOCAL_CFLAGS += \ endif endif +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_CFLAGS += \ + -DHAVE_LLVM=0x0305 -DLLVM_VERSION_PATCH=2 \ + -D__STDC_CONSTANT_MACROS \ + -D__STDC_FORMAT_MACROS \ + -D__STDC_LIMIT_MACROS +endif + LOCAL_CPPFLAGS += \ -Wno-error=non-virtual-dtor \ -Wno-non-virtual-dtor diff --git a/Android.mk b/Android.mk index 6a09a9d..341978a 100644 --- a/Android.mk +++ b/Android.mk @@ -80,6 +80,8 @@ else MESA_BUILD_GALLIUM := false endif +MESA_ENABLE_LLVM := $(if $(filter radeonsi,$(MESA_GPU_DRIVERS)),true,false) + # add subdirectories ifneq ($(strip $(MESA_GPU_DRIVERS)),) diff --git a/src/gallium/Android.common.mk b/src/gallium/Android.common.mk index 782510f..7c6c7ac 100644 --- a/src/gallium/Android.common.mk +++ b/src/gallium/Android.common.mk @@ -29,4 +29,12 @@ LOCAL_C_INCLUDES += \ $(GALLIUM_TOP)/winsys \ $(GALLIUM_TOP)/drivers +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_C_INCLUDES += \ + external/llvm/include \ + external/llvm/device/include \ + external/libcxx/include \ + external/elfutils/$(if $(filter true,$(MESA_LOLLIPOP_BUILD)),0.153/)libelf +endif + include $(MESA_COMMON_MK) diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk index 96a2125..2d91752 100644 --- a/src/gallium/auxiliary/Android.mk +++ b/src/gallium/auxiliary/Android.mk @@ -35,6 +35,14 @@ LOCAL_SRC_FILES := \ LOCAL_C_INCLUDES := \ $(GALLIUM_TOP)/auxiliary/util +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_SRC_FILES += \ + $(GALLIVM_SOURCES) \ + $(GALLIVM_CPP_SOURCES) + +LOCAL_CPPFLAGS := -std=c++11 +endif + LOCAL_MODULE := libmesa_gallium # generate sources diff --git a/src/gallium/drivers/radeon/Android.mk b/src/gallium/drivers/radeon/Android.mk index d615792..6997a6d 100644 --- a/src/gallium/drivers/radeon/Android.mk +++ b/src/gallium/drivers/radeon/Android.mk @@ -30,6 +30,10 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(C_SOURCES) +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_SRC_FILES += $(LLVM_C_FILES) +endif + LOCAL_SHARED_LIBRARIES := libdrm libdrm_radeon LOCAL_MODULE := libmesa_pipe_radeon diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk index ac33a6e..78f7b7c 100644 --- a/src/gallium/targets/dri/Android.mk +++ b/src/gallium/targets/dri/Android.mk @@ -80,6 +80,7 @@ LOCAL_CFLAGS += -DGALLIUM_R600 endif ifneq ($(filter radeonsi,$(MESA_GPU_DRIVERS)),) gallium_DRIVERS += libmesa_pipe_radeonsi +LOCAL_SHARED_LIBRARIES += libLLVM LOCAL_CFLAGS += -DGALLIUM_RADEONSI endif gallium_DRIVERS += libmesa_winsys_radeon libmesa_pipe_radeon @@ -108,5 +109,14 @@ LOCAL_STATIC_LIBRARIES := \ libmesa_util \ libmesa_loader \ +ifeq ($(MESA_ENABLE_LLVM),true) +LOCAL_STATIC_LIBRARIES += \ + libLLVMR600CodeGen \ + libLLVMR600Desc \ + libLLVMR600Info \ + libLLVMR600AsmPrinter \ + libelf +endif + include $(GALLIUM_COMMON_MK) include $(BUILD_SHARED_LIBRARY) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 06/15] android: try to load gallium_dri.so directly
To avoid the trick of creating links for all dri drivers. Signed-off-by: Chih-Wei Huang --- src/egl/drivers/dri2/egl_dri2.c | 4 1 file changed, 4 insertions(+) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index fe5cbc8..7fc9f78 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -419,6 +419,10 @@ dri2_open_driver(_EGLDisplay *disp) /* not need continue to loop all paths once the driver is found */ if (dri2_dpy->driver != NULL) break; +#ifdef ANDROID + snprintf(path, sizeof path, "%.*s/gallium_dri.so", len, p); + dri2_dpy->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL); +#endif } if (dri2_dpy->driver == NULL) { -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 00/15] More Android patches
This is the v2 series of patches for Android. Tested OK with Android-x86 lollipop-x86 branch. Summary of the changes: * Use C++11 compliant unordered_set to fix nouveau driver with Android stlport and libcxx (lollipop). * Add gallium_dri.so for Android. This fixes gallium support since 5564c36. * Enable radeonsi driver for Android. * Miscellaneous fixes. Chih-Wei Huang (15): android: loader: export the path to be included android: export more dirs from libmesa_dri_common android: add rules to build gallium/state_trackers/dri android: add rules to build gallium_dri.so android: enable the rules to build gallium st/dri android: try to load gallium_dri.so directly android: clean up the makefile of libGLES_mesa egl/main: let EGL_RECORDABLE_ANDROID be a valid attrib android: generate files by $(call es-gen) android: enable the radeonsi driver android: avoid building errors with stlport nv50/ir: optimize the use of std::tr1::unordered_set nv50/ir: use C++11 compliant unordered_set if possible android: nv50/ir: make the code be compatible with stlport android: build with libcxx of android lollipop Android.common.mk | 10 ++ Android.mk | 8 +- CleanSpec.mk | 1 + src/egl/drivers/dri2/Android.mk| 1 - src/egl/drivers/dri2/egl_dri2.c| 4 + src/egl/main/Android.mk| 83 +- src/egl/main/eglconfig.h | 2 + src/gallium/Android.common.mk | 8 ++ src/gallium/Android.mk | 10 +- src/gallium/auxiliary/Android.mk | 6 + src/gallium/drivers/nouveau/Android.mk | 4 + src/gallium/drivers/nouveau/codegen/nv50_ir.h | 37 ++- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 4 +- .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 4 +- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 5 +- src/gallium/drivers/r600/Android.mk| 4 + src/gallium/drivers/radeon/Android.mk | 4 + src/gallium/state_trackers/dri/Android.mk | 64 +++ src/gallium/targets/dri/Android.mk | 123 + src/gallium/winsys/sw/dri/Android.mk | 35 ++ src/gallium/winsys/sw/kms-dri/Android.mk | 37 +++ src/glsl/Android.mk| 1 - src/loader/Android.mk | 2 + src/mesa/Android.gen.mk| 16 ++- src/mesa/drivers/dri/common/Android.mk | 4 +- src/util/list.h| 2 + 26 files changed, 373 insertions(+), 106 deletions(-) create mode 100644 src/gallium/state_trackers/dri/Android.mk create mode 100644 src/gallium/targets/dri/Android.mk create mode 100644 src/gallium/winsys/sw/dri/Android.mk create mode 100644 src/gallium/winsys/sw/kms-dri/Android.mk -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 15/15] android: build with libcxx of android lollipop
The libcxx introduced in android lollipop can be used to replace stlport. Fallback to use stlport when build with earlier android releases. Signed-off-by: Chih-Wei Huang --- Android.common.mk | 1 + src/gallium/drivers/nouveau/Android.mk | 4 src/gallium/drivers/r600/Android.mk| 4 src/gallium/targets/dri/Android.mk | 3 ++- src/glsl/Android.mk| 1 - 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Android.common.mk b/Android.common.mk index 45474ee..49a4402 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -78,6 +78,7 @@ endif LOCAL_CPPFLAGS += \ -std=c++11 \ + $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \ -Wno-error=non-virtual-dtor \ -Wno-non-virtual-dtor diff --git a/src/gallium/drivers/nouveau/Android.mk b/src/gallium/drivers/nouveau/Android.mk index 420c8e5..daf3abd 100644 --- a/src/gallium/drivers/nouveau/Android.mk +++ b/src/gallium/drivers/nouveau/Android.mk @@ -39,6 +39,10 @@ LOCAL_SRC_FILES := \ LOCAL_SHARED_LIBRARIES := libdrm libdrm_nouveau LOCAL_MODULE := libmesa_pipe_nouveau +ifeq ($(MESA_LOLLIPOP_BUILD),true) +LOCAL_C_INCLUDES := external/libcxx/include +else include external/stlport/libstlport.mk +endif include $(GALLIUM_COMMON_MK) include $(BUILD_STATIC_LIBRARY) diff --git a/src/gallium/drivers/r600/Android.mk b/src/gallium/drivers/r600/Android.mk index e935759..bfe3987 100644 --- a/src/gallium/drivers/r600/Android.mk +++ b/src/gallium/drivers/r600/Android.mk @@ -33,6 +33,10 @@ LOCAL_SRC_FILES := $(C_SOURCES) $(CXX_SOURCES) LOCAL_SHARED_LIBRARIES := libdrm libdrm_radeon LOCAL_MODULE := libmesa_pipe_r600 +ifeq ($(MESA_LOLLIPOP_BUILD),true) +LOCAL_C_INCLUDES := external/libcxx/include +else include external/stlport/libstlport.mk +endif include $(GALLIUM_COMMON_MK) include $(BUILD_STATIC_LIBRARY) diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk index 78f7b7c..1772d25 100644 --- a/src/gallium/targets/dri/Android.mk +++ b/src/gallium/targets/dri/Android.mk @@ -95,7 +95,7 @@ gallium_DRIVERS += libmesa_winsys_svga libmesa_pipe_svga LOCAL_CFLAGS += -DGALLIUM_VMWGFX endif ifneq ($(filter nouveau r600g,$(MESA_GPU_DRIVERS)),) -LOCAL_SHARED_LIBRARIES += libstlport +LOCAL_SHARED_LIBRARIES += $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),libc++,libstlport) endif LOCAL_STATIC_LIBRARIES := \ @@ -116,6 +116,7 @@ LOCAL_STATIC_LIBRARIES += \ libLLVMR600Info \ libLLVMR600AsmPrinter \ libelf +LOCAL_LDLIBS += $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-lgcc) endif include $(GALLIUM_COMMON_MK) diff --git a/src/glsl/Android.mk b/src/glsl/Android.mk index f20741e..f63b7da 100644 --- a/src/glsl/Android.mk +++ b/src/glsl/Android.mk @@ -46,7 +46,6 @@ LOCAL_C_INCLUDES := \ LOCAL_MODULE := libmesa_glsl -include external/stlport/libstlport.mk include $(LOCAL_PATH)/Android.gen.mk include $(MESA_COMMON_MK) include $(BUILD_STATIC_LIBRARY) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 04/15] android: add rules to build gallium_dri.so
Signed-off-by: Chih-Wei Huang --- src/gallium/Android.mk | 7 +- src/gallium/targets/dri/Android.mk | 112 +++ src/gallium/winsys/sw/dri/Android.mk | 35 ++ src/gallium/winsys/sw/kms-dri/Android.mk | 37 ++ 4 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 src/gallium/targets/dri/Android.mk create mode 100644 src/gallium/winsys/sw/dri/Android.mk create mode 100644 src/gallium/winsys/sw/kms-dri/Android.mk diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk index aaa07bc..a9c34d9 100644 --- a/src/gallium/Android.mk +++ b/src/gallium/Android.mk @@ -33,7 +33,9 @@ SUBDIRS := auxiliary # # swrast -SUBDIRS += winsys/sw/android drivers/softpipe +ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),) +SUBDIRS += winsys/sw/dri winsys/sw/kms-dri drivers/softpipe +endif # freedreno ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),) @@ -79,6 +81,7 @@ ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),) SUBDIRS += winsys/svga/drm drivers/svga endif -SUBDIRS += state_trackers/dri +# Gallium state trackers and target for dri +SUBDIRS += state_trackers/dri targets/dri include $(call all-named-subdir-makefiles,$(SUBDIRS)) diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk new file mode 100644 index 000..ac33a6e --- /dev/null +++ b/src/gallium/targets/dri/Android.mk @@ -0,0 +1,112 @@ +# Mesa 3-D graphics library +# +# Copyright (C) 2015 Chih-Wei Huang +# Copyright (C) 2015 Android-x86 Open Source Project +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := gallium_dri + +ifeq ($(MESA_LOLLIPOP_BUILD),true) +LOCAL_MODULE_RELATIVE_PATH := $(notdir $(MESA_DRI_MODULE_PATH)) +else +LOCAL_MODULE_PATH := $(MESA_DRI_MODULE_PATH) +endif + +LOCAL_SRC_FILES := target.c + +LOCAL_CFLAGS := -DDRI_TARGET -DHAVE_LIBDRM + +LOCAL_SHARED_LIBRARIES := \ + libdl \ + libglapi \ + libexpat \ + +# swrast only? +ifeq ($(MESA_GPU_DRIVERS),swrast) +LOCAL_CFLAGS += -D__NOT_HAVE_DRM_H +else +LOCAL_SHARED_LIBRARIES += libdrm +endif + +ifneq ($(filter freedreno,$(MESA_GPU_DRIVERS)),) +LOCAL_CFLAGS += -DGALLIUM_FREEDRENO +gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno +LOCAL_SHARED_LIBRARIES += libdrm_freedreno +endif +ifneq ($(filter i915g,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_winsys_i915 libmesa_pipe_i915 +LOCAL_SHARED_LIBRARIES += libdrm_intel +LOCAL_CFLAGS += -DGALLIUM_I915 +endif +ifneq ($(filter ilo,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_winsys_intel libmesa_pipe_ilo +LOCAL_SHARED_LIBRARIES += libdrm_intel +LOCAL_CFLAGS += -DGALLIUM_ILO +endif +ifneq ($(filter nouveau,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau +LOCAL_CFLAGS += -DGALLIUM_NOUVEAU +LOCAL_SHARED_LIBRARIES += libdrm_nouveau +endif +ifneq ($(filter r%,$(MESA_GPU_DRIVERS)),) +ifneq ($(filter r300g,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_pipe_r300 +LOCAL_CFLAGS += -DGALLIUM_R300 +endif +ifneq ($(filter r600g,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_pipe_r600 +LOCAL_CFLAGS += -DGALLIUM_R600 +endif +ifneq ($(filter radeonsi,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_pipe_radeonsi +LOCAL_CFLAGS += -DGALLIUM_RADEONSI +endif +gallium_DRIVERS += libmesa_winsys_radeon libmesa_pipe_radeon +LOCAL_SHARED_LIBRARIES += libdrm_radeon +endif +ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_dri libmesa_winsys_sw_kms_dri +LOCAL_CFLAGS += -DGALLIUM_SOFTPIPE +endif +ifneq ($(filter vmwgfx,$(MESA_GPU_DRIVERS)),) +gallium_DRIVERS += libmesa_winsys_svga libmesa_pipe_svga +LOCAL_CFLAGS += -DGALLIUM_VMWGFX +endif +ifneq ($(filter nouveau r600g,$(MESA_GPU_DRIVERS)),) +LOCAL_SHARED_LIBRARIES += libstlport +endif + +LOCAL_STATIC_LIBRARIES := \ + $(gallium_DRIVERS) \ +
[Mesa-dev] [PATCH v2 11/15] android: avoid building errors with stlport
The gallium debugging helpers have defined the assert macro. It causes some errors when build with Android stlport. To workaround it, do not include assert.h if the assert macro has been defined. Signed-off-by: Chih-Wei Huang --- src/util/list.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/list.h b/src/util/list.h index 9460347..0ba883a 100644 --- a/src/util/list.h +++ b/src/util/list.h @@ -40,7 +40,9 @@ #include #include +#ifndef assert #include +#endif struct list_head -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 01/15] android: loader: export the path to be included
Signed-off-by: Chih-Wei Huang --- src/egl/drivers/dri2/Android.mk | 1 - src/loader/Android.mk | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/egl/drivers/dri2/Android.mk b/src/egl/drivers/dri2/Android.mk index 5931ce8..d4d809b 100644 --- a/src/egl/drivers/dri2/Android.mk +++ b/src/egl/drivers/dri2/Android.mk @@ -45,7 +45,6 @@ endif LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/mapi \ $(MESA_TOP)/src/egl/main \ - $(MESA_TOP)/src/loader \ $(DRM_GRALLOC_TOP) LOCAL_STATIC_LIBRARIES := \ diff --git a/src/loader/Android.mk b/src/loader/Android.mk index 8e215de..92d9fd2 100644 --- a/src/loader/Android.mk +++ b/src/loader/Android.mk @@ -40,6 +40,8 @@ else LOCAL_SHARED_LIBRARIES := libdrm endif +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) + LOCAL_MODULE := libmesa_loader include $(MESA_COMMON_MK) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 12/15] nv50/ir: optimize the use of std::tr1::unordered_set
Instead of using unordered_set directly, the patch changes to use unordered_set and adds a wrapper template class to convert the iterators to the expected user-defined type. This avoid instantiating the template multiple times and make the object code be smaller about 4KB. Signed-off-by: Chih-Wei Huang --- src/gallium/drivers/nouveau/codegen/nv50_ir.h | 28 +++--- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 4 ++-- .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 4 +--- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 5 ++-- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h index 529dcb9..f4d52b7 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h @@ -451,6 +451,28 @@ struct Storage #define NV50_IR_INTERP_OFFSET (2 << 2) #define NV50_IR_INTERP_SAMPLEID(3 << 2) +typedef std::tr1::unordered_set voidptr_unordered_set; + +template +class ptr_unordered_set : public voidptr_unordered_set { + public: +typedef voidptr_unordered_set _base; +typedef _base::iterator _biterator; + +class iterator : public _biterator { + public: +iterator(const _biterator & i) : _biterator(i) {} +V *operator*() { return reinterpret_cast(*_biterator(*this)); } +const V *operator*() const { return reinterpret_cast(*_biterator(*this)); } +}; +typedef const iterator const_iterator; + +iterator begin() { return _base::begin(); } +iterator end() { return _base::end(); } +const_iterator begin() const { return _base::begin(); } +const_iterator end() const { return _base::end(); } +}; + // do we really want this to be a class ? class Modifier { @@ -583,10 +605,10 @@ public: static inline Value *get(Iterator&); - std::tr1::unordered_set uses; + ptr_unordered_set uses; std::list defs; - typedef std::tr1::unordered_set::iterator UseIterator; - typedef std::tr1::unordered_set::const_iterator UseCIterator; + typedef ptr_unordered_set::iterator UseIterator; + typedef ptr_unordered_set::const_iterator UseCIterator; typedef std::list::iterator DefIterator; typedef std::list::const_iterator DefCIterator; diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp index b61f3c4..669d292 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -224,7 +224,7 @@ NVC0LegalizePostRA::findFirstUses( const Instruction *texi, const Instruction *insn, std::list &uses, - std::tr1::unordered_set& visited) + ptr_unordered_set& visited) { for (int d = 0; insn->defExists(d); ++d) { Value *v = insn->getDef(d); @@ -318,7 +318,7 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn) if (!uses) return false; for (size_t i = 0; i < texes.size(); ++i) { - std::tr1::unordered_set visited; + ptr_unordered_set visited; findFirstUses(texes[i], texes[i], uses[i], visited); } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h index 260e101..17b6f6f 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h @@ -20,8 +20,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include - #include "codegen/nv50_ir.h" #include "codegen/nv50_ir_build_util.h" @@ -73,7 +71,7 @@ private: inline bool insnDominatedBy(const Instruction *, const Instruction *) const; void findFirstUses(const Instruction *tex, const Instruction *def, std::list&, - std::tr1::unordered_set&); + ptr_unordered_set&); void findOverwritingDefs(const Instruction *tex, Instruction *insn, const BasicBlock *term, std::list&); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp index 898653c..03acba7 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp @@ -25,7 +25,6 @@ #include #include -#include namespace nv50_ir { @@ -1551,7 +1550,7 @@ SpillCodeInserter::run(const std::list& lst) // Keep track of which instructions to delete later. Deleting them // inside the loop is unsafe since a single instruction may have // multiple destinations that all need to be spilled (like OP_SPLIT). - std::tr1::unordered_set to_del; + ptr_unordered_set to_del; for (Value::DefIterator d = lval->defs.begin(
[Mesa-dev] [PATCH v2 14/15] android: nv50/ir: make the code be compatible with stlport
The stlport uses std::tr1::unordered_set instead of std::unordered_set. Besides, std::isfinite has to be exported. Determine whether to build with lollipop libcxx or stlport. Signed-off-by: Chih-Wei Huang --- src/gallium/drivers/nouveau/codegen/nv50_ir.h | 5 + 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h index f8316f7..2bfc792 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h @@ -31,8 +31,13 @@ #include #if __cplusplus >= 201103L #include +#ifdef _USING_LIBCXX typedef std::unordered_set voidptr_unordered_set; #else +typedef std::tr1::unordered_set voidptr_unordered_set; +using std::isfinite; +#endif +#else #include typedef std::tr1::unordered_set voidptr_unordered_set; #endif -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 08/15] egl/main: let EGL_RECORDABLE_ANDROID be a valid attrib
Signed-off-by: Chih-Wei Huang --- src/egl/main/eglconfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index 84cb227..7121b3d 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -86,6 +86,7 @@ struct _egl_config /* extensions */ EGLint YInvertedNOK; + EGLint RecordableAndroid; }; @@ -133,6 +134,7 @@ _eglOffsetOfConfig(EGLint attr) ATTRIB_MAP(EGL_CONFORMANT,Conformant); /* extensions */ ATTRIB_MAP(EGL_Y_INVERTED_NOK,YInvertedNOK); + ATTRIB_MAP(EGL_RECORDABLE_ANDROID,RecordableAndroid); #undef ATTRIB_MAP default: return -1; -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 13/15] nv50/ir: use C++11 compliant unordered_set if possible
If build with C++11 standard, use std::unordered_set instead of std::tr1::unordered_set. Signed-off-by: Chih-Wei Huang --- Android.common.mk | 1 + src/gallium/auxiliary/Android.mk | 2 -- src/gallium/drivers/nouveau/codegen/nv50_ir.h | 8 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Android.common.mk b/Android.common.mk index 43766bf..45474ee 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -77,6 +77,7 @@ LOCAL_CFLAGS += \ endif LOCAL_CPPFLAGS += \ + -std=c++11 \ -Wno-error=non-virtual-dtor \ -Wno-non-virtual-dtor diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk index 2d91752..4a914ab 100644 --- a/src/gallium/auxiliary/Android.mk +++ b/src/gallium/auxiliary/Android.mk @@ -39,8 +39,6 @@ ifeq ($(MESA_ENABLE_LLVM),true) LOCAL_SRC_FILES += \ $(GALLIVM_SOURCES) \ $(GALLIVM_CPP_SOURCES) - -LOCAL_CPPFLAGS := -std=c++11 endif LOCAL_MODULE := libmesa_gallium diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h index f4d52b7..f8316f7 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h @@ -29,7 +29,13 @@ #include #include #include +#if __cplusplus >= 201103L +#include +typedef std::unordered_set voidptr_unordered_set; +#else #include +typedef std::tr1::unordered_set voidptr_unordered_set; +#endif #include "codegen/nv50_ir_util.h" #include "codegen/nv50_ir_graph.h" @@ -451,8 +457,6 @@ struct Storage #define NV50_IR_INTERP_OFFSET (2 << 2) #define NV50_IR_INTERP_SAMPLEID(3 << 2) -typedef std::tr1::unordered_set voidptr_unordered_set; - template class ptr_unordered_set : public voidptr_unordered_set { public: -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 07/15] android: clean up the makefile of libGLES_mesa
Most of the rules for the gallium drivers has been moved to src/gallium/targets/dri/Android.mk. Signed-off-by: Chih-Wei Huang --- src/egl/main/Android.mk | 75 + 1 file changed, 1 insertion(+), 74 deletions(-) diff --git a/src/egl/main/Android.mk b/src/egl/main/Android.mk index 27d0b18..8f687e9 100644 --- a/src/egl/main/Android.mk +++ b/src/egl/main/Android.mk @@ -43,8 +43,6 @@ LOCAL_CFLAGS := \ -D_EGL_DRIVER_SEARCH_DIR=\"/system/lib/egl\" \ -D_EGL_OS_UNIX=1 -LOCAL_STATIC_LIBRARIES := - LOCAL_SHARED_LIBRARIES := \ libglapi \ libdl \ @@ -63,7 +61,6 @@ LOCAL_SHARED_LIBRARIES += libdrm endif LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2 -LOCAL_STATIC_LIBRARIES += libmesa_egl_dri2 ifeq ($(strip $(MESA_BUILD_CLASSIC)),true) # require i915_dri and/or i965_dri @@ -72,81 +69,11 @@ LOCAL_REQUIRED_MODULES += \ endif # MESA_BUILD_CLASSIC ifeq ($(strip $(MESA_BUILD_GALLIUM)),true) - -gallium_DRIVERS := - -# freedreno -ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno -LOCAL_SHARED_LIBRARIES += libdrm_freedreno -endif - -# i915g -ifneq ($(filter i915g, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_i915 libmesa_pipe_i915 -LOCAL_SHARED_LIBRARIES += libdrm_intel -endif - -# ilo -ifneq ($(filter ilo, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_intel libmesa_pipe_ilo -LOCAL_SHARED_LIBRARIES += libdrm_intel -endif - -# nouveau -ifneq ($(filter nouveau, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau -LOCAL_SHARED_LIBRARIES += libdrm_nouveau -LOCAL_SHARED_LIBRARIES += libstlport -endif - -# r300g/r600g/radeonsi -ifneq ($(filter r300g r600g radeonsi, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_radeon -LOCAL_SHARED_LIBRARIES += libdrm_radeon -ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_pipe_r300 -endif # r300g -ifneq ($(filter r600g radeonsi, $(MESA_GPU_DRIVERS)),) -ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_pipe_r600 -LOCAL_SHARED_LIBRARIES += libstlport -endif # r600g -ifneq ($(filter radeonsi, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_pipe_radeonsi -endif # radeonsi -gallium_DRIVERS += libmesa_pipe_radeon -endif # r600g || radeonsi -endif # r300g || r600g || radeonsi - -# vmwgfx -ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),) -gallium_DRIVERS += libmesa_winsys_svga libmesa_pipe_svga -endif - -# -# Notes about the order here: -# -# * libmesa_st_egl depends on libmesa_winsys_sw_android in $(gallium_DRIVERS) -# * libmesa_pipe_r300 in $(gallium_DRIVERS) depends on libmesa_st_mesa and -#libmesa_glsl -# * libmesa_st_mesa depends on libmesa_glsl -# * libmesa_glsl depends on libmesa_glsl_utils -# -LOCAL_STATIC_LIBRARIES := \ - $(gallium_DRIVERS) \ - libmesa_st_mesa \ - libmesa_util \ - libmesa_glsl \ - libmesa_glsl_utils \ - libmesa_gallium \ - $(LOCAL_STATIC_LIBRARIES) - LOCAL_REQUIRED_MODULES += gallium_dri endif # MESA_BUILD_GALLIUM LOCAL_STATIC_LIBRARIES := \ - $(LOCAL_STATIC_LIBRARIES) \ + libmesa_egl_dri2 \ libmesa_loader LOCAL_MODULE := libGLES_mesa -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 02/15] android: export more dirs from libmesa_dri_common
The include paths of libmesa_dri_common are also used by modules that need libmesa_dri_common. Signed-off-by: Chih-Wei Huang --- src/mesa/drivers/dri/common/Android.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/common/Android.mk b/src/mesa/drivers/dri/common/Android.mk index a7fcd6d..c003c94 100644 --- a/src/mesa/drivers/dri/common/Android.mk +++ b/src/mesa/drivers/dri/common/Android.mk @@ -39,7 +39,9 @@ intermediates := $(call local-generated-sources-dir) LOCAL_C_INCLUDES := \ $(MESA_DRI_C_INCLUDES) -LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates) +LOCAL_EXPORT_C_INCLUDE_DIRS := \ +$(LOCAL_PATH) \ +$(intermediates) # swrast only ifeq ($(MESA_GPU_DRIVERS),swrast) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 05/15] android: enable the rules to build gallium st/dri
The libmesa_dri_common and libmesa_egl_dri2 should not be limited to the classical drivers only. Allow them to be built with the gallium drivers. v2: add a clean step to rebuild all dri modules properly. Signed-off-by: Chih-Wei Huang --- Android.mk | 6 +- CleanSpec.mk| 1 + src/egl/main/Android.mk | 8 ++-- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Android.mk b/Android.mk index b19419b..6a09a9d 100644 --- a/Android.mk +++ b/Android.mk @@ -89,13 +89,9 @@ SUBDIRS := \ src/glsl \ src/mesa \ src/util \ - src/egl/main - -ifeq ($(strip $(MESA_BUILD_CLASSIC)),true) -SUBDIRS += \ + src/egl/main \ src/egl/drivers/dri2 \ src/mesa/drivers/dri -endif ifeq ($(strip $(MESA_BUILD_GALLIUM)),true) SUBDIRS += src/gallium diff --git a/CleanSpec.mk b/CleanSpec.mk index 2068163..d08b0de 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -13,3 +13,4 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/SHARED_LIBRARIES/libGLES_mesa_int $(call add-clean-step, rm -rf $(HOST_OUT_release)/*/EXECUTABLES/mesa_*_intermediates) $(call add-clean-step, rm -rf $(HOST_OUT_release)/*/EXECUTABLES/glsl_compiler_intermediates) $(call add-clean-step, rm -rf $(HOST_OUT_release)/*/STATIC_LIBRARIES/libmesa_*_intermediates) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/SHARED_LIBRARIES/*_dri_intermediates) diff --git a/src/egl/main/Android.mk b/src/egl/main/Android.mk index 12b66d0..27d0b18 100644 --- a/src/egl/main/Android.mk +++ b/src/egl/main/Android.mk @@ -62,10 +62,10 @@ ifneq ($(MESA_GPU_DRIVERS),swrast) LOCAL_SHARED_LIBRARIES += libdrm endif -ifeq ($(strip $(MESA_BUILD_CLASSIC)),true) LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2 LOCAL_STATIC_LIBRARIES += libmesa_egl_dri2 +ifeq ($(strip $(MESA_BUILD_CLASSIC)),true) # require i915_dri and/or i965_dri LOCAL_REQUIRED_MODULES += \ $(addsuffix _dri, $(filter i915 i965, $(MESA_GPU_DRIVERS))) @@ -75,9 +75,6 @@ ifeq ($(strip $(MESA_BUILD_GALLIUM)),true) gallium_DRIVERS := -# swrast -gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_android - # freedreno ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),) gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno @@ -137,8 +134,6 @@ endif # * libmesa_glsl depends on libmesa_glsl_utils # LOCAL_STATIC_LIBRARIES := \ - libmesa_egl_gallium \ - libmesa_st_egl \ $(gallium_DRIVERS) \ libmesa_st_mesa \ libmesa_util \ @@ -147,6 +142,7 @@ LOCAL_STATIC_LIBRARIES := \ libmesa_gallium \ $(LOCAL_STATIC_LIBRARIES) +LOCAL_REQUIRED_MODULES += gallium_dri endif # MESA_BUILD_GALLIUM LOCAL_STATIC_LIBRARIES := \ -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 12/15] nv50/ir: optimize the use of std::tr1::unordered_set
2015-05-20 16:35 GMT+08:00 Petri Latvala : > On 05/20/2015 06:30 AM, Ilia Mirkin wrote: >> >> +typedef const iterator const_iterator; >> + > > This at least is wrong. A const iterator allows *iter = val, a > const_iterator doesn't. A const_iterator allows ++, a const iterator > doesn't. You're right. Thank you! The const_iterator should be derived from _base::const_iterator. After review the code again, the unordered_set::const_iterator is not used except in Value::UseCIterator, but the latter is not used, either. So I think it's safe to remove it at all. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 14/16] android: add inital NIR build
2015-03-29 4:54 GMT+08:00 Emil Velikov : > From: Mauro Rossi > > Required by the i965 driver. > > Cc: "10.5" > [Emil Velikov: Split from a larger commit] > Signed-off-by: Emil Velikov > --- > src/glsl/Android.gen.mk | 62 > +++-- > src/glsl/Android.mk | 3 +- > src/mesa/drivers/dri/Android.mk | 1 + > 3 files changed, 63 insertions(+), 3 deletions(-) > > diff --git a/src/glsl/Android.gen.mk b/src/glsl/Android.gen.mk > index 7ec56d4..82f2bf1 100644 > --- a/src/glsl/Android.gen.mk > +++ b/src/glsl/Android.gen.mk > @@ -33,11 +33,21 @@ sources := \ > glsl_lexer.cpp \ > glsl_parser.cpp \ > glcpp/glcpp-lex.c \ > - glcpp/glcpp-parse.c > + glcpp/glcpp-parse.c \ > + nir/nir_builder_opcodes.h \ > + nir/nir_constant_expressions.c \ > + nir/nir_opcodes.c \ > + nir/nir_opcodes.h \ > + nir/nir_opt_algebraic.c > > LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES)) > > -LOCAL_C_INCLUDES += $(intermediates) $(intermediates)/glcpp > $(MESA_TOP)/src/glsl/glcpp > +LOCAL_C_INCLUDES += \ > + $(intermediates) \ > + $(intermediates)/glcpp \ > + $(intermediates)/nir \ > + $(MESA_TOP)/src/glsl/glcpp \ > + $(MESA_TOP)/src/glsl/nir > > sources := $(addprefix $(intermediates)/, $(sources)) > LOCAL_GENERATED_SOURCES += $(sources) > @@ -77,3 +87,51 @@ $(intermediates)/glcpp/glcpp-lex.c: > $(LOCAL_PATH)/glcpp/glcpp-lex.l > > $(intermediates)/glcpp/glcpp-parse.c: $(LOCAL_PATH)/glcpp/glcpp-parse.y > $(call glsl_local-y-to-c-and-h) > + > +nir_builder_opcodes_gen := $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py > +nir_builder_opcodes_deps := \ > + $(LOCAL_PATH)/nir/nir_opcodes.py \ > + $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py > + > +$(intermediates)/nir/nir_builder_opcodes.h: $(nir_builder_opcodes_deps) > + @mkdir -p $(dir $@) @mkdir -p $(@D) > + @$(MESA_PYTHON2) $(nir_builder_opcodes_gen) $< > $@ Use $(hide) instead of @ > + > +nir_constant_expressions_gen := $(LOCAL_PATH)/nir/nir_constant_expressions.py > +nir_constant_expressions_deps := \ > + $(LOCAL_PATH)/nir/nir_opcodes.py \ > + $(LOCAL_PATH)/nir/nir_constant_expressions.py \ > + $(LOCAL_PATH)/nir/nir_constant_expressions.h > + > +$(intermediates)/nir/nir_constant_expressions.c: > $(nir_constant_expressions_deps) > + @mkdir -p $(dir $@) > + @$(MESA_PYTHON2) $(nir_constant_expressions_gen) $< > $@ Use $(hide) instead of @ > + > +nir_opcodes_h_gen := $(LOCAL_PATH)/nir/nir_opcodes_h.py > +nir_opcodes_h_deps := \ > + $(LOCAL_PATH)/nir/nir_opcodes.py \ > + $(LOCAL_PATH)/nir/nir_opcodes_h.py > + > +$(intermediates)/nir/nir_opcodes.h: $(nir_opcodes_h_deps) > + @mkdir -p $(dir $@) > + @$(MESA_PYTHON2) $(nir_opcodes_h_gen) $< > $@ Use $(hide) instead of @ > + > +$(LOCAL_PATH)/nir/nir.h: $(intermediates)/nir/nir_opcodes.h > + > +nir_opcodes_c_gen := $(LOCAL_PATH)/nir/nir_opcodes_c.py > +nir_opcodes_c_deps := \ > + $(LOCAL_PATH)/nir/nir_opcodes.py \ > + $(LOCAL_PATH)/nir/nir_opcodes_c.py > + > +$(intermediates)/nir/nir_opcodes.c: $(nir_opcodes_c_deps) > + @mkdir -p $(dir $@) > + @$(MESA_PYTHON2) $(nir_opcodes_c_gen) $< > $@ Use $(hide) instead of @ > + > +nir_opt_algebraic_gen := $(LOCAL_PATH)/nir/nir_opt_algebraic.py > +nir_opt_algebraic_deps := \ > + $(LOCAL_PATH)/nir/nir_opt_algebraic.py \ > + $(LOCAL_PATH)/nir/nir_algebraic.py > + > +$(intermediates)/nir/nir_opt_algebraic.c: $(nir_opt_algebraic_deps) > + @mkdir -p $(dir $@) > + @$(MESA_PYTHON2) $(nir_opt_algebraic_gen) $< > $@ Use $(hide) instead of @ > diff --git a/src/glsl/Android.mk b/src/glsl/Android.mk > index 356f44e..f20741e 100644 > --- a/src/glsl/Android.mk > +++ b/src/glsl/Android.mk > @@ -35,7 +35,8 @@ include $(CLEAR_VARS) > > LOCAL_SRC_FILES := \ > $(LIBGLCPP_FILES) \ > - $(LIBGLSL_FILES) > + $(LIBGLSL_FILES) \ > + $(NIR_FILES) > > LOCAL_C_INCLUDES := \ > $(MESA_TOP)/src/mapi \ > diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk > index 64e237b..764cd5a 100644 > --- a/src/mesa/drivers/dri/Android.mk > +++ b/src/mesa/drivers/dri/Android.mk > @@ -36,6 +36,7 @@ MESA_DRI_CFLAGS := \ > > MESA_DRI_C_INCLUDES := \ > $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_dri_common) \ > + $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_glsl)/nir \ I prefer this hunk be replaced by a more simpler solution: diff --git a/src/glsl/Android.gen.mk b/src/glsl/Android.gen.mk index 82f2bf1..cc2e633 100644 --- a/src/glsl/Android.gen.mk +++ b/src/glsl/Android.gen.mk @@ -49,6 +49,9 @@ LOCAL_C_INCLUDES += \ $(MESA_TOP)/src/glsl/glcpp \ $(MESA_TOP)/src/glsl/nir +LOCAL_EXPORT_C_INCLUDE_DIRS += \ + $(intermediates)/nir + sources := $(addprefix $(intermedia
[Mesa-dev] [PATCH 0/2] More Android patches
First, thanks to Emil who submitted a series of patches to fix Android building issues for the master branch. However, there are still some errors in my test. These patches try to fix them. The patches are based on Emil's 'submit/android-fixes#1' branch. With them I'm able to build the i915 and i965 drivers for android-x86. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] android: export the path of the generated nir_opcodes.h
The modules including nir_opcodes.h can just add libmesa_glsl to their LOCAL_STATIC_LIBRARIES. Signed-off-by: Chih-Wei Huang --- src/glsl/Android.gen.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/Android.gen.mk b/src/glsl/Android.gen.mk index 82f2bf1..35d79f2 100644 --- a/src/glsl/Android.gen.mk +++ b/src/glsl/Android.gen.mk @@ -49,6 +49,8 @@ LOCAL_C_INCLUDES += \ $(MESA_TOP)/src/glsl/glcpp \ $(MESA_TOP)/src/glsl/nir +LOCAL_EXPORT_C_INCLUDE_DIRS += $(intermediates)/nir + sources := $(addprefix $(intermediates)/, $(sources)) LOCAL_GENERATED_SOURCES += $(sources) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] android: fix a building error of libmesa_program
Add libmesa_glsl to LOCAL_STATIC_LIBRARIES to get its exported include path (for nir_opcodes.h). Signed-off-by: Chih-Wei Huang --- src/mesa/program/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/program/Android.mk b/src/mesa/program/Android.mk index 374fcbf..af16e77 100644 --- a/src/mesa/program/Android.mk +++ b/src/mesa/program/Android.mk @@ -44,6 +44,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := libmesa_program LOCAL_MODULE_CLASS := STATIC_LIBRARIES +LOCAL_STATIC_LIBRARIES := libmesa_glsl intermediates := $(call local-intermediates-dir) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] i915: add mock implementation of GL_OES_EGL_image_external
This is similar to commit 7420c9dab4aaf87e6b840410226c296c4668a48f but for the i915 driver. It's necessary to support android-x86. Signed-off-by: Chih-Wei Huang --- src/mesa/drivers/dri/i915/i830_texstate.c| 1 + src/mesa/drivers/dri/i915/i915_fragprog.c| 1 + src/mesa/drivers/dri/i915/i915_state.c | 1 + src/mesa/drivers/dri/i915/i915_tex_layout.c | 2 ++ src/mesa/drivers/dri/i915/i915_texstate.c| 1 + src/mesa/drivers/dri/i915/intel_extensions.c | 1 + 6 files changed, 7 insertions(+) diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 00731e6..a14adb9 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -336,6 +336,7 @@ i830UpdateTextureState(struct intel_context *intel) case GL_TEXTURE_1D: case GL_TEXTURE_2D: case GL_TEXTURE_CUBE_MAP: + case TEXTURE_EXTERNAL_BIT: ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_NORMAL); break; case GL_TEXTURE_RECTANGLE: diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 9b00223..508073a 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -241,6 +241,7 @@ translate_tex_src_target(struct i915_fragment_program *p, GLubyte bit) case TEXTURE_1D_INDEX: return D0_SAMPLE_TYPE_2D; case TEXTURE_2D_INDEX: + case TEXTURE_EXTERNAL_INDEX: return D0_SAMPLE_TYPE_2D; case TEXTURE_RECT_INDEX: return D0_SAMPLE_TYPE_2D; diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 32e5f98..68a733b 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -777,6 +777,7 @@ i915Enable(struct gl_context * ctx, GLenum cap, GLboolean state) switch (cap) { case GL_TEXTURE_2D: + case GL_TEXTURE_EXTERNAL_OES: break; case GL_LIGHTING: diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c index d416d46..f534bed 100644 --- a/src/mesa/drivers/dri/i915/i915_tex_layout.c +++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c @@ -236,6 +236,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt) break; case GL_TEXTURE_1D: case GL_TEXTURE_2D: + case GL_TEXTURE_EXTERNAL_OES: case GL_TEXTURE_RECTANGLE_ARB: i915_miptree_layout_2d(mt); break; @@ -468,6 +469,7 @@ i945_miptree_layout(struct intel_mipmap_tree * mt) break; case GL_TEXTURE_1D: case GL_TEXTURE_2D: + case GL_TEXTURE_EXTERNAL_OES: case GL_TEXTURE_RECTANGLE_ARB: i945_miptree_layout_2d(mt); break; diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 000ab6e..75123f5 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -423,6 +423,7 @@ i915UpdateTextureState(struct intel_context *intel) case GL_TEXTURE_2D: case GL_TEXTURE_CUBE_MAP: case GL_TEXTURE_3D: + case GL_TEXTURE_EXTERNAL_OES: ok = i915_update_tex_unit(intel, i, SS3_NORMALIZED_COORDS); break; case GL_TEXTURE_RECTANGLE: diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c index ab7820f..eca6234 100644 --- a/src/mesa/drivers/dri/i915/intel_extensions.c +++ b/src/mesa/drivers/dri/i915/intel_extensions.c @@ -76,6 +76,7 @@ intelInitExtensions(struct gl_context *ctx) ctx->Extensions.TDFX_texture_compression_FXT1 = true; ctx->Extensions.OES_EGL_image = true; ctx->Extensions.OES_draw_texture = true; + ctx->Extensions.OES_EGL_image_external = true; ctx->Const.GLSLVersion = 120; _mesa_override_glsl_version(&ctx->Const); -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/6] android: export the path of the generated headers
The modules need the headers can get the path automatically. Signed-off-by: Chih-Wei Huang --- src/mesa/Android.libmesa_dricore.mk| 1 - src/mesa/Android.libmesa_st_mesa.mk| 1 - src/mesa/drivers/dri/Android.mk| 2 -- src/mesa/drivers/dri/common/Android.mk | 2 ++ src/mesa/program/Android.mk| 2 ++ 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/Android.libmesa_dricore.mk b/src/mesa/Android.libmesa_dricore.mk index da6176a..7758d54 100644 --- a/src/mesa/Android.libmesa_dricore.mk +++ b/src/mesa/Android.libmesa_dricore.mk @@ -60,7 +60,6 @@ LOCAL_CFLAGS += \ endif LOCAL_C_INCLUDES := \ - $(call intermediates-dir-for STATIC_LIBRARIES,libmesa_program,,) \ $(MESA_TOP)/src/mapi \ $(MESA_TOP)/src/mesa/main \ $(MESA_TOP)/src/glsl \ diff --git a/src/mesa/Android.libmesa_st_mesa.mk b/src/mesa/Android.libmesa_st_mesa.mk index e02030b..b4b7fd9 100644 --- a/src/mesa/Android.libmesa_st_mesa.mk +++ b/src/mesa/Android.libmesa_st_mesa.mk @@ -52,7 +52,6 @@ LOCAL_CFLAGS := \ endif LOCAL_C_INCLUDES := \ - $(call intermediates-dir-for STATIC_LIBRARIES,libmesa_program,,) \ $(MESA_TOP)/src/mapi \ $(MESA_TOP)/src/mesa/main \ $(MESA_TOP)/src/glsl \ diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk index 09ce55a..d399666 100644 --- a/src/mesa/drivers/dri/Android.mk +++ b/src/mesa/drivers/dri/Android.mk @@ -34,8 +34,6 @@ MESA_DRI_CFLAGS := \ -DHAVE_ANDROID_PLATFORM MESA_DRI_C_INCLUDES := \ - $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_dri_common) \ - $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_glsl)/nir \ $(addprefix $(MESA_TOP)/, $(mesa_dri_common_INCLUDES)) \ $(MESA_TOP)/src/gallium/include \ $(MESA_TOP)/src/gallium/auxiliary \ diff --git a/src/mesa/drivers/dri/common/Android.mk b/src/mesa/drivers/dri/common/Android.mk index 458e4e9..511d4af 100644 --- a/src/mesa/drivers/dri/common/Android.mk +++ b/src/mesa/drivers/dri/common/Android.mk @@ -39,6 +39,8 @@ intermediates := $(call local-generated-sources-dir) LOCAL_C_INCLUDES := \ $(MESA_DRI_C_INCLUDES) +LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates) + # swrast only ifeq ($(MESA_GPU_DRIVERS),swrast) LOCAL_CFLAGS := -D__NOT_HAVE_DRM_H diff --git a/src/mesa/program/Android.mk b/src/mesa/program/Android.mk index 9a6f962..ccb0fa5 100644 --- a/src/mesa/program/Android.mk +++ b/src/mesa/program/Android.mk @@ -78,5 +78,7 @@ LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/gallium/auxiliary \ $(MESA_TOP)/src/gallium/include +LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates) + include $(MESA_COMMON_MK) include $(BUILD_STATIC_LIBRARY) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/6] android: fix building issues of host binaries
Define _GNU_SOURCE to enable features (__USE_XOPEN2K and __USE_UNIX98) required to build the host binaries. Signed-off-by: Chih-Wei Huang --- Android.common.mk| 2 +- src/mesa/Android.mesa_gen_matypes.mk | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Android.common.mk b/Android.common.mk index a4ee181..edf52d6 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -24,7 +24,7 @@ # use c99 compiler by default ifeq ($(LOCAL_CC),) ifeq ($(LOCAL_IS_HOST_MODULE),true) -LOCAL_CC := $(HOST_CC) -std=c99 +LOCAL_CC := $(HOST_CC) -std=c99 -D_GNU_SOURCE else LOCAL_CC := $(TARGET_CC) -std=c99 endif diff --git a/src/mesa/Android.mesa_gen_matypes.mk b/src/mesa/Android.mesa_gen_matypes.mk index 5521087..6e301f9 100644 --- a/src/mesa/Android.mesa_gen_matypes.mk +++ b/src/mesa/Android.mesa_gen_matypes.mk @@ -33,7 +33,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := mesa_gen_matypes LOCAL_IS_HOST_MODULE := true -LOCAL_CFLAGS := -D_POSIX_C_SOURCE=199309L LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/mapi \ -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/6] android: fix the building rules for Android 5.0
Android 5.0 allows modules to generate source into $OUT/gen, which will then be copied into $OUT/obj and $OUT/obj_$(TARGET_2ND_ARCH) as necessary. Modules will need to change calls to local-intermediates-dir into local-generated-sources-dir. The patch changes local-intermediates-dir into local-generated-sources-dir. If the Android version is less than 5.0, fallback to local-intermediates-dir. The patch also fixes the 64-bit building issue of Android 5.0. Signed-off-by: Chih-Wei Huang --- Android.mk | 7 +++ src/egl/drivers/dri2/Android.mk| 8 +++- src/egl/main/Android.mk| 4 src/gallium/auxiliary/Android.mk | 2 +- src/gallium/auxiliary/os/os_mman.h | 2 +- src/glsl/Android.gen.mk| 3 +-- src/mapi/Android.mk| 2 +- src/mesa/Android.gen.mk| 2 +- src/mesa/drivers/dri/Android.mk| 1 - src/mesa/drivers/dri/common/Android.mk | 3 +-- src/mesa/drivers/dri/i915/Android.mk | 5 - src/mesa/drivers/dri/i965/Android.mk | 5 - src/mesa/program/Android.mk| 3 +-- src/util/Android.mk| 4 ++-- 14 files changed, 35 insertions(+), 16 deletions(-) diff --git a/Android.mk b/Android.mk index 87ed464..b19419b 100644 --- a/Android.mk +++ b/Android.mk @@ -34,6 +34,13 @@ MESA_TOP := $(call my-dir) MESA_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION))) MESA_ANDROID_MINOR_VERSION := $(word 2, $(subst ., , $(PLATFORM_VERSION))) MESA_ANDROID_VERSION := $(MESA_ANDROID_MAJOR_VERSION).$(MESA_ANDROID_MINOR_VERSION) +ifeq ($(filter 1 2 3 4,$(MESA_ANDROID_MAJOR_VERSION)),) +MESA_LOLLIPOP_BUILD := true +else +define local-generated-sources-dir +$(call local-intermediates-dir) +endef +endif MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk MESA_PYTHON2 := python diff --git a/src/egl/drivers/dri2/Android.mk b/src/egl/drivers/dri2/Android.mk index d48506a..5931ce8 100644 --- a/src/egl/drivers/dri2/Android.mk +++ b/src/egl/drivers/dri2/Android.mk @@ -32,10 +32,16 @@ LOCAL_SRC_FILES := \ platform_android.c LOCAL_CFLAGS := \ - -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" \ -DHAVE_SHARED_GLAPI \ -DHAVE_ANDROID_PLATFORM +ifeq ($(MESA_LOLLIPOP_BUILD),true) +LOCAL_CFLAGS_x86 := -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" +LOCAL_CFLAGS_x86_64 := -DDEFAULT_DRIVER_DIR=\"/system/lib64/dri\" +else +LOCAL_CFLAGS += -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" +endif + LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/mapi \ $(MESA_TOP)/src/egl/main \ diff --git a/src/egl/main/Android.mk b/src/egl/main/Android.mk index 4d0cc57..12b66d0 100644 --- a/src/egl/main/Android.mk +++ b/src/egl/main/Android.mk @@ -154,7 +154,11 @@ LOCAL_STATIC_LIBRARIES := \ libmesa_loader LOCAL_MODULE := libGLES_mesa +ifeq ($(MESA_LOLLIPOP_BUILD),true) +LOCAL_MODULE_RELATIVE_PATH := egl +else LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl +endif include $(MESA_COMMON_MK) include $(BUILD_SHARED_LIBRARY) diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk index c7b2634..96a2125 100644 --- a/src/gallium/auxiliary/Android.mk +++ b/src/gallium/auxiliary/Android.mk @@ -39,7 +39,7 @@ LOCAL_MODULE := libmesa_gallium # generate sources LOCAL_MODULE_CLASS := STATIC_LIBRARIES -intermediates := $(call local-intermediates-dir) +intermediates := $(call local-generated-sources-dir) LOCAL_GENERATED_SOURCES := $(addprefix $(intermediates)/, $(GENERATED_SOURCES)) $(LOCAL_GENERATED_SOURCES): PRIVATE_PYTHON := $(MESA_PYTHON2) diff --git a/src/gallium/auxiliary/os/os_mman.h b/src/gallium/auxiliary/os/os_mman.h index 3fc8c43..e892610 100644 --- a/src/gallium/auxiliary/os/os_mman.h +++ b/src/gallium/auxiliary/os/os_mman.h @@ -54,7 +54,7 @@ extern "C" { #endif -#if defined(PIPE_OS_ANDROID) +#if defined(PIPE_OS_ANDROID) && !defined(__LP64__) extern void *__mmap2(void *, size_t, int, int, int, size_t); diff --git a/src/glsl/Android.gen.mk b/src/glsl/Android.gen.mk index 35d79f2..5591f9d 100644 --- a/src/glsl/Android.gen.mk +++ b/src/glsl/Android.gen.mk @@ -27,7 +27,7 @@ ifeq ($(LOCAL_MODULE_CLASS),) LOCAL_MODULE_CLASS := STATIC_LIBRARIES endif -intermediates := $(call local-intermediates-dir) +intermediates := $(call local-generated-sources-dir) sources := \ glsl_lexer.cpp \ @@ -43,7 +43,6 @@ sources := \ LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES)) LOCAL_C_INCLUDES += \ - $(intermediates) \ $(intermediates)/glcpp \ $(intermediates)/nir \ $(MESA_TOP)/src/glsl/glcpp \ diff --git a/src/mapi/Android.mk b/src/mapi/Android.mk index f104378..4445218 100644 --- a/src/mapi/Android.mk +++ b/src/mapi/Android.mk @@ -53,7 +53,7 @@ LOCAL_C_INCLUDES := \ LOCAL_MODULE := libglapi LOCAL_MODULE_CLASS := SHARED_LIBRARIES -intermediates := $(call local-intermediates-dir) +interm
[Mesa-dev] [PATCH 4/6] android: refine the rules to generate xmlpool/options.h
The patch gets rid of the last use of intermediates-dir-for. Signed-off-by: Chih-Wei Huang --- src/mesa/drivers/dri/Android.mk| 3 --- src/mesa/drivers/dri/common/Android.mk | 18 -- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk index d399666..b18c8a2 100644 --- a/src/mesa/drivers/dri/Android.mk +++ b/src/mesa/drivers/dri/Android.mk @@ -54,9 +54,6 @@ MESA_DRI_SHARED_LIBRARIES := \ libglapi \ liblog -# All DRI modules must add this to LOCAL_GENERATED_SOURCES. -MESA_DRI_OPTIONS_H := $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_dri_common)/xmlpool/options.h - #--- # Build drivers and libmesa_dri_common diff --git a/src/mesa/drivers/dri/common/Android.mk b/src/mesa/drivers/dri/common/Android.mk index 511d4af..6ccfe27 100644 --- a/src/mesa/drivers/dri/common/Android.mk +++ b/src/mesa/drivers/dri/common/Android.mk @@ -50,8 +50,8 @@ endif LOCAL_SRC_FILES := $(DRI_COMMON_FILES) -LOCAL_GENERATED_SOURCES := \ -$(intermediates)/xmlpool/options.h +MESA_DRI_OPTIONS_H := $(intermediates)/xmlpool/options.h +LOCAL_GENERATED_SOURCES := $(MESA_DRI_OPTIONS_H) # # Generate options.h from gettext translations. @@ -81,16 +81,14 @@ $(intermediates)/xmlpool/%/LC_MESSAGES/options.mo: $(intermediates)/xmlpool/%.po mkdir -p $(dir $@) msgfmt -o $@ $< -$(intermediates)/xmlpool/options.h: PRIVATE_SCRIPT := $(LOCAL_PATH)/xmlpool/gen_xmlpool.py -$(intermediates)/xmlpool/options.h: PRIVATE_LOCALEDIR := $(intermediates)/xmlpool -$(intermediates)/xmlpool/options.h: PRIVATE_TEMPLATE_HEADER := $(LOCAL_PATH)/xmlpool/t_options.h -$(intermediates)/xmlpool/options.h: PRIVATE_MO_FILES := $(MESA_DRI_OPTIONS_LANGS:%=$(intermediates)/xmlpool/%/LC_MESSAGES/options.mo) +$(MESA_DRI_OPTIONS_H): PRIVATE_SCRIPT := $(LOCAL_PATH)/xmlpool/gen_xmlpool.py +$(MESA_DRI_OPTIONS_H): PRIVATE_TEMPLATE_HEADER := $(LOCAL_PATH)/xmlpool/t_options.h +$(MESA_DRI_OPTIONS_H): PRIVATE_MO_FILES := $(MESA_DRI_OPTIONS_LANGS:%=$(intermediates)/xmlpool/%/LC_MESSAGES/options.mo) .SECONDEXPANSION: -$(intermediates)/xmlpool/options.h: $$(PRIVATE_SCRIPT) $$(PRIVATE_TEMPLATE_HEADER) $$(PRIVATE_MO_FILES) - mkdir -p $(dir $@) - mkdir -p $(PRIVATE_LOCALEDIR) +$(MESA_DRI_OPTIONS_H): $$(PRIVATE_SCRIPT) $$(PRIVATE_TEMPLATE_HEADER) $$(PRIVATE_MO_FILES) + @mkdir -p $(@D) $(MESA_PYTHON2) $(PRIVATE_SCRIPT) $(PRIVATE_TEMPLATE_HEADER) \ - $(PRIVATE_LOCALEDIR) $(MESA_DRI_OPTIONS_LANGS) > $@ + $(@D) $(MESA_DRI_OPTIONS_LANGS) > $@ include $(MESA_COMMON_MK) include $(BUILD_STATIC_LIBRARY) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [[PATCH 0/6] Fix Android 5.x building issues
This is a series of patches to fix building issues with Android 5.0 (and newer version) based on Emil's 'submit/android-fixes#1' branch. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 5/6] android: build x86(-64) assembly for Android 5.0
Android 5.0 changed HOST_ARCH to x86_64 that broke the asm building rules. The patch fix the rules to build asm for both x86 and x86_64 targets. Note mesa_gen_matypes is built for 32-bit only. Signed-off-by: Chih-Wei Huang --- Android.common.mk| 9 + Android.mk | 2 +- src/mapi/Android.mk | 2 ++ src/mesa/Android.gen.mk | 2 -- src/mesa/Android.libmesa_dricore.mk | 3 +++ src/mesa/Android.libmesa_st_mesa.mk | 3 +++ src/mesa/Android.mesa_gen_matypes.mk | 3 +-- src/mesa/main/imports.h | 6 +++--- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Android.common.mk b/Android.common.mk index edf52d6..0ca6d13 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -61,10 +61,11 @@ LOCAL_CFLAGS += \ ifeq ($(strip $(MESA_ENABLE_ASM)),true) ifeq ($(TARGET_ARCH),x86) -LOCAL_CFLAGS += \ - -DUSE_X86_ASM \ - -DHAVE_DLOPEN \ - +LOCAL_CFLAGS += -DUSE_X86_ASM -DHAVE_DLOPEN +else ifeq ($(TARGET_2ND_ARCH),x86) +LOCAL_CFLAGS_x86 += -DUSE_X86_ASM -DHAVE_DLOPEN +LOCAL_CFLAGS_x86_64 += -DUSE_X86_64_ASM -DHAVE_DLOPEN +LOCAL_ASFLAGS_x86_64 := -DUSE_X86_64_ASM endif endif diff --git a/Android.mk b/Android.mk index b19419b..cd85937 100644 --- a/Android.mk +++ b/Android.mk @@ -62,7 +62,7 @@ MESA_GPU_DRIVERS := $(filter-out $(invalid_drivers), $(MESA_GPU_DRIVERS)) endif # host and target must be the same arch to generate matypes.h -ifeq ($(TARGET_ARCH),$(HOST_ARCH)) +ifneq ($(filter $(TARGET_ARCH) $(TARGET_2ND_ARCH),x86),) MESA_ENABLE_ASM := true else MESA_ENABLE_ASM := false diff --git a/src/mapi/Android.mk b/src/mapi/Android.mk index 4445218..c909d68 100644 --- a/src/mapi/Android.mk +++ b/src/mapi/Android.mk @@ -47,6 +47,8 @@ LOCAL_CFLAGS := \ -DMAPI_MODE_GLAPI \ -DMAPI_ABI_HEADER=\"$(abi_header)\" +LOCAL_LDFLAGS := -Wl,--no-warn-shared-textrel + LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/mapi diff --git a/src/mesa/Android.gen.mk b/src/mesa/Android.gen.mk index 27656cd..fb4a616 100644 --- a/src/mesa/Android.gen.mk +++ b/src/mesa/Android.gen.mk @@ -45,11 +45,9 @@ LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES)) LOCAL_C_INCLUDES += $(intermediates)/main ifeq ($(strip $(MESA_ENABLE_ASM)),true) -ifeq ($(TARGET_ARCH),x86) sources += x86/matypes.h LOCAL_C_INCLUDES += $(intermediates)/x86 endif -endif sources += main/git_sha1.h diff --git a/src/mesa/Android.libmesa_dricore.mk b/src/mesa/Android.libmesa_dricore.mk index 7758d54..0636b2f 100644 --- a/src/mesa/Android.libmesa_dricore.mk +++ b/src/mesa/Android.libmesa_dricore.mk @@ -44,6 +44,9 @@ LOCAL_SRC_FILES := \ ifeq ($(strip $(MESA_ENABLE_ASM)),true) ifeq ($(TARGET_ARCH),x86) LOCAL_SRC_FILES += $(X86_FILES) +else ifeq ($(TARGET_2ND_ARCH),x86) + LOCAL_SRC_FILES_x86 := $(X86_FILES) + LOCAL_SRC_FILES_x86_64 := $(X86_64_FILES) endif # x86 endif # MESA_ENABLE_ASM diff --git a/src/mesa/Android.libmesa_st_mesa.mk b/src/mesa/Android.libmesa_st_mesa.mk index b4b7fd9..cec59a9 100644 --- a/src/mesa/Android.libmesa_st_mesa.mk +++ b/src/mesa/Android.libmesa_st_mesa.mk @@ -43,6 +43,9 @@ LOCAL_SRC_FILES := \ ifeq ($(strip $(MESA_ENABLE_ASM)),true) ifeq ($(TARGET_ARCH),x86) LOCAL_SRC_FILES += $(X86_FILES) +else ifeq ($(TARGET_2ND_ARCH),x86) + LOCAL_SRC_FILES_x86 := $(X86_FILES) + LOCAL_SRC_FILES_x86_64 := $(X86_64_FILES) endif # x86 endif # MESA_ENABLE_ASM diff --git a/src/mesa/Android.mesa_gen_matypes.mk b/src/mesa/Android.mesa_gen_matypes.mk index 6e301f9..296191e 100644 --- a/src/mesa/Android.mesa_gen_matypes.mk +++ b/src/mesa/Android.mesa_gen_matypes.mk @@ -25,7 +25,6 @@ # - ifeq ($(strip $(MESA_ENABLE_ASM)),true) -ifeq ($(TARGET_ARCH),x86) LOCAL_PATH := $(call my-dir) @@ -33,6 +32,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := mesa_gen_matypes LOCAL_IS_HOST_MODULE := true +LOCAL_MULTILIB := 32 LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/mapi \ @@ -44,5 +44,4 @@ LOCAL_SRC_FILES := \ include $(MESA_COMMON_MK) include $(BUILD_HOST_EXECUTABLE) -endif # x86 endif # MESA_ENABLE_ASM diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 29f2499..627fbb8 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -179,7 +179,7 @@ static inline int IROUND_POS(float f) */ static inline int F_TO_I(float f) { -#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) +#if defined(USE_X86_ASM) && (defined(__GNUC__) || defined(ANDROID)) && defined(__i386__) int r; __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st"); return r; @@ -201,7 +201,7 @@ static inline int F_TO_I(float f) /** Return (as an integer) floor of float */ static inline int IFLOOR(float f) { -#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(_
[Mesa-dev] [PATCH 6/6] android: re-build all mesa binaries properly
The clean steps ensure both 32-bit and 64-bit objects are cleaned. Signed-off-by: Chih-Wei Huang --- CleanSpec.mk | 8 1 file changed, 8 insertions(+) diff --git a/CleanSpec.mk b/CleanSpec.mk index 820a1c7..2068163 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -5,3 +5,11 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libGLES_mesa_i $(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/obj/EXECUTABLES/mesa_*_intermediates) $(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/obj/EXECUTABLES/glsl_compiler_intermediates) $(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/obj/STATIC_LIBRARIES/libmesa_glsl_utils_intermediates) + +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/STATIC_LIBRARIES/libmesa_*_intermediates) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/SHARED_LIBRARIES/i9?5_dri_intermediates) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/SHARED_LIBRARIES/libglapi_intermediates) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/SHARED_LIBRARIES/libGLES_mesa_intermediates) +$(call add-clean-step, rm -rf $(HOST_OUT_release)/*/EXECUTABLES/mesa_*_intermediates) +$(call add-clean-step, rm -rf $(HOST_OUT_release)/*/EXECUTABLES/glsl_compiler_intermediates) +$(call add-clean-step, rm -rf $(HOST_OUT_release)/*/STATIC_LIBRARIES/libmesa_*_intermediates) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 16/16] android: mesa: fix the path of the SSE4_1 optimisations
2015-03-29 4:54 GMT+08:00 Emil Velikov : > Commit dd6f641303c(mesa: Build with subdir-objects.) removed the SRCDIR > variable, but forgot to update all references of it. > > Cc: "10.5" > Signed-off-by: Emil Velikov > --- > src/mesa/Android.libmesa_dricore.mk | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/Android.libmesa_dricore.mk > b/src/mesa/Android.libmesa_dricore.mk > index c2a4c28..da6176a 100644 > --- a/src/mesa/Android.libmesa_dricore.mk > +++ b/src/mesa/Android.libmesa_dricore.mk > @@ -49,8 +49,8 @@ endif # MESA_ENABLE_ASM > > ifeq ($(ARCH_X86_HAVE_SSE4_1),true) > LOCAL_SRC_FILES += \ > - $(SRCDIR)main/streaming-load-memcpy.c \ > - $(SRCDIR)main/sse_minmax.c > + $(MESA_TOP)/src/mesa/main/streaming-load-memcpy.c \ > + $(MESA_TOP)/src/mesa/main/sse_minmax.c Ah, just notice this is incorrect. The path of files in LOCAL_SRC_FILES must be relative to the $(LOCAL_PATH). So it should be LOCAL_SRC_FILES += \ main/streaming-load-memcpy.c \ main/sse_minmax.c > LOCAL_CFLAGS := -msse4.1 > endif I saw there are two adjacent sections of ifeq ($(ARCH_X86_HAVE_SSE4_1),true) How about combine them together? > -- -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965: Add XRGB8888 format to intel_screen_make_configs
Please consider i915 as well. Should it be add to .../dri/i915/intel_screen.c? diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 34efb29..5cd2a9b 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -1061,7 +1076,8 @@ intel_screen_make_configs(__DRIscreen *dri_screen) { static const mesa_format formats[] = { MESA_FORMAT_B5G6R5_UNORM, - MESA_FORMAT_B8G8R8A8_UNORM + MESA_FORMAT_B8G8R8A8_UNORM, + MESA_FORMAT_B8G8R8X8_UNORM, }; /* GLX_SWAP_COPY_OML is not supported due to page flipping. */ 2015-03-25 19:36 GMT+08:00 Boyan Ding : > Some application, such as drm backend of weston, uses XRGB config as > default. i965 doesn't provide this format, but before commit 65c8965d, > the drm platform of EGL takes ARGB as XRGB. Now that commit > 65c8965d makes EGL recognize format correctly so weston won't start > because it can't find XRGB. Add XRGB format to i965 just as > other drivers do. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89689 > Signed-off-by: Boyan Ding > --- > src/mesa/drivers/dri/i965/intel_screen.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/i965/intel_screen.c > b/src/mesa/drivers/dri/i965/intel_screen.c > index 3640b67..2b82c33 100644 > --- a/src/mesa/drivers/dri/i965/intel_screen.c > +++ b/src/mesa/drivers/dri/i965/intel_screen.c > @@ -1126,7 +1126,8 @@ intel_screen_make_configs(__DRIscreen *dri_screen) > { > static const mesa_format formats[] = { >MESA_FORMAT_B5G6R5_UNORM, > - MESA_FORMAT_B8G8R8A8_UNORM > + MESA_FORMAT_B8G8R8A8_UNORM, > + MESA_FORMAT_B8G8R8X8_UNORM > }; > > /* GLX_SWAP_COPY_OML is not supported due to page flipping. */ > -- > 2.3.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 3/4] Android: enable building on arm64
2016-02-03 4:45 GMT+08:00 Rob Herring : > Use the LOCAL_CFLAGS_{32/64} instead of arch specific variants to define > the DEFAULT_DRIVER_DIR. This enables building for arm64. > > Cc: Emil Velikov > Cc: Chih-Wei Huang > Signed-off-by: Rob Herring > --- > v2: > - Use LOCAL_CFLAGS_(32|64) instead of arch flags > > src/egl/Android.mk | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/src/egl/Android.mk b/src/egl/Android.mk > index ebd67af..cf71251 100644 > --- a/src/egl/Android.mk > +++ b/src/egl/Android.mk > @@ -44,9 +44,8 @@ LOCAL_CFLAGS := \ > -DHAVE_ANDROID_PLATFORM > > ifeq ($(MESA_LOLLIPOP_BUILD),true) > -LOCAL_CFLAGS_arm := -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" > -LOCAL_CFLAGS_x86 := -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" > -LOCAL_CFLAGS_x86_64 := -DDEFAULT_DRIVER_DIR=\"/system/lib64/dri\" > +LOCAL_CFLAGS_32 := -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" > +LOCAL_CFLAGS_64 := -DDEFAULT_DRIVER_DIR=\"/system/lib64/dri\" > else > LOCAL_CFLAGS += -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" > endif > -- Looks good to me. Thank you! -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 2/4] Android: Fix building secondary arch in mixed 32/64-bit builds
2016-02-03 4:45 GMT+08:00 Rob Herring : > TARGET_CC is not defined for the secondary arch on combined 32/64-bit > builds. The build system uses 2ND_TARGET_CC instead and it is not meant > to be used in module makefiles. LOCAL_CC was used to provide C only > flags as -std=c99 is not valid for C++ files. Since Android 4.4, > LOCAL_CONLYFLAGS was added to set compiler flags on C files only, so it > can be used now instead of LOCAL_CC. > > This will break on pre-4.4 versions of Android, but it unlikely anyone > is using current Mesa with such an old version of Android. > > Cc: Emil Velikov > Cc: Chih-Wei Huang > Signed-off-by: Rob Herring > --- > v2: > - move c99 comment > - Reword the commit msg to better describe the problem and about pre-4.4 > breakage > > Android.common.mk | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/Android.common.mk b/Android.common.mk > index 948561c..72fa5d9 100644 > --- a/Android.common.mk > +++ b/Android.common.mk > @@ -21,13 +21,8 @@ > # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > # DEALINGS IN THE SOFTWARE. > > -# use c99 compiler by default > -ifeq ($(LOCAL_CC),) > ifeq ($(LOCAL_IS_HOST_MODULE),true) > -LOCAL_CC := $(HOST_CC) -std=c99 -D_GNU_SOURCE > -else > -LOCAL_CC := $(TARGET_CC) -std=c99 > -endif > +LOCAL_CFLAGS += -D_GNU_SOURCE > endif > > LOCAL_C_INCLUDES += \ > @@ -60,6 +55,10 @@ LOCAL_CFLAGS += \ > -fvisibility=hidden \ > -Wno-sign-compare > > +# mesa requires at least c99 compiler > +LOCAL_CONLYFLAGS += \ > + -std=c99 > + > ifeq ($(strip $(MESA_ENABLE_ASM)),true) > ifeq ($(TARGET_ARCH),x86) > LOCAL_CFLAGS += \ > -- Looks good to me. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] black background on android-x86-5.1
2016-02-16 16:24 GMT+08:00 qinshao...@phoenixos.com : > > I note that you're only getting GLES 2.0 -- perhaps that's the reason, > the later android's probably require GLES 3 -- I suspect you're > hitting this because you're not building mesa with > --enable-texture-float. Hi ilia, After enabled texture-float the GLES becomes 3.0 now. However, it didn't fix the wallpaper issue. Actually it seems only affects the gallium drivers. The classical i915/i965 drivers are fine. Any other idea? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 0/8] Fixes for building AOSP master
2016-02-25 9:47 GMT+08:00 Emil Velikov : > On 24 February 2016 at 18:56, Rob Herring wrote: >> AOSP master branch has switched to clang from gcc and has major build >> system changes moving away from GNU make. > > Out of curiosity: what are they moving to ? I can see "blueprint" > (ninja?), kati (gnu make clone) and soong(?). Is there a > comparison/documentation about them ? Google has announced the change to all partners. The reasons include it’s time to have just one compiler for Android, and the positive impact on security of sanitizers like AddressSanitizer, etc. The full post and faq can be found in the android-gms-announcements list. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 0/8] Fixes for building AOSP master
2016-02-26 1:27 GMT+08:00 Emil Velikov : > On 25 February 2016 at 17:22, Chih-Wei Huang wrote: >> 2016-02-25 9:47 GMT+08:00 Emil Velikov : >>> On 24 February 2016 at 18:56, Rob Herring wrote: >>>> AOSP master branch has switched to clang from gcc and has major build >>>> system changes moving away from GNU make. >>> >>> Out of curiosity: what are they moving to ? I can see "blueprint" >>> (ninja?), kati (gnu make clone) and soong(?). Is there a >>> comparison/documentation about them ? >> >> Google has announced the change to all partners. >> The reasons include it’s time to have just one compiler >> for Android, and the positive impact on security >> of sanitizers like AddressSanitizer, etc. >> > I was wondering about GNU make move (to ...?), while I think you're > talking about gcc vs clang. Ah, I didn't read your question clearly. Sorry. Actually I only see the move of gcc to clang in the announcement, not mentioned about the make. >> The full post and faq can be found in the >> android-gms-announcements list. >> > Searching for android-gms-announcements does list anything. Is there a > typo in the name or the discussion group is closed to partners only ? Oh, it's partners only. Sorry. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] android: re-generate git_sha1.h if git HEAD updated
The git_sha1.h has to depend on the git HEAD otherwise it will never be updated. Signed-off-by: Chih-Wei Huang --- src/mesa/Android.gen.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/Android.gen.mk b/src/mesa/Android.gen.mk index a985f0a..e567102 100644 --- a/src/mesa/Android.gen.mk +++ b/src/mesa/Android.gen.mk @@ -69,7 +69,7 @@ define es-gen $(hide) $(PRIVATE_SCRIPT) $(1) $(PRIVATE_XML) > $@ endef -$(intermediates)/main/git_sha1.h: +$(intermediates)/main/git_sha1.h: $(wildcard $(MESA_TOP)/.git/HEAD) @mkdir -p $(dir $@) @echo "GIT-SHA1: $(PRIVATE_MODULE) <= git" $(hide) touch $@ -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe
2016-03-05 3:53 GMT+08:00 Rob Clark : > On Fri, Mar 4, 2016 at 2:43 PM, Thomas Hellstrom > wrote: >> On 03/04/2016 07:07 PM, Rob Clark wrote: >>> On Fri, Mar 4, 2016 at 12:59 PM, Rob Clark wrote: So, I've been advocating that for android, gallium drivers use gralloc_drm_pipe, since with android it seems like you end up with both gralloc and libGL in the same process, and having both share the same pipe_screen avoids lots of headaches with multiple gem handles pointing to same underlying buffer. But the awkward thing is that gralloc_drm_pipe is using gallium APIs that aren't particularly intended to be used out-of-tree. Ie. not really stable APIs. At the time, the thing that made sense to me was to pull drm_gralloc into mesa. But at the time, there were no non-mesa users of drm_gralloc, which isn't really true anymore. Maybe what makes more sense now is to implement a gralloc state tracker, which exposes a stable API for drm_gralloc? It would mostly be a shim to expose gallium import/export/transfer APIs in a stable way, but would also be where the code that figures out which driver to use to create/get the pipe_screen. >>> and actually, we might just be able to use XA state tracker for this.. >>> I think it exposes all the necessary import/export/etc stuff that >>> gralloc would need.. >>> >>> BR, >>> -R >>> >> and it was created for a very similar purpose, except that we also >> needed some >> render functionality, enough to composite surfaces. > > right, and since we have the ability to import/export dmabuf handles, > I think it is a superset of what is needed. (gralloc is using blits > instead of flips for vmwgfx, for reasons I don't fully understand.. > but XA can do these blits and more, so we are still good there) Hi Rob, Thank you for raising the problem though I don't fully understand the technical details. So you are planning to modify (or re-implement?) gralloc_drm_pipe to use the APIs of XA state tracker. Do I understand your words correctly? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] LLVMInitializeAMDGPU* undefined?
Hi devs, On building 64-bit Android-x86 mesa with amdgpu support, we got some errors about the symbols LLVMInitializeAMDGPU* are not defined. (missing prototypes) It's easy to fix the errors by adding the definition of the function prototypes. However, I'm curious in which side it should be fixed? The mesa or llvm? Does the llvm forgot to provide a header for these functions? Or the functions are internal APIs of llvm that should not be used by mesa directly? Any comment? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] LLVMInitializeAMDGPU* undefined?
2016年3月10日 下午6:47於 "Marek Olšák" 寫道: > > Those functions are only supported by LLVM 3.7 and later, and if you > have such a version, the AMDGPU backend must be enabled in your LLVM > build. Yes, I knew that. But seems you misunderstood my question. It's a compile time error instead of a linking time error: external/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c: In function 'init_r600_target': external/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c:106:2: error: implicit declaration of function 'LLVMInitializeAMDGPUTargetInfo' [-Werror=implicit-function-declaration] LLVMInitializeAMDGPUTargetInfo(); ^ external/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c:107:2: error: implicit declaration of function 'LLVMInitializeAMDGPUTarget' [-Werror=implicit-function-declaration] LLVMInitializeAMDGPUTarget(); ^ external/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c:108:2: error: implicit declaration of function 'LLVMInitializeAMDGPUTargetMC' [-Werror=implicit-function-declaration] LLVMInitializeAMDGPUTargetMC(); ^ external/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c:109:2: error: implicit declaration of function 'LLVMInitializeAMDGPUAsmPrinter' [-Werror=implicit-function-declaration] LLVMInitializeAMDGPUAsmPrinter(); ^ cc1: some warnings being treated as errors Some proposed patches on the mesa side: https://sourceforge.net/p/android-x86/external_mesa/ci/f6611f58cf89a40e013b20180604f65707b6e73e/ (add a header to declare the functions) https://github.com/maurossi/mesa/commit/deb3a6ebb7fdba688b0331bd0e4b27acfc9d869f (disable implicit declaration warnings) But I'm still not sure whether if it should be fixed on the mesa side. So my question is, what kind of fix do we want (i.e., acceptable by the upstream)? > On Thu, Mar 10, 2016 at 10:04 AM, Chih-Wei Huang > wrote: > > Hi devs, > > On building 64-bit Android-x86 mesa with amdgpu support, > > we got some errors about the symbols LLVMInitializeAMDGPU* > > are not defined. (missing prototypes) > > > > It's easy to fix the errors by adding the definition of > > the function prototypes. > > However, I'm curious in which side it should be fixed? > > The mesa or llvm? > > > > Does the llvm forgot to provide a header for these functions? > > Or the functions are internal APIs of llvm that should not be used > > by mesa directly? > > > > Any comment? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] LLVMInitializeAMDGPU* undefined?
2016-03-11 11:50 GMT+08:00 Jan Vesely : > On Fri, 2016-03-11 at 10:09 +0800, Chih-Wei Huang wrote: >> cc1: some warnings being treated as errors >> >> >> But I'm still not sure whether if it should be fixed on the mesa >> side. >> >> So my question is, what kind of fix do we want (i.e., acceptable by >> the upstream)? > > this is the result of using llvm without AMDGPU backend. the header > "llvm-c/Target.h" includes "llvm/Config/Targets.def" and declares > functions based on backends listed there (selected at llvm build time). > > Your "llvm/Config/Targets.def" needs to include this line: > LLVM_TARGET(AMDGPU) Ah, thank you for pointed it out. Originally I thought adding Android.mk for AMDGPU is enough. I'll try to add this. Anything else we need to do to "enable" AMDGPU backend? > otherwise the functions are not declared. > probably the only patch needed on mesa side is to detect this at > configure time. Android doesn't need configure. What we need is to detect Android version then we know the llvm version it uses and what backends it has. The patch is already in android-x86 codebase but probably not submited to mesa-dev yet. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [android-x86-devel] Re: gralloc_drm_pipe
2016-03-24 8:51 GMT+08:00 Rob Clark : [deleted] > > [*] the caveat there is vmwgfx stuff which seems to want to do blits.. > although I'm not entirely sure why or if that is even still requires > w/ newer vmware players. But if vmwgfx still really needs the blit > path, I guess they could still keep using gralloc_drm instead of > switching to gralloc_gbm ;-) Did you mean this chunk in gralloc_drm_pipe.c? if (strcmp(pm->driver, "vmwgfx") == 0) { drm->mode_quirk_vmwgfx = 1; drm->swap_mode = DRM_SWAP_COPY; } else { drm->mode_quirk_vmwgfx = 0; drm->swap_mode = DRM_SWAP_FLIP; } In my last hacking of gralloc_drm_pipe.c for vmwgfx, it seems flip just work. Actually I have tried the two paths but can't find any explicit differences. (at least for VM Player 12 I tested) I guess the blit path isn't needed anymore so I just removed it: https://sourceforge.net/p/android-x86/external_drm_gralloc/ci/c04133951d10c4c17c0dfc9b86144b5a5957e17c/ (I need this hacking because pm->driver was removed by Rohb's "pipe: use gallium loader function") BTW, the above chunk was written by Chia-I Wu (commit db29afe6). He is probably the only one who can explain it better. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] Android: correct libz dependency
2017-05-17 21:11 GMT+08:00 Emil Velikov : > On 17 May 2017 at 13:45, Rob Herring wrote: >> On Wed, May 17, 2017 at 12:10 AM, Chih-Wei Huang >> wrote: >>> Commit 6facb0c0 ("android: fix libz dynamic library dependencies") >>> unconditionally adds libz as a dependency to all shared libraries. >>> That is unnecessary. >>> >>> Commit 85a9b1b5 introduced libz as a dependency to libmesa_util. >>> So only the shared libraries that use libmesa_util need libz. >>> >>> Fix Android Lollipop build by adding the include path of zlib to >>> libmesa_util explicitly instead of getting the path implicitly >>> from zlib since it doesn't export the include path in Lollipop. >>> >>> Fixes: 6facb0c0 "android: fix libz dynamic library dependencies" >>> >>> Signed-off-by: Chih-Wei Huang >>> --- >>> Android.common.mk | 4 >>> src/gallium/targets/dri/Android.mk | 3 ++- >>> src/intel/Android.vulkan.mk| 2 +- >>> src/mesa/drivers/dri/Android.mk| 3 ++- >>> src/util/Android.mk| 1 + >>> 5 files changed, 6 insertions(+), 7 deletions(-) >> >> Reviewed-by: Rob Herring > Thanks Rob. Pushed to master. Thank you. BTW, since libmesa_util is used by several places, is it better to change it to a shared library? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965: Add RGBX8888 and RGBA8888 to EGL configure and reorder the list
2017-05-12 12:04 GMT+08:00 Xu, Randy : > Thanks, Emil > > dEQP has patch to exclude 565 blend cases (commit named "Exclude RGB565 > blending cases from the must-pass"), so we don’t need any patches now. Hi Randy, Tapani, I think we still need a patch. Right? I see the similar patch is still applied to Android-IA codebase. -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev