summaryrefslogtreecommitdiff
path: root/src/gallium
AgeCommit message (Collapse)AuthorFilesLines
2014-01-28r600g/compute: Emit DEALLOC_STATE on cayman after dispatching a compute shader.Tom Stellard4-14/+10
This is necessary to prevent the next SURFACE_SYNC packet from hanging the GPU. https://bugs.freedesktop.org/show_bug.cgi?id=73418 Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> CC: "9.2" "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit d51dbe048afd2131eb3675e9cd868ce73325a61d)
2014-01-28gallium/rtasm: handle mmap failures appropriatelyEmil Velikov1-3/+7
For a variety of reasons mmap (selinux and pax to name a few) and can fail and with current code. This will result in a crash in the driver, if not worse. This has been the case since the inception of the gallium copy of rtasm. Cc: 9.1 9.2 10.0 <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73473 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (cherry picked from commit 4dd445f1cf80292f10eda53665cefc2a674d838d)
2014-01-27draw: fix incorrect vertex size computation in LLVM drawing codeBrian Paul2-11/+30
We were calling draw_total_vs_outputs() too early. The call to draw_pt_emit_prepare() could result in the vertex size changing. So call draw_total_vs_outputs() after draw_pt_emit_prepare(). This fix would seem to be needed for the non-LLVM code as well, but it's not obvious. Instead, I added an assertion there to try to catch this problem if it were to occur there. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72926 Cc: 10.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: José Fonseca <jfonseca@vmware.com> (cherry picked from commit ad814d04ca5d579538885a595331b5b27caefd2a) Conflicts: src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
2014-01-25gallium/util: util_format_srgb should not return FORMAT_NONE for sRGB formatsMarek Olšák1-0/+3
This fixes a serious regression introduced in 4e549ddb500cf677b6fa16d9ebdfa67cc23da097. Cc: 9.2 10.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit d40532f260c15d56e5fa836147e02c031a999682)
2014-01-25st/vdpau: don't return a device if the screen doesn't support NPOTIlia Mirkin1-0/+5
NV3x cards don't support NPOT textures. Technically this restriction could be worked around, but since it also doesn't expose any video decoding hw, just turn it off entirely. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: 10.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Christian König <christian.koenig@amd.com> (cherry picked from commit 00e4314f6d605e467b9a386cacab7eec48b9e429)
2014-01-25nv50: access only the available amount of constbufEmil Velikov1-1/+1
The textures array is defined as a number of NV50_MAX_PIPE_CONSTBUFS per shader stage. Currently the nv50 driver handles only 3 shader stages, thus we wreck chaos when accessing array-out-of-bounds. Cc: 9.1 9.2 10.0 <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (cherry picked from commit 12e744abbb9fd8cb07a12954aaa7127521d5af0a)
2014-01-25nv50: access only the available amount of texturesEmil Velikov1-1/+1
The textures array is defined as a number of PIPE_MAX_SAMPLERS per shader stage. Currently nv50 driver handles only 3 shader stages, thus we wreck chaos when accessing array-out-of-bounds. Fixes a segfault in piglit/bin/arb_texture_buffer_object-data-sync -fbo -auto Cc: 9.1 9.2 10.0 <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (cherry picked from commit d606ca37eb20f18d8ac4727c68831fcecb2f7de4)
2014-01-25st/dri: prevent leak of dri option default valuesAaron Watry1-0/+6
v2: Change comment style CC: "10.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit ce3528896b37c7d8ef051780e29ea9588fada9da)
2014-01-25radeon: Move gfx/dma cs cleanup to r600_common_context_cleanupAaron Watry2-7/+7
The radeonsi code was not cleaning up either of these items leading to leaked memory. v2: Move cleanup to r600_common_context_cleanup instead of duplicating the logic for SI CC: "10.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit 5ac3229f76f02453ae7e971d515b01fb56ad3fa5) Conflicts: src/gallium/drivers/radeon/r600_pipe_common.c
2014-01-09mesa: Work around internal compiler errorThomas Sondergaard1-2/+2
This small rearrangement avoids MSVC 2013 ICE. Also, this should be a better memory access order. Cc: "10.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 8fcddd325ce3dc5dfdafc95767542590ae860c45)
2014-01-02nv50: fix a small leak on context destroyIlia Mirkin1-0/+2
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> (cherry picked from commit f50a45452a4fd4f7cece8fe37c394edac0808136)
2014-01-02r600/pipe: Stop leaking context->start_compute_cs_cmd.buf on EG/CMAaron Watry1-0/+2
Found while tracking down memory leaks in VDPAU playback Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 3ddabe0d523416693f28e293d8d3d918bdb612ca)
2014-01-02st/vdpau: Destroy context when initialization failsAaron Watry1-0/+1
Prevents a potential memory leak found when tracking down something else. Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 20446d0e535c0735489c8944e8d767e0fc74fc6e)
2014-01-02radeon/llvm: Free target data at end of optimizationAaron Watry1-0/+1
Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 767b0f82c37f0370c05335120e50f0a534549109)
2014-01-02r600/compute: Use the correct FREE macro when deleting compute stateAaron Watry1-1/+1
Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 0bd858d7ff4a16228164e3157aca846edeb6c228)
2014-01-02r600/compute: Free compiled kernels when deleting compute stateAaron Watry1-0/+2
v2: Remove unnecessary null pointer check CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit e19717d075bd26c16e12564ed578ff519a5ce57a)
2014-01-02radeon/compute: Stop leaking LLVMContexts in radeon_llvm_parse_bitcodeAaron Watry5-18/+41
Previously we were creating a new LLVMContext every time that we called radeon_llvm_parse_bitcode, which caused us to leak the context every time that we compiled a CL program. Sadly, we can't dispose of the LLVMContext at the point that it was being created because evergreen_launch_grid (and possibly the SI equivalent) was assuming that the context used to compile the kernels was still available. Now, we'll create a new LLVMContext when creating EG/SI compute state, store it there, and pass it to all of the places that need it. The LLVM Context gets destroyed when we delete the EG/SI compute state. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 8c9a9205d96b5ac0718218bfa952a5b4b6ad939c)
2014-01-02pipe_loader/sw: close dev->lib when initialization failsAaron Watry1-1/+4
Prevents a memory leak. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a7653c19a3b1adae162864587a7ab1c17ab256e6)
2014-01-02clover: Remove unused variableAaron Watry1-1/+0
Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 862f55c29c50798942e58ea75c5294921c0489f8)
2014-01-02llvmpipe: use pipe_sampler_view_release() to avoid segfaultJonathan Liu1-0/+6
This fixes another case of faulting when freeing a pipe_sampler_view that belongs to a previously destroyed context. Cc: "10.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 7990ab58fa01cbebcefd63dd25af5fd6fdddf019)
2014-01-02r600g/sb: fix stack size computation on evergreenVadim Girlin1-4/+12
On evergreen we have to reserve 1 stack element in some additional cases besides the ones mentioned in the docs, but stack size computation was recently reimplemented exactly as described in the docs by the patch that added workarounds for stack issues on EG/CM, resulting in regressions with some apps (Serious Sam 3). This patch fixes it by restoring previous behavior. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=72369 Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com> Cc: "10.0" <mesa-stable@lists.freedesktop.org> Tested-by: Andre Heider <a.heider@gmail.com> (cherry picked from commit 00faf82832f3e6ef886abad246b50cc47b901c1f)
2013-12-12nv50: report 15 max inputs for fragment programsIlia Mirkin1-1/+1
First off, nv50_program only has 16 in/out varyings. However reporting 16 makes 'm' become 68 in nv50_fp_linkage_validate with the varying-packing-simple piglit test. (Subverting the assert makes it compile but fail.) With this patch, varying-packing-simple passes. See: https://bugs.freedesktop.org/show_bug.cgi?id=69155 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit bad8871e524cf518bc5da4ac52c1618a115054a7)
2013-12-12nouveau: Fix compiler warning regressionMaarten Lankhorst1-4/+0
cfg is now unused, remove it. Cc: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 5576ad11ed922fad641e630fbb9b199f6434f528)
2013-12-09r300/compiler/tests: Fix line length check in test parserTom Stellard1-1/+3
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> CC: "9.2" "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 9a5ce0c4c971a8511574e10dd3ef37eebbe65ce7)
2013-12-09r300/compiler/tests: Fix segfaultTom Stellard1-6/+5
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> CC: "9.2" "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 1896431f7933e727a0f75c0e0a2da4c580a04a72)
2013-12-09nouveau/video: update a few more h264 picparm field namesIlia Mirkin1-16/+17
Based on comments by Benjamin Morris <bmorris@nvidia.com> in http://lists.freedesktop.org/archives/nouveau/2013-December/015328.html This adds setting of is_long_term, and updates a few field names we were unclear about. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 2cd2b9705e722d94091ce8ff6ff56a44dd8d5cc6)
2013-12-09nouveau/video: update h264 picparm field names based on usageIlia Mirkin1-15/+13
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 78525dae8ae4daf785e89ba8a334e4ec3be8a334)
2013-12-09nv50: enable h264 and mpeg4 for nv98+ (vp3, vp4.0)Ilia Mirkin2-7/+2
Create the ref_bo without any storage type flags set for now. The issue probably arises from our use of the additional buffer space at the end of the ref_bo. It should probably be split up in the future. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Tested-by: Martin Peres <martin.peres@labri.fr> Cc: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit e01ba9d6b049d5eee8c125e3ec43b4539c26e4d7)
2013-12-06nv50: wait on the buf's fence before sticking it into pushbufIlia Mirkin2-0/+12
This resolves some rendering issues in source games. See https://bugs.freedesktop.org/show_bug.cgi?id=64323 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 0e5bf8565106833e1a678ebdae81fdf1657391c9)
2013-12-06nouveau: avoid leaking fences while waitingIlia Mirkin1-6/+5
This fixes a memory leak in some situations. Also avoids emitting an extra fence if the kick handler does the call to nouveau_fence_next itself. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit ce6dd69697ae62d9336bbd4f5808bc4d75cdcc04)
2013-12-06nv50: Fix GPU_READING/WRITING bit removalIlia Mirkin2-3/+3
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> CC: "9.1, 9.2, 10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit c45cf6199fc493538cef33125c8a97a892e2ca83)
2013-12-06st/xa: Bump major version number to 2Thomas Hellstrom1-1/+1
For some reason this was left out when the version was changed... Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2013-11-26radeon/compute: Unconditionally inline all functions v2Tom Stellard1-2/+20
We need to do this until function calls are supported. v2: - Fix loop conditional https://bugs.freedesktop.org/show_bug.cgi?id=64225 CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit ddc77c5092b6f782327a7014b320f31f5f4e8e93)
2013-11-23radeonsi/compute: Fix LDS size calculationTom Stellard1-1/+16
We need to include the number of LDS bytes allocated by the state tracker. CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 1bdb99330ac68003a9ee6c963f46bddb03b9073d)
2013-11-23r600g/compute: Add a work-around for flushing issues on CaymanTom Stellard3-1/+17
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> https://bugs.freedesktop.org/show_bug.cgi?id=69321 CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 7a30cd7085b6879d3858f5c1a6945fbe30c818a6)
2013-11-23r600g/compute: Fix handling of global buffers in r600_resource_copy_region()Tom Stellard1-1/+36
Global buffers do not have an associate cs_buf handle, so we can't copy them using r600_copy_buffer() https://bugs.freedesktop.org/show_bug.cgi?id=64226 Reviewed-by: Marek Ol????k <marek.olsak@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 1b9511d7ce70a9f9cadd0c03bd0c916b88b6dd43)
2013-11-23gallium: Pass version scripts to linker using --version-script=Tom Stellard4-4/+4
This fixes build failures with the gold linker. CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 17930a66aad6774224296ad9c845d30e01e4ffe5)
2013-11-23clover: Optionally return context's devices from clGetProgramInfo()Tom Stellard1-2/+6
The spec allows clGetProgramInfo() to return information about either the devices associated with the program or the devices associated with the context. If there are no devices associated with the program, then we return devices associated with the context. https://bugs.freedesktop.org/show_bug.cgi?id=52171 Reviewed-by: Francisco Jerez <currojerez@riseup.net> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a84dd2398f75c672293122408828ac66bb7052a0)
2013-11-23r600g/sb: work around hw issues with stack on eg/cmVadim Girlin5-44/+123
v2: make it actually work, improve condition Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68503 Cc: "10.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com> (cherry picked from commit 4cb04aa0dfaf8c23e312fa49778e637e59410727)
2013-11-15radeon/llvm: Free elf_buffer after useAaron Watry1-0/+1
Prevents a memory leak. v2: Remove null check CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 2be85e2492b6ad7e04884525904a7ec22cde0ddc)
2013-11-15r600/llvm: Free binary.code/binary.config in r600_llvm_compileAaron Watry1-0/+3
radeon_llvm_compile allocates memory for binary.code, binary.config, or neither depending on what's being done. We need to make sure to free that memory after it's no longer needed. v2: Don't bother checking for null before FREE() CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 01f3622c740173d4001eb421b74d4d60a0c7fd12)
2013-11-15r600/llvm: initialize radeon_llvm_binaryAaron Watry1-0/+1
use memset to initialize to 0's... otherwise code_size and config_size could be uninitialized when read later in this method. It's also hard to do NULL checks on uninitialized pointers. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> v2: Fix indentation CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit dd73b99420de17651001e0a4d937f1f66fbef14c)
2013-11-15svga: mark dest image as defined in svga_surface_copy()Brian Paul1-0/+2
After we blit/copy to a dest texture image we need to mark it as being defined. This fixes broken mipmap generation for quite a few texture formats. Mipgen involves making texture views and svga_texture_view_surface() skips texture images that are undefined. Cc: "10.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: José Fonseca <jfonseca@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> (cherry picked from commit 3969330b47c5b7f7843f356db0a10962553339a6)
2013-11-15svga: do primitive trimming in translate_indices()Brian Paul1-3/+12
The index translation code expects the number of indexes to be consistent with the primitive type (ex: a multiple of 3 for PIPE_PRIM_TRIANGLES). If it's not, we can write out of bounds in the destination buffer. Fixes failed assertions in the pipebuffer debug code found with Piglit primitive-restart-draw-mode test. Cc: "10.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: José Fonseca <jfonseca@vmware.com> (cherry picked from commit 79984b9928d4444665ce617a1e4551e53d415bd4)
2013-11-15gallium/pipe_loader: un-reference udev resources when we're done with them.Aaron Watry1-0/+3
Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 598f61ba28bcfd220104e18e89973768babeaac3)
2013-11-15radeonsi/compute: Dispose of LLVM module after compiling kernelsAaron Watry1-0/+1
v2: Fix indentation Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 4c6ac9e61452ffc49f8e360fc879deec8e04bbb5)
2013-11-15radeonsi/compute: Free program and program.kernels on shutdownAaron Watry1-1/+15
v2: Fix indentation Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 35dad4a1e235b2bf7fb3ecdb82aed0214db69a35)
2013-11-15radeon/llvm: Free created llvm memory bufferAaron Watry1-0/+1
v2: Fix indentation Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit d41b10f811a89c76248f195a6b4ade62322b8c3c)
2013-11-15radeon/llvm: Free libelf resourcesAaron Watry1-0/+3
v2: Fix indentation Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a2b93da84bda2b92108cf3b9c253fec114b69dc2)
2013-11-15radeon/llvm: fix spelling errorAaron Watry1-1/+1
Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit df482fe02f6732fb6fe7ae0a509b3c66e655bd5b)