Commit Graph

149970 Commits

Author SHA1 Message Date
Kenneth Graunke 413ea503ba iris: Disable PIPE_CAP_PREFER_BACK_BUFFER_REUSE
This cap bit only affects DRI_PRIME setups.  Since iris now uses the
blitter to perform dGPU -> iGPU copies asynchronously, it's better to
always use at least two backbuffers so the 3D engine can start rendering
the next frame during the copy.

See commit d17e752857 where this change
was made for radeonsi.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13877>
2022-02-09 07:45:43 +00:00
Kenneth Graunke e3cb620b55 iris: Use the hardware blitter for DRI PRIME blits
In a hybrid graphics setup, Mesa allocates two buffers for the window
surface.  The first is what the discrete card renders to; it lives in
VRAM and is usually tiled and possibly compressed.  The second is a
shadow copy that lives in system memory (readable by the integrated
card with the displays); it's usually linear and uncompressed.

Mesa's window system code schedules blits to update the shadow copy
when needed, typically at the end of a frame.  These can be fairly
costly when running a full-screen application at high resolutions.

We'd like to use the blitter for these copies, as it lets us perform
the copy asynchronously, letting the 3D engine race ahead and start
rendering the next frame.  If we used the 3D engine, the next frame
could not start rendering until the PRIME blit finishes, giving us
less time to draw the frame.  Fortunately, Tigerlake introduced new
blitter commands which can operate at full memory bandwidth.

DRI PRIME blits happen via the Gallium blit() hook.  We can detect that
case by looking for the PIPE_BIND_PRIME_BLIT_DST flag on the destination
resource.  This patch detects that case and calls iris_copy_region() on
IRIS_BATCH_BLITTER to handle it.  We know a priori that the blitter can
handle this operation (it's not a scaled blit, the formats match and
should not be 96bpp, there's no combined depth stencil, or other weird
edge cases).  blorp_copy() will also assert that edge cases don't occur.

Together with the next patch, this improves performance on DG1 Hybrid
scenarios by about 5-6%.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13877>
2022-02-09 07:45:43 +00:00
Kenneth Graunke f9eba6e2b5 iris: Allow IRIS_BATCH_BLITTER in iris_copy_region()
This updates iris_copy_region() to support using the blitter batch.
(Future patches will actually do so; for now, we keep using render.)

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13877>
2022-02-09 07:45:43 +00:00
Melissa Wen 70a219d4a3 broadcom/simulator: enable multisync in the simulator
Use drmSyncobjSignal to signal out_syncobjs when a GPU job submission
ends in the simulator. With this, we can enable multisync support in the
simulator and keep the multisync approach to process fence by submitting
a serialized no-op job that adds the fence to the array of out syncobjs,
i.e.  syncobjs to be signaled in the kernel when a job completes (job
post deps).

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14768>
2022-02-09 07:22:42 +00:00
Ilia Mirkin 5200e1c212 translate: improve sse2 32-bit unsigned -> float conversion
The existing logic would drop the low bit. Instead, let's drop the high
bit, do the conversion, and then add the fixed constant back in if the
value had the high bit set originally.

Fixes KHR-GL45.direct_state_access.vertex_arrays_attribute_format on
drivers that use this module to handle the format conversion.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emma Anholt <emma@anholt.net>
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14922>
2022-02-09 06:04:25 +00:00
Ilia Mirkin 0b69f7b15d rtasm: add pcmpgtd operation
This will be used shortly by the translate code. Available in SSE2.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emma Anholt <emma@anholt.net>
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14922>
2022-02-09 06:04:25 +00:00
Ilia Mirkin 55b735c51a rtasm: fix printf specifier for ptrdiff_t
In practice it's a small number, but new gcc versions complain.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emma Anholt <emma@anholt.net>
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14922>
2022-02-09 06:04:25 +00:00
Mike Blumenkrantz 7d1727079c zink: ci updates
hooray

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14932>
2022-02-09 05:11:40 +00:00
Erik Faye-Lund 883017b67e zink: do not copy colors through floats
Copying per compoents might flush NaN values, leading to changes in the
values, so it'd be safer to copy as unsigned integers here. But in one
of the cases here we can do even better, and just copy the whole damn
union instead.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14932>
2022-02-09 05:11:40 +00:00
Jason Ekstrand 745fc95659 zink: Re-interpret formats when using vkCmdClearColorImage()
vkCmdClearColorImage() doesn't take a view format so it always uses the
underlying format of the image.  If there's texture views going on, we
need to manually mangle the colors into the image format.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14932>
2022-02-09 05:11:40 +00:00
Ilia Mirkin 86eaff29c0 st/mesa: only enable ARB_enhanced_layouts if there are xfb buffers
It really doesn't make sense without any xfb support. One could limp
along, but our validation does not work as-is. Doesn't seem important to
support this use-case.

