Re: [Mesa-dev] [PATCH 3/3] android: aco: add support for libmesa_aco

2019-09-27 Thread Mauro Rossi
Hi,
for this 3rd patch I'm in contact with John Stultz

Could you please give me both some advice on how to perform Merge Request
(newbie)

I have pushed an android_aco branch in my gitlab repo with account
issor.oruam (same used in mesa)
but I'm not able to perform Merge Request/Compare branches between source
issor.oruam/mesa branch android_aco
and the mesa/mesa branch master

Is it mandatory that I push to a mesa/mesa branch android_aco to be able to
perform MR/Compare to master?
Thanks for the info/help

Mauro

On Sun, Sep 22, 2019 at 12:00 PM Mauro Rossi  wrote:

> Android building rules are added in src/amd/Android.compiler.mk
> libmesa_aco static library is built conditionally to radeonsi
> as done for vulkan.radv module
>
> This will prevent Android build errors for non x86 systems
>
> filter-out compiler/aco_instruction_selection_setup.cpp source,
> as already included by compiler/aco_instruction_selection.cpp
> and would cause several multiple definition linker errors
>
> NOTE: libLLVM requires AMDGPU Disassembler to build radv with aco
>
> Fixes: 93c8ebf ("aco: Initial commit of independent AMD compiler")
> Fixes: a70a998 ("radv/aco: Setup alternate path in RADV to support the
> experimental ACO compiler")
> Signed-off-by: Mauro Rossi 
> ---
>  src/amd/Android.compiler.mk | 93 +
>  src/amd/Android.mk  |  1 +
>  src/amd/Makefile.sources| 32 +
>  src/amd/vulkan/Android.mk   |  4 +-
>  4 files changed, 129 insertions(+), 1 deletion(-)
>  create mode 100644 src/amd/Android.compiler.mk
>
> diff --git a/src/amd/Android.compiler.mk b/src/amd/Android.compiler.mk
> new file mode 100644
> index 00..a62c93d9d3
> --- /dev/null
> +++ b/src/amd/Android.compiler.mk
> @@ -0,0 +1,93 @@
> +# Copyright © 2018 Valve Corporation
> +# Copyright © 2019 Mauro Rossi issor.or...@gmail.com
> +
> +# 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 (including the
> next
> +# paragraph) 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
> +
> +# ---
> +# Build libmesa_aco
> +# ---
> +
> +include $(CLEAR_VARS)
> +
> +LOCAL_MODULE := libmesa_aco
> +
> +# filter-out compiler/aco_instruction_selection_setup.cpp because
> +# it's already included by compiler/aco_instruction_selection.cpp
> +LOCAL_SRC_FILES := \
> +   $(filter-out compiler/aco_instruction_selection_setup.cpp,
> $(ACO_FILES))
> +
> +LOCAL_CFLAGS += -DFORCE_BUILD_AMDGPU   # instructs LLVM to declare
> LLVMInitializeAMDGPU* functions
> +
> +LOCAL_CPPFLAGS += -Wall -std=c++14
> +
> +# generate sources
> +LOCAL_MODULE_CLASS := STATIC_LIBRARIES
> +intermediates := $(call local-generated-sources-dir)
> +LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/,
> $(ACO_GENERATED_FILES))
> +
> +ACO_OPCODES_H_SCRIPT := $(MESA_TOP)/src/amd/compiler/aco_opcodes_h.py
> +ACO_OPCODES_CPP_SCRIPT := $(MESA_TOP)/src/amd/compiler/aco_opcodes_cpp.py
> +ACO_BUILDER_H_SCRIPT := $(MESA_TOP)/src/amd/compiler/aco_builder_h.py
> +
> +ACO_DEPS := $(MESA_TOP)/src/amd/compiler/aco_opcodes.py
> +
> +$(intermediates)/compiler/aco_opcodes.h: $(ACO_OPCODES_H_SCRIPT)
> $(ACO_DEPS)
> +   @mkdir -p $(dir $@)
> +   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
> +   $(hide) $(MESA_PYTHON2) $(ACO_OPCODES_H_SCRIPT) > $@ || ($(RM) $@;
> false)
> +
> +$(intermediates)/compiler/aco_opcodes.cpp: $(ACO_OPCODES_CPP_SCRIPT)
> $(ACO_DEPS)
> +   @mkdir -p $(dir $@)
> +   @echo "Gen Header: $(

[Mesa-dev] [PATCH 1/3] android: aco: fix undefined template 'std::__1::array' build errors

2019-09-22 Thread Mauro Rossi
Fixes a few building errors similar to the following:

In file included from 
external/mesa/src/amd/compiler/aco_instruction_selection.cpp:26:
In file included from external/libcxx/include/algorithm:639:
external/libcxx/include/utility:321:9:
error: implicit instantiation of undefined template 'std::__1::array'
_T2 second;
^

Fixes: 93c8ebf ("aco: Initial commit of independent AMD compiler")
Signed-off-by: Mauro Rossi 
---
 src/amd/compiler/aco_instruction_selection.cpp   | 1 +
 src/amd/compiler/aco_instruction_selection_setup.cpp | 1 +
 src/amd/compiler/aco_print_asm.cpp   | 2 +-
 src/amd/compiler/aco_register_allocation.cpp | 1 +
 src/amd/compiler/aco_validate.cpp| 1 +
 5 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp 
b/src/amd/compiler/aco_instruction_selection.cpp
index d52043f3c0..164ac8ed5d 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -24,6 +24,7 @@
  */
 
 #include 
+#include 
 #include 
 
 #include "aco_ir.h"
diff --git a/src/amd/compiler/aco_instruction_selection_setup.cpp 
b/src/amd/compiler/aco_instruction_selection_setup.cpp
index 6c4c408e65..e8522c3d12 100644
--- a/src/amd/compiler/aco_instruction_selection_setup.cpp
+++ b/src/amd/compiler/aco_instruction_selection_setup.cpp
@@ -22,6 +22,7 @@
  *
  */
 
+#include 
 #include 
 #include "aco_ir.h"
 #include "nir.h"
diff --git a/src/amd/compiler/aco_print_asm.cpp 
b/src/amd/compiler/aco_print_asm.cpp
index 31079aa1c4..d3f4c3cb40 100644
--- a/src/amd/compiler/aco_print_asm.cpp
+++ b/src/amd/compiler/aco_print_asm.cpp
@@ -1,4 +1,4 @@
-
+#include 
 #include 
 #include "aco_ir.h"
 #include "llvm-c/Disassembler.h"
diff --git a/src/amd/compiler/aco_register_allocation.cpp 
b/src/amd/compiler/aco_register_allocation.cpp
index d55f1febc6..47ea932f11 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -27,6 +27,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/src/amd/compiler/aco_validate.cpp 
b/src/amd/compiler/aco_validate.cpp
index 0988d66df3..9919d0a585 100644
--- a/src/amd/compiler/aco_validate.cpp
+++ b/src/amd/compiler/aco_validate.cpp
@@ -24,6 +24,7 @@
 
 #include "aco_ir.h"
 
+#include 
 #include 
 
 namespace aco {
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 2/3] android: compiler/nir: build nir_divergence_analysis.c

2019-09-22 Thread Mauro Rossi
Prerequisite to avoid following radv linking error happening with aco

FAILED: 
out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/vulkan.radv_intermediates/LINKED/vulkan.radv.so
...
external/mesa/src/amd/compiler/aco_instruction_selection_setup.cpp:178:
error: undefined reference to 'nir_divergence_analysis'
clang.real: error: linker command failed with exit code 1 (use -v to see 
invocation)

Fixes: df86c5f ("nir: add divergence analysis pass.")
Signed-off-by: Mauro Rossi 
---
 src/compiler/Makefile.sources | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
index c4d2c2be7c..bc49e00525 100644
--- a/src/compiler/Makefile.sources
+++ b/src/compiler/Makefile.sources
@@ -215,6 +215,7 @@ NIR_FILES = \
nir/nir_control_flow_private.h \
nir/nir_deref.c \
nir/nir_deref.h \
+   nir/nir_divergence_analysis.c \
nir/nir_dominance.c \
nir/nir_format_convert.h \
nir/nir_from_ssa.c \
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 3/3] android: aco: add support for libmesa_aco

2019-09-22 Thread Mauro Rossi
Android building rules are added in src/amd/Android.compiler.mk
libmesa_aco static library is built conditionally to radeonsi
as done for vulkan.radv module

This will prevent Android build errors for non x86 systems

filter-out compiler/aco_instruction_selection_setup.cpp source,
as already included by compiler/aco_instruction_selection.cpp
and would cause several multiple definition linker errors

NOTE: libLLVM requires AMDGPU Disassembler to build radv with aco

Fixes: 93c8ebf ("aco: Initial commit of independent AMD compiler")
Fixes: a70a998 ("radv/aco: Setup alternate path in RADV to support the 
experimental ACO compiler")
Signed-off-by: Mauro Rossi 
---
 src/amd/Android.compiler.mk | 93 +
 src/amd/Android.mk  |  1 +
 src/amd/Makefile.sources| 32 +
 src/amd/vulkan/Android.mk   |  4 +-
 4 files changed, 129 insertions(+), 1 deletion(-)
 create mode 100644 src/amd/Android.compiler.mk

diff --git a/src/amd/Android.compiler.mk b/src/amd/Android.compiler.mk
new file mode 100644
index 00..a62c93d9d3
--- /dev/null
+++ b/src/amd/Android.compiler.mk
@@ -0,0 +1,93 @@
+# Copyright © 2018 Valve Corporation
+# Copyright © 2019 Mauro Rossi issor.or...@gmail.com
+
+# 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 (including the next
+# paragraph) 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
+
+# ---
+# Build libmesa_aco
+# ---
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libmesa_aco
+
+# filter-out compiler/aco_instruction_selection_setup.cpp because
+# it's already included by compiler/aco_instruction_selection.cpp
+LOCAL_SRC_FILES := \
+   $(filter-out compiler/aco_instruction_selection_setup.cpp, $(ACO_FILES))
+
+LOCAL_CFLAGS += -DFORCE_BUILD_AMDGPU   # instructs LLVM to declare 
LLVMInitializeAMDGPU* functions
+
+LOCAL_CPPFLAGS += -Wall -std=c++14
+
+# generate sources
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+intermediates := $(call local-generated-sources-dir)
+LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, 
$(ACO_GENERATED_FILES))
+
+ACO_OPCODES_H_SCRIPT := $(MESA_TOP)/src/amd/compiler/aco_opcodes_h.py
+ACO_OPCODES_CPP_SCRIPT := $(MESA_TOP)/src/amd/compiler/aco_opcodes_cpp.py
+ACO_BUILDER_H_SCRIPT := $(MESA_TOP)/src/amd/compiler/aco_builder_h.py
+
+ACO_DEPS := $(MESA_TOP)/src/amd/compiler/aco_opcodes.py
+
+$(intermediates)/compiler/aco_opcodes.h: $(ACO_OPCODES_H_SCRIPT) $(ACO_DEPS)
+   @mkdir -p $(dir $@)
+   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+   $(hide) $(MESA_PYTHON2) $(ACO_OPCODES_H_SCRIPT) > $@ || ($(RM) $@; 
false)
+
+$(intermediates)/compiler/aco_opcodes.cpp: $(ACO_OPCODES_CPP_SCRIPT) 
$(ACO_DEPS)
+   @mkdir -p $(dir $@)
+   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+   $(hide) $(MESA_PYTHON2) $(ACO_OPCODES_CPP_SCRIPT) > $@ || ($(RM) $@; 
false)
+
+$(intermediates)/compiler/aco_builder.h: $(ACO_BUILDER_H_SCRIPT) $(ACO_DEPS)
+   @mkdir -p $(dir $@)
+   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+   $(hide) $(MESA_PYTHON2) $(ACO_BUILDER_H_SCRIPT) > $@ || ($(RM) $@; 
false)
+
+LOCAL_C_INCLUDES := \
+   $(MESA_TOP)/src/amd \
+   $(MESA_TOP)/src/amd/common \
+   $(MESA_TOP)/src/amd/compiler \
+   $(MESA_TOP)/src/compiler/nir \
+   $(MESA_TOP)/src/mapi \
+   $(MESA_TOP)/src/mesa \
+   $(intermediates)/compiler
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+   $(MESA_TOP)/src/amd/compiler \
+   $(intermediates)/compiler
+
+LOCAL_SHARED_LIBRARIES := \
+   libdrm_amdgpu
+
+LOCAL_STATIC_LIBRARIES := \
+   libmesa_amd_common \
+   libmesa_nir
+
+$(call mesa-build-with-llvm)
+
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/amd/Android.mk b/src/amd/Android.mk
index e40e7da01b..c9dbeafde1 100644

[Mesa-dev] [PATCH] android: anv: libmesa_vulkan_common: add libmesa_util static dependency

2019-09-08 Thread Mauro Rossi
Change needed to fix the following building error:

In file included from external/mesa/src/intel/vulkan/anv_device.c:43:
external/mesa/src/util/xmlpool.h:115:10: fatal error: 'xmlpool/options.h' file 
not found
 ^~~
1 error generated.

Fixes: 4dcb1ff ("anv: add support for driconf")
Signed-off-by: Mauro Rossi 
---
 src/intel/Android.vulkan.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk
index 624b440560..468ddfc65f 100644
--- a/src/intel/Android.vulkan.mk
+++ b/src/intel/Android.vulkan.mk
@@ -233,7 +233,8 @@ LOCAL_STATIC_LIBRARIES := \
libmesa_nir \
libmesa_genxml \
libmesa_git_sha1 \
-   libmesa_vulkan_util
+   libmesa_vulkan_util \
+   libmesa_util
 
 # The rule generates both C and H files, but due to some strange
 # reason generating the files once leads to link-time issues.
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: mesa: revert "Enable asm unconditionally"

2019-09-05 Thread Mauro Rossi
Hi Eric, Emil,
we have Tapani ok, in my understanding

Please follow up on this one
Mauro

On Fri, Aug 16, 2019 at 4:29 AM Mauro Rossi  wrote:

> Hi Tapani, Eric,
>
> On Thu, Aug 15, 2019 at 1:00 PM Tapani Pälli 
> wrote:
>
>>
>> On 8/15/19 12:52 PM, Mauro Rossi wrote:
>> > Hi Tapani,
>> >
>> > On Thu, Aug 15, 2019 at 7:29 AM Tapani Pälli > > <mailto:tapani.pa...@intel.com>> wrote:
>> >
>> >
>> > On 8/13/19 9:55 PM, Mauro Rossi wrote:
>> >  > Hi,
>> >  >
>> >  > On Tue, Aug 13, 2019 at 3:51 PM Tapani Pälli
>> > mailto:tapani.pa...@intel.com>
>> >  > <mailto:tapani.pa...@intel.com <mailto:tapani.pa...@intel.com>>>
>> > wrote:
>> >  >
>> >  >
>> >  > On 8/13/19 3:32 PM, Mauro Rossi wrote:
>> >  >  > Hi,
>> >  >  >
>> >  >  > On Tue, Aug 13, 2019 at 2:03 PM Tapani Pälli
>> >  > mailto:tapani.pa...@intel.com>
>> > <mailto:tapani.pa...@intel.com <mailto:tapani.pa...@intel.com>>
>> >  >  > <mailto:tapani.pa...@intel.com
>> > <mailto:tapani.pa...@intel.com> <mailto:tapani.pa...@intel.com
>> > <mailto:tapani.pa...@intel.com>>>>
>> >  > wrote:
>> >  >  >
>> >  >  > Hi;
>> >  >  >
>> >  >  > On 8/13/19 2:43 PM, Mauro Rossi wrote:
>> >  >  >  > Hi Tapani,
>> >  >  >  >
>> >  >  >  > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi
>> >  >  > mailto:issor.or...@gmail.com>
>> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
>> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>
>> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>>
>> >  >  >  > <mailto:issor.or...@gmail.com
>> > <mailto:issor.or...@gmail.com>
>> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com
>> >>
>> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>
>> >  > <mailto:issor.or...@gmail.com
>> > <mailto:issor.or...@gmail.com>>>>> wrote:
>> >  >  >  >
>> >  >  >  > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi
>> >  >  > mailto:issor.or...@gmail.com>
>> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
>> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>
>> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>>
>> >  >  >  > <mailto:issor.or...@gmail.com
>> > <mailto:issor.or...@gmail.com>
>> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com
>> >>
>> >  >  > <mailto:issor.or...@gmail.com
>> > <mailto:issor.or...@gmail.com>
>> >  > <mailto:issor.or...@gmail.com
>> > <mailto:issor.or...@gmail.com>>>>> wrote:
>> >  >  >  >  >
>> >  >  >  >  > On Thu, Jul 18, 2019 at 1:07 PM Chih-Wei
>> Huang
>> >  >  >  > > > <mailto:cwhu...@android-x86.org>
>> >  > <mailto:cwhu...@android-x86.org
>> > <mailto:cwhu...@android-x86.org>> <mailto:cwhu...@android-x86.org
>> > <mailto:cwhu...@android-x86.org>
>> >  > <mailto:cwhu...@android-x86.org
>> > <mailto:cwhu...@android-x86.org>>>
>> >  >  > <mailto:cwhu...@android-x86.org
>> > <mailto:cwhu...@android-x86.org>
>> >  > <mailto:cwhu...@android-x86.org
>> > <mailto:cwhu...@android-x86.org>> <mailto:cwhu...@android-x86.org
>> > <mailto:cwhu...@android-x86.org>
>> >  > <mailto:cwhu...@android-x86.org
>> > <mailto:cwhu...@android-x86.org>>>>>
>> >  >  > wrote:
>> >  >  >  >  > >
>> >  >  >  >  > > Mauro Ro

Re: [Mesa-dev] [PATCH] android: mesa: revert "Enable asm unconditionally"

2019-08-15 Thread Mauro Rossi
Hi Tapani, Eric,

On Thu, Aug 15, 2019 at 1:00 PM Tapani Pälli  wrote:

>
> On 8/15/19 12:52 PM, Mauro Rossi wrote:
> > Hi Tapani,
> >
> > On Thu, Aug 15, 2019 at 7:29 AM Tapani Pälli  > <mailto:tapani.pa...@intel.com>> wrote:
> >
> >
> > On 8/13/19 9:55 PM, Mauro Rossi wrote:
> >  > Hi,
> >  >
> >  > On Tue, Aug 13, 2019 at 3:51 PM Tapani Pälli
> > mailto:tapani.pa...@intel.com>
> >  > <mailto:tapani.pa...@intel.com <mailto:tapani.pa...@intel.com>>>
> > wrote:
> >  >
> >  >
> >  > On 8/13/19 3:32 PM, Mauro Rossi wrote:
> >  >  > Hi,
> >  >  >
> >  >  > On Tue, Aug 13, 2019 at 2:03 PM Tapani Pälli
> >  > mailto:tapani.pa...@intel.com>
> > <mailto:tapani.pa...@intel.com <mailto:tapani.pa...@intel.com>>
> >  >  > <mailto:tapani.pa...@intel.com
> >     <mailto:tapani.pa...@intel.com> <mailto:tapani.pa...@intel.com
> > <mailto:tapani.pa...@intel.com>>>>
> >  > wrote:
> >  >  >
> >  >  > Hi;
> >  >  >
> >  >  > On 8/13/19 2:43 PM, Mauro Rossi wrote:
> >  >  >  > Hi Tapani,
> >  >  >  >
> >  >  >  > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi
> >  >  > mailto:issor.or...@gmail.com>
> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>
> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>>
> >  >  >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>>>>> wrote:
> >  >  >  >
> >  >  >  > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi
> >  >  > mailto:issor.or...@gmail.com>
> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>
> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>>
> >  >  >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
> >  >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>>>>> wrote:
> >  >  >  >  >
> >  >  >  >  > On Thu, Jul 18, 2019 at 1:07 PM Chih-Wei
> Huang
> >  >  >  >  > <mailto:cwhu...@android-x86.org>
> >  > <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org>> <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org>
> >  > <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org>>>
> >  >  > <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org>
> >  > <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org>> <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org>
> >  > <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org>>>>>
> >  >  > wrote:
> >  >  >  >  > >
> >  >  >  >  > > Mauro Rossi  > <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
> >  >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com> <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>>>
> >  >  >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>
> &

Re: [Mesa-dev] Concern about proposed patch "egl/android: remove HAL_PIXEL_FORMAT_BGRA_8888 support"

2019-08-15 Thread Mauro Rossi
Hi Lepton,

On Thu, Aug 15, 2019 at 9:58 PM Lepton Wu  wrote:

> That's interesting. The android frame work will hard coded to use
> RGBA_ and set it as window format here:
>
>
> https://android.googlesource.com/platform/frameworks/native/+/refs/heads/master/opengl/libs/EGL/eglApi.cpp#738
>
> Do you have a custom version of android which do different code here?
>

Affirmative, you may check [1] for reference

[1]
http://git.osdn.net/view?p=android-x86/frameworks-native.git;a=commit;h=792c8dc009bd3a0c44eb39e757a95e099c03b54c


>
> For other GPU, like intel, if we choose a EGL config with BGRA ,
> finally we got a wrong color on screen.
>

android-x86 implementation selects BGRA_ only when RGBA_ not
available,
in a similar way to a pre-existing Workaround 10194508 that was removed
from AOSP code

Removing HAL_PIXEL_FORMAT_BGRA_ support from egl/android
SurfaceFlinger will just crash with SIGABRT on nouveau


>
> On Thu, Aug 15, 2019 at 12:49 PM Mauro Rossi 
> wrote:
> >
> > Hi,
> >
> > sorry if I'm communicating in dedicated thread, but I don't know how to
> reply to existing one.
> >
> > The proposed patch is based on the wrong assumption that all drivers
> used with Android have RGBA_, which is not correct, for example nouveau
> does not support RGBA on primary planes, infact we have a fallback to
> simpler EGL query in android-x86 and we use BGRA_ (pixel format = 5)
> >
> > If patch does not solve a specific problem and it will cause a
> regression at least in nouveau, it is recommended to abandon the patch
> >
> > Thanks for your feedbacks
> >
> > Mauro
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] Concern about proposed patch "egl/android: remove HAL_PIXEL_FORMAT_BGRA_8888 support"

2019-08-15 Thread Mauro Rossi
Hi,

sorry if I'm communicating in dedicated thread, but I don't know how to
reply to existing one.

The proposed patch is based on the wrong assumption that all drivers used
with Android have RGBA_, which is not correct, for example nouveau does
not support RGBA on primary planes, infact we have a fallback to simpler
EGL query in android-x86 and we use BGRA_ (pixel format = 5)

If patch does not solve a specific problem and it will cause a regression
at least in nouveau, it is recommended to abandon the patch

Thanks for your feedbacks

Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: mesa: revert "Enable asm unconditionally"

2019-08-15 Thread Mauro Rossi
Hi Tapani,

On Thu, Aug 15, 2019 at 7:29 AM Tapani Pälli  wrote:

