[Mesa-dev] radv: use rtld for shader uploads

2019-07-01 Thread Nicolai Hähnle-Montoro
Hey folks, the merge request at https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1220 moves radv to using the rtld for shader uploads for parity with radeonsi and to address some issues that arose with changes in LLVM behavior. Please review! Cheers, Nicolai -- Lerne, wie die Welt

[Mesa-dev] [PATCH] amd/rtld: update the ELF representation of LDS symbols

2019-06-16 Thread Nicolai Hähnle
From: Nicolai Hähnle The initial prototype used a processor-specific symbol type, but feedback suggests that an approach using processor-specific section name that encodes the alignment analogous to SHN_COMMON symbols is preferred. This patch keeps both variants around for now to reduce

Re: [Mesa-dev] amd/common: derive register headers and ac_debug from a JSON database

2019-05-13 Thread Nicolai Hähnle
By the way: Yes, I'm aware that other "database" formats are in use in Mesa either directly or indirectly, but for various reasons it wasn't easily possible to reuse the corresponding code. On 13.05.19 23:26, Nicolai Hähnle wrote: Hi all, this series moves to a description of

[Mesa-dev] amd/common: derive register headers and ac_debug from a JSON database

2019-05-13 Thread Nicolai Hähnle
Hi all, this series moves to a description of registers in a JSON file as the single source of truth for register descriptions. Both register headers and the tables used for decoding command buffers for debugging are derived from this JSON description at build time. This should make

[Mesa-dev] [PATCH 4/4] radeonsi: add radeonsi_debug_disassembly option

2019-05-13 Thread Nicolai Hähnle
From: Nicolai Hähnle This dumps disassembly to the pipe_debug_callback together with shader stats. Can be used together with shader-db to get full disassembly of all shaders in the database. --- src/gallium/drivers/radeonsi/si_debug_options.h | 1 + src/gallium/drivers/radeonsi/si_shader.c

[Mesa-dev] [PATCH 3/4] radeonsi: fix line splitting in si_shader_dump_assembly

2019-05-13 Thread Nicolai Hähnle
From: Nicolai Hähnle Compute the count since the start of the current line instead of the count since the start of the the disassembly. --- src/gallium/drivers/radeonsi/si_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b

[Mesa-dev] [PATCH 1/4] amd/common: use ARRAY_SIZE for the LLVM command line options

2019-05-13 Thread Nicolai Hähnle
From: Nicolai Hähnle This is more convenient for changing it around during debug. --- src/amd/common/ac_llvm_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c index 69446863b95..16c1b25d8c2 100644

[Mesa-dev] [PATCH 2/4] radeonsi: cleanup some #includes

2019-05-13 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 59d50376438..b31a2f6428a 100644 --- a/src/gallium/drivers

[Mesa-dev] [PATCH v2 3/3] u_dynarray: turn util_dynarray_{grow, resize} into element-oriented macros

2019-05-13 Thread Nicolai Hähnle
From: Nicolai Hähnle The main motivation for this change is API ergonomics: most operations on dynarrays are really on elements, not on bytes, so it's weird to have grow and resize as the odd operations out. The secondary motivation is memory safety. Users of the old byte-oriented functions

[Mesa-dev] [PATCH v2 2/3] u_dynarray: return 0 on realloc failure and ensure no-op

2019-05-13 Thread Nicolai Hähnle
From: Nicolai Hähnle We're not very good at handling out-of-memory conditions in general, but this change at least gives the caller the option of handling it gracefully and without memory leaks. This happens to fix an error in out-of-memory handling in i965, which has the following code

[Mesa-dev] [PATCH v2 0/3] u_dynarray: minor API cleanups

2019-05-13 Thread Nicolai Hähnle
Hi all, after reflecting on the comments a bit more, here's a v2 of the series in which resize and grow are no-ops on reallocation failure, but get MUST_CHECK attributes so that the compiler warns if the return value isn't used. It seems like almost all callers are well-behaved, except for a few

[Mesa-dev] [PATCH v2 1/3] freedreno: use util_dynarray_clear instead of util_dynarray_resize(_, 0)

2019-05-13 Thread Nicolai Hähnle
From: Nicolai Hähnle This is more expressive and simplifies a subsequent change. v2: - fix one more call-site after rebase --- src/gallium/drivers/freedreno/a2xx/fd2_gmem.c | 12 ++-- src/gallium/drivers/freedreno/a3xx/fd3_gmem.c | 4 ++-- src/gallium/drivers/freedreno/a4xx/fd4_gmem.c

[Mesa-dev] [PATCH 1/6] radeonsi: inline si_shader_binary_read_config into its only caller

