mesa.git
6 years agoi965/fs: Don't propagate conditional modifiers from integer compares to adds
Ian Romanick [Thu, 13 Sep 2018 00:16:50 +0000 (17:16 -0700)]
i965/fs: Don't propagate conditional modifiers from integer compares to adds

No shader-db changes on any Intel platform... which probably explains
why no bugs have been bisected to this problem since it landed in Mesa
18.1. :( The commit mentioned below is in 18.2, so 18.1 would need a
slightly different fix (due to code refactoring).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Fixes: 77f269bb560 "i965/fs: Refactor propagation of conditional modifiers from compares to adds"
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> (reviewed the original patch)
Cc: Matt Turner <mattst88@gmail.com> (reviewed the original patch)
6 years agoradv: Only allow 16 user SGPRs for compute on GFX9+.
Bas Nieuwenhuizen [Sun, 16 Sep 2018 10:28:33 +0000 (12:28 +0200)]
radv: Only allow 16 user SGPRs for compute on GFX9+.

Apparently for compute there are only 16 instead of the 32 for the
graphics path.

Fixes dEQP-VK.binding_model.descriptorset_random.sets16.noarray.ubolimitlow.sbolimitlow.imglimitlow.noiub.comp.0

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv: Set the user SGPR MSB for Vega.
Bas Nieuwenhuizen [Sun, 16 Sep 2018 10:17:00 +0000 (12:17 +0200)]
radv: Set the user SGPR MSB for Vega.

Otherwise using 32 user SGPRs would be broken.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv: Optimize rebinding the same descriptor set.
Bas Nieuwenhuizen [Sun, 16 Sep 2018 00:17:32 +0000 (02:17 +0200)]
radv: Optimize rebinding the same descriptor set.

This makes it cheaper to just change the dynamic offsets with
the same descriptor sets.

Suggested-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agor600/sb: use safe math optimizations when TGSI contains precise operations
Gert Wollny [Fri, 14 Sep 2018 14:56:48 +0000 (16:56 +0200)]
r600/sb: use safe math optimizations when TGSI contains precise operations

Fixes:
  dEQP-GLES3.functional.shaders.invariance.highp.common_subexpression_3
  dEQP-GLES3.functional.shaders.invariance.mediump.common_subexpression_3
  dEQP-GLES3.functional.shaders.invariance.lowp.common_subexpression_3

Signed-off-by: Gert Wollny <gw.fossdev@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
6 years agoandroid: broadcom/cle: export the broadcom top level path headers
Mauro Rossi [Sun, 26 Aug 2018 21:38:12 +0000 (23:38 +0200)]
android: broadcom/cle: export the broadcom top level path headers

Fixes the following building error in vc4 build:

In file included from external/mesa/src/gallium/drivers/vc4/kernel/vc4_render_cl.c:34:
In file included from external/mesa/src/gallium/drivers/vc4/kernel/vc4_drv.h:27:
In file included from external/mesa/src/gallium/drivers/vc4/vc4_simulator_validate.h:34:
In file included from external/mesa/src/gallium/drivers/vc4/vc4_context.h:39:
In file included from external/mesa/src/gallium/drivers/vc4/vc4_cl.h:56:
gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h:12:10:
fatal error: 'cle/v3d_packet_helpers.h' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Fixes: 5b102160ae ("broadcom/genxml: Introduce a V3D packet/struct decoder.")
Cc: "18.2" <mesa-stable@lists.freedesktop.org>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
6 years agoandroid: broadcom/cle: add gallium include path
Mauro Rossi [Sun, 26 Aug 2018 21:11:02 +0000 (23:11 +0200)]
android: broadcom/cle: add gallium include path

Fixes the following building error:

In file included from external/mesa/src/broadcom/cle/v3d_decoder.c:38:
In file included from external/mesa/src/broadcom/cle/v3d_packet_helpers.h:29:
external/mesa/src/gallium/auxiliary/util/u_math.h:42:10:
fatal error: 'pipe/p_compiler.h' file not found
         ^~~~~~~~~~~~~~~~~~~
1 error generated.

Fixes: 5b102160ae ("broadcom/genxml: Introduce a V3D packet/struct decoder.")
Cc: "18.2" <mesa-stable@lists.freedesktop.org>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
6 years agoandroid: broadcom/genxml: fix collision with intel/genxml header-gen macro
Mauro Rossi [Sat, 25 Aug 2018 16:17:23 +0000 (18:17 +0200)]
android: broadcom/genxml: fix collision with intel/genxml header-gen macro

Fixes the following building error, happening when building both intel and broadcom:

Gen Header: libmesa_broadcom_genxml_32 <= v3d_packet_v21_pack.h
FAILED: gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h
/bin/bash -c "python external/mesa/src/broadcom/cle/gen_pack_header.py \
external/mesa/src/broadcom/cle/v3d_packet_v21.xml \
> gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h"
Traceback (most recent call last):
  File "external/mesa/src/broadcom/cle/gen_pack_header.py", line 626, in <module>
    p = Parser(sys.argv[2])
IndexError: list index out of range

header-gen macro is already defined by Intel genxml building rules
and the existing header-gen does not have the $(PRIVATE_VER) argument,
infact the bash command line logged in the building error is missing
exactly $(PRIVATE_VER) argument

Renaming the macro as pack-header-gen in src/broadcom/Android.genxml.mk
solves the building error, another possible way is to keep the gen rules
commands expanded and not use the macros.

Fixes: 7f80a9ff13 ("vc4: Introduce XML-based packet header generation like Intel's.")
Cc: "18.2" <mesa-stable@lists.freedesktop.org>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
6 years agoanv/memcpy: fix build after starting to use addresses
Caio Marcelo de Oliveira Filho [Sat, 15 Sep 2018 03:53:22 +0000 (20:53 -0700)]
anv/memcpy: fix build after starting to use addresses

The offsets now come from the anv_address, these references were not
updated and using the old variable.

Fixes: e1ab8345574 "anv/memcpy: Use addresses instead of bo+offset"
Tested-by: Clayton Craft <clayton.a.craft@intel.com>
6 years agoanv/cmd_buffer: Take an address in emit_lrm
Jason Ekstrand [Tue, 11 Sep 2018 19:59:02 +0000 (14:59 -0500)]
anv/cmd_buffer: Take an address in emit_lrm

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agoanv/memcpy: Use addresses instead of bo+offset
Jason Ekstrand [Mon, 10 Sep 2018 21:43:34 +0000 (16:43 -0500)]
anv/memcpy: Use addresses instead of bo+offset

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agoanv/so_memcpy: Use the correct SO_BUFFER size on gen8+
Jason Ekstrand [Mon, 10 Sep 2018 21:37:17 +0000 (16:37 -0500)]
anv/so_memcpy: Use the correct SO_BUFFER size on gen8+

This shouldn't matter as we'll never write OOB anyway but we may as well
get it right.  It's supposed to be in dwords - 1.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
6 years agoac: fix get_image_coords() for radeonsi
Timothy Arceri [Fri, 27 Jul 2018 05:32:36 +0000 (15:32 +1000)]
ac: fix get_image_coords() for radeonsi

Because this was setting image to true we would end up calling
si_load_image_desc() when we sould be calling
si_load_sampler_desc().

This fixes an assert() in Deus Ex: MD

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agogallium/util: don't let child processes inherit our thread affinity
Marek Olšák [Thu, 13 Sep 2018 00:29:19 +0000 (20:29 -0400)]
gallium/util: don't let child processes inherit our thread affinity

v2: corrected the comment

6 years agogallium/util: start with a random L3 cache index for AMD Zen
Marek Olšák [Fri, 7 Sep 2018 19:37:45 +0000 (15:37 -0400)]
gallium/util: start with a random L3 cache index for AMD Zen

6 years agost/mesa: Validate the result of pipe_transfer_map in make_texture (v2)
Josh Pieper [Mon, 10 Sep 2018 02:03:27 +0000 (22:03 -0400)]
st/mesa: Validate the result of pipe_transfer_map in make_texture (v2)

When using Freecad, I was getting intermittent segfaults inside of
mesa.  I traced it down to this path in st_cb_drawpixels.c where the
result of pipe_transfer_map wasn't being checked.  In my case, it was
returning NULL because nouveau_bo_new returned ENOENT.  I'm by no
means a mesa developer, but this patch solves the problem for me and
seems reasonable enough.

v2: Marek - also unmap the PBO and release the texture, and call
    the make_texture function sooner for less cleanup

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
6 years agoradv: emit the initial config only once in the preambles
Samuel Pitoiset [Thu, 13 Sep 2018 10:30:21 +0000 (12:30 +0200)]
radv: emit the initial config only once in the preambles

It shouldn't be needed to emit the initial graphics or compute
state when beginning a new command buffer. Emitting them in
the preamble should be enough and this will reduce IB sizes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: fix setting global locations for indirect descriptors
Samuel Pitoiset [Wed, 12 Sep 2018 13:40:09 +0000 (15:40 +0200)]
radv: fix setting global locations for indirect descriptors

Indirect descriptors only need one entry, we don't have to
emit a location for every descriptors.

Fixes GPU hangs with new CTS:
dEQP-VK.binding_model.descriptorset_random.*

CC: 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: fix flushing indirect descriptors
Samuel Pitoiset [Wed, 12 Sep 2018 13:40:08 +0000 (15:40 +0200)]
radv: fix flushing indirect descriptors

Let say, we first bind a graphics pipeline that needs indirect
descriptors sets. The userdata pointers will be emitted at draw
time. Then if we bind a compute pipeline that doesn't need any
indirect descriptors, the driver will re-emit them for all
grpahics stages.

To avoid this to happen, just check the bind point type.

CC: 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: fix GPU hangs with 32-bit indirect descriptors
Samuel Pitoiset [Wed, 12 Sep 2018 13:40:07 +0000 (15:40 +0200)]
radv: fix GPU hangs with 32-bit indirect descriptors

LLVM 6 isn't affected.

Fixes GPU hangs with new CTS:
dEQP-VK.binding_model.descriptorset_random.*

CC: 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: handle loc->indirect correctly for the first descriptor
Samuel Pitoiset [Wed, 12 Sep 2018 13:40:06 +0000 (15:40 +0200)]
radv: handle loc->indirect correctly for the first descriptor

This was wrong for descriptor #0 when all of them are indirect.
This is because indirect_offset was 0 and we emitted a
"normal" descriptor pointer for nothing.

While we are at it remove
radv_userdata_info::indirect_offset which is useless.

CC: 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: bump the maximum number of arguments to 64
Samuel Pitoiset [Wed, 12 Sep 2018 13:40:05 +0000 (15:40 +0200)]
radv: bump the maximum number of arguments to 64

Bumping to 64 should be safe enough.

Fixes some crashes with new CTS:
dEQP-VK.binding_model.descriptorset_random.*

CC: 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: tidy up ac_setup_rings() for the GSVS rings
Samuel Pitoiset [Thu, 13 Sep 2018 13:58:02 +0000 (15:58 +0200)]
radv: tidy up ac_setup_rings() for the GSVS rings

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: fix setting the number of entries for GSVS on VI+
Samuel Pitoiset [Thu, 13 Sep 2018 13:58:01 +0000 (15:58 +0200)]
radv: fix setting the number of entries for GSVS on VI+

According to RadeonSI, it's unnecessary to multiply by
the stride. That field seems to always be 64.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: always compute the number of components from the output mask
Samuel Pitoiset [Thu, 13 Sep 2018 13:58:00 +0000 (15:58 +0200)]
radv: always compute the number of components from the output mask

That removes two special cases for clip/cull distances.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: emit data contiguously in the GS->VS ring buffer
Samuel Pitoiset [Thu, 13 Sep 2018 13:57:59 +0000 (15:57 +0200)]
radv: emit data contiguously in the GS->VS ring buffer

Instead of having holes. The other ring parameters like
offset and stride can be updated later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: make use of the output usage mask in GS copy shader
Samuel Pitoiset [Thu, 13 Sep 2018 13:57:58 +0000 (15:57 +0200)]
radv: make use of the output usage mask in GS copy shader

This is just for consistency because LLVM can detect and
remove unused loads.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: improve a comment in si_emit_set_predication_state()
Samuel Pitoiset [Wed, 12 Sep 2018 21:20:39 +0000 (23:20 +0200)]
radv: improve a comment in si_emit_set_predication_state()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: fix VK_EXT_conditional_rendering visibility
Samuel Pitoiset [Wed, 12 Sep 2018 21:20:38 +0000 (23:20 +0200)]
radv: fix VK_EXT_conditional_rendering visibility

It's actually just the opposite.

This fixes the new Sascha conditionalrender demo.

CC: 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: make use of ac_unpack_param() instead of ac_build_bfe()
Samuel Pitoiset [Thu, 13 Sep 2018 14:36:45 +0000 (16:36 +0200)]
radv: make use of ac_unpack_param() instead of ac_build_bfe()

Same code is generated because LLVM ends up by using bfe, but
that seems cleaner to me.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agonir: add loop unroll support for complex wrapper loops
Timothy Arceri [Wed, 11 Jul 2018 00:53:41 +0000 (10:53 +1000)]
nir: add loop unroll support for complex wrapper loops

In GLSL IR we cheat with switch statements and simply convert them
into loops with a single iteration. This allowed us to make use of
the existing jump instruction handling provided by the loop handing
code, it also allows dead code to be cleaned up once we have
wrapped the code in a loop.

However using loops in this way created previously unrollable loops
which limits further optimisations. Here we provide a way to unroll
loops that end in a break and have multiple other exits.

All shader-db changes are from the dolphin uber shaders. There is a
small amount of HURT shaders but in general the improvements far
exceed the HURT.

shader-db results IVB:

total instructions in shared programs: 10018187 -> 10016468 (-0.02%)
instructions in affected programs: 104080 -> 102361 (-1.65%)
helped: 36
HURT: 15

total cycles in shared programs: 220065064 -> 154529655 (-29.78%)
cycles in affected programs: 126063017 -> 60527608 (-51.99%)
helped: 51
HURT: 0

total loops in shared programs: 2515 -> 2308 (-8.23%)
loops in affected programs: 903 -> 696 (-22.92%)
helped: 51
HURT: 0

total spills in shared programs: 4370 -> 4124 (-5.63%)
spills in affected programs: 1397 -> 1151 (-17.61%)
helped: 9
HURT: 12

total fills in shared programs: 4581 -> 4419 (-3.54%)
fills in affected programs: 2201 -> 2039 (-7.36%)
helped: 9
HURT: 15

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agonir: propagates if condition evaluation down some alu chains
Timothy Arceri [Mon, 23 Jul 2018 04:38:34 +0000 (14:38 +1000)]
nir: propagates if condition evaluation down some alu chains

v2:
 - only allow nir_op_inot or nir_op_b2i when alu input is 1.
 - use some helpers as suggested by Jason.

v3:
 - evaluate alu op for single input alu ops
 - add helper function to decide if to propagate through alu
 - make use of nir_before_src in another spot

shader-db IVB results:

total instructions in shared programs: 9993483 -> 9993472 (-0.00%)
instructions in affected programs: 1300 -> 1289 (-0.85%)
helped: 11
HURT: 0

total cycles in shared programs: 219476091 -> 219476059 (-0.00%)
cycles in affected programs: 7675 -> 7643 (-0.42%)
helped: 10
HURT: 1

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agonir: evaluate if condition uses inside the if branches
Timothy Arceri [Wed, 29 Aug 2018 15:24:43 +0000 (10:24 -0500)]
nir: evaluate if condition uses inside the if branches

Since we know what side of the branch we ended up on we can just
replace the use with a constant.

All the spill changes in shader-db are from Dolphin uber shaders,
despite some small regressions the change is clearly positive.

V2: insert new constant after any phis in the
    use->parent_instr->type == nir_instr_type_phi path.

v3:
 - use nir_after_block_before_jump() for inserting const
 - check dominance of phi uses correctly

v4:
 - create some helpers as suggested by Jason.

v5 (Jason Ekstrand):
 - Use LIST_ENTRY to get the phi src

shader-db results IVB:

total instructions in shared programs: 9999201 -> 9993483 (-0.06%)
instructions in affected programs: 163235 -> 157517 (-3.50%)
helped: 132
HURT: 2

total cycles in shared programs: 231670754 -> 219476091 (-5.26%)
cycles in affected programs: 143424120 -> 131229457 (-8.50%)
helped: 115
HURT: 24

total spills in shared programs: 4383 -> 4370 (-0.30%)
spills in affected programs: 1656 -> 1643 (-0.79%)
helped: 9
HURT: 18

total fills in shared programs: 4610 -> 4581 (-0.63%)
fills in affected programs: 374 -> 345 (-7.75%)
helped: 6
HURT: 0

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agovirgl: adjust strides when mapping temp-resources
Erik Faye-Lund [Wed, 12 Sep 2018 07:48:41 +0000 (09:48 +0200)]
virgl: adjust strides when mapping temp-resources

When we're mapping temp-resources, we clip the resource to the
transfer-box, which means the stride might not be correct any more.

So let's update the stride from the temp-resource, and recompute the
layer-stride.

This fixes crashes when running dEQP with --deqp-gl-config-name=rgba8888d24s8ms4

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: a8987b88ff1 "virgl: add driver for virtio-gpu 3D (v2)"
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agonvir: Always split 64-bit IMAD/IMUL operations
Pierre Moreau [Mon, 4 Dec 2017 23:51:04 +0000 (00:51 +0100)]
nvir: Always split 64-bit IMAD/IMUL operations

Those operations do not map to actual hardware instructions, therefore
those should always be lowered to 32-bit instructions.

Fixes: 009c54aa7af "nv50/ir: Split 64-bit integer MAD/MUL operations"
Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
6 years agost/vdpau: Use output buffer as back buffer with 24-bit color only
Leo Liu [Fri, 7 Sep 2018 13:26:08 +0000 (09:26 -0400)]
st/vdpau: Use output buffer as back buffer with 24-bit color only

Using output buffer with 8 bits video RGB as back buffer
certainly is not working for 30 bits color depth visual.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
6 years agovl/dri: add color depth to vl winsys
Leo Liu [Mon, 10 Sep 2018 20:02:29 +0000 (16:02 -0400)]
vl/dri: add color depth to vl winsys

For VDPAU use later

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
6 years agovl/dri3: add support for 10 bits format
Leo Liu [Mon, 10 Sep 2018 19:33:28 +0000 (15:33 -0400)]
vl/dri3: add support for 10 bits format

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
6 years agovl/dri: add 10 bits format supports
Leo Liu [Fri, 7 Sep 2018 19:17:31 +0000 (15:17 -0400)]
vl/dri: add 10 bits format supports

v2: Tell B10G10R10X2 and R10G10B10X2 formats for different HW.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
6 years agoegl/android: Declare droid_load_driver() static
Kristian H. Kristensen [Wed, 12 Sep 2018 18:38:22 +0000 (11:38 -0700)]
egl/android: Declare droid_load_driver() static

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
6 years agoradv: fix function names for VK_EXT_conditional_rendering
Samuel Pitoiset [Wed, 12 Sep 2018 20:54:27 +0000 (22:54 +0200)]
radv: fix function names for VK_EXT_conditional_rendering

Otherwise they are not exported.

CC: 18.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Dave Airlie <airlied@redhat.com
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoanv: Silence a couple compiler warnings
Jason Ekstrand [Wed, 12 Sep 2018 22:02:57 +0000 (17:02 -0500)]
anv: Silence a couple compiler warnings

[63/93] Compiling C object 'src/intel/vulkan/...intel@vulkan@@anv_common@sta/anv_device.c.o'.
../src/intel/vulkan/anv_device.c:685:30: warning: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
   vk_free(&instance->alloc, instance->app_info.app_name);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/vulkan/util/vk_alloc.h:62:51: note: passing argument to parameter 'data' here
vk_free(const VkAllocationCallbacks *alloc, void *data)
                                                  ^
../src/intel/vulkan/anv_device.c:686:30: warning: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
   vk_free(&instance->alloc, instance->app_info.engine_name);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/vulkan/util/vk_alloc.h:62:51: note: passing argument to parameter 'data' here
vk_free(const VkAllocationCallbacks *alloc, void *data)
                                                  ^
[65/93] Compiling C object 'src/intel/vulkan/...ommon@sta/anv_nir_apply_pipeline_layout.c.o'.
../src/intel/vulkan/anv_nir_apply_pipeline_layout.c:519:13: warning: unused variable 'image_uniform' [-Wunused-variable]
   unsigned image_uniform;

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agoloader/dri3: Don't wait for fence of old buffer when re-allocating it
Michel Dänzer [Tue, 4 Sep 2018 16:18:57 +0000 (18:18 +0200)]
loader/dri3: Don't wait for fence of old buffer when re-allocating it

We only need to wait for the fence before drawing to a buffer, not
before reading from it.

This might avoid hangs when re-allocating the fake front buffer, similar
to the previous change. But I haven't seen any evidence that this was
actually happening in practice.

Tested-by: Olivier Fourdan <ofourdan@redhat.com>
6 years agoloader/dri3: Only wait for back buffer fences in dri3_get_buffer
Michel Dänzer [Tue, 4 Sep 2018 10:18:19 +0000 (12:18 +0200)]
loader/dri3: Only wait for back buffer fences in dri3_get_buffer

We don't need to wait before drawing to the fake front buffer, as front
buffer rendering by definition is allowed to produce artifacts.

Fixes hangs in some cases when re-using the fake front buffer, due to it
still being busy (i.e. in use for presentation).

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/106404
Bugzilla: https://bugs.freedesktop.org/107757
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
6 years agoglsl/linker: Check the invariance of built-in special variables
Vadym Shovkoplias [Fri, 7 Sep 2018 12:14:52 +0000 (15:14 +0300)]
glsl/linker: Check the invariance of built-in special variables

From Section 4.6.4 (Invariance and Linkage) of the GLSL ES 1.0 specification

    "The invariance of varyings that are declared in both the vertex and
     fragment shaders must match. For the built-in special variables,
     gl_FragCoord can only be declared invariant if and only if
     gl_Position is declared invariant. Similarly gl_PointCoord can only
     be declared invariant if and only if gl_PointSize is declared
     invariant. It is an error to declare gl_FrontFacing as invariant.
     The invariance of gl_FrontFacing is the same as the invariance of
     gl_Position."

Fixes:
    * glsl-pcoord-invariant.shader_test
    * glsl-fcoord-invariant.shader_test
    * glsl-fface-invariant.shader_test

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107734
Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agointel/tools: fix initial position of window in aubinator viewer
Tapani Pälli [Tue, 11 Sep 2018 07:32:32 +0000 (10:32 +0300)]
intel/tools: fix initial position of window in aubinator viewer

Currently position is set before widgets are sized by gtk and
calculation can get wrong results where window is positioned
offscreen. Patch fixes this by setting aubfile window position
as 0,0 only when size_allocate has been called to the widget.

Now window is always positioned to 0,0 if imgui.ini is missing.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agowinsys/virgl: avoid unintended behavior
Erik Faye-Lund [Thu, 6 Sep 2018 10:21:53 +0000 (11:21 +0100)]
winsys/virgl: avoid unintended behavior

If we end up never taking the loop that writes ret, we can end up with
an uninitialized value, and if we're *really* unlucky, that value can
be -1, causing us to go down an error-path instead of a success path.

This was obviously not intended, so let's just initialize this to zero.

Noticed by Valgrind:

Conditional jump or move depends on uninitialised value(s)
   at 0xBA640A0: virgl_drm_winsys_resource_cache_create (virgl_drm_winsys.c:348)
   by 0xBA62FCF: virgl_buffer_create (virgl_buffer.c:170)
   by 0xBA605AC: virgl_resource_create (virgl_resource.c:60)
   by 0xBCF816F: bufferobj_data (st_cb_bufferobjects.c:344)
   by 0xBCF816F: st_bufferobj_data (st_cb_bufferobjects.c:390)
   by 0xBB7E836: vbo_use_buffer_objects (vbo_exec_api.c:1136)
   by 0xBCFCC6E: st_create_context_priv (st_context.c:414)
   by 0xBCFD3CD: st_create_context (st_context.c:590)
   by 0xBBB30CA: st_api_create_context (st_manager.c:896)
   by 0xB981E76: dri_create_context (dri_context.c:155)
   by 0xB97BDCE: driCreateContextAttribs (dri_util.c:473)
   by 0x5288331: dri3_create_context_attribs (dri3_glx.c:309)
   by 0x5264D64: glXCreateContextAttribsARB (create_context.c:78)

Fixes: a8987b88ff1 ("virgl: add driver for virtio-gpu 3D (v2)")
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
6 years agotravis: use python3.5 for meson
Juan A. Suarez Romero [Mon, 10 Sep 2018 12:15:33 +0000 (14:15 +0200)]
travis: use python3.5 for meson

Newer Meson versions require python >=3.5. But in Trusty default python3
version is 3.4.x.

Install python3.5 and makes it the default version for Meson using
update-alternatives method.

CC: Jan Vesely <jano.vesely@gmail.com>
CC: Andres Gomez <agomez@igalia.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Jon Turney <jon.turney@dronecode.org.uk>
CC: Eric Engestrom <eric.engestrom@intel.com>
CC: Dylan Baker <dylan@pnwbakers.com>
Fixes: 3824c8e7cda97c3bf856 "meson: disable asserts by default on release builds"
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
6 years agoradv: adjust ESGS ring buffer size computation on VI+
Samuel Pitoiset [Mon, 10 Sep 2018 16:14:41 +0000 (18:14 +0200)]
radv: adjust ESGS ring buffer size computation on VI+

Noticed while working in this area. Ported from RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agomesa/texture: Also check for LA texture when querying intensity component size
Gert Wollny [Mon, 10 Sep 2018 10:39:44 +0000 (12:39 +0200)]
mesa/texture: Also check for LA texture when querying intensity component size

Gallium may pick L16A16_FLOAT to represent GL_INTENSITY16F if no intensity
format is provided by the driver. However, when calling

   glGetTexLevelParameteriv(..., GL_TEXTURE_INTENSITY_SIZE, ...)

mesa will return a zero size because the actually used format has no
intensity channel and as a fallback only the sizes of the red/green
channels are checked.

Also checking for LA sizes in the allocated texture resolves this problem.

v2: Only check alpha channel size and return it (Marek)
    L and A size are always the same in this case.

Fixes (on virgl):
  ext_framebuffer_multisample-fast-clear GL_ARB_texture_float *

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107832

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agonv50,nvc0: warn on not-explicitly-handled caps
Ilia Mirkin [Fri, 7 Sep 2018 02:33:13 +0000 (22:33 -0400)]
nv50,nvc0: warn on not-explicitly-handled caps

Not handling caps explicitly means that we're likely getting incorrect
values -- these need to be reviewed and set appropriately.

While we're at it, add in some missing caps, and set all the subpixel
stuff to 8 as that seems to be what the blob reports.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
6 years agomesa: remove duplicate dispatch sanity tests
Timothy Arceri [Fri, 7 Sep 2018 22:21:21 +0000 (08:21 +1000)]
mesa: remove duplicate dispatch sanity tests

This removes duplicate tests from gl_core_functions_possible
that are already covered by common_desktop_functions_possible.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agomesa: tidy up init_matrix_stack()
Timothy Arceri [Mon, 10 Sep 2018 10:41:27 +0000 (20:41 +1000)]
mesa: tidy up init_matrix_stack()

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
6 years agoradeon: fix ColorMask
Christopher Egert [Sat, 8 Sep 2018 00:16:48 +0000 (02:16 +0200)]
radeon: fix ColorMask

Since commit af3685d14936844f79e6f372b4b258e29375f21b various OpenGL applications regressed
on the classic mesa radeon driver.

Signed-off-by: Christopher Egert <cme3000@gmail.com>
CC: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
6 years agogallium: Correctly handle no config context creation
Elie Tournier [Thu, 6 Sep 2018 09:46:32 +0000 (10:46 +0100)]
gallium: Correctly handle no config context creation

This patch fixes the following Piglit test:
spec@egl_mesa_configless_context@basic
It also fixes few test in a virgl guest.

v2: Evaluate the value of no_config (Ilia)

Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
6 years agoradv: Support v3 of VK_EXT_vertex_attribute_divisor.
Bas Nieuwenhuizen [Mon, 10 Sep 2018 18:34:00 +0000 (20:34 +0200)]
radv: Support v3 of VK_EXT_vertex_attribute_divisor.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
CC: 18.2 <mesa-stable@lists.freedesktop.org>
6 years agoradeonsi/nir: port some bindless and sampler code from TGSI
Marek Olšák [Wed, 29 Aug 2018 06:45:49 +0000 (02:45 -0400)]
radeonsi/nir: port some bindless and sampler code from TGSI

These might be all missing changes for bindless textures.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradeonsi: adjust and simplify max_alloc_size determination
Marek Olšák [Tue, 28 Aug 2018 23:13:18 +0000 (19:13 -0400)]
radeonsi: adjust and simplify max_alloc_size determination

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradeonsi: split si_copy_buffer
Marek Olšák [Fri, 24 Aug 2018 04:28:16 +0000 (00:28 -0400)]
radeonsi: split si_copy_buffer

compute and SDMA will be added into it.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradeonsi: don't call VBO prefetch with size=0
Marek Olšák [Tue, 28 Aug 2018 21:45:00 +0000 (17:45 -0400)]
radeonsi: don't call VBO prefetch with size=0

for the next commit.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradeonsi: merge SI and CI dma_clear_buffer and remove the callback
Marek Olšák [Fri, 24 Aug 2018 04:04:11 +0000 (00:04 -0400)]
radeonsi: merge SI and CI dma_clear_buffer and remove the callback

also use assertions for the requirements that offset and size are a multiple
of 4.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradeonsi: fix GPU hangs with bindless textures and LLVM 7.0
Marek Olšák [Wed, 29 Aug 2018 05:34:46 +0000 (01:34 -0400)]
radeonsi: fix GPU hangs with bindless textures and LLVM 7.0

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoac: remove deprecated use of LLVMInt1Type()
Marek Olšák [Wed, 29 Aug 2018 04:17:26 +0000 (00:17 -0400)]
ac: remove deprecated use of LLVMInt1Type()

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoac: use iN_0/1 constants
Marek Olšák [Wed, 29 Aug 2018 04:15:16 +0000 (00:15 -0400)]
ac: use iN_0/1 constants

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoac: add radeon_info::num_good_cu_per_sh
Marek Olšák [Sat, 25 Aug 2018 02:57:17 +0000 (22:57 -0400)]
ac: add radeon_info::num_good_cu_per_sh

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoac: revert new LLVM 7.0 behavior for fdiv
Marek Olšák [Sat, 25 Aug 2018 03:00:37 +0000 (23:00 -0400)]
ac: revert new LLVM 7.0 behavior for fdiv

Cc: 18.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradeonsi: fix printing a BO list into ddebug reports
Marek Olšák [Tue, 28 Aug 2018 18:59:25 +0000 (14:59 -0400)]
radeonsi: fix printing a BO list into ddebug reports

important for debugging

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agor600: fix HTILE for NPOT textures with mipmapping
Marek Olšák [Tue, 28 Aug 2018 19:49:31 +0000 (15:49 -0400)]
r600: fix HTILE for NPOT textures with mipmapping

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agowinsys/radeon: fix CMASK fast clear for NPOT textures with mipmapping on SI/CI
Marek Olšák [Tue, 28 Aug 2018 18:39:09 +0000 (14:39 -0400)]
winsys/radeon: fix CMASK fast clear for NPOT textures with mipmapping on SI/CI

Cc: 18.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradeonsi: fix HTILE for NPOT textures with mipmapping on SI/CI
Marek Olšák [Tue, 28 Aug 2018 19:49:31 +0000 (15:49 -0400)]
radeonsi: fix HTILE for NPOT textures with mipmapping on SI/CI

VI uses addrlib so it's unaffected.

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agodocs: document new features/extensions in driver for WS 15 / Fusion 11
Brian Paul [Mon, 10 Sep 2018 17:29:12 +0000 (11:29 -0600)]
docs: document new features/extensions in driver for WS 15 / Fusion 11

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
6 years agosvga: assorted fixes/changes in svga_pipe_blit.c
Brian Paul [Thu, 6 Sep 2018 21:06:22 +0000 (15:06 -0600)]
svga: assorted fixes/changes in svga_pipe_blit.c

To align the code with VMware's in-house copy.

Signed-off-by: Brian Paul <brianp@vmware.com>
6 years agosvga: set buffer bind_flags in svga_buffer_add_host_surface()
Brian Paul [Thu, 6 Sep 2018 20:56:47 +0000 (14:56 -0600)]
svga: set buffer bind_flags in svga_buffer_add_host_surface()

To match the in-house VMware code.

Signed-off-by: Brian Paul <brianp@vmware.com>
6 years agosvga: add format conversion for legacy formats
Charmaine Lee [Sun, 29 Apr 2018 22:13:05 +0000 (15:13 -0700)]
svga: add format conversion for legacy formats

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>
6 years agosvga: remove obsolete code to reemit gs binding
Charmaine Lee [Thu, 15 Feb 2018 20:11:43 +0000 (12:11 -0800)]
svga: remove obsolete code to reemit gs binding

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>
6 years agosvga: move variant->fs_shadow_compare_units assignment
Brian Paul [Wed, 27 Dec 2017 18:36:03 +0000 (11:36 -0700)]
svga: move variant->fs_shadow_compare_units assignment

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>
6 years agosvga: fix resource checking in is_blending_enabled()
Charmaine Lee [Mon, 18 Dec 2017 17:41:54 +0000 (09:41 -0800)]
svga: fix resource checking in is_blending_enabled()

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>
6 years agosvga: Use texture_copy_region instead of texture_copy_handle for multisampling
Neha Bhende [Wed, 13 Dec 2017 23:02:13 +0000 (15:02 -0800)]
svga: Use texture_copy_region instead of texture_copy_handle for multisampling

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>
6 years agosvga: add missing devcap check for texture array support
Charmaine Lee [Fri, 8 Dec 2017 05:29:49 +0000 (21:29 -0800)]
svga: add missing devcap check for texture array support

The patch checks DXFMT_ARRAY devcap for texture array support.

Tested with MTT-piglit. No regressions.

Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agosvga: no need to check MULTISAMPLE devcap for view format
Charmaine Lee [Wed, 6 Dec 2017 23:33:45 +0000 (15:33 -0800)]
svga: no need to check MULTISAMPLE devcap for view format

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>
6 years agosvga: sync devcap name changes in svga3d_devcaps.h
Charmaine Lee [Thu, 7 Dec 2017 17:52:47 +0000 (09:52 -0800)]
svga: sync devcap name changes in svga3d_devcaps.h

Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agosvga: explicit set DXFMT_SHADER_SAMPLE for DS format for pre-SM41 device
Charmaine Lee [Thu, 7 Dec 2017 17:35:00 +0000 (09:35 -0800)]
svga: explicit set DXFMT_SHADER_SAMPLE for DS format for pre-SM41 device

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>
6 years agosvga: remove unused variable
Charmaine Lee [Thu, 7 Dec 2017 20:04:17 +0000 (12:04 -0800)]
svga: remove unused variable

Trivial.

6 years agosvga: draw round points when msaa is enabled
Brian Paul [Fri, 8 Dec 2017 04:12:10 +0000 (21:12 -0700)]
svga: draw round points when msaa is enabled

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>
6 years agosvga: check number of samples before emitting MSAA decls/opcodes
Brian Paul [Wed, 6 Dec 2017 03:41:55 +0000 (20:41 -0700)]
svga: check number of samples before emitting MSAA decls/opcodes

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>
6 years agosvga: remove obsolete comment on format_cap_table[]
Brian Paul [Tue, 5 Dec 2017 00:09:24 +0000 (17:09 -0700)]
svga: remove obsolete comment on format_cap_table[]

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>
6 years agosvga: allow TGSI_TEXTURE_CUBE_ARRAY in emit_tg4()
Brian Paul [Fri, 17 Nov 2017 18:18:38 +0000 (11:18 -0700)]
svga: allow TGSI_TEXTURE_CUBE_ARRAY in emit_tg4()

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>
6 years agosvga: no dma on multisample surface
Charmaine Lee [Mon, 4 Dec 2017 18:03:51 +0000 (10:03 -0800)]
svga: no dma on multisample surface

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>
6 years agosvga: src surface for IntraSurfaceCopy cannot be multisample
Charmaine Lee [Sat, 2 Dec 2017 04:59:42 +0000 (20:59 -0800)]
svga: src surface for IntraSurfaceCopy cannot be multisample

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>
6 years agosvga: fix missing format multisample devcap check
Charmaine Lee [Fri, 1 Dec 2017 20:45:30 +0000 (12:45 -0800)]
svga: fix missing format multisample devcap check

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>
6 years agosvga: fix incorrect multisample support in VGPU9 device
Charmaine Lee [Thu, 30 Nov 2017 16:54:44 +0000 (08:54 -0800)]
svga: fix incorrect multisample support in VGPU9 device

Commit e4048f6cd1 unintentionally allows multisample support for VGPU9 device.
This patch fixes this regression.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agosvga: fix the missing devcap for SVGA3D_BC3_UNORM_SRGB
Charmaine Lee [Wed, 29 Nov 2017 21:27:58 +0000 (13:27 -0800)]
svga: fix the missing devcap for SVGA3D_BC3_UNORM_SRGB

Set the devcap to SVGA3D_DEVCAP_DXFMT_BC3_UNORM_SRGB

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agosvga: add a separate function to get dx format capabilities from vgpu10 device
Charmaine Lee [Wed, 29 Nov 2017 21:25:30 +0000 (13:25 -0800)]
svga: add a separate function to get dx format capabilities from vgpu10 device

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>
6 years agosvga: assign a separate function for is_format_supported() for vgpu10 device
Charmaine Lee [Wed, 29 Nov 2017 21:09:26 +0000 (13:09 -0800)]
svga: assign a separate function for is_format_supported() for vgpu10 device

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>
6 years agosvga: add some devcap debugging code
Brian Paul [Wed, 29 Nov 2017 18:28:10 +0000 (11:28 -0700)]
svga: add some devcap debugging code

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
6 years agosvga: fix depth and coverage mask output declaration
Charmaine Lee [Mon, 27 Nov 2017 21:24:26 +0000 (13:24 -0800)]
svga: fix depth and coverage mask output declaration

Set the component mask to zero for both registers.

Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agosvga: add sample positions for 2 samples
Charmaine Lee [Fri, 17 Nov 2017 03:46:35 +0000 (19:46 -0800)]
svga: add sample positions for 2 samples

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>
6 years agosvga: check sample count devcaps
Charmaine Lee [Thu, 16 Nov 2017 06:21:22 +0000 (22:21 -0800)]
svga: check sample count devcaps

Check sample count devcaps from the svga device to determine the
supported sample counts.

Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agosvga: fix 1-element cube map array issue
Brian Paul [Tue, 14 Nov 2017 16:36:23 +0000 (09:36 -0700)]
svga: fix 1-element cube map array issue

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>
6 years agosvga: simplify array test in svga_init_shader_key_common()
Brian Paul [Tue, 14 Nov 2017 16:34:29 +0000 (09:34 -0700)]
svga: simplify array test in svga_init_shader_key_common()

And squash commit a patch to silence a compiler warning (add
default case to the switch statement).

Reviewed-by: Charmaine Lee <charmainel@vmware.com>