>
> On 8/13/19 9:55 PM, Mauro Rossi wrote:
> > Hi,
> >
> > On Tue, Aug 13, 2019 at 3:51 PM Tapani Pälli  > <mailto:tapani.pa...@intel.com>> wrote:
> >
> >
> > On 8/13/19 3:32 PM, Mauro Rossi wrote:
> >  > Hi,
> >  >
> >  > On Tue, Aug 13, 2019 at 2:03 PM Tapani Pälli
> > mailto:tapani.pa...@intel.com>
> >  > <mailto:tapani.pa...@intel.com <mailto:tapani.pa...@intel.com>>>
> > wrote:
> >  >
> >  > Hi;
> >  >
> >  > On 8/13/19 2:43 PM, Mauro Rossi wrote:
> >  >  > Hi Tapani,
> >  >  >
> >  >  > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi
> >  > mailto:issor.or...@gmail.com>
> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
> >  >      > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com> <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>>>> wrote:
> >  >  >
> >  >  > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi
> >  > mailto:issor.or...@gmail.com>
> > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
> >  >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>>>> wrote:
> >  >  >  >
> >  >  >  > On Thu, Jul 18, 2019 at 1:07 PM Chih-Wei Huang
> >  >  >  > <mailto:cwhu...@android-x86.org> <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org>>
> >  > <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org> <mailto:cwhu...@android-x86.org
> > <mailto:cwhu...@android-x86.org>>>>
> >  > wrote:
> >  >  >  > >
> >  >  >  > > Mauro Rossi  > <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>
> >  >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>>>> 於 2019年7月14日 週日 下午5:17寫道:
> >  >  >  > > >
> >  >  >  > > > This patch partially reverts 20294dc ("mesa:
> > Enable asm
> >  >  > unconditionally, ...")
> >  >  >  > > >
> >  >  >  > > > Android makefile build logic needs to disable
> > assembler
> >  >  > optimization
> >  >  >  > > > in 32bit builds to avoid text relocations for
> >  > libglapi.so shared
> >  >  >  > > >
> >  >  >  > > > Fixes the following build error with Android
> > x86 32bit
> >  > target:
> >  >  >  > > >
> >  >  >  > > > [  0% 4/477] target SharedLib: libglapi
> >  >  >
> >  >
> >
>  
> (out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so)
> >  >  >  > > > FAILED:
> >  >  >
> >  >
> >
>  
> out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so
> >  >  >  > > > ...
> >  >  >  > > >
> >  >  >
> >  >
> >
>  
> prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> >  >  > warning: shared library text segment is not shareable
> >  >  >  > > >
> >  >  >
> >  >
> >
>  
> prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> >  >  > error: treating warnings as errors
> >  >  >  > > > clang-6.0: error: linker command failed with
> > exit code
> >  > 1 (use
> >  >  > -v to see invocation)
> >  >  >  > > >
> >  >  

Re: [Mesa-dev] [PATCH] android: mesa: revert "Enable asm unconditionally"

2019-08-13 Thread Mauro Rossi
Hi,

On Tue, Aug 13, 2019 at 3:51 PM Tapani Pälli  wrote:

>
> On 8/13/19 3:32 PM, Mauro Rossi wrote:
> > Hi,
> >
> > On Tue, Aug 13, 2019 at 2:03 PM Tapani Pälli  > <mailto:tapani.pa...@intel.com>> wrote:
> >
> > Hi;
> >
> > On 8/13/19 2:43 PM, Mauro Rossi wrote:
> >  > Hi Tapani,
> >  >
> >  > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi
> > mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com>>>
> wrote:
> >  >
> >  > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi
> > mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>>> wrote:
> >  >  >
> >  >  > On Thu, Jul 18, 2019 at 1:07 PM Chih-Wei Huang
> >  > mailto:cwhu...@android-x86.org>
> > <mailto:cwhu...@android-x86.org <mailto:cwhu...@android-x86.org>>>
> > wrote:
> >  >  > >
> >  >  > > Mauro Rossi  > <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com
> > <mailto:issor.or...@gmail.com>>> 於 2019年7月14日 週日 下午5:17寫道:
> >  >  > > >
> >  >  > > > This patch partially reverts 20294dc ("mesa: Enable asm
> >  > unconditionally, ...")
> >  >  > > >
> >  >  > > > Android makefile build logic needs to disable assembler
> >  > optimization
> >  >  > > > in 32bit builds to avoid text relocations for
> > libglapi.so shared
> >  >  > > >
> >  >  > > > Fixes the following build error with Android x86 32bit
> > target:
> >  >  > > >
> >  >  > > > [  0% 4/477] target SharedLib: libglapi
> >  >
> >
>  
> (out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so)
> >  >  > > > FAILED:
> >  >
> >
>  
> out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so
> >  >  > > > ...
> >  >  > > >
> >  >
> >
>  
> prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> >  > warning: shared library text segment is not shareable
> >  >  > > >
> >  >
> >
>  
> prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> >  > error: treating warnings as errors
> >  >  > > > clang-6.0: error: linker command failed with exit code
> > 1 (use
> >  > -v to see invocation)
> >  >  > > >
> >  >  > > > Fixes: 20294dc ("mesa: Enable asm unconditionally, now
> > that
> >  > gen_matypes is gone.")
> >  >  > > > Signed-off-by: Mauro Rossi  > <mailto:issor.or...@gmail.com>
> >  > <mailto:issor.or...@gmail.com <mailto:issor.or...@gmail.com
> >>>
> >  >  > > > ---
> >  >  > > > Android.common.mk <http://Android.common.mk>
> > <http://Android.common.mk>
> >  >   | 3 +++
> >  >  > > >  Android.mk  | 7 +++
> >  >  > > >  src/mesa/Android.libmesa_dricore.mk
> > <http://Android.libmesa_dricore.mk>
> >  > <http://Android.libmesa_dricore.mk> | 2 ++
> >  >  > > >  src/mesa/Android.libmesa_st_mesa.mk
> > <http://Android.libmesa_st_mesa.mk>
> >  > <http://Android.libmesa_st_mesa.mk> | 2 ++
> >  >  > > >  4 files changed, 14 insertions(+)
> >  >  > > >
> >  >  > > > diff --git a/Android.common.mk
> > <http://Android.common.mk> <http://Android.common.mk>
> >  > b/Android.common.mk <http://Android.common.mk>
> > <http://Android.common.mk>
> >  >  > > > index 8a1c734353..209654bb75 100644
> >  >  > > > --- a/Android.common.mk <http://Android.common.mk>
> > <http://Android.common.mk>
> >  >  > > > +++ b/Android.common.mk <http:/

[Mesa-dev] [PATCH] i965/gen11: fix genX_bits.h include path

2019-08-13 Thread Mauro Rossi
Instead of "genX_bits.h" use "genxml/genX_bits.h"
as already done in other similar cases

Besides being more correct, it also fixes building error in Android.

Fixes: f0d2923 ("i965/gen11: Emit SLICE_HASH_TABLE when pipes are unbalanced.")
Signed-off-by: Mauro Rossi 
---
 src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c 
b/src/mesa/drivers/dri/i965/brw_state_upload.c
index c095f2e59c..87550425fc 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -43,7 +43,7 @@
 #include "brw_gs.h"
 #include "brw_wm.h"
 #include "brw_cs.h"
-#include "genX_bits.h"
+#include "genxml/genX_bits.h"
 #include "main/framebuffer.h"
 
 void
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: mesa: revert "Enable asm unconditionally"

2019-08-13 Thread Mauro Rossi
Hi,

On Tue, Aug 13, 2019 at 2:03 PM Tapani Pälli  wrote:

> Hi;
>
> On 8/13/19 2:43 PM, Mauro Rossi wrote:
> > Hi Tapani,
> >
> > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi  > <mailto:issor.or...@gmail.com>> wrote:
> >
> > On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi  > <mailto:issor.or...@gmail.com>> wrote:
> >  >
> >  > On Thu, Jul 18, 2019 at 1:07 PM Chih-Wei Huang
> > mailto:cwhu...@android-x86.org>> wrote:
> >  > >
> >  > > Mauro Rossi  > <mailto:issor.or...@gmail.com>> 於 2019年7月14日 週日 下午5:17寫道:
> >  > > >
> >  > > > This patch partially reverts 20294dc ("mesa: Enable asm
> > unconditionally, ...")
> >  > > >
> >  > > > Android makefile build logic needs to disable assembler
> > optimization
> >  > > > in 32bit builds to avoid text relocations for libglapi.so
> shared
> >  > > >
> >  > > > Fixes the following build error with Android x86 32bit target:
> >  > > >
> >  > > > [  0% 4/477] target SharedLib: libglapi
> >
>  
> (out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so)
> >  > > > FAILED:
> >
>  
> out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so
> >  > > > ...
> >  > > >
> >
>  
> prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> > warning: shared library text segment is not shareable
> >  > > >
> >
>  
> prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> > error: treating warnings as errors
> >  > > > clang-6.0: error: linker command failed with exit code 1 (use
> > -v to see invocation)
> >  > > >
> >  > > > Fixes: 20294dc ("mesa: Enable asm unconditionally, now that
> > gen_matypes is gone.")
> >  > > > Signed-off-by: Mauro Rossi  > <mailto:issor.or...@gmail.com>>
> >  > > > ---
> >  > > > Android.common.mk <http://Android.common.mk>
> >   | 3 +++
> >  > > >  Android.mk  | 7 +++
> >  > > >  src/mesa/Android.libmesa_dricore.mk
> > <http://Android.libmesa_dricore.mk> | 2 ++
> >  > > >  src/mesa/Android.libmesa_st_mesa.mk
> > <http://Android.libmesa_st_mesa.mk> | 2 ++
> >  > > >  4 files changed, 14 insertions(+)
> >  > > >
> >  > > > diff --git a/Android.common.mk <http://Android.common.mk>
> > b/Android.common.mk <http://Android.common.mk>
> >  > > > index 8a1c734353..209654bb75 100644
> >  > > > --- a/Android.common.mk <http://Android.common.mk>
> >  > > > +++ b/Android.common.mk <http://Android.common.mk>
> >  > > > @@ -106,9 +106,12 @@ ifeq ($(shell test
> > $(PLATFORM_SDK_VERSION) -ge 26 && echo true),true)
> >  > > >  LOCAL_CFLAGS += -DHAVE_SYS_SHM_H
> >  > > >  endif
> >  > > >
> >  > > > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)
> >  > > >  ifeq ($(TARGET_ARCH),x86)
> >  > > >  LOCAL_CFLAGS += \
> >  > > > -DUSE_X86_ASM
> >  > > > +
> >  > > > +endif
> >  > > >  endif
> >  > > >  ifeq ($(ARCH_ARM_HAVE_NEON),true)
> >  > > >  LOCAL_CFLAGS_arm += -DUSE_ARM_ASM
> >  > > > diff --git a/Android.mk b/Android.mk
> >  > > > index 57613eccfc..4a2a003ea3 100644
> >  > > > --- a/Android.mk
> >  > > > +++ b/Android.mk
> >  > > > @@ -83,6 +83,13 @@ endif
> >  > > >
> >  > > >  $(foreach d, $(MESA_BUILD_CLASSIC) $(MESA_BUILD_GALLIUM),
> > $(eval $(d) := true))
> >  > > >
> >  > > > +# host and target must be the same arch to generate matypes.h
> >  > > > +ifeq ($(TARGET_ARCH),$(HOST_ARCH))
> >  > > > +MESA_ENABLE_ASM := true
> >  > > > +else
> >  > > > +MESA_ENABLE_ASM := false
> >  > > > +endif
> >  > > > +
> >  > > >  ifneq ($(filter true, $(HAVE

[Mesa-dev] [PATCH] android: intel/perf: fix missing include path in makefile

2019-08-09 Thread Mauro Rossi
Fixes the following building error:

In file included from external/mesa/src/intel/perf/gen_perf.c:42:
external/mesa/src/util/u_math.h:42:10:
fatal error: 'pipe/p_compiler.h' file not found
 ^~~
1 error generated.

Fixes: 018f9b8 ("intel/perf: refactor gen_perf_begin_query into gen_perf")
Signed-off-by: Mauro Rossi 
---
 src/intel/Android.perf.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/intel/Android.perf.mk b/src/intel/Android.perf.mk
index 0d7d746a63..c99d84c4be 100644
--- a/src/intel/Android.perf.mk
+++ b/src/intel/Android.perf.mk
@@ -31,7 +31,9 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 
 intermediates := $(call local-generated-sources-dir)
 
-LOCAL_C_INCLUDES := $(MESA_TOP)/include/drm-uapi
+LOCAL_C_INCLUDES := \
+   $(MESA_TOP)/include/drm-uapi \
+   $(MESA_TOP)/src/gallium/include
 
 LOCAL_SRC_FILES := $(GEN_PERF_FILES)
 
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: mesa: revert "Enable asm unconditionally"

2019-07-27 Thread Mauro Rossi
On Sat, Jul 27, 2019 at 2:56 PM Mauro Rossi  wrote:
>
> On Thu, Jul 18, 2019 at 1:07 PM Chih-Wei Huang  
> wrote:
> >
> > Mauro Rossi  於 2019年7月14日 週日 下午5:17寫道:
> > >
> > > This patch partially reverts 20294dc ("mesa: Enable asm unconditionally, 
> > > ...")
> > >
> > > Android makefile build logic needs to disable assembler optimization
> > > in 32bit builds to avoid text relocations for libglapi.so shared
> > >
> > > Fixes the following build error with Android x86 32bit target:
> > >
> > > [  0% 4/477] target SharedLib: libglapi 
> > > (out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so)
> > > FAILED: 
> > > out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so
> > > ...
> > > prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> > >  warning: shared library text segment is not shareable
> > > prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> > >  error: treating warnings as errors
> > > clang-6.0: error: linker command failed with exit code 1 (use -v to see 
> > > invocation)
> > >
> > > Fixes: 20294dc ("mesa: Enable asm unconditionally, now that gen_matypes 
> > > is gone.")
> > > Signed-off-by: Mauro Rossi 
> > > ---
> > >  Android.common.mk   | 3 +++
> > >  Android.mk  | 7 +++
> > >  src/mesa/Android.libmesa_dricore.mk | 2 ++
> > >  src/mesa/Android.libmesa_st_mesa.mk | 2 ++
> > >  4 files changed, 14 insertions(+)
> > >
> > > diff --git a/Android.common.mk b/Android.common.mk
> > > index 8a1c734353..209654bb75 100644
> > > --- a/Android.common.mk
> > > +++ b/Android.common.mk
> > > @@ -106,9 +106,12 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && 
> > > echo true),true)
> > >  LOCAL_CFLAGS += -DHAVE_SYS_SHM_H
> > >  endif
> > >
> > > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)
> > >  ifeq ($(TARGET_ARCH),x86)
> > >  LOCAL_CFLAGS += \
> > > -DUSE_X86_ASM
> > > +
> > > +endif
> > >  endif
> > >  ifeq ($(ARCH_ARM_HAVE_NEON),true)
> > >  LOCAL_CFLAGS_arm += -DUSE_ARM_ASM
> > > diff --git a/Android.mk b/Android.mk
> > > index 57613eccfc..4a2a003ea3 100644
> > > --- a/Android.mk
> > > +++ b/Android.mk
> > > @@ -83,6 +83,13 @@ endif
> > >
> > >  $(foreach d, $(MESA_BUILD_CLASSIC) $(MESA_BUILD_GALLIUM), $(eval $(d) := 
> > > true))
> > >
> > > +# host and target must be the same arch to generate matypes.h
> > > +ifeq ($(TARGET_ARCH),$(HOST_ARCH))
> > > +MESA_ENABLE_ASM := true
> > > +else
> > > +MESA_ENABLE_ASM := false
> > > +endif
> > > +
> > >  ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI)),)
> > >  MESA_ENABLE_LLVM := true
> > >  endif
> > > diff --git a/src/mesa/Android.libmesa_dricore.mk 
> > > b/src/mesa/Android.libmesa_dricore.mk
> > > index 8eb6aabe83..792117767b 100644
> > > --- a/src/mesa/Android.libmesa_dricore.mk
> > > +++ b/src/mesa/Android.libmesa_dricore.mk
> > > @@ -39,9 +39,11 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
> > >  LOCAL_SRC_FILES := \
> > > $(MESA_FILES)
> > >
> > > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)
> > >  ifeq ($(TARGET_ARCH),x86)
> > > LOCAL_SRC_FILES += $(X86_FILES)
> > >  endif # x86
> > > +endif # MESA_ENABLE_ASM
> > >
> > >  ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
> > >  LOCAL_WHOLE_STATIC_LIBRARIES := \
> > > diff --git a/src/mesa/Android.libmesa_st_mesa.mk 
> > > b/src/mesa/Android.libmesa_st_mesa.mk
> > > index 16153a3c5b..ddfd03059c 100644
> > > --- a/src/mesa/Android.libmesa_st_mesa.mk
> > > +++ b/src/mesa/Android.libmesa_st_mesa.mk
> > > @@ -42,9 +42,11 @@ LOCAL_GENERATED_SOURCES := \
> > > $(MESA_GEN_GLSL_H) \
> > > $(MESA_GEN_NIR_H)
> > >
> > > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)
> > >  ifeq ($(TARGET_ARCH),x86)
> > > LOCAL_SRC_FILES += $(X86_FILES)
> > >  endif # x86
> > > +endif # MESA_ENABLE_ASM
> > >
> > >  ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
> > >  LOCAL_WHOLE_STATIC_LIBRARIES := \
> > > --
> >
> > Looks good to me.
> >
> > Review-by: Chih-Wei Huang 
>
> Added Tapani who should one of the users of 32bit mesa,
> please provide feedback to proceed.
> Mauro

Tapani added now
M.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: mesa: revert "Enable asm unconditionally"

2019-07-27 Thread Mauro Rossi
On Thu, Jul 18, 2019 at 1:07 PM Chih-Wei Huang  wrote:
>
> Mauro Rossi  於 2019年7月14日 週日 下午5:17寫道:
> >
> > This patch partially reverts 20294dc ("mesa: Enable asm unconditionally, 
> > ...")
> >
> > Android makefile build logic needs to disable assembler optimization
> > in 32bit builds to avoid text relocations for libglapi.so shared
> >
> > Fixes the following build error with Android x86 32bit target:
> >
> > [  0% 4/477] target SharedLib: libglapi 
> > (out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so)
> > FAILED: 
> > out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so
> > ...
> > prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> >  warning: shared library text segment is not shareable
> > prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
> >  error: treating warnings as errors
> > clang-6.0: error: linker command failed with exit code 1 (use -v to see 
> > invocation)
> >
> > Fixes: 20294dc ("mesa: Enable asm unconditionally, now that gen_matypes is 
> > gone.")
> > Signed-off-by: Mauro Rossi 
> > ---
> >  Android.common.mk   | 3 +++
> >  Android.mk  | 7 +++
> >  src/mesa/Android.libmesa_dricore.mk | 2 ++
> >  src/mesa/Android.libmesa_st_mesa.mk | 2 ++
> >  4 files changed, 14 insertions(+)
> >
> > diff --git a/Android.common.mk b/Android.common.mk
> > index 8a1c734353..209654bb75 100644
> > --- a/Android.common.mk
> > +++ b/Android.common.mk
> > @@ -106,9 +106,12 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && 
> > echo true),true)
> >  LOCAL_CFLAGS += -DHAVE_SYS_SHM_H
> >  endif
> >
> > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)
> >  ifeq ($(TARGET_ARCH),x86)
> >  LOCAL_CFLAGS += \
> > -DUSE_X86_ASM
> > +
> > +endif
> >  endif
> >  ifeq ($(ARCH_ARM_HAVE_NEON),true)
> >  LOCAL_CFLAGS_arm += -DUSE_ARM_ASM
> > diff --git a/Android.mk b/Android.mk
> > index 57613eccfc..4a2a003ea3 100644
> > --- a/Android.mk
> > +++ b/Android.mk
> > @@ -83,6 +83,13 @@ endif
> >
> >  $(foreach d, $(MESA_BUILD_CLASSIC) $(MESA_BUILD_GALLIUM), $(eval $(d) := 
> > true))
> >
> > +# host and target must be the same arch to generate matypes.h
> > +ifeq ($(TARGET_ARCH),$(HOST_ARCH))
> > +MESA_ENABLE_ASM := true
> > +else
> > +MESA_ENABLE_ASM := false
> > +endif
> > +
> >  ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI)),)
> >  MESA_ENABLE_LLVM := true
> >  endif
> > diff --git a/src/mesa/Android.libmesa_dricore.mk 
> > b/src/mesa/Android.libmesa_dricore.mk
> > index 8eb6aabe83..792117767b 100644
> > --- a/src/mesa/Android.libmesa_dricore.mk
> > +++ b/src/mesa/Android.libmesa_dricore.mk
> > @@ -39,9 +39,11 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
> >  LOCAL_SRC_FILES := \
> > $(MESA_FILES)
> >
> > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)
> >  ifeq ($(TARGET_ARCH),x86)
> > LOCAL_SRC_FILES += $(X86_FILES)
> >  endif # x86
> > +endif # MESA_ENABLE_ASM
> >
> >  ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
> >  LOCAL_WHOLE_STATIC_LIBRARIES := \
> > diff --git a/src/mesa/Android.libmesa_st_mesa.mk 
> > b/src/mesa/Android.libmesa_st_mesa.mk
> > index 16153a3c5b..ddfd03059c 100644
> > --- a/src/mesa/Android.libmesa_st_mesa.mk
> > +++ b/src/mesa/Android.libmesa_st_mesa.mk
> > @@ -42,9 +42,11 @@ LOCAL_GENERATED_SOURCES := \
> > $(MESA_GEN_GLSL_H) \
> > $(MESA_GEN_NIR_H)
> >
> > +ifeq ($(strip $(MESA_ENABLE_ASM)),true)
> >  ifeq ($(TARGET_ARCH),x86)
> > LOCAL_SRC_FILES += $(X86_FILES)
> >  endif # x86
> > +endif # MESA_ENABLE_ASM
> >
> >  ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
> >  LOCAL_WHOLE_STATIC_LIBRARIES := \
> > --
>
> Looks good to me.
>
> Review-by: Chih-Wei Huang 

Added Tapani who should one of the users of 32bit mesa,
please provide feedback to proceed.
Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: radv/gfx10: generate gfx10_format_table.h

2019-07-16 Thread Mauro Rossi
Hi,
kind reminder for Review or Ack,

apart from Android makefile changes Makefile.sources was modified
to add gfx10_format_table.h generated file.

Mauro

On Wed, Jul 10, 2019 at 9:13 AM Mauro Rossi  wrote:

> This patch adds gfx10_format_table.h in Makefile.sources
> and the rules for Android to fix following building errors:
>
> In file included from external/mesa/src/amd/vulkan/radv_debug.c:35:
> In file included from external/mesa/src/amd/vulkan/radv_debug.h:27:
> external/mesa/src/amd/vulkan/radv_private.h:95:10:
> fatal error: 'gfx10_format_table.h' file not found
>  ^~
> 1 error generated.
>
> In file included from external/mesa/src/amd/vulkan/radv_android.c:31:
> external/mesa/src/amd/vulkan/radv_private.h:95:10:
> fatal error: 'gfx10_format_table.h' file not found
>  ^~
> 1 error generated.
>
> Fixes: 3dc5ec5d16 ("radv/gfx10: generate gfx10_format_table.h")
> Signed-off-by: Mauro Rossi 
> ---
>  src/amd/vulkan/Android.mk   | 15 +++
>  src/amd/vulkan/Makefile.sources |  3 ++-
>  2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/Android.mk b/src/amd/vulkan/Android.mk
> index 0725feacb5..23cebb1ec8 100644
> --- a/src/amd/vulkan/Android.mk
> +++ b/src/amd/vulkan/Android.mk
> @@ -83,6 +83,7 @@ LOCAL_GENERATED_SOURCES +=
> $(intermediates)/radv_entrypoints.h
>  LOCAL_GENERATED_SOURCES += $(intermediates)/radv_extensions.c
>  LOCAL_GENERATED_SOURCES += $(intermediates)/radv_extensions.h
>  LOCAL_GENERATED_SOURCES += $(intermediates)/vk_format_table.c
> +LOCAL_GENERATED_SOURCES += $(intermediates)/gfx10_format_table.h
>
>  RADV_ENTRYPOINTS_SCRIPT :=
> $(MESA_TOP)/src/amd/vulkan/radv_entrypoints_gen.py
>  RADV_EXTENSIONS_SCRIPT := $(MESA_TOP)/src/amd/vulkan/radv_extensions.py
> @@ -117,6 +118,20 @@ $(intermediates)/vk_format_table.c:
> $(VK_FORMAT_TABLE_SCRIPT) \
> @mkdir -p $(dir $@)
> $(MESA_PYTHON2) $(VK_FORMAT_TABLE_SCRIPT) $(vk_format_layout_csv)
> > $@
>
> +RADV_GEN10_FORMAT_TABLE_INPUTS := \
> +   $(MESA_TOP)/src/amd/vulkan/vk_format_layout.csv \
> +   $(MESA_TOP)/src/amd/registers/gfx10-rsrc.json
> +
> +RADV_GEN10_FORMAT_TABLE_DEP := \
> +   $(MESA_TOP)/src/amd/registers/regdb.py
> +
> +RADV_GEN10_FORMAT_TABLE := $(LOCAL_PATH)/gfx10_format_table.py
> +
> +$(intermediates)/gfx10_format_table.h: $(RADV_GEN10_FORMAT_TABLE)
> $(RADV_GEN10_FORMAT_TABLE_INPUTS) $(RADV_GEN10_FORMAT_TABLE_DEP)
> +   @mkdir -p $(dir $@)
> +   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
> +   $(hide) $(MESA_PYTHON2) $(RADV_GEN10_FORMAT_TABLE)
> $(RADV_GEN10_FORMAT_TABLE_INPUTS) > $@ || ($(RM) $@; false)
> +
>  LOCAL_SHARED_LIBRARIES += $(RADV_SHARED_LIBRARIES)
>
>  LOCAL_EXPORT_C_INCLUDE_DIRS := \
> diff --git a/src/amd/vulkan/Makefile.sources
> b/src/amd/vulkan/Makefile.sources
> index df90c1150a..312cd0b1e9 100644
> --- a/src/amd/vulkan/Makefile.sources
> +++ b/src/amd/vulkan/Makefile.sources
> @@ -91,5 +91,6 @@ VULKAN_GENERATED_FILES := \
> radv_entrypoints.h \
> radv_extensions.c \
> radv_extensions.h \
> -   vk_format_table.c
> +   vk_format_table.c \
> +   gfx10_format_table.h
>
> --
> 2.20.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: mesa: revert "Enable asm unconditionally"

2019-07-14 Thread Mauro Rossi
This patch partially reverts 20294dc ("mesa: Enable asm unconditionally, ...")

Android makefile build logic needs to disable assembler optimization
in 32bit builds to avoid text relocations for libglapi.so shared

Fixes the following build error with Android x86 32bit target:

[  0% 4/477] target SharedLib: libglapi 
(out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so)
FAILED: 
out/target/product/x86/obj/SHARED_LIBRARIES/libglapi_intermediates/LINKED/libglapi.so
...
prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
 warning: shared library text segment is not shareable
prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/ld:
 error: treating warnings as errors
clang-6.0: error: linker command failed with exit code 1 (use -v to see 
invocation)

Fixes: 20294dc ("mesa: Enable asm unconditionally, now that gen_matypes is 
gone.")
Signed-off-by: Mauro Rossi 
---
 Android.common.mk   | 3 +++
 Android.mk  | 7 +++
 src/mesa/Android.libmesa_dricore.mk | 2 ++
 src/mesa/Android.libmesa_st_mesa.mk | 2 ++
 4 files changed, 14 insertions(+)

diff --git a/Android.common.mk b/Android.common.mk
index 8a1c734353..209654bb75 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -106,9 +106,12 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo 
true),true)
 LOCAL_CFLAGS += -DHAVE_SYS_SHM_H
 endif
 
+ifeq ($(strip $(MESA_ENABLE_ASM)),true)
 ifeq ($(TARGET_ARCH),x86)
 LOCAL_CFLAGS += \
-DUSE_X86_ASM
+
+endif
 endif
 ifeq ($(ARCH_ARM_HAVE_NEON),true)
 LOCAL_CFLAGS_arm += -DUSE_ARM_ASM
diff --git a/Android.mk b/Android.mk
index 57613eccfc..4a2a003ea3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -83,6 +83,13 @@ endif
 
 $(foreach d, $(MESA_BUILD_CLASSIC) $(MESA_BUILD_GALLIUM), $(eval $(d) := true))
 
+# host and target must be the same arch to generate matypes.h
+ifeq ($(TARGET_ARCH),$(HOST_ARCH))
+MESA_ENABLE_ASM := true
+else
+MESA_ENABLE_ASM := false
+endif
+
 ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI)),)
 MESA_ENABLE_LLVM := true
 endif
diff --git a/src/mesa/Android.libmesa_dricore.mk 
b/src/mesa/Android.libmesa_dricore.mk
index 8eb6aabe83..792117767b 100644
--- a/src/mesa/Android.libmesa_dricore.mk
+++ b/src/mesa/Android.libmesa_dricore.mk
@@ -39,9 +39,11 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 LOCAL_SRC_FILES := \
$(MESA_FILES)
 
+ifeq ($(strip $(MESA_ENABLE_ASM)),true)
 ifeq ($(TARGET_ARCH),x86)
LOCAL_SRC_FILES += $(X86_FILES)
 endif # x86
+endif # MESA_ENABLE_ASM
 
 ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
 LOCAL_WHOLE_STATIC_LIBRARIES := \
diff --git a/src/mesa/Android.libmesa_st_mesa.mk 
b/src/mesa/Android.libmesa_st_mesa.mk
index 16153a3c5b..ddfd03059c 100644
--- a/src/mesa/Android.libmesa_st_mesa.mk
+++ b/src/mesa/Android.libmesa_st_mesa.mk
@@ -42,9 +42,11 @@ LOCAL_GENERATED_SOURCES := \
$(MESA_GEN_GLSL_H) \
$(MESA_GEN_NIR_H)
 
+ifeq ($(strip $(MESA_ENABLE_ASM)),true)
 ifeq ($(TARGET_ARCH),x86)
LOCAL_SRC_FILES += $(X86_FILES)
 endif # x86
+endif # MESA_ENABLE_ASM
 
 ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
 LOCAL_WHOLE_STATIC_LIBRARIES := \
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 3/3] android: amd/addrlib: add gfx10 support

2019-07-10 Thread Mauro Rossi
Hi again Mark,

On Wed, Jul 10, 2019 at 4:59 PM Mark Janes  wrote:

> Do you have some documentation on how you are building Android with
> Mesa?  We set up a buildtest using an Android (Celadon) tree from Intel,
> and it seems to be less up-to-date than your build.
>
> Last week, you found a build error that was missed by our CI.  When you
> pushed this series, we got:
>
>  src/egl/main/egldevice.c:126:11: error: implicit declaration of function
> 'drmDevicesEqual'
>

This function should be provided by libdrm (mesa/drm xf86drm.h)
because the code is between  #ifdef HAVE_LIBDRM/#endif braces.

I'm using the following libdrm branch, but android-x86 additional commits
and my last one to prevent building error in IA-HardwareComposer,
shouldn't be neither interfering nor helping:
https://github.com/maurossi/drm/commits/2.4.99_android-x86

My series of fixes on amdgpu/radeonsi Android build rules did not touch
src/egl build rules
and looking at Chih-Wei they seem also unrelated, he may confirm that

Mauro



>
> I'd like to leverage your work to improve our automation, so we don't
> break your tree again.
>
> -Mark
>
> Mauro Rossi  writes:
>
> > Fix the following building error:
> >
> > external/mesa/src/amd/addrlib/src/gfx10/gfx10addrlib.cpp:35:10:
> > fatal error: 'gfx10_gb_reg.h' file not found
> >  ^~~~
> > 1 error generated.
> >
> > Fixes: 78cdf9a ("amd/addrlib: add gfx10 support")
> > Signed-off-by: Mauro Rossi 
> > ---
> >  src/amd/Android.addrlib.mk | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/src/amd/Android.addrlib.mk b/src/amd/Android.addrlib.mk
> > index 428fe19b20..eec78fc8bf 100644
> > --- a/src/amd/Android.addrlib.mk
> > +++ b/src/amd/Android.addrlib.mk
> > @@ -37,6 +37,7 @@ LOCAL_C_INCLUDES := \
> >   $(MESA_TOP)/src/amd/addrlib/src \
> >   $(MESA_TOP)/src/amd/addrlib/src/core \
> >   $(MESA_TOP)/src/amd/addrlib/src/chip/gfx9 \
> > + $(MESA_TOP)/src/amd/addrlib/src/chip/gfx10 \
> >   $(MESA_TOP)/src/amd/addrlib/src/chip/r800
> >
> >  LOCAL_EXPORT_C_INCLUDE_DIRS := \
> > --
> > 2.20.1
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 3/3] android: amd/addrlib: add gfx10 support

2019-07-10 Thread Mauro Rossi
Hi,
the procedure I apply is to build android-x86, but it could be applied to
AOSP or Celadon too.

The sequence of steps is described in details here:
https://www.android-x86.org/source.html

At the moment I am testing with
BOARD_GPU_DRIVERS ?= i915 i965 nouveau r300g r600g radeonsi virgl vmwgfx

http://git.osdn.net/view?p=android-x86/device-generic-common.git;a=blob;f=BoardConfig.mk;h=bd23daf54a7f45b4d2bc27c8cfa49e0deef801ae;hb=refs/heads/oreo-x86


Looking at extended drivers scope all the drivers having Android support
(Android.mk building rules) could be tested by CI,
to ensure Android build is at least not broken.

In order to test that the drivers "are just building ok" (pure build
verification)
the necessary action would be to add the drivers to BoardConfig.mk in
BOARD_GPU_DRIVERS variable.

Mauro

On Wed, Jul 10, 2019 at 4:59 PM Mark Janes  wrote:

> Do you have some documentation on how you are building Android with
> Mesa?  We set up a buildtest using an Android (Celadon) tree from Intel,
> and it seems to be less up-to-date than your build.
>
> Last week, you found a build error that was missed by our CI.  When you
> pushed this series, we got:
>
>  src/egl/main/egldevice.c:126:11: error: implicit declaration of function
> 'drmDevicesEqual'
>
> I'd like to leverage your work to improve our automation, so we don't
> break your tree again.
>
> -Mark
>
> Mauro Rossi  writes:
>
> > Fix the following building error:
> >
> > external/mesa/src/amd/addrlib/src/gfx10/gfx10addrlib.cpp:35:10:
> > fatal error: 'gfx10_gb_reg.h' file not found
> >  ^~~~
> > 1 error generated.
> >
> > Fixes: 78cdf9a ("amd/addrlib: add gfx10 support")
> > Signed-off-by: Mauro Rossi 
> > ---
> >  src/amd/Android.addrlib.mk | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/src/amd/Android.addrlib.mk b/src/amd/Android.addrlib.mk
> > index 428fe19b20..eec78fc8bf 100644
> > --- a/src/amd/Android.addrlib.mk
> > +++ b/src/amd/Android.addrlib.mk
> > @@ -37,6 +37,7 @@ LOCAL_C_INCLUDES := \
> >   $(MESA_TOP)/src/amd/addrlib/src \
> >   $(MESA_TOP)/src/amd/addrlib/src/core \
> >   $(MESA_TOP)/src/amd/addrlib/src/chip/gfx9 \
> > + $(MESA_TOP)/src/amd/addrlib/src/chip/gfx10 \
> >   $(MESA_TOP)/src/amd/addrlib/src/chip/r800
> >
> >  LOCAL_EXPORT_C_INCLUDE_DIRS := \
> > --
> > 2.20.1
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: radv/gfx10: generate gfx10_format_table.h

2019-07-10 Thread Mauro Rossi
This patch adds gfx10_format_table.h in Makefile.sources
and the rules for Android to fix following building errors:

In file included from external/mesa/src/amd/vulkan/radv_debug.c:35:
In file included from external/mesa/src/amd/vulkan/radv_debug.h:27:
external/mesa/src/amd/vulkan/radv_private.h:95:10:
fatal error: 'gfx10_format_table.h' file not found
 ^~
1 error generated.

In file included from external/mesa/src/amd/vulkan/radv_android.c:31:
external/mesa/src/amd/vulkan/radv_private.h:95:10:
fatal error: 'gfx10_format_table.h' file not found
 ^~
1 error generated.

Fixes: 3dc5ec5d16 ("radv/gfx10: generate gfx10_format_table.h")
Signed-off-by: Mauro Rossi 
---
 src/amd/vulkan/Android.mk   | 15 +++
 src/amd/vulkan/Makefile.sources |  3 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/Android.mk b/src/amd/vulkan/Android.mk
index 0725feacb5..23cebb1ec8 100644
--- a/src/amd/vulkan/Android.mk
+++ b/src/amd/vulkan/Android.mk
@@ -83,6 +83,7 @@ LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.h
 LOCAL_GENERATED_SOURCES += $(intermediates)/radv_extensions.c
 LOCAL_GENERATED_SOURCES += $(intermediates)/radv_extensions.h
 LOCAL_GENERATED_SOURCES += $(intermediates)/vk_format_table.c
+LOCAL_GENERATED_SOURCES += $(intermediates)/gfx10_format_table.h
 
 RADV_ENTRYPOINTS_SCRIPT := $(MESA_TOP)/src/amd/vulkan/radv_entrypoints_gen.py
 RADV_EXTENSIONS_SCRIPT := $(MESA_TOP)/src/amd/vulkan/radv_extensions.py
@@ -117,6 +118,20 @@ $(intermediates)/vk_format_table.c: 
$(VK_FORMAT_TABLE_SCRIPT) \
@mkdir -p $(dir $@)
$(MESA_PYTHON2) $(VK_FORMAT_TABLE_SCRIPT) $(vk_format_layout_csv) > $@
 
+RADV_GEN10_FORMAT_TABLE_INPUTS := \
+   $(MESA_TOP)/src/amd/vulkan/vk_format_layout.csv \
+   $(MESA_TOP)/src/amd/registers/gfx10-rsrc.json
+
+RADV_GEN10_FORMAT_TABLE_DEP := \
+   $(MESA_TOP)/src/amd/registers/regdb.py
+
+RADV_GEN10_FORMAT_TABLE := $(LOCAL_PATH)/gfx10_format_table.py
+
+$(intermediates)/gfx10_format_table.h: $(RADV_GEN10_FORMAT_TABLE) 
$(RADV_GEN10_FORMAT_TABLE_INPUTS) $(RADV_GEN10_FORMAT_TABLE_DEP)
+   @mkdir -p $(dir $@)
+   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+   $(hide) $(MESA_PYTHON2) $(RADV_GEN10_FORMAT_TABLE) 
$(RADV_GEN10_FORMAT_TABLE_INPUTS) > $@ || ($(RM) $@; false)
+
 LOCAL_SHARED_LIBRARIES += $(RADV_SHARED_LIBRARIES)
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
diff --git a/src/amd/vulkan/Makefile.sources b/src/amd/vulkan/Makefile.sources
index df90c1150a..312cd0b1e9 100644
--- a/src/amd/vulkan/Makefile.sources
+++ b/src/amd/vulkan/Makefile.sources
@@ -91,5 +91,6 @@ VULKAN_GENERATED_FILES := \
radv_entrypoints.h \
radv_extensions.c \
radv_extensions.h \
-   vk_format_table.c
+   vk_format_table.c \
+   gfx10_format_table.h
 
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 2/3] android: amd/common/gfx10: add register JSON

2019-07-06 Thread Mauro Rossi
The necessary Android makefile building rules are added
and the generation rules are simplified for readability

Fixes the following building errors:

external/mesa/src/amd/common/ac_llvm_build.c:1496:45:
error: use of undeclared identifier 'V_008F0C_IMG_FORMAT_8_UINT'
   case V_008F0C_BUF_DATA_FORMAT_8: format = V_008F0C_IMG_FORMAT_8_UINT; break;
 ^
Fixes: 74a26af ("amd/common/gfx10: add register JSON")
Signed-off-by: Mauro Rossi 
---
 src/amd/Android.common.mk | 34 ++
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/src/amd/Android.common.mk b/src/amd/Android.common.mk
index 1a3a00b9bc..d5a266215f 100644
--- a/src/amd/Android.common.mk
+++ b/src/amd/Android.common.mk
@@ -41,14 +41,32 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 intermediates := $(call local-generated-sources-dir)
 LOCAL_GENERATED_SOURCES := $(addprefix $(intermediates)/, 
$(AMD_GENERATED_FILES))
 