2019-05-04 Thread Nicolai Hähnle
From: Nicolai Hähnle Since it can only be used for reading the config of an individual, non-combined shader, it is not very reusable anyway. --- src/gallium/drivers/radeonsi/si_shader.c | 21 +++-- src/gallium/drivers/radeonsi/si_shader.h | 2 -- 2 files changed, 7 insertions

[Mesa-dev] [PATCH 0/6] amd,radeonsi: link explicit LDS symbols

2019-05-04 Thread Nicolai Hähnle
this series builds on my recent series adding a runtime linker to now support layout and relocation of explicit LDS symbols. Currently, all our uses of LDS have a single LDS base pointer which is defined either by an inttoptr case from 0 or as a single global LDS symbol. This is fine for our

[Mesa-dev] [PATCH 2/6] amd/rtld: layout and relocate LDS symbols

2019-05-04 Thread Nicolai Hähnle
From: Nicolai Hähnle Upcoming changes to LLVM will emit LDS objects as symbols in the ELF symbol table, with relocations that will be resolved with this change. Callers will also be able to define LDS symbols that are shared between shader parts. This will be used by radeonsi for the ESGS ring

[Mesa-dev] [PATCH 5/6] radeonsi: use an explicit symbol for the LSHS LDS memory

2019-05-04 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_shader.c | 17 +++-- src/gallium/drivers/radeonsi/si_state_draw.c | 5 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi

[Mesa-dev] [PATCH 4/6] radeonsi: rename lds_{load, store} to lshs_lds_{load, store}

2019-05-04 Thread Nicolai Hähnle
From: Nicolai Hähnle These functions are now only used in LS/HS shaders (both separate and merged). --- src/gallium/drivers/radeonsi/si_shader.c | 33 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium

[Mesa-dev] [PATCH 3/6] radeonsi/gfx9: declare LDS ESGS ring as an explicit symbol on LLVM >= 9

2019-05-04 Thread Nicolai Hähnle
From: Nicolai Hähnle This will make it easier to use LDS for other purposes in geometry shaders in the future. The lifetime of the esgs_ring variable is as follows: - declared as [0 x i32] while compiling shader parts or monolithic shaders - just before uploading, gfx9_get_gs_info computes

[Mesa-dev] [PATCH 6/6] radeonsi: raise the alignment of LDS memory for compute shaders

2019-05-04 Thread Nicolai Hähnle
From: Nicolai Hähnle This implies that the memory will always be at address 0, which allows LLVM to generate slightly better code. --- src/gallium/drivers/radeonsi/si_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src

[Mesa-dev] [PATCH 2/3] u_dynarray: return 0 on realloc failure

2019-05-04 Thread Nicolai Hähnle
From: Nicolai Hähnle We're not very good at handling out-of-memory conditions in general, but this change at least gives the caller the option of handling it. This happens to fix an error in out-of-memory handling in i965, which has the following code in brw_bufmgr.c: node

[Mesa-dev] [PATCH 3/3] u_dynarray: turn util_dynarray_{grow, resize} into element-oriented macros

2019-05-04 Thread Nicolai Hähnle
From: Nicolai Hähnle The main motivation for this change is API ergonomics: most operations on dynarrays are really on elements, not on bytes, so it's weird to have grow and resize as the odd operations out. The secondary motivation is memory safety. Users of the old byte-oriented functions

[Mesa-dev] [PATCH 1/3] freedreno: use util_dynarray_clear instead of util_dynarray_resize(_, 0)

2019-05-04 Thread Nicolai Hähnle
From: Nicolai Hähnle This is more expressive and simplifies a subsequent change. --- src/gallium/drivers/freedreno/a2xx/fd2_gmem.c | 12 ++-- src/gallium/drivers/freedreno/a3xx/fd3_gmem.c | 4 ++-- src/gallium/drivers/freedreno/a4xx/fd4_gmem.c | 2 +- src/gallium/drivers/freedreno

[Mesa-dev] [PATCH 0/3] u_dynarray: minor API cleanups

2019-05-04 Thread Nicolai Hähnle
just some small changes that should make util_dynarray more convenient and safer to use. Please review! Thanks, Nicolai -- .../drivers/freedreno/a2xx/fd2_gmem.c| 12 +++--- .../drivers/freedreno/a3xx/fd3_gmem.c| 4 +- .../drivers/freedreno/a4xx/fd4_gmem.c| 2 +-

[Mesa-dev] [PATCH 09/10] radeonsi: don't declare pointers to static strings

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle The compiler should be able to optimize them away, but still. There's no point in declaring those as pointers, and if the compiler *doesn't* optimize them away, they add unnecessary load-time relocations. --- src/gallium/drivers/radeonsi/si_shader.c | 4 ++-- 1 file changed

