summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
Commit message (Collapse)AuthorAgeFilesLines
* svga: Set alpha to 1 for non-alpha viewsThomas Hellstrom2017-06-071-0/+18
| | | | | | | | | | | Gallium RGB textures may be backed by imported ARGB svga3d surfaces. In those and similar cases we need to set the alpha value to 1 when sampling. Fixes piglit glx::glx-tfp Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Allow format differences in 16-bit RGBA surface sharingThomas Hellstrom2017-06-071-1/+5
| | | | | | | | | | | | | For the purpose of surface sharing, treat SVGA3D_R5G6B5 and SVGA3D_B5G6R5_UNORM as identical formats. This fixes the following piglit tests with dri3/xa: glx@glx-visuals-depth -pixmap glx@glx-visuals-stencil -pixmap Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Deepak Singh Rawat <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* tree-wide: remove trailing backslashEric Engestrom2017-06-071-1/+1
| | | | | | | | | Simple search for a backslash followed by two newlines. If one of the newlines were to be removed, this would cause issues, so let's just remove these trailing backslashes. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* gallium: Add a cap to check if the driver supports ARB_post_depth_coverageLyude2017-06-021-0/+1
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* svga: document some incorrect VGPU10 shader translation issuesBrian Paul2017-05-261-0/+9
| | | | | | | | | We have a few mistakes in our shader translation code, but the virtual GPU is forgiving. Reviewed-by: Michal Krol <[email protected]> Reviewed-by: Neha Bhende<[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: init svga_screen::swc_mutex with mtx_recursiveBrian Paul2017-05-242-1/+4
| | | | | | | | | | | | | | | | | | If the SVGA3D_BindGBSurface() call in svga_buffer_hw_storage_unmap() fails, we'll flush and that might involve unmapping other buffers. That leads to a recursive lock on svga_screen::swc_mutex and causes a deadlock. Fix this by initializing the mutex with mtx_recursive. Note that this only happened on Linux, not Windows. On Windows, the mutex functions are implemented with Win32 critical sections which support recursive locking. Also add a comment about this. Fixes VMware bug 1831549 (Unigine Tropics demo freeze on Linux). Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: Neha Bhende<[email protected]>
* svga: move logging initialization code into new functionBrian Paul2017-05-242-24/+31
| | | | | | Plus a few other minor clean-ups. Reviewed-by: Sinclair Yeh <[email protected]>
* svga: init local vars to silence uninitialized use warningsBrian Paul2017-05-241-3/+3
| | | | Reviewed-by: Sinclair Yeh <[email protected]>
* svga: log the process command line to the vmware.log fileBrian Paul2017-05-241-0/+16
| | | | | | | | | This is useful for Piglit when thousands of tests are run and we want to determine which test triggered a device error. v2: only log command line info if the new SVGA_EXTRA_LOGGING env var is set Reviewed-by: Charmaine Lee <[email protected]>
* svga: Limit svga message capability to newer compilersSinclair Yeh2017-05-241-4/+14
| | | | | | | | | | | The assembly code used by the SVGA message feature doesn't build properly with older compilers, so limit it to only gcc 5.3.0 and newer. Also modified the stubs to avoid "unused variable" warnings. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: Fix MSVC build.Brian Paul2017-05-241-2/+32
| | | | | | This let us compile the code with MSVC, but it no-ops the log function. Reviewed-by: Jose Fonseca <[email protected]>
* svga: Add the ability to log messages to vmware.log on the host.Sinclair Yeh2017-05-245-0/+471
| | | | | | | | For now this capability only exists in the SVGA driver but can be exported later if other modules, e.g. winsys, wants to use it for logging. Reviewed-by: Brian Paul <[email protected]>
* gallium: add PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTIONMarek Olšák2017-05-171-0/+1
| | | | | | for skipping mapped-buffer checking in every GL draw call Reviewed-by: Nicolai Hähnle <[email protected]>
* Android: push driver build details to driver makefilesRob Herring2017-05-111-0/+4
| | | | | | | | | | | | | src/gallium/targets/dri/Android.mk contains lots of conditional for individual drivers. Let's move these details into the individual driver makefiles. In the process, align the make driver conditionals with automake (i.e. HAVE_GALLIUM_*). Signed-off-by: Rob Herring <[email protected]> [Emil Velikov: add the radeon winsys for radeonsi] Signed-off-by: Emil Velikov <[email protected]>
* gallium: add PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEXMarek Olšák2017-05-101-0/+1
| | | | | | | The next patch will use it. This is really for svga and GL2-level drivers. Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: remove pipe_index_buffer and set_index_bufferMarek Olšák2017-05-105-35/+29
| | | | | | | | | | | | | | pipe_draw_info::indexed is replaced with index_size. index_size == 0 means non-indexed. Instead of pipe_index_buffer::offset, pipe_draw_info::start is used. For indexed indirect draws, pipe_draw_info::start is added to the indirect start. This is the only case when "start" affects indirect draws. pipe_draw_info::index is a union. Use either index::resource or index::user depending on the value of pipe_draw_info::has_user_indices. v2: fixes for nine, svga
* gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytesMarek Olšák2017-05-105-21/+17
|
* svga: implement sRGB rendering for imported surfacesNeha Bhende2017-04-281-2/+9
| | | | | | | | | | If texture is imported and templ format is sRGB, use compatible sRGB format to the imported texture format while creating surface view. tested with MTT piglit, glretrace, viewperf and conform Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: add function svga_linear_to_srgb()Neha Bhende2017-04-282-0/+29
| | | | | | | | This function will return compatible svga srgb format for corresponding linear format Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Add a more elaborate format compatibility determination v2Thomas Hellstrom2017-04-283-41/+93
| | | | | | | | | | | | | | dri3 is a bit sloppy about its format compatibility requirements, so add a possibility to import xrgb surfaces as argb textures and vice versa. At the same time, make the svga_texture_from_handle() function a bit more readable and fix the error path where we leaked a winsys surface. v2: Addressed review comments by Brian. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix vertex buffer binding issueBrian Paul2017-04-261-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we ran Viewperf11's Maya-03 test 3 we saw warnings about flushing the command buffer with mapped buffers. This happened when transitioning from hardware rendering to a 'draw' fallback path. The problem is the util_set_vertex_buffers_count() function doesn't do exactly what we want in svga_hwtnl_vertex_buffers(). In a case such as dst_count=2, dst={bufA, bufB}, count=1 and src={bufC}, when the function returns we'll have dst_count=2 and dst={bufC, bufB}. What we really want is dst_count=1 and dst={bufC, NULL}. As it was, we were telling the svga device that there were two vertex buffers when in fact we really only needed one for the subsequent drawing command. In this particular case, we first did hardware drawing with {bufA, bufB} then we transitioned to the 'draw' module, consuming vertex data from bufA and bufB and writing the new vertex data to bufC. bufA and bufB are mapped for reading when we flush the command buffer but should not be referenced by the command buffer. The above change fixes that. No Piglit regressions. Also tested with Viewperf, Google Earth, Heaven, etc. VMware bug 1842059 Reviewed-by: Charmaine Lee <[email protected]>
* svga: Removed the unused label 'done' in svga_validate_surface_view()Charmaine Lee2017-04-261-1/+0
| | | | Trivial fix
* svga: use the winsys interface to invalidate surfaceCharmaine Lee2017-04-261-5/+1
| | | | | | | | | | Instead of directly sending the InvalidateGBSurface command, this patch uses the invalidate_surface interface. Fixes Linux VM piglit failures including ext_texture_array-gen-mipmap, fbo-generatemipmap-array S3TC_DXT1 Reviewed-by: Brian Paul <[email protected]>
* svga: fix format for screen targetCharmaine Lee2017-04-261-0/+26
| | | | | | | | | | | | | | | | | | | This patch revises the fix in commit 606f13afa31c9f041a68eb22cc32112ce813f944 to properly translate the surface format for screen target. Instead of changing the svga format for PIPE_FORMAT_B5G6R5_UNORM to SVGA3D_R5G6B5 for all texture surfaces, this patch only restricts SVGA3D_R5G6B5 for screen target surfaces. This avoids rendering failures when specify a non-vgpu10 format in a vgpu10 context with software renderer. Fixes piglit failures spec@!opengl 1.1@draw-pixels, spec@!opengl 1.1@teximage-colors gl_r3_g3_b2 spec@!opengl 1.1@texwrap formats Tested Xorg with 16bits depth. Also tested with MTT piglit, MTT glretrace. Reviewed-by: Brian Paul <[email protected]>
* svga: cache the backing surface handle in the texture objectCharmaine Lee2017-04-265-10/+57
| | | | | | | | | | | | | | | | | | CinebenchR15 not only binds the same texture for rendering and sampling, it actually changes the framebuffer buffer attachment very often, causing a lot of backed surface view to be created and a lot of surface copies to be done. This patch caches the backed surface handle in the texture resource and allows the backed surface view to reuse the backed surface handle. With this patch, the number of backed surface view reduces from 1312 to 3. Unfortunately, this does not eliminate all the surface copies. There are still surface copies involved when we switch from original to backed surface handle for rendering. Tested with CinebenchR15, NobelClinicianViewer, Turbine, Lightsmark2008, MTT glretrace, MTT piglit. Reviewed-by: Brian Paul <[email protected]>
* svga: Update the backing resource only if neededCharmaine Lee2017-04-262-3/+14
| | | | | | | | | | | | | | This patch adds a timestamp in svga_surface structure to keep track of when the backing surface is last sync with the original resource. This helps to avoid unnecessary surface copy from the original resource to the backing surface if the original resource has not since been modified. This reduces the amount of surface copy with CinebenchR15. Tested with CinebenchR15, mtt glretrace. Reviewed-by: Brian Paul <[email protected]>
* svga: Set the surface dirty bit for the right surface viewCharmaine Lee2017-04-261-5/+19
| | | | | | | | For VGPU10, we will render to a backed surface view when the same resource is used for rendering and sampling. In this case, we will mark the dirty bit for the backed surface view. Reviewed-by: Brian Paul <[email protected]>
* svga: Move rendertarget view related fields to hw_clear stateCharmaine Lee2017-04-264-17/+18
| | | | | | | | This patch moves the rendertarget view related fields from svga_hw_draw_state to svga_hw_clear_state where all the hw framebuffer related state resides. Reviewed-by: Brian Paul <[email protected]>
* svga: Move setting the rendered_to flags to framebuffer emit timeCharmaine Lee2017-04-262-18/+28
| | | | | | | Instead of setting the rendered_to flags at set time, this patch moves the setting of the flags to framebuffer emit time. Reviewed-by: Brian Paul <[email protected]>
* svga: add const qualifiers on svga_check_sampler_view_resource_collision()Brian Paul2017-04-262-4/+4
| | | | | | We don't change any of the argument objects. Reviewed-by: Charmaine Lee <[email protected]>
* svga: improve surface view debug messagesBrian Paul2017-04-261-4/+5
| | | | | | The old ones were somewhat cryptic. Reviewed-by: Charmaine Lee <[email protected]>
* svga: add DEBUG_SAMPLERSBrian Paul2017-04-263-1/+4
| | | | | | | | The debug output in svga_create_sampler_state() was controlled by DEBUG_VIEWS but that's not consistent with the other debug output for sampler views. Create/use a new debug flag just for this. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fail screen creation if HW version is too oldBrian Paul2017-04-261-0/+7
| | | | | | | | Tested by verifying 3D acceleration works with HWv8 but not earlier. For HWv7 and older we get the GDI Generic renderer. Reviewed-by: Neha Bhende<[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* gallium: add PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERSSamuel Pitoiset2017-04-261-0/+3
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add PIPE_CAP_TGSI_TES_LAYER_VIEWPORTNicolai Hähnle2017-04-141-0/+1
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* svga: add context pointer to the invalidate surface interfaceCharmaine Lee2017-04-074-11/+16
| | | | | | | | | | | | | | With this patch, we will specify the current context when we invalidate the surface before the surface is put back to the recycled surface pool. This allows the winsys layer to use the specified context to do the invalidation rather than using the last context that referenced the surface. This prevents race condition if the last referenced context is now made current in another thread. Tested with MTT glretrace, NobelClinicianViewer. Reviewed-by: Sinclair Yeh <[email protected]>
* svga: remove pre-SVGA3D_HWVERSION_WS8_B1 codeBrian Paul2017-04-071-71/+5
| | | | | | | | 3D wasn't officially supported before virtual HW version 8 so we can remove this old code. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: remove redundant surface propagationCharmaine Lee2017-04-072-12/+8
| | | | | | | | | | | Currently, surface propagation for colliding render target resource is done at framebuffer emit time for vgpu10. This patch adds the surface propagation for non-vgpu10 path to emit_fb_vgpu9() and removes the redundant surface copy at set time. Tested with MTT glretrace, piglit, NobelClinicianViewer, Turbine, Cinebench. Reviewed-by: Neha Bhende <[email protected]>
* svga: Fix zslice index to svga_texture_copy_handle_resource()Charmaine Lee2017-04-071-7/+10
| | | | | | | | | | | The zslice index to svga_texture_copy_handle_resource() is not adjusted and should be a signed integer. This patch fixes piglit tests for non-vgpu10 including spec@arb_framebuffer_object@fbo-generatemipmap-3d [email protected]@execution@tex-miplevel-selection gl2:texture* 3d Tested with MTT piglit and glretrace
* svga: specify include path for git_sha1.h for out-of-src buildsBrian Paul2017-04-071-0/+3
| | | | | | | If we're doing an out-of-src build, we need to specify the #include patch to find git_sha1.h Reviewed-by: Charmaine Lee <[email protected]>
* svga: Fix out-of-sync backing surfaceCharmaine Lee2017-04-071-21/+70
| | | | | | | | | | | | | | | When a backing surface is reused, it is possible that the original surface has been changed. So before the backing surface is bound again, we need to sync up the surface. This patch creates a new helper function svga_texture_copy_handle_resource() to sync up the backing surface resource. This patch, together with the backing surface dirty bit fix, fixes the rendering corruption in NobelClinicianViewer when rotating the model. Also tested with MTT glretrace, piglit, Cinebench, Turbine. Reviewed-by: Brian Paul <[email protected]>
* svga: add a reset flag to svga_propagate_surface()Charmaine Lee2017-04-074-8/+19
| | | | | | | | | The reset flag specifies if the dirty bit needs to be reset after the surface is propagated to the texture. This is used to make sure that the dirty bit is not reset and stay unset before the surface is unbound. Reviewed-by: Brian Paul <[email protected]>
* svga: add the has_backed_views flagCharmaine Lee2017-04-073-0/+15
| | | | | | | | | The new has_backed_views flag specifies if any of the render target views or depth stencil view is a backing surface view. The flag is used in svga_propagate_rendertargets() so it can return early if there is no surface to propagate. Reviewed-by: Brian Paul <[email protected]>
* svga: only destroy render target view from a context that created itCharmaine Lee2017-04-071-12/+23
| | | | | | | | | | | | | | A texture can be destroyed from a different context from which it is created, but destroying the render target view from a different context will cause svga device errors. Similar to shader resource view, this patch skips destroying render target view or depth stencil view from a non-parent context. Fixes driver errors running NobelClinician Viewer application. Tested with NobelClinician Viewer, MTT piglit, glretrace. Reviewed-by: Brian Paul <[email protected]>
* svga: disable rasterization if rasterizer_discard is set or FS undefinedCharmaine Lee2017-04-076-39/+128
| | | | | | | | | | | | | | | | | | | With this patch, rasterization will be disabled if the rasterizer_discard flag is set or the fragment shader is undefined due to missing position output from the vertex/geometry shader. Tested with piglit test glsl-1.50-geometry-primitive-id-restart. Also tested with full MTT glretrace and piglit. v2: As suggested by Roland, to properly disable rasterization, besides setting FS to NULL, we will also need to disable depth and stencil test. v3: As suggested by Brian, set SVGA_NEW_DEPTH_STENCIL_ALPHA dirty bit in svga_bind_rasterizer_state() if the rasterizer_discard flag is changed. Reviewed-by: Brian Paul <[email protected]>
* svga: do not emulate wide points in GS when doing transform feedbackCharmaine Lee2017-04-071-3/+5
| | | | | | | | | | Emulating wide points in geometry shader when doing transform feedback is problematic. This patch disables the emulation. Tested with piglit test ext_transform_feedback-points. Also tested with MTT glretrace, mesa demos pointblast and spriteblast. Reviewed-by: Brian Paul <[email protected]>
* gallium: add PIPE_CAP_TGSI_BALLOTNicolai Hähnle2017-04-051-0/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* gallium: add sparse buffer interface and capabilityNicolai Hähnle2017-04-051-0/+1
| | | | | | | v2: - explain the resource_commit interface in more detail Reviewed-by: Marek Olšák <[email protected]>
* svga: add comment on svga_buffer_hw_storage_map()Brian Paul2017-04-031-0/+1
| | | | Trivial.
* gallium: Add a cap to check if the driver supports fill_rectangleLyude2017-03-311-0/+1
| | | | | | | | Changes since v1: - Add pipe caps for etnaviv, freedreno, swr and virgl Signed-off-by: Lyude <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>