summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
Commit message (Collapse)AuthorAgeFilesLines
* svga: replace gotos with conditionals in array drawing codeBrian Paul2017-08-212-32/+32
| | | | | | No Piglit regressions. Reviewed-by: Charmaine Lee <[email protected]>
* svga: whitespace clean-up in svga_draw_private.hBrian Paul2017-08-211-29/+27
| | | | Trivial.
* gallium: introduce PIPE_CAP_MEMOBJTimothy Arceri2017-08-031-0/+1
| | | | | | | | | | | | | | This can be used to guard support for EXT_memory_object and related extensions. v2: update gallium docs v3 (Timothy Arceri): - add cap to nv50 Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* gallium: add PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE and corresponding capNicolai Hähnle2017-08-021-0/+1
| | | | | | | | v2: rename cap to PIPE_CAP_QUERY_SO_OVERFLOW and be a bit more explicit in the documentation Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add PIPE_CAP_NIR_SAMPLERS_AS_DEREFNicolai Hähnle2017-07-311-0/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* svga: implement MSAA alpha_to_one featureBrian Paul2017-07-255-1/+57
| | | | | | | | | | | | | The device doesn't directly support this feature so we implement it with additional shader code which sets the color output(s) w component to 1.0 (or max_int or max_uint). Fixes 16 Piglit ext_framebuffer_multisample/*alpha-to-one* tests. v2: only support unorm/float buffers, not int/uint, per Roland. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: rework the FS white fragments codeBrian Paul2017-07-252-33/+21
| | | | | | | | | | When we forcibly write white to FS outputs (for XOR mode emulation) we were using a temp register. But that's not really necessary. This also fixes the case of writing white to multiple color buffers. Subsequent changes will build on this. Reviewed-by: Charmaine Lee <[email protected]>
* svga: Limit number of immediates in shaderNeha Bhende2017-07-221-3/+5
| | | | | | | | | | | | imm {128.0, -128.0, 2.0, 3.0} is used for lit instruction which is not used very frequently. So allocate it only if lit instruction is used. Tested with mtt piglit and mtt glretrace v2: As per Charmaine's comment Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix constant indices for texcoord scale factors and texture buffer sizeCharmaine Lee2017-07-221-9/+6
| | | | | | | | | | This patch fixes the ordering of the constant indices for texcoord scale factor and texture buffer size to match the order they were added to the constant buffer in svga_get_extra_constants_common(). Tested with MTT piglit, glretrace. Reviewed-by: Brian Paul <[email protected]>
* svga: fix unnormalized->normalized texture coordinate conversionNeha Bhende2017-07-223-3/+35
| | | | | | | | | | | | | Sometimes, converting unnormalized coordinates to normalized coordinates requires an epsilon value to produce the right texels with nearest filtering. Adding 0.0001 to the coordinates when the min/mag filter is nearest fixes the issue. Fixes piglit test fbo-blit-scaled-linear Tested with mtt-piglit, mtt-glretrace Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: only support 4x, 8x, 16x msaaBrian Paul2017-07-221-0/+5
| | | | | | | Skip 2x MSAA, for example, since it's seldom used and just bloats the list of pixel formats. Reviewed-by: Charmaine Lee <[email protected]>
* drivers/svga: Connect driver-side fence_* functionsSinclair Yeh2017-07-172-1/+56
| | | | | | | | | Connect fence_get_fd, fence_create_fd, and fence_server_sync. Return PIPE_CAP_NATIVE_FENCE_FD capability based on what the winsys reports Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* winsys/svga/drm: Create winsys interface for Fence FDSinclair Yeh2017-07-171-1/+33
| | | | | | | | The new interfaces will be used to enable EGL_ANDROID_native_fence_sync. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* drivers/svga, winsys/svga/drm: Thread through timeout for fence_finishSinclair Yeh2017-07-174-6/+12
| | | | | | | | | | | | The timeout parameter is required to implement EGL_ANDROID_native_fence_sync. v2 * Replaced default timeout from 0 to PIPE_TIMEOUT_INFINITE * Add more documentation to the new timeout parameter Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: whitespace clean-up in svga_winsys.hBrian Paul2017-07-171-67/+66
| | | | Trivial.
* svga: add some const qualifiersBrian Paul2017-07-171-3/+3
| | | | Trivial.
* svga: add comment about 'extra' constant locationsBrian Paul2017-07-171-1/+5
| | | | Trivial.
* svga: whitespace, formatting fixes in svga_swtnl_backend.cBrian Paul2017-07-121-34/+45
|
* svga: whitespace, formatting fixes in svga_swtnl_draw.cBrian Paul2017-07-121-9/+9
|
* svga: whitespace, formatting fixes in svga_swtnl_state.cBrian Paul2017-07-121-19/+19
|
* svga: move comment, declaration in svga_init_shader_key_common()Brian Paul2017-07-121-6/+5
| | | | | | | put the comment before the relevant code. Move declaration of swizzle_tab var to where it's used. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix texture swizzle writemaskingBrian Paul2017-07-111-0/+2
| | | | | | | | | | | | | | | Commit bfe1e7737a76e3b046 changed how texture swizzles are set up. This exposed a latent bug in the VMware driver: we were ignoring the texture instruction's writemask when applying the 0 and 1 swizzle terms. This wasn't caught by the Piglit texture swizzle test because it only exercises fixed function (no write masking). Fixes issues seen with ETQW apitrace. CC: <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: s/unsigned/enum tgsi_texture_type/Brian Paul2017-07-111-3/+4
| | | | | Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: s/unsigned/enum tgsi_swizzleBrian Paul2017-07-111-4/+4
| | | | | Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: s/unsigned/enum tgsi_interpolate_mode/Brian Paul2017-07-111-1/+2
| | | | | | | And s/unsigned/enum tgsi_interpolate_loc/ Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: s/unsigned/enum tgsi_file_type/Brian Paul2017-07-111-7/+7
| | | | | Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: s/unsigned/enum tgsi_semantic/Brian Paul2017-07-114-8/+10
| | | | | | | Makes gdb debugging a little nicer. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: fix PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE valueBrian Paul2017-07-101-1/+4
| | | | | | | | | | | | This query is supposed to return the max texture buffer size/width in texels, not size in bytes. Divide by 16 (the largest format size) to return texels. Fixes Piglit arb_texture_buffer_object-max-size test. Cc: [email protected] Reviewed-by :Charmaine Lee <[email protected]>
* svga: fix breakage in create_backed_surface_view()Brian Paul2017-07-101-4/+3
| | | | | | | | This fixes a regression in some piglit tests since commit 5e5d5f1a2eb. I think I mis-resolved the merge conflict when cherry-picking that commit to master. Reviewed-by: Charmaine Lee <[email protected]>
* svga: adjust line subpixel position for HWv8Brian Paul2017-07-071-1/+1
| | | | | | | | | | | | | | | | This fixes two regressions on HWv8: Piglit gl-1.0-ortho-pos Piglit/glean fbo This was caused by commit c2b92dada076a "svga: clamp device line width to at least 1 to fix HWv8 line stippling" This also fixes two conform tests: Vertex Order and Polygon Face No Piglit/conform changes with HWv9 or later. VMware bug 1905053 Reviewed-by: Charmaine Lee <[email protected]>
* Android: generate symlinks for all enabled gallium driversMauro Rossi2017-07-051-1/+1
| | | | | | | | | | | | Current post install command relies on GALLIUM_TARGET_DRIVERS variable, however variable needs to be initialized in src/gallium/Android.mk in order that all enabled gallium drivers symlinks are correctly generated. At the moment due to sorting of INC_DIRS and variable set with svga (vmwgfx) only vmwgfx_dri.so and virtio_gpu_dri.so symlinks are generated. Fixes: a3d98ca62f ("Android: use symlinks for driver loading") Reviewed-by: Emil Velikov <[email protected]>
* svga: don't call svga_texture_device_format_has_alpha() for PIPE_BUFFERBrian Paul2017-07-032-1/+5
| | | | | | | | | | | svga_texture_device_format_has_alpha() is only intended to work for texture resources, not buffer resources. This fixes a failed assertion in the svga_texture() cast function when running texture buffer tests. Also, add an assertion in svga_texture_device_format_has_alpha() to catch the issue sooner. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix texture buffer object regressionBrian Paul2017-07-031-9/+11
| | | | | | | | | | | | With change 8aba778fa2cd98a0b5a7429d3c5057778a0c808c we stopped binding sampler objects for texture buffers. That broke our texture sample / sampler view setup code. Now, we loop over the max(num samplers, num sampler views) and handle the sampler and view information separately. For texture buffers, the sampler will be NULL but the sampler view non-null. Reviewed-by: Charmaine Lee <[email protected]>
* svga: move assertion in draw_vgpu10()Brian Paul2017-07-031-1/+1
| | | | | | | The buffer binding flags aren't ensured until after the svga_buffer_handle() call, so move the assertion after it. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix buffer binding flags initializationBrian Paul2017-07-031-0/+6
| | | | | | | | | | | | | | | | | | | If a buffer is created/initialized with glNamedBufferData we will have no target (GL_ARRAY_BUFFER, GL_UNIFORM_BUFFER, etc) so the svga_buffer::bind_flags will be zero until we try to get the buffer handle. This patch initializes the svga_buffer::bind_flags field when it's zero. This fixes the Piglit arb_uniform_buffer_object-rendering-dsa test. Note that there's still issues in this area that'll have to be addressed in the future. For example, creating a buffer object as GL_UNIFORM_BUFFER and later using it as a vertex buffer will fail. Reviewed-by: Charmaine Lee <[email protected]>
* svga: add texture size/levels sanity check code in svga_texture_create()Brian Paul2017-06-301-0/+33
| | | | | | | | | The state tracker should never ask us to create a texture with invalid dimensions / mipmap levels. Do some assertions to check that. No Piglit regressions. Reviewed-by: Charmaine Lee <[email protected]>
* 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]>