-$(LOCAL_GENERATED_SOURCES): PRIVATE_PYTHON := $(MESA_PYTHON2)
-$(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PYTHON) $^ > $@
-
-$(intermediates)/common/sid_tables.h: $(LOCAL_PATH)/common/sid_tables.py 
$(LOCAL_PATH)/common/sid.h $(LOCAL_PATH)/registers/amdgfxregs.json 
$(LOCAL_PATH)/registers/pkt3.json
-   $(transform-generated-source)
-
-$(intermediates)/common/amdgfxregs.h: $(LOCAL_PATH)/registers/makeregheader.py 
$(LOCAL_PATH)/registers/amdgfxregs.json $(LOCAL_PATH)/registers/pkt3.json
-   $(transform-generated-source) --sort address --guard AMDGFXREGS_H
+SID_TABLES := $(LOCAL_PATH)/common/sid_tables.py
+
+SID_TABLES_INPUTS := \
+   $(LOCAL_PATH)/common/sid.h \
+   $(LOCAL_PATH)/registers/amdgfxregs.json \
+   $(LOCAL_PATH)/registers/pkt3.json \
+   $(LOCAL_PATH)/registers/gfx10.json \
+   $(LOCAL_PATH)/registers/gfx10-rsrc.json
+
+$(intermediates)/common/sid_tables.h: $(SID_TABLES) $(SID_TABLES_INPUTS)
+   @mkdir -p $(dir $@)
+   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+   $(hide) $(MESA_PYTHON2) $(SID_TABLES) $(SID_TABLES_INPUTS) > $@ || 
($(RM) $@; false)
+
+AMDGFXREGS := $(LOCAL_PATH)/registers/makeregheader.py
+
+AMDGFXREGS_INPUTS := \
+   $(LOCAL_PATH)/registers/amdgfxregs.json \
+   $(LOCAL_PATH)/registers/pkt3.json \
+   $(LOCAL_PATH)/registers/gfx10.json \
+   $(LOCAL_PATH)/registers/gfx10-rsrc.json
+
+$(intermediates)/common/amdgfxregs.h: $(AMDGFXREGS) $(AMDGFXREGS_INPUTS)
+   @mkdir -p $(dir $@)
+   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+   $(hide) $(MESA_PYTHON2) $(AMDGFXREGS) $(AMDGFXREGS_INPUTS) --sort 
address --guard AMDGFXREGS_H > $@ || ($(RM) $@; false)
 
 LOCAL_C_INCLUDES := \
$(MESA_TOP)/include \
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 3/3] android: amd/addrlib: add gfx10 support

2019-07-06 Thread Mauro Rossi
Fix the following building error:

external/mesa/src/amd/addrlib/src/gfx10/gfx10addrlib.cpp:35:10:
fatal error: 'gfx10_gb_reg.h' file not found
 ^~~~
1 error generated.

Fixes: 78cdf9a ("amd/addrlib: add gfx10 support")
Signed-off-by: Mauro Rossi 
---
 src/amd/Android.addrlib.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/Android.addrlib.mk b/src/amd/Android.addrlib.mk
index 428fe19b20..eec78fc8bf 100644
--- a/src/amd/Android.addrlib.mk
+++ b/src/amd/Android.addrlib.mk
@@ -37,6 +37,7 @@ LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/amd/addrlib/src \
$(MESA_TOP)/src/amd/addrlib/src/core \
$(MESA_TOP)/src/amd/addrlib/src/chip/gfx9 \
+   $(MESA_TOP)/src/amd/addrlib/src/chip/gfx10 \
$(MESA_TOP)/src/amd/addrlib/src/chip/r800
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 1/3] android: radeonsi/gfx10: generate gfx10_format_table.h (v2)

2019-07-06 Thread Mauro Rossi
Fix Android building rules for gfx10_format_table.h generated header

(v2) Add LOCAL_C_INCLUDES += $(intermediates)/radeonsi to fix error:

external/mesa/src/gallium/drivers/radeonsi/si_state.c:46:10:
fatal error: 'gfx10_format_table.h' file not found
 ^~
1 error generated.

Fixes: 0ffa229 ("radeonsi/gfx10: generate gfx10_format_table.h")
Signed-off-by: Mauro Rossi 
---
 src/gallium/drivers/radeonsi/Android.mk | 16 
 1 file changed, 16 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/Android.mk 
b/src/gallium/drivers/radeonsi/Android.mk
index 76309a4ebc..e402da639e 100644
--- a/src/gallium/drivers/radeonsi/Android.mk
+++ b/src/gallium/drivers/radeonsi/Android.mk
@@ -61,6 +61,22 @@ $(intermediates)/radeonsi/si_driinfo.h: $(MERGE_DRIINFO) 
$(GEN_DRIINFO_INPUTS)
@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
$(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) > $@ || 
($(RM) $@; false)
 
+GEN10_FORMAT_TABLE_INPUTS := \
+   $(MESA_TOP)/src/gallium/auxiliary/util/u_format.csv \
+   $(MESA_TOP)/src/amd/registers/gfx10-rsrc.json
+
+GEN10_FORMAT_TABLE_DEP := \
+   $(MESA_TOP)/src/amd/registers/regdb.py
+
+GEN10_FORMAT_TABLE := $(LOCAL_PATH)/gfx10_format_table.py
+
+$(intermediates)/radeonsi/gfx10_format_table.h: $(GEN10_FORMAT_TABLE) 
$(GEN10_FORMAT_TABLE_INPUTS) $(GEN10_FORMAT_TABLE_DEP)
+   @mkdir -p $(dir $@)
+   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+   $(hide) $(MESA_PYTHON2) $(GEN10_FORMAT_TABLE) 
$(GEN10_FORMAT_TABLE_INPUTS) > $@ || ($(RM) $@; false)
+
+LOCAL_C_INCLUDES += $(intermediates)/radeonsi
+
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
 
 $(call mesa-build-with-llvm)
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: radeonsi/gfx10: generate gfx10_format_table.h

2019-07-06 Thread Mauro Rossi
Hi,
there are more issues to resove with gfx10 new code,
this patch does not suffice.

I am sending a separate series with updated patches.

I added Nicolai and Marek because some of their commits need those fixes.
Please follow the new thread

Mauro



On Sat, Jul 6, 2019 at 4:01 PM Mauro Rossi  wrote:

> Fix Android building rules for gfx10_format_table.h generated header
>
> Fixes: 0ffa229 ("radeonsi/gfx10: generate gfx10_format_table.h")
> Signed-off-by: Mauro Rossi 
> ---
>  src/gallium/drivers/radeonsi/Android.mk | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/Android.mk
> b/src/gallium/drivers/radeonsi/Android.mk
> index 76309a4ebc..efdcec8ab9 100644
> --- a/src/gallium/drivers/radeonsi/Android.mk
> +++ b/src/gallium/drivers/radeonsi/Android.mk
> @@ -61,6 +61,20 @@ $(intermediates)/radeonsi/si_driinfo.h:
> $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS)
> @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
> $(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) >
> $@ || ($(RM) $@; false)
>
> +GEN10_FORMAT_TABLE_INPUTS := \
> +   $(MESA_TOP)/src/gallium/auxiliary/util/u_format.csv \
> +   $(MESA_TOP)/src/amd/registers/gfx10-rsrc.json
> +
> +GEN10_FORMAT_TABLE_DEP := \
> +   $(MESA_TOP)/src/amd/registers/regdb.py
> +
> +GEN10_FORMAT_TABLE := $(LOCAL_PATH)/gfx10_format_table.py
> +
> +$(intermediates)/radeonsi/gfx10_format_table.h: $(GEN10_FORMAT_TABLE)
> $(GEN10_FORMAT_TABLE_INPUTS) $(GEN10_FORMAT_TABLE_DEP)
> +   @mkdir -p $(dir $@)
> +   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
> +   $(hide) $(MESA_PYTHON2) $(GEN10_FORMAT_TABLE)
> $(GEN10_FORMAT_TABLE_INPUTS) > $@ || ($(RM) $@; false)
> +
>  LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
>
>  $(call mesa-build-with-llvm)
> --
> 2.20.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: radeonsi/gfx10: generate gfx10_format_table.h

2019-07-06 Thread Mauro Rossi
Fix Android building rules for gfx10_format_table.h generated header

Fixes: 0ffa229 ("radeonsi/gfx10: generate gfx10_format_table.h")
Signed-off-by: Mauro Rossi 
---
 src/gallium/drivers/radeonsi/Android.mk | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/Android.mk 
b/src/gallium/drivers/radeonsi/Android.mk
index 76309a4ebc..efdcec8ab9 100644
--- a/src/gallium/drivers/radeonsi/Android.mk
+++ b/src/gallium/drivers/radeonsi/Android.mk
@@ -61,6 +61,20 @@ $(intermediates)/radeonsi/si_driinfo.h: $(MERGE_DRIINFO) 
$(GEN_DRIINFO_INPUTS)
@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
$(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) > $@ || 
($(RM) $@; false)
 
+GEN10_FORMAT_TABLE_INPUTS := \
+   $(MESA_TOP)/src/gallium/auxiliary/util/u_format.csv \
+   $(MESA_TOP)/src/amd/registers/gfx10-rsrc.json
+
+GEN10_FORMAT_TABLE_DEP := \
+   $(MESA_TOP)/src/amd/registers/regdb.py
+
+GEN10_FORMAT_TABLE := $(LOCAL_PATH)/gfx10_format_table.py
+
+$(intermediates)/radeonsi/gfx10_format_table.h: $(GEN10_FORMAT_TABLE) 
$(GEN10_FORMAT_TABLE_INPUTS) $(GEN10_FORMAT_TABLE_DEP)
+   @mkdir -p $(dir $@)
+   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+   $(hide) $(MESA_PYTHON2) $(GEN10_FORMAT_TABLE) 
$(GEN10_FORMAT_TABLE_INPUTS) > $@ || ($(RM) $@; false)
+
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
 
 $(call mesa-build-with-llvm)
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: virgl: fix libmesa_virgil_common build and dependencies

2019-06-29 Thread Mauro Rossi
Hi,

On Tue, Jun 25, 2019 at 12:07 PM Chih-Wei Huang 
wrote:

> Mauro Rossi  於 2019年6月25日 週二 下午5:52寫道:
> >
> > Hi,
> >
> > On Mon, Jun 24, 2019 at 8:55 AM Chih-Wei Huang 
> wrote:
> >>
> >> Mauro Rossi  於 2019年6月15日 週六 下午1:39寫道:
> >> >
> >> > Fixes the following building errors and resolves Bug 110922
> >> > Fixes gallium_dri target missing symbols at linking.
> >> >
> >> > external/mesa/src/gallium/winsys/virgl/drm/Android.mk:
> >> > error: libmesa_winsys_virgl (STATIC_LIBRARIES android-x86_64) missing
> libmesa_winsys_virgl_common (STATIC_LIBRARIES android-x86_64)
> >> > ...
> >> > external/mesa/src/gallium/winsys/virgl/vtest/Android.mk:
> >> > error: libmesa_winsys_virgl_vtest (STATIC_LIBRARIES android-x86_64)
> missing libmesa_winsys_virgl_common (STATIC_LIBRARIES android-x86_64)
> >> > ...
> >> > build/core/main.mk:728: error: exiting from previous errors.
> >> >
> >> > In file included from
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c:34:
> >> >
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h:35:10:
> >> > fatal error: 'virgl_resource_cache.h' file not found
> >> >  ^~~~
> >> > 1 error generated.
> >> >
> >> > In file included from
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c:32:
> >> >
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h:35:10:
> >> > fatal error: 'virgl_resource_cache.h' file not found
> >> > #include "virgl_resource_cache.h"
> >> >  ^~~~
> >> > 1 error generated.
> >> >
> >> > Fixes: b18f09a ("virgl: Introduce virgl_resource_cache")
> >> > Signed-off-by: Mauro Rossi 
> >> > ---
> >> >  src/gallium/Android.mk| 2 +-
> >> >  src/gallium/drivers/virgl/Android.mk  | 2 +-
> >> >  src/gallium/winsys/virgl/drm/Android.mk   | 2 ++
> >> >  src/gallium/winsys/virgl/vtest/Android.mk | 2 ++
> >> >  4 files changed, 6 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
> >> > index 3a3f042c7a..37e923c225 100644
> >> > --- a/src/gallium/Android.mk
> >> > +++ b/src/gallium/Android.mk
> >> > @@ -43,7 +43,7 @@ SUBDIRS += winsys/radeon/drm drivers/r300
> >> >  SUBDIRS += winsys/radeon/drm drivers/r600
> >> >  SUBDIRS += winsys/radeon/drm winsys/amdgpu/drm drivers/radeonsi
> >> >  SUBDIRS += winsys/vc4/drm drivers/vc4
> >> > -SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
> >> > +SUBDIRS += winsys/virgl/common winsys/virgl/drm winsys/virgl/vtest
> drivers/virgl
> >> >  SUBDIRS += winsys/svga/drm drivers/svga
> >> >  SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
> >> >  SUBDIRS += state_trackers/dri
> >> > diff --git a/src/gallium/drivers/virgl/Android.mk
> b/src/gallium/drivers/virgl/Android.mk
> >> > index 0067dfa702..a6fe53fbe9 100644
> >> > --- a/src/gallium/drivers/virgl/Android.mk
> >> > +++ b/src/gallium/drivers/virgl/Android.mk
> >> > @@ -35,5 +35,5 @@ include $(BUILD_STATIC_LIBRARY)
> >> >
> >> >  ifneq ($(HAVE_GALLIUM_VIRGL),)
> >> >  GALLIUM_TARGET_DRIVERS += virtio_gpu
> >> > -$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl
> libmesa_winsys_virgl_vtest)
> >> > +$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl_common
> libmesa_winsys_virgl libmesa_winsys_virgl_vtest)
> >> >  endif
> >> > diff --git a/src/gallium/winsys/virgl/drm/Android.mk
> b/src/gallium/winsys/virgl/drm/Android.mk
> >> > index 5e2500774e..398a7645bc 100644
> >> > --- a/src/gallium/winsys/virgl/drm/Android.mk
> >> > +++ b/src/gallium/winsys/virgl/drm/Android.mk
> >> > @@ -27,6 +27,8 @@ include $(CLEAR_VARS)
> >> >
> >> >  LOCAL_SRC_FILES := $(C_SOURCES)
> >> >
> >> > +LOCAL_C_INCLUDES := $(GALLIUM_TOP)/winsys/virgl/common
> >>
> >> This should be unnecessary.
> >> The include path should be imported automatically.
> >> However, there is a typo in Android.mk of libmesa_winsys_virgl_common
> >> that prevents it from working. We should fix the typo instead of adding
> this.
> >> Will send a patch later.
> >
&

Re: [Mesa-dev] [PATCH] android: virgl: fix generated virgl_driinfo.h building rules

2019-06-25 Thread Mauro Rossi
Hi Chih-Wei,

On Mon, Jun 24, 2019 at 7:26 AM Chih-Wei Huang 
wrote:

> Mauro Rossi  於 2019年6月22日 週六 上午2:06寫道:
> >
> > Changelog in Android makefile:
> > - Add LOCAL_MODULE_CLASS, intermediates and LOCAL_GENERATED_SOURCES
> > - Use LOCAL_EXPORT_C_INCLUDE_DIRS to export $(intermediates) path
> > - Move generated header rules before 'include $(BUILD_STATIC_LIBRARY)'
> >
> > Fixes the following building error:
> >
> > In file included from external/mesa/src/gallium/targets/dri/target.c:1:
> > external/mesa/src/gallium/auxiliary/target-helpers/drm_helper.h:257:16:
> > fatal error: 'virgl/virgl_driinfo.h' file not found
> >   #include "virgl/virgl_driinfo.h"
> >^~~
> > 1 error generated.
> >
> > Fixes: cf800998a ("virgl: Add driinfo file and tie it into the build")
> > Signed-off-by: Mauro Rossi 
> > ---
> >  src/gallium/drivers/virgl/Android.mk | 10 --
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/gallium/drivers/virgl/Android.mk
> b/src/gallium/drivers/virgl/Android.mk
> > index f77bcf196e..585ed7b2ce 100644
> > --- a/src/gallium/drivers/virgl/Android.mk
> > +++ b/src/gallium/drivers/virgl/Android.mk
> > @@ -30,8 +30,9 @@ LOCAL_SRC_FILES := \
> >
> >  LOCAL_MODULE := libmesa_pipe_virgl
> >
> > -include $(GALLIUM_COMMON_MK)
> > -include $(BUILD_STATIC_LIBRARY)
> > +LOCAL_MODULE_CLASS := STATIC_LIBRARIES
> > +intermediates := $(call local-generated-sources-dir)
> > +LOCAL_GENERATED_SOURCES += $(intermediates)/virgl/virgl_driinfo.h
> >
> >  GEN_DRIINFO_INPUTS := \
> > $(MESA_TOP)/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h \
> > @@ -44,6 +45,11 @@ $(intermediates)/virgl/virgl_driinfo.h:
> $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS)
> > @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
> > $(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) >
> $@ || ($(RM) $@; false)
> >
> > +LOCAL_EXPORT_C_INCLUDE_DIRS += $(intermediates)
> > +
> > +include $(GALLIUM_COMMON_MK)
> > +include $(BUILD_STATIC_LIBRARY)
> > +
> >  ifneq ($(HAVE_GALLIUM_VIRGL),)
> >  GALLIUM_TARGET_DRIVERS += virtio_gpu
> >  $(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl_common
> libmesa_winsys_virgl libmesa_winsys_virgl_vtest)
> > --
>
> I suggest to use := instead of += in
> LOCAL_GENERATED_SOURCES and LOCAL_EXPORT_C_INCLUDE_DIRS
> since they don't catenate others.
>

Thanks a lot, I did not know that, I will correct in the final version.


> Except that, the patch looks good to me.
>
> Review-by: Chih-Wei Huang 
>

Thanks for the review
Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: virgl: fix libmesa_virgil_common build and dependencies

2019-06-25 Thread Mauro Rossi
Hi,

On Mon, Jun 24, 2019 at 8:55 AM Chih-Wei Huang 
wrote:

> Mauro Rossi  於 2019年6月15日 週六 下午1:39寫道:
> >
> > Fixes the following building errors and resolves Bug 110922
> > Fixes gallium_dri target missing symbols at linking.
> >
> > external/mesa/src/gallium/winsys/virgl/drm/Android.mk:
> > error: libmesa_winsys_virgl (STATIC_LIBRARIES android-x86_64) missing
> libmesa_winsys_virgl_common (STATIC_LIBRARIES android-x86_64)
> > ...
> > external/mesa/src/gallium/winsys/virgl/vtest/Android.mk:
> > error: libmesa_winsys_virgl_vtest (STATIC_LIBRARIES android-x86_64)
> missing libmesa_winsys_virgl_common (STATIC_LIBRARIES android-x86_64)
> > ...
> > build/core/main.mk:728: error: exiting from previous errors.
> >
> > In file included from
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c:34:
> > external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h:35:10:
> > fatal error: 'virgl_resource_cache.h' file not found
> >  ^~~~
> > 1 error generated.
> >
> > In file included from
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c:32:
> > external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h:35:10:
> > fatal error: 'virgl_resource_cache.h' file not found
> > #include "virgl_resource_cache.h"
> >  ^~~~
> > 1 error generated.
> >
> > Fixes: b18f09a ("virgl: Introduce virgl_resource_cache")
> > Signed-off-by: Mauro Rossi 
> > ---
> >  src/gallium/Android.mk| 2 +-
> >  src/gallium/drivers/virgl/Android.mk  | 2 +-
> >  src/gallium/winsys/virgl/drm/Android.mk   | 2 ++
> >  src/gallium/winsys/virgl/vtest/Android.mk | 2 ++
> >  4 files changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
> > index 3a3f042c7a..37e923c225 100644
> > --- a/src/gallium/Android.mk
> > +++ b/src/gallium/Android.mk
> > @@ -43,7 +43,7 @@ SUBDIRS += winsys/radeon/drm drivers/r300
> >  SUBDIRS += winsys/radeon/drm drivers/r600
> >  SUBDIRS += winsys/radeon/drm winsys/amdgpu/drm drivers/radeonsi
> >  SUBDIRS += winsys/vc4/drm drivers/vc4
> > -SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
> > +SUBDIRS += winsys/virgl/common winsys/virgl/drm winsys/virgl/vtest
> drivers/virgl
> >  SUBDIRS += winsys/svga/drm drivers/svga
> >  SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
> >  SUBDIRS += state_trackers/dri
> > diff --git a/src/gallium/drivers/virgl/Android.mk
> b/src/gallium/drivers/virgl/Android.mk
> > index 0067dfa702..a6fe53fbe9 100644
> > --- a/src/gallium/drivers/virgl/Android.mk
> > +++ b/src/gallium/drivers/virgl/Android.mk
> > @@ -35,5 +35,5 @@ include $(BUILD_STATIC_LIBRARY)
> >
> >  ifneq ($(HAVE_GALLIUM_VIRGL),)
> >  GALLIUM_TARGET_DRIVERS += virtio_gpu
> > -$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl
> libmesa_winsys_virgl_vtest)
> > +$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl_common
> libmesa_winsys_virgl libmesa_winsys_virgl_vtest)
> >  endif
> > diff --git a/src/gallium/winsys/virgl/drm/Android.mk
> b/src/gallium/winsys/virgl/drm/Android.mk
> > index 5e2500774e..398a7645bc 100644
> > --- a/src/gallium/winsys/virgl/drm/Android.mk
> > +++ b/src/gallium/winsys/virgl/drm/Android.mk
> > @@ -27,6 +27,8 @@ include $(CLEAR_VARS)
> >
> >  LOCAL_SRC_FILES := $(C_SOURCES)
> >
> > +LOCAL_C_INCLUDES := $(GALLIUM_TOP)/winsys/virgl/common
>
> This should be unnecessary.
> The include path should be imported automatically.
> However, there is a typo in Android.mk of libmesa_winsys_virgl_common
> that prevents it from working. We should fix the typo instead of adding
> this.
> Will send a patch later.
>

I was also thinking the LOCAL_C_INCLUDES un-necessary,
but for some reason fatal error: '*.h' file not found was happening without
this

I double checked prior to submit the patch with the LOCAL_C_INCLUDES


>
> > +
> >  LOCAL_MODULE := libmesa_winsys_virgl
> >
> >  LOCAL_STATIC_LIBRARIES := libmesa_winsys_virgl_common
> > diff --git a/src/gallium/winsys/virgl/vtest/Android.mk
> b/src/gallium/winsys/virgl/vtest/Android.mk
> > index 5b33f67711..6d35223c8e 100644
> > --- a/src/gallium/winsys/virgl/vtest/Android.mk
> > +++ b/src/gallium/winsys/virgl/vtest/Android.mk
> > @@ -27,6 +27,8 @@ include $(CLEAR_VARS)
> >
> >  LOCAL_SRC_FILES := $(C_SOURCES)
> >
> > +LOCAL_C_INCLUDES := $(GALLIUM_TOP)/winsys/virgl/common
>
> Ditto
>

Same comment here
The patch has been already commited to master to at least avoid the
building errors

If you find more correct way, please submit new patch to mesa-dev
Thanks

Mauro


>
> > +
> >  LOCAL_MODULE := libmesa_winsys_virgl_vtest
> >
> >  LOCAL_STATIC_LIBRARIES := libmesa_winsys_virgl_common
> > --
>
>
>
> --
> 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: virgl: fix generated virgl_driinfo.h building rules

2019-06-21 Thread Mauro Rossi
Changelog in Android makefile:
- Add LOCAL_MODULE_CLASS, intermediates and LOCAL_GENERATED_SOURCES
- Use LOCAL_EXPORT_C_INCLUDE_DIRS to export $(intermediates) path
- Move generated header rules before 'include $(BUILD_STATIC_LIBRARY)'

Fixes the following building error:

In file included from external/mesa/src/gallium/targets/dri/target.c:1:
external/mesa/src/gallium/auxiliary/target-helpers/drm_helper.h:257:16:
fatal error: 'virgl/virgl_driinfo.h' file not found
  #include "virgl/virgl_driinfo.h"
   ^~~
1 error generated.

Fixes: cf800998a ("virgl: Add driinfo file and tie it into the build")
Signed-off-by: Mauro Rossi 
---
 src/gallium/drivers/virgl/Android.mk | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/virgl/Android.mk 
b/src/gallium/drivers/virgl/Android.mk
index f77bcf196e..585ed7b2ce 100644
--- a/src/gallium/drivers/virgl/Android.mk
+++ b/src/gallium/drivers/virgl/Android.mk
@@ -30,8 +30,9 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libmesa_pipe_virgl
 
-include $(GALLIUM_COMMON_MK)
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+intermediates := $(call local-generated-sources-dir)
+LOCAL_GENERATED_SOURCES += $(intermediates)/virgl/virgl_driinfo.h
 
 GEN_DRIINFO_INPUTS := \
$(MESA_TOP)/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h \
@@ -44,6 +45,11 @@ $(intermediates)/virgl/virgl_driinfo.h: $(MERGE_DRIINFO) 
$(GEN_DRIINFO_INPUTS)
@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
$(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) > $@ || 
($(RM) $@; false)
 
+LOCAL_EXPORT_C_INCLUDE_DIRS += $(intermediates)
+
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
 ifneq ($(HAVE_GALLIUM_VIRGL),)
 GALLIUM_TARGET_DRIVERS += virtio_gpu
 $(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl_common 
libmesa_winsys_virgl libmesa_winsys_virgl_vtest)
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: virgl: fix libmesa_virgil_common build and dependencies

2019-06-14 Thread Mauro Rossi
Hi,
there is a typo in the commit title, the library is
libmesa_winsys_virgl_common
I will correct it in the final commit

Mauro

On Sat, Jun 15, 2019 at 7:39 AM Mauro Rossi  wrote:

> Fixes the following building errors and resolves Bug 110922
> Fixes gallium_dri target missing symbols at linking.
>
> external/mesa/src/gallium/winsys/virgl/drm/Android.mk:
> error: libmesa_winsys_virgl (STATIC_LIBRARIES android-x86_64) missing
> libmesa_winsys_virgl_common (STATIC_LIBRARIES android-x86_64)
> ...
> external/mesa/src/gallium/winsys/virgl/vtest/Android.mk:
> error: libmesa_winsys_virgl_vtest (STATIC_LIBRARIES android-x86_64)
> missing libmesa_winsys_virgl_common (STATIC_LIBRARIES android-x86_64)
> ...
> build/core/main.mk:728: error: exiting from previous errors.
>
> In file included from
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c:34:
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h:35:10:
> fatal error: 'virgl_resource_cache.h' file not found
>  ^~~~
> 1 error generated.
>
> In file included from
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c:32:
> external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h:35:10:
> fatal error: 'virgl_resource_cache.h' file not found
> #include "virgl_resource_cache.h"
>  ^~~~
> 1 error generated.
>
> Fixes: b18f09a ("virgl: Introduce virgl_resource_cache")
> Signed-off-by: Mauro Rossi 
> ---
>  src/gallium/Android.mk| 2 +-
>  src/gallium/drivers/virgl/Android.mk  | 2 +-
>  src/gallium/winsys/virgl/drm/Android.mk   | 2 ++
>  src/gallium/winsys/virgl/vtest/Android.mk | 2 ++
>  4 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
> index 3a3f042c7a..37e923c225 100644
> --- a/src/gallium/Android.mk
> +++ b/src/gallium/Android.mk
> @@ -43,7 +43,7 @@ SUBDIRS += winsys/radeon/drm drivers/r300
>  SUBDIRS += winsys/radeon/drm drivers/r600
>  SUBDIRS += winsys/radeon/drm winsys/amdgpu/drm drivers/radeonsi
>  SUBDIRS += winsys/vc4/drm drivers/vc4
> -SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
> +SUBDIRS += winsys/virgl/common winsys/virgl/drm winsys/virgl/vtest
> drivers/virgl
>  SUBDIRS += winsys/svga/drm drivers/svga
>  SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
>  SUBDIRS += state_trackers/dri
> diff --git a/src/gallium/drivers/virgl/Android.mk
> b/src/gallium/drivers/virgl/Android.mk
> index 0067dfa702..a6fe53fbe9 100644
> --- a/src/gallium/drivers/virgl/Android.mk
> +++ b/src/gallium/drivers/virgl/Android.mk
> @@ -35,5 +35,5 @@ include $(BUILD_STATIC_LIBRARY)
>
>  ifneq ($(HAVE_GALLIUM_VIRGL),)
>  GALLIUM_TARGET_DRIVERS += virtio_gpu
> -$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl
> libmesa_winsys_virgl_vtest)
> +$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl_common
> libmesa_winsys_virgl libmesa_winsys_virgl_vtest)
>  endif
> diff --git a/src/gallium/winsys/virgl/drm/Android.mk
> b/src/gallium/winsys/virgl/drm/Android.mk
> index 5e2500774e..398a7645bc 100644
> --- a/src/gallium/winsys/virgl/drm/Android.mk
> +++ b/src/gallium/winsys/virgl/drm/Android.mk
> @@ -27,6 +27,8 @@ include $(CLEAR_VARS)
>
>  LOCAL_SRC_FILES := $(C_SOURCES)
>
> +LOCAL_C_INCLUDES := $(GALLIUM_TOP)/winsys/virgl/common
> +
>  LOCAL_MODULE := libmesa_winsys_virgl
>
>  LOCAL_STATIC_LIBRARIES := libmesa_winsys_virgl_common
> diff --git a/src/gallium/winsys/virgl/vtest/Android.mk
> b/src/gallium/winsys/virgl/vtest/Android.mk
> index 5b33f67711..6d35223c8e 100644
> --- a/src/gallium/winsys/virgl/vtest/Android.mk
> +++ b/src/gallium/winsys/virgl/vtest/Android.mk
> @@ -27,6 +27,8 @@ include $(CLEAR_VARS)
>
>  LOCAL_SRC_FILES := $(C_SOURCES)
>
> +LOCAL_C_INCLUDES := $(GALLIUM_TOP)/winsys/virgl/common
> +
>  LOCAL_MODULE := libmesa_winsys_virgl_vtest
>
>  LOCAL_STATIC_LIBRARIES := libmesa_winsys_virgl_common
> --
> 2.20.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: virgl: fix libmesa_virgil_common build and dependencies

2019-06-14 Thread Mauro Rossi
Fixes the following building errors and resolves Bug 110922
Fixes gallium_dri target missing symbols at linking.

external/mesa/src/gallium/winsys/virgl/drm/Android.mk:
error: libmesa_winsys_virgl (STATIC_LIBRARIES android-x86_64) missing 
libmesa_winsys_virgl_common (STATIC_LIBRARIES android-x86_64)
...
external/mesa/src/gallium/winsys/virgl/vtest/Android.mk:
error: libmesa_winsys_virgl_vtest (STATIC_LIBRARIES android-x86_64) missing 
libmesa_winsys_virgl_common (STATIC_LIBRARIES android-x86_64)
...
build/core/main.mk:728: error: exiting from previous errors.

In file included from 
external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c:34:
external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h:35:10:
fatal error: 'virgl_resource_cache.h' file not found
 ^~~~
1 error generated.

In file included from 
external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c:32:
external/mesa/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h:35:10:
fatal error: 'virgl_resource_cache.h' file not found
#include "virgl_resource_cache.h"
 ^~~~
1 error generated.

Fixes: b18f09a ("virgl: Introduce virgl_resource_cache")
Signed-off-by: Mauro Rossi 
---
 src/gallium/Android.mk| 2 +-
 src/gallium/drivers/virgl/Android.mk  | 2 +-
 src/gallium/winsys/virgl/drm/Android.mk   | 2 ++
 src/gallium/winsys/virgl/vtest/Android.mk | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
index 3a3f042c7a..37e923c225 100644
--- a/src/gallium/Android.mk
+++ b/src/gallium/Android.mk
@@ -43,7 +43,7 @@ SUBDIRS += winsys/radeon/drm drivers/r300
 SUBDIRS += winsys/radeon/drm drivers/r600
 SUBDIRS += winsys/radeon/drm winsys/amdgpu/drm drivers/radeonsi
 SUBDIRS += winsys/vc4/drm drivers/vc4
-SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
+SUBDIRS += winsys/virgl/common winsys/virgl/drm winsys/virgl/vtest 
drivers/virgl
 SUBDIRS += winsys/svga/drm drivers/svga
 SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
 SUBDIRS += state_trackers/dri
diff --git a/src/gallium/drivers/virgl/Android.mk 
b/src/gallium/drivers/virgl/Android.mk
index 0067dfa702..a6fe53fbe9 100644
--- a/src/gallium/drivers/virgl/Android.mk
+++ b/src/gallium/drivers/virgl/Android.mk
@@ -35,5 +35,5 @@ include $(BUILD_STATIC_LIBRARY)
 
 ifneq ($(HAVE_GALLIUM_VIRGL),)
 GALLIUM_TARGET_DRIVERS += virtio_gpu
-$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl 
libmesa_winsys_virgl_vtest)
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl_common 
libmesa_winsys_virgl libmesa_winsys_virgl_vtest)
 endif
diff --git a/src/gallium/winsys/virgl/drm/Android.mk 
b/src/gallium/winsys/virgl/drm/Android.mk
index 5e2500774e..398a7645bc 100644
--- a/src/gallium/winsys/virgl/drm/Android.mk
+++ b/src/gallium/winsys/virgl/drm/Android.mk
@@ -27,6 +27,8 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
+LOCAL_C_INCLUDES := $(GALLIUM_TOP)/winsys/virgl/common
+
 LOCAL_MODULE := libmesa_winsys_virgl
 
 LOCAL_STATIC_LIBRARIES := libmesa_winsys_virgl_common
diff --git a/src/gallium/winsys/virgl/vtest/Android.mk 
b/src/gallium/winsys/virgl/vtest/Android.mk
index 5b33f67711..6d35223c8e 100644
--- a/src/gallium/winsys/virgl/vtest/Android.mk
+++ b/src/gallium/winsys/virgl/vtest/Android.mk
@@ -27,6 +27,8 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
+LOCAL_C_INCLUDES := $(GALLIUM_TOP)/winsys/virgl/common
+
 LOCAL_MODULE := libmesa_winsys_virgl_vtest
 
 LOCAL_STATIC_LIBRARIES := libmesa_winsys_virgl_common
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: winsys/amdgpu, radv: fix generated amdgfxregs.h header dependecies

2019-06-14 Thread Mauro Rossi
Fix android building errors in winsys/amdgpu and radv
due to 'amdgfxregs.h' not found.

Changelog:
amd/common - generated $(intermediated)/common path is added to exports
winsys/amdgpu - libmesa_amd_common static dependency is added
radv - fix libmesa_amd_common $(intermediated)/common path in includes

Fixes: f480b8a ("amd/common: use generated register header")
Signed-off-by: Mauro Rossi 
---
 src/amd/Android.common.mk| 3 ++-
 src/amd/vulkan/Android.mk| 2 +-
 src/gallium/winsys/amdgpu/drm/Android.mk | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/amd/Android.common.mk b/src/amd/Android.common.mk
index 54180f16bb..1a3a00b9bc 100644
--- a/src/amd/Android.common.mk
+++ b/src/amd/Android.common.mk
@@ -62,7 +62,8 @@ LOCAL_C_INCLUDES := \
$(intermediates)/common
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
-   $(LOCAL_PATH)/common
+   $(LOCAL_PATH)/common \
+   $(intermediates)/common
 
 LOCAL_SHARED_LIBRARIES := \
libdrm_amdgpu
diff --git a/src/amd/vulkan/Android.mk b/src/amd/vulkan/Android.mk
index ab39ba3b72..0725feacb5 100644
--- a/src/amd/vulkan/Android.mk
+++ b/src/amd/vulkan/Android.mk
@@ -68,7 +68,7 @@ $(call mesa-build-with-llvm)
 
 LOCAL_C_INCLUDES := \
$(RADV_COMMON_INCLUDES) \
-   $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_amd_common,,) 
\
+   $(call 
generated-sources-dir-for,STATIC_LIBRARIES,libmesa_amd_common,,)/common \
$(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \
$(call 
generated-sources-dir-for,STATIC_LIBRARIES,libmesa_radv_common,,) \
$(call 
generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util \
diff --git a/src/gallium/winsys/amdgpu/drm/Android.mk 
b/src/gallium/winsys/amdgpu/drm/Android.mk
index 6e84a0c8de..0b8edf972d 100644
--- a/src/gallium/winsys/amdgpu/drm/Android.mk
+++ b/src/gallium/winsys/amdgpu/drm/Android.mk
@@ -32,7 +32,7 @@ LOCAL_SRC_FILES := $(C_SOURCES)
 
 LOCAL_CFLAGS := $(AMDGPU_CFLAGS)
 
-LOCAL_STATIC_LIBRARIES := libmesa_amdgpu_addrlib
+LOCAL_STATIC_LIBRARIES := libmesa_amdgpu_addrlib libmesa_amd_common
 
 LOCAL_SHARED_LIBRARIES := libdrm_amdgpu
 LOCAL_MODULE := libmesa_winsys_amdgpu
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: radv: fix necessary dependecies

2019-06-08 Thread Mauro Rossi
Hi,
please provide Reviewed-by when possible

There is another patch sent to ML which his already reviewed by Tapani and
waiting for this one

Mauro

On Wed, Apr 24, 2019 at 3:44 PM Mauro Rossi  wrote:

> Fixes building errors due to missing libmesa_util generated files include
> and libexpat dependencies:
>
> In file included from external/mesa/src/amd/vulkan/radv_device.c:52:
> external/mesa/src/util/xmlpool.h:115:10: fatal error: 'xmlpool/options.h'
> file not found
>  ^~~
> 1 error generated.
>
> FAILED:
> out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/vulkan.radv_intermediates/LINKED/
> vulkan.radv.so
> ...
> external/mesa/src/util/xmlconfig.c:670: error: undefined reference to
> 'XML_ParserCreate'
> ...
> clang.real: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> Fixes: 3c2e826 ("radv: Add support for driconf.")
> Signed-off-by: Mauro Rossi 
> ---
>  src/amd/vulkan/Android.mk | 12 +++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/Android.mk b/src/amd/vulkan/Android.mk
> index 9574bf54e5..ab39ba3b72 100644
> --- a/src/amd/vulkan/Android.mk
> +++ b/src/amd/vulkan/Android.mk
> @@ -71,7 +71,8 @@ LOCAL_C_INCLUDES := \
> $(call
> generated-sources-dir-for,STATIC_LIBRARIES,libmesa_amd_common,,) \
> $(call
> generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \
> $(call
> generated-sources-dir-for,STATIC_LIBRARIES,libmesa_radv_common,,) \
> -   $(call
> generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util
> +   $(call
> generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util \
> +   $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_util,,)
>
>  LOCAL_WHOLE_STATIC_LIBRARIES := \
> libmesa_vulkan_util \
> @@ -165,5 +166,14 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
>
>  LOCAL_SHARED_LIBRARIES += $(RADV_SHARED_LIBRARIES) libz libsync liblog
>
> +# If Android version >=8 MESA should static link libexpat else should
> dynamic link
> +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
> +LOCAL_STATIC_LIBRARIES := \
> +   libexpat
> +else
> +LOCAL_SHARED_LIBRARIES += \
> +   libexpat
> +endif
> +
>  include $(MESA_COMMON_MK)
>  include $(BUILD_SHARED_LIBRARY)
> --
> 2.20.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: amd/common: fix missing include path

2019-05-05 Thread Mauro Rossi
Fixes the following building error in Android:

In file included from external/mesa/src/amd/common/ac_llvm_helper.cpp:34:
In file included from external/mesa/src/amd/common/ac_llvm_build.h:30:
In file included from external/mesa/src/compiler/nir/nir.h:40:
In file included from external/mesa/src/compiler/nir_types.h:36:
external/mesa/src/compiler/glsl_types.h:37:10: fatal error: 'main/config.h' 
file not found
 ^~~
1 error generated.

Fixes: bd4c661 ("ac,ac/nir: use a better sync scope for shared atomics")
Signed-off-by: Mauro Rossi 
---
 src/amd/Android.common.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/Android.common.mk b/src/amd/Android.common.mk
index 4ef7f176e9..29a294adcd 100644
--- a/src/amd/Android.common.mk
+++ b/src/amd/Android.common.mk
@@ -55,6 +55,7 @@ LOCAL_C_INCLUDES := \
$(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \
$(MESA_TOP)/src/gallium/include \
$(MESA_TOP)/src/gallium/auxiliary \
+   $(MESA_TOP)/src/mesa \
$(intermediates)/common
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: radv: fix necessary dependecies

2019-04-24 Thread Mauro Rossi
Fixes building errors due to missing libmesa_util generated files include
and libexpat dependencies:

In file included from external/mesa/src/amd/vulkan/radv_device.c:52:
external/mesa/src/util/xmlpool.h:115:10: fatal error: 'xmlpool/options.h' file 
not found
 ^~~
1 error generated.

FAILED: 
out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/vulkan.radv_intermediates/LINKED/vulkan.radv.so
...
external/mesa/src/util/xmlconfig.c:670: error: undefined reference to 
'XML_ParserCreate'
...
clang.real: error: linker command failed with exit code 1 (use -v to see 
invocation)

Fixes: 3c2e826 ("radv: Add support for driconf.")
Signed-off-by: Mauro Rossi 
---
 src/amd/vulkan/Android.mk | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/Android.mk b/src/amd/vulkan/Android.mk
index 9574bf54e5..ab39ba3b72 100644
--- a/src/amd/vulkan/Android.mk
+++ b/src/amd/vulkan/Android.mk
@@ -71,7 +71,8 @@ LOCAL_C_INCLUDES := \
$(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_amd_common,,) 
\
$(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \
$(call 
generated-sources-dir-for,STATIC_LIBRARIES,libmesa_radv_common,,) \
-   $(call 
generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util
+   $(call 
generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util \
+   $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_util,,)
 
 LOCAL_WHOLE_STATIC_LIBRARIES := \
libmesa_vulkan_util \
@@ -165,5 +166,14 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
 
 LOCAL_SHARED_LIBRARIES += $(RADV_SHARED_LIBRARIES) libz libsync liblog
 
+# If Android version >=8 MESA should static link libexpat else should dynamic 
link
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
+LOCAL_STATIC_LIBRARIES := \
+   libexpat
+else
+LOCAL_SHARED_LIBRARIES += \
+   libexpat
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_SHARED_LIBRARY)
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: fix LLVM version string related building errors

2019-04-13 Thread Mauro Rossi
Hi,

On Sat, Apr 13, 2019 at 6:32 PM Eric Engestrom  wrote:
>
> On 2019-04-13 at 01:36, Mauro Rossi  wrote:
> > Just a message to Eric,
> >
> > as per our previous private thread,
>
> Sorry, I completely forgot to actually send the fix :facepalm:

No problem

>
> >
> > I've checked that the Android build works,
> > but we use libLLVM70 name in library dependency.
>
> I don't understand the second part is this sentence?

The patch I have submitted does not apply to mesa dev
because in android-x86 we build with libLLVM70.so shared dependency,
instead of libLLVM.so

AOSP has is own llvm, we had to do this to avoid library name
collision in Android build system

>
> >
> > Please adapt and apply the patch to mesa dev branch,
> > to fix the breakage
> >
> > \ prior to " in the LLVM version string value, just touching
> > Android.mk solves the problem for me
>
> Yes, this is the correct fix (because of the `eval`, if anyone's wondering).
>
> Reviewed-by: Eric Engestrom 
>
> Unfortunately, I'm on holiday for a week now. Can you push the fix yourself? 
> Otherwise, Tapani can :)

Ok, I'll proceed in the push

>
> >
> > Mauro
> >
> > On Sat, Apr 13, 2019 at 1:27 AM Mauro Rossi  wrote:
> > >
> > > Fixes the following building errors:
> > >
> > > external/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1290:14:
> > > error: expected ')'
> > >  ", LLVM " MESA_LLVM_VERSION_STRING
> > >^
> > > :8:34: note: expanded from here
> > >  ^
> > > external/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1287:10:
> > > note: to match this '('
> > > snprintf(rscreen->renderer_string, 
> > > sizeof(rscreen->renderer_string),
> > > ^
> > > 1 error generated.
> > >
> > > Fixes: 05b114e ("simplify LLVM version string printing")
> > > Signed-off-by: Mauro Rossi 
> > > ---
> > >  Android.mk | 8 
> > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/Android.mk b/Android.mk
> > > index 09139e86d1..b835eb64e9 100644
> > > --- a/Android.mk
> > > +++ b/Android.mk
> > > @@ -97,13 +97,13 @@ define mesa-build-with-llvm
> > >$(if $(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5), \
> > >  $(warning Unsupported LLVM version in Android 
> > > $(MESA_ANDROID_MAJOR_VERSION)),) \
> > >$(if $(filter 6,$(MESA_ANDROID_MAJOR_VERSION)), \
> > > -$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 
> > > -DMESA_LLVM_VERSION_STRING="3.7")) \
> > > +$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 
> > > -DMESA_LLVM_VERSION_STRING=\"3.7\")) \
> > >$(if $(filter 7,$(MESA_ANDROID_MAJOR_VERSION)), \
> > > -$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
> > > -DMESA_LLVM_VERSION_STRING="7.0")) \
> > > +$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
> > > -DMESA_LLVM_VERSION_STRING=\"7.0\")) \
> > >$(if $(filter 8,$(MESA_ANDROID_MAJOR_VERSION)), \
> > > -$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
> > > -DMESA_LLVM_VERSION_STRING="7.0")) \
> > > +$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
> > > -DMESA_LLVM_VERSION_STRING=\"7.0\")) \
> > >$(if $(filter 9,$(MESA_ANDROID_MAJOR_VERSION)), \
> > > -$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0309 
> > > -DMESA_LLVM_VERSION_STRING="3.9")) \
> > > +$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0309 
> > > -DMESA_LLVM_VERSION_STRING=\"3.9\")) \
> > >$(eval LOCAL_SHARED_LIBRARIES += libLLVM70)
> > >  endef
> > >
> > > --
> > > 2.20.1
> > >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] draw: fix building error in draw_gs_init()

2019-04-13 Thread Mauro Rossi
Fixes the following building error happening with Android build system:

external/mesa/src/gallium/auxiliary/draw/draw_gs.c:740:79:
error: address of array 'draw->gs.tgsi.machine->PrimitiveOffsets' will always 
evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
 if (!draw->gs.tgsi.machine->Primitives[i] || 
!draw->gs.tgsi.machine->PrimitiveOffsets)
  
^~~~
1 error generated.

Fixes: 7720ce3 ("draw: add support to tgsi paths for geometry streams. (v2)")
Signed-off-by: Mauro Rossi 
---
 src/gallium/auxiliary/draw/draw_gs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/draw/draw_gs.c 
b/src/gallium/auxiliary/draw/draw_gs.c
index 1d6040993c..6420cfbb26 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -737,7 +737,7 @@ draw_gs_init( struct draw_context *draw )
 MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector), 16);
  draw->gs.tgsi.machine->PrimitiveOffsets[i] = align_malloc(
 MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector), 16);
- if (!draw->gs.tgsi.machine->Primitives[i] || 
!draw->gs.tgsi.machine->PrimitiveOffsets)
+ if (!draw->gs.tgsi.machine->Primitives[i] || 
!draw->gs.tgsi.machine->PrimitiveOffsets[i])
 return FALSE;
  memset(draw->gs.tgsi.machine->Primitives[i], 0,
 MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector));
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: fix LLVM version string related building errors

2019-04-12 Thread Mauro Rossi
Just a message to Eric,

as per our previous private thread,

I've checked that the Android build works,
but we use libLLVM70 name in library dependency.

Please adapt and apply the patch to mesa dev branch,
to fix the breakage

\ prior to " in the LLVM version string value, just touching
Android.mk solves the problem for me

Mauro

On Sat, Apr 13, 2019 at 1:27 AM Mauro Rossi  wrote:
>
> Fixes the following building errors:
>
> external/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1290:14:
> error: expected ')'
>  ", LLVM " MESA_LLVM_VERSION_STRING
>^
> :8:34: note: expanded from here
>  ^
> external/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1287:10:
> note: to match this '('
> snprintf(rscreen->renderer_string, sizeof(rscreen->renderer_string),
> ^
> 1 error generated.
>
> Fixes: 05b114e ("simplify LLVM version string printing")
> Signed-off-by: Mauro Rossi 
> ---
>  Android.mk | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Android.mk b/Android.mk
> index 09139e86d1..b835eb64e9 100644
> --- a/Android.mk
> +++ b/Android.mk
> @@ -97,13 +97,13 @@ define mesa-build-with-llvm
>$(if $(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5), \
>  $(warning Unsupported LLVM version in Android 
> $(MESA_ANDROID_MAJOR_VERSION)),) \
>$(if $(filter 6,$(MESA_ANDROID_MAJOR_VERSION)), \
> -$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 
> -DMESA_LLVM_VERSION_STRING="3.7")) \
> +$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 
> -DMESA_LLVM_VERSION_STRING=\"3.7\")) \
>$(if $(filter 7,$(MESA_ANDROID_MAJOR_VERSION)), \
> -$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
> -DMESA_LLVM_VERSION_STRING="7.0")) \
> +$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
> -DMESA_LLVM_VERSION_STRING=\"7.0\")) \
>$(if $(filter 8,$(MESA_ANDROID_MAJOR_VERSION)), \
> -$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
> -DMESA_LLVM_VERSION_STRING="7.0")) \
> +$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
> -DMESA_LLVM_VERSION_STRING=\"7.0\")) \
>$(if $(filter 9,$(MESA_ANDROID_MAJOR_VERSION)), \
> -$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0309 
> -DMESA_LLVM_VERSION_STRING="3.9")) \
> +$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0309 
> -DMESA_LLVM_VERSION_STRING=\"3.9\")) \
>$(eval LOCAL_SHARED_LIBRARIES += libLLVM70)
>  endef
>
> --
> 2.20.1
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: fix LLVM version string related building errors

2019-04-12 Thread Mauro Rossi
Fixes the following building errors:

external/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1290:14:
error: expected ')'
 ", LLVM " MESA_LLVM_VERSION_STRING
   ^
:8:34: note: expanded from here
 ^
external/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1287:10:
note: to match this '('
snprintf(rscreen->renderer_string, sizeof(rscreen->renderer_string),
^
1 error generated.

Fixes: 05b114e ("simplify LLVM version string printing")
Signed-off-by: Mauro Rossi 
---
 Android.mk | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Android.mk b/Android.mk
index 09139e86d1..b835eb64e9 100644
--- a/Android.mk
+++ b/Android.mk
@@ -97,13 +97,13 @@ define mesa-build-with-llvm
   $(if $(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5), \
 $(warning Unsupported LLVM version in Android 
$(MESA_ANDROID_MAJOR_VERSION)),) \
   $(if $(filter 6,$(MESA_ANDROID_MAJOR_VERSION)), \
-$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 
-DMESA_LLVM_VERSION_STRING="3.7")) \
+$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 
-DMESA_LLVM_VERSION_STRING=\"3.7\")) \
   $(if $(filter 7,$(MESA_ANDROID_MAJOR_VERSION)), \
-$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
-DMESA_LLVM_VERSION_STRING="7.0")) \
+$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
-DMESA_LLVM_VERSION_STRING=\"7.0\")) \
   $(if $(filter 8,$(MESA_ANDROID_MAJOR_VERSION)), \
-$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
-DMESA_LLVM_VERSION_STRING="7.0")) \
+$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0700 
-DMESA_LLVM_VERSION_STRING=\"7.0\")) \
   $(if $(filter 9,$(MESA_ANDROID_MAJOR_VERSION)), \
-$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0309 
-DMESA_LLVM_VERSION_STRING="3.9")) \
+$(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0309 
-DMESA_LLVM_VERSION_STRING=\"3.9\")) \
   $(eval LOCAL_SHARED_LIBRARIES += libLLVM70)
 endef
 
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android: nouveau: add support for nir

2019-03-17 Thread Mauro Rossi
Hi Karol,

On Sun, Mar 17, 2019 at 11:25 PM Karol Herbst  wrote:
>
> On Sun, Mar 17, 2019 at 10:52 PM Mauro Rossi  wrote:
> >
> > Add the necessary build rules for android, to avoid building errors.
> >
> > Fixes: f014ae3 ("nouveau: add support for nir")
> > Signed-off-by: Mauro Rossi 
> > ---
> >  src/gallium/drivers/nouveau/Android.mk | 7 ++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/gallium/drivers/nouveau/Android.mk 
> > b/src/gallium/drivers/nouveau/Android.mk
> > index cd2dd0938f..49a341c831 100644
> > --- a/src/gallium/drivers/nouveau/Android.mk
> > +++ b/src/gallium/drivers/nouveau/Android.mk
> > @@ -37,8 +37,13 @@ LOCAL_SRC_FILES := \
> > $(NVC0_C_SOURCES)
> >
> >  LOCAL_C_INCLUDES := \
> > -   $(MESA_TOP)/include
> > +   $(MESA_TOP)/include \
> > +   $(call 
> > generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \
> > +   $(MESA_TOP)/src/compiler/nir \
> > +   $(MESA_TOP)/src/mapi \
> > +   $(MESA_TOP)/src/mesa
>
> do we really have to add all those includes? freedreno doesn't seem to
> add those either and just has the libmesa_nir dependency

Hi Karol,

the first build error "main/config.h" not found
was caused by $(MESA_TOP)/src/mesa missing,
then I did not chased the others,
I replicated with fidelity your Autotools build rules
as I've always been instructed this way by Emil Velikov

The patch is working and Android booting on GTX950 with the patch
KR

Mauro

>
> >
> > +LOCAL_STATIC_LIBRARIES := libmesa_nir
> >  LOCAL_SHARED_LIBRARIES := libdrm_nouveau
> >  LOCAL_MODULE := libmesa_pipe_nouveau
> >
> > --
> > 2.19.1
> >
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: nouveau: add support for nir

2019-03-17 Thread Mauro Rossi
Add the necessary build rules for android, to avoid building errors.

Fixes: f014ae3 ("nouveau: add support for nir")
Signed-off-by: Mauro Rossi 
---
 src/gallium/drivers/nouveau/Android.mk | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/Android.mk 
b/src/gallium/drivers/nouveau/Android.mk
index cd2dd0938f..49a341c831 100644
--- a/src/gallium/drivers/nouveau/Android.mk
+++ b/src/gallium/drivers/nouveau/Android.mk
@@ -37,8 +37,13 @@ LOCAL_SRC_FILES := \
$(NVC0_C_SOURCES)
 
 LOCAL_C_INCLUDES := \
-   $(MESA_TOP)/include
+   $(MESA_TOP)/include \
+   $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \
+   $(MESA_TOP)/src/compiler/nir \
+   $(MESA_TOP)/src/mapi \
+   $(MESA_TOP)/src/mesa
 
+LOCAL_STATIC_LIBRARIES := libmesa_nir
 LOCAL_SHARED_LIBRARIES := libdrm_nouveau
 LOCAL_MODULE := libmesa_pipe_nouveau
 
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] Building error in android-x86 due to recent mesa commit

2019-03-16 Thread Mauro Rossi
Hi Bas,
many thanks
Mauro

On Sat, Mar 16, 2019 at 11:02 PM Bas Nieuwenhuizen
 wrote:
>
> Should be fixed when
>
> https://gitlab.freedesktop.org/mesa/mesa/merge_requests/456
>
> is merged.
>
> On Sat, Mar 16, 2019 at 10:16 PM Mauro Rossi  wrote:
> >
> > Hi Marek,
> >
> > I'm getting the following building error after commit [1]
> > but I don't understand why.
> >
> > Mauro
> >
> > external/mesa/src/gallium/drivers/radeonsi/si_compute.c:807:8: error:
> > initializing 'uint *' (aka 'unsigned int *') with an expression of
> > type 'uint const[3]' discards qualifiers
> > [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> > uint *last_block = info->last_block;
> >   ^
> > 1 error generated.
> >
> >
> > [1] 
> > https://cgit.freedesktop.org/mesa/mesa/commit/?id=b9e02fe138ef181f02fd739129517fbe70604af6
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] Building error in android-x86 due to recent mesa commit

2019-03-16 Thread Mauro Rossi
Hi Marek,

I'm getting the following building error after commit [1]
but I don't understand why.

Mauro

external/mesa/src/gallium/drivers/radeonsi/si_compute.c:807:8: error:
initializing 'uint *' (aka 'unsigned int *') with an expression of
type 'uint const[3]' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
uint *last_block = info->last_block;
  ^
1 error generated.


[1] 
https://cgit.freedesktop.org/mesa/mesa/commit/?id=b9e02fe138ef181f02fd739129517fbe70604af6
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android, autotools: st/mesa: fix location of float64_glsl.h

2019-03-10 Thread Mauro Rossi
Hi Jordan,

On Wed, Mar 6, 2019 at 10:01 PM Jordan Justen  wrote:
>
> On 2019-03-04 16:11:33, Jordan Justen wrote:
> > On 2019-03-04 15:21:26, Mauro Rossi wrote:
> > > Hi,
> > > On Mon, Mar 4, 2019 at 7:50 PM Mauro Rossi  wrote:
> > > >
> > > > Il lun 4 mar 2019, 18:59 Dylan Baker  ha scritto:
> > > >>
> > > >> I wrote c812, and I'd be very happy to revert it. The problem that I 
> > > >> ran into
> > > >> was putting it in a place that android, meson, and the autotools dist 
> > > >> tarball
> > > >> were happy with. I'm hoping that we can remove autotools in the very 
> > > >> near future
> > > >> and just revert c812 at that time. Does that seem like a reasonable 
> > > >> solution?
> > > >>
> > > >> Dylan
> > >
> > > Hi Dylan,
> > > I have checked on Android.mk and reverting you commit c812c740e6
> > > would be very complex.
> > >
> > > The best way is to proceed now is with my patch to un-break the Android 
> > > build
> > >
> > > Then as a reference, the future solution may require chages to sources:
> > >
> > > #include "compiler/glsl/{header}.h"
> > > to become
> > > #include "glsl/{header}.h"
> > >
> > > in order to reach the Android generated files with
> > >  $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_glsl,,)
> > > as equivalent of -I$(top_builddir)/src/compiler
> >
> > Just wanted to point out that Jason is moving this under glsl in:
> >
> > https://gitlab.freedesktop.org/mesa/mesa/merge_requests/371
>
> Mauro,
>
> Jason pushed MR 371 in 9ab1b1d0227499b7ff6a61fdebe75693212a67f5.
>
> > So, either that will fix this, or else cause it to break in a new,
> > different way. :)
>
> Which was it? :)
>
> -Jordan

The android build is ok for me, without need for android, autotools patch
I tested also build of iris

Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android, autotools: st/mesa: fix location of float64_glsl.h

2019-03-04 Thread Mauro Rossi
Hi,
On Mon, Mar 4, 2019 at 7:50 PM Mauro Rossi  wrote:
>
> Hi,
> Sounds good to me.
>
> The way it could have been prevented was to avoid having fp64 generated file 
> as the only one with with different path in sources.
>
> Could you just confirm that inc_compiler is not needed in 
> src/mesa/meson.build, and provide R-b so that I will proceed with push?
>
> I've tried to build with meson and it's ok
>
> Il lun 4 mar 2019, 18:59 Dylan Baker  ha scritto:
>>
>> Quoting Mauro Rossi (2019-03-04 01:21:05)
>> > Hi Tapani,
>> > On Mon, Mar 4, 2019 at 6:51 AM Tapani Pälli  wrote:
>> > >
>> > > Hi;
>> > >
>> > > On 3/3/19 10:10 PM, Mauro Rossi wrote:
>> > > > Necessary to avoid building error in Android,
>> > > > due to 'compiler/glsl/float64_glsl.h' file not found
>> > > >
>> > > > Fixes: cb4e3e3 ("st/mesa: add support for lowering fp64/int64 for nir 
>> > > > drivers")
>> > > > Signed-off-by: Mauro Rossi 
>> > > > ---
>> > > >   src/mesa/Android.libmesa_st_mesa.mk   | 1 +
>> > > >   src/mesa/Makefile.sources | 1 +
>> > > >   src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +-
>> > > >   3 files changed, 3 insertions(+), 1 deletion(-)
>> > > >
>> > > > diff --git a/src/mesa/Android.libmesa_st_mesa.mk 
>> > > > b/src/mesa/Android.libmesa_st_mesa.mk
>> > > > index ddfd03059c..c5b16cad34 100644
>> > > > --- a/src/mesa/Android.libmesa_st_mesa.mk
>> > > > +++ b/src/mesa/Android.libmesa_st_mesa.mk
>> > > > @@ -58,6 +58,7 @@ endif
>> > > >   LOCAL_C_INCLUDES := \
>> > > >   $(MESA_TOP)/src/mapi \
>> > > >   $(MESA_TOP)/src/mesa/main \
>> > > > + $(call 
>> > > > generated-sources-dir-for,STATIC_LIBRARIES,libmesa_glsl,,) \
>> > > >   $(MESA_TOP)/src/compiler/nir \
>> > > >   $(MESA_TOP)/src/gallium/auxiliary \
>> > > >   $(MESA_TOP)/src/gallium/include
>> > > > diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
>> > > > index 1e25f47e50..69f32c6adf 100644
>> > > > --- a/src/mesa/Makefile.sources
>> > > > +++ b/src/mesa/Makefile.sources
>> > > > @@ -689,6 +689,7 @@ INCLUDE_DIRS = \
>> > > >   -I$(top_srcdir)/include \
>> > > >   -I$(top_builddir)/src \
>> > > >   -I$(top_srcdir)/src \
>> > > > + -I$(top_builddir)/src/compiler \
>> > > >   -I$(top_builddir)/src/compiler/glsl \
>> > > >   -I$(top_builddir)/src/compiler/nir \
>> > > >   -I$(top_builddir)/src/mesa \
>> > > > diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp 
>> > > > b/src/mesa/state_tracker/st_glsl_to_nir.cpp
>> > > > index a1e3b6233c..ad77b746ab 100644
>> > > > --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
>> > > > +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
>> > > > @@ -48,7 +48,7 @@
>> > > >   #include "compiler/glsl/ir.h"
>> > > >   #include "compiler/glsl/ir_optimization.h"
>> > > >   #include "compiler/glsl/string_to_uint_map.h"
>> > > > -#include "compiler/glsl/float64_glsl.h"
>> > > > +#include "glsl/float64_glsl.h"
>> > >
>> > > Looks familiar :)
>> > >
>> > > https://github.com/tpalli/external-mesa/commit/ebd8581ad133206ec2b1b818e98dc4f8401af8de
>> > >
>> > > Before going further though, I'd like to understand why do we have both
>> > > 'compiler/glsl/' and 'glsl/' going on. Should we rather put the
>> > > 'compiler' back in the header generation? I can't remember the full
>> > > story behind commit c812c740e60 but that one changed this .. perhaps we
>> > > should pull it back and have the 'compiler/', any objections to that?
>> > >
>> >
>> > I agree that simply continue to have include "compiler/glsl/float64_glsl.h"
>> > in all sources places would be simpler
>> > and should not break neither autotools nor meson,
>> > which may continue to have glsl/float64_glsl.h in their generators
>> >
>> > Mauro
>>
>> I wrote c812, and I'd be very happy to revert it. The problem that I ran into
>> was putting it in a place that android, meson, and the autotools dist tarball
>> were happy with. I'm hoping that we can remove autotools in the very near 
>> future
>> and just revert c812 at that time. Does that seem like a reasonable solution?
>>
>> Dylan

Hi Dylan,
I have checked on Android.mk and reverting you commit c812c740e6
would be very complex.

The best way is to proceed now is with my patch to un-break the Android build

Then as a reference, the future solution may require chages to sources:

#include "compiler/glsl/{header}.h"
to become
#include "glsl/{header}.h"

in order to reach the Android generated files with
 $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_glsl,,)
as equivalent of -I$(top_builddir)/src/compiler

Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android, autotools: st/mesa: fix location of float64_glsl.h

