summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
Commit message (Collapse)AuthorAgeFilesLines
* svga: update a few surface format namesBrian Paul2017-06-303-24/+24
| | | | | | To sync with in-house changes. Reviewed-by: Neha Bhende <[email protected]>
* svga: whitespace fixes in svga_resource_buffer_upload.cBrian Paul2017-06-301-15/+14
| | | | Trivial.
* svga: add mksstats for surface view emulationCharmaine Lee2017-06-301-10/+17
| | | | | | | Add mksstats for surface view emulation and also tighten the stat CreateBackedView for the actual creation of backed view. Reviewed-by: Brian Paul <[email protected]>
* svga: change error handling convention for svga_set_stream_output()Brian Paul2017-06-303-12/+18
| | | | | | | | | | | | | | | | | | In general, the functions which emit commands to the command buffer check for failure and return a PIPE_ERROR_x code. It's up to the caller to flush the buffer and retry the command. But svga_set_stream_output() did its own flushing and the callers never checked the return value (though, it would always be PIPE_OK) in practice. This patch changes svga_set_stream_output() so that it does not call svga_context_flush() when the buffer is full. And we update the callers to check the return value as we do for other functions, like svga_set_shader(). No Piglit regressions. Also tested w/ Nature demo. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fixed surface size to include array sizeCharmaine Lee2017-06-301-1/+2
| | | | | | | | | This patch fixes the total surface size in surface cache to include array size as well. Tested with MTT glretrace. Reviewed-by: Brian Paul <[email protected]>
* svga: loop over box.depth for ReadBack_image on each sliceNeha Bhende2017-06-301-7/+8
| | | | | | | | piglit test ext_texture_array-gen-mipmap is fixed with this patch. Tested with mtt piglit, glretrace, viewperf and conform. No regression. Reviewed-by: Brian Paul <[email protected]>
* svga: add mksstats for context creationCharmaine Lee2017-06-301-2/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* svga: re-validate sampler view at draw time if neededCharmaine Lee2017-06-304-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch validates those sampler views with backing copy of texture whose original copy has been updated since the view is last validated. This is done here at draw time because the texture binding might not have modified, hence validation is not triggered at state update time, and yet the texture might have been updated in another context, so we need to re-validate the sampler view in order to update the backing copy of the updated texture. This fixes a rendering flickering issue with Photoshop running in Linux VM with HWversion 11. The problem is Photoshop renders to texture A in context X, and then bind texture A to context Y. The first time when texture A is bound to context Y, cso calls pipe->set_sampler_views(). Validation of sampler views is done, rendering is fine. But when texture A is rendered to again in context X, and rebound in context Y, cso skips pipe->set_sampler_views() because texture A is already bound in context Y. SVGA driver is not given a chance to re-validate the texture binding, the backing copy of the texture is not updated, and hence causes black image. Tested with Photoshop, MTT glretrace, piglit. Fixes VMware bug 1769103. Reviewed-by: Jose Fonseca <[email protected]>
* Android: use symlinks for driver loadingRob Herring2017-06-291-0/+1
| | | | | | | | | Instead of having special driver loading logic for Android, create symlinks to gallium_dri.so so we can use the standard loading logic. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Rob Herring <[email protected]>
* svga: clean up format_cap_tableCharmaine Lee2017-06-271-403/+92
| | | | | | | | | | | Per Jose's suggestion, this patch cleans up format_cap_table to remove the unnecessary default cap value for vgpu10 formats since those devcap values can be retrieved from the device. Tested with MTT conform, glretrace, piglit in HWv13 and HWv8. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: fix the default devcap for SVGA3D_Z_D24S8_INTCharmaine Lee2017-06-271-4/+1
| | | | | | | | | | The default devcap for format SVGA3D_Z_D24S8_INT in HWv8 when its devcap is not explicitly advertised should be set to zero to match the default value in the device. Tested with MTT piglit in HW version 8. Reviewed-by: Neha Bhende <[email protected]>
* svga: create buffer surfaces for incompatible bind flagsCharmaine Lee2017-06-274-27/+217
| | | | | | | | | | | | | | | | | | | | | | In cases where certain bind flags cannot be enabled together, such as CONSTANT_BUFFER cannot be combined with any other flags, a separate host surface will be created. For example, if a stream output buffer is reused as a constant buffer, two host surfaces will be created, one for stream output, and another one for constant buffer. Data will be copied from the stream output surface to the constant buffer surface. Fixes piglit test ext_transform_feedback-immediate-reuse-index-buffer, ext_transform_feedback-immediate-reuse-uniform-buffer Tested with MTT piglit, MTT glretrace, Nature, NobelClinician Viewer, Tropics. v2: Fix bind flags compatibility check as suggested by Brian. v3: Use the list utility to maintain the buffer surface list. v4: Use the SAFE rev of LIST_FOR_EACH_ENTRY Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: do not unconditionally enable streamout bind flagCharmaine Lee2017-06-274-11/+78
| | | | | | | | | | | | | | | | | | Currently we unconditionally enable streamout bind flag at buffer resource creation time. This is not necessary if the buffer is never used as a streamout buffer. With this patch, we enable streamout bind flag as indicated by the state tracker. If the buffer is later bound to streamout and does not already has streamout bind flag enabled, we will recreate the buffer with the new set of bind flags. Buffer content will be copied from the old buffer to the new one. Tested with MTT piglit, Nature, Tropics, Lightsmark. v2: Fix bind flags check as suggested by Brian. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: pass tobind_flags to svga_buffer_handleCharmaine Lee2017-06-278-15/+26
| | | | | | | | This is to prepare for more bind_flags optimization in subsequent patches. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: pass bind_flags to surface create functionsCharmaine Lee2017-06-273-26/+34
| | | | | | | | This is to prepare for other bind_flags optimization in subsequent patches. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* svga: minor whitespace fixes in svga_pipe_vertex.cBrian Paul2017-06-221-6/+10
|
* svga: check return value from svga_set_shader( SVGA3D_SHADERTYPE_GS, NULL)Brian Paul2017-06-221-0/+2
| | | | | | | | | | | If the call fails we need to flush the command buffer and retry. In this case, we were failing to unbind the GS which led to subsequent errors. This fixes a bug replaying a Cinebench R15 apitrace in a Linux guest. VMware bug 1894451 cc: [email protected] Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix pre-mature flushing of the command bufferCharmaine Lee2017-06-223-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | When surface_invalidate is called to invalidate a newly created surface in svga_validate_surface_view(), it is possible that the command buffer is already full, and in this case, currently, the associated wddm winsys function will flush the command buffer and resend the invalidate surface command. However, this can pre-maturely flush the command buffer if there is still pending image updates to be patched. To fix the problem, this patch will add a return status to the surface_invalidate interface and if it returns FALSE, the caller will call svga_context_flush() to do the proper context flush. Note, we don't call svga_context_flush() if surface_invalidate() fails when flushing the screen surface cache though, because it is already in the process of context flush, all the image updates are already patched, calling svga_context_flush() can trigger a deadlock. So in this case, we call the winsys context flush interface directly to flush the command buffer. Fixes driver errors and graphics corruption running Tropics. VMware bug 1891975. Also tested with MTT glretrace, piglit and various OpenGL apps such as Heaven, CinebenchR15, NobelClinicianViewer, Lightsmark, GoogleEarth. cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* svga: add new num-failed-allocations HUD queryBrian Paul2017-06-165-2/+26
| | | | | | | This counter is incremented if we fail to allocate memory for vertex/index/const buffers, textures, etc. Reviewed-by: Neha Bhende <[email protected]>
* svga: add a few minor commentsBrian Paul2017-06-162-1/+6
| | | | Trivial.
* svga: add some missing SVGA_STATS_* enum values, prefix stringsBrian Paul2017-06-161-2/+15
| | | | | | | To fix the build when VMX86_STATS is defined. Also, some minor whitespace changes to match upstream code. Reviewed-by: Charmaine Lee <[email protected]>
* svga: Relax the format checks for copy_region_vgpu10 somewhatThomas Hellstrom2017-06-161-2/+26
| | | | | | | | | The new generic checks were actually more restrictive than the previous svga- specific tests and not vice versa. So bypass the common format checks for copy_region_vgpu10. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: Fix incorrect format conversion blit destinationThomas Hellstrom2017-06-161-1/+3
| | | | | | | | | | The blit.dst.resource member that was used as destination was modified earlier in the function, effectively making us try to blit the content onto itself. Fix this and also add a debug printout when the format conversion blits fail. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: Fix srgb copy_region regressionThomas Hellstrom2017-06-161-1/+4
| | | | | | | | This fixes a tf2 srgb copy_region regression from "svga: Rework the blit and resource_copy_region functionality v3" Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: Prefer accelerated blits over cpu copy regionThomas Hellstrom2017-06-161-5/+3
| | | | | | | | | | | | | | | | | This reduces the number of cpu copy_region fallbacks on a Nvidia system running the piglit command ./publish/bin/piglit run -1 -t copy -t blit tests/quick from 64789 to 780 Previously this has caused a regression in piglit test spec@!opengl [email protected], but I'm currently not able to reproduce that regression. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Support accelerated conditional blittingThomas Hellstrom2017-06-164-43/+62
| | | | | | | | | | | | | | | | | | The blitter has functions to save and restore the conditional rendering state, but we currently don't save the needed info. Since also the copy_region_vgpu10 path supports conditional blitting, we instead use the same function as the clearing routines and move that function to svga_pipe_query.c Note that we still haven't implemented conditional blitting with the software fallbacks. Fixes piglit nv_conditional_render::copyteximage Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Use utility functions to help determine whether we can use copy_regionThomas Hellstrom2017-06-161-6/+3
| | | | | | | | | | | | | | It seems like the SVGA tests are in general more stringent than the utility tests, but they also miss some blitter features like filters and window rectangles, and if new blitter features are added in the future, it might be possible that we forget adding tests for those. So in addition to the SVGA tests, use the utility tests to restrict the situations where we can use copy_region. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Rework the blit and resource_copy_region functionality v3Thomas Hellstrom2017-06-161-201/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This work was initially trigged by the fact that imported surfaces may be backed by other SVGA3D formats than the default. Therefore some fixes were needed to avoid using the copy_region_vgpu10() functionality for incompatible SVGA3D formats where the pipe formats were OK. This situation happens when using dri3. Also in some situations, for example where a R8G8_UNORM surface is backed by an SVGA3D_NV12 format, we can't use the copy_region functionality at all and thus need to fall back to the quad blitter also for the resource_copy_region function. This situation doesn't happen currently, but will if we start using video textures. The patch makes the blit- and copy_region paths similar and the decision whether to use a certain gpu command should now be easy to locate. Probably the resource_copy_region path will suffer from a minor additional cpu overhead, but on the other hand there are more cases now that we accelerate, since we try harder before falling back to cpu copies / blits. v2: Addressed review comments and fixed up piglit failures by sometimes preferring cpu_copy_region() over blit(). v3: Removed a stray test statement. Updated commit message. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: clamp device line width to at least 1 to fix HWv8 line stipplingBrian Paul2017-06-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The line stipple fallback code for virtual HW version 8 didn't work. With HW version 8, we were getting zero when querying the max line widths (AA and non-AA). This means we were setting the draw module's wide line threshold to zero. This caused the wide line stage to always get enabled. That caused the line stipple module to fall because the wide line stage was clobbering the rasterization state with a state object setting the line stipple pattern to 0xffff. Now the wide_lines variable in draw's validate_pipeline() will not be incorrectly set. Also improve debug output. BTW, also this fixes several other piglit tests: polygon-mode, primitive- restart-draw-mode, and line-flat-clip-color since they all use the draw module fallback. See VMware bug 1895811. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix git_sha1.h include path in Android.mk (v3)Mauro Rossi2017-06-151-0/+2
| | | | | | | | | | | | | | | | | | | | Adds libmesa_git_sha1 static (dummy) library to generate git_sha1.h with some polishing to header dependency on .git/HEAD and scripted rules. The now redundant generation rules are removed from Android.gen.mk libmesa_git_sha1 whole static depedency is added to libmesa_pipe_svga, libmesa_dricore and libmesa_st_mesa modules Fixes the following building error: external/mesa/src/gallium/drivers/svga/svga_screen.c:26:10: fatal error: 'git_sha1.h' file not found ^ 1 error generated. Fixes: 1ce3a27 ("svga: Add the ability to log messages to vmware.log on the host.") Reviewed-by: Emil Velikov <[email protected]>
* gallium: add PIPE_CAP_BINDLESS_TEXTURESamuel Pitoiset2017-06-141-0/+1
| | | | | | | | | Whether bindless texture operations are supported by the underlying driver. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* svga: Always set the alpha value to 1 when sampling using an XRGB viewThomas Hellstrom2017-06-071-13/+30
| | | | | | | | | | If the XRGB view is sampling from an ARGB svga format, change PIPE_SWIZZLE_W to PIPE_SWIZZLE_1 for all channels. Previously we unconditionally set PIPE_SWIZZLE_1 on the alpha channel which could be both insufficient and incorrect. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Fix imported surface view creationThomas Hellstrom2017-06-074-11/+33
| | | | | | | | | | When deciding to create a view with or without an alpha channel we need to look at the SVGA3D format and not the PIPE format. This fixes the glx-tfp piglit test for dri3/xa. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* 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
|