aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
Commit message (Collapse)AuthorAgeFilesLines
* gallium: change comments to remove 'state tracker'Marek Olšák2020-05-137-12/+12
| | | | | | | Acked-by: Eric Anholt <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
* gallium: rename 'state tracker' to 'frontend'Marek Olšák2020-05-131-1/+1
| | | | | | | Acked-by: Eric Anholt <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
* gallium: add pipe cap for scissored clears and pass scissor state to clear() ↵Mike Blumenkrantz2020-04-291-1/+1
| | | | | | | | | | | | | | | | hook this adds a new pipe cap that drivers can support which enables passing buffer clears with scissor test enabled through to be handled by the driver instead of having mesa draw a quad also adjust all existing clear() hooks to have the new parameter Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Vasily Khoruzhick <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4310>
* svga: Treat forced coherent maps as maps of persistent memoryThomas Hellstrom2020-04-012-18/+7
| | | | | | | | | | | | | | | | | A previous commit made sure we sent a BindGBSurface command at map time rather than at unmap time for persistent memory. To be consistent, do the same for forced coherent maps. This makes it possible to avoid the explicit UpdateGBSurface at unmap time for discard maps and to instead rely on the kernel's dirty-tracking mechanism at the cost of an additional flush. Tested with SVGA_FORCE_COHERENT=1, piglit run quick. No regressions. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4399> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4399>
* svga, winsys/svga: Fix persistent memory discard mapsThomas Hellstrom2020-04-013-5/+38
| | | | | | | | | | | | | | | | | | | | The kernel driver requires immediate notification using a BindGBSurface command when a graphics coherent memory resource changes backing MOB, so that it can start dirty-tracking the new MOB. Since we always use graphics coherent memory for persistent memory, enqueue and flush a BindGBSurface commmand at map time rather than at unmap time. Since we're dealing with persistent memory, It's OK to flush while mapped. This fixes an issue with gnome-shell / Wayland which uses persistent memory together with discard maps when we advertise ARB_buffer_storage. XWayland clients will render incorrectly. Fixes: 71b43490dd ("svga: Support ARB_buffer_storage") Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4399>
* svga: Use pipe_shader_state_from_tgsi to set shader stateNeha Bhende2020-02-101-1/+1
| | | | | | | | | | | | Use pipe_shader_state_from_tgsi() to set shader state for transformed shader so that we get all correct data for respective shader state. This fixes several regressed glretrace, piglit crashes found during merging upsteam mesa Fixes: bf12bc2dd7a2 (draw: add nir info gathering and building support) Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix size of format_conversion_table[]Neha Bhende2020-02-101-0/+2
| | | | | | | | | | Since we are now using sparse matrix for format_conversion_table, we have to make sure we have last entry in table which gives the sense of required size of format_conversion_table Fixes: 84db6ba7 ("svga: Drop unsupported formats from the format table") Reviewed-by: Charmaine Lee <[email protected]>
* svga: Fix banded DMA uploadThomas Hellstrom2020-02-061-10/+11
| | | | | | | | | | | | | | | | | | A previous commit ("winsys/svga: Limit the maximum DMA hardware buffer size") made banded DMA transfer kick in when transfering gnome-shell window contents under gnome-shell / wayland. This uncovered a bug where we assumed that banded DMA transfers always occur to the top (y=0) of the surface. Fix this by taking the destination y offset into account. Cc: 19.2 19.3 20.0 <[email protected]> Fixes: 287c94ea498 ("Squashed commit of the following:") Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3733> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3733>
* util: Make helper functions for pack/unpacking pixel rows.Eric Anholt2020-02-041-14/+3
| | | | | | | | | Almost all users of the unpack functions don't have strides to plug in (and many are only doing one pixel!), and this will help simplify them. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2744>
* svga: Avoid discard DMA uploadsThomas Hellstrom2020-01-291-1/+1
| | | | | | | | | | | | Newer versions of the device code will make discard DMA uploads sub-optimal. Disable them for guest-backed aware code, where we previously had them conditionally enabled. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3614>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-1414-14/+14
| | | | | | | | | | | | | | | 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]>
* svga: check return value of define_query_vgpu{9,10}Philipp Sieweck2019-11-051-8/+23
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* util: remove LIST_IS_EMPTY macroTimothy Arceri2019-10-281-2/+2
| | | | | | | 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-282-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_ADD macroTimothy Arceri2019-10-282-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-282-2/+2
| | | | | | | 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-283-7/+7
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* svga: Fix banded DMA upload unmapThomas Hellstrom2019-10-241-1/+1
| | | | | | | | | | | | | | | | Even with banded DMA uploads, st->hwbuf is always non-NULL, but when we've allocated a software buffer to hold the full upload, unmapping of the hardware buffer has already been done before svga_texture_transfer_unmap_dma(), and the code was performing an unmap of an already mapped buffer. Fix this by testing for software buffer not present. Fixes: a9c4a861d5d ("svga: refactor svga_texture_transfer_map/unmap functions") Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: remove PIPE_SHADER_CAP_SCALAR_ISAMarek Olšák2019-10-101-6/+0
| | | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* svga: replace binary HAVE_LLVM checks with LLVM_AVAILABLEEric Engestrom2019-09-061-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Michel Dänzer <[email protected]>
* svga: Drop unsupported formats from the format table.Eric Anholt2019-08-191-170/+0
| | | | | | | | | | | Now that we're using the array initializers, we don't need to manually fill out all these stub entries. Produced with "sed -i '/.*INVALID.*INVALID.*INVALID/d' src/gallium/drivers/svga/svga_format.c" Acked-by: Jose Fonseca <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Remove duplication in the format table.Eric Anholt2019-08-191-329/+322
| | | | | | | | | | | | | By using the [ ] = {} array initializer syntax, we no longer need the entries to be listed in PIPE_FORMAT_* value order. This means that people adding new gallium formats don't need to cargo-cult changes to this driver or regress that non-unit-tested requirement. While I'm here, drop the lines for formats that no longer exist (the numbered ones in the table). Acked-by: Jose Fonseca <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Factor out the format conversion table entry lookup.Eric Anholt2019-08-191-16/+25
| | | | | | | | | | | Seemed like a sensible cleanup, while I was looking at whether I could make the table sparse. To make the svga table not require fixups on every new gallium format, we may want to change how it's populated. Acked-by: Jose Fonseca <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* gallium: add AYUV and XYUV formatsMike Blumenkrantz2019-07-311-0/+2
| | | | | | this only adds the PIPE_FORMAT members, not any direct handling for them Reviewed-by: Kenneth Graunke <[email protected]>
* tree-wide: replace MAYBE_UNUSED with ASSERTEDEric Engestrom2019-07-313-6/+6
| | | | | | Suggested-by: Jason Ekstrand <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* u_blitter: add a msaa parameter to util_blitter_clearPierre-Eric Pelloux-Prayer2019-07-231-1/+2
| | | | | | | Fixes: ea5b7de138b ("radeonsi: make gl_SampleMaskIn = 0x1 when MSAA is disabled") Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: switch boolean -> bool at the interface definitionsIlia Mirkin2019-07-227-46/+46
| | | | | | | | | | | | | | | | | | This is a relatively minimal change to adjust all the gallium interfaces to use bool instead of boolean. I tried to avoid making unrelated changes inside of drivers to flip boolean -> bool to reduce the risk of regressions (the compiler will much more easily allow "dirty" values inside a char-based boolean than a C99 _Bool). This has been build-tested on amd64 with: Gallium drivers: nouveau r300 r600 radeonsi freedreno swrast etnaviv v3d vc4 i915 svga virgl swr panfrost iris lima kmsro Gallium st: mesa xa xvmc xvmc vdpau va Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
* util: use standard name for snprintf()Eric Engestrom2019-07-192-9/+9
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util: use standard name for sprintf()Eric Engestrom2019-07-191-1/+1
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gallium: get rid of PIPE_CAP_SM3Erik Faye-Lund2019-07-101-1/+3
| | | | | | | | | | | | | | | | | | | | | PIPE_CAP_SM3 has always been an odd one out of all our caps. While most other caps are fine-grained and single-purpose, this cap encode several features in one. And since OpenGL cares more about single features, it'd be nice to get rid of this one. As it turns, this is now relatively simple. We only really care about three features using this cap, and those already got their own caps. So we can remove it, and make sure all current drivers just give the same response to all of them. The only place we *really* care about SM3 is in nine, and there we can instead just re-construct the information based on the finer-grained caps. This avoids DX9 semantics from needlessly leaking into all of the drivers, most of who doesn't care a whole lot about DX9 specifically. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
* gallium: Add CAP for opcode DIVGert Wollny2019-06-301-0/+2
| | | | | | | | Not all drivers support TGSI_OPCODE_DIV, so we should have a cap to be able to check this. Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: Support ARB_buffer_storageThomas Hellstrom2019-06-205-9/+33
| | | | | | | | | | | | This basically boils down to supporting persistent and coherent buffer storage. We chose to use coherent buffer storage for all persistent buffers even if it's not explicitly specified, since using glMemoryBarrier to obtain coherency would be particularly expensive in our driver stack, and require a lot of additional bookkeeping. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: Map vertex- index- and constant buffers ansynchronously when readingThomas Hellstrom2019-06-202-4/+9
| | | | | | | | | | | | | | | | | With SWTNL and index translation we're mapping buffers for reading. These buffers are commonly upload_mgr buffers that might already be referenced by another submitted or unsubmitted GPU command. A synchronous map will then trigger a flush and sync, at least on Linux that doesn't distinguish between read- and write referencing. So map these buffers async. If they for some obscure reason happen to be dirty (stream-output, buffer-copy), the resource_buffer code will read-back and sync anyway. For persistent / coherent buffers a corresponding read-back and sync will happen in the kernel fault handler. Testing: Piglit quick. No regressions. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: Fix index buffer uploadsThomas Hellstrom2019-06-206-172/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the case of SWTNL and index translation we were uploading index buffers and then reading out from them using the CPU. Furthermore, when translating indices we often cached the results with an upload_mgr buffer, causing the cached indexes to be immediately discarded on the next write to that upload_mgr buffer. Fix this by only uploading when we know the index buffer is going to be used by hardware. If translating, only cache translated indices if the original buffer was not a user buffer. In the latter case when we're not caching, use an upload_mgr buffer for the hardware indices. This means we can also remove the SWTNL hand-crafted index buffer upload mechanism in favour of the upload_mgr. Finally avoid using util_upload_index_buffer(). It wastes index buffer space by trying to make sure that the offset of the indices in the upload_mgr buffer is larger or equal to the position of the indices in the source buffer. From what I can tell, the SVGA device does not require that. Testing done: Piglit quick. No regressions. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* winsys/svga: Make it possible to specify coherent resourcesThomas Hellstrom2019-06-203-2/+8
| | | | | | | | Add a flag in the surface cache key and a winsys usage flag to specify coherent memory. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: add z24s8_as_r8g8b8a8 formatRob Clark2019-06-151-0/+1
| | | | | | | | | | | | This maps to a special format that recent generations of adreno have, for blitting z24s8. Conceptually it is similar to doing Z and/or S blits by pretending it is r8g8b8a8 (with appropriate writemask). But it differs when bandwidth compression is used, as z24 is a different type from r8g8b8. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* svga: Remove unnecessary check for the pre flush bit for setting vertex buffersCharmaine Lee2019-06-061-4/+4
| | | | | | | | | | This fixes the missing rebind when the can_pre_flush bit is not set and the vertex buffers are the same as what have been sent. Cc: [email protected] Reviewed-by: Neha Bhende <[email protected]> Signed-off-by: Charmaine Lee <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
* svga: clamp max_const_buffers to SVGA_MAX_CONST_BUFSBrian Paul2019-05-291-1/+2
| | | | | | In case the device reports 15 (or more) buffers. Reviewed-by: Charmaine Lee <[email protected]>
* gallium: Change PIPE_CAP_TGSI_FS_FBFETCH bool to PIPE_CAP_FBFETCH countKenneth Graunke2019-05-231-1/+1
| | | | | | | | | | | | | | TGSI's FBFETCH instruction currently only supports reading from a single render target, but NIR intrinsics can support multiple render targets. radeonsi can only support fetching from RT 0, but other drivers may be able to support fetching from any render target. To express this, this patch renames PIPE_CAP_TGSI_FS_FBFETCH to simply PIPE_CAP_FBFETCH, and converts it from a boolean "is FBFETCH supported?" to an integer number of render targets which can be fetched. Reviewed-by: Marek Olšák <[email protected]>
* svga: Add an environment variable to force coherent surface memoryThomas Hellstrom2019-05-175-28/+64
| | | | | | | | | | The vmwgfx driver supports emulated coherent surface memory as of version 2.16. Add en environtment variable to enable this functionality for texture- and buffer maps: SVGA_FORCE_COHERENT. This environment variable should be used for testing only. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: Set the rendered-to flag for dma transfers to surfacesThomas Hellstrom2019-05-171-0/+4
| | | | | | | | | | The rendered-to flag indicates that the HW surface content is more recent than the content of the mob. That's the case after a SurfaceDMA transfer to the surface. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Remove the surface_invalidate winsys functionThomas Hellstrom2019-05-173-13/+12
| | | | | | | | | | | Instead unconditionally call SVGA3D_InvalidateGBSurface() since it's needed also for Linux for dirty buffers and operation without SurfaceDMA. For non-guest-backed operation, remove the surface cache surface invalidation altogether. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* gallium: Redefine the max texture 2d cap from _LEVELS to _SIZE.Eric Anholt2019-05-131-8/+8
| | | | | | | | The _LEVELS assumes that the max is always power of two. For V3D 4.2, we can support up to 7680 non-power-of-two MSAA textures, which will let X11 support dual 4k displays on newer hardware. Reviewed-by: Marek Olšák <[email protected]>
* svga: add SVGA_NO_LOGGING env var (v2)Brian Paul2019-05-021-1/+15
| | | | | | | | | | valgrind crashes when we try to initialize host logging. This env var can be used to disable logging. v2: rebase onto "svga: move host logging to winsys". Cc: [email protected] Reviewed-by: Neha Bhende <[email protected]>
* svga: move host logging to winsysCharmaine Lee2019-05-026-502/+11
| | | | | | | | | This patch adds a host_log interface to svga_winsys and moves the host logging code to the winsys layer. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: Avoid bouncing buffer data in malloced buffersThomas Hellstrom2019-05-023-13/+36
| | | | | | | | | | | | | | Some constant- and texture upload buffer data may bounce in malloced buffers before being transferred to hardware buffers. In the case of texture upload buffers this seems to be an oversight. In the case of constant buffers, code comments indicate that we want to avoid mapping hardware buffers for reading when copying out of buffers that need modification before being passed to hardware. In this case we avoid data bouncing for upload manager buffers but make sure buffers that we read out from stay in malloced memory. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: set PIPE_CAP_MAX_FRAMES_IN_FLIGHT to 2 for all driversMarek Olšák2019-04-241-2/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* gallium: replace DRM_CONF_THROTTLE with PIPE_CAP_MAX_FRAMES_IN_FLIGHTMarek Olšák2019-04-231-0/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* svga: add new ATC formats to the format conversion tableJonathan Marek2019-04-231-0/+3
| | | | | | | Fixes the static assertion error. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* Delete autotoolsDylan Baker2019-04-152-51/+0
| | | | | | | | | | Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Marek Olšák <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Matt Turner <[email protected]>