<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 1, 2017 at 3:28 PM, Jan Vesely <span dir="ltr"><<a href="mailto:jan.vesely@rutgers.edu" target="_blank">jan.vesely@rutgers.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-off-by: Jan Vesely <<a href="mailto:jan.vesely@rutgers.edu">jan.vesely@rutgers.edu</a>><br>
---<br>
Hi guys,<br>
<br>
this is the first step towards dropping libamd_common dependency.<br>
It's based on Emil's patches 3/5 and 4/5.<br>
Enabling opencl still falls back to the old way of requiring libamd_common.<br>
I'll try to address that in the next step (no time estimate, feel free to beat me to it). I think we can drop part of those functions rather than just copying them.<br></blockquote><div><br></div><div>I did a build test of r600 on my laptop with an old libdrm before/after this patch with/without opencl enabled, and got:<br></div><div>before, no CL: Build Failure<br>after, no CL: Build succeeded<br>before, with CL:  <span class="gmail-">Build Failure<br>after, with CL: Build Failure<br><br></span></div><div><span class="gmail-">I then went and updated libdrm/amdgpu, and the with/without CL build for r600 works again there.  I then built this on my r600 box and double-checked that clinfo and piglit's cl-program-tester ran and could execute a simple kernel (tests/cl/program/execute/builtin/geometric/<a href="http://length.cl">length.cl</a>), so I'd say that this is:<br></span></div><div><span class="gmail-">Tested-By: Aaron Watry <<a href="mailto:awatry@gmail.com">awatry@gmail.com</a>><br><br></span></div><div><span class="gmail-">And yes, I agree that we should remove the amdgpu dependency from libamd_common (or at least the parts that r600 depends on), but I'd be ok with doing that in a follow-up... That, or we also extend vinson's patch [0] and wrap it in a check for if opencl is enabled so that we get a configure-time failure if R600 is being built with CL and amdgpu's drm headers are missing/old.<br><br></span></div><div><span class="gmail-">--Aaron<br></span></div><div><span class="gmail-"><br>[0] <a href="https://lists.freedesktop.org/archives/mesa-dev/2017-May/157327.html">https://lists.freedesktop.org/archives/mesa-dev/2017-May/157327.html</a><br></span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Emil, I didn't find anything in android build that enabled opencl, so I dropped it entirely.<br>
<br>
regards,<br>
Jan<br>
<br>
 <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>                                | 3 ++-<br>
 src/gallium/drivers/r600/<wbr>Android.mk         | 5 -----<br>
 src/gallium/drivers/r600/<wbr>Automake.inc       | 2 +-<br>
 src/gallium/targets/pipe-<wbr>loader/Makefile.am | 2 +-<br>
 4 files changed, 4 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
index 5caf316..e0996a0 100644<br>
--- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
@@ -2631,7 +2631,8 @@ AM_CONDITIONAL(HAVE_SWRAST_<wbr>DRI, test x$HAVE_SWRAST_DRI = xyes)<br>
 AM_CONDITIONAL(HAVE_RADEON_<wbr>VULKAN, test "x$HAVE_RADEON_VULKAN" = xyes)<br>
 AM_CONDITIONAL(HAVE_INTEL_<wbr>VULKAN, test "x$HAVE_INTEL_VULKAN" = xyes)<br>
<br>
-AM_CONDITIONAL(HAVE_AMD_<wbr>DRIVERS, test "x$HAVE_GALLIUM_R600" = xyes -o \<br>
+AM_CONDITIONAL(HAVE_AMD_<wbr>DRIVERS, test \( "x$HAVE_GALLIUM_R600" = xyes -a \<br>
+                                      "x$enable_opencl" = xyes \) -o \<br>
                                       "x$HAVE_GALLIUM_RADEONSI" = xyes -o \<br>
                                       "x$HAVE_RADEON_VULKAN" = xyes)<br>
<br>
diff --git a/src/gallium/drivers/r600/<wbr>Android.mk b/src/gallium/drivers/r600/<wbr>Android.mk<br>
index 87f433d..18c5bb6 100644<br>
--- a/src/gallium/drivers/r600/<wbr>Android.mk<br>
+++ b/src/gallium/drivers/r600/<wbr>Android.mk<br>
@@ -30,11 +30,7 @@ include $(CLEAR_VARS)<br>
<br>
 LOCAL_SRC_FILES := $(C_SOURCES) $(CXX_SOURCES)<br>
<br>
-ifeq ($(MESA_ENABLE_LLVM),true)<br>
-LOCAL_STATIC_LIBRARIES := libmesa_amd_common<br>
-else<br>
 LOCAL_C_INCLUDES += $(MESA_TOP)/src/amd/common<br>
-endif<br>
<br>
 LOCAL_SHARED_LIBRARIES := libdrm_radeon<br>
 LOCAL_MODULE := libmesa_pipe_r600<br>
@@ -45,7 +41,6 @@ include $(BUILD_STATIC_LIBRARY)<br>
 ifneq ($(HAVE_GALLIUM_R600),)<br>
 $(eval GALLIUM_LIBS += \<br>
        $(LOCAL_MODULE) \<br>
-       $(LOCAL_STATIC_LIBRARIES) \<br>
        libmesa_winsys_radeon)<br>
 $(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))<br>
 endif<br>
diff --git a/src/gallium/drivers/r600/<wbr>Automake.inc b/src/gallium/drivers/r600/<wbr>Automake.inc<br>
index fa45735..c96fe74 100644<br>
--- a/src/gallium/drivers/r600/<wbr>Automake.inc<br>
+++ b/src/gallium/drivers/r600/<wbr>Automake.inc<br>
@@ -13,7 +13,7 @@ TARGET_RADEON_WINSYS = \<br>
 TARGET_RADEON_COMMON = \<br>
        $(top_builddir)/src/gallium/<wbr>drivers/radeon/<a href="http://libradeon.la" rel="noreferrer" target="_blank">libradeon.la</a><br>
<br>
-if HAVE_GALLIUM_LLVM<br>
+if HAVE_AMD_DRIVERS<br>
 TARGET_RADEON_COMMON += \<br>
        $(top_builddir)/src/amd/<wbr>common/<a href="http://libamd_common.la" rel="noreferrer" target="_blank">libamd_common.la</a><br>
 endif<br>
diff --git a/src/gallium/targets/pipe-<wbr>loader/Makefile.am b/src/gallium/targets/pipe-<wbr>loader/Makefile.am<br>
index 5f629a2..c991533 100644<br>
--- a/src/gallium/targets/pipe-<wbr>loader/Makefile.am<br>
+++ b/src/gallium/targets/pipe-<wbr>loader/Makefile.am<br>
@@ -131,7 +131,7 @@ pipe_r600_la_LIBADD = \<br>
        $(LIBDRM_LIBS) \<br>
        $(RADEON_LIBS)<br>
<br>
-if HAVE_GALLIUM_LLVM<br>
+if HAVE_AMD_DRIVERS<br>
 pipe_r600_la_LIBADD += \<br>
        $(top_builddir)/src/amd/<wbr>common/<a href="http://libamd_common.la" rel="noreferrer" target="_blank">libamd_common.la</a><br>
 endif<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
2.9.4<br>
<br>
</font></span></blockquote></div><br></div></div>