[Mesa-dev] [PATCH 02/10] amd/common: clarify ac_shader_binary::lds_size

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/amd/common/ac_binary.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/common/ac_binary.h b/src/amd/common/ac_binary.h index febc4da7fed..8f594a9ce75 100644 --- a/src/amd/common/ac_binary.h +++ b/src/amd/common/ac_binary.h @@ -68,21

[Mesa-dev] [PATCH 01/10] amd/common: extract ac_parse_shader_binary_config

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/amd/common/ac_binary.c | 77 +- src/amd/common/ac_binary.h | 4 ++ 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/src/amd/common/ac_binary.c b/src/amd/common/ac_binary.c index fabeb15a204..44251886b5f 100644

[Mesa-dev] [PATCH 06/10] radeonsi: return bool from si_shader_binary_upload

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle We didn't really use error codes anyway. --- src/gallium/drivers/radeonsi/si_compute.c | 6 +++--- src/gallium/drivers/radeonsi/si_shader.c | 21 +-- src/gallium/drivers/radeonsi/si_shader.h | 2 +- .../drivers/radeonsi/si_state_shaders.c

[Mesa-dev] [PATCH 03/10] amd/common: add a more powerful runtime linker

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle Using an explicit linker instead of just concatenating .text sections will allow us to start using .rodata sections and explicit descriptions of data on LDS that is shared between stages. --- src/amd/Makefile.sources | 2 + src/amd/common/ac_binary.h | 2 + src/amd

[Mesa-dev] [PATCH 08/10] amd/common: add ac_compile_module_to_elf

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle A new variant of ac_compile_module_to_binary that allows us to keep the entire ELF around. --- src/amd/common/ac_llvm_helper.cpp | 88 --- src/amd/common/ac_llvm_util.h | 2 + 2 files changed, 83 insertions(+), 7 deletions(-) diff --git

[Mesa-dev] [PATCH 00/10] amd,radeonsi: add a real runtime linker

2019-05-03 Thread Nicolai Hähnle
these patches change the way we load shaders, initially for radeonsi but ideally radv would adopt the same approach. Basically, instead of hard-coding that we have a single .text section in the ELF generated by LLVM, we align ourselves more with the ELF standard and actually look at all the

[Mesa-dev] [PATCH 07/10] radeonsi: dump shader binary buffer contents

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle Help identify bugs related to corruption of shaders in memory, or errors in shader upload / rtld. --- src/gallium/drivers/radeonsi/si_debug.c| 18 ++ .../drivers/radeonsi/si_debug_options.h| 1 + 2 files changed, 19 insertions(+) diff --git

[Mesa-dev] [PATCH 10/10] radeonsi: use the new run-time linker for shaders

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_compute.c | 63 ++-- src/gallium/drivers/radeonsi/si_debug.c | 74 +++-- src/gallium/drivers/radeonsi/si_pipe.c| 2 +- src/gallium/drivers/radeonsi/si_pipe.h| 2 +- src/gallium/drivers/radeonsi/si_shader.c

[Mesa-dev] [PATCH 04/10] radeonsi: use ac_shader_config

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/amd/common/ac_binary.c| 2 + src/gallium/drivers/radeonsi/si_compute.c | 14 +-- src/gallium/drivers/radeonsi/si_shader.c | 112 +++--- src/gallium/drivers/radeonsi/si_shader.h | 25 + 4 files changed, 27 insertions(+), 126

[Mesa-dev] [PATCH 05/10] radeonsi: let si_shader_create return a boolean

2019-05-03 Thread Nicolai Hähnle
From: Nicolai Hähnle We didn't really use error codes anyway. --- src/gallium/drivers/radeonsi/si_compute.c | 2 +- src/gallium/drivers/radeonsi/si_shader.c | 18 +- src/gallium/drivers/radeonsi/si_shader.h | 2 +- .../drivers/radeonsi/si_state_shaders.c

Re: [Mesa-dev] [PATCH 0/3] radeonsi: handle unaligned vertex buffers in hardware

2019-05-03 Thread Nicolai Hähnle
25, 2019 at 7:18 AM Nicolai Hähnle <mailto:nhaeh...@gmail.com>> wrote: Hi all, the following patches contain code to implement all vertex fetches using plain, non-format loads plus explicit shader arithmetic for format conversion. This allows us to remove the

[Mesa-dev] [PATCH 0/3] radeonsi: handle unaligned vertex buffers in hardware

2019-04-25 Thread Nicolai Hähnle
Hi all, the following patches contain code to implement all vertex fetches using plain, non-format loads plus explicit shader arithmetic for format conversion. This allows us to remove the software workaround for unaligned vertex buffers on SI, because we can just load individual bytes on the

[Mesa-dev] [PATCH 2/3] radeonsi: store sctx->vertex_elements in a local in si_shader_selector_key_vs

2019-04-25 Thread Nicolai Hähnle
From: Nicolai Hähnle Purely as a shorthand in the remainder of the function. --- src/gallium/drivers/radeonsi/si_state_shaders.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi

[Mesa-dev] [PATCH 3/3] radeonsi: overhaul the vertex fetch fixup mechanism

2019-04-25 Thread Nicolai Hähnle
From: Nicolai Hähnle The overall goal is to support unaligned loads from vertex buffers natively on SI. In the unaligned case, we fall back to the general case implementation in ac_build_opencoded_load_format. Since this function is fully general, we will also use it going forward for cases

[Mesa-dev] [PATCH 1/3] amd/common: add ac_build_opencoded_fetch_format

2019-04-25 Thread Nicolai Hähnle
From: Nicolai Hähnle Implement software emulation of buffer_load_format for all types required by vertex buffer fetches. --- src/amd/common/ac_llvm_build.c | 313 + src/amd/common/ac_llvm_build.h | 30 2 files changed, 343 insertions(+) diff --git a/src

Re: [Mesa-dev] [PATCH 1/8] radeonsi: add si_debug_options for convenient adding/removing of options

2019-04-25 Thread Nicolai Hähnle
On 25.04.19 04:45, Marek Olšák wrote: [snip] -       bool                            clear_db_cache_before_clear;         bool                            has_msaa_sample_loc_bug;         bool                            has_ls_vgpr_init_bug;         bool                         

[Mesa-dev] [PATCH 7/8] radeonsi: add radeonsi_aux_debug option for aux context debug dumps

2019-04-24 Thread Nicolai Hähnle
From: Nicolai Hähnle Enabling this option will create ddebug-style dumps for the aux context, except that instead of intercepting the pipe_context layer we just dump the IB contents on flush. --- src/gallium/drivers/radeonsi/si_debug.c | 17 + .../drivers/radeonsi

[Mesa-dev] [PATCH 6/8] ddebug: expose some helper functions as non-inline

2019-04-24 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/auxiliary/driver_ddebug/dd_draw.c | 63 +- src/gallium/auxiliary/driver_ddebug/dd_util.h | 66 +++ 2 files changed, 70 insertions(+), 59 deletions(-) diff --git a/src/gallium/auxiliary/driver_ddebug/dd_draw.c b/src/gallium

[Mesa-dev] [PATCH 4/8] ddebug: log calls to pipe->flush

2019-04-24 Thread Nicolai Hähnle
From: Nicolai Hähnle This can be useful when internal draws lead to a hang. --- src/gallium/auxiliary/driver_ddebug/dd_draw.c | 75 ++- src/gallium/auxiliary/driver_ddebug/dd_pipe.h | 6 ++ 2 files changed, 61 insertions(+), 20 deletions(-) diff --git a/src/gallium/auxiliary

[Mesa-dev] [PATCH 5/8] ddebug: dump driver state into a separate file

2019-04-24 Thread Nicolai Hähnle
From: Nicolai Hähnle Due to asynchronous execution, it's not clear which of the draws the state may refer to. This also works around an issue encountered with radeonsi where dumping the driver state itself caused a hang. --- src/gallium/auxiliary/driver_ddebug/dd_draw.c | 17

[Mesa-dev] [PATCH 3/8] ddebug: set thread name

2019-04-24 Thread Nicolai Hähnle
From: Nicolai Hähnle For better debuggability. --- src/gallium/auxiliary/driver_ddebug/dd_draw.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/auxiliary/driver_ddebug/dd_draw.c b/src/gallium/auxiliary/driver_ddebug/dd_draw.c index f5b94356119..4eb0dd096f4 100644

[Mesa-dev] [PATCH 0/8] ddebug, radeonsi: misc changes to help debugging

2019-04-24 Thread Nicolai Hähnle
Hi folks, this is a collection of assorted patches that should help with driver debugging: - add driconf-style debug options in a convenient way - some minor ddebug cleanups - allow dumping aux context command streams - allow force-syncing of compile threads Please review! Thanks, Nicolai --

[Mesa-dev] [PATCH 8/8] radeonsi: add radeonsi_sync_compile option

2019-04-24 Thread Nicolai Hähnle
From: Nicolai Hähnle Force the driver thread to sync immediately with a compiler thread (but compilation still happens in a separate thread). This can be useful to simplify debugging compiler issues. --- src/gallium/drivers/radeonsi/si_debug_options.inc | 1 + src/gallium/drivers/radeonsi

[Mesa-dev] [PATCH 2/8] util/u_log: flush auto loggers before starting a new page

2019-04-24 Thread Nicolai Hähnle
From: Nicolai Hähnle Without this, command stream dumps of radeonsi may misleadingly end up in a later page. --- src/gallium/auxiliary/util/u_log.c | 4 1 file changed, 4 insertions(+) diff --git a/src/gallium/auxiliary/util/u_log.c b/src/gallium/auxiliary/util/u_log.c index 90fd24ca394

