summaryrefslogtreecommitdiff
path: root/src/amd/common
AgeCommit message (Collapse)AuthorFilesLines
2017-09-13ac/surface: match Z and stencil tile configNicolai Hähnle1-7/+42
Fixes various piglit tests on Stoney, see the comment. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-09-13ac/surface: sanity-check that we got a TC-compatible HTILE if requestedNicolai Hähnle1-0/+6
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-09-13amd/common: get ME/PFP/CE firmware feature versions as wellNicolai Hähnle2-4/+9
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-09-13radv/ac: bump params array for image atomic comp swapDave Airlie1-1/+1
For the comp_swap case this was overflowing and crashing sometimes. Fixes: dEQP-VK.image.atomic_operations.compare_exchange.* Cc: "17.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-13radv: handle GFX9 1D texturesDave Airlie1-11/+69
As GFX9 can't handle 1D depth textures, radeonsi and apparantly pro just update all 1D textures to 2D, and work around it. This ports the workarounds from radeonsi. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Cc: "17.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-08ac: remove bitcast_to_float()Connor Abbott1-16/+2
ac_to_float() does a superset of what it does. Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-08ac: move ac_to_integer() and ac_to_float() to ac_llvm_build.cConnor Abbott3-162/+172
We'll need to use ac_to_integer() for other stuff in ac_llvm_build.c. Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-09-08ac: fix ac_get_type_size() for doublesConnor Abbott1-0/+1
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-09-08radv/ac: use ac_get_type_size.Dave Airlie1-23/+3
Just moved to newly shared code. Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-08radeonsi: move the guts of ARB_shader_group_vote emission to acConnor Abbott2-0/+36
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-08radeonsi: move si_emit_ballot() to acConnor Abbott2-0/+29
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-08radeonsi: move emit_optimization_barrier() to acConnor Abbott2-0/+45
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-08radeonsi: move llvm_get_type_size() to acConnor Abbott2-0/+26
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-07ac/surface: add radeon_surf::has_stencil for convenienceMarek Olšák2-0/+3
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-09-07ac/surface: reduce gfx9_surface_layout size.Dave Airlie1-2/+3
152->144. Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-06ac/debug: take ASIC generation into account when printing registersNicolai Hähnle2-107/+177
There were some overlapping changes in gfx9 especially in the CB/DB blocks which made register dumps rather misleading. The split is along the lines of the header files, so we'll print VI-only fields on SI and CI, for example, but we won't print GFX9 fields on SI/CI/VI, and we won't print SI/CI/VI fields on GFX9. Acked-by: Marek Olšák <marek.olsak@amd.com>
2017-09-06amd/common: pass chip_class to ac_dump_regNicolai Hähnle2-45/+45
Acked-by: Marek Olšák <marek.olsak@amd.com>
2017-09-06ac/sid_tables: add FieldTable objectNicolai Hähnle1-30/+85
Automatically re-use table entries like StringTable and IntTable do. This allows us to get rid of the "fields_owner" logic, and simplifies the next change. Acked-by: Marek Olšák <marek.olsak@amd.com>
2017-09-06ac/sid_tables: remove unused variable varname_valuesNicolai Hähnle1-1/+0
Acked-by: Marek Olšák <marek.olsak@amd.com>
2017-09-06radv/gfx9: fix buffer size on gfx9.Dave Airlie1-1/+1
The VI sizing only applies to VI. This fixes: dEQP-VK.image.image_size.buffer.* Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-04ac: reorg ac_shader_binary struct to take less space.Dave Airlie1-8/+9
This reduces the size from 96 to 80 bytes but putting all the 32-bit sizes at the start. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-09-01radeonsi: move si_vm_fault_occured() to AMD common codeSamuel Pitoiset2-0/+113
For radv, in order to report VM faults when detected. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-08-29ac/debug: Support multiple trace ids for nested IBs.Bas Nieuwenhuizen2-22/+40
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-08-29ac/nir: remove misleading conditionGrazvydas Ignotas1-1/+1
location is never set to INTERP_SAMPLE, and Nicolai comments: "... that part is misleading. location refers to the base location, not the final location of the sample, and it can never be INTERP_SAMPLE." Suggested-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
2017-08-29ac/nir: silence maybe-uninitialized warningsGrazvydas Ignotas1-6/+9
These are likely false positives, but are also annoying because they show up on every "make install", which causes ac_nir_to_llvm to be rebuilt here. Initializing those variables to NULL should be harmless even when unnecessary. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-29amd: add .editorconfigGrazvydas Ignotas1-0/+3
amd/common/ and amd/vulkan/ are using tabs for indent, which doesn't match the settings in root .editorconfig, so let's override. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-28gallium/radeon: set EVENT_WRITE_EOP.INT_SEL = wait for write confirmationMarek Olšák1-0/+3
Ported from Vulkan. Not sure what this is good for.. maybe write confirmation from L2 flushes? Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-27Revert "radeonsi: get the raster config from AMDGPU on SI"Marek Olšák2-5/+0
This reverts commit fc99cb3c9edee3af773700cf7ebdc60dc02fcaba. "The performance went down from 64.7 to 51.4 fps in Valley and from 30.8 to 25.1 fps in Heaven on Radeon HD 7970. Other games seem to have also a 10-25% performance decrease." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102429 It looks like we can't use the raster config values from the kernel.
2017-08-24ac/debug: use util_strchrnul() to fix android build errorMauro Rossi1-1/+2
Similar to e09d04cd56 "radeonsi: use util_strchrnul() to fix android build error" Android Bionic does not support strchrnul() string function, gallium auxiliary util/u_string.h provides util_strchrnul() This change avoids the following warning and error: external/mesa/src/amd/common/ac_debug.c:501:15: warning: implicit declaration of function 'strchrnul' is invalid in C99 char *end = strchrnul(out, '\n'); ^ external/mesa/src/amd/common/ac_debug.c:501:9: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' char *end = strchrnul(out, '\n'); ^ ~~~~~~~~~~~~~~~~~~~~ 1 warning and 1 error generated. Fixes: c2c3912410 "ac/debug: annotate IB dumps with the raw values" Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Rob Herring <robh@kernel.org>
2017-08-24radeonsi: get the raster config from AMDGPU on SIMarek Olšák2-0/+5
Not sure yet if we wanna do this on CIK and VI too. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-24ac/nir: Add shader support for multiviews.Bas Nieuwenhuizen4-2/+44
It uses an user SGPR to pass the view index to the shaders, except for the fragment shader where we use layer=view (which comes in handy when we want to do the NV ext that allows us to execute pre-FS stages once instead of per view). Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-08-24ac/nir: Make shader key a struct.Bas Nieuwenhuizen1-6/+8
Some bits can be passed to almost every shader, and I don't like adding 5 variables. Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-08-24ac/nir: Implement input attachments with layered rendering.Bas Nieuwenhuizen1-2/+11
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-08-24ac/nir: Determine if input attachments are used in the info pass.Bas Nieuwenhuizen2-1/+11
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-08-24ac/nir: Cast sources of integer ops to int.Bas Nieuwenhuizen1-0/+16
The int32->float semantic conversion got dropped in a testcase, because the src was already float. On closer inspection I decided to add a few more casts for integer op operands to be safe too. Cc: 17.2 <mesa-stable@lists.freedesktop.org> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-08-24radv: Implement bc optimize.Bas Nieuwenhuizen2-0/+30
Seems like we actually enabled it already, but did not implement the shader part. With this patch we do. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-08-24ac/nir: refactor input variable iteration.Bas Nieuwenhuizen1-19/+11
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-08-23ac/debug: invoke valgrind checks while parsing IBsNicolai Hähnle1-0/+20
Help catch garbage data written into IBs. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-23ac/debug: annotate IB dumps with the raw valuesNicolai Hähnle1-18/+66
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-23ac/debug: use an explicit getter for fetching words from the IBNicolai Hähnle1-153/+215
Guard against out-of-bounds accesses, and prepare for upcoming changes. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-22ac/surface/gfx9: don't allow DCC for the smallest mipmap levelsMarek Olšák1-1/+18
This fixes garbage there if we don't flush TC L2 after rendering. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-22gallium/radeon: clean up EOP_DATA_SEL magic numbersMarek Olšák1-6/+4
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-22radeonsi/gfx9: properly handle imported textures with unexpected swizzle modeMarek Olšák1-0/+5
Cc: 17.2 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-22amd/common: split out ac_parse_ib_chunk from ac_parse_ibNicolai Hähnle2-8/+32
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-21ac/nir: fixup layer/viewport export for GFX9.Dave Airlie1-7/+25
GFX9 moved where the viewport index export goes. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Cc: "17.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-08-17radv: disable texture gather workaround on gfx9.Dave Airlie1-1/+1
Not required anymore. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Cc: "17.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-08-10ac: fail shader compilation if libelf is replaced by an incompatible versionMarek Olšák2-3/+11
UE4Editor has this issue. This commit prevents hangs (release build) or assertion failures (debug build). It doesn't fix the editor, but catastrophic scenarios are prevented. Cc: 17.1 17.2 <mesa-stable@lists.freedesktop.org> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-08-08ac/nir: fix saturate emissionConnor Abbott1-2/+2
The .f32 was already getting added by emit_intrin_2f_param(). Noticed when enabling LLVM module verification. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-08-07radv: fix f16->f32 denorm handling for SI/CIK. (v2)Dave Airlie1-2/+16
This just copies the code from the -pro shaders, and fixes the tests on CIK. With this CIK passes the same set of conformance tests as VI. Fixes: 83e58b03 (radv: flush f32->f16 conversion denormals to zero. (v2)) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-08-06ac/gpu: add driver/device UUID query helpersAndres Rodriguez2-0/+32
We need vulkan and gl to produce the same UUIDs. Therefore we should keep the mechanism to compute these in a common location to guarantee they are updated in lockstep. Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>