summaryrefslogtreecommitdiff
path: root/src/amd
AgeCommit message (Collapse)AuthorFilesLines
2017-07-31ac/nir: add image and write parameter to ac_shader_abi::load_sampler_descNicolai Hähnle2-19/+28
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: add support for arrays-of-arrays to get_sampler_descNicolai Hähnle1-5/+20
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: pass ac_nir_context to tex_fetch_ptrs and related functionsNicolai Hähnle1-75/+83
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: add and use ac_shader_abi::load_sampler_descNicolai Hähnle2-48/+84
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: pass ac_nir_context to visit_tex and various related functionsNicolai Hähnle1-117/+118
Get most of the churn out of the way before actually loading samplers via the ABI. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir,radeonsi: add ac_shader_abi::chip_classNicolai Hähnle2-0/+3
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir,radeonsi: add ac_shader_abi::load_uboNicolai Hähnle2-0/+5
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: pass ac_nir_context to visit_load_ubo_bufferNicolai Hähnle1-8/+8
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: pass ac_nir_context to visit_{load,store}_var and get_deref_offset ↵Nicolai Hähnle1-75/+75
helper Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: pass ac_llvm_context to some helper functionsNicolai Hähnle1-20/+20
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: pass ac_nir_context to visit_intrinsicNicolai Hähnle1-52/+52
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: add ac_nir_context::main_functionNicolai Hähnle1-0/+3
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: split scanning outputs from setting up output allocasNicolai Hähnle1-8/+43
The scanning phase sets the driver_location, because it is part of the ABI: radeonsi does the assignment differently. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: pass ac_llvm_context to *build_alloca* helpersNicolai Hähnle1-9/+9
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: use ac_shader_abi::emit_outputsNicolai Hähnle1-2/+14
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac,radeonsi: add ac_shader_abi::emit_outputs for hardware VS shadersNicolai Hähnle1-0/+4
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31radeonsi: translate NIR to LLVMNicolai Hähnle1-1/+1
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: add ac_shader_abi::inputsNicolai Hähnle2-0/+9
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: begin splitting off ac_nir_contextNicolai Hähnle2-234/+290
The eventual goal is to hide all radv-specific details behind ac_nir_context::abi, so that the NIR->LLVM code can be re-used by radeonsi. During development, we live with a partial split, where some of the NIR->LLVM code still relies on linking back to the nir_to_llvm_context (which should ultimately be renamed to reflect that it's radv-specific). The idea is to get rid of these backlinks over time. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac/nir: start using ac_shader_abiNicolai Hähnle1-20/+18
v2: update for LLVMValueRefs in ac_shader_abi Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31ac,radeonsi: move some VS input descriptions to ac_shader_abiNicolai Hähnle1-0/+40
v2: use LLVM values instead of function parameter indices Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-28radv: for stencil only set Z tile mode index to same valueDave Airlie1-0/+2
On SI this was causing a hang in dEQP-VK.pipeline.render_to_image.core.2d_array.mipmap.r16g16_sint_s8_uint This was due to not handling the tile mode index for depth like I fixed previously for new GPUs. Fixes: 01d0c5a9 (radv: fix stencil regression since new addrlib import) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-26radv/ac: port SI TC L1 write corruption fix.Dave Airlie1-3/+5
This ports 72e46c988 to radv. radeonsi: apply a TC L1 write corruption workaround for SI Fixes: f4e499ec7 (radv: add initial non-conformant radv vulkan driver) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-26radv/winsys: fix padding command stream for SIDave Airlie1-4/+6
We were adding pad to size after creating the object, so we could submit a CS bigger than the bo created for it. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-26radv/ac: realign SI workaround with radeonsi.Dave Airlie1-2/+3
This ports: da7453666ae radeonsi: don't apply the Z export bug workaround to Hainan to radv. Just noticed in passing. Fixes: f4e499ec7 (radv: add initial non-conformant radv vulkan driver) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-26ac/surface: fix hybrid graphics where APU=GFX9, dGPU=olderMarek Olšák1-0/+12
v2: don't do it for compressed textures (bpp = 0) Cc: 17.2 <mesa-stable@lists.freedesktop.org> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1) Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
2017-07-26radv: rename physical_device->uuid[] to cache_uuid[]Andres Rodriguez3-5/+5
We have a few UUIDs, so lets be more specific. Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-25radv: only report external semaphore info for opaque fd.Dave Airlie1-5/+10
Until we support sync fd, don't report the info. Fixes CTS dEQP-VK.api.external.semaphore.sync_fd.* from crashing. Fixes: eaa56eab6 (radv: initial support for shared semaphores (v2)) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-24radv: fix buffer views on SI/CIK.Dave Airlie1-0/+5
Fixes CTS dEQP-VK.memory.pipeline_barrier.host_write_uniform_texel_buffer.1024 on SI/CIK with radv. Fixes: f4e499ec (radv: add initial non-conformant radv vulkan driver) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-24radv: enable sample shadingDave Airlie2-2/+4
This calculates ps_iter_samples from the minSampleShading input Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-24radv: don't set dedicated bit for buffer external memory.Dave Airlie1-2/+1
This is an alternate fix for the buffer export dedicated interaction. Fixes CTS dEQP-VK.api.external.memory.opaque_fd.dedicated.buffer.info Fixes: b70829708a (radv: Implement VK_KHR_external_memory) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-24radv: fix non-0 based layer clears.Dave Airlie1-4/+9
If the layer base was > 0, it wasn't getting passed as the start instance or getting added in the shaders. Fixes CTS dEQP-VK.api.image_clearing.core.clear_color_attachment.2d_r8_uint_multiple_layers Fixes: 7e0382fb (radv: add support for layered clears (v2)) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-24radv: check enabled device features.Dave Airlie1-0/+13
The spec says we should return VK_ERROR_FEATURE_NOT_PRESENT. Ported from anv. Fixes CTS test dEQP-VK.api.device_init.create_device_unsupported_features Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-24radv: for external memory imports close the fd on import successDave Airlie1-1/+3
If we get an fd, we need to close it before returning. Fixes CTS test dEQP-VK.api.external.memory.opaque_fd.dedicated.device_only.import_multiple_times Fixes: b70829708a (radv: Implement VK_KHR_external_memory) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-24radv: Don't segfault when exporting an image which hasn't been bound yet.Bas Nieuwenhuizen1-1/+1
The image is set on Memory allocation already, but the image doesn't have to have the BindImageMemory called yet. Luckily, we know offset within a BO has to be 0 for dedicated allocations, so we can just use the dummy 0 in the address calaculations. Fixes CTS test dEQP-VK.api.external.memory.opaque_fd.dedicated.image.export_bind_import_bind Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Fixes: b70829708ac "radv: Implement VK_KHR_external_memory" Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-07-24radv: Handle VK_ATTACHMENT_UNUSED in color attachments.Bas Nieuwenhuizen6-20/+45
This just sets them to INVALID COLOR, instead of shifting the attachments together. This also fixes a number of cases where we use it first and only then check if it is VK_ATTACHMENT_UNUSED. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver" Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-07-22radv: reset non-syncobj semaphore context after wait.Dave Airlie1-0/+2
When I ported from libdrm, I forgot to add the line to reset the sem, we just need to reset the context. This fixes a regression in DOOM. Fixes: 9ac1432a571 ("radv: port to new libdrm API.") Reported-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-21radv: rebase radv_entrypoints_gen.py on anv_entrypoints_gen.pyDylan Baker2-275/+287
The two generators forked from each other, and they remain basically the same. This rebases the radv version on the anv version, but with the radv changes ported over. The result is that we get rid of the "cat |" madness and gain mako, correct "generated by" attributions, and write files out directly. The only differences between the output is whitespace and comments. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Dave Airlie <airlied@redhat.com>
2017-07-22radv: Generate storage image descriptors unconditionallyAlex Smith1-4/+1
We can also use storage images internally for resolves, which don't require TRANSFER_DST usage on the image, so currently we may not create the needed descriptors. Just create these descriptors unconditionally. Fixes: 0e1886efb9e ("radv: Fix descriptors for cube images with VK_IMAGE_USAGE_STORAGE_BIT") Reported-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Alex Smith <asmith@feralinteractive.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-21radv: initial support for shared semaphores (v2)Dave Airlie6-71/+359
This adds support for sharing semaphores using kernel syncobjects. Syncobj backed semaphores are used for any semaphore which is created with external flags, and when a semaphore is imported, otherwise we use the current non-kernel semaphores. Temporary imports from syncobj fd are also available, these just override the current user until the next wait, when the temp syncobj is dropped. v2: allocate more chunks upfront, fix off by one after previous refactor of syncobj setup, remove unnecessary null check. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-21radv/winsys: add syncobj hooksDave Airlie2-0/+44
This just adds syncobj create/destroy/export/import paths into the winsys interface. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-21ac/gpu: add code to detect if kernel supports sync objects.Dave Airlie2-0/+10
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-20radv: Add support for VK_KHR_variable_pointers.Bas Nieuwenhuizen3-0/+18
Just a trivial enable. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Acked-by: Dave Airlie <airlied@redhat.com>
2017-07-20radv: Add VK_KHR_storage_buffer_storage_class support.Bas Nieuwenhuizen2-0/+5
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Acked-by: Dave Airlie <airlied@redhat.com>
2017-07-20radv: port to new libdrm API.Dave Airlie1-29/+92
This bumps the libdrm requirement for amdgpu to the 2.4.82. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-20radv: introduce some wrapper in cs code to make porting off libdrm_amdgpu ↵Dave Airlie1-18/+70
easier. This just introduces a central semaphore info struct, and passes it around, and introduces some wrappers that will make porting off libdrm_amdgpu easier. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-18radv: Set the RADEON_SURF_OPTIMIZE_FOR_SPACE flag for imagesAlex Smith1-0/+1
This looks like a regression from df301237940 ("radv: use ac_compute_surface"). Before that, the opt4Space addrlib flag was set to true unless the image has FMASK (ac_compute_surface will similarly only set that flag for images without FMASK). This saves multiple gigabytes of VRAM on one of our games, and brings its VRAM utilisation on RADV in line with AMDGPU-PRO and NVIDIA. Signed-off-by: Alex Smith <asmith@feralinteractive.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-18radv: don't shadow meta_va.Dave Airlie1-1/+1
Coverity warned about dead code below, as meta_va was being shadowed. Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-07-17ac/nir: rewrite shared variable handling (v2)Connor Abbott1-87/+158
Translate the NIR variables directly to LLVM instead of lowering to a TGSI-style giant array of vec4's and then back to a variable. This should fix indirect dereferences, make shared variables more tightly packed, and make LLVM's alias analysis more precise. This should fix an upcoming Feral title, which has a compute shader that was failing to compile because the extra padding made us run out of LDS space. v2: Combine the previous two patches into one, only use this for shared variables for now until LLVM becomes smarter. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Tested-by: Alex Smith <asmith@feralinteractive.com>
2017-07-17ac/gpu_info: if clock crystal frequency is 0, print an error and set 1Marek Olšák1-0/+4
During bring-up, this is often 0. Prevent automatic disablement of ARB_timer_query and demotion of the OpenGL version to 3.2 by setting a non-zero frequency. Print an error message instead. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>