2019-03-04 Thread Mauro Rossi
Hi,
Sounds good to me.

The way it could have been prevented was to avoid having fp64 generated
file as the only one with with different path in sources.

Could you just confirm that inc_compiler is not needed in
src/mesa/meson.build, and provide R-b so that I will proceed with push?

I've tried to build with meson and it's ok

Il lun 4 mar 2019, 18:59 Dylan Baker  ha scritto:

> Quoting Mauro Rossi (2019-03-04 01:21:05)
> > Hi Tapani,
> > On Mon, Mar 4, 2019 at 6:51 AM Tapani Pälli 
> wrote:
> > >
> > > Hi;
> > >
> > > On 3/3/19 10:10 PM, Mauro Rossi wrote:
> > > > Necessary to avoid building error in Android,
> > > > due to 'compiler/glsl/float64_glsl.h' file not found
> > > >
> > > > Fixes: cb4e3e3 ("st/mesa: add support for lowering fp64/int64 for
> nir drivers")
> > > > Signed-off-by: Mauro Rossi 
> > > > ---
> > > >   src/mesa/Android.libmesa_st_mesa.mk   | 1 +
> > > >   src/mesa/Makefile.sources | 1 +
> > > >   src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +-
> > > >   3 files changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/src/mesa/Android.libmesa_st_mesa.mk b/src/mesa/
> Android.libmesa_st_mesa.mk
> > > > index ddfd03059c..c5b16cad34 100644
> > > > --- a/src/mesa/Android.libmesa_st_mesa.mk
> > > > +++ b/src/mesa/Android.libmesa_st_mesa.mk
> > > > @@ -58,6 +58,7 @@ endif
> > > >   LOCAL_C_INCLUDES := \
> > > >   $(MESA_TOP)/src/mapi \
> > > >   $(MESA_TOP)/src/mesa/main \
> > > > + $(call
> generated-sources-dir-for,STATIC_LIBRARIES,libmesa_glsl,,) \
> > > >   $(MESA_TOP)/src/compiler/nir \
> > > >   $(MESA_TOP)/src/gallium/auxiliary \
> > > >   $(MESA_TOP)/src/gallium/include
> > > > diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
> > > > index 1e25f47e50..69f32c6adf 100644
> > > > --- a/src/mesa/Makefile.sources
> > > > +++ b/src/mesa/Makefile.sources
> > > > @@ -689,6 +689,7 @@ INCLUDE_DIRS = \
> > > >   -I$(top_srcdir)/include \
> > > >   -I$(top_builddir)/src \
> > > >   -I$(top_srcdir)/src \
> > > > + -I$(top_builddir)/src/compiler \
> > > >   -I$(top_builddir)/src/compiler/glsl \
> > > >   -I$(top_builddir)/src/compiler/nir \
> > > >   -I$(top_builddir)/src/mesa \
> > > > diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp
> b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> > > > index a1e3b6233c..ad77b746ab 100644
> > > > --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
> > > > +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> > > > @@ -48,7 +48,7 @@
> > > >   #include "compiler/glsl/ir.h"
> > > >   #include "compiler/glsl/ir_optimization.h"
> > > >   #include "compiler/glsl/string_to_uint_map.h"
> > > > -#include "compiler/glsl/float64_glsl.h"
> > > > +#include "glsl/float64_glsl.h"
> > >
> > > Looks familiar :)
> > >
> > >
> https://github.com/tpalli/external-mesa/commit/ebd8581ad133206ec2b1b818e98dc4f8401af8de
> > >
> > > Before going further though, I'd like to understand why do we have both
> > > 'compiler/glsl/' and 'glsl/' going on. Should we rather put the
> > > 'compiler' back in the header generation? I can't remember the full
> > > story behind commit c812c740e60 but that one changed this .. perhaps we
> > > should pull it back and have the 'compiler/', any objections to that?
> > >
> >
> > I agree that simply continue to have include
> "compiler/glsl/float64_glsl.h"
> > in all sources places would be simpler
> > and should not break neither autotools nor meson,
> > which may continue to have glsl/float64_glsl.h in their generators
> >
> > Mauro
>
> I wrote c812, and I'd be very happy to revert it. The problem that I ran
> into
> was putting it in a place that android, meson, and the autotools dist
> tarball
> were happy with. I'm hoping that we can remove autotools in the very near
> future
> and just revert c812 at that time. Does that seem like a reasonable
> solution?
>
> Dylan
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: anv: fix generated files depedencies (v2)

2019-03-04 Thread Mauro Rossi
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

(v2) Fixed a missing $(VULKAN_API_XML) reference

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 | 40 +++--
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk
index 04c9d5b3e4..9fdb8debf2 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 \
+  $(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) \
-   --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \
+   $(MESA_PYTHON2) $(ANV_ENTRYPOINTS_GEN_SCRIPT) \
+   --xml $(VULKAN_API_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)
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] android, autotools: st/mesa: fix location of float64_glsl.h

2019-03-04 Thread Mauro Rossi
Hi Tapani,
On Mon, Mar 4, 2019 at 6:51 AM Tapani Pälli  wrote:
>
> Hi;
>
> On 3/3/19 10:10 PM, Mauro Rossi wrote:
> > Necessary to avoid building error in Android,
> > due to 'compiler/glsl/float64_glsl.h' file not found
> >
> > Fixes: cb4e3e3 ("st/mesa: add support for lowering fp64/int64 for nir 
> > drivers")
> > Signed-off-by: Mauro Rossi 
> > ---
> >   src/mesa/Android.libmesa_st_mesa.mk   | 1 +
> >   src/mesa/Makefile.sources | 1 +
> >   src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +-
> >   3 files changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/mesa/Android.libmesa_st_mesa.mk 
> > b/src/mesa/Android.libmesa_st_mesa.mk
> > index ddfd03059c..c5b16cad34 100644
> > --- a/src/mesa/Android.libmesa_st_mesa.mk
> > +++ b/src/mesa/Android.libmesa_st_mesa.mk
> > @@ -58,6 +58,7 @@ endif
> >   LOCAL_C_INCLUDES := \
> >   $(MESA_TOP)/src/mapi \
> >   $(MESA_TOP)/src/mesa/main \
> > + $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_glsl,,) \
> >   $(MESA_TOP)/src/compiler/nir \
> >   $(MESA_TOP)/src/gallium/auxiliary \
> >   $(MESA_TOP)/src/gallium/include
> > diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
> > index 1e25f47e50..69f32c6adf 100644
> > --- a/src/mesa/Makefile.sources
> > +++ b/src/mesa/Makefile.sources
> > @@ -689,6 +689,7 @@ INCLUDE_DIRS = \
> >   -I$(top_srcdir)/include \
> >   -I$(top_builddir)/src \
> >   -I$(top_srcdir)/src \
> > + -I$(top_builddir)/src/compiler \
> >   -I$(top_builddir)/src/compiler/glsl \
> >   -I$(top_builddir)/src/compiler/nir \
> >   -I$(top_builddir)/src/mesa \
> > diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp 
> > b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> > index a1e3b6233c..ad77b746ab 100644
> > --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
> > +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> > @@ -48,7 +48,7 @@
> >   #include "compiler/glsl/ir.h"
> >   #include "compiler/glsl/ir_optimization.h"
> >   #include "compiler/glsl/string_to_uint_map.h"
> > -#include "compiler/glsl/float64_glsl.h"
> > +#include "glsl/float64_glsl.h"
>
> Looks familiar :)
>
> https://github.com/tpalli/external-mesa/commit/ebd8581ad133206ec2b1b818e98dc4f8401af8de
>
> Before going further though, I'd like to understand why do we have both
> 'compiler/glsl/' and 'glsl/' going on. Should we rather put the
> 'compiler' back in the header generation? I can't remember the full
> story behind commit c812c740e60 but that one changed this .. perhaps we
> should pull it back and have the 'compiler/', any objections to that?
>

I agree that simply continue to have include "compiler/glsl/float64_glsl.h"
in all sources places would be simpler
and should not break neither autotools nor meson,
which may continue to have glsl/float64_glsl.h in their generators

Mauro



> Thanks;
>
> // Tapani
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android, autotools: st/mesa: fix location of float64_glsl.h

2019-03-03 Thread Mauro Rossi
Necessary to avoid building error in Android,
due to 'compiler/glsl/float64_glsl.h' file not found

Fixes: cb4e3e3 ("st/mesa: add support for lowering fp64/int64 for nir drivers")
Signed-off-by: Mauro Rossi 
---
 src/mesa/Android.libmesa_st_mesa.mk   | 1 +
 src/mesa/Makefile.sources | 1 +
 src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/Android.libmesa_st_mesa.mk 
b/src/mesa/Android.libmesa_st_mesa.mk
index ddfd03059c..c5b16cad34 100644
--- a/src/mesa/Android.libmesa_st_mesa.mk
+++ b/src/mesa/Android.libmesa_st_mesa.mk
@@ -58,6 +58,7 @@ endif
 LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/mesa/main \
+   $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_glsl,,) \
$(MESA_TOP)/src/compiler/nir \
$(MESA_TOP)/src/gallium/auxiliary \
$(MESA_TOP)/src/gallium/include
diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
index 1e25f47e50..69f32c6adf 100644
--- a/src/mesa/Makefile.sources
+++ b/src/mesa/Makefile.sources
@@ -689,6 +689,7 @@ INCLUDE_DIRS = \
-I$(top_srcdir)/include \
-I$(top_builddir)/src \
-I$(top_srcdir)/src \
+   -I$(top_builddir)/src/compiler \
-I$(top_builddir)/src/compiler/glsl \
-I$(top_builddir)/src/compiler/nir \
-I$(top_builddir)/src/mesa \
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp 
b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index a1e3b6233c..ad77b746ab 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -48,7 +48,7 @@
 #include "compiler/glsl/ir.h"
 #include "compiler/glsl/ir_optimization.h"
 #include "compiler/glsl/string_to_uint_map.h"
-#include "compiler/glsl/float64_glsl.h"
+#include "glsl/float64_glsl.h"
 
 static int
 type_size(const struct glsl_type *type)
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 1/2] android: anv: fix generated files depedencies

2019-03-03 Thread Mauro Rossi
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 \
+  $(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)
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 2/2] android: anv: fix libexpat shared dependency

2019-03-03 Thread Mauro Rossi
Fixes undefined reference building errors for XML_* functions

Signed-off-by: Mauro Rossi 
Cc: "19.0" 
---
 src/intel/Android.vulkan.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk
index 2e99ac6294..c9bce50c78 100644
--- a/src/intel/Android.vulkan.mk
+++ b/src/intel/Android.vulkan.mk
@@ -318,7 +318,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
libmesa_intel_compiler \
libmesa_anv_entrypoints
 
-LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) libz libsync liblog
+LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) libexpat libz libsync liblog
 
 include $(MESA_COMMON_MK)
 include $(BUILD_SHARED_LIBRARY)
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] android: intel/isl: remove redundant building rules

2019-02-21 Thread Mauro Rossi
Fixes the following building error:

including ./external/mesa/Android.mk ...
build/core/base_rules.mk:183: *** external/mesa/src/intel:
MODULE.TARGET.STATIC_LIBRARIES.libmesa_isl_tiled_memcpy already defined by 
external/mesa/src/intel.
make: *** [build/core/ninja.mk:164: out/build-android_x86_64.ninja] Error 1

ISL_TILED_MEMCPY_FILES is isl/isl_tiled_memcpy_normal.c
and that source file includes isl_tiled_memcpy.c source

Fixes: 96bb328 ("iris: add Android build")
Signed-off-by: Mauro Rossi 
---
 src/intel/Android.isl.mk | 13 -
 1 file changed, 13 deletions(-)

diff --git a/src/intel/Android.isl.mk b/src/intel/Android.isl.mk
index 28944875e0..07a64b8ed1 100644
--- a/src/intel/Android.isl.mk
+++ b/src/intel/Android.isl.mk
@@ -198,19 +198,6 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
 
-
-# ---
-# Build libmesa_isl_tiled_memcpy
-# ---
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libmesa_isl_tiled_memcpy
-
-LOCAL_SRC_FILES := isl/isl_tiled_memcpy.c
-
-include $(MESA_COMMON_MK)
-include $(BUILD_STATIC_LIBRARY)
-
 # ---
 # Build libmesa_isl_tiled_memcpy
 # ---
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 1/3] android: glsl: fix fp64 generated source path

2019-02-02 Thread Mauro Rossi
Hi,
sorry I just saw that there is a similar correction is already in both
19.0 and master branches
but I missed it because I searched only in mesa-dev ML

Please Dylan, just check if the 3rd patch makes sense or not necessary at all.
Mauro

On Sat, Feb 2, 2019 at 11:30 AM Mauro Rossi  wrote:
>
> Porting of commit 7d7b308 ("automake: Fix path to generated source")
> to Android build system
>
> Fixes the following building error:
> ninja: error: 
> '.../x86/gen/STATIC_LIBRARIES/libmesa_glsl_intermediates/glsl/float64_glsl.h',
> needed by 
> '.../x86/obj/STATIC_LIBRARIES/libmesa_glsl_intermediates/glsl/float64_glsl.h',
> missing and no known rule to make it
>
> Signed-off-by: Mauro Rossi 
> Fixes: 7d7b308 ("automake: Fix path to generated source")
> Fixes: b63a1f8 ("glsl: Create file to contain software fp64 functions")
> Cc: 19.0 
> ---
>  src/compiler/Android.glsl.gen.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/Android.glsl.gen.mk 
> b/src/compiler/Android.glsl.gen.mk
> index e31eb6f101..3b94ea7bd2 100644
> --- a/src/compiler/Android.glsl.gen.mk
> +++ b/src/compiler/Android.glsl.gen.mk
> @@ -104,6 +104,6 @@ $(intermediates)/glsl/ir_expression_operation_strings.h: 
> $(LOCAL_PATH)/glsl/ir_e
> @mkdir -p $(dir $@)
> $(hide) $(MESA_PYTHON2) $< strings > $@
>
> -$(intermediates)/compiler/glsl/float64_glsl.h: $(LOCAL_PATH)/glsl/xxd.py
> +$(intermediates)/glsl/float64_glsl.h: $(LOCAL_PATH)/glsl/xxd.py
> @mkdir -p $(dir $@)
> $(hide) $(MESA_PYTHON2) $< $(MESA_TOP)/src/compiler/glsl/float64.glsl 
> $@ -n float64_source > $@
> --
> 2.19.1
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/3] i965: fix glsl/float64_glsl.h include

2019-02-02 Thread Mauro Rossi
Fixes the following build error:

external/mesa/src/mesa/drivers/dri/i965/brw_program.c:45:10:
fatal error: 'compiler/glsl/float64_glsl.h' file not found
#include "compiler/glsl/float64_glsl.h"
 ^~
1 error generated.

Include of src/compiler in builddir is added accordingly

Signed-off-by: Mauro Rossi 
Fixes: 7d7b308 ("automake: Fix path to generated source")
Fixes: b63a1f8 ("glsl: Create file to contain software fp64 functions")
Cc: 19.0 
---
 src/mesa/drivers/dri/i965/Makefile.am   | 1 +
 src/mesa/drivers/dri/i965/brw_program.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/Makefile.am 
b/src/mesa/drivers/dri/i965/Makefile.am
index b562c6ea21..48d15296d9 100644
--- a/src/mesa/drivers/dri/i965/Makefile.am
+++ b/src/mesa/drivers/dri/i965/Makefile.am
@@ -34,6 +34,7 @@ AM_CFLAGS = \
-I$(top_builddir)/src/util \
-I$(top_srcdir)/src/mesa/drivers/dri/common \
-I$(top_srcdir)/src/gtest/include \
+   -I$(top_builddir)/src/compiler/ \
-I$(top_builddir)/src/compiler/glsl \
-I$(top_builddir)/src/compiler/nir \
-I$(top_srcdir)/src/compiler/nir \
diff --git a/src/mesa/drivers/dri/i965/brw_program.c 
b/src/mesa/drivers/dri/i965/brw_program.c
index 9ab25cf664..1038d9a47a 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -42,7 +42,7 @@
 #include "compiler/glsl/ir.h"
 #include "compiler/glsl/program.h"
 #include "compiler/glsl/glsl_to_nir.h"
-#include "compiler/glsl/float64_glsl.h"
+#include "glsl/float64_glsl.h"
 
 #include "brw_program.h"
 #include "brw_context.h"
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/3] meson: i965: add inc_compiler include

2019-02-02 Thread Mauro Rossi
With new glsl/float64_glsl.h include, required in i965 source
to correctly build Android and with automake, inc_compiler is
added in meson build includes.
It may not be necessary for meson, but it is formally correct

Signed-off-by: Mauro Rossi 
Fixes: 7d7b308 ("automake: Fix path to generated source")
Fixes: b63a1f8 ("glsl: Create file to contain software fp64 functions")
Cc: 19.0 
---
 src/mesa/drivers/dri/i965/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/meson.build 
b/src/mesa/drivers/dri/i965/meson.build
index cd3683ae7e..4c06dad1b3 100644
--- a/src/mesa/drivers/dri/i965/meson.build
+++ b/src/mesa/drivers/dri/i965/meson.build
@@ -179,7 +179,7 @@ libi965 = static_library(
   [files_i965, i965_oa_sources, ir_expression_operation_h,
xmlpool_options_h, float64_glsl_h],
   include_directories : [
-inc_common, inc_intel, inc_dri_common, inc_util, inc_drm_uapi,
+inc_common, inc_compiler, inc_intel, inc_dri_common, inc_util, 
inc_drm_uapi,
   ],
   c_args : [c_vis_args, no_override_init_args, c_sse2_args],
   cpp_args : [cpp_vis_args, c_sse2_args],
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/3] android: glsl: fix fp64 generated source path

2019-02-02 Thread Mauro Rossi
Porting of commit 7d7b308 ("automake: Fix path to generated source")
to Android build system

Fixes the following building error:
ninja: error: 
'.../x86/gen/STATIC_LIBRARIES/libmesa_glsl_intermediates/glsl/float64_glsl.h',
needed by 
'.../x86/obj/STATIC_LIBRARIES/libmesa_glsl_intermediates/glsl/float64_glsl.h',
missing and no known rule to make it

Signed-off-by: Mauro Rossi 
Fixes: 7d7b308 ("automake: Fix path to generated source")
Fixes: b63a1f8 ("glsl: Create file to contain software fp64 functions")
Cc: 19.0 
---
 src/compiler/Android.glsl.gen.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/Android.glsl.gen.mk b/src/compiler/Android.glsl.gen.mk
index e31eb6f101..3b94ea7bd2 100644
--- a/src/compiler/Android.glsl.gen.mk
+++ b/src/compiler/Android.glsl.gen.mk
@@ -104,6 +104,6 @@ $(intermediates)/glsl/ir_expression_operation_strings.h: 
$(LOCAL_PATH)/glsl/ir_e
@mkdir -p $(dir $@)
$(hide) $(MESA_PYTHON2) $< strings > $@
 
-$(intermediates)/compiler/glsl/float64_glsl.h: $(LOCAL_PATH)/glsl/xxd.py
+$(intermediates)/glsl/float64_glsl.h: $(LOCAL_PATH)/glsl/xxd.py
@mkdir -p $(dir $@)
$(hide) $(MESA_PYTHON2) $< $(MESA_TOP)/src/compiler/glsl/float64.glsl 
$@ -n float64_source > $@
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] android: st/mesa: fix building error due to sched_getcpu()

2018-11-30 Thread Mauro Rossi
Android has cpufeatures library but pinning of threads is not supported
PIPE_OS_LINUX code path causes build error due to sched_getcpu() unavailable
thus we need to avoid setting HAVE_SCHED_GETCPU for Android

Fixes: 48f2160 ("st/mesa: regularly re-pin driver threads to the CCX where the 
app thread is")
Signed-off-by: Mauro Rossi 
---
 src/mesa/state_tracker/st_draw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 5910ffa5bd..9600b1569d 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -67,7 +67,7 @@
 #include "draw/draw_context.h"
 #include "cso_cache/cso_context.h"
 
-#ifdef PIPE_OS_LINUX
+#if defined(PIPE_OS_LINUX) && !defined(ANDROID)
 #include 
 #define HAVE_SCHED_GETCPU 1
 #else
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] android: amd/addrlib: update Mesa's copy of addrlib

2018-11-30 Thread Mauro Rossi
Needed to fix build error in addrlib in mesa for Android

Fixes: 776b911 ("amd/addrlib: update Mesa's copy of addrlib")
Signed-off-by: Mauro Rossi 
---
 src/amd/Android.addrlib.mk | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/amd/Android.addrlib.mk b/src/amd/Android.addrlib.mk
index a37112d715..428fe19b20 100644
--- a/src/amd/Android.addrlib.mk
+++ b/src/amd/Android.addrlib.mk
@@ -33,12 +33,11 @@ LOCAL_SRC_FILES := $(ADDRLIB_FILES)
 LOCAL_C_INCLUDES := \
$(MESA_TOP)/src \
$(MESA_TOP)/src/amd/common \
-   $(MESA_TOP)/src/amd/addrlib \
-   $(MESA_TOP)/src/amd/addrlib/core \
-   $(MESA_TOP)/src/amd/addrlib/inc/chip/gfx9 \
-   $(MESA_TOP)/src/amd/addrlib/inc/chip/r800 \
-   $(MESA_TOP)/src/amd/addrlib/gfx9/chip \
-   $(MESA_TOP)/src/amd/addrlib/r800/chip
+   $(MESA_TOP)/src/amd/addrlib/inc \
+   $(MESA_TOP)/src/amd/addrlib/src \
+   $(MESA_TOP)/src/amd/addrlib/src/core \
+   $(MESA_TOP)/src/amd/addrlib/src/chip/gfx9 \
+   $(MESA_TOP)/src/amd/addrlib/src/chip/r800
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH) \
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] android: radv: add libmesa_git_sha1 static dependency

2018-11-02 Thread Mauro Rossi
Hi all,
could somebody provide Reviewed-by in order to apply in mesa-dev and
avoid trivial building error?
Thanks

Mauro
On Tue, Oct 30, 2018 at 10:42 PM Mauro Rossi  wrote:
>
> libmesa_git_sha1 whole static dependency is added to get git_sha1.h header
> and avoid following building error:
>
> external/mesa/src/amd/vulkan/radv_device.c:46:10:
> fatal error: 'git_sha1.h' file not found
>  ^
> 1 error generated.
>
> Fixes: 9d40ec2cf6 ("radv: Add support for VK_KHR_driver_properties.")
> Signed-off-by: Mauro Rossi 
> ---
>  src/amd/vulkan/Android.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/Android.mk b/src/amd/vulkan/Android.mk
> index 51b03561fa..9574bf54e5 100644
> --- a/src/amd/vulkan/Android.mk
> +++ b/src/amd/vulkan/Android.mk
> @@ -74,7 +74,8 @@ LOCAL_C_INCLUDES := \
> $(call 
> generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util
>
>  LOCAL_WHOLE_STATIC_LIBRARIES := \
> -   libmesa_vulkan_util
> +   libmesa_vulkan_util \
> +   libmesa_git_sha1
>
>  LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.c
>  LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.h
> --
> 2.19.1
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] android: gallium/auxiliary: add include to get u_debug.h header

2018-10-31 Thread Mauro Rossi
To avoid build error in u_debug_stack_android.cpp
due to now missing u_debug.h header:

external/mesa/src/gallium/auxiliary/util/u_debug_stack_android.cpp:26:10:
fatal error: 'u_debug.h' file not found
#include "u_debug.h"
 ^
1 error generated.

Fixes: 37db383abb ("util: Move u_debug to utils")
Signed-off-by: Mauro Rossi 
---
 src/gallium/auxiliary/Android.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk
index acd243b834..7618c6fcd9 100644
--- a/src/gallium/auxiliary/Android.mk
+++ b/src/gallium/auxiliary/Android.mk
@@ -36,7 +36,8 @@ LOCAL_SRC_FILES := \
util/u_debug_stack_android.cpp
 
 LOCAL_C_INCLUDES := \
-   $(GALLIUM_TOP)/auxiliary/util
+   $(GALLIUM_TOP)/auxiliary/util \
+   $(MESA_TOP)/src/util
 
 ifeq ($(MESA_ENABLE_LLVM),true)
 LOCAL_SRC_FILES += \
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] android: radv: add libmesa_git_sha1 static dependency

2018-10-30 Thread Mauro Rossi
libmesa_git_sha1 whole static dependency is added to get git_sha1.h header
and avoid following building error:

external/mesa/src/amd/vulkan/radv_device.c:46:10:
fatal error: 'git_sha1.h' file not found
 ^
1 error generated.

Fixes: 9d40ec2cf6 ("radv: Add support for VK_KHR_driver_properties.")
Signed-off-by: Mauro Rossi 
---
 src/amd/vulkan/Android.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/Android.mk b/src/amd/vulkan/Android.mk
index 51b03561fa..9574bf54e5 100644
--- a/src/amd/vulkan/Android.mk
+++ b/src/amd/vulkan/Android.mk
@@ -74,7 +74,8 @@ LOCAL_C_INCLUDES := \
$(call 
generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util
 
 LOCAL_WHOLE_STATIC_LIBRARIES := \
-   libmesa_vulkan_util
+   libmesa_vulkan_util \
+   libmesa_git_sha1
 
 LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.c
 LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.h
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] android: i965/tiled_memcpy: fix build for x86 generic target

2018-10-29 Thread Mauro Rossi
x86 32 bit generic target does not enable ARCH_X86_HAVE_SSE4_1
for this reason all Android library modules using SSE4_1 in mesa
are built conditionally to ARCH_X86_HAVE_SSE4_1

The same approach is now applied to libmesa_intel_tiled_memcpy_sse41
in order to avoid the following building errors:

external/mesa/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c:574:15:
error: initializing '__m128i' (vector of 2 'long long' values) with an 
expression of incompatible type 'int'
  __m128i val = _mm_stream_load_si128((__m128i *)src);
  ^ ~
external/mesa/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c:578:15:
error: initializing '__m128i' (vector of 2 'long long' values) with an 
expression of incompatible type 'int'
  __m128i val0 = _mm_stream_load_si128(((__m128i *)src) + 0);
  ^  ~~~
external/mesa/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c:579:15:
error: initializing '__m128i' (vector of 2 'long long' values) with an 
expression of incompatible type 'int'
  __m128i val1 = _mm_stream_load_si128(((__m128i *)src) + 1);
  ^  ~~~
external/mesa/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c:580:15:
error: initializing '__m128i' (vector of 2 'long long' values) with an 
expression of incompatible type 'int'
  __m128i val2 = _mm_stream_load_si128(((__m128i *)src) + 2);
  ^  ~~~
external/mesa/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c:581:15: error: 
initializing '__m128i' (vector of 2 'long long' values) with an expression of 
incompatible type 'int'
  __m128i val3 = _mm_stream_load_si128(((__m128i *)src) + 3);
  ^  ~~~
5 errors generated.

Fixes: 11b1afdc92 ("i965/tiled_memcpy: inline movntdqa loads in 
tiled_to_linear")
Signed-off-by: Mauro Rossi 
---
 src/mesa/drivers/dri/i965/Android.mk | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/Android.mk 
b/src/mesa/drivers/dri/i965/Android.mk
index e1401ae813..0e9ef48999 100644
--- a/src/mesa/drivers/dri/i965/Android.mk
+++ b/src/mesa/drivers/dri/i965/Android.mk
@@ -71,6 +71,7 @@ include $(BUILD_STATIC_LIBRARY)
 # Build libmesa_intel_tiled_memcpy_sse41
 # ---
 
+ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libmesa_intel_tiled_memcpy_sse41
@@ -79,13 +80,12 @@ LOCAL_C_INCLUDES := $(I965_PERGEN_COMMON_INCLUDES)
 
 LOCAL_SRC_FILES := $(intel_tiled_memcpy_sse41_FILES)
 
-ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
 LOCAL_CFLAGS += \
-DUSE_SSE41 -msse4.1 -mstackrealign
-endif
 
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
+endif
 
 # ---
 # Build libmesa_i965_gen4
@@ -310,11 +310,6 @@ LOCAL_LDFLAGS += $(MESA_DRI_LDFLAGS)
 LOCAL_CFLAGS := \
$(MESA_DRI_CFLAGS)
 
-ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
-LOCAL_CFLAGS += \
-   -DUSE_SSE41
-endif
-
 LOCAL_C_INCLUDES := \
$(MESA_DRI_C_INCLUDES) \
$(MESA_TOP)/include/drm-uapi
@@ -326,13 +321,19 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
$(MESA_DRI_WHOLE_STATIC_LIBRARIES) \
$(I965_PERGEN_LIBS) \
libmesa_intel_tiled_memcpy \
-   libmesa_intel_tiled_memcpy_sse41 \
libmesa_intel_dev \
libmesa_intel_common \
libmesa_isl \
libmesa_blorp \
libmesa_intel_compiler
 
+ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
+LOCAL_CFLAGS += \
+   -DUSE_SSE41
+LOCAL_WHOLE_STATIC_LIBRARIES += \
+   libmesa_intel_tiled_memcpy_sse41
+endif
+
 LOCAL_SHARED_LIBRARIES := \
$(MESA_DRI_SHARED_LIBRARIES)
 
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3] egl/android: rework device probing

2018-09-10 Thread Mauro Rossi
Hi Emil,
Il giorno lun 3 set 2018 alle ore 14:42 Emil Velikov
 ha scritto:
>
> From: Emil Velikov 
>
> Unlike the other platforms, here we aim do guess if the device that we
> somewhat arbitrarily picked, is supported or not.
>
> In particular: when a vendor is _not_ requested we loop through all
> devices, picking the first one which can create a DRI screen.
>
> When a vendor is requested - we use that and do _not_ fall-back to any
> other device.
>
> The former seems a bit fiddly, but considering EGL_EXT_explicit_device and
> EGL_MESA_query_renderer are MIA, this is the best we can do for the
> moment.
>
> With those (proposed) extensions userspace will be able to create a
> separate EGL display for each device, query device details and make the
> conscious decision which one to use.
>
> v2:
>  - update droid_open_device_drm_gralloc()
>  - set the dri2_dpy->fd before using it
>  - return a EGLBoolean for droid_{probe,open}_device*
>  - do not warn on droid_load_driver failure (Tomasz)
>  - plug mem leak on dri2_create_screen failure (Tomasz)
>  - fixup function name typo (Tomasz, Rob)
>
> v3:
>  - add forward declaration for droid_load_driver()
> Fixes the HAVE_DRM_GRALLOC build (Mauro)
>  - split dup() assignment and check in separate lines (Tomasz, Eric)
>  - make droid_load_driver() static (Tomasz)
>  - drop unused prop_set variable (Tomasz)
>
> Cc: Robert Foss 
> Cc: Tomasz Figa 
> Cc: Mauro Rossi 
> Signed-off-by: Emil Velikov 
> Tested-by: Tomasz Figa 
> Tested-by: Tapani Pälli 
> ---
> Thanks for the feedback everyone.
>
> Mauro, this includes a forward declaration which should fix things for
> you.
> ---
>  src/egl/drivers/dri2/platform_android.c | 124 +++-
>  1 file changed, 79 insertions(+), 45 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/platform_android.c 
> b/src/egl/drivers/dri2/platform_android.c
> index ecc0245c9a2..5a73d9e7ea9 100644
> --- a/src/egl/drivers/dri2/platform_android.c
> +++ b/src/egl/drivers/dri2/platform_android.c
> @@ -1202,10 +1202,14 @@ droid_add_configs_for_visuals(_EGLDriver *drv, 
> _EGLDisplay *dpy)
> return (config_count != 0);
>  }
>
> +static EGLBoolean
> +droid_load_driver(_EGLDisplay *disp);

droid_probe_device(_EGLDisplay *disp);

is required here, as it is invoked in droid_open_device_drm_gralloc()
With this change there is no regression in the drivers I've tested
(Intel and AMD)