This disables GL_ARB_enhanced_layouts on crocus with gen4/5.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14869>
2022-02-09 03:31:16 +00:00
Ilia Mirkin 13c6f401cc glsl: only validate xfb_buffer values when we have enhanced layouts
XFB might not be supported, and the shader wouldn't be setting this
flag. But validation would still fail, since the number of xfb buffers
would be 0. So only validate if an xfb_buffer is set in the qualifiers.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5415
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14869>
2022-02-09 03:31:16 +00:00
Ilia Mirkin c17a3392c4 glsl: simplify conditions for setting various allowed flags
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14869>
2022-02-09 03:31:16 +00:00
Emma Anholt 2883e8f33d nir_to_tgsi: Add a flag for lowering fabs, and use it in r300/i915.
Saves instructions if the same fabs value is used multiple times.

i915g:
total instructions in shared programs: 397005 -> 396525 (-0.12%)
instructions in affected programs: 11061 -> 10581 (-4.34%)
LOST:   0
GAINED: 22

r300 (not r500):
total instructions in shared programs: 180286 -> 179767 (-0.29%)
instructions in affected programs: 27102 -> 26583 (-1.91%)
total temps in shared programs: 29692 -> 29638 (-0.18%)
temps in affected programs: 356 -> 302 (-15.17%)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
2022-02-08 18:50:01 -08:00
Emma Anholt f4ee7146f9 nir: Split the flag for lowering of fabs and fneg to source modifiers.
i915 and r300 have fneg source modifier but not fabs, and doing it in NIR
can save us some backend pain.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
2022-02-08 18:50:01 -08:00
Emma Anholt bd24f418c3 r300: Throw a compile error instead of an assert in r300 swizzle rewrites.
I hit this on shader-db, but I really just want to get stats for unrelated
changes.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
2022-02-08 18:50:01 -08:00
Emma Anholt 4968f8c066 r300: Demote a compiler assert(0) to a compile failure.
This triggers in shader-db and doesn't have an obvious fix.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
2022-02-08 18:50:01 -08:00
Jesse Natalie 97d13b2deb d3d12: Fix take_ownership semantic for constant buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14941>
2022-02-09 02:14:34 +00:00
Emma Anholt d52d500f17 r300: Request that nir-to-tgsi avoid generating TGSI_OPCODE_CMP.
Given that our fcsels are on float-bools, we can emit the LRP directly and
save the backend having to emit a SLT to turn the CMP src[0] into a bool.

This required passing a codegen flags struct for nir-to-tgsi.  I think
this is a good way forward for it, as the alternative I think has mostly
been adding flags to nir_shader_compiler_options (since adding
PIPE_SHADER_CAPs is an unreasonable amount of pain).

r300 shader-db:
total instructions in shared programs: 1484320 -> 1472463 (-0.80%)
instructions in affected programs: 243588 -> 231731 (-4.87%)
total temps in shared programs: 212485 -> 212143 (-0.16%)
temps in affected programs: 3845 -> 3503 (-8.89%)

Acked-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14886>
2022-02-09 01:19:13 +00:00
Dave Airlie 4a1ba7914a ci/lavapipe: update lvp asan results after leak fixes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14939>
2022-02-09 09:55:50 +10:00
Dave Airlie 2f9089f6de lavapipe: fix sampler + sampler view leaks.
The compute sampler views are using a different method
of generation so have to be deleted explicitly.

Fixes: e94fd4cc65 ("lavapipe: rename vallium to lavapipe")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14939>
2022-02-09 09:54:21 +10:00
Pavel Ondračka 1f5330de3a r300: fix transformation of abs modifiers with negate
It is being overwritten by the memset. Just set the only remaining
member RelAddr explicitly.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14915>
2022-02-08 22:54:02 +00:00
Emma Anholt ef112db311 ci: Bump VK-GL-CTS to 1.3.1.0.
The main thing is VK 1.3 testing, but also includes test bugfixes.  The
1.3 CTS required an uprev of deqp-runner to handle a new style of test
output, and that deqp-runner brings in some neat new features, too (piglit
in your deqp-runner suite, and extension list checking).

