<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 26, 2017 at 10:56 AM, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I think this will break r600 clover support. I don't know if anybody uses it.<span class="HOEnZb"><font color="#888888"><br></font></span></div></div></blockquote><div><br></div><div>I just rebuild my desktop a month ago with a new Ryzen setup, which means that my BARTS is actually in my old machine now. WIth the open-source release of the OpenCL CTS last week, I had actually been hoping to make some progress on r600g/radeonsi clover/libclc in the near future. It'd be a shame to remove that support from r600g right now. Note that I haven't tested this patch yet, so I can't say whether this has broken anything at this point in time.<br><br></div><div>--Aaron<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">Marek<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 26, 2017 at 5:32 PM, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Emil Velikov <<a href="mailto:emil.velikov@collabora.com" target="_blank">emil.velikov@collabora.com</a>><br>
<br>
The code hasn't bee en touched in a very long time, and was never<br>
completed.<br>
<br>
It is conditionally built only when OpenCL is selected at built time,<br>
and pulls the libamd_common static library, which in itself depends on<br>
amdgpu.<br>
<br>
With later commit(s) we'll address the amdgpu dependency, but for now<br>
drop this partial code. If anyone is interested in reviving and beating<br>
it into shape they are welcome to git revert.<br>
<br>
Cc: Nicolai Hähnle <<a href="mailto:nicolai.haehnle@amd.com" target="_blank">nicolai.haehnle@amd.com</a>><br>
Cc: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
Signed-off-by: Emil Velikov <<a href="mailto:emil.velikov@collabora.com" target="_blank">emil.velikov@collabora.com</a>><br>
---<br>
src/gallium/drivers/r600/Make<wbr><a href="http://file.am">file.am</a> | 5 --<br>
src/gallium/drivers/r600/ever<wbr>green_compute.c | 90 ----------------------<br>
.../drivers/r600/evergreen_co<wbr>mpute_internal.h | 7 --<br>
src/gallium/drivers/radeon/r6<wbr>00_pipe_common.h | 2 -<br>
4 files changed, 104 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/r600/Mak<wbr><a href="http://efile.am">efile.am</a> b/src/gallium/drivers/r600/Mak<wbr><a href="http://efile.am">efile.am</a><br>
index 21762d838d0..127e7424b74 100644<br>
--- a/src/gallium/drivers/r600/Mak<wbr><a href="http://efile.am">efile.am</a><br>
+++ b/src/gallium/drivers/r600/Mak<wbr><a href="http://efile.am">efile.am</a><br>
@@ -25,11 +25,6 @@ AM_CFLAGS += \<br>
<br>
endif<br>
<br>
-if HAVE_GALLIUM_COMPUTE<br>
-AM_CFLAGS += \<br>
- -DHAVE_OPENCL<br>
-endif<br>
-<br>
EXTRA_DIST = \<br>
sb/notes.markdown \<br>
sb/sb_bc_fmt_def.inc<br>
diff --git a/src/gallium/drivers/r600/eve<wbr>rgreen_compute.c b/src/gallium/drivers/r600/eve<wbr>rgreen_compute.c<br>
index 37ef1058d3f..45df11296c6 100644<br>
--- a/src/gallium/drivers/r600/eve<wbr>rgreen_compute.c<br>
+++ b/src/gallium/drivers/r600/eve<wbr>rgreen_compute.c<br>
@@ -26,7 +26,6 @@<br>
<br>
#include <stdio.h><br>
#include <errno.h><br>
-#include "ac_binary.h"<br>
#include "pipe/p_defines.h"<br>
#include "pipe/p_state.h"<br>
#include "pipe/p_context.h"<br>
@@ -172,65 +171,6 @@ static void evergreen_cs_set_constant_buff<wbr>er(struct r600_context *rctx,<br>
rctx->b.b.set_constant_buffer(<wbr>&rctx->b.b, PIPE_SHADER_COMPUTE, cb_index, &cb);<br>
}<br>
<br>
-/* We need to define these R600 registers here, because we can't include<br>
- * evergreend.h and r600d.h.<br>
- */<br>
-#define R_028868_SQ_PGM_RESOURCES_VS 0x028868<br>
-#define R_028850_SQ_PGM_RESOURCES_PS 0x028850<br>
-<br>
-#ifdef HAVE_OPENCL<br>
-<br>
-static void r600_shader_binary_read_config<wbr>(const struct ac_shader_binary *binary,<br>
- struct r600_bytecode *bc,<br>
- uint64_t symbol_offset,<br>
- boolean *use_kill)<br>
-{<br>
- unsigned i;<br>
- const unsigned char *config =<br>
- ac_shader_binary_config_<wbr>start(binary, symbol_offset);<br>
-<br>
- for (i = 0; i < binary->config_size_per_symbol<wbr>; i+= 8) {<br>
- unsigned reg =<br>
- util_le32_to_cpu(*(uint32_t*)<wbr>(config + i));<br>
- unsigned value =<br>
- util_le32_to_cpu(*(uint32_t*)<wbr>(config + i + 4));<br>
- switch (reg) {<br>
- /* R600 / R700 */<br>
- case R_028850_SQ_PGM_RESOURCES_PS:<br>
- case R_028868_SQ_PGM_RESOURCES_VS:<br>
- /* Evergreen / Northern Islands */<br>
- case R_028844_SQ_PGM_RESOURCES_PS:<br>
- case R_028860_SQ_PGM_RESOURCES_VS:<br>
- case R_0288D4_SQ_PGM_RESOURCES_LS:<br>
- bc->ngpr = MAX2(bc->ngpr, G_028844_NUM_GPRS(value));<br>
- bc->nstack = MAX2(bc->nstack, G_028844_STACK_SIZE(value));<br>
- break;<br>
- case R_02880C_DB_SHADER_CONTROL:<br>
- *use_kill = G_02880C_KILL_ENABLE(value);<br>
- break;<br>
- case R_0288E8_SQ_LDS_ALLOC:<br>
- bc->nlds_dw = value;<br>
- break;<br>
- }<br>
- }<br>
-}<br>
-<br>
-static unsigned r600_create_shader(struct r600_bytecode *bc,<br>
- const struct ac_shader_binary *binary,<br>
- boolean *use_kill)<br>
-<br>
-{<br>
- assert(binary->code_size % 4 == 0);<br>
- bc->bytecode = CALLOC(1, binary->code_size);<br>
- memcpy(bc->bytecode, binary->code, binary->code_size);<br>
- bc->ndw = binary->code_size / 4;<br>
-<br>
- r600_shader_binary_read_confi<wbr>g(binary, bc, 0, use_kill);<br>
- return 0;<br>
-}<br>
-<br>
-#endif<br>
-<br>
static void r600_destroy_shader(struct r600_bytecode *bc)<br>
{<br>
FREE(bc->bytecode);<br>
@@ -241,27 +181,6 @@ static void *evergreen_create_compute_stat<wbr>e(struct pipe_context *ctx,<br>
{<br>
struct r600_context *rctx = (struct r600_context *)ctx;<br>
struct r600_pipe_compute *shader = CALLOC_STRUCT(r600_pipe_comput<wbr>e);<br>
-#ifdef HAVE_OPENCL<br>
- const struct pipe_llvm_program_header *header;<br>
- const char *code;<br>
- void *p;<br>
- boolean use_kill;<br>
-<br>
- COMPUTE_DBG(rctx->screen, "*** evergreen_create_compute_state<wbr>\n");<br>
- header = cso->prog;<br>
- code = cso->prog + sizeof(struct pipe_llvm_program_header);<br>
- radeon_shader_binary_init(&sh<wbr>ader->binary);<br>
- ac_elf_read(code, header->num_bytes, &shader->binary);<br>
- r600_create_shader(&shader->b<wbr>c, &shader->binary, &use_kill);<br>
-<br>
- /* Upload code + ROdata */<br>
- shader->code_bo = r600_compute_buffer_alloc_vram<wbr>(rctx->screen,<br>
- shader->bc.ndw * 4);<br>
- p = r600_buffer_map_sync_with_ring<wbr>s(&rctx->b, shader->code_bo, PIPE_TRANSFER_WRITE);<br>
- //TODO: use util_memcpy_cpu_to_le32 ?<br>
- memcpy(p, shader->bc.bytecode, shader->bc.ndw * 4);<br>
- rctx->b.ws->buffer_unmap(shad<wbr>er->code_bo->buf);<br>
-#endif<br>
<br>
shader->ctx = rctx;<br>
shader->local_size = cso->req_local_mem;<br>
@@ -589,15 +508,6 @@ static void evergreen_launch_grid(struct pipe_context *ctx,<br>
const struct pipe_grid_info *info)<br>
{<br>
struct r600_context *rctx = (struct r600_context *)ctx;<br>
-#ifdef HAVE_OPENCL<br>
- struct r600_pipe_compute *shader = rctx->cs_shader_state.shader;<br>
- boolean use_kill;<br>
-<br>
- rctx->cs_shader_state.pc = info->pc;<br>
- /* Get the config information for this kernel. */<br>
- r600_shader_binary_read_confi<wbr>g(&shader->binary, &shader->bc,<br>
- info->pc, &use_kill);<br>
-#endif<br>
<br>
COMPUTE_DBG(rctx->screen, "*** evergreen_launch_grid: pc = %u\n", info->pc);<br>
<br>
diff --git a/src/gallium/drivers/r600/eve<wbr>rgreen_compute_internal.h b/src/gallium/drivers/r600/eve<wbr>rgreen_compute_internal.h<br>
index 6f4be3ea57f..4c1bed909ec 100644<br>
--- a/src/gallium/drivers/r600/eve<wbr>rgreen_compute_internal.h<br>
+++ b/src/gallium/drivers/r600/eve<wbr>rgreen_compute_internal.h<br>
@@ -26,9 +26,6 @@<br>
#define EVERGREEN_COMPUTE_INTERNAL_H<br>
<br>
#include "r600_asm.h"<br>
-#ifdef HAVE_OPENCL<br>
-#include <llvm-c/Core.h><br>
-#endif<br>
<br>
struct r600_pipe_compute {<br>
struct r600_context *ctx;<br>
@@ -41,10 +38,6 @@ struct r600_pipe_compute {<br>
unsigned private_size;<br>
unsigned input_size;<br>
struct r600_resource *kernel_param;<br>
-<br>
-#ifdef HAVE_OPENCL<br>
- LLVMContextRef llvm_ctx;<br>
-#endif<br>
};<br>
<br>
struct r600_resource* r600_compute_buffer_alloc_vram<wbr>(struct r600_screen *screen, unsigned size);<br>
diff --git a/src/gallium/drivers/radeon/r<wbr>600_pipe_common.h b/src/gallium/drivers/radeon/r<wbr>600_pipe_common.h<br>
index b17b690faba..1fbd79d23b4 100644<br>
--- a/src/gallium/drivers/radeon/r<wbr>600_pipe_common.h<br>
+++ b/src/gallium/drivers/radeon/r<wbr>600_pipe_common.h<br>
@@ -34,8 +34,6 @@<br>
<br>
#include <stdio.h><br>
<br>
-#include "amd/common/ac_binary.h"<br>
-<br>
#include "radeon/radeon_winsys.h"<br>
<br>
#include "util/disk_cache.h"<br>
<span class="m_-924580592874073067HOEnZb"><font color="#888888">--<br>
2.12.2<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
<br></blockquote></div><br></div></div>