platform/upstream/mesa.git
2 years agoradv: determine if an image support fast clears using comp-to-single
Samuel Pitoiset [Wed, 28 Apr 2021 11:53:02 +0000 (13:53 +0200)]
radv: determine if an image support fast clears using comp-to-single

Only on GFX10+ with DCC enabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10518>

2 years agoradv: add RADV_DCC_CLEAR_SINGLE
Samuel Pitoiset [Wed, 28 Apr 2021 11:53:35 +0000 (13:53 +0200)]
radv: add RADV_DCC_CLEAR_SINGLE

When DCC is cleared with that code, the hardware expects the clear
color value to be stored at the beginning of each 256B block in
the image.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10518>

2 years agoradv: pass an image view to vi_get_fast_clear_parameters()
Samuel Pitoiset [Wed, 28 Apr 2021 15:01:13 +0000 (17:01 +0200)]
radv: pass an image view to vi_get_fast_clear_parameters()

image_format was unused.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10518>

2 years agoradv: use more explicit DCC clear codes
Samuel Pitoiset [Wed, 28 Apr 2021 14:44:09 +0000 (16:44 +0200)]
radv: use more explicit DCC clear codes

No functional changes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10518>

2 years agovirgl/ci: Set NIR_VALIDATE=0 on the host
Tomeu Vizoso [Fri, 6 Aug 2021 10:05:45 +0000 (12:05 +0200)]
virgl/ci: Set NIR_VALIDATE=0 on the host

As we aren't testing LLVMPipe in these jobs, and shader compilation is
currrently the bottleneck.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12196>

2 years agovirgl/ci: Wait a bit before shutting the VM down
Tomeu Vizoso [Fri, 6 Aug 2021 08:28:36 +0000 (10:28 +0200)]
virgl/ci: Wait a bit before shutting the VM down

Sometimes, the VM powered off before all the output from the guest got
to the console.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12196>

2 years agovirgl/ci: Rebalance concurrency
Tomeu Vizoso [Thu, 5 Aug 2021 06:27:15 +0000 (08:27 +0200)]
virgl/ci: Rebalance concurrency

Crosvm deals with virtio-gpu commands sequentially, so parallelization
in the host doesn't help much.

Also, too much parallelization in the guest causes some tests to time
out.

So reduce the number of dEQP instances being run concurrently, make sure
we dont limit the number of CPUs being used in the host and schedule
more jobs in CI to keep the times below 10 minutes.

Closes: #5172
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12196>

2 years agovirgl/ci: Have LLVMPipe use more threads for rendering
Tomeu Vizoso [Wed, 4 Aug 2021 05:51:31 +0000 (07:51 +0200)]
virgl/ci: Have LLVMPipe use more threads for rendering

dEQP isn't high on rendering, but that is in the critical path as all
dEQP processes are waiting for Crosvm to single-threadedly service their
requests.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12196>

2 years agoradv: fix reported sample counts for VRS 1x1
Samuel Pitoiset [Fri, 6 Aug 2021 15:08:09 +0000 (17:08 +0200)]
radv: fix reported sample counts for VRS 1x1

The Vulkan spec requires ~0 for 1x1.

Fixes dEQP-VK.fragment_shading_rate.misc.shading_rates.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12245>

2 years agoradv: bump maxFragmentShadingRateCoverageSamples to 32
Samuel Pitoiset [Fri, 6 Aug 2021 15:00:26 +0000 (17:00 +0200)]
radv: bump maxFragmentShadingRateCoverageSamples to 32

Minimum required value is 16 but we support up to 32
(2x2 VRS with MSAA 8x).

Fixes dEQP-VK.fragment_shading_rate.misc.limits.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12245>

2 years agoradv: disable fragmentShadingRateWithCustomSampleLocations
Samuel Pitoiset [Fri, 6 Aug 2021 14:57:17 +0000 (16:57 +0200)]
radv: disable fragmentShadingRateWithCustomSampleLocations

From the Vulkan spec 1.2.187.

"fragmentShadingRateWithCustomSampleLocations specifies whether
 custom sample locations are supported for multi-pixel fragments.
 It must be VK_FALSE if VK_EXT_sample_locations is not supported."

VK_EXT_sample_locations is disabled on GFX10+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12245>

2 years agoradv: bump maxFragmentSizeAspectRatio to 2
Samuel Pitoiset [Fri, 6 Aug 2021 14:56:38 +0000 (16:56 +0200)]
radv: bump maxFragmentSizeAspectRatio to 2

Minimum required value is 2.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12245>

2 years agoci/vc4: update piglit expected results
Juan A. Suarez Romero [Mon, 9 Aug 2021 14:33:17 +0000 (16:33 +0200)]
ci/vc4: update piglit expected results

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12281>

2 years agodocs: flag VK_KHR_multiview as implemented for v3dv
Iago Toral Quiroga [Mon, 9 Aug 2021 09:40:45 +0000 (11:40 +0200)]
docs: flag VK_KHR_multiview as implemented for v3dv

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12279>