[Mesa-dev] [PATCH 1/8] radeonsi: add si_debug_options for convenient adding/removing of options

2019-04-24 Thread Nicolai Hähnle
From: Nicolai Hähnle Move the definition of radeonsi_clear_db_cache_before_clear there, as well as radeonsi_enable_nir. This removes the AMD_DEBUG=nir option. We currently still have two places for options: the driconf machinery and AMD_DEBUG/R600_DEBUG. If we are to have a single place

Re: [Mesa-dev] [PATCH 1/2] radeonsi: always use compute rings for clover on CI and newer

2019-02-12 Thread Nicolai Hähnle
On 11.02.19 21:27, Marek Olšák wrote: From: Marek Olšák initialize all non-compute context functions to NULL. --- src/gallium/drivers/radeonsi/si_blit.c| 14 ++- src/gallium/drivers/radeonsi/si_clear.c | 7 +- src/gallium/drivers/radeonsi/si_compute.c | 15 +--

Re: [Mesa-dev] [PATCH 2/2] radeonsi: use MEM instead of MEM_GRBM in COPY_DATA.DST_SEL

2019-02-12 Thread Nicolai Hähnle
Both patches: Reviewed-by: Nicolai Hähnle On 11.02.19 21:26, Marek Olšák wrote: From: Marek Olšák --- src/gallium/drivers/radeonsi/si_perfcounter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_perfcounter.c b/src/gallium

Re: [Mesa-dev] [PATCH 4/4] radeonsi: use SDMA for uploading data through const_uploader

2019-02-11 Thread Nicolai Hähnle
On 07.02.19 02:22, Marek Olšák wrote: + bool use_sdma_upload = sscreen->info.has_dedicated_vram && sctx->dma_cs && debug_get_bool_option("SDMA", true); Could you please namespace the environment variable, e.g. RADEONSI_SDMA? Apart from that, series

Re: [Mesa-dev] [PATCH 6/6] winsys/amdgpu: cs_check_space sets the minimum IB size for future IBs

2019-02-11 Thread Nicolai Hähnle
For the series: Reviewed-by: Nicolai Hähnle On 06.02.19 22:20, Marek Olšák wrote: From: Marek Olšák --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 18 -- src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 7 +++ 2 files changed, 23 insertions(+), 2 deletions(-) diff

Re: [Mesa-dev] [PATCH 2/2] radeonsi: fix EXPLICIT_FLUSH for flush offsets > 0

2019-02-11 Thread Nicolai Hähnle
Both patches: Reviewed-by: Nicolai Hähnle On 06.02.19 22:12, Marek Olšák wrote: From: Marek Olšák Cc: 18.3 19.0 --- src/gallium/drivers/radeonsi/si_buffer.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium

Re: [Mesa-dev] [PATCH 5/5] radeonsi: use local ws variable in si_need_dma_space

2019-02-05 Thread Nicolai Hähnle
For the series: Reviewed-by: Nicolai Hähnle On 31.01.19 19:56, Marek Olšák wrote: From: Marek Olšák --- src/gallium/drivers/radeonsi/si_dma_cs.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_dma_cs.c b/src

[Mesa-dev] [PATCH] amd/surface: provide firstMipIdInTail for metadata surface calculations

2019-02-05 Thread Nicolai Hähnle
From: Nicolai Hähnle This field was added in a recent addrlib update, and while there currently seems to be no issue with skipping it, we will have to set it correctly in the future. --- src/amd/common/ac_surface.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/amd/common

[Mesa-dev] [PATCH] meson: link LLVM 'native' component when LLVM is available

2019-02-04 Thread Nicolai Hähnle
From: Nicolai Hähnle It is required for the draw module, and makes a difference when linking statically or against LLVM built with BUILD_SHARED_LIBS=ON. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index bfff862c3c8..e955bdedcc6

Re: [Mesa-dev] [PATCH 23/25] radeonsi: factor si_query_buffer logic out of si_query_hw

2019-02-04 Thread Nicolai Hähnle
an Arkham City     benchmark.     On 7/12/18 1:00 am, Nicolai Hähnle wrote: > From: Nicolai Hähnle mailto:nicolai.haeh...@amd.com>> > > This is a move towards using composition instead of inheritance for > different query types. > > This c

Re: [Mesa-dev] [PATCH 23/25] radeonsi: factor si_query_buffer logic out of si_query_hw

2019-02-04 Thread Nicolai Hähnle
, Marek On Wed, Jan 2, 2019 at 10:58 PM Timothy Arceri <mailto:tarc...@itsqueeze.com>> wrote: This commit seems to cause bad stuttering in the Batman Arkham City benchmark. On 7/12/18 1:00 am, Nicolai Hähnle wrote: > From: Nicolai Hähnle mailto:nicolai.hae