nouveau has some other problem, manifesting as drm driver errors and
freezes, happening also with drm_gralloc,
but it is not due to this patch, the problem was alreaday present w/o
this patch.

Mauro

> +
>  #ifdef HAVE_DRM_GRALLOC
> -static int
> -droid_open_device_drm_gralloc(struct dri2_egl_display *dri2_dpy)
> +static EGLBoolean
> +droid_open_device_drm_gralloc(_EGLDisplay *disp)
>  {
> +   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
> int fd = -1, err = -EINVAL;
>
> if (dri2_dpy->gralloc->perform)
> @@ -1214,10 +1218,14 @@ droid_open_device_drm_gralloc(struct dri2_egl_display 
> *dri2_dpy)
>);
> if (err || fd < 0) {
>_eglLog(_EGL_WARNING, "fail to get drm fd");
> -  fd = -1;
> +  return EGL_FALSE;
> }
>
> -   return (fd >= 0) ? fcntl(fd, F_DUPFD_CLOEXEC, 3) : -1;
> +   dri2_dpy->fd = fcntl(fd, F_DUPFD_CLOEXEC, 3);
> +   if (dri2_dpy->fd < 0)
> + return EGL_FALSE;
> +
> +   return droid_probe_device(disp);
>  }
>  #endif /* HAVE_DRM_GRALLOC */
>
> @@ -1362,10 +1370,10 @@ static const __DRIextension 
> *droid_image_loader_extensions[] = {
> NULL,
>  };
>
> -EGLBoolean
> +static EGLBoolean
>  droid_load_driver(_EGLDisplay *disp)
>  {
> -   struct dri2_egl_display *dri2_dpy = disp->DriverData;
> +   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
> const char *err;
>
> dri2_dpy->driver_name = loader_get_driver_for_fd(dri2_dpy->fd);
> @@ -1404,6 +1412,17 @@ error:
> return false;
>  }
>
> +static void
> +droid_unload_driver(_EGLDisplay *disp)
> +{
> +   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
> +
> +   dlclose(dri2_dpy->driver);
> +   dri2_dpy->driver = NULL;
> +   free(dri2_dpy->driver_name);
> +   dri2_dpy->driver_name = NULL;
> +}
> +
>  static int
>  droid_filter_device(_EGLDisplay *disp, int fd, const char *vendor)
>  {
> @@ -1420,13 +1439,31 @@ droid_filter_device(_EGLDisplay *disp, int fd, const 
> char *vendor)
> return 0;
>  }
>
> -static int
> +static EGLBoolean
> +droid_probe_device(_EGLDisplay *disp)
> +{
> +  /* Check that the device is supported, 

Re: [Mesa-dev] [PATCH] android: util/u_thread: fix building error with bionic pthread

2018-09-10 Thread Mauro Rossi
Hi,

Il giorno lun 10 set 2018 alle ore 09:58 Tapani Pälli
 ha scritto:
>
> Marek sent a similar fix here:
> https://lists.freedesktop.org/archives/mesa-dev/2018-September/204797.html

Thanks a lot!
So the APU L3 cache optimization will be lost for Android

>
> On 09/10/2018 10:52 AM, Mauro Rossi wrote:
> > This patch is to tackle with shortcomings in Android bionic libc.
> > Even if setting cflag -D__USE__GNU and adding include of  cpuset 
> > macros
> > may become available, bionic libc does not support 
> > pthread_{g,s}etaffinity_np()
> >
> > Wrappers to sched_{g,s]etaffinity() were found to here:
> > www.spinics.net/lists/linux-rt-users/msg16928.html
> > but I'm not sure that passing 0 as pid (the means "for the current process")
> > would works to pin the thread and if sched_{g,s]etaffinity() makes sense.
> >
> > Feedback about opportunity to use wrappers implementation is appreciated,
> > I have tested also the build with wrappers, but I need to know if it may 
> > work.

Provided that Android bionic libc should not have been chopped,
as now it has part of sched.h and does not have thread affinity,
going back to my doubt, would those wrappers work or not?

Mauro

> >
> > For now preprocessor conditional is added to avoid following building 
> > errors:
> >
> > In file included from external/mesa/src/gallium/auxiliary/os/os_thread.h:42:
> > external/mesa/src/util/u_thread.h:93:4: error: use of undeclared identifier 
> > 'pthread_setaffinity_np'
> > pthread_setaffinity_np(thread, sizeof(cpuset), );
> > ^~
> > ...
> > In file included from external/mesa/src/gallium/auxiliary/os/os_thread.h:42:
> > external/mesa/src/util/u_thread.h:110:8: error: use of undeclared 
> > identifier 'pthread_getaffinity_np'
> > if (pthread_getaffinity_np(thread, sizeof(cpuset), ) == 0) {
> > ^
> > 2 errors generated.
> >
> > Fixes: 8d473f555a ("st/mesa: pin driver threads to a specific L3 cache on 
> > AMD Zen (v2)")
> > ---
> >   src/util/u_thread.h | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/util/u_thread.h b/src/util/u_thread.h
> > index ec0d9a7f36..7419dd7e2c 100644
> > --- a/src/util/u_thread.h
> > +++ b/src/util/u_thread.h
> > @@ -83,7 +83,7 @@ static inline void u_thread_setname( const char *name )
> >   static inline void
> >   util_pin_thread_to_L3(thrd_t thread, unsigned L3_index, unsigned 
> > cores_per_L3)
> >   {
> > -#if defined(HAVE_PTHREAD)
> > +#if defined(HAVE_PTHREAD) && !defined(ANDROID)
> >  cpu_set_t cpuset;
> >
> >  CPU_ZERO();
> > @@ -103,7 +103,7 @@ util_pin_thread_to_L3(thrd_t thread, unsigned L3_index, 
> > unsigned cores_per_L3)
> >   static inline int
> >   util_get_L3_for_pinned_thread(thrd_t thread, unsigned cores_per_L3)
> >   {
> > -#if defined(HAVE_PTHREAD)
> > +#if defined(HAVE_PTHREAD) && !defined(ANDROID)
> >  cpu_set_t cpuset;
> >
> >  if (pthread_getaffinity_np(thread, sizeof(cpuset), ) == 0) {
> >
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] android: util/u_thread: fix building error with bionic pthread

2018-09-10 Thread Mauro Rossi
This patch is to tackle with shortcomings in Android bionic libc.
Even if setting cflag -D__USE__GNU and adding include of  cpuset 
macros 
may become available, bionic libc does not support pthread_{g,s}etaffinity_np()

Wrappers to sched_{g,s]etaffinity() were found to here:
www.spinics.net/lists/linux-rt-users/msg16928.html
but I'm not sure that passing 0 as pid (the means "for the current process")
would works to pin the thread and if sched_{g,s]etaffinity() makes sense.

Feedback about opportunity to use wrappers implementation is appreciated,
I have tested also the build with wrappers, but I need to know if it may work.

For now preprocessor conditional is added to avoid following building errors:

In file included from external/mesa/src/gallium/auxiliary/os/os_thread.h:42:
external/mesa/src/util/u_thread.h:93:4: error: use of undeclared identifier 
'pthread_setaffinity_np'
   pthread_setaffinity_np(thread, sizeof(cpuset), );
   ^~
...
In file included from external/mesa/src/gallium/auxiliary/os/os_thread.h:42:
external/mesa/src/util/u_thread.h:110:8: error: use of undeclared identifier 
'pthread_getaffinity_np'
   if (pthread_getaffinity_np(thread, sizeof(cpuset), ) == 0) {
   ^
2 errors generated.

Fixes: 8d473f555a ("st/mesa: pin driver threads to a specific L3 cache on AMD 
Zen (v2)")
---
 src/util/u_thread.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/u_thread.h b/src/util/u_thread.h
index ec0d9a7f36..7419dd7e2c 100644
--- a/src/util/u_thread.h
+++ b/src/util/u_thread.h
@@ -83,7 +83,7 @@ static inline void u_thread_setname( const char *name )
 static inline void
 util_pin_thread_to_L3(thrd_t thread, unsigned L3_index, unsigned cores_per_L3)
 {
-#if defined(HAVE_PTHREAD)
+#if defined(HAVE_PTHREAD) && !defined(ANDROID)
cpu_set_t cpuset;
 
CPU_ZERO();
@@ -103,7 +103,7 @@ util_pin_thread_to_L3(thrd_t thread, unsigned L3_index, 
unsigned cores_per_L3)
 static inline int
 util_get_L3_for_pinned_thread(thrd_t thread, unsigned cores_per_L3)
 {
-#if defined(HAVE_PTHREAD)
+#if defined(HAVE_PTHREAD) && !defined(ANDROID)
cpu_set_t cpuset;
 
if (pthread_getaffinity_np(thread, sizeof(cpuset), ) == 0) {
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [Mesa-stable] [PATCH 1/3] android: broadcom/genxml: fix collision with intel/genxml header-gen macro

2018-09-09 Thread Mauro Rossi
Hi,

Il giorno gio 6 set 2018 alle ore 18:20 Dylan Baker
 ha scritto:
>
> Quoting Rob Herring (2018-09-06 07:16:07)
> > On Mon, Sep 3, 2018 at 4:27 PM Eric Anholt  wrote:
> > >
> > > Mauro Rossi  writes:
> > >
> > > > Fixes the following building error, happening when building both intel 
> > > > and broadcom:
> > >
> > > I wish someone maintaining android Mesa would work on making the meson
> > > build work for them instead of just continuing to maintain the
> > > Android.mk mess.
> >
> > Trust me, no one likes this thankless job.
> >
> > How do you envision that would work without meson support in the
> > Android build system? I went down the path of defining a "prebuilt"
> > Android.mk target which calls meson to do a build. This was a dead end
> > because the Android.mk gets none of the build environment. It's
> > possible to dump all that out and re-construct those settings. That
> > seems horribly fragile, and I'd guess we'd just be switching from mesa
> > to AOSP breaking the build. Of course the latter already happens too.
> > Finally, I'm pretty sure this would not be accepted for the AOSP copy
> > of mesa (which is trying to track mainline).
> >
> > The other route would be some sort automatic meson to Android BP build
> > file translation. Such a thing exists for autotools, but I've never
> > seen it in actual use anywhere.
> >
> > Either way, this seems like a unicorn to me until AOSP provides some
> > support to support meson. If you really want to force the issue, strip
> > all the Android.mk files out of mesa. Though that will mainly put the
> > pain on downstream device trees, not AOSP.
> >
> > Rob
>
> With my meson hat on,
>
> I've been looking at blueprint recently, trying to decide if we could 
> implement
> a meson-for-android on top of blueprint. While I know a lot about meson (I've
> written a bunch of the meson implementation), I don't know a lot about 
> blueprint
> and their documentation is basically aimed at explaining how soong works. I
> certainly can't commit to full time development on a meson-on-blueprint
> implementation, but I certainly could help write one if there was someone
> interested in working on it as well. It would also be helpful if there was
> someone in the blueprint camp who could tell me whether such a thing is even
> feasible or not.
>
> Dylan

I can comment that when talking about the patching process in Mesa,
it is very much clear when Android.mk changes are needed
and there are many people currently supporting Android.mk and in the
last three years
there was much attention to keep Android.mk in good shape.
That's why it is in good shape.

In my understanding kati for building with Android.mk will be dropped
at some point,
Android.bp will be the only building script language supported by AOSP.

Android.bp will be easier to mantain than Android.mk, because Android.bp
is intentionally very similar to Bazel build script language,
which should have corresponding objects and grammar/syntax rules than
can be translated or visually inspected, if people will continue to
care.

IMHO .go language scripts should not be used when unnecessary, for
architecture conditionals and genrules that may be supported in
Android.bp
but environement variables, if I understood correctly, will require
.go script because of how Blueprint is inspired to Bazel but not
identical.
I'm still wondering if a .go-less Android.bp may be feasible

So options are:

1. Use the androidmk parser / blueprint_tools to perform the draft
translation, then huge work to fix the Android.bp build through all
the tree.
2. meson to Android.bp parser/translator - this would be interesting,
if we could find a way to generate the .go which is not tackled with
in 1.,or surrogate rules in bp
3. Go to Google  ninja-build forums if they have plans to perform
feasibility analysis and develop soong to accept meson directly (In
the long term it is a Win for them)
4. Go to Google Build forum and propose a meson-to-bp added to
blueprint_tools (and have part of this task driven by them  - A
clearly mesa is not the only project using meson)
5. Propose Google to setup one/two projects for next GSoC in area 3. and 4.
6. Wait for Google be at the milestone of kati/Android.mk demise and
see how they will build mesa.

I am interested in contributing in part of my spare time.

Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/3] android: broadcom/genxml: fix collision with intel/genxml header-gen macro

2018-08-26 Thread Mauro Rossi
Fixes the following building error, happening when building both intel and 
broadcom:

Gen Header: libmesa_broadcom_genxml_32 <= v3d_packet_v21_pack.h
FAILED: 
out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h
/bin/bash -c "python external/mesa/src/broadcom/cle/gen_pack_header.py \
external/mesa/src/broadcom/cle/v3d_packet_v21.xml \ 
> out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h"
Traceback (most recent call last):
  File "external/mesa/src/broadcom/cle/gen_pack_header.py", line 626, in 

p = Parser(sys.argv[2])
IndexError: list index out of range

header-gen macro is already defined by Intel genxml building rules
and the existing header-gen does not have the $(PRIVATE_VER) argument,
infact the bash command line logged in the building error is missing
exactly $(PRIVATE_VER) argument

Renaming the macro as pack-header-gen in src/broadcom/Android.genxml.mk
solves the building error, another possible way is to keep the gen rules
commands expanded and not use the macros.

Fixes: 7f80a9ff13 ("vc4: Introduce XML-based packet header generation like 
Intel's.")
Cc: "18.2" 
Signed-off-by: Mauro Rossi 
---
 src/broadcom/Android.genxml.mk | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/broadcom/Android.genxml.mk b/src/broadcom/Android.genxml.mk
index eb5d142fe0..91e0de05d9 100644
--- a/src/broadcom/Android.genxml.mk
+++ b/src/broadcom/Android.genxml.mk
@@ -39,7 +39,7 @@ $(intermediates)/dummy.c:
 # This is the list of auto-generated files headers
 LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/broadcom/, 
$(BROADCOM_GENXML_GENERATED_FILES))
 
-define header-gen
+define pack-header-gen
@mkdir -p $(dir $@)
@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
$(hide) $(PRIVATE_SCRIPT) $(PRIVATE_SCRIPT_FLAGS) $(PRIVATE_XML) 
$(PRIVATE_VER) > $@
@@ -49,25 +49,25 @@ $(intermediates)/broadcom/cle/v3d_packet_v21_pack.h: 
PRIVATE_SCRIPT := $(MESA_PY
 $(intermediates)/broadcom/cle/v3d_packet_v21_pack.h: PRIVATE_XML := 
$(LOCAL_PATH)/cle/v3d_packet_v21.xml
 $(intermediates)/broadcom/cle/v3d_packet_v21_pack.h: PRIVATE_VER := 21
 $(intermediates)/broadcom/cle/v3d_packet_v21_pack.h: 
$(LOCAL_PATH)/cle/v3d_packet_v21.xml $(LOCAL_PATH)/cle/gen_pack_header.py
-   $(call header-gen)
+   $(call pack-header-gen)
 
 $(intermediates)/broadcom/cle/v3d_packet_v33_pack.h: PRIVATE_SCRIPT := 
$(MESA_PYTHON2) $(LOCAL_PATH)/cle/gen_pack_header.py
 $(intermediates)/broadcom/cle/v3d_packet_v33_pack.h: PRIVATE_XML := 
$(LOCAL_PATH)/cle/v3d_packet_v33.xml
 $(intermediates)/broadcom/cle/v3d_packet_v33_pack.h: PRIVATE_VER := 33
 $(intermediates)/broadcom/cle/v3d_packet_v33_pack.h: 
$(LOCAL_PATH)/cle/v3d_packet_v33.xml $(LOCAL_PATH)/cle/gen_pack_header.py
-   $(call header-gen)
+   $(call pack-header-gen)
 
 $(intermediates)/broadcom/cle/v3d_packet_v41_pack.h: PRIVATE_SCRIPT := 
$(MESA_PYTHON2) $(LOCAL_PATH)/cle/gen_pack_header.py
 $(intermediates)/broadcom/cle/v3d_packet_v41_pack.h: PRIVATE_XML := 
$(LOCAL_PATH)/cle/v3d_packet_v33.xml
 $(intermediates)/broadcom/cle/v3d_packet_v41_pack.h: PRIVATE_VER := 41
 $(intermediates)/broadcom/cle/v3d_packet_v41_pack.h: 
$(LOCAL_PATH)/cle/v3d_packet_v33.xml $(LOCAL_PATH)/cle/gen_pack_header.py
-   $(call header-gen)
+   $(call pack-header-gen)
 
 $(intermediates)/broadcom/cle/v3d_packet_v42_pack.h: PRIVATE_SCRIPT := 
$(MESA_PYTHON2) $(LOCAL_PATH)/cle/gen_pack_header.py
 $(intermediates)/broadcom/cle/v3d_packet_v42_pack.h: PRIVATE_XML := 
$(LOCAL_PATH)/cle/v3d_packet_v33.xml
 $(intermediates)/broadcom/cle/v3d_packet_v42_pack.h: PRIVATE_VER := 42
 $(intermediates)/broadcom/cle/v3d_packet_v42_pack.h: 
$(LOCAL_PATH)/cle/v3d_packet_v33.xml $(LOCAL_PATH)/cle/gen_pack_header.py
-   $(call header-gen)
+   $(call pack-header-gen)
 
 $(intermediates)/broadcom/cle/v3d_xml.h: $(addprefix 
$(MESA_TOP)/src/broadcom/,$(BROADCOM_GENXML_XML_FILES)) 
$(MESA_TOP)/src/intel/genxml/gen_zipped_file.py
@mkdir -p $(dir $@)
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/3] android: broadcom/cle: export the broadcom top level path headers

2018-08-26 Thread Mauro Rossi
Fixes the following building error in vc4 build:

In file included from 
external/mesa/src/gallium/drivers/vc4/kernel/vc4_render_cl.c:34:
In file included from external/mesa/src/gallium/drivers/vc4/kernel/vc4_drv.h:27:
In file included from 
external/mesa/src/gallium/drivers/vc4/vc4_simulator_validate.h:34:
In file included from external/mesa/src/gallium/drivers/vc4/vc4_context.h:39:
In file included from external/mesa/src/gallium/drivers/vc4/vc4_cl.h:56:
out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h:12:10:
fatal error: 'cle/v3d_packet_helpers.h' file not found
 ^~
1 error generated.

Fixes: 5b102160ae ("broadcom/genxml: Introduce a V3D packet/struct decoder.")
Cc: "18.2" 
Signed-off-by: Mauro Rossi 
---
 src/broadcom/Android.cle.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/broadcom/Android.cle.mk b/src/broadcom/Android.cle.mk
index c6bf262641..5634a8d4ad 100644
--- a/src/broadcom/Android.cle.mk
+++ b/src/broadcom/Android.cle.mk
@@ -31,6 +31,8 @@ LOCAL_STATIC_LIBRARIES := libmesa_broadcom_genxml
 
 LOCAL_C_INCLUDES += $(MESA_TOP)/src/gallium/include
 
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
 LOCAL_SHARED_LIBRARIES := libexpat libz
 
 include $(MESA_COMMON_MK)
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/3] android: broadcom/cle: add gallium include path

2018-08-26 Thread Mauro Rossi
Fixes the following building error:

In file included from external/mesa/src/broadcom/cle/v3d_decoder.c:38:
In file included from external/mesa/src/broadcom/cle/v3d_packet_helpers.h:29:
external/mesa/src/gallium/auxiliary/util/u_math.h:42:10:
fatal error: 'pipe/p_compiler.h' file not found
 ^~~
1 error generated.

Fixes: 5b102160ae ("broadcom/genxml: Introduce a V3D packet/struct decoder.")
Cc: "18.2" 
Signed-off-by: Mauro Rossi 
---
 src/broadcom/Android.cle.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/broadcom/Android.cle.mk b/src/broadcom/Android.cle.mk
index 9b728424fa..c6bf262641 100644
--- a/src/broadcom/Android.cle.mk
+++ b/src/broadcom/Android.cle.mk
@@ -29,6 +29,8 @@ LOCAL_SRC_FILES := $(BROADCOM_DECODER_FILES)
 
 LOCAL_STATIC_LIBRARIES := libmesa_broadcom_genxml
 
+LOCAL_C_INCLUDES += $(MESA_TOP)/src/gallium/include
+
 LOCAL_SHARED_LIBRARIES := libexpat libz
 
 include $(MESA_COMMON_MK)
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] egl/android: do not indent HAVE_DRM_GRALLOC preprocessor directive

2018-08-24 Thread Mauro Rossi
Hi,

Il giorno mer 15 ago 2018 alle ore 15:13 Mauro Rossi
 ha scritto:
>
> Fixes: 3f7bca44d9 ("egl/android: #ifdef out flink name support")
> Fixes: c7bb82136b ("egl/android: Add DRM node probing and filtering")
> Signed-off-by: Mauro Rossi 
> ---
>  src/egl/drivers/dri2/platform_android.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/platform_android.c 
> b/src/egl/drivers/dri2/platform_android.c
> index 834bbd258e..f8c85f97cf 100644
> --- a/src/egl/drivers/dri2/platform_android.c
> +++ b/src/egl/drivers/dri2/platform_android.c
> @@ -1226,7 +1226,7 @@ droid_load_driver(_EGLDisplay *disp)
> dri2_dpy->is_render_node = drmGetNodeTypeFromFd(dri2_dpy->fd) == 
> DRM_NODE_RENDER;
>
> if (!dri2_dpy->is_render_node) {
> -   #ifdef HAVE_DRM_GRALLOC
> +#ifdef HAVE_DRM_GRALLOC
> /* Handle control nodes using __DRI_DRI2_LOADER extension and GEM 
> names
>  * for backwards compatibility with drm_gralloc. (Do not use on new
>  * systems.) */
> @@ -1235,10 +1235,10 @@ droid_load_driver(_EGLDisplay *disp)
>err = "DRI2: failed to load driver";
>goto error;
> }
> -   #else
> +#else
> err = "DRI2: handle is not for a render node";
> goto error;
> -   #endif
> +#endif
> } else {
> dri2_dpy->loader_extensions = droid_image_loader_extensions;
> if (!dri2_load_driver_dri3(disp)) {
> --
> 2.17.1
>

Please provide one R-b ,
in order to proceed in commit to gitlab master
and propose as candidate for mesa 18.2.0 release

Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] egl/android: do not indent HAVE_DRM_GRALLOC preprocessor directive

2018-08-15 Thread Mauro Rossi
Fixes: 3f7bca44d9 ("egl/android: #ifdef out flink name support")
Fixes: c7bb82136b ("egl/android: Add DRM node probing and filtering")
Signed-off-by: Mauro Rossi 
---
 src/egl/drivers/dri2/platform_android.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_android.c 
b/src/egl/drivers/dri2/platform_android.c
index 834bbd258e..f8c85f97cf 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1226,7 +1226,7 @@ droid_load_driver(_EGLDisplay *disp)
dri2_dpy->is_render_node = drmGetNodeTypeFromFd(dri2_dpy->fd) == 
DRM_NODE_RENDER;
 
if (!dri2_dpy->is_render_node) {
-   #ifdef HAVE_DRM_GRALLOC
+#ifdef HAVE_DRM_GRALLOC
/* Handle control nodes using __DRI_DRI2_LOADER extension and GEM names
 * for backwards compatibility with drm_gralloc. (Do not use on new
 * systems.) */
@@ -1235,10 +1235,10 @@ droid_load_driver(_EGLDisplay *disp)
   err = "DRI2: failed to load driver";
   goto error;
}
-   #else
+#else
err = "DRI2: handle is not for a render node";
goto error;
-   #endif
+#endif
} else {
dri2_dpy->loader_extensions = droid_image_loader_extensions;
if (!dri2_load_driver_dri3(disp)) {
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] radv/meta_decompress: fix pointer to integer conversion

2018-08-15 Thread Mauro Rossi
Hi Bas,

Il giorno mar 14 ago 2018 alle ore 23:10 Bas Nieuwenhuizen <
b...@basnieuwenhuizen.nl> ha scritto:

> On Tue, Aug 14, 2018 at 10:48 PM, Mauro Rossi 
> wrote:
> > (VkShaderModule) cast is added before NULL to avoid following building
> error:
> >
> > external/mesa/src/amd/vulkan/radv_meta_decompress.c:365:54: error:
> > incompatible pointer to integer conversion passing 'void *' to parameter
> > of type 'VkShaderModule' (aka 'unsigned long long')
> [-Werror,-Wint-conversion]
> > VkResult ret = create_pipeline(cmd_buffer->device, NULL,
> samples,
> >^~~~
> >
> prebuilts/clang/host/linux-x86/clang-4053586/lib64/clang/5.0.300080/include/stddef.h:105:16:
> > note: expanded from macro 'NULL'
> > #  define NULL ((void*)0)
> >^~
> > external/mesa/src/amd/vulkan/radv_meta_decompress.c:97:32:
> > note: passing argument to parameter 'vs_module_h' here
> > VkShaderModule vs_module_h,
> >^
> > 1 error generated.
> >
> > Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in
> shaders.")
> > Signed-off-by: Mauro Rossi 
> > ---
> >  src/amd/vulkan/radv_meta_decompress.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/amd/vulkan/radv_meta_decompress.c
> b/src/amd/vulkan/radv_meta_decompress.c
> > index 41ed7b6d04..183be1fd88 100644
> > --- a/src/amd/vulkan/radv_meta_decompress.c
> > +++ b/src/amd/vulkan/radv_meta_decompress.c
> > @@ -362,7 +362,7 @@ static void radv_process_depth_image_inplace(struct
> radv_cmd_buffer *cmd_buffer,
> > return;
> >
> > if (!meta_state->depth_decomp[samples_log2].decompress_pipeline)
> {
> > -   VkResult ret = create_pipeline(cmd_buffer->device, NULL,
> samples,
> > +   VkResult ret = create_pipeline(cmd_buffer->device,
> (VkShaderModule) NULL, samples,
>
> Instead of the cast, use VK_NULL_HANDLE.
>

I've applied that change and it is working.

Do you prefer I send a v2 patch version to mesa-dev ML or may I apply to
gitlab master with your Reviewed-by ?
Thanks

Mauro


>
> >
> meta_state->depth_decomp[samples_log2].pass,
> >
> meta_state->depth_decomp[samples_log2].p_layout,
> >
> _state->depth_decomp[samples_log2].decompress_pipeline,
> > --
> > 2.17.1
> >
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] egl/android: fix regression in drm_gralloc path

2018-08-15 Thread Mauro Rossi
Hi Emil,

Il Mer 15 Ago 2018, 13:16 Emil Velikov  ha
scritto:

> On 15 August 2018 at 09:13, Mauro Rossi  wrote:
> > Hi Robert,
> > Il giorno mer 15 ago 2018 alle ore 09:37 Robert Foss
> >  ha scritto:
> >>
> >> Hey Mauro,
> >>
> >> Thanks for catching this.
> >>
> >> On 14/08/2018 22.27, Mauro Rossi wrote:
> >> > This patch fixes a regression in mesa 18.2 and mesa-dev branches
> >> > for HAVE_DRM_GRALLOC code path which is causing black screen on
> Android
> >> > and prevents boot due to SIGSEGV MAPERR crash related to unproper
> >> > handling
> >> > of drm_gralloc drm FD in new droid_open_device() path.
> >> >
> >> > The problem due to c7bb82136b ("egl/android: Add DRM node probing and
> >> > filtering")
> >> >
> >> > ...  3173  3307 D GRALLOC-DRM: drmOpen radeon: 71
> >> > ...  3173  3307 I GRALLOC-RADEON: detected chipset 0x6841 family 0x31
> >> > (vram size 238MiB, gart size 1021MiB)
> >> > ...  3173  3307 I GRALLOC-DRM: create radeon for driver radeon
> >> > ...  3173  3307 W EGL-MAIN: Could not get native buffer FD
> >> > - beginning of crash
> >> > ...  3173  3307 F libc: Fatal signal 11 (SIGSEGV), code 1, fault
> >> > addr 0x18 in tid 3307 (RenderThread), pid 3173 (ndroid.systemui)
> >> > ... 0 0 D : [drm:radeon_crtc_page_flip_target
> [radeon]]
> >> > flip-ioctl() cur_rbo = 3512328a, new_rbo = 00
> >> > ...  3420  3420 I crash_dump64: performing dump of process 3173
> (target
> >> > tid = 3307)
> >> > ...  3420  3420 F DEBUG   : *** *** *** *** *** *** *** *** *** ***
> ***
> >> > *** *** *** *** ***
> >> > ...  3420  3420 F DEBUG   : Build fingerprint:
> >> >
> 'Android-x86/android_x86_64/x86_64:8.1.0/OPM6.171019.030.E1/uten07210645:userdebug/test-keys'
> >> > ...  3420  3420 F DEBUG   : Revision: '0'
> >> > ...  3420  3420 F DEBUG   : ABI: 'x86_64'
> >> > ...  3420  3420 F DEBUG   : pid: 3173, tid: 3307, name: RenderThread
> >> > >>> com.android.systemui <<<
> >> > ...  3420  3420 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR),
> >> > fault addr 0x18
> >> > ...  3420  3420 F DEBUG   : Cause: null pointer dereference
> >> > ...  3420  3420 F DEBUG   : rax   rbx
> >> > 7c6ac3a3eee0  rcx   rdx 0038
> >> > ...  3420  3420 F DEBUG   : rsi   rdi
> >> > 7c6ab5bfeaa0
> >> > ...  3420  3420 F DEBUG   : r8  7c6ab04c16e4  r9
> >> > 7c6b4ee6a220  r10   r11 0200
> >> > ...  3420  3420 F DEBUG   : r12   r13
> >> >   r14 0001  r15 7c6ab04c1600
> >> > ...  3420  3420 F DEBUG   : cs  0033  ss
> >> > 002b
> >> > ...  3420  3420 F DEBUG   : rip 7c6ab0cee444  rbp
> >> > 7c6ac3ae8400  rsp 7c6ab5bfea80  eflags 00010246
> >> > ...  3420  3420 F DEBUG   :
> >> > ...  3420  3420 F DEBUG   : backtrace:
> >> > ...  3420  3420 F DEBUG   : #00 pc 0056b444
> >> > /system/vendor/lib64/dri/gallium_dri.so
> (st_update_framebuffer_state+660)
> >> > ...  3420  3420 F DEBUG   : #01 pc 00569d61
> >> > /system/vendor/lib64/dri/gallium_dri.so (st_validate_state+561)
> >> > ...  3420  3420 F DEBUG   : #02 pc 00572374
> >> > /system/vendor/lib64/dri/gallium_dri.so (st_Clear+116)
> >> > ...  3420  3420 F DEBUG   : #03 pc 0004a9c0
> >> > /android/system/lib64/libhwui.so
> >> > ...  3420  3420 F DEBUG   : #04 pc 00085cab
> >> > /android/system/lib64/libhwui.so
> >> > ...  3420  3420 F DEBUG   : #05 pc 00085f31
> >> > /android/system/lib64/libhwui.so
> >> > ...  3420  3420 F DEBUG   : #06 pc 0006e8c1
> >> > /android/system/lib64/libhwui.so
> >> > ...  3420  3420 F DEBUG   : #07 pc 0006e3d9
> >> > /android/system/lib64/libhwui.so
> >> > ...  3420  3420 F DEBUG   : #08 pc 0006c4e3
> >> > /android/system/lib64/libhwui.so
> >> > ...  3420  3420 F DEBUG   : #09 pc 000704c8
> >> > /android/system/lib64/libhwui.so
> >> > ...  3420  3420 F DEBUG   :

Re: [Mesa-dev] [PATCH 1/2] egl/android: fix regression in drm_gralloc path

2018-08-15 Thread Mauro Rossi
Hi Robert,
Il giorno mer 15 ago 2018 alle ore 09:37 Robert Foss <
robert.f...@collabora.com> ha scritto:

> Hey Mauro,
>
> Thanks for catching this.
>
> On 14/08/2018 22.27, Mauro Rossi wrote:
> > This patch fixes a regression in mesa 18.2 and mesa-dev branches
> > for HAVE_DRM_GRALLOC code path which is causing black screen on Android
> > and prevents boot due to SIGSEGV MAPERR crash related to unproper
> handling
> > of drm_gralloc drm FD in new droid_open_device() path.
> >
> > The problem due to c7bb82136b ("egl/android: Add DRM node probing and
> filtering")
> >
> > ...  3173  3307 D GRALLOC-DRM: drmOpen radeon: 71
> > ...  3173  3307 I GRALLOC-RADEON: detected chipset 0x6841 family 0x31
> (vram size 238MiB, gart size 1021MiB)
> > ...  3173  3307 I GRALLOC-DRM: create radeon for driver radeon
> > ...  3173  3307 W EGL-MAIN: Could not get native buffer FD
> > - beginning of crash
> > ...  3173  3307 F libc: Fatal signal 11 (SIGSEGV), code 1, fault
> addr 0x18 in tid 3307 (RenderThread), pid 3173 (ndroid.systemui)
> > ... 0 0 D : [drm:radeon_crtc_page_flip_target [radeon]]
> flip-ioctl() cur_rbo = 3512328a, new_rbo = 00
> > ...  3420  3420 I crash_dump64: performing dump of process 3173 (target
> tid = 3307)
> > ...  3420  3420 F DEBUG   : *** *** *** *** *** *** *** *** *** *** ***
> *** *** *** *** ***
> > ...  3420  3420 F DEBUG   : Build fingerprint:
> 'Android-x86/android_x86_64/x86_64:8.1.0/OPM6.171019.030.E1/uten07210645:userdebug/test-keys'
> > ...  3420  3420 F DEBUG   : Revision: '0'
> > ...  3420  3420 F DEBUG   : ABI: 'x86_64'
> > ...  3420  3420 F DEBUG   : pid: 3173, tid: 3307, name: RenderThread
> >>> com.android.systemui <<<
> > ...  3420  3420 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR),
> fault addr 0x18
> > ...  3420  3420 F DEBUG   : Cause: null pointer dereference
> > ...  3420  3420 F DEBUG   : rax   rbx
> 7c6ac3a3eee0  rcx   rdx 0038
> > ...  3420  3420 F DEBUG   : rsi   rdi
> 7c6ab5bfeaa0
> > ...  3420  3420 F DEBUG   : r8  7c6ab04c16e4  r9
> 7c6b4ee6a220  r10   r11 0200
> > ...  3420  3420 F DEBUG   : r12   r13
>   r14 0001  r15 7c6ab04c1600
> > ...  3420  3420 F DEBUG   : cs  0033  ss
> 002b
> > ...  3420  3420 F DEBUG   : rip 7c6ab0cee444  rbp
> 7c6ac3ae8400  rsp 7c6ab5bfea80  eflags 00010246
> > ...  3420  3420 F DEBUG   :
> > ...  3420  3420 F DEBUG   : backtrace:
> > ...  3420  3420 F DEBUG   : #00 pc 0056b444
> /system/vendor/lib64/dri/gallium_dri.so (st_update_framebuffer_state+660)
> > ...  3420  3420 F DEBUG   : #01 pc 00569d61
> /system/vendor/lib64/dri/gallium_dri.so (st_validate_state+561)
> > ...  3420  3420 F DEBUG   : #02 pc 00572374
> /system/vendor/lib64/dri/gallium_dri.so (st_Clear+116)
> > ...  3420  3420 F DEBUG   : #03 pc 0004a9c0
> /android/system/lib64/libhwui.so
> > ...  3420  3420 F DEBUG   : #04 pc 00085cab
> /android/system/lib64/libhwui.so
> > ...  3420  3420 F DEBUG   : #05 pc 00085f31
> /android/system/lib64/libhwui.so
> > ...  3420  3420 F DEBUG   : #06 pc 0006e8c1
> /android/system/lib64/libhwui.so
> > ...  3420  3420 F DEBUG   : #07 pc 0006e3d9
> /android/system/lib64/libhwui.so
> > ...  3420  3420 F DEBUG   : #08 pc 0006c4e3
> /android/system/lib64/libhwui.so
> > ...  3420  3420 F DEBUG   : #09 pc 000704c8
> /android/system/lib64/libhwui.so
> > ...  3420  3420 F DEBUG   : #10 pc 00077fb9
> /android/system/lib64/libhwui.so
> > ...  3420  3420 F DEBUG   : #11 pc 000117fa
> /android/system/lib64/libutils.so
> > ...  3420  3420 F DEBUG   : #12 pc 000ba193
> /android/system/lib64/libandroid_runtime.so
> > ...  3420  3420 F DEBUG   : #13 pc 00079f0b
> /android/system/lib64/libc.so
> > ...  3420  3420 F DEBUG   : #14 pc 00028c5d
> /android/system/lib64/libc.so
> > ...  3420  3420 F DEBUG   : #15 pc 00027555
> /android/system/lib64/libc.so
> >
> > To avoid the crash the former existing working droid_open_device() is
> restored,
> > renamed droid_open_device_drm_gralloc() and kept within HAVE_DRM_GRALLOC
> braces.
> >
> > NOTE: Definition of enum{} for GRALLOC_MODULE_PERFORM_GET_DRM_FD
> > is not necessary and it is actually causing 

[Mesa-dev] [PATCH] radv/meta_decompress: fix pointer to integer conversion

2018-08-14 Thread Mauro Rossi
(VkShaderModule) cast is added before NULL to avoid following building error:

external/mesa/src/amd/vulkan/radv_meta_decompress.c:365:54: error:
incompatible pointer to integer conversion passing 'void *' to parameter
of type 'VkShaderModule' (aka 'unsigned long long') [-Werror,-Wint-conversion]
VkResult ret = create_pipeline(cmd_buffer->device, NULL, 
samples,
   ^~~~
prebuilts/clang/host/linux-x86/clang-4053586/lib64/clang/5.0.300080/include/stddef.h:105:16:
note: expanded from macro 'NULL' 
#  define NULL ((void*)0)
   ^~
external/mesa/src/amd/vulkan/radv_meta_decompress.c:97:32:
note: passing argument to parameter 'vs_module_h' here
VkShaderModule vs_module_h,
   ^
1 error generated.

Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in shaders.")
Signed-off-by: Mauro Rossi 
---
 src/amd/vulkan/radv_meta_decompress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_meta_decompress.c 
b/src/amd/vulkan/radv_meta_decompress.c
index 41ed7b6d04..183be1fd88 100644
--- a/src/amd/vulkan/radv_meta_decompress.c
+++ b/src/amd/vulkan/radv_meta_decompress.c
@@ -362,7 +362,7 @@ static void radv_process_depth_image_inplace(struct 
radv_cmd_buffer *cmd_buffer,
return;
 
if (!meta_state->depth_decomp[samples_log2].decompress_pipeline) {
-   VkResult ret = create_pipeline(cmd_buffer->device, NULL, 
samples,
+   VkResult ret = create_pipeline(cmd_buffer->device, 
(VkShaderModule) NULL, samples,
   
meta_state->depth_decomp[samples_log2].pass,
   
meta_state->depth_decomp[samples_log2].p_layout,
   
_state->depth_decomp[samples_log2].decompress_pipeline,
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] egl/android: fix regression in drm_gralloc path

2018-08-14 Thread Mauro Rossi
Hi all,
sorry for the typo in the subject the patch is only one, it should have
been titled

[PATCH] egl/android: fix regression in drm_gralloc path

Please review and I am available to test if there are working alternatives
to avoid the breakage of drm_gralloc users.
Mauro

Il giorno mar 14 ago 2018 alle ore 22:27 Mauro Rossi 
ha scritto:

> This patch fixes a regression in mesa 18.2 and mesa-dev branches
> for HAVE_DRM_GRALLOC code path which is causing black screen on Android
> and prevents boot due to SIGSEGV MAPERR crash related to unproper handling
> of drm_gralloc drm FD in new droid_open_device() path.
>
> The problem due to c7bb82136b ("egl/android: Add DRM node probing and
> filtering")
>
> ...  3173  3307 D GRALLOC-DRM: drmOpen radeon: 71
> ...  3173  3307 I GRALLOC-RADEON: detected chipset 0x6841 family 0x31
> (vram size 238MiB, gart size 1021MiB)
> ...  3173  3307 I GRALLOC-DRM: create radeon for driver radeon
> ...  3173  3307 W EGL-MAIN: Could not get native buffer FD
> - beginning of crash
> ...  3173  3307 F libc: Fatal signal 11 (SIGSEGV), code 1, fault addr
> 0x18 in tid 3307 (RenderThread), pid 3173 (ndroid.systemui)
> ... 0 0 D : [drm:radeon_crtc_page_flip_target [radeon]]
> flip-ioctl() cur_rbo = 3512328a, new_rbo = 00
> ...  3420  3420 I crash_dump64: performing dump of process 3173 (target
> tid = 3307)
> ...  3420  3420 F DEBUG   : *** *** *** *** *** *** *** *** *** *** ***
> *** *** *** *** ***
> ...  3420  3420 F DEBUG   : Build fingerprint:
> 'Android-x86/android_x86_64/x86_64:8.1.0/OPM6.171019.030.E1/uten07210645:userdebug/test-keys'
> ...  3420  3420 F DEBUG   : Revision: '0'
> ...  3420  3420 F DEBUG   : ABI: 'x86_64'
> ...  3420  3420 F DEBUG   : pid: 3173, tid: 3307, name: RenderThread  >>>
> com.android.systemui <<<
> ...  3420  3420 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR),
> fault addr 0x18
> ...  3420  3420 F DEBUG   : Cause: null pointer dereference
> ...  3420  3420 F DEBUG   : rax   rbx
> 7c6ac3a3eee0  rcx   rdx 0038
> ...  3420  3420 F DEBUG   : rsi   rdi 7c6ab5bfeaa0
> ...  3420  3420 F DEBUG   : r8  7c6ab04c16e4  r9
> 7c6b4ee6a220  r10   r11 0200
> ...  3420  3420 F DEBUG   : r12   r13
>   r14 0001  r15 7c6ab04c1600
> ...  3420  3420 F DEBUG   : cs  0033  ss  002b
> ...  3420  3420 F DEBUG   : rip 7c6ab0cee444  rbp
> 7c6ac3ae8400  rsp 7c6ab5bfea80  eflags 00010246
> ...  3420  3420 F DEBUG   :
> ...  3420  3420 F DEBUG   : backtrace:
> ...  3420  3420 F DEBUG   : #00 pc 0056b444
> /system/vendor/lib64/dri/gallium_dri.so (st_update_framebuffer_state+660)
> ...  3420  3420 F DEBUG   : #01 pc 00569d61
> /system/vendor/lib64/dri/gallium_dri.so (st_validate_state+561)
> ...  3420  3420 F DEBUG   : #02 pc 00572374
> /system/vendor/lib64/dri/gallium_dri.so (st_Clear+116)
> ...  3420  3420 F DEBUG   : #03 pc 0004a9c0
> /android/system/lib64/libhwui.so
> ...  3420  3420 F DEBUG   : #04 pc 00085cab
> /android/system/lib64/libhwui.so
> ...  3420  3420 F DEBUG   : #05 pc 00085f31
> /android/system/lib64/libhwui.so
> ...  3420  3420 F DEBUG   : #06 pc 0006e8c1
> /android/system/lib64/libhwui.so
> ...  3420  3420 F DEBUG   : #07 pc 0006e3d9
> /android/system/lib64/libhwui.so
> ...  3420  3420 F DEBUG   : #08 pc 0006c4e3
> /android/system/lib64/libhwui.so
> ...  3420  3420 F DEBUG   : #09 pc 000704c8
> /android/system/lib64/libhwui.so
> ...  3420  3420 F DEBUG   : #10 pc 00077fb9
> /android/system/lib64/libhwui.so
> ...  3420  3420 F DEBUG   : #11 pc 000117fa
> /android/system/lib64/libutils.so
> ...  3420  3420 F DEBUG   : #12 pc 000ba193
> /android/system/lib64/libandroid_runtime.so
> ...  3420  3420 F DEBUG   : #13 pc 00079f0b
> /android/system/lib64/libc.so
> ...  3420  3420 F DEBUG   : #14 pc 00028c5d
> /android/system/lib64/libc.so
> ...  3420  3420 F DEBUG   : #15 pc 00027555
> /android/system/lib64/libc.so
>
> To avoid the crash the former existing working droid_open_device() is
> restored,
> renamed droid_open_device_drm_gralloc() and kept within HAVE_DRM_GRALLOC
> braces.
>
> NOTE: Definition of enum{} for GRALLOC_MODULE_PERFORM_GET_DRM_FD
> is not necessary and it is actually causing a redefinition building error,
> because in HAVE_DRM_GRALLOC path gralloc_drm.h is already exported
> by libgralloc_drm which is currently still

[Mesa-dev] [PATCH 1/2] egl/android: fix regression in drm_gralloc path

2018-08-14 Thread Mauro Rossi
This patch fixes a regression in mesa 18.2 and mesa-dev branches 
for HAVE_DRM_GRALLOC code path which is causing black screen on Android
and prevents boot due to SIGSEGV MAPERR crash related to unproper handling
of drm_gralloc drm FD in new droid_open_device() path.

The problem due to c7bb82136b ("egl/android: Add DRM node probing and 
filtering")

...  3173  3307 D GRALLOC-DRM: drmOpen radeon: 71
...  3173  3307 I GRALLOC-RADEON: detected chipset 0x6841 family 0x31 (vram 
size 238MiB, gart size 1021MiB)
...  3173  3307 I GRALLOC-DRM: create radeon for driver radeon
...  3173  3307 W EGL-MAIN: Could not get native buffer FD
- beginning of crash
...  3173  3307 F libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x18 
in tid 3307 (RenderThread), pid 3173 (ndroid.systemui)
... 0 0 D : [drm:radeon_crtc_page_flip_target [radeon]] 
flip-ioctl() cur_rbo = 3512328a, new_rbo = 00
...  3420  3420 I crash_dump64: performing dump of process 3173 (target tid = 
3307)
...  3420  3420 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** 
*** *** ***
...  3420  3420 F DEBUG   : Build fingerprint: 
'Android-x86/android_x86_64/x86_64:8.1.0/OPM6.171019.030.E1/uten07210645:userdebug/test-keys'
...  3420  3420 F DEBUG   : Revision: '0'
...  3420  3420 F DEBUG   : ABI: 'x86_64'
...  3420  3420 F DEBUG   : pid: 3173, tid: 3307, name: RenderThread  >>> 
com.android.systemui <<<
...  3420  3420 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault 
addr 0x18
...  3420  3420 F DEBUG   : Cause: null pointer dereference
...  3420  3420 F DEBUG   : rax   rbx 7c6ac3a3eee0  rcx 
  rdx 0038
...  3420  3420 F DEBUG   : rsi   rdi 7c6ab5bfeaa0
...  3420  3420 F DEBUG   : r8  7c6ab04c16e4  r9  7c6b4ee6a220  r10 
  r11 0200
...  3420  3420 F DEBUG   : r12   r13   r14 
0001  r15 7c6ab04c1600
...  3420  3420 F DEBUG   : cs  0033  ss  002b
...  3420  3420 F DEBUG   : rip 7c6ab0cee444  rbp 7c6ac3ae8400  rsp 
7c6ab5bfea80  eflags 00010246
...  3420  3420 F DEBUG   :
...  3420  3420 F DEBUG   : backtrace:
...  3420  3420 F DEBUG   : #00 pc 0056b444  
/system/vendor/lib64/dri/gallium_dri.so (st_update_framebuffer_state+660)
...  3420  3420 F DEBUG   : #01 pc 00569d61  
/system/vendor/lib64/dri/gallium_dri.so (st_validate_state+561)
...  3420  3420 F DEBUG   : #02 pc 00572374  
/system/vendor/lib64/dri/gallium_dri.so (st_Clear+116)
...  3420  3420 F DEBUG   : #03 pc 0004a9c0  
/android/system/lib64/libhwui.so
...  3420  3420 F DEBUG   : #04 pc 00085cab  
/android/system/lib64/libhwui.so
...  3420  3420 F DEBUG   : #05 pc 00085f31  
/android/system/lib64/libhwui.so
...  3420  3420 F DEBUG   : #06 pc 0006e8c1  
/android/system/lib64/libhwui.so
...  3420  3420 F DEBUG   : #07 pc 0006e3d9  
/android/system/lib64/libhwui.so
...  3420  3420 F DEBUG   : #08 pc 0006c4e3  
/android/system/lib64/libhwui.so
...  3420  3420 F DEBUG   : #09 pc 000704c8  
/android/system/lib64/libhwui.so
...  3420  3420 F DEBUG   : #10 pc 00077fb9  
/android/system/lib64/libhwui.so
...  3420  3420 F DEBUG   : #11 pc 000117fa  
/android/system/lib64/libutils.so
...  3420  3420 F DEBUG   : #12 pc 000ba193  
/android/system/lib64/libandroid_runtime.so
...  3420  3420 F DEBUG   : #13 pc 00079f0b  
/android/system/lib64/libc.so
...  3420  3420 F DEBUG   : #14 pc 00028c5d  
/android/system/lib64/libc.so
...  3420  3420 F DEBUG   : #15 pc 00027555  
/android/system/lib64/libc.so

To avoid the crash the former existing working droid_open_device() is restored,
renamed droid_open_device_drm_gralloc() and kept within HAVE_DRM_GRALLOC braces.

NOTE: Definition of enum{} for GRALLOC_MODULE_PERFORM_GET_DRM_FD
is not necessary and it is actually causing a redefinition building error,
because in HAVE_DRM_GRALLOC path gralloc_drm.h is already exported
by libgralloc_drm which is currently still a dependency.

Tested with mesa-dev and mesa 18.2 branch and oreo-x86 bootanimation
and Androdi GUI booting is fixed with i965, nouveau, radeon.

The changes are compatible with gbm_gralloc, I've tested build with hwc too.

Fixes: c7bb82136b ("egl/android: Add DRM node probing and filtering")
Cc: "18.2" 
Signed-off-by: Mauro Rossi 
---
 src/egl/drivers/dri2/platform_android.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_android.c 
b/src/egl/drivers/dri2/platform_android.c
index cc16fd8118..834bbd258e 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1134,6 +1134,25 @@ droid_add_c

Re: [Mesa-dev] vulkan.radv build trouble w/ AOSP

2018-08-03 Thread Mauro Rossi
Hi Rob,
Il giorno gio 2 ago 2018 alle ore 22:33 Rob Herring 
ha scritto:

> On Thu, Aug 2, 2018 at 12:47 AM Mauro Rossi  wrote:
> >
> > Hi,
> >
> > Il giorno gio 2 ago 2018 alle ore 02:06 John Stultz <
> john.stu...@linaro.org> ha scritto:
> >>
> >> Just as a heads up, with mesa3d master (plus my other build fixups I
> >> just sent out), I'm seeing a new build failure when building under
> >> AOSP/master:
> >>
> >> external/mesa3d/src/amd/vulkan/Android.mk: error: vulkan.radv
> >> (SHARED_LIBRARIES android-arm64) missing libLLVM (SHARED_LIBRARIES
> >> android-arm64)
> >> You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if
> >> this is intentional, but that may defer real problems until later in
> >> the build.
> >> external/mesa3d/src/amd/vulkan/Android.mk: error: vulkan.radv
> >> (SHARED_LIBRARIES android-arm) missing libLLVM (SHARED_LIBRARIES
> >> android-arm)
> >> You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if
> >> this is intentional, but that may defer real problems until later in
> >> the build.
> >> build/make/core/main.mk:842: error: exiting from previous errors.
> >> 22:56:25 ckati failed with: exit status 1
> >>
> >> This seems to be coming from the $(call mesa-build-with-llvm) line here:
> >>
> https://github.com/mesa3d/mesa/blob/master/src/amd/vulkan/Android.mk#L144
> >>
> >> (as commenting that out avoids the issue)
> >>
> >> This gets pulled in as AOSP will check library dependencies for all
> >> SHARED_LIBRARIES, so that's why the vulkan.radv trips this while other
> >> "mesa-build-with-llvm" callers don't (they are built as
> >> STATIC_LIBRARIES).
> >>
> >> Last time we had this issue, it was with the libpciaccess library,
> >> which we solved it by dropping it.
> >>
> >> In this case I'm not sure what the best solution might be.
> >>
> >> * We could set it as a static library instead?
> >>
> >> * Alternatively, it seems we might be able to use the libLLVM_android
> >> library instead of libLLVM here:
> >>   https://github.com/mesa3d/mesa/blob/master/Android.mk#L107
> >>
> >> Other ideas/suggestions?
> >>
> >> thanks
> >> -john
> >
> >
> > A couple of ideas, but not yet tested in a build
> >
> > option 3) - use LOCAL_MODULE_TARGET_ARCH in the local vulkan.radv
> Android.mk and see if that solves the problem
> >
> > option 4) - brace the 'include $(LOCAL_PATH)/vulkan/Android.mk' in
> vulkan.radv src/amd/Android.mk in like this:
> >
> >  # Import variables
> >  include $(LOCAL_PATH)/Makefile.sources
> >  include $(LOCAL_PATH)/Android.addrlib.mk
> >  include $(LOCAL_PATH)/Android.common.mk
> > +ifneq ($(filter radeonsi,$(BOARD_GPU_DRIVERS)),)
> > include $(LOCAL_PATH)/vulkan/Android.mk
> > +endif
> >
> > I think the option 4) seems simpler than the others , if the assumption
> that ARM does not have radeonsi stands
>
> Using AMD cards on ARM is not unheard of, but perhaps not on Android.
>
> Rob
>

Thanks for information

In any case if mesa amd drivers had to be built  with arm targets
then libLLVM dependency would become necessary (AMDGPU targets)

The facts that AOSP in master decimated the content of libLLVM_android
library
and the constraint of mesa for llvm 6.0 or later would required to add llvm
relase_60 or release_70
as a separate project.

So, in case amd drivers will be built for arm in android, given the
constraints, then the patch is still ok
Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] android: radv: build vulkan.radv conditionally to radeonsi

2018-08-02 Thread Mauro Rossi
A problem was reported with arm,arm64 targets build due to missing
libLLVM shared library dependency with AOSP; to avoid this issue vulkan.radv
is built conditionally only when radeonsi is in BOARD_GPU_DRIVERS

Fixes: 0ca153f869 ("android: radv: enable build of vulkan.radv HAL module")

Reported-by: John Stultz 
Signed-off-by: Mauro Rossi 
Cc: "18.2" 
---
 src/amd/Android.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/amd/Android.mk b/src/amd/Android.mk
index 6129e360cb..e40e7da01b 100644
--- a/src/amd/Android.mk
+++ b/src/amd/Android.mk
@@ -27,4 +27,6 @@ include $(LOCAL_PATH)/Makefile.sources
 
 include $(LOCAL_PATH)/Android.addrlib.mk
 include $(LOCAL_PATH)/Android.common.mk
+ifneq ($(filter radeonsi,$(BOARD_GPU_DRIVERS)),)
 include $(LOCAL_PATH)/vulkan/Android.mk
+endif
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] vulkan.radv build trouble w/ AOSP

2018-08-02 Thread Mauro Rossi
Hi,


Il giorno gio 2 ago 2018 alle ore 17:51 Emil Velikov <
emil.l.veli...@gmail.com> ha scritto:

> On 2 August 2018 at 07:47, Mauro Rossi  wrote:
> > Hi,
> >
> > Il giorno gio 2 ago 2018 alle ore 02:06 John Stultz <
> john.stu...@linaro.org>
> > ha scritto:
> >>
> >> Just as a heads up, with mesa3d master (plus my other build fixups I
> >> just sent out), I'm seeing a new build failure when building under
> >> AOSP/master:
> >>
> >> external/mesa3d/src/amd/vulkan/Android.mk: error: vulkan.radv
> >> (SHARED_LIBRARIES android-arm64) missing libLLVM (SHARED_LIBRARIES
> >> android-arm64)
> >> You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if
> >> this is intentional, but that may defer real problems until later in
> >> the build.
> >> external/mesa3d/src/amd/vulkan/Android.mk: error: vulkan.radv
> >> (SHARED_LIBRARIES android-arm) missing libLLVM (SHARED_LIBRARIES
> >> android-arm)
> >> You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if
> >> this is intentional, but that may defer real problems until later in
> >> the build.
> >> build/make/core/main.mk:842: error: exiting from previous errors.
> >> 22:56:25 ckati failed with: exit status 1
> >>
> >> This seems to be coming from the $(call mesa-build-with-llvm) line here:
> >>
> https://github.com/mesa3d/mesa/blob/master/src/amd/vulkan/Android.mk#L144
> >>
> >> (as commenting that out avoids the issue)
> >>
> >> This gets pulled in as AOSP will check library dependencies for all
> >> SHARED_LIBRARIES, so that's why the vulkan.radv trips this while other
> >> "mesa-build-with-llvm" callers don't (they are built as
> >> STATIC_LIBRARIES).
> >>
> >> Last time we had this issue, it was with the libpciaccess library,
> >> which we solved it by dropping it.
> >>
> >> In this case I'm not sure what the best solution might be.
> >>
> >> * We could set it as a static library instead?
> >>
> >> * Alternatively, it seems we might be able to use the libLLVM_android
> >> library instead of libLLVM here:
> >>   https://github.com/mesa3d/mesa/blob/master/Android.mk#L107
> >>
> >> Other ideas/suggestions?
> >>
> >> thanks
> >> -john
> >
> >
> > A couple of ideas, but not yet tested in a build
> >
> > option 3) - use LOCAL_MODULE_TARGET_ARCH in the local vulkan.radv
> Android.mk
> > and see if that solves the problem
> >
> > option 4) - brace the 'include $(LOCAL_PATH)/vulkan/Android.mk' in
> > vulkan.radv src/amd/Android.mk in like this:
> >
> >  # Import variables
> >  include $(LOCAL_PATH)/Makefile.sources
> >  include $(LOCAL_PATH)/Android.addrlib.mk
> >  include $(LOCAL_PATH)/Android.common.mk
> > +ifneq ($(filter radeonsi,$(BOARD_GPU_DRIVERS)),)
> > include $(LOCAL_PATH)/vulkan/Android.mk
> > +endif
> >
> > I think the option 4) seems simpler than the others , if the assumption
> that
> > ARM does not have radeonsi stands
> > Mauro
> >
> Such a guard sounds perfectly reasonable IMHO.
>
> Note that ANV does not have equivalent hunk, although it will be a great
> idea.
> IIRC the lack of it, is the core reason behind xgettext workaround
> that John sent out recently.
>
> Thanks
> Emil
>