2 years agoetnaviv: always try to create KMS side handles for imported resources
Lucas Stach [Wed, 15 Jan 2020 11:07:44 +0000 (12:07 +0100)]
etnaviv: always try to create KMS side handles for imported resources

By creating the KMS side handles we allow GBM to return the proper KMS
side GEM handles for imported buffers. Always creating the KMS side
handles adds a bit of overhead, as we don't need them on all imported
resources, but seems like the most robust solution for now.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12018>

2 years agorenderonly: don't complain when GPU import fails
Lucas Stach [Wed, 28 Oct 2020 18:53:43 +0000 (19:53 +0100)]
renderonly: don't complain when GPU import fails

There are a number of drivers which do a trial-and-error import
of buffers into the KMS side via renderonly. Some of those imports
are expected to fail, so we should not print a error message in
this case. All callers do proper error handling themselves.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12018>

2 years agoclover: add kernel attributes support for SPIR-V
Dave Airlie [Thu, 5 Aug 2021 10:32:31 +0000 (20:32 +1000)]
clover: add kernel attributes support for SPIR-V

Fixes CTS api kernel_attributes

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12225>

2 years agoclover: return CL_INVALID_PLATFORM properly.
Dave Airlie [Thu, 5 Aug 2021 06:34:51 +0000 (16:34 +1000)]
clover: return CL_INVALID_PLATFORM properly.

If the platform isn't clover platform return an error,

Fixes CTS api negative_get_platform_info

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12225>

2 years agoclover: fix api zero sized enqueue
Dave Airlie [Tue, 13 Oct 2020 04:17:00 +0000 (14:17 +1000)]
clover: fix api zero sized enqueue

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12225>

2 years agoradv: flush caches before performing separate depth/stencil aspect init
Samuel Pitoiset [Thu, 5 Aug 2021 16:52:19 +0000 (18:52 +0200)]
radv: flush caches before performing separate depth/stencil aspect init

It's a RMW operation, also note that DB doesn't use L2 on GFX6-8.

Fixes test_clear_depth_stencil_view() and test_discard_resource() tests
from vkd3d-proton.

Cc: 21.2 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12223>

2 years agoanv: Make anv_image_aspect_to_plane take an anv_image*
Jason Ekstrand [Fri, 30 Jul 2021 23:57:35 +0000 (18:57 -0500)]
anv: Make anv_image_aspect_to_plane take an anv_image*

It's called anv_image_* so it really should take an anv_image.  For the
couple of cases where we really want to pass in a set of aspects, we
leave an anv_aspect_to_plane() helper.  anv_image_aspect_to_plane() is
then just a wrapper around it which grabs the aspects from the image.

While we're in the area, sprinkle some const around.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv: Rework our aspect/plane helpers
Jason Ekstrand [Thu, 29 Jul 2021 21:35:26 +0000 (16:35 -0500)]
anv: Rework our aspect/plane helpers

The new versions should have identical output, just a simpler (and
probably faster) implementation and more/better asserts.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv/image: Rework YCbCr image aspects
Jason Ekstrand [Thu, 29 Jul 2021 21:41:14 +0000 (16:41 -0500)]
anv/image: Rework YCbCr image aspects

The Vulkan 1.2.184 spec says:

    "When creating a VkImageView, if sampler Y′CBCR conversion is
    enabled in the sampler, the aspectMask of a subresourceRange used by
    the VkImageView must be VK_IMAGE_ASPECT_COLOR_BIT.

    When creating a VkImageView, if sampler Y′CBCR conversion is not
    enabled in the sampler and the image format is multi-planar, the
    image must have been created with
    VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the aspectMask of the
    VkImageView’s subresourceRange must be VK_IMAGE_ASPECT_PLANE_0_BIT,
    VK_IMAGE_ASPECT_PLANE_1_BIT or VK_IMAGE_ASPECT_PLANE_2_BIT."

Previously, for YCbCr images, we were flipping this around.  For single-
plane views where VK_IMAGE_ASPECT_PLANE_N_BIT would be passed in by the
app, we would store VK_IMAGE_ASPECT_COLOR_BIT.  For multi-plane views
where the client says VK_IMAGE_ASPECT_COLOR_BIT, we would store a all of
the planes.  (There was also an extra bit of remapping that would
compact the planes in the non-existent case of a format with a non-
contiguous set of planes.)  The idea behind this was that for things
like rendering or single-plane sampling, storage, or compute, we want it
to look as much like a single-plane image as possible but we wanted the
multi-plane case to be the awkward one.

This commit changes it around so that iview->aspects is always exactly
the subset of image->vk.aspects represented by the view.  This is
identical to how aspects work for depth/stencil so it gains us some
consistency.

This commit also changes anv_image_view::aspect_mask to aspects to force
a full audit of the field.  As can be seen, there are only a few uses of
this field and they're all mostly fine:

 - A bunch of them are used to check for depth/stencil.  That hasn't
   changed.

 - Most of the checks for color already used ANY_COLOR_BIT, only one
   needed fixing.

 - There's a check that both src/depth are color for MSAA resolves.
   However, we don't support MSAA on YCbCr so there's no point in
   checking for ANY_COLOR_BIT.