[Mesa-dev] [PATCH 2/2] amd/common/vi+: enable SMEM loads with GLC=1

2019-01-10 Thread Nicolai Hähnle
From: Nicolai Hähnle Only on LLVM 8.0+, which supports the new intrinsic. --- src/amd/common/ac_llvm_build.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 4d7f15901e3..6aa96ee86d4 100644

[Mesa-dev] [PATCH 1/2] amd/common: use llvm.amdgcn.s.buffer.load for LLVM 8.0

2019-01-10 Thread Nicolai Hähnle
From: Nicolai Hähnle llvm.SI.load.const is deprecated. --- src/amd/common/ac_llvm_build.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 76047148a6a..4d7f15901e3 100644 --- a/src/amd/common

Re: [Mesa-dev] [PATCH] winsys/amdgpu: Pull in LLVM CFLAGS

2018-12-19 Thread Nicolai Hähnle
On 19.12.18 16:05, Michel Dänzer wrote: From: Michel Dänzer Fixes build failure if the LLVM headers aren't in a standard include directory. Huh, interesting that I didn't run into this. Anyway: Reviewed-by: Nicolai Hähnle Fixes: ec22dd34c88f "radeonsi: move SI_FORCE_F

Re: [Mesa-dev] last call for autotools

2018-12-18 Thread Nicolai Hähnle
On 17.12.18 23:46, Dylan Baker wrote: Quoting Marek Olšák (2018-12-17 12:25:29) On Mon, Dec 17, 2018 at 1:18 PM Eric Anholt wrote: Eero Tamminen writes: > Hi, > > On 17.12.2018 8.08, Marek Olšák wrote: > [...] >> I think one of the serious usability issues is

[Mesa-dev] [PATCH] amd/surface: fix setting of ADDR2_SURFACE_FLAGS::color

2018-12-18 Thread Nicolai Hähnle
From: Nicolai Hähnle In the gfx9 addrlib, this bit has been clarified as meaning that the surface can be used as a color buffer (render target). Setting this for compressed surfaces triggers a workaround that is only required for surfaces that can be render targets, and ends up breaking the 16

Re: [Mesa-dev] [PATCH v2] docs: Document GitLab merge request process (email alternative)

2018-12-06 Thread Nicolai Hähnle
On 06.12.18 00:32, Jordan Justen wrote: This documents a process for using GitLab Merge Requests as an second way to submit code changes for Mesa. Only one of the two methods is allowed for each patch series. We will *not* require all patches to be emailed. Some code changes may be reviewed and

[Mesa-dev] [PATCH 22/25] radeonsi: move query suspend logic into the top-level si_query struct

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_perfcounter.c | 13 ++-- src/gallium/drivers/radeonsi/si_query.c | 75 ++- src/gallium/drivers/radeonsi/si_query.h | 18 +++-- 3 files changed, 62 insertions(+), 44 deletions(-) diff --git a/src/gallium

[Mesa-dev] [PATCH 24/25] radeonsi: split perfcounter queries from si_query_hw

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle Remove a level of indirection to make the code more explicit -- should make it easier to follow what's going on. --- src/gallium/drivers/radeonsi/si_perfcounter.c | 143 -- 1 file changed, 93 insertions(+), 50 deletions(-) diff --git a/src/gallium/drivers

[Mesa-dev] [PATCH 20/25] radeonsi: track constant buffer bind history in si_pipe_set_constant_buffer

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle Other callers of si_set_constant_buffer don't need it. --- src/gallium/drivers/radeonsi/si_descriptors.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c

[Mesa-dev] [PATCH 21/25] radeonsi: move remaining perfcounter code into si_perfcounter.c

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeon/r600_perfcounter.c | 639 src/gallium/drivers/radeonsi/Makefile.sources | 1 - src/gallium/drivers/radeonsi/meson.build | 1 - src/gallium/drivers/radeonsi/si_perfcounter.c | 688 -- src/gallium

[Mesa-dev] [PATCH 17/25] radeonsi: avoid using hard-coded SI_NUM_RW_BUFFERS

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index 22019741d80..fe2970a0ea3 100644 --- a/src/gallium/drivers/radeonsi

[Mesa-dev] [PATCH 23/25] radeonsi: factor si_query_buffer logic out of si_query_hw

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle This is a move towards using composition instead of inheritance for different query types. This change weakens out-of-memory error reporting somewhat, though this should be acceptable since we didn't consistently report such errors in the first place. --- src/gallium

[Mesa-dev] [PATCH 25/25] radeonsi: const-ify the si_query_ops

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_perfcounter.c | 2 +- src/gallium/drivers/radeonsi/si_query.c | 6 +++--- src/gallium/drivers/radeonsi/si_query.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/radeonsi

