summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga
AgeCommit message (Collapse)AuthorFilesLines
2018-05-29gallium: add PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITYMarek Olšák1-0/+3
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2018-05-16svga: fix incompatible bind flags at buffer validation timeCharmaine Lee1-2/+7
At buffer resource validation time, if the resource handle is not yet created and if the initial buffer bind flags and the tobind flags are incompatible, just use the tobind flags to create the resource handle. On the other hand, if the bind flags are compatible, we can combine the bind flags for the resource handle creation. Fixes piglit gl-3.1-buffer-bindings crash. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-04-30gallium: add initial support for conservative rasterizationRhys Perry1-0/+13
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-04-19svga: Fix incorrect advertizing of EGL_KHR_gl_colorspaceThomas Hellstrom1-1/+1
When advertizing this extension, egl_dri2 uses the DRI2_RENDERER_QUERY extension to query whether an sRGB format is supported. That extension will query our driver with the BIND flag PIPE_BIND_RENDER_TARGET rather than PIPE_BIND_DISPLAY_TARGET which is used when building the configs. We only return the correct value for PIPE_BIND_DISPLAY_TARGET. The inconsistency causes EGL to crash at surface initialization if sRGB is not supported. Fix this by supporting both bind flags. Testing done: piglit egl_gl_colorspace srgb Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-03-23svga: simplify uses_flat_interp expression in emit_input_declarations()Brian Paul1-1/+1
Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-03-23svga: replace unsigned with proper enum namesBrian Paul2-15/+16
Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-03-23svga: use enum tgsi_opcodeBrian Paul2-5/+5
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-03-20gallium: add packed uniform CAPTimothy Arceri1-0/+1
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-03-02svga: add SVGA_NEW_PRESCALE to the tracked dirty mask for gsCharmaine Lee1-1/+2
Since geometry shader also consumes prescale constants, the geometry shader constant buffer will need to be updated when prescale factor is changed. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-03-02svga: fix blending regressionBrian Paul1-11/+24
The earlier Mesa commit 3d06c8afb5 ("st/mesa: don't translate blend state when it's disabled for a colorbuffer") subtly changed the details of gallium's per-RT blend state. In particular, when pipe_rt_blend_state[i].blend_enabled is true, we have to get the src/dst blend terms from pipe_rt_blend_state[i], not [0] as before. We now have to scan the blend targets to find the first one that's enabled (if any). We have to use the index of that target for getting the src/dst blend terms. And note that we have to set identical blend terms for all targets. This fixes the Piglit fbo-drawbuffers2-blend test. VMware bug 2063493. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-03-02svga: check svga_have_vgpu10() in svga_delete_blend_state()Brian Paul1-1/+1
We were calling SVGA3D_vgpu10_DestroyBlendState() when vgpu10 was not enabled (bs->id==0 by default), resulting in lots of device errors. Reviewed-by: Neha Bhende<bhenden@vmware.com>
2018-03-02svga: if svga_update_state() fails, skip the draw callBrian Paul1-5/+5
If svga_update_state() fails, we flush the command buffer and retry. If it fails again, it likely means we were unable to translate a shader for some reason (uses too many resources, for example). In that case, let's just skip the draw call. The alternative, just disabling the shader stage in question, would certainly lead to bad rendering anyway, and probably device errors. Fixes failed assertion running Piglit glsl-1.50/execution/ variable-indexing/gs-output-array-vec4-index-wr.shader_test since it uses too many GS output registers (though the test still fails). VMware bug 2063492. v2: also call pipe_debug_message() so apps or apitrace can be notified when this issue occurs. v3: use svga_update_state_retry(). Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-03-02svga: let svga_update_state_retry() return a boolBrian Paul2-6/+9
This will allow minor simplifications elsewhere. Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-03-02svga: s/unsigned/boolean/ for a few local varsBrian Paul1-6/+6
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-02-20svga: replaced 'unsigned' with proper enum types in shader codeBrian Paul1-12/+21
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-02-20svga: Fix a leftover debug hackThomas Hellstrom1-2/+2
Fix what appears to be a leftover debug hack. The hack would force the driver to take a different blit path; possibly, although unverified, reverting to software blits. Tested using piglit tests/quick. No related regressions. Cc: "17.2 17.3 18.0" <mesa-stable@lists.freedesktop.org> Fixes: 9d81ab7376 (svga: Relax the format checks for copy_region_vgpu10 somewhat) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104625 Reported-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2018-02-17gallium: allow drivers to impose BO flags restrictions on constant buffer 0Marek Olšák1-0/+1
Required by radeonsi for optimal behavior.
2018-02-15svga: replace gotos with else clausesBrian Paul3-23/+20
Simple clean-up. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-02-15svga: s/unsigned/enum pipe_shader_type/Brian Paul3-4/+6
Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-02-15svga: move duplicated code for setting fillmode/flatshade stateBrian Paul1-20/+10
Move the calls to svga_hwtnl_set_fillmode() and svga_hwtnl_set_flatshade() out of the two retry_draw_*() functions to the svga_draw_vbo() function. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-02-15svga: move svga_update_state() call in draw codeBrian Paul1-18/+19
This fixes a few Piglit transform feedback regressions caused by commit 7a1401938b351. In that change I moved the moved svga_update_state() into the loops, after the calls to svga_hwtnl_set_flatshade(). But svga_hwtnl_set_flatshade() actually depends on some derived shader state. This patch moves the svga_update_state() call into svga_draw_vbo() so it's not duplicated in two places. Fixes: 7a1401938b351 ("svga: clean up retry_draw_range_elements(), retry_draw_arrays()") Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-02-15svga: call tgsi_scan_shader() for dummy shadersBrian Paul2-0/+7
If we fail to compile the normal VS or FS we fall back to a simple/ dummy shader. We need to rescan the the shader to update the shader info. Otherwise, this can lead to further translations failures because the shader info doesn't match the actual shader. Found by adding some extra debug assertions in the state-update code while debugging something else. v2: also update shader generic_inputs/outputs, etc. per Charmaine Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-02-14gallium: drop all the guard band float caps.Dave Airlie1-5/+0
Nobody queries these and nobody sets them to anything useful, the docs say TODO. Drop them until a use appears. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-02-02gallium: Add a new A4B4G4R4 pipe format for Broadcom.Eric Anholt1-0/+1
The VC5 HW puts A in the low bits and R in the high bits. We can't just swizzle in the shaders because the blending HW can't pick what channel A is in, so make a new format to match it. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-02-01svga: remove unneeded #includes in svga_pipe_draw.cBrian Paul1-7/+0
Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-02-01svga: whitespace/formatting fixes in svga_pipe_draw.cBrian Paul1-33/+34
Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-02-01svga: clean up retry_draw_range_elements(), retry_draw_arrays()Brian Paul1-54/+27
Get rid of a bunch of goto spaghetti. Remove unneeded do_retry parameter. No Piglit changes. Also tested w/ Google Earth and other apps. Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-02-01svga: remove unused min/max_index params to draw_vgpu10()Brian Paul1-4/+3
Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-01-31svga: use opcode local var to simplify some codeBrian Paul1-4/+2
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-01-31svga: s/unsigned/VGPU10_OPCODE_TYPE/Brian Paul1-10/+11
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-01-30gallium: introduce PIPE_CAP_FENCE_SIGNAL v2Andres Rodriguez1-0/+1
Protects semaphore signaling functionality required by GL_EXT_semaphore. v2: s/semaphore/fence Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-01-30gallium: add type parameter to create_fence_fdAndres Rodriguez1-1/+3
An fd can potentially have different types of objects backing it. Specifying the type helps us make sure we treat the FD correctly. This is in preparation to allow importing syncobj fence FDs in addition to native sync FDs. Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-01-29svga: Check rasterization state object before checking poly_stipple_enableNeha Bhende1-1/+1
Sometimes rasterization state object could be empty. This is causing segfault on hw8,9,10 for some traces. This patch fixes enemy_territory_quake_wars_high, enemy_territory_quake_wars_low, etqw-demo, lightsmark2008, quake1 glretrace crashes on hw 8,9,10. Tested with mtt-glretrace and mtt-piglit. Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2018-01-29svga: Adjust alpha for S3TC_DXT1_EXT RGB formatsNeha Bhende1-0/+4
According to spec, S3TC_DXT1_EXT RGB formats are supposed to be opaque. Correspoding svga formats are not handling it so explicitly setting it to 1.0. This fixes piglit test spec@ext_texture_compression_s3tc@s3tc-targeted Note: This test is testcase for freedesktop bug 100925 Tested with mtt-piglit and mtt-glretrace on 8,9,10,11 and 15 Reviewed-by: Brian Paul <brianp@vmware.com>
2018-01-25svga: s/Bool/SVGA3dBool/ in SVGA3dDevCapResultBrian Paul1-3/+3
And fix whitespace. To sync up with in-house code. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-01-23svga: fix context alloc error handlingGrazvydas Ignotas1-1/+1
'cleanup' path is dereferencing 'svga' a lot, 'done' is a better choice. Found by Coccinelle. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2018-01-22svga: Prevent use after free.Jose Fonseca1-0/+1
Courtesy of clang static analyzer. I was hunting for potential sources of memory corruption using Mesa with a GL trace, and happened to find this (unrelated) issue. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2018-01-19autotools: include meson build files in tarballDylan Baker1-1/+2
This adds the meson.build, meson_options.txt, and a few scripts that are used exclusively by the meson build. v2: - Remove accidentally included changes needed to test make dist with LLVM > 3.9 Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Acked-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-17gallium: remove PIPE_CAP_USER_CONSTANT_BUFFERSMarek Olšák1-2/+0
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2018-01-17gallium: remove PIPE_CAP_TEXTURE_SHADOW_MAPMarek Olšák1-2/+0
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2018-01-17gallium: remove PIPE_CAP_TWO_SIDED_STENCILMarek Olšák1-2/+0
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2018-01-17svga: add num-commands-per-draw HUD queryBrian Paul6-0/+24
This query shows the ratio of total commands vs. drawing commands sent to the vgpu device. This gives some idea of how many state changes are sent per draw call. The closer the ratio is to 1.0, the better. Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com>
2018-01-11svga: simplify failure code in emit_rss_vgpu9()Brian Paul1-17/+12
No need for a goto. Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-01-11svga: remove unused fail parameter to EMIT_RS(), EMIT_RS_FLOAT()Brian Paul1-57/+57
Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-01-11svga: add assertion in svga_queue_rs()Brian Paul1-0/+1
Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-01-11svga: whitespace/formatting fixes in svga_state_rss.cBrian Paul1-79/+75
Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-12-28svga: update SVGA_NEW_ flags for updating sampler stateBrian Paul1-3/+4
The SVGA_NEW_FS flag is needed since we now examine the fragment shader's fs_shadow_compare_units flags. The SVGA_NEW_TEXTURE_FLAGS flag is not needed since it's only for pre-VGPU10. No piglit changes. This doesn't fix any known issues but it could pop up somewhere. Suggested by Charmaine. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-12-28svga: whitespace, formatting fixes in svga_state_tss.cBrian Paul1-34/+21
2017-12-28svga: check for null fs pointer in update_samplers()Brian Paul1-1/+1
This can happen when there's no active fragment shader, such as when using transform feedback. This wasn't hit by any Piglit test but is hit by Daniel Rákos' Nature demo. VMware bug 2026189. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-12-27svga: move variant->fs_shadow_compare_units assignmentBrian Paul1-2/+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>