Thanks,
I will submit to mesa-dev and Cc: "18.2" mesa-stable to have it in the
18.2.0 release.
John, is it ok for you?

Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] vulkan.radv build trouble w/ AOSP

2018-08-02 Thread Mauro Rossi
Hi,

Il giorno gio 2 ago 2018 alle ore 02:06 John Stultz 
ha scritto:

> Just as a heads up, with mesa3d master (plus my other build fixups I
> just sent out), I'm seeing a new build failure when building under
> AOSP/master:
>
> external/mesa3d/src/amd/vulkan/Android.mk: error: vulkan.radv
> (SHARED_LIBRARIES android-arm64) missing libLLVM (SHARED_LIBRARIES
> android-arm64)
> You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if
> this is intentional, but that may defer real problems until later in
> the build.
> external/mesa3d/src/amd/vulkan/Android.mk: error: vulkan.radv
> (SHARED_LIBRARIES android-arm) missing libLLVM (SHARED_LIBRARIES
> android-arm)
> You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if
> this is intentional, but that may defer real problems until later in
> the build.
> build/make/core/main.mk:842: error: exiting from previous errors.
> 22:56:25 ckati failed with: exit status 1
>
> This seems to be coming from the $(call mesa-build-with-llvm) line here:
> https://github.com/mesa3d/mesa/blob/master/src/amd/vulkan/Android.mk#L144
>
> (as commenting that out avoids the issue)
>
> This gets pulled in as AOSP will check library dependencies for all
> SHARED_LIBRARIES, so that's why the vulkan.radv trips this while other
> "mesa-build-with-llvm" callers don't (they are built as
> STATIC_LIBRARIES).
>
> Last time we had this issue, it was with the libpciaccess library,
> which we solved it by dropping it.
>
> In this case I'm not sure what the best solution might be.
>
> * We could set it as a static library instead?
>
> * Alternatively, it seems we might be able to use the libLLVM_android
> library instead of libLLVM here:
>   https://github.com/mesa3d/mesa/blob/master/Android.mk#L107
>
> Other ideas/suggestions?
>
> thanks
> -john
>

A couple of ideas, but not yet tested in a build

option 3) - use LOCAL_MODULE_TARGET_ARCH in the local vulkan.radv
Android.mk and see if that solves the problem

option 4) - brace the 'include $(LOCAL_PATH)/vulkan/Android.mk' in
vulkan.radv src/amd/Android.mk in like this:

 # Import variables
 include $(LOCAL_PATH)/Makefile.sources
 include $(LOCAL_PATH)/Android.addrlib.mk
 include $(LOCAL_PATH)/Android.common.mk
+ifneq ($(filter radeonsi,$(BOARD_GPU_DRIVERS)),)
include $(LOCAL_PATH)/vulkan/Android.mk
+endif

I think the option 4) seems simpler than the others , if the assumption
that ARM does not have radeonsi stands
Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/4] android: radv: add Android.mk for vulkan.radv HAL module

2018-07-26 Thread Mauro Rossi
Hello there,
Il giorno gio 26 lug 2018 alle ore 17:09 Mauro Rossi
 ha scritto:
>
> Hi Emil,
>
> Il giorno gio 26 lug 2018 alle ore 16:48 Emil Velikov
>  ha scritto:
> >
> > On 22 July 2018 at 09:14, Mauro Rossi  wrote:
> > > radv implements the Android Vulkan HAL interface, this patch adds
> > > Android.mk building rules by porting of radv automake rules.
> > > vendor HAL module is installed as /vendor/lib/hw/vulkan.radv.so
> > >
> > > Signed-off-by: Mauro Rossi 
> > > ---
> > >  src/amd/vulkan/Android.mk | 166 ++
> >
> > It would be great it this file is a bit closer to the ANV one,
> > although no clever ideas come to mind.
>
> As a Quick Win, I think I could pull up this of one level as
> src/amd/Android.vulkan.mk,
> perform the necessary changes in paths, modify 4/4 accordingly,
> test build and no regression and then and push to gitlab with those changes.
>
> No problem to do that.
>
> Please, let me know if I may send 3/4 and 4/4 for review
> to you, to avoid resubmitting and re-reviewing the full series.
>
> Is it ok for you?
> Mauro

Well, I was too optimistic and considering only Android building rules,
it would require to modify also the automake rules and Makefile.sources
to accomodate the change in the relative path.

At least the automake and Android for radv are aligned in the AS-IS serie.

We can align radv to anv with another patch, but it is better to check
also with AMD developers that they agree to it.

Mauro

>
> >
> > With the Fixes tag in Patch 1/4, the series is
> > Reviewed-by: Emil Velikov 
> >
> > Thanks
> > Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/4] android: radv: add Android.mk for vulkan.radv HAL module

2018-07-26 Thread Mauro Rossi
Hi Emil,

Il giorno gio 26 lug 2018 alle ore 16:48 Emil Velikov
 ha scritto:
>
> On 22 July 2018 at 09:14, Mauro Rossi  wrote:
> > radv implements the Android Vulkan HAL interface, this patch adds
> > Android.mk building rules by porting of radv automake rules.
> > vendor HAL module is installed as /vendor/lib/hw/vulkan.radv.so
> >
> > Signed-off-by: Mauro Rossi 
> > ---
> >  src/amd/vulkan/Android.mk | 166 ++
>
> It would be great it this file is a bit closer to the ANV one,
> although no clever ideas come to mind.