[Mesa-dev] [PATCH 19/25] radeonsi: use si_set_rw_shader_buffer for setting streamout buffers

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle Reduce the number of places that encode buffer descriptors. --- .../drivers/radeonsi/si_state_streamout.c | 61 --- 1 file changed, 11 insertions(+), 50 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state_streamout.c b/src/gallium/drivers

[Mesa-dev] [PATCH 18/25] radeonsi: add an si_set_rw_shader_buffer convenience function

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_descriptors.c | 107 ++ src/gallium/drivers/radeonsi/si_state.h | 2 + 2 files changed, 64 insertions(+), 45 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi

[Mesa-dev] [PATCH 16/25] radeonsi: show the fixed function TCS in debug dumps

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle This is rather important for merged VS/TCS as LSHS shaders... --- src/gallium/drivers/radeonsi/si_debug.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index

[Mesa-dev] [PATCH 09/25] radeonsi: move SI_FORCE_FAMILY functionality to winsys

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle This helps some debugging cases by initializing addrlib with slightly more appropriate settings. --- src/gallium/drivers/radeonsi/si_pipe.c| 34 -- src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 36 +++ 2 files changed, 36 insertions

[Mesa-dev] [PATCH 08/25] ac/surface: 3D and cube surfaces are never displayable

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/amd/common/ac_surface.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index d8d927ee1c5..aeba5e161c9 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c

[Mesa-dev] [PATCH 10/25] radeonsi: extract declare_vs_blit_inputs

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle Prepare for some later refactoring. --- src/gallium/drivers/radeonsi/si_shader.c | 43 ++-- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index

[Mesa-dev] [PATCH 06/25] amd/common: scan/reduce across waves of a workgroup

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle Order-aware scan/reduce can trade-off LDS traffic for external atomics memory traffic in producer/consumer compute shaders. --- src/amd/common/ac_llvm_build.c | 195 - src/amd/common/ac_llvm_build.h | 36 ++ 2 files changed, 227

[Mesa-dev] [PATCH 13/25] radeonsi: don't set RAW_WAIT for CP DMA clears

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle There is never a read-after-write hazard because the command doesn't read. --- src/gallium/drivers/radeonsi/si_cp_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_cp_dma.c b/src/gallium/drivers/radeonsi/si_cp_dma.c

[Mesa-dev] [PATCH 15/25] radeonsi: const-ify si_set_tesseval_regs

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_state_shaders.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index ad7d21e7816..0d4e1956037 100644 --- a/src

[Mesa-dev] [PATCH 14/25] radeonsi: rename SI_RESOURCE_FLAG_FORCE_TILING to clarify its purpose

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_blit.c| 2 +- src/gallium/drivers/radeonsi/si_pipe.h| 2 +- src/gallium/drivers/radeonsi/si_texture.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium

[Mesa-dev] [PATCH 02/25] amd/sid_tables: add additional python3 compatibility imports

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle This happened to bite me while doing some experiments. --- src/amd/common/sid_tables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/common/sid_tables.py b/src/amd/common/sid_tables.py index 7b5e626e3e1..f12bed4b209 100644 --- a/src/amd/common

[Mesa-dev] [PATCH 07/25] amd/common: add i1 special case to ac_build_{inclusive, exclusive}_scan

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle Allow for a unified but efficient treatment of adding a bitmask over a wave or an entire threadgroup. --- src/amd/common/ac_llvm_build.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/amd/common/ac_llvm_build.c b/src/amd

[Mesa-dev] [PATCH 00/25] amd/common, radeonsi: misc cleanups, refactorings, etc.

2018-12-06 Thread Nicolai Hähnle
this is a grab bag of random patches that I've been accumulating, without any real unifying theme. The main highlights are: - finally move the perfcounter code into the radeonsi directory - unify some RW buffer handling - new helpers for cross-wave scans and reductions Please review! Thanks,

[Mesa-dev] [PATCH 03/25] amd/common: cleanup DATA_FORMAT/NUM_FORMAT field names

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle The definition wasn't actually changed in gfx9, so having the suffix makes no sense. --- src/amd/common/ac_nir_to_llvm.c | 2 +- src/amd/common/gfx9d.h| 12 ++-- src/amd/common/sid.h | 12

[Mesa-dev] [PATCH 12/25] radeonsi/gfx9: use SET_UCONFIG_REG_INDEX packets when available

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/amd/common/ac_debug.c| 2 ++ src/amd/common/sid.h | 1 + src/gallium/drivers/radeonsi/si_build_pm4.h | 8 +++- src/gallium/drivers/radeonsi/si_state_draw.c | 12 4 files changed, 18 insertions(+), 5

[Mesa-dev] [PATCH 04/25] amd/common: whitespace fixes

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/amd/common/ac_llvm_build.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index abc18da13db..fba90205a2e 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src

