summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
Commit message (Collapse)AuthorAgeFilesLines
* st/dri: assume external consumers of back buffers can write to the buffersMarek Olšák2019-12-101-6/+6
| | | | | | | This was reverted needlessly because if was part of another series. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-By: Tapani Pälli <[email protected]>
* st/dri: use st->flush callback to flush the backbufferPierre-Eric Pelloux-Prayer2019-12-101-39/+63
| | | | | | | | | | | | | | Previously the flush was done before the call to st->flush but could lead to problems as FLUSH_VERTICES could push some work that would change the backbuffer (or modify it). With this commit, all the backbuffer flushing code is executed right before the call to st_flush. Closes: https://gitlab.freedesktop.org/drm/amd/issues/842 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205049 Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: add a notify_before_flush callback param to flushPierre-Eric Pelloux-Prayer2019-12-108-15/+16
| | | | | | | | | | The new callback is called right before the flush is done to allow users of st->flush to do some work after all the previous work has been flushed. This will be used by dri_flush in the next commit. Reviewed-by: Marek Olšák <[email protected]>
* gallium: Store the image format in winsys_handleNanley Chery2019-12-061-0/+4
| | | | | | | | This format will be used to properly handle planar images with modifiers in iris. Fixes: 246eebba4a8 ("iris: Export and import surfaces with modifiers that have aux data") Reviewed-by: Kenneth Graunke <[email protected]>
* gallium/dri2: Fix creation of multi-planar modifier imagesNanley Chery2019-12-061-19/+16
| | | | | | | | | | | | | | | | The commit noted below assumed and enforced that DRM_MOD_INVALID was the only valid modifier for multi-planar imported images. Due to that, it required that modifier on multi-planar images to: 1. Allow multiple planes. 2. Perform YUV format lowering and extent adjustments. 3. Use buffer_index to correctly map the given planes. Fix these issues by removing or updating the code built on that assumption. Fixes: 2066966c106 ("gallium/dri2: Support creating multi-planar modifier images") Reviewed-by: Kenneth Graunke <[email protected]>
* gallium: Fix the ->set_damage_region() implementationBoris Brezillon2019-11-293-4/+35
| | | | | | | | | | | | | | BACK_LEFT attachment can be outdated when the user calls KHR_partial_update() (->lastStamp != ->texture_stamp), leading to a damage region update on the wrong pipe_resource object. Let's delay the ->set_damage_region() call until the attachments are updated when we're in that case. Reported-by: Carsten Haitzler <[email protected]> Fixes: 492ffbed63a2 ("st/dri2: Implement DRI2bufferDamageExtension") Cc: <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* driconf, glsl: Add a vs_position_always_invariant optionKenneth Graunke2019-11-271-0/+2
| | | | | | | | | | | | | | | | | | | | Many applications use multi-pass rendering and require their vertex shader position to be computed the same way each time. Optimizations may consider, say, fusing a multiply-add based on global usage of an expression in a shader. But a second shader with the same expression may have different code, causing that optimization to make the other choice the second time around. The correct solution is for applications to mark their VS outputs 'invariant', indicating they need multiple shaders to compute that output in the same manner. However, most applications fail to do so. So, we add a new driconf option - vs_position_always_invariant - which forces the gl_Position output in vertex shaders to be marked invariant. Fixes: 7025dbe794b ("nir: Skip emitting no-op movs from the builder.") Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* clover/llvm: fix build after llvm 10 commit 1dfede3122eeAaron Watry2019-11-152-4/+20
| | | | | | | | | CodeGenFileType moved from ::llvm::TargetMachine in llvm/Target/TargetMachine.h to ::llvm:: in llvm/Support/CodeGen.h Signed-off-by: Aaron Watry <[email protected]> Reviewed-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-1419-19/+19
| | | | | | | | | | | | | | | To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* Revert "st/dri: assume external consumers of back buffers can write to the ↵Tapani Pälli2019-11-141-6/+6
| | | | | | | | | | | | | buffers" This reverts commit 1d1b4578211dcc69cfab8879d0cdafaba1eec948. This series caused unexpected flickering artifacts with Iris driver on Chrome OS and EGL_EXT_image_flush_external spec has not been published yet. Acked-by: Eric Engestrom <[email protected]> Acked-by: Kristian H. Kristensen <[email protected]>
* Revert "st/dri: add support for EGL_EXT_image_flush_external"Tapani Pälli2019-11-141-91/+40
| | | | | | | | | | | This reverts commit 1d122c104a7a3d9348ab347e1e843b7e2bf3b498. This series caused unexpected flickering artifacts with Iris driver on Chrome OS and EGL_EXT_image_flush_external spec has not been published yet. Acked-by: Eric Engestrom <[email protected]> Acked-by: Kristian H. Kristensen <[email protected]>
* st/mesa: fix Sanctuary and Tropics by disabling ARB_gpu_shader5 for themMarek Olšák2019-11-111-0/+2
| | | | | | | They use the "sample" keyword as a variable name. Cc: 19.2 19.3 <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* gallium: dri2: Use index as plane number.Lepton Wu2019-11-061-1/+1
| | | | | | | | | | This fix wrong color when playing video under Android + virgl configuration. Fixes: 2decad495f3 ("gallium/dri2: Support images with multiple planes for modifiers") Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Lepton Wu <[email protected]>
* util: rename PIPE_ARCH_*_ENDIAN to UTIL_ARCH_*_ENDIANDylan Baker2019-11-051-3/+3
| | | | | | | | | | | As requested by Tim. This was generated with: grep 'PIPE_ARCH_.*_ENDIAN' -rIl | xargs sed -ie 's@PIPE_ARCH_\(.*\)_ENDIAN@UTIL_ARCH_\1_ENDIAN@'g v2: - add this patch Reviewed-by: Eric Engestrom <[email protected]>
* gallium/osmesa: Use PIPE_ARCH_*_ENDIAN instead of little_endian functionDylan Baker2019-11-051-20/+15
| | | | Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_IS_EMPTY macroTimothy Arceri2019-10-287-12/+12
| | | | | | | Just use the inlined function directly. The new function was introduced in addcf410. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_DEL macroTimothy Arceri2019-10-285-8/+8
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_ADDTAIL macroTimothy Arceri2019-10-285-11/+11
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_INITHEAD macroTimothy Arceri2019-10-287-16/+16
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* st/dri: add support for EGL_EXT_image_flush_externalMarek Olšák2019-10-251-40/+91
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-By: Tapani Pälli <[email protected]>
* st/dri: assume external consumers of back buffers can write to the buffersMarek Olšák2019-10-251-6/+6
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-By: Tapani Pälli <[email protected]>
* st/nine: Fix unused variable warnings in release build.Timur Kristóf2019-10-251-9/+9
| | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/nine: Fix build with -Werror=empty-bodyTimur Kristóf2019-10-251-3/+3
| | | | | | | | Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1995 Fixes: 8d43e2b2ded0fe3c82d4 ("meson: add -Werror=empty-body to disallow `if(x);`") Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* gallium: do not increase ref count of the new throttle fenceJames Xiong2019-10-171-2/+4
| | | | | | | | | | | | | | A new throttle fence was initialized to 1, and increased by 1 again when it's put in drawable->throttle_fence; the ref was decreased by 1 when it's removed from drawable->throttle_fence, and never reached to 0, caused leak. Fixes: ff77bf5cbf7 ("gallium: simplify throttle implementation") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1949 Signed-off-by: James Xiong <[email protected]> Reported-by: Florian Wesch <[email protected]> Reviewed-by: Jose Maria Casanova Crespo <[email protected]>
* gallium/xlib: Fix xmesa drawable creationAdam Jackson2019-10-151-6/+2
| | | | | | | | | | | | | | The first time you call glXMakeCurrent, current != ctx. As a result we would never look up whether the drawable already had an XMesaDrawable, and would instead always create one. Then XMesaBufferList would have two different buffers for the same XID, and you'd be reading and drawing to different places, and that's not what you want at all. Instead just always look up the drawable. Fixes: db8be355 (gallium/xlib: Remove drawable caching from the MakeCurrent path) Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1196 Reviewed-by: Michel Dänzer <[email protected]>
* gallium: rename PIPE_CAP_MAX_FRAMES_IN_FLIGHT to PIPE_CAP_THROTTLEJames Xiong2019-10-141-2/+1
| | | | | | | | | v2: [ Michel Dänzer ] * Update src/gallium/docs/source/screen.rst accordingly Signed-off-by: James Xiong <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> # v1 Reviewed-by: Marek Olšák <[email protected]> # v1
* gallium: simplify throttle implementationJames Xiong2019-10-144-110/+13
| | | | | | | | | | | All gallium drivers currently set MAX_FRAME_IN_FLIGHT to either 1 or 0, which means that the drivers either throttle on the previous render or don't throttle, the current implementation is more complicated than necessary and can be simplified. Signed-off-by: James Xiong <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* meson: fix gallium-osmesa to build for windowsDylan Baker2019-10-101-1/+10
| | | | | | | | v2: - set so_version to '' (only affects windows) - always set lib prefix to 'lib', even on msvc v5: - key NO_EXPORTS on shared glapi instead of gles. Acked-by: Kristian H. Kristensen <[email protected]>
* meson: build wgl state trackerDylan Baker2019-10-101-0/+57
| | | | | | | | v4: - Handle enable gles properly - Add comments about what various #defines do v5: - key NO_EXPORTS on shared glapi instead of gles. Acked-by: Kristian H. Kristensen <[email protected]>
* clover: fix the nir_serialize build failureMarek Olšák2019-10-101-1/+1
| | | | Fixes: dd4cc56ebd0 "nir: add a strip parameter to nir_serialize"
* clover: Remove unused codeMatt Turner2019-10-091-17/+0
| | | | | Fixes: 96b592696f1 ("gallium: Require LLVM >= 3.9") Bug: https://bugs.gentoo.org/685678
* clover: use iterator_range in get_kernel_nodesGreg V2019-10-091-2/+2
| | | | | | With libc++ (LLVM's STL implementation), the original code does not compile because an appropriate vector constructor cannot be found (for the _ForwardIterator one, requirement is_constructible is not satisfied).
* vl: use u_format in vl_video_buffer_formatsMarek Olšák2019-10-091-4/+2
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* meson: use idep_nir instead of libnir in libclnirEric Engestrom2019-10-071-2/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* Revert "Revert "st/dri2: Implement DRI2bufferDamageExtension""Boris Brezillon2019-10-071-0/+35
| | | | | | | This reverts commit 19546108d3dd5541a189e36df4ea83b3f519e48f. This commit breaks the build because lima implements ->set_damage_region(). I guess we'll need more discussion before removing the ->set_damage_region() hook.
* Revert "st/dri2: Implement DRI2bufferDamageExtension"Boris Brezillon2019-10-071-35/+0
| | | | | | | | | | | | | | This reverts commit 492ffbed63a2a62759224b1c7d45aa7923d8f542. BACK_LEFT attachment can be outdated when the user calls KHR_partial_update(), leading to a damage region update on the wrong pipe_resource object. Let's not expose the ->set_damage_region() method until the core is fixed to handle that properly. Cc: [email protected] Signed-off-by: Boris Brezillon <[email protected]> Acked-by: Daniel Stone <[email protected]>
* st/dri: Perform MSAA downsampling for __DRI2_THROTTLE_COPYSUBBUFFERKenneth Graunke2019-10-051-2/+4
| | | | | | | | | | | | | | glXCopySubBufferMESA copies data from the back buffer to the front, so it needs to perform a MSAA downsampling operation just like glXSwapBuffers would. Currently, the CopySubBuffer implementations supply a throttle reason of __DRI2_THROTTLE_SWAPBUFFERS, so they hit this path and work today. But we'd like to avoid swapbuffer throttling in this case, so the next patch will change that reason. Tested-by: Michel Dänzer <[email protected]> # DRI3 only Reviewed-by: Michel Dänzer <[email protected]>
* meson: remove -DGALLIUM_SOFTPIPE from st/osmesaDylan Baker2019-10-011-1/+0
| | | | | | | | It's unused here, and undefined in scons. It is used in targets/osmesa, but it's properly defined there already. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* haiku: fix Mesa buildKen Mays2019-10-012-3/+11
| | | | | | | | | | | | | | | | | | | | 1. The hgl.c file is a read-only file versus read-write. Ref: src/gallium/state_trackers/hgl/hgl.c 2. I've included the Haiku-specific patches I used to get a successful build of Mesa 19.1.7 on Haiku using the meson/ninja build procedure. Shows "[764/764] linking target ... libswpipe.so" at build completion. v2: Remove autotools files (Eric) v3: Update the patch Reported-by: Ken Mays <[email protected]> Tested-by: Ken Mays <[email protected]> CC: [email protected] Reviewed-by: Alexander von Gluck IV <[email protected]>
* meson: gallium media state trackers require libdrm with x11Dylan Baker2019-09-304-8/+14
| | | | | | | | v2: - update copyright year in all changed files - rebase on master Cc: 19.1 19.2 <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* meson: Link xvmc with libxvDylan Baker2019-09-271-3/+7
| | | | | | | | | | | Prior to xvmc 1.0.12 libxvmc incorrectly required libxv, but that was fixed. This results in compilation failures for the gallium xvmc tracker and tools. This patch fixes that by explicitly linking to libxv. Fixes: 22a817af8a89eb3c762fc3e07b443a3ce37d7416 ("meson: build gallium xvmc state tracker") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1844 Reviewed-by: Adam Jackson <[email protected]>
* meson: Try finding libxvmcw via pkg-config before using find_libraryDylan Baker2019-09-271-2/+7
| | | | | | | | | | | | This fixes cross compiling issues, because pkg-config is less likely to get the wrong libs. v2: - Fix typo in comment Fixes: 22a817af8a89eb3c762fc3e07b443a3ce37d7416 ("meson: build gallium xvmc state tracker") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/939 Reviewed-by: Adam Jackson <[email protected]>
* st/nine: Ignore D3DSIO_RET if it is the last instruction in a shaderDanylo Piliaiev2019-09-251-1/+7
| | | | | | | | | | | | | | RET as a last instruction could be safely ignored. Remove it to prevent crashes/warnings in case underlying driver doesn't implement arbitrary returns. A better way would be to remove the RET after the whole shader is parsed which will handle a possible case when the last RET is followed by a comment. CC: <[email protected]> Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* clover: eliminate "ignoring attributes on template argument" warningKarol Herbst2019-09-251-1/+10
| | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* clover/codegen: remove unused get_symbol_offsets functionKarol Herbst2019-09-251-12/+0
| | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* clover/llvm: remove harmful std::move callKarol Herbst2019-09-251-1/+1
| | | | | | | | both clang and gcc warn with: "moving a local object in a return statement prevents copy elision" Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* clover/nir: fix compilation with g++-5.5 and maybe earlierKarol Herbst2019-09-231-10/+7
| | | | | | | | fixes "sorry, unimplemented: non-trivial designated initializers not supported" Fixes: deb04adf2ae ("clover: add support for passing kernels as nir to the driver") Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* clover: add support for passing kernels as nir to the driverKarol Herbst2019-09-216-7/+245
| | | | | | | | | | | | | v2: minor formatting fixes v3: call glsl_type_singleton_init_or_ref and glsl_type_singleton_decref v4: capitalize and punctuate comments fix text_executable -> text_intermediate in TODO make glsl_type_singleton wrapper static v5: rewrite how we run the nir passes v6: fix unhandled case switch warning in st/mesa Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> (v4)
* clover: prepare supporting multiple IRsKarol Herbst2019-09-213-6/+64
| | | | | | | | | | | v2: rework arguments to compiler::compile_program add assert to device::ir_format v3: remove PIPE_SHADER_IR_SPIRV change title Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> (v2) Reviewed-by: Pierre Moreau <[email protected]>
* clover: add support for drivers having no proper binary formatKarol Herbst2019-09-211-2/+3
| | | | | | | | | | | | | Most drivers have actually no binary format and just store the IR directly as a single entry point blob. v2: add a cap to switch between single or multi entry point binaries v3: remove the entry_point field v4: remove PIPE_CAP_MULTI_ENTRY_POINT_BINARIES v5: remove supports_multiple_entry_points Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>