As a Quick Win, I think I could pull up this of one level as
src/amd/Android.vulkan.mk,
perform the necessary changes in paths, modify 4/4 accordingly,
test build and no regression and then and push to gitlab with those changes.

No problem to do that.

Please, let me know if I may send 3/4 and 4/4 for review
to you, to avoid resubmitting and re-reviewing the full series.

Is it ok for you?
Mauro

>
> With the Fixes tag in Patch 1/4, the series is
> Reviewed-by: Emil Velikov 
>
> Thanks
> Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/4] android: radv: add Android.mk for vulkan.radv HAL module

2018-07-22 Thread Mauro Rossi
radv implements the Android Vulkan HAL interface, this patch adds
Android.mk building rules by porting of radv automake rules.
vendor HAL module is installed as /vendor/lib/hw/vulkan.radv.so

Signed-off-by: Mauro Rossi 
---
 src/amd/vulkan/Android.mk | 166 ++
 1 file changed, 166 insertions(+)
 create mode 100644 src/amd/vulkan/Android.mk

diff --git a/src/amd/vulkan/Android.mk b/src/amd/vulkan/Android.mk
new file mode 100644
index 00..e2c3ed9df8
--- /dev/null
+++ b/src/amd/vulkan/Android.mk
@@ -0,0 +1,166 @@
+# Copyright © 2018 Advanced Micro Devices, Inc.
+# Copyright © 2018 Mauro Rossi issor.or...@gmail.com
+
+# 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 (including the next
+# paragraph) 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)
+
+# get VULKAN_FILES and VULKAN_GENERATED_FILES
+include $(LOCAL_PATH)/Makefile.sources
+
+# The gallium includes are for the util/u_math.h include from main/macros.h
+
+RADV_COMMON_INCLUDES := \
+   $(MESA_TOP)/include \
+   $(MESA_TOP)/src/ \
+   $(MESA_TOP)/src/vulkan/wsi \
+   $(MESA_TOP)/src/vulkan/util \
+   $(MESA_TOP)/src/amd \
+   $(MESA_TOP)/src/amd/common \
+   $(MESA_TOP)/src/compiler \
+   $(MESA_TOP)/src/mapi \
+   $(MESA_TOP)/src/mesa \
+   $(MESA_TOP)/src/mesa/drivers/dri/common \
+   $(MESA_TOP)/src/gallium/auxiliary \
+   $(MESA_TOP)/src/gallium/include \
+   frameworks/native/vulkan/include
+
+RADV_SHARED_LIBRARIES := libdrm_amdgpu
+
+ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
+RADV_SHARED_LIBRARIES += libnativewindow
+endif
+
+#
+# libmesa_radv_common
+#
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libmesa_radv_common
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir)
+
+LOCAL_SRC_FILES := \
+   $(VULKAN_FILES)
+
+LOCAL_CFLAGS += -DFORCE_BUILD_AMDGPU   # instructs LLVM to declare 
LLVMInitializeAMDGPU* functions
+
+$(call mesa-build-with-llvm)
+
+LOCAL_C_INCLUDES := \
+   $(RADV_COMMON_INCLUDES) \
+   $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_amd_common,,) 
\
+   $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \
+   $(call 
generated-sources-dir-for,STATIC_LIBRARIES,libmesa_radv_common,,) \
+   $(call 
generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+   libmesa_vulkan_util
+
+LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.c
+LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.h
+LOCAL_GENERATED_SOURCES += $(intermediates)/radv_extensions.c
+LOCAL_GENERATED_SOURCES += $(intermediates)/radv_extensions.h
+LOCAL_GENERATED_SOURCES += $(intermediates)/vk_format_table.c
+
+RADV_ENTRYPOINTS_SCRIPT := $(MESA_TOP)/src/amd/vulkan/radv_entrypoints_gen.py
+RADV_EXTENSIONS_SCRIPT := $(MESA_TOP)/src/amd/vulkan/radv_extensions.py
+VK_FORMAT_TABLE_SCRIPT := $(MESA_TOP)/src/amd/vulkan/vk_format_table.py
+VK_FORMAT_PARSE_SCRIPT := $(MESA_TOP)/src/amd/vulkan/vk_format_parse.py
+
+vulkan_api_xml = $(MESA_TOP)/src/vulkan/registry/vk.xml
+vk_format_layout_csv = $(MESA_TOP)/src/amd/vulkan/vk_format_layout.csv
+
+$(intermediates)/radv_entrypoints.c: $(RADV_ENTRYPOINTS_SCRIPT) \
+   $(RADV_EXTENSIONS_SCRIPT) \
+   $(vulkan_api_xml)
+   @mkdir -p $(dir $@)
+   $(MESA_PYTHON2) $(RADV_ENTRYPOINTS_SCRIPT) \
+   --xml $(vulkan_api_xml) \
+   --outdir $(dir $@)
+
+$(intermediates)/radv_entrypoints.h: $(intermediates)/radv_entrypoints.c
+
+$(intermediates)/radv_extensions.c: $(RADV_EXTENSIONS_SCRIPT) $(vulkan_api_xml)
+   @mkdir -p $(dir $@)
+   $(MESA_PYTHON2) $(RADV_EXTENSIONS_SCRIPT) \
+   --xml $(vulkan_api_xml) \
+   --out-c $@ \
+   --out-h $(addsuffix .h,$(basename $@))
+
+$(intermediates)/radv_extensions.h: $(intermediate

[Mesa-dev] android: add support for vulkan radv

2018-07-22 Thread Mauro Rossi
The following series adds support for vulkan radv for Android 8.1

[PATCH 1/4] radv: move vk_format_table.c to generated sources
[PATCH 2/4] radv: generate entrypoints for VK_ANDROID_native_buffer
[PATCH 3/4] android: radv: add Android.mk for vulkan.radv HAL module
[PATCH 4/4] android: radv: enable build of vulkan.radv HAL module

Tested oreo-x86_8.1.0_r41 with mesa-dev and llvm70 master on GCN 2nd gen parts,
with "hwcomposer.drm (hwc1 and hwc2) + gralloc.gbm" HALs as a Proof of Concept.

Android CTS 8.1_r7 dEQP-VK.* tests: 227442 passed, 14 failed, 0 not executed

The following Vulkan enabled apps are working:
VulkanCapsViewer, Sascha Willems demos (44 of 48 are Ok), Google tutorials,
V1 Benchmark Pro (Vulkan API), PPSSPP emulator, Breakneck, Dream League Soccer,
Olympus Rising, Score! Hero, Toy Zombies Lite, Vainglory

To test vulkan.radv HAL, surfaceflinger was modified to request BGRA format,
instead of AOSP default RGBA format, hwcomposer.drm and gralloc.gbm mainstream
branches required small changes and mesa 18.2 prime fd support in egl/android
was essential to avoid following show stopper error:
'vulkan  : vkCreateImage w/ native buffer failed: 3294895293'

All the necessary changes in the graphics stack are documented and available
here for reference (maurossi commits) and they work also for Intel anv:

frameworks/native (PoC, to be refined to use native HW pixel formats):
https://github.com/maurossi/frameworks_native/commits/BGRA_in_hwc2

hwc1:
https://github.com/maurossi/drm_hwcomposer/commits/oreo-x86_conn_state
https://github.com/maurossi/gbm_gralloc/commits/oreo-x86_hwc_flag

hwc2:
https://github.com/maurossi/drm_hwcomposer/commits/robh_handle-rework
https://github.com/maurossi/gbm_gralloc/commits/robh_handle-rework-v2

external/llvm70 branch (used to build libLLVM70 shared library):
https://github.com/maurossi/llvm/tree/oreo-x86_llvm70_test

Thanks to Chih-Wei Huang, Qiang Yu, Tapani P  lli , Emil Velikov,
Robert Foss, Rob Herring and Tomasz Figa for continuous help and support.

Signed-off-by: Mauro Rossi 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/4] radv: move vk_format_table.c to generated sources

2018-07-22 Thread Mauro Rossi
Android build system will try to compile vk_format_table.c
as a shipped source, but at compile time it will be missing,
we move it to generated source, where it belongs

Signed-off-by: Mauro Rossi 
---
 src/amd/vulkan/Makefile.sources | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/Makefile.sources b/src/amd/vulkan/Makefile.sources
index 152fdd7cb7..53a638362b 100644
--- a/src/amd/vulkan/Makefile.sources
+++ b/src/amd/vulkan/Makefile.sources
@@ -69,7 +69,6 @@ VULKAN_FILES := \
radv_util.h \
radv_wsi.c \
si_cmd_buffer.c \
-   vk_format_table.c \
vk_format.h \
$(RADV_WS_AMDGPU_FILES)
 
@@ -89,5 +88,6 @@ VULKAN_GENERATED_FILES := \
radv_entrypoints.c \
radv_entrypoints.h \
radv_extensions.c \
-   radv_extensions.h
+   radv_extensions.h \
+   vk_format_table.c
 
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/4] radv: generate entrypoints for VK_ANDROID_native_buffer

2018-07-22 Thread Mauro Rossi
Patch changes radv entrypoints generator to not skip this extension even
though it is set as disabled in the vk.xml

Reference: 63525ba730 ("android: enable VK_ANDROID_native_buffer")
Fixes: 69f447553c ("vulkan: Drop vk_android_native_buffer.xml")
Signed-off-by: Mauro Rossi 
---
 src/amd/vulkan/radv_entrypoints_gen.py | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/amd/vulkan/radv_entrypoints_gen.py 
b/src/amd/vulkan/radv_entrypoints_gen.py
index bef0c447f6..16aa30797e 100644
--- a/src/amd/vulkan/radv_entrypoints_gen.py
+++ b/src/amd/vulkan/radv_entrypoints_gen.py
@@ -413,9 +413,6 @@ def get_entrypoints(doc, entrypoints_to_defines, 
start_index):
 if ext_name not in supported_exts:
 continue
 
-if extension.attrib['supported'] != 'vulkan':
-continue
-
 ext = supported_exts[ext_name]
 ext.type = extension.attrib['type']
 
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/4] android: radv: enable build of vulkan.radv HAL module

2018-07-22 Thread Mauro Rossi
src/amd/Android.mk requires to include src/amd/vulkan/Android.mk
to enable the build of vulkan.radv module

Signed-off-by: Mauro Rossi 
---
 src/amd/Android.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/Android.mk b/src/amd/Android.mk
index 07af05287f..6129e360cb 100644
--- a/src/amd/Android.mk
+++ b/src/amd/Android.mk
@@ -27,3 +27,4 @@ include $(LOCAL_PATH)/Makefile.sources
 
 include $(LOCAL_PATH)/Android.addrlib.mk
 include $(LOCAL_PATH)/Android.common.mk
+include $(LOCAL_PATH)/vulkan/Android.mk
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] android: util/disk_cache: fix building errors in gallium drivers

2018-07-21 Thread Mauro Rossi
This patch applies the necessary changes in Android.common.mk
as per automake rules, to avoid following building error:

external/mesa/src/gallium/drivers/nouveau/nouveau_screen.c:159:8:
error: implicit declaration of function 'disk_cache_get_function_timestamp'
is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   if (disk_cache_get_function_timestamp(nouveau_disk_cache_create,
   ^
1 error generated.

Fixes: cc10b34 ("util/disk_cache: Fix disk_cache_get_function_timestamp with 
disabled cache.")
Signed-off-by: Mauro Rossi 
---
 Android.common.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Android.common.mk b/Android.common.mk
index 999e17789b..492a5fbeab 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -46,12 +46,12 @@ LOCAL_CFLAGS += \
 # here to fix the radeonsi build.
 LOCAL_CFLAGS += \
-DANDROID_API_LEVEL=$(PLATFORM_SDK_VERSION) \
-   -DENABLE_SHADER_CACHE \
-D__STDC_CONSTANT_MACROS \
-D__STDC_LIMIT_MACROS \
-DHAVE___BUILTIN_EXPECT \
-DHAVE___BUILTIN_FFS \
-DHAVE___BUILTIN_FFSLL \
+   -DHAVE_DLFCN_H \
-DHAVE_FUNC_ATTRIBUTE_FLATTEN \
-DHAVE_FUNC_ATTRIBUTE_UNUSED \
-DHAVE_FUNC_ATTRIBUTE_FORMAT \
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] radv: winsys/amdgpu: include missing pthread.h header

2018-07-13 Thread Mauro Rossi
Hi,

Il giorno lun 9 lug 2018 alle ore 09:48 Bas Nieuwenhuizen <
b...@basnieuwenhuizen.nl> ha scritto:

> I'd like to nominate this for 18.1 stable releases.
>

Me too, but I haven't seen it picked in staging/18.1 yet

Please Dylan could you have a look,
in case I am supposed to do something, please let me know.
Mauro


>
> On Mon, Jul 2, 2018 at 1:25 AM, Mauro Rossi  wrote:
> > pthread types are used in some files without explicitely including
> pthread.h.
> > This leads to compile errors on Android 7.x nougat-x86
> > e.g. in src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
> >
> > In file included from
> external/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c:31:
> > In file included from
> external/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.h:32:
> > external/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h:52:2:
> error: unknown type name 'pthread_mutex_t'
> > pthread_mutex_t global_bo_list_lock;
> > ^
> > 1 error generated.
> >
> > Including pthread.h explicitely solves the building error
> >
> > Signed-off-by: Mauro Rossi 
> > ---
> >  src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
> b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
> > index d6af6052a6..40d35d557b 100644
> > --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
> > +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
> > @@ -33,6 +33,7 @@
> >  #include "addrlib/addrinterface.h"
> >  #include 
> >  #include "util/list.h"
> > +#include 
> >
> >  struct radv_amdgpu_winsys {
> > struct radeon_winsys base;
> > --
> > 2.17.1
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v1 0/3] Android kms_swrast support

2018-07-09 Thread Mauro Rossi
Hi Robert,

Il giorno lun 9 lug 2018 alle ore 13:01 Robert Foss <
robert.f...@collabora.com> ha scritto:

>
> NOTE: This series has not been tested successfully, and I'm seeing a
> segfault
>   during the boot process. Which I'm currently looking into.
>


What is your testing setup (hwcomposer, gralloc)?

I am asking because I am seeing segfaults with other drivers with
drm_hwcomposer (master) + gralloc.gbm (handle-rework-v2)
and also I would propose to verify also no regression on gralloc.drm.

Since this series should be compatible with the rock stable gralloc.drm, I
could perform some tests with former stack ( gralloc.drm pipe w/o
hwcomposer) where compatibility should be guaranteed
by BOARD_USES_DRM_GRALLOC:=true in BoardConfig.mk
and report back, if useful.

Please let me ask also a question to Rob Herring about gralloc.gbm
compliance with gralloc0 w/o hwcomposer,
can we also rely on this stack/configuration, but testing it only with mesa
having prime fd support?

Mauro


>
> This series implements kms_swrast support for the Android
> platform.
>
> It's available here:
> https://gitlab.collabora.com/robertfoss/mesa/tree/kms_swrast_v1
> and here with some debug:
> https://gitlab.collabora.com/robertfoss/mesa/tree/kms_swrast_v1_debug
>
>
> Changes since RFC:
>   - Dropped "st/dri: Allow kms_swrast to work without a device FD"
>   - Removed software renderer fallback from platform_android
>   - Fixed various smaller issues
>
>
> Rob.
>
> Rob Herring (1):
>   android: Build kms_swrast for the Android platform
>
> Robert Foss (2):
>   egl/android: Add Android property for forcing software rendering
>   platform/android: Enable kms_swrast fallback
>
>  src/egl/drivers/dri2/platform_android.c  | 19 ++-
>  src/egl/main/egldriver.c | 10 ++
>  src/gallium/Android.mk   |  2 +-
>  src/gallium/auxiliary/pipe-loader/Android.mk |  1 +
>  src/gallium/drivers/softpipe/Android.mk  |  4 +--
>  src/gallium/state_trackers/dri/Android.mk|  1 +
>  src/gallium/winsys/sw/kms-dri/Android.mk | 33 
>  7 files changed, 59 insertions(+), 11 deletions(-)
>  create mode 100644 src/gallium/winsys/sw/kms-dri/Android.mk
>
> --
> 2.17.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] radv: winsys/amdgpu: include missing pthread.h header

2018-07-01 Thread Mauro Rossi
pthread types are used in some files without explicitely including pthread.h.
This leads to compile errors on Android 7.x nougat-x86
e.g. in src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h

In file included from 
external/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c:31:
In file included from 
external/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.h:32:
external/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h:52:2: error: 
unknown type name 'pthread_mutex_t'
pthread_mutex_t global_bo_list_lock;
^
1 error generated.

Including pthread.h explicitely solves the building error

Signed-off-by: Mauro Rossi 
---
 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h 
b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
index d6af6052a6..40d35d557b 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
@@ -33,6 +33,7 @@
 #include "addrlib/addrinterface.h"
 #include 
 #include "util/list.h"
+#include 
 
 struct radv_amdgpu_winsys {
struct radeon_winsys base;
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] RFC about anv change that should be applicable to radv

2018-06-27 Thread Mauro Rossi
Hi,

Il giorno mer 27 giu 2018 alle ore 10:41 Tapani Pälli <
tapani.pa...@intel.com> ha scritto:

> Hi;
>
> On 06/13/2018 09:32 AM, Mauro Rossi wrote:
> > +Samuel Pitoiset
> >
> >
> > 2018-06-11 22:31 GMT+02:00 Mauro Rossi  > <mailto:issor.or...@gmail.com>>:
> >
> > Hi Bas,
> >
> > commit [1] removed a check on 'supported' attribute in
> > src/intel/vulkan/anv_entrypoints_gen.py
> >
> > Should the check on 'supported' attribute be removed also in
> > src/amd/vulkan/radv_entrypoints_gen.py ?
>
> Yes
>

Infact with that change the vulkan.radv module works with amdgpu (dc=1) on
HD7790,
I'm going to submit the patch to mesa-dev.


>
> > Thanks for your feedback
> > Mauro
> >
> > [1]
> >
> https://cgit.freedesktop.org/mesa/mesa/commit/?id=63525ba730e3d8a466d7f6382a2b91f4c75dd171
> > <
> https://cgit.freedesktop.org/mesa/mesa/commit/?id=63525ba730e3d8a466d7f6382a2b91f4c75dd171
> >
> >
> >
> >
> > Hi Sam, Bas,
> >
> > there is an important matter regarding Android builds (android-x86)
> >
> > I have a series of patches for Android makefiles to build radv for that
> > platform,
> > they are building but they require the change in
> > src/amd/vulkan/radv_entrypoints_gen.py
> > to have the necessary entrypoints and vulkan apps starting to work.
> >
> > What I forgot to say is that I have the Android building rules ready to
> > submit to mesa-dev,
> > but they require to build libLLVM with a different name e.g libLLVM60 or
> > libLLVM_mesa and set the correct HAVE_LLVM properly
> >
> > The patches themselves would break the Android build for Intel, because
> > amd tree is built unconditionally,
> > but the libLLVM"for mesa" shared library is not in place in AOSP, Intel
> > builds and not even in android-x86 oreo,
>
> This *should* not be a problem for us since it's the dependencies set in
> product.mk that define what libraries will be built. Android-IA
> (nowadays "Celadon") should just not then list the library name built
> for radv.
>

If vulkan.radv is not added to PRODUCT_PACKAGES list then it should not be
a problem for Android-IA

The problem I'm referring to is the libLLVM shared dependency in itself

AOSP builds libLLVM from external/llvm for its own purposes, version 3.9 is
bundled with for Oreo branches,
recent mesa have ceased support for that version, so we cannot avoid
building the bundled libLLVM and for mesa we need to build libLLVM50
(different shared library module name)
because Android Build system does not allow for duplicated shared libraries
module names.

If this is not a problem I will submit the patches with Android building
rules assuming that llvm shared library can be the current i.e. libLLVM,
but in reality to build vulkan.radv for Android, libLLVM must be version
5.0 or later and requires "the trick" to side-build another external/llvm50
project.

This setup does not have many users, but upstream the Android radv patches
could make sense, if it's not disruptive for other users.
If someone know a different way or view please let me know.



>
> One issue is that anv currently builds as
> 'vulkan.$(TARGET_BOARD_PLATFORM)' which is very generic, we should
> probably have something like vulkan.anv.$(TARGET_BOARD_PLATFORM) instead
> and then use ro.hardware.vulkan=vulkan.anv.$(TARGET_BOARD_PLATFORM) in
> device.mk so that Android finds it (?)
>

vulkan.anv should be ok, as the vulkan HAL module name should not need to
depend on the $(TARGET_BOARD_PLATFORM) label

If I recall correctly for a 'vulkan.anv' named module the property is set
as:

setprop  ro.hardware.vulkan anv

if set as ro.hardware.vulkan vulkan.anv the module may not be found.

In android-x86 we plan to set  the property in init.sh, according to the
loaded drmfb module, for available vulkan hals:

for inteldrmfb setprop ro.hardware.vulkan anv
for amdgpudrmfb   setprop ro.hardware.vulkan radv
[in the future as example] for  virtiodrmfb setprop ro.hardware.vulkan virgl

Mauro


>
>
> > so I wanted to start discussing about how to integrate ravd for Android
> > in a way that does not break other drivers builds,
> > if there are other interested users.
> >
> > Mauro
>
> // Tapani
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] RFC about anv change that should be applicable to radv

2018-06-13 Thread Mauro Rossi
+Samuel Pitoiset


2018-06-11 22:31 GMT+02:00 Mauro Rossi :

> Hi Bas,
>
> commit [1] removed a check  on 'supported' attribute in
> src/intel/vulkan/anv_entrypoints_gen.py
>
> Should the check on 'supported' attribute be removed also in
> src/amd/vulkan/radv_entrypoints_gen.py ?
>
> Thanks for your feedback
> Mauro
>
> [1] https://cgit.freedesktop.org/mesa/mesa/commit/?id=
> 63525ba730e3d8a466d7f6382a2b91f4c75dd171
>
>
>
Hi Sam, Bas,

there is an important matter regarding Android builds (android-x86)

I have a series of patches for Android makefiles to build radv for that
platform,
they are building but they require the change in
src/amd/vulkan/radv_entrypoints_gen.py
to have the necessary entrypoints and vulkan apps starting to work.

What I forgot to say is that I have the Android building rules ready to
submit to mesa-dev,
but they require to build libLLVM with a different name e.g libLLVM60 or
libLLVM_mesa and set the correct HAVE_LLVM properly

The patches themselves would break the Android build for Intel, because amd
tree is built unconditionally,
but the libLLVM"for mesa" shared library is not in place in AOSP, Intel
builds and not even in android-x86 oreo,

so I wanted to start discussing about how to integrate ravd for Android in
a way that does not break other drivers builds,
if there are other interested users.

Mauro
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] RFC about anv change that should be applicable to radv

2018-06-11 Thread Mauro Rossi
Hi Bas,

commit [1] removed a check  on 'supported' attribute in
src/intel/vulkan/anv_entrypoints_gen.py

Should the check on 'supported' attribute be removed also in
src/amd/vulkan/radv_entrypoints_gen.py ?

Thanks for your feedback
Mauro

[1]
https://cgit.freedesktop.org/mesa/mesa/commit/?id=63525ba730e3d8a466d7f6382a2b91f4c75dd171
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] anv/android: Set the BO flags in bo_cache_import

2018-06-03 Thread Mauro Rossi
Hi,

2018-06-04 0:31 GMT+02:00 Lionel Landwerlin :

> On 03/06/18 21:22, Mauro Rossi wrote:
>
> Hi there,
>
> 2018-06-03 21:52 GMT+02:00 Lionel Landwerlin <
> lionel.g.landwer...@intel.com>:
>
>> On 03/06/18 19:41, Mauro Rossi wrote:
>>
>>> Change to avoid building error:
>>>
>>> external/mesa/src/intel/vulkan/anv_android.c:131:72:
>>> error: too few arguments to function call, expected 5, have 4
>>> result = anv_bo_cache_import(device, >bo_cache, dma_buf,
>>> );
>>>  ~~~^
>>> 1 error generated.
>>>
>>> Fixes: b0d50247a7 ("anv/allocator: Set the BO flags in
>>> bo_cache_alloc/import")
>>> Signed-off-by: Mauro Rossi 
>>> ---
>>>   src/intel/vulkan/anv_android.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/intel/vulkan/anv_android.c
>>> b/src/intel/vulkan/anv_android.c
>>> index 7e07dbaaa4..ed5da5b537 100644
>>> --- a/src/intel/vulkan/anv_android.c
>>> +++ b/src/intel/vulkan/anv_android.c
>>> @@ -128,7 +128,7 @@ anv_image_from_gralloc(VkDevice device_h,
>>>   */
>>>  int dma_buf = gralloc_info->handle->data[0];
>>>   -   result = anv_bo_cache_import(device, >bo_cache, dma_buf,
>>> );
>>> +   result = anv_bo_cache_import(device, >bo_cache, dma_buf, 0,
>>> );
>>>
>>
>> If you look at anv_intel.c here are the flags that we use :
>>
>>uint64_t bo_flags = 0;
>>if (device->instance->physicalDevice.supports_48bit_addresses)
>>   bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
>>
>> I'm pretty sure we want the same, potentially also the async flag?
>
>
> Please I need review on the correctness or improvements,
> because I just put 0 as bo_flags as a deduction based on similar change
> in src/intel/vulkan/anv_queue.c where in anv_bo_cache_import() call the
> bo_flag was set to 0
>
> Thanks
> M.
>
>
> Here is what looks good to me (maybe Jason can confirm) :
>
>uint64_t bo_flags = 0;
>if (device->instance->physicalDevice.supports_48bit_addresses)
>   bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
>if (pdevice->use_softpin) /* You'll need to grab a pointer to the
> physical device here */
>

The above expression should be ok:

   if (device->instance->physicalDevice.use_softpin)

If all builds I'm sending v2 of PATCH 1/2 soon
Thanks

Mauro


>
>
  bo_flags |= EXEC_OBJECT_PINNED;
>
> anv_queue.c is for fences which are buffers we don't actually touch for
> the GPU.
> They're just used for creating/dealing with dependency graph of workloads.
>
> It seems anv_intel.c needs updating, or maybe we should just drop that
> extensions now that we have other means of importing BOs.
>
> Thanks for looking into this,
>
> -
> Lionel
>
>
>
>>
>>
>>  if (result != VK_SUCCESS) {
>>> return vk_errorf(device->instance, device, result,
>>>  "failed to import dma-buf from
>>> VkNativeBufferANDROID");
>>>
>>
>>
>>
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] anv/android: Set the BO flags in bo_cache_import (v2)

2018-06-03 Thread Mauro Rossi
Changes to avoid building error:

external/mesa/src/intel/vulkan/anv_android.c:131:72:
error: too few arguments to function call, expected 5, have 4
   result = anv_bo_cache_import(device, >bo_cache, dma_buf, );
~~~^
1 error generated.

(v2) Set the correct bo_flags based on support of 48bit addresses and soft-pin

Fixes: b0d50247a7 ("anv/allocator: Set the BO flags in bo_cache_alloc/import")
Fixes: e7d0378bd9 ("anv: Soft-pin client-allocated memory")
Signed-off-by: Mauro Rossi 
---
 src/intel/vulkan/anv_android.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c
index 7e07dbaaa4..8611e77b82 100644
--- a/src/intel/vulkan/anv_android.c
+++ b/src/intel/vulkan/anv_android.c
@@ -128,7 +128,13 @@ anv_image_from_gralloc(VkDevice device_h,
 */
int dma_buf = gralloc_info->handle->data[0];
 
-   result = anv_bo_cache_import(device, >bo_cache, dma_buf, );
+   uint64_t bo_flags = 0;
+   if (device->instance->physicalDevice.supports_48bit_addresses)
+  bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+   if (device->instance->physicalDevice.use_softpin)
+  bo_flags |= EXEC_OBJECT_PINNED;
+
+   result = anv_bo_cache_import(device, >bo_cache, dma_buf, bo_flags, 
);
if (result != VK_SUCCESS) {
   return vk_errorf(device->instance, device, result,
"failed to import dma-buf from VkNativeBufferANDROID");
-- 
2.17.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] anv/android: Set the BO flags in bo_cache_import (v2)

2018-06-03 Thread Mauro Rossi
Changes to avoid building error:

external/mesa/src/intel/vulkan/anv_android.c:131:72:
error: too few arguments to function call, expected 5, have 4
   result = anv_bo_cache_import(device, >bo_cache, dma_buf, );
~~~^
1 error generated.

(v2) Set the correct bo_flags based on support of 48bit addresses and soft-pin

Fixes: b0d50247a7 ("anv/allocator: Set the BO flags in bo_cache_alloc/import")
Fixes: e7d0378bd9 ("anv: Soft-pin client-allocated memory")
Signed-off-by: Mauro Rossi 
---
 src/intel/vulkan/anv_android.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c
index 7e07dbaaa4..6e4d5a6d27 100644
--- a/src/intel/vulkan/anv_android.c
+++ b/src/intel/vulkan/anv_android.c
@@ -128,7 +128,13 @@ anv_image_from_gralloc(VkDevice device_h,
 */
int dma_buf = gralloc_info->handle->data[0];
 
-   result = anv_bo_cache_import(device, >bo_cache, dma_buf, );
+   uint64_t bo_flags = 0;
+   if (device->instance->physicalDevice.supports_48bit_addresses)
+  bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+   if (device->instance->physicalDevice.use_softpin)
+  bo_flags |= EXEC_OBJECT_PINNED;
+
+   result = anv_bo_cache_import(device, >bo_cache, dma_buf, bo_flags, 
);
if (result != VK_SUCCESS) {
   return vk_errorf(device->instance, device, result,
"failed to import dma-buf from VkNativeBufferANDROID");
-- 
2.17.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] anv/android: Set the BO flags in bo_cache_import

2018-06-03 Thread Mauro Rossi
Hi there,

2018-06-03 21:52 GMT+02:00 Lionel Landwerlin 
:

> On 03/06/18 19:41, Mauro Rossi wrote:
>
>> Change to avoid building error:
>>
>> external/mesa/src/intel/vulkan/anv_android.c:131:72:
>> error: too few arguments to function call, expected 5, have 4
>> result = anv_bo_cache_import(device, >bo_cache, dma_buf, );
>>  ~~~^
>> 1 error generated.
>>
>> Fixes: b0d50247a7 ("anv/allocator: Set the BO flags in
>> bo_cache_alloc/import")
>> Signed-off-by: Mauro Rossi 
>> ---
>>   src/intel/vulkan/anv_android.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/intel/vulkan/anv_android.c
>> b/src/intel/vulkan/anv_android.c
>> index 7e07dbaaa4..ed5da5b537 100644
>> --- a/src/intel/vulkan/anv_android.c
>> +++ b/src/intel/vulkan/anv_android.c
>> @@ -128,7 +128,7 @@ anv_image_from_gralloc(VkDevice device_h,
>>   */
>>  int dma_buf = gralloc_info->handle->data[0];
>>   -   result = anv_bo_cache_import(device, >bo_cache, dma_buf,
>> );
>> +   result = anv_bo_cache_import(device, >bo_cache, dma_buf, 0,
>> );
>>
>
> If you look at anv_intel.c here are the flags that we use :
>
>uint64_t bo_flags = 0;
>if (device->instance->physicalDevice.supports_48bit_addresses)
>   bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
>
> I'm pretty sure we want the same, potentially also the async flag?


Please I need review on the correctness or improvements,
because I just put 0 as bo_flags as a deduction based on similar change
in src/intel/vulkan/anv_queue.c where in anv_bo_cache_import() call the
bo_flag was set to 0

Thanks
M.


>
>
>  if (result != VK_SUCCESS) {
>> return vk_errorf(device->instance, device, result,
>>  "failed to import dma-buf from
>> VkNativeBufferANDROID");
>>
>
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


  1   2   3   4   >