[Mesa-dev] [PATCH 11/25] radeonsi: add si_init_draw_functions and make some functions static

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_pipe.c | 4 +-- src/gallium/drivers/radeonsi/si_state.c | 2 -- src/gallium/drivers/radeonsi/si_state.h | 10 +-- src/gallium/drivers/radeonsi/si_state_draw.c | 28 +--- 4 files changed, 22 insertions

[Mesa-dev] [PATCH 05/25] amd/common: add ac_build_ifcc

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/amd/common/ac_llvm_build.c | 7 +++ src/amd/common/ac_llvm_build.h | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index fba90205a2e..68c8bad9e83 100644 --- a/src/amd/common

[Mesa-dev] [PATCH 01/25] r600: remove redundant semicolon

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/drivers/r600/sb/sb_ir.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/sb/sb_ir.h b/src/gallium/drivers/r600/sb/sb_ir.h index c7a94fcb930..ef0fbd4e68f 100644 --- a/src/gallium/drivers/r600/sb/sb_ir.h +++ b/src

[Mesa-dev] [PATCH] meson: link LLVM 'native' component when LLVM is available

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle Linking against LLVM built with BUILD_SHARED_LIBS fails otherwise, as the component is required for the draw module. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1aeef95f722..0177716c476 100644

[Mesa-dev] [PATCH 2/2] ddebug: always flush when requested, even when hang detection is disabled

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle --- src/gallium/auxiliary/driver_ddebug/dd_draw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/driver_ddebug/dd_draw.c b/src/gallium/auxiliary/driver_ddebug/dd_draw.c index a930299ebb7..f5b94356119 100644 --- a/src/gallium/auxiliary

[Mesa-dev] [PATCH 1/2] ddebug: simplify watchdog loop and fix crash in the no-timeout case

2018-12-06 Thread Nicolai Hähnle
From: Nicolai Hähnle The following race condition could occur in the no-timeout case: API thread Gallium threadWatchdog -- -- dd_before_draw u_threaded_context draw dd_after_draw add to dctx->reco

Re: [Mesa-dev] Make Jordan an Owner of the mesa project?

2018-12-04 Thread Nicolai Hähnle
+1 On 04.12.18 08:26, Marek Olšák wrote: Ack. On Mon, Dec 3, 2018, 7:49 PM Jason Ekstrand wrote: Jordan has requested to be made an Owner of the mesa project.  As much as I may be the guy who pushed to get everything set up, I don't want to do this

[Mesa-dev] [PATCH v2] winsys/amdgpu: explicitly declare whether buffer_map is permanent or not

2018-11-22 Thread Nicolai Hähnle
From: Nicolai Hähnle Introduce a new driver-private transfer flag RADEON_TRANSFER_TEMPORARY that specifies whether the caller will use buffer_unmap or not. The default behavior is set to permanent maps, because that's what drivers do for Gallium buffer maps. This should eliminate the need

Re: [Mesa-dev] [PATCH 2/2] winsys/amdgpu: explicitly declare whether buffer_map is permanent or not

2018-11-22 Thread Nicolai Hähnle
On 21.11.18 21:27, Marek Olšák wrote: On Wed, Nov 21, 2018 at 12:57 PM Nicolai Hähnle <mailto:nhaeh...@gmail.com>> wrote: From: Nicolai Hähnle mailto:nicolai.haeh...@amd.com>> Introduce a new driver-private transfer flag RADEON_TRANSFER_TEMPORARY that specifies whe

[Mesa-dev] [PATCH 1/2] winsys/amdgpu: add amdgpu_winsys_bo::lock

2018-11-21 Thread Nicolai Hähnle
From: Nicolai Hähnle We'll use it in the upcoming mapping change. Sparse buffers have always had one. --- src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 19 +-- src/gallium/winsys/amdgpu/drm/amdgpu_bo.h | 4 ++-- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 10 +- 3 files

[Mesa-dev] [PATCH 2/2] winsys/amdgpu: explicitly declare whether buffer_map is permanent or not

2018-11-21 Thread Nicolai Hähnle
From: Nicolai Hähnle Introduce a new driver-private transfer flag RADEON_TRANSFER_TEMPORARY that specifies whether the caller will use buffer_unmap or not. The default behavior is set to permanent maps, because that's what drivers do for Gallium buffer maps. This should eliminate the need

[Mesa-dev] [PATCH 1.5/2] ac/surface/gfx9: let addrlib choose the preferred swizzle kind

2018-11-21 Thread Nicolai Hähnle
From: Nicolai Hähnle Our choices here are simply redundant as long as sin.flags is set correctly. -- This is the change I was talking about. --- src/amd/common/ac_surface.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c

  1   2   3   4   5   6   7   8   9   10   >