There is a hidden usage of planes in anv_descriptor_set_write_image_view
that's not as obvious.  However, this function simply looks at
anv_image_view::n_planes and blindly fills out the descriptor
accordingly.  As long as image views with a single plane continue to
claim n_planes == 1, this will be fine.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv: Stop assuming planes are in aspect-bit-order
Jason Ekstrand [Fri, 30 Jul 2021 21:58:22 +0000 (16:58 -0500)]
anv: Stop assuming planes are in aspect-bit-order

Previously, we initialized vplane in anv_CreateImageView to 0 and
incremented it every iteration of the aspect loop.  This only works
because planes are guaranteed to be in aspect-bit-order which wasn't
documented anywhere.  Instead, drop this assumption and burn a couple
CPU cycles properly calculating vplane.

While we're here, make iplane const as well.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv: Use anv_get_format_plane for color image view setup
Jason Ekstrand [Fri, 30 Jul 2021 11:59:53 +0000 (06:59 -0500)]
anv: Use anv_get_format_plane for color image view setup

When creating a single-plane view of a multi-plane image, we were
relying on vplane_aspect to be VK_IMAGE_ASPECT_COLOR_BIT so that
anv_get_format_plane of the single-plane view format would work.
Instead of relying on this quirk, we can drop vplane_aspect and rely
entirely on vplane to only be 0 in this case.  In the case of depth or
stencil images, we still need to grab the format aspect but we can use
the actual aspect and don't need the vplane_aspect trickery.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv: Use anv_get_format_plane in anv_get_image_format_features
Jason Ekstrand [Fri, 30 Jul 2021 11:57:35 +0000 (06:57 -0500)]
anv: Use anv_get_format_plane in anv_get_image_format_features

Once we get past depth/stencil, what we really want is plane 0 not the
color aspect.  A bunch of those formats don't have a single color
aspect.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv: Add a get_format_plane helper and use it in image setup
Jason Ekstrand [Fri, 30 Jul 2021 11:46:29 +0000 (06:46 -0500)]
anv: Add a get_format_plane helper and use it in image setup

Unlike anv_get_format_aspect, this takes a plane number which is
relative to the set of aspects on the format.  There are a number of
cases where we already have the plane and so re-fetching it is useless.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv: Rework depth/stencil early return in anv_get_format_plane
Jason Ekstrand [Fri, 30 Jul 2021 11:42:33 +0000 (06:42 -0500)]
anv: Rework depth/stencil early return in anv_get_format_plane

The comment about modifiers is bogus because we check the modifier
before this check and return early.  Also, there's no reason why we need
to check the requested aspect when we could check the format itself.
anv_image_aspect_to_plane will ensure that the requested aspect is one
that actually exists.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv: Rename anv_get_format_plane to anv_get_format_aspect
Jason Ekstrand [Fri, 30 Jul 2021 11:31:03 +0000 (06:31 -0500)]
anv: Rename anv_get_format_plane to anv_get_format_aspect

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv/blorp: Use the isl_surf for computing level_width/height in anv_image_ccs_op
Jason Ekstrand [Wed, 21 Jul 2021 22:54:39 +0000 (17:54 -0500)]
anv/blorp: Use the isl_surf for computing level_width/height in anv_image_ccs_op

Don't manually monkey around with the denominator scales.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agoanv/blorp: Drop some can_ycbcr checks
Jason Ekstrand [Wed, 21 Jul 2021 22:52:58 +0000 (17:52 -0500)]
anv/blorp: Drop some can_ycbcr checks

Vulkan allows us to, in theory, support ycbcr on single-plane formats if
the client really wants it.  Also, these functions should work on a
multi-plane color image as long as the client specifies the right
aspect.  This gets rid of our usage of can_ycbcr outside of anv_image.c.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12141>

2 years agonouveau: Use nir_lower_tex for projectors
Jason Ekstrand [Mon, 12 Jul 2021 16:27:29 +0000 (11:27 -0500)]
nouveau: Use nir_lower_tex for projectors

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11826>

2 years agonir: add imm_vec3 to round these out
Mike Blumenkrantz [Fri, 6 Aug 2021 18:47:37 +0000 (14:47 -0400)]
nir: add imm_vec3 to round these out

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12253>

2 years agoradv: Allocate space for inline push constants.
Bas Nieuwenhuizen [Sun, 8 Aug 2021 12:37:52 +0000 (14:37 +0200)]
radv: Allocate space for inline push constants.

In the compute dispatch path we do not allocate a huge amount
of space to cover everything so the individual functions have to
allocate. This was missing here, causing a hang in Cyberpunk when
accessing the system menu at some locations with thread tracing
enabled.

Fixes: bd1186572f6 ("radv: add support for push constants inlining when possible")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12271>

2 years agoradv: Use correct signedness in misalign test.
Bas Nieuwenhuizen [Sun, 8 Aug 2021 15:12:58 +0000 (17:12 +0200)]
radv: Use correct signedness in misalign test.

Lots of the MAX2 args end up subtracting two unsigned numbers, which
blows up when the result is negative.

Fixes: 4c99d6ff54b ("radv: flush L2 for images affected by the pipe misaligned issue on GFX10+")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12272>

2 years agopanfrost: Fix pan_blitter_emit_bifrost_blend()
Boris Brezillon [Fri, 6 Aug 2021 12:53:33 +0000 (14:53 +0200)]
panfrost: Fix pan_blitter_emit_bifrost_blend()

If we return inside a pan_pack() the descriptor packing doesn't happen.

Cc: mesa-stable
Fixes: 8ba2f9f69858 ("panfrost: Create a blitter library to replace the existing preload helpers")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12239>

2 years agov3d: print error on perfmon destroy error
Juan A. Suarez Romero [Mon, 9 Aug 2021 08:36:17 +0000 (10:36 +0200)]
v3d: print error on perfmon destroy error

Print an error in case destroying the kernel perfmon fails.

Fixes CID 1489964: Error handling issues (CHECKED_RETURN).

v2:
 - Wrap line (Iago).

Fixes: 685281278eb ("v3d: implement performance counter queries")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12280>

2 years agobroadcom/compiler: change current block on setting spill base
Juan A. Suarez Romero [Mon, 9 Aug 2021 09:40:55 +0000 (11:40 +0200)]
broadcom/compiler: change current block on setting spill base

The spill base setting instructions (which includes some uniforms) are
added in the entry block, not in the current block. When ldunif
optimization is applied, the cursor is pointing to instructions in the
entry block, but the current block is a different one. This leads to a
heap-buffer-overflow when going through the list of instructions
(detected by the address sanitizer).

Thus change the current block to entry block, and restore it after the
setup is done.

This fixes
dEQP-VK.ssbo.readonly.layout.single_struct.single_buffer.std430_instance_array_comp_access_store_cols
with address sanitizer enabled.

v2:
 - Set current block instead of disabling ldunif optimization (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12221>

2 years agogallium/noop: implement a lot of missing context functions
Marek Olšák [Fri, 6 Aug 2021 22:07:54 +0000 (18:07 -0400)]
gallium/noop: implement a lot of missing context functions

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

2 years agogallium/noop: implement a lot of missing screen functions
Marek Olšák [Fri, 6 Aug 2021 21:59:45 +0000 (17:59 -0400)]
gallium/noop: implement a lot of missing screen functions

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

2 years agogallium/noop: update pipe_screen::num_contexts
Marek Olšák [Fri, 6 Aug 2021 21:59:19 +0000 (17:59 -0400)]
gallium/noop: update pipe_screen::num_contexts

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

2 years agogallium/noop: enable threaded_context to test TC overhead without a driver
Marek Olšák [Fri, 6 Aug 2021 21:01:04 +0000 (17:01 -0400)]
gallium/noop: enable threaded_context to test TC overhead without a driver

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

2 years agogallium/noop: use threaded_transfer
Marek Olšák [Fri, 6 Aug 2021 20:03:11 +0000 (16:03 -0400)]
gallium/noop: use threaded_transfer

to enable threaded_context later

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

2 years agogallium/noop: use threaded_resource
Marek Olšák [Fri, 6 Aug 2021 20:03:11 +0000 (16:03 -0400)]
gallium/noop: use threaded_resource

to enable threaded_context later

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

2 years agogallium/noop: use threaded_query
Marek Olšák [Fri, 6 Aug 2021 20:02:34 +0000 (16:02 -0400)]
gallium/noop: use threaded_query

to enable threaded_context later

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

2 years agogallium/noop: implement shader buffers and shader images
Marek Olšák [Fri, 6 Aug 2021 06:39:23 +0000 (02:39 -0400)]
gallium/noop: implement shader buffers and shader images

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

2 years agogallium/noop: implement fences
Marek Olšák [Fri, 6 Aug 2021 06:36:09 +0000 (02:36 -0400)]
gallium/noop: implement fences

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

2 years agogallium: simplify VRAM uploads by adding PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLY
Marek Olšák [Fri, 6 Aug 2021 05:02:50 +0000 (01:02 -0400)]
gallium: simplify VRAM uploads by adding PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLY

When this flag is set, u_threaded_context will try not to map it directly
for better buffer placement. It's set by drivers when visible VRAM is too
small.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12257>

2 years agoradeonsi: improve viewperf snx performance by forcing staging for VRAM buffers
Marek Olšák [Fri, 6 Aug 2021 04:54:14 +0000 (00:54 -0400)]
radeonsi: improve viewperf snx performance by forcing staging for VRAM buffers

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12257>

2 years agoradv: remove unnecessary FIXME about custom sample locations
Samuel Pitoiset [Fri, 6 Aug 2021 15:23:29 +0000 (17:23 +0200)]
radv: remove unnecessary FIXME about custom sample locations

VK_EXT_sample_locations is disabled on GFX10+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12247>

2 years agonir/tests: add tests for umod/imod/irem optimizations
Rhys Perry [Tue, 27 Jul 2021 18:33:34 +0000 (19:33 +0100)]
nir/tests: add tests for umod/imod/irem optimizations

Both nir_opt_algebraic and nir_opt_idiv_const have optimizations for
umod/imod/irem by constants.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>

2 years agonir: fix signed overflow for iadd constant folding
Rhys Perry [Thu, 29 Jul 2021 10:12:29 +0000 (11:12 +0100)]
nir: fix signed overflow for iadd constant folding

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>

2 years agonir/idiv_const: optimize imod/irem
Rhys Perry [Wed, 21 Jul 2021 16:02:11 +0000 (17:02 +0100)]
nir/idiv_const: optimize imod/irem

fossil-db changes (Sienna Cichlid):
Totals from 223 (0.15% of 150170) affected shaders:
CodeSize: 384564 -> 370824 (-3.57%)
Instrs: 74518 -> 71961 (-3.43%)
Latency: 351620 -> 344640 (-1.99%)
InvThroughput: 80122 -> 74846 (-6.58%)
VClause: 919 -> 920 (+0.11%)
SClause: 2879 -> 2877 (-0.07%); split: -0.10%, +0.03%
Copies: 3099 -> 3103 (+0.13%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>

2 years agonir/idiv_const: improve idiv(n, INT_MIN)
Rhys Perry [Wed, 21 Jul 2021 16:15:51 +0000 (17:15 +0100)]
nir/idiv_const: improve idiv(n, INT_MIN)

This lowering is smaller and -INT64_MIN is probably UB (signed overflow).

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>

2 years agonir/algebraic: improve irem by power-of-two optimization
Rhys Perry [Wed, 21 Jul 2021 16:10:39 +0000 (17:10 +0100)]
nir/algebraic: improve irem by power-of-two optimization

Requires one less instruction.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>

2 years agonir/search: don't consider INT_MIN a negative power-of-two
Rhys Perry [Wed, 21 Jul 2021 16:13:40 +0000 (17:13 +0100)]
nir/search: don't consider INT_MIN a negative power-of-two

ineg(INT_MIN)/iabs(INT_MIN) won't work as expected.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>

2 years agonir/algebraic: add optimizations for imul(a, INT_MIN)
Rhys Perry [Wed, 21 Jul 2021 16:03:01 +0000 (17:03 +0100)]
nir/algebraic: add optimizations for imul(a, INT_MIN)

is_pos_power_of_two would catch this, but nir_op_imul has signed sources,
so is_neg_power_of_two catches it instead, which creates a useless
nir_op_ineg.

fossil-db (Sienna Cichlid):
Totals from 1014 (0.68% of 150170) affected shaders:
CodeSize: 3592296 -> 3592288 (-0.00%); split: -0.00%, +0.00%
Instrs: 671211 -> 670426 (-0.12%)
Latency: 5268917 -> 5268479 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 2187349 -> 2187343 (-0.00%); split: -0.00%, +0.00%
VClause: 8634 -> 8636 (+0.02%)
Copies: 97585 -> 97604 (+0.02%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>

2 years agonir/algebraic: don't optimize umod/imod/irem if lower_bitops=true
Rhys Perry [Wed, 21 Jul 2021 16:08:52 +0000 (17:08 +0100)]
nir/algebraic: don't optimize umod/imod/irem if lower_bitops=true

Match the udiv/idiv/imul by power-of-two optimizations.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>

2 years agonir/algebraic: fix imod by negative power-of-two
Rhys Perry [Wed, 21 Jul 2021 16:06:30 +0000 (17:06 +0100)]
nir/algebraic: fix imod by negative power-of-two

If "a" is a multiple of "b", then the result would have been "b" instead
of 0.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fixes: 0ef5f3552f6 ("nir: add strength reduction pattern for imod/irem with pow2 divisor.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>

2 years agoradv: fix initializing the DS clear metadata value for separate aspects
Samuel Pitoiset [Thu, 5 Aug 2021 15:47:02 +0000 (17:47 +0200)]
radv: fix initializing the DS clear metadata value for separate aspects

We shouldn't overwrite the clear value of the other aspect (in case
separate depth/stencil layouts are used).

Found by inspection.

Cc: 21.2 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12222>

2 years agoradeonsi: don't create an infinite number of variants
Pierre-Eric Pelloux-Prayer [Fri, 30 Jul 2021 09:48:28 +0000 (11:48 +0200)]
radeonsi: don't create an infinite number of variants

If a shader has code like this:

   uniform float timestamp;
   ...
   if (timestamp > 0.0)
      do_something()

And timestamp is modified each frame, we'll end up generating a new
variant per frame.

This commit introduces a hard limit on the number of variants we generate
for a single shader.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5121
Fixes: b7501184b90 ("radeonsi: implement inlinable uniforms")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12138>

2 years agoradeonsi: add -t option to the test script
Pierre-Eric Pelloux-Prayer [Thu, 5 Aug 2021 14:03:38 +0000 (16:03 +0200)]
radeonsi: add -t option to the test script

This allows to easily run a subset of the tests without having
to figure out which test suite(s) they belong to.

dEQP cannot use this option because currently "deqp-runner suite"
don't have it.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12215>

2 years agoradeonsi: fix test script's output
Pierre-Eric Pelloux-Prayer [Thu, 5 Aug 2021 14:02:31 +0000 (16:02 +0200)]
radeonsi: fix test script's output

This line was dropped in the last refactoring. We need
to clearly state to the user if the new results are
different to the expected ones.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12215>

2 years agoradv: allow DCC MSAA fast clears if a FCE is needed
Samuel Pitoiset [Tue, 3 Aug 2021 09:37:29 +0000 (11:37 +0200)]
radv: allow DCC MSAA fast clears if a FCE is needed

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12180>

2 years agoradv: perform a FCE for MSAA images that might have been fast-cleared
Samuel Pitoiset [Tue, 3 Aug 2021 09:36:36 +0000 (11:36 +0200)]
radv: perform a FCE for MSAA images that might have been fast-cleared

FMASK_DECOMPRESS can't eliminate DCC fast clears. This will allow to
enable DCC MSAA fast clears that require a FCE.

Only supported on GFX10+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12180>

2 years agoradv: rework DCC, FMASK and FCE decompress path
Samuel Pitoiset [Tue, 3 Aug 2021 09:13:35 +0000 (11:13 +0200)]
radv: rework DCC, FMASK and FCE decompress path

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12180>

2 years agogallivm: remove code to force nearest s/t interpolation
Erik Faye-Lund [Fri, 6 Aug 2021 13:09:40 +0000 (15:09 +0200)]
gallivm: remove code to force nearest s/t interpolation

These two bits were added in 2012, but never got wired up. Let's cut our
losses, and remove them again. 9 years unused seems sufficient.

While we're at it, remove reduction_mode from the hacks-section, because
this isn't a hack at all, rather normal state.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12240>

2 years agolavapipe: lower mipmapPrecisionBits to 4
Erik Faye-Lund [Fri, 6 Aug 2021 10:04:18 +0000 (12:04 +0200)]
lavapipe: lower mipmapPrecisionBits to 4

Through some exhaustive searching, I've found that our log2 approximation
is precise to around 3.5 bits. And the squaring step should increase the
result with one bit, leaving us with 4.5 bits of precision.

Reporting the right mipmap precision fixes a few CTS-tests.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12238>

2 years agoanv: allow stencil memory export
Tapani Pälli [Wed, 28 Apr 2021 05:09:35 +0000 (08:09 +0300)]
anv: allow stencil memory export

This commit reverts 58e93711412 as now iris driver can import stencil.
This makes ext_external_objects-vk-stencil-display pass and X-Plane 11
vulkan rendering backend to work with anv + iris.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10609>

2 years agoanv: disable aux for exportable images without modifiers
Tapani Pälli [Wed, 28 Jul 2021 07:52:46 +0000 (10:52 +0300)]
anv: disable aux for exportable images without modifiers

This makes import easier on different gfx generations and we don't
have to lock down on a certain aux layout just yet.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10609>

2 years agoiris: handle depth-stencil import with a wrapper function
Tapani Pälli [Thu, 3 Jun 2021 12:22:24 +0000 (15:22 +0300)]
iris: handle depth-stencil import with a wrapper function

This is similar to u_transfer_helper wrap but implemented in
the driver as the layout between drivers can vary.

v2: remove else, simplify (Rohan, Eleni)
v3: add hiz surface support when importing depth buffer
v4: use iris_resource_configure_aux_offsets for setting
    aux offsets for depth
v5: introduce helper for configuring imported memobj aux
    offsets and utilize that
v6: simplify, remove aux support for now
v7: cleanups, fix offset calculation (Nanley)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10609>

2 years agocrocus: disable depth and d+s formats with memory objects
Tapani Pälli [Wed, 28 Jul 2021 07:33:50 +0000 (10:33 +0300)]
crocus: disable depth and d+s formats with memory objects

This is similar to i965 commit ba11f673a24, we set depth and
d+s formats unsupported for now.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10609>

2 years agocrocus: take a reference to memobj bo in crocus_resource_from_memobj
Tapani Pälli [Wed, 28 Jul 2021 07:21:52 +0000 (10:21 +0300)]
crocus: take a reference to memobj bo in crocus_resource_from_memobj

This is the same fix as commit 2d87ea31665 for iris driver.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10609>

2 years agoi915g: Reapply clang-format.
Emma Anholt [Fri, 6 Aug 2021 18:30:19 +0000 (11:30 -0700)]
i915g: Reapply clang-format.

Missed this in 2008ec8a432c ("i915g: Fix writemasking of SEQ/SNE/SSG.")

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12250>

2 years agoi915g: Use the devmaster quadratic approximation for sin/cos.
Emma Anholt [Thu, 5 Aug 2021 22:41:04 +0000 (15:41 -0700)]
i915g: Use the devmaster quadratic approximation for sin/cos.

11 instructions, but now processes up to 4 channels at once (since TGSI
splits to scalar for these math ops) while being higher accuracy.
Previously we used 6 instructions per channel, but it didn't look like a
sine wave.  i915c managed it in 9 instructions per scalar channel, thanks
to avoiding an extra mov we do for the fabs (should be fixable), and
avoiding an extra MUL (maybe just needs reassociation of our immediates?).
But, the ALU count win from doing 4 channels at once will be way more
important for making sure that programs compile than those 2 ALU ops, plus
now we do it in NIR instead of assembly.

Closes: #4981
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12250>

2 years agofreedreno/regs: add bit to control continuous clock with 7nm PHYs
Dmitry Baryshkov [Mon, 7 Jun 2021 13:14:39 +0000 (16:14 +0300)]
freedreno/regs: add bit to control continuous clock with 7nm PHYs

7nm PHYs need another special bit set in DSI_LANE_CTRL to enable
continuous DSI clock. Document this bit.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11219>

2 years agodocs: make most important part of bugs.rst easier to find
Filip Gawin [Thu, 29 Jul 2021 10:29:14 +0000 (10:29 +0000)]
docs: make most important part of bugs.rst easier to find

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12124>

2 years agopps: Restore documentation
Antonio Caggiano [Tue, 13 Jul 2021 12:13:26 +0000 (14:13 +0200)]
pps: Restore documentation

Restore part of the perfetto documentation deleted by mistake.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11846>

2 years agofrontends/va/postproc: Keep track of deinterlacing method being used
Thong Thai [Fri, 6 Aug 2021 18:42:44 +0000 (14:42 -0400)]
frontends/va/postproc: Keep track of deinterlacing method being used

When transcoding a video, the context used by decode/postproc process
might be different from that of the encoder, but we encoder needs to
know if deinterlacing was used.

Fixes: c5088b49729 ("gallium: Fix VAAPI postproc blit")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12251>

2 years agogallium/util: add half texel offset param to util_compute_blit
Thong Thai [Fri, 6 Aug 2021 14:42:00 +0000 (10:42 -0400)]
gallium/util: add half texel offset param to util_compute_blit

Fixes an issue where the video image is blurry after blitting.

Fixes: c5088b49729 ("gallium: Fix VAAPI postproc blit")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12251>

2 years agogallium/auxiliary/vl: Add additional deinterlace enum and tracking
Thong Thai [Fri, 6 Aug 2021 18:32:40 +0000 (14:32 -0400)]
gallium/auxiliary/vl: Add additional deinterlace enum and tracking

Add additional deinterlace enums and a deinterlace field to the
vl_compositor struct, so we can keep track of which deinterlacing
algorithm is currently being used, if any.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12251>

2 years agoutil/fossilize_db: Add extra flock mutex.
Bas Nieuwenhuizen [Sat, 7 Aug 2021 21:31:00 +0000 (23:31 +0200)]
util/fossilize_db: Add extra flock mutex.

The flock is per-fd, not per thread, and we do it outside of the main mutex. This was
done to avoid having to wait in the mutex, but we can get a case where one ends up running
the body with the flock unlocked.

Fix this by adding a mutex that doesn't need to be locked for reads.

Fixes: 4f0f8133a35 "util/fossilize_db: Do not lock the fossilize db permanently."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12266>

2 years agoutil/fossilize_db: Unlock the cache file if the entry already exists.
Bas Nieuwenhuizen [Sat, 7 Aug 2021 21:23:56 +0000 (23:23 +0200)]
util/fossilize_db: Unlock the cache file if the entry already exists.

Fixes: 4f0f8133a35 "util/fossilize_db: Do not lock the fossilize db permanently."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12266>

2 years agoutil/fossilize_db: Use uint64_t for file size.
Bas Nieuwenhuizen [Sat, 7 Aug 2021 21:20:13 +0000 (23:20 +0200)]
util/fossilize_db: Use uint64_t for file size.

For those 32-bit systems with 4G of cache.

Fixes: 2ec1bff0f3a "util/fossilize_db: Split out reading the index."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12266>

2 years agoutil/fossilize_db: Only allocate entries after full read.
Bas Nieuwenhuizen [Wed, 4 Aug 2021 23:43:01 +0000 (01:43 +0200)]
util/fossilize_db: Only allocate entries after full read.

Should void leaking entries on read failure.

Fixes: 2ec1bff0f3a "util/fossilize_db: Split out reading the index."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>

2 years agoutil/fossilize_db: Be conservative about header length check for locking.
Bas Nieuwenhuizen [Wed, 4 Aug 2021 23:30:25 +0000 (01:30 +0200)]
util/fossilize_db: Be conservative about header length check for locking.

Don't anticipate seeing any partial written headers but just in case we
should probably wait on the lock to make sure whatever header was being
written is finished being written.

Fixes: 4f0f8133a35 "util/fossilize_db: Do not lock the fossilize db permanently."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>

2 years agoutil/fossilize_db: Flush files after header write.
Bas Nieuwenhuizen [Wed, 4 Aug 2021 23:29:04 +0000 (01:29 +0200)]
util/fossilize_db: Flush files after header write.

We should probably flush before we unlock the file again.

Fixes: 4f0f8133a35 "util/fossilize_db: Do not lock the fossilize db permanently."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>

2 years agoutil/fossilize_db: Reset file position to parsed_offset on cache_offset read failure.
Bas Nieuwenhuizen [Thu, 5 Aug 2021 01:03:48 +0000 (03:03 +0200)]
util/fossilize_db: Reset file position to parsed_offset on cache_offset read failure.

Otherwise we might restart reading from the middle of the entry.

Fixes: 2ec1bff0f3a "util/fossilize_db: Split out reading the index."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>

2 years agoutil/fossilize_db: Update parsed_offset correctly.
Bas Nieuwenhuizen [Wed, 4 Aug 2021 23:26:15 +0000 (01:26 +0200)]
util/fossilize_db: Update parsed_offset correctly.

If things went perfectly parsed_offset was never updated for the
final entry and we'd seek_set to the start of the last entry. Is
fun when appending to the file next.

Fixes: 2ec1bff0f3a "util/fossilize_db: Split out reading the index."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>

2 years agospirv_to_dxil: Fix missing-prototypes build error.
Vinson Lee [Sat, 7 Aug 2021 05:55:58 +0000 (22:55 -0700)]
spirv_to_dxil: Fix missing-prototypes build error.

../src/microsoft/spirv_to_dxil/spirv_to_dxil.c: At top level:
../src/microsoft/spirv_to_dxil/spirv_to_dxil.c:200:1: error: no previous prototype for ‘spirv_to_dxil_get_version’ [-Werror=missing-prototypes]
  200 | spirv_to_dxil_get_version()
      | ^~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 92b0cf8e773 ("spirv_to_dxil: expose version number")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12264>

2 years agoci/freedreno: Add jobs to manually do a full VK on freedreno.
Emma Anholt [Fri, 30 Jul 2021 22:21:20 +0000 (15:21 -0700)]
ci/freedreno: Add jobs to manually do a full VK on freedreno.

Building toward scheduled nightly runs, add a button to do a full VK run
when you think you're changing test expectations.

Be gentle with the play button on this, 4 people doing this at once
would block marge for everyone else for a while.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12150>

2 years agoci/freedreno: Skip the slow dEQP-VK.ubo.random.all_shared_buffer.48 in CI.
Emma Anholt [Fri, 30 Jul 2021 19:33:13 +0000 (12:33 -0700)]
ci/freedreno: Skip the slow dEQP-VK.ubo.random.all_shared_buffer.48 in CI.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12150>

2 years agoci/freedreno: Clean up and fill out the tess timeout annotations.
Emma Anholt [Fri, 30 Jul 2021 19:35:27 +0000 (12:35 -0700)]
ci/freedreno: Clean up and fill out the tess timeout annotations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12150>

2 years agoci/freedreno: Generalize the spirv_ids_abuse skips.
Emma Anholt [Fri, 30 Jul 2021 19:33:13 +0000 (12:33 -0700)]
ci/freedreno: Generalize the spirv_ids_abuse skips.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12150>

2 years agoci/freedreno: Organize, fill out, and document our VK xfails.
Emma Anholt [Fri, 30 Jul 2021 20:10:52 +0000 (13:10 -0700)]
ci/freedreno: Organize, fill out, and document our VK xfails.

This is the full set of xfails for 1.2.7.0 currently.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12150>

2 years agovenus: free queues after vkDestroyDevice is emitted
Chia-I Wu [Fri, 6 Aug 2021 18:50:41 +0000 (11:50 -0700)]
venus: free queues after vkDestroyDevice is emitted

Otherwise, another thread might reuse their object ids for other
objects.  For example,

  T1: free queue with object id X
  T2: reuse id X
  T2: emit vkCreateFoo with id X
  T1: emit vkDestroyDevice

virglrenderer happily accepts that which leads to double frees of the
queue: once when X is updated to point to another object and once when
vkDestroyDevice is executed.  virglrenderer should be fixed to catch
such invalid object id reuse as well.

Fixes
dEQP-VK.api.object_management.multithreaded_shared_resources.device_group.

Fixes: ddd75330559 ("venus: initial support for queue/fence/semaphore")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12252>

2 years agofreedreno: Device matching based on chip_id
Rob Clark [Sun, 1 Aug 2021 17:37:06 +0000 (10:37 -0700)]
freedreno: Device matching based on chip_id

Add support for device matching based on chip_id instead of gpu_id, to
handle newer GPUs

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12159>

2 years agofreedreno: Make chip_id 64b
Rob Clark [Thu, 5 Aug 2021 22:36:05 +0000 (15:36 -0700)]
freedreno: Make chip_id 64b

In the UABI it is already 64b, but userspace ignored the upper 32b.  But
it looks like we will start needing the upper 32b.  So before we start
actually *using* chip_id, lets make sure everything is treating it as
64b.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12159>

2 years agofreedreno/all: Introduce fd_dev_id
Rob Clark [Sat, 31 Jul 2021 20:46:50 +0000 (13:46 -0700)]
freedreno/all: Introduce fd_dev_id

Move away from using gpu_id as the primary means to identify which
adreno we are running on, as future GPUs (starting with 7c3) stop
providing a gpu_id as a new naming scheme is introduced.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12159>

2 years agofreedreno/ir3/lower_io_offsets: Drop gpu_id param
Rob Clark [Sat, 31 Jul 2021 19:35:57 +0000 (12:35 -0700)]
freedreno/ir3/lower_io_offsets: Drop gpu_id param

It was unused.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12159>