summaryrefslogtreecommitdiff
path: root/src/amd
AgeCommit message (Collapse)AuthorFilesLines
2017-03-14radv: Flush before copying with PKT3_WRITE_DATA in CmdUpdateBufferAlex Smith1-0/+2
Need to flush before updating the buffer to ensure that the copy is ordered after previous accesses (assuming the app has performed the appropriate barriers). This fixes potential issues due to draws prior to an update reading the new buffer content, despite having the necessary barriers between them. Signed-off-by: Alex Smith <asmith@feralinteractive.com> Cc: 17.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-14radv: Emit cache flushes before CP DMA.Bas Nieuwenhuizen1-0/+3
The flushes could be due to TRANSFER barriers. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Cc: 17.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-14nir: Rework conversion opcodesJason Ekstrand2-17/+13
The NIR story on conversion opcodes is a mess. We've had way too many of them, naming is inconsistent, and which ones have explicit sizes was sort-of random. This commit re-organizes things and makes them all consistent: - All non-bool conversion opcodes now have the explicit size in the destination and are named <src_type>2<dst_type><size>. - Integer <-> integer conversion opcodes now only come in i2i and u2u forms (i2u and u2i have been removed) since the only difference between the different integer conversions is whether or not they sign-extend when up-converting. - Boolean conversion opcodes all have the explicit size on the bool and are named <src_type>2<dst_type>. Making things consistent also allows nir_type_conversion_op to be moved to nir_opcodes.c and auto-generated using mako. This will make adding int8, int16, and float16 versions much easier when the time comes. Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-14radv: setup llvm target data layoutDave Airlie1-0/+7
Ported from radeonsi, pointed out by Tom. "This prevents LLVM from using sext instructions for local memory offsets and allows the backend to fold immediate offsets into the instruction. This also prevents some incorrect code generation for ptrtoint and inttoptr instructions." Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Tom Stellard <tstellar@redhat.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-13radv: Reinitialise loaderMagic when allocating a cached command bufferAlex Smith1-0/+1
This must be set to ICD_LOADER_MAGIC by vkAllocateCommandBuffers, which was being done when allocating a new buffer but not when reusing an existing one in the cache. This would hit an assertion and crash in debug builds of the Vulkan loader. Fixes: 682248db451f ("radv: Cache command buffers in command pool.") Signed-off-by: Alex Smith <asmith@feralinteractive.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-03-13vulkan/wsi: Generate wayland protocol headers separately from EGLJason Ekstrand1-3/+0
Previously, we were depending on EGL for generating the headers and providing the protocol symbols. However, since neither Vulkan driver actually wants to link against EGL, this is kind of pointless. It also creates a weird build dependency. v2 [Jason] - Add missing wsi/ prefix, MKDIR_GEN v3 [Emil Velikov] - include BUILT_SOURCES/generation rules outside of conditional Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-13radv/wsi: Don't include wayland headersEmil Velikov1-3/+0
Unused and we'll rework the way wayland-drm-client-protocol.h is generated with later commit. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Acked-by: Dave Airlie <airlied@redhat.com>
2017-03-13radv: Store shaders in VRAM.Bas Nieuwenhuizen2-2/+2
Less IFETCH latency on misses. Shader code is write once read many, so GTT doesn't make much sense anyway. If it turns out to fragment the CPU visible VRAM too much, we can upload with SDMA. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-13radv/ac: move to new image intrinsics.Dave Airlie1-145/+77
This hooks up radv to the new image intrinsic builders. Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-13radv: disabled scaled formats for transfers.Dave Airlie1-7/+10
These really are only supported for vertex buffers. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-10amd: remove shebang from python scriptsEmil Velikov3-3/+0
Analogous to earlier commit(s). Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-10amd: remove execute bit from python scriptsEmil Velikov3-0/+0
Analogous to earlier commit(s). Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-09radv: Don't flush the CB before doing a fast clear eliminate.Bas Nieuwenhuizen1-2/+0
The only way we write CMASK/DCC compressed textures through shaders is fast clears and CMASK/DCC inits, which have their own flushes. Hence the CB cache is always up to date. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-09radv: Don't emit cache flushes on subpass switch.Bas Nieuwenhuizen3-6/+0
I think we should only flush right before an action (draw/dispatch etc.), as otherwise it is too easy to issue redundant flushes. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-09radv: Only flush for the needed stages, and before the flushes.Bas Nieuwenhuizen1-6/+1
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-09radv: Don't invalidate CB/DB for images that aren't modified outside CB/DB.Bas Nieuwenhuizen1-9/+19
Without stores, the only writes are fast clears, transfers and metadata initialization, each of which have the appropiate invalidations already. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-09radv: Flush more caches after writes.Bas Nieuwenhuizen1-3/+9
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-09radv: Don't flush for fixed-function reading.Bas Nieuwenhuizen1-1/+0
The data should always be in memory after a src flush. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-09radv: Invalidate the correct caches for CB/DB dst barriers.Bas Nieuwenhuizen1-5/+11
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-09radv: Determine cache flushes per object.Bas Nieuwenhuizen1-17/+19
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-09radv/ac: fixup texture coord to have right number of channels.Dave Airlie2-4/+4
Jason has patches to add validation to this area, this should fix radv shaders. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-08radv: remove duplicate initialization of alphaToOne featureDamien Grassart1-1/+0
Fixes a GCC warning when compiling with -Wextra: radv_device.c:463:47: warning: initialized field overwritten [-Woverride-init] Signed-off-by: Damien Grassart <damien@grassart.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-08radv: disable mip point pre clamping.Dave Airlie1-1/+1
No idea what this does, but disabling it fixes a bunch of failing CTS tests in the lod area, so let's go with that. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-07radv/ac: fix multiple descriptor sets with dynamic buffersFredrik Höglund1-3/+5
The dynamic_offset_offset in the descriptor set binding layout is relative to the dynamic_offset_start for the set in the pipeline layout. Cc: 17.0 <mesa-stable@lists.freedesktop.org> Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-03-07radv: fix the size of the dynamic_buffers arrayFredrik Höglund1-1/+1
A buffer descriptor is 16 bytes, not 16 dwords. Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-03-07radv: fix the dynamic buffer index in vkCmdBindDescriptorSetsFredrik Höglund1-1/+1
This fixes the wrong dynamic buffer descriptors being updated when firstSet > 0. Cc: 17.0 <mesa-stable@lists.freedesktop.org> Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-03-07build: Replace NEED_RADEON_LLVM with HAVE_GALLIUM_LLVM.Matt Turner1-1/+1
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-03-07radv: Use the subresource range in HTILE initialization.Bas Nieuwenhuizen2-7/+12
v2: fix levelCount assert. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-07radv: Use winsys HTILE info.Bas Nieuwenhuizen6-87/+18
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-07radv/amdgpu: Let addrlib calculate the HTILE parameters.Bas Nieuwenhuizen2-0/+31
Still not sure we can support miptrees when sampling from HTILE enabled textures. Added the tcCompatible winsys stuff while I'm at it. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-07amd/common: document PREDICATION OP 3 as 64-bit bool.Dave Airlie1-0/+1
This just documents some info for possible future use. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-07radv: handle z offset for 3d image <-> buffer copies.Dave Airlie1-0/+4
This fixes: dEQP-VK.pipeline.render_to_image.3d.huge.depth.r8g8b8a8_unorm Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-07radv: move fast clear before resolve into own loop.Dave Airlie1-8/+15
Don't fast clear inside the meta loop as things get confused, fixes a crash in: dEQP-VK.api.copy_and_blit.resolve_image.whole_array_image.2_bit Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv: Disable HTILE for textures with multiple layers/levels.Bas Nieuwenhuizen1-0/+3
It has issues and the fix I'm working on is too complicated for stable, so disable for now. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com> CC: 13.0 17.0 <mesa-stable@lists.freedesktop.org>
2017-03-07radv: Properly handle destroying NULL devices and instancesDave Airlie1-0/+6
Ported from anv: 3d33a23e anv: Properly handle destroying NULL devices and instances Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-07radv/ac: introduce i1true/i1false to context.Dave Airlie1-32/+33
This uses these in a few places, and fixes one or two cases which were using da as 32-bit instead of bool. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-07radv/ac: handle Z export using new builder.Dave Airlie1-22/+19
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-07radv/ac: move to using common ac_get_image_intr_name.Dave Airlie1-40/+15
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-07radeonsi/ac: move get_image_intr_name to commonDave Airlie2-0/+31
This code is used in radv, so move to common build code. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv: Emit pending flushes before executing a secondary command bufferAlex Smith1-0/+3
If we have any pending flushes on the primary command buffer, these must be performed before executing the secondary buffer. This fixes potential corruption when the contents of a subpass which clears any of its render targets are given in a secondary buffer: the flushes after a fast clear would not have been performed until the vkCmdEndRenderPass call. Signed-off-by: Alex Smith <asmith@feralinteractive.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Cc: 13.0 17.0 <mesa-stable@lists.freedesktop.org>
2017-03-06radeonsi: drop support for LLVM 3.6 & 3.7Marek Olšák3-38/+14
They are too old. Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-06radeonsi: set the convergent attribute where neededMarek Olšák1-2/+6
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-06gallivm,ac: add LP_FUNC_ATTR_CONVERGENTMarek Olšák2-0/+2
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-06radeonsi: fix LLVM 3.9 - don't use non-matching attributes on declarationsMarek Olšák1-3/+3
Call site attributes are used since LLVM 4.0. This also reverts commit b19caecbd6f310c1663b0cfe483d113ae3bd5fe2 "radeon/ac: fix intrinsic version check", because this is the correct fix. Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv: Use the new L2 writeback flag.Bas Nieuwenhuizen2-6/+6
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv: Add L2 writeback.Bas Nieuwenhuizen2-34/+54
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv/ac: use bitfield extract new intrinsics.Dave Airlie1-7/+4
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv/ac: move to new kill build.Dave Airlie1-5/+2
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv/ac: move to using new export intrinsics.Dave Airlie1-93/+86
This uses the new code in build to do exports. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv/ac: switch to new intrinsics for pkrtz and clamp.Dave Airlie1-5/+2
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>