A bunch of VK tests got renamed, so I replaced panvk's custom test list
with simple include filters on the main test list.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> (panvk)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14920>
2022-02-08 22:16:36 +00:00
Emma Anholt 3f34251495 ci/broadcom: Remove unused v3dv xfails file.
It's actually in broadcom-rpi4-fails.txt.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14920>
2022-02-08 22:16:35 +00:00
Emma Anholt 648dd03e32 ci/panfrost: Add a flake a few of us have run into in the last couple days.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14920>
2022-02-08 22:16:35 +00:00
Jesse Natalie 60775780ae d3d12: Allow 8bit index buffer conversions by vbuf
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie 52766e020f d3d12: Use CPU storage in TC for buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie 96d68cb300 d3d12: Add a buffer busy callback to the bufmgr
Not all cached buffers can be mapped, so using map with do-not-wait
is a terrible heuristic. Use an explicit buffer busy callback which
is always false, since buffers are only put into the cache once they're
free.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie 9d6febad5d d3d12: Actually suballocate and cache buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie d0f4f8efae d3d12: Fix offset for buf/image copies with suballocated buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie fb08bc8d76 d3d12: Don't suballocate TBO buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie 58a9a63d9e d3d12: Fix TBOs from suballocated buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie c35f77aa84 d3d12: Delete make_resource_writeable
This never did anything useful AFAICT since we didn't actually
suballocate buffers, and when this ended up being invoked it breaks
the ability to read back XFB data.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie caae9b0e1f d3d12: Always respect offsets when mapping a bo, not just when there's a range
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie b48aea0ec8 d3d12: Fix range calculation for suballocated buffers in d3d12_bo_unmap
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie 2659098d6d d3d12: Fix set constant buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie 7ec0e2b893 tc: CPU storage needs to be freed with align_free
Cc: mesa-stable
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Alyssa Rosenzweig 12446491c1 panfrost: Fix Depth Source enum
As I suspected... sigh.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig 32e58c2dd4 panfrost: Remove unused layout enums
Folded into Valhall-specific plane descriptor enums.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig d27d46a266 panfrost: Remove some indexed formats on Valhall
Block compressed formats like ETC2 are now indicated in the plane descriptor,
rather than the pixel format descriptor. Various other minor formats were
removed in Valhall; remove them from the XML so we don't accidentally try to use
them.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig 8c51b54bd1 panfrost: Update supported job types
Remove a few that no longer exist, and rename IDVS helper to Malloc Vertex. The
distinction between Malloc Vertex jobs and regular Indexed Vertex jobs is that
the hardware allocates varying buffers dynamically for Malloc Vertex jobs.
Regular IDVS and even legacy tiler jobs are also supported where desired.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig d70a48a706 panfrost: Flesh out tiler heap descriptor
Merged with the Buffer descriptor, hence why it shares a type nibble. However,
Bifrost uses a dedicated tiler heap descriptor, and I see no benefit to merging.
So pretending it's a dedicated descriptor on Valhall too allows us to reuse the
Bifrost code with no modifications.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig 62173fa532 panfrost: Strip % in GenXML names
A new Valhall enum will represent percentages, so allow that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig e514f4c0b1 panfrost: Flesh out Buffer descriptor
Add fields required for structured buffers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Jason Ekstrand 4c61c8a0b8 vulkan,lavapipe: Simplify command recording code-gen
The Entrypoint class already has utilities for gettingt he parameter
list as either declarations or as comma-separated argument names for a
call.  Use that instead of hand-rolling it.  The only modification we
need to make is to add the ability to start the list somewhere other
than at the beginning.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14919>
2022-02-08 19:50:57 +00:00
Mike Blumenkrantz cb781fc350 lavapipe: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14911>
2022-02-08 18:38:20 +00:00
Mike Blumenkrantz 1532556eb0 zink: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14911>
2022-02-08 18:38:20 +00:00
Mike Blumenkrantz 08c2b9d7cb lavapipe: use util_pack_color_union() for generating clear colors
this enables clamping for packed formats (e.g., RGB10_A2UI) where color
values may exceed the width of the component

cc: mesa-stable

fixes (zink):
KHR-GL45.direct_state_access.renderbuffers_storage*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14911>
2022-02-08 18:38:20 +00:00
Emma Anholt 6faaeca584 ci/freedreno: Add another unsizedArrayLength flake.
Started appearing on Feb 1, but given that the rest of this test group
flakes, I assume it's similar.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14934>
2022-02-08 18:04:37 +00:00
Andrii Pauk cf4de7d8ff venus: Allow usage of virtio-mmio based device
Libdrm reports bustype as DRM_BUS_PLATFORM for virtio-mmio
based device. DRM_BUS_PCI is reported only for virtio-pci based
devices. Add possibility to use devices with DRM_BUS_PLATFORM.

Signed-off-by: Andrii Pauk <Andrii.Pauk@opensynergy.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14531>
2022-02-08 17:53:21 +00:00