summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga
AgeCommit message (Collapse)AuthorFilesLines
2018-11-02Gallium: Add format PIPE_FORMAT_R8_SRGBGert Wollny1-0/+1
This format is needed to support EXT_texture_sRGB_R8. THe patch adds a new format enum, the format entries in Gallium and and svga, the mapping between sRGB and linear formats, and tests. v2: - add mapping to linear format for PIPE_FORMATR_R8_SRGB v3: - Add texture format to svga format table since otherwise building mesa will fail when this driver is enabled. It was not tested whether the extension actually works. v4: - svga: remove the SVGA specific format definitions and table entries and only add correct the location of PIPE_FORMAT_R8_SRGB in the format_conversion_table (Ilia Mirkin) - Split patch (1/2) to separate Gallium part and mesa/st part. (Roland Scheidegger) - Trim the commit message to only contain the relevant parts from the split. v5: - svga: correct location of PIPE_FORMAT_SRGB_R8 (Ilia Mirkin) Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2018-10-30scons: drop unused HAVE_STDINT_H macroEric Engestrom2-10/+0
This was required back when MSVC didn't support C99 and was missing this header, but since MSVC 2013 (or maybe earlier?) this isn't it does and this code isn't doing anything anymore. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-10-30svga: Add missing include guardsMichał Janiszewski1-0/+5
Signed-off-by: Michał Janiszewski <janisozaur+signed@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2018-10-29svga: add missing meson build dependencyEric Engestrom1-1/+1
Fixes: a537231b226280bc1e5b7 "meson: build svga driver on linux" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-10-26scons/svga: remove opt from the list of valid build typesBrian Paul1-2/+0
This reverts commit a5fd54f8bf6713312fa5efd7ef5cd125557a0ffe. The whole point was to add a way to pass -DVMX86_STATS to the build, but we can do that with a command line argument when we invoke scons. Reviewed-by: José Fonseca <jfonseca@vmware.com>
2018-10-09svga: change svga_destroy_shader_variant() to return voidBrian Paul5-23/+6
svga_destroy_shader_variant() itself flushes and retries the command if there's a failure. So no need for the callers to do it. Other callers of the function were already ignoring the return value. This also fixes a corner-case double-free reported by Coverity (and reported by Dave Airlie). Tested with various OpenGL apps. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-20svga: fix uninitialized fields in DefineDepthStencilView/DefineStreamOutputCharmaine Lee1-0/+9
This patch fixes uninitialized fields in DefineDepthStencilView and DefineStreamOutput commands that are not relevant in SM4 device. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-20svga: Enable Opengl 3.3 compatibility profileNeha Bhende1-1/+1
With this patch, svga driver will start advertising OpenGL 3.3 compatibility profile. Tested with some mesa demos, piglit and glretrace. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-20svga: Apply texcoord scale factors only if there is sampler viewNeha Bhende1-1/+1
We need to convert unnormalized texcoords to normalized texcoords when we are sampling from texture. We don't need this conversion if there is no sampler view. Tested with piglit, glretrace Fixes vmware bug 2101970 Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-20svga: fix texture array layer index in transfer mapCharmaine Lee2-66/+42
In gallium, the layer index of a texture array to be mapped is specified in the z component, whereas in svga device, the index is specified in a separate argument. Currently in svga_texture_transfer_map(), we explicitly modify the z value in the base transfer map to 0 so the layer offset will not be applied twice, but this causes problem when state tracker later refers to the base transfer map and expects the slice index to be specified in z (commit 463b0ea1f6762b7e0536cfadc4e384840af3e8e0). To fix the problem, this patch makes a local copy of the box in svga_transfer and modifies the z value in this copy instead. Fixes spec@khr_texture_compression-astc piglit test crashes. Fixes regression in the dma path with commit 1fdd3dd94a. Tested with mtt glretrace, piglit on Windows VM and Linux VM. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: assorted fixes/changes in svga_pipe_blit.cBrian Paul1-27/+15
To align the code with VMware's in-house copy. Signed-off-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: set buffer bind_flags in svga_buffer_add_host_surface()Brian Paul1-0/+3
To match the in-house VMware code. Signed-off-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: add format conversion for legacy formatsCharmaine Lee4-332/+433
This patch extends the format_conversion table to support different view formats on texture buffer. For legacy image formats such as INTENSITY, LUMINANCE, LUMINANCE_ALPHA, special swizzle masks will be used on the red or RG channels. This fixes piglit test arb_texture_buffer_object-formats fs|vs arb Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: remove obsolete code to reemit gs bindingCharmaine Lee2-39/+0
The svga_reemit_gs_bindings function is no longer needed. Remove it. Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: move variant->fs_shadow_compare_units assignmentBrian Paul1-0/+2
Fixes a crash since the variant object isn't allocated until later in the function. Not sure how this got through. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: fix resource checking in is_blending_enabled()Charmaine Lee1-1/+2
This patch makes sure a valid color buffer is bound before checking its resource. This fixes Unigine Valley running in SM41 device. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: Use texture_copy_region instead of texture_copy_handle for multisamplingNeha Bhende1-9/+18
This fixes some of tests cases in arb_copy_image-formats and also fixes SurfaceCopy related errors in vmware.log when multi sampled surfaces are used. Tested with piglit, glretrace on windows and linux VM. v2: As per Brian's comment Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: add missing devcap check for texture array supportCharmaine Lee1-1/+11
The patch checks DXFMT_ARRAY devcap for texture array support. Tested with MTT-piglit. No regressions. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: no need to check MULTISAMPLE devcap for view formatCharmaine Lee1-1/+1
According to the current SVGA contract, any view format can be used on the underlying resource that is multisample. So there is no need to check the MULTISAMPLE devcap for the view format. Fixes black rendering issue with Tropics running with 4xMSAA. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: sync devcap name changes in svga3d_devcaps.hCharmaine Lee2-12/+12
Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: explicit set DXFMT_SHADER_SAMPLE for DS format for pre-SM41 deviceCharmaine Lee1-5/+6
Explicit set the DXFMT_SHADER_SAMPLE bit for depth stencil formats for pre-SM41 device only. This bit is now set by the SM41 device. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: remove unused variableCharmaine Lee1-1/+0
Trivial.
2018-09-10svga: draw round points when msaa is enabledBrian Paul1-13/+15
See comments for details. This allows the piglit ext_framebuffer_multisample-point-smooth test to pass. Also, test the pipe_rasterizer_state::point_quad_rasterization field to see if sprite point rasterization is needed because it's possible for no sprite_coord_enable bits to be set when drawing sprites. Finally, remove old, stale comments. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: check number of samples before emitting MSAA decls/opcodesBrian Paul1-2/+14
If real MSAA is not available, we only support 1 sample/pixel. In that case, we must not declare MSAA resources or emit MSAA opcodes. Do that by checking the sample count. Fixes several piglit MSAA tests, such as arb_texture_multisample-sample-depth (when the hard-coded sample count of 4 is fixed in that test). Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: remove obsolete comment on format_cap_table[]Brian Paul1-10/+0
We removed the special cases referred to in this comment in the commit "svga: add a separate function to get dx format capabilities from vgpu10 device". Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: allow TGSI_TEXTURE_CUBE_ARRAY in emit_tg4()Brian Paul1-7/+2
Technically, SM4.1 doesn't support cube map arrays, but our backend renderers actually do. This allows the Piglit textureGather cube map array tests to pass. Tested with GLrenderer, DX11renderer and SWrenderer. Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: no dma on multisample surfaceCharmaine Lee1-0/+7
Force direct map on multisample surface. Fixes SVGA Driver Errors running multisample piglit tests on Linux VM v2: use texture for the check. Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-09-10svga: src surface for IntraSurfaceCopy cannot be multisampleCharmaine Lee1-0/+4
Fixes SVGA Driver Errors with piglit test arb_copy_image-targets Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-09-10svga: fix missing format multisample devcap checkCharmaine Lee1-0/+1
In commit e4048f6cd1, svga_is_dx_format_supported() is supposed to also check the SVGA3D_DXFMT_MULTISAMPLE bit for multisample support of a format. Somehow that code is not included in that commit. This patch fixes it. Fixes piglit test spec@ext_framebuffer_multisample@formats all_samples. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: fix incorrect multisample support in VGPU9 deviceCharmaine Lee1-0/+4
Commit e4048f6cd1 unintentionally allows multisample support for VGPU9 device. This patch fixes this regression. Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-09-10svga: fix the missing devcap for SVGA3D_BC3_UNORM_SRGBCharmaine Lee1-0/+1
Set the devcap to SVGA3D_DEVCAP_DXFMT_BC3_UNORM_SRGB Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-09-10svga: add a separate function to get dx format capabilities from vgpu10 deviceCharmaine Lee1-97/+91
Currently we have one function to get format capabailities and we convert DX10 devcaps back to DX9. This can be confusing. Going forward we will have a separate function for dealing with dx formats. This patch also fixes the depth stencil devcap. Instead of hardcoding the capabilities for the depth stencil formats, we will inquire the device for the capabilities. Note: we will still need to explicity set the SVGA3D_DXFMT_SHADER_SAMPLE bit for SVGA3D_R32_FLOAT_X8X24 and SVGA3D_R24_UNORM_X8 since this bit is not advertised but supported by the device. v2: reapply the patch after svga_is_format_supported is moved to svga_format.c Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-09-10svga: assign a separate function for is_format_supported() for vgpu10 deviceCharmaine Lee3-18/+116
This patch adds a new function svga_is_dx_format_supported() to check for format support in a VGPU10 device. v2: reapply the patch after svga_is_format_supported is moved to svga_format.c Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-09-10svga: add some devcap debugging codeBrian Paul1-0/+193
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: fix depth and coverage mask output declarationCharmaine Lee1-3/+5
Set the component mask to zero for both registers. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: add sample positions for 2 samplesCharmaine Lee1-0/+7
Fixes piglit tests spec@arb_sample_shading@builtin-gl-sample-position 2 spec@arb_texture_multisample@fb-completeness@2 Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: check sample count devcapsCharmaine Lee1-0/+8
Check sample count devcaps from the svga device to determine the supported sample counts. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: fix 1-element cube map array issueBrian Paul2-5/+10
As with 1D and 2D array textures, if there's only one array element (one cubemap in this case) we have to issue different shader code. This fixes a number of Piglit cubemap array tests. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: simplify array test in svga_init_shader_key_common()Brian Paul1-11/+10
And squash commit a patch to silence a compiler warning (add default case to the switch statement). Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: sync svga3d_types.h with upstream changesCharmaine Lee1-10/+45
Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: add git version logging at init timeCharmaine Lee1-0/+3
Before we can log the git version in the host log, we'll add the git version in the init debug message. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: fix a typo in svga_texture_copy_region()Charmaine Lee1-1/+1
Trivial.
2018-09-10svga: use helper function to do copy regionCharmaine Lee1-21/+5
Use the common helper function svga_texture_copy_region for copy region command. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: fix cubemap array rendering with backed surface viewCharmaine Lee2-12/+83
This patch fixes the layer index when rendering to a backed surface view of a cubemap array. Fixes piglit test fbo-generatemipmap-cubemap array. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: add a helper function to send ResolveCopy commandCharmaine Lee2-6/+40
Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: sync svga3d header filesCharmaine Lee3-16/+98
This is a squash of what was orginally three commits. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-10svga: add SM4_1 enable debug printCharmaine Lee1-0/+4
Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: fix swizzling for texture gatherCharmaine Lee1-20/+33
Texture swizzling for texture gather needs to be done to the selected texels rather than to the returned vector. This patch has specical cases for the different swizzles in emit_tg4(). Fixes a lot of piglit texture gather tests. Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10svga: fix starting index for system valuesCharmaine Lee3-3/+13
Currently, the starting index for system values is assigned to the next index after the highest index of the tgsi declared input registers. But the tgsi index might be different from the actual assigned index, hence this might cause overlap of indices. With this patch, the shader linker keeps track of the highest index of the translated input registers, and the next index will be used for the starting index for system values. Fixes SHIM errors running arb_copy_image-formats on SM4_1 device. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10winsys/svga: Add support for new surface ioctl, multisample patternDeepak Rawat2-0/+26
Kernel driver version 2.15 added new surface ioctl named: DRM_VMW_GB_SURFACE_CREATE_EXT DRM_VMW_GB_SURFACE_REF_EXT The new ioctl has support for 64-bit svga3d_flags if DRM_VMW_PARAM_SM4_1 is available. Multisampling surface mob size calculation is added. Also synced the relevant header update. svga device modified the surface define command V3 with new parameter multisampling pattern. Adding support for that in winsys. Signed-off-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>