Commit Graph

162364 Commits

Author SHA1 Message Date
Anton Bambura 18e7f5c428 panfrost: Enable Mali-T620
Support of this GPU is now good enough to enable it

Signed-off-by: Anton Bambura <jenneron@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19408>
2022-10-31 13:02:06 +00:00
Gert Wollny 333aa0a6e8 r600: Print MOVA_INT dest on Cayman
On Cayman the index registers can be written too, so print it.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19397>
2022-10-31 12:52:49 +00:00
Gert Wollny dfeb96e277 r600: Only count ALU registers that are not clause local
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19397>
2022-10-31 12:52:49 +00:00
Gert Wollny 04465c10bd r600: declare for counter locally and fix signed/unsigned warning
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19397>
2022-10-31 12:52:49 +00:00
Samuel Pitoiset d4ec3f21cf Revert "radv: add a pointer to radv_shader_binary in radv_shader"
This is actually not necessary because we compile and upload binaries
directly from libraries with GPL. This introduced random double free
crashes because binaries were potentially freed by concurrent threads.

Root cause found by Ishi.

This reverts commit f8d887527a.

Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19383>
2022-10-31 12:16:38 +00:00
Sunil Khatri 4f57dfc115 winsys/amdgpu: clamp up the alignment if zero
Zero alignment buffers is a valid alignment and is
used for the cases when there is no special alignment
enforced due to hardware requirement.

Clamp up the buffer alignment of such buffers to
gart_page_size. Screenshot app uses such buffers
with zero alignment which is returned NULL by winsys
and failed and hence failed to capture.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19314>
2022-10-31 11:48:14 +00:00
Danylo Piliaiev 5eaca461a7 freedreno/fdl: Increase alignment for UBWC images
From empirical tests (on a660) R8G8 with UBWC enabled requires 256b
alignment, otherwise there would be a GPU fault during blits.

Set alignment to 4096 for all UBWC images since that's what blob does
and this area is heavily undertested.

Fixes GPU fault in Borderlands 3 running through DXVK.

cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19298>
2022-10-31 11:17:31 +00:00
Frank Binns d4b43d1bcf pvr: setup buffer and image format feature bits
Note, this also fixes a case where image usage and format feature flags were
being mixed. This was noticed as part of the conversion to format feature 2
flags.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19372>
2022-10-31 11:07:30 +00:00
Georg Lehmann 2eac571d61 aco: Use opsel for the third operand.
Foz-DB Navi21:
Totals from 2 (0.00% of 134913) affected shaders:
CodeSize: 7788 -> 7772 (-0.21%)
Instrs: 1305 -> 1303 (-0.15%)
Latency: 7175 -> 7163 (-0.17%)
InvThroughput: 2082 -> 2078 (-0.19%)
Copies: 57 -> 55 (-3.51%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19380>
2022-10-31 09:54:01 +00:00
Samuel Pitoiset 25e311e9d3 radv: implement transform feedback queries with NGG streamout
The control bit is written to the upper bits because GDS counters
are 32-bits only, this allows to re-use the existing query shader.

Tested on GFX10.3.

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/19325>
2022-10-31 08:22:29 +00:00
Tapani Pälli 7cfd0e8d31 hasvk: remove some unused functions
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19368>
2022-10-31 06:59:36 +00:00
Tapani Pälli f9176d9b2c anv: remove some unused functions
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19368>
2022-10-31 06:59:36 +00:00
Bas Nieuwenhuizen 78519987b9 radv: Speculatively tune RT pipelines for GFX11.
With ACO not supporting VOPD and the high number of SALU instructions,
we're likely better off using wave64 until we can actually benchmark
this and fix these issues.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19288>
2022-10-31 02:39:34 +00:00
Lionel Landwerlin 6b52834ece anv: remove shader fp64 inspection after parsing
Unfortunately some crucible tests are using all floating point widths
in a single shader and specializing a variable to select what code
path to use for a particular supported floating point width. This is
reporting errors in the validation layers.

Remove the validation for now.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes 8c4c4c3ee1 ("anv: Add softtp64 workaround")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19401>
2022-10-30 22:16:52 +00:00
Yusuf Khan 492ac88078 nouveau: enable PIPE_CAP_UMA when appropriate
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18172>
2022-10-30 20:21:51 +00:00
Bas Nieuwenhuizen 9369b40725 radv: Use PLOC for BVH building
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Bas Nieuwenhuizen 271865373e radv: Add PLOC shader
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Friedrich Vock 14dfb6035f radv: Add REF as a typename macro to .clang-format
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Friedrich Vock 0c0f179037 radv: Add global sync utilities
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Friedrich Vock 608fa1bd25 radv/rt: Track number of inactive leaf nodes
To avoid emitting nodes with only invalid children in PLOC.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Friedrich Vock f502b3aab3 radv/rt: Dispatch internal converter indirectly
Preparation for using the converter with PLOC.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Friedrich Vock 49c0995918 radv/rt: Fix internal converter synchronization
Fixes: e83e4faf ("radv: Only emit parents from parents that actually end up in the tree.")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Friedrich Vock fa578f280e radv: Add radv_indirect_unaligned_dispatch
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Friedrich Vock 030a1f6843 radv: Use a struct for AABBs
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Bas Nieuwenhuizen ccf0a69e05 radv: Make the number of internal nodes be written on the GPU.
Opens the door of algorithms with a variable number of nodes.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Bas Nieuwenhuizen 0e23df959e radv: Add BVH IR header.
To include GPU state passed between stages but not in a node.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Friedrich Vock 37525c11d1 radv: Rename emulated float helpers
Use only conversion functions now.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292>
2022-10-30 19:48:46 +00:00
Mauro Rossi db946364df util: glsl2spirv.py: ensure '#endif' is printed in new line
Fixes the following building errors:

In file included from ../src/intel/vulkan/anv_pipeline_cache.c:34:
src/intel/vulkan/float64_spv.h:3316:3: error: expected identifier or '('
};#endif // FLOAT64_SPV_H
  ^
src/intel/vulkan/float64_spv.h:1:2: error: unterminated conditional directive
 ^
../src/intel/vulkan/anv_pipeline_cache.c:59:17: error: use of undeclared identifier 'anv_shader_bin_serialize'; did you mean 'anv_shader_bin_deserialize'?
   .serialize = anv_shader_bin_serialize,
                ^~~~~~~~~~~~~~~~~~~~~~~~
                anv_shader_bin_deserialize
../src/intel/vulkan/anv_pipeline_cache.c:41:1: note: 'anv_shader_bin_deserialize' declared here
anv_shader_bin_deserialize(struct vk_device *device,
^
../src/intel/vulkan/anv_pipeline_cache.c:59:17: error: incompatible pointer types initializing 'bool (*)(struct vk_pipeline_cache_object *, struct blob *)' with an expression of type 'struct vk_pipeline_cache_object *(struct vk_device *, const void *, size_t, struct blob_reader *)' (aka 'struct vk_pipeline_cache_object *(struct vk_device *, const void *, unsigned long, struct blob_reader *)') [-Werror,-Wincompatible-pointer-types]
   .serialize = anv_shader_bin_serialize,
                ^~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.

Fixes: 9786d9e ("util: Add glsl2spirv.py script")
Reviewed-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19394>
2022-10-30 14:14:21 +01:00
Filip Gawin 3f282b54fa r300: update r400 tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19395>
2022-10-29 20:45:17 +00:00
Mike Blumenkrantz e68ecb52d2 zink: enable renderpass optimizing for turnip jobs
this should catch regressions, at the least

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19077>
2022-10-29 20:19:51 +00:00
Mike Blumenkrantz 8a439f89d4 zink: use tc renderpass tracking to optimize renderpasses
this massively improves performance on tiling gpus

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19077>
2022-10-29 20:19:51 +00:00
Mike Blumenkrantz 58f09f5993 zink: add a context flag to indicate when blitter is running
...or blitter-like functionality

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19077>
2022-10-29 20:19:51 +00:00
Mike Blumenkrantz 07017aa137 util/tc: implement renderpass tracking
this allows tc to track metadata for framebuffer attachments so that
drivers can optimize their renderpasses

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19077>
2022-10-29 20:19:51 +00:00
Mike Blumenkrantz 42fafd2f51 util/tc: split out dsa and fs state cso handling
no functional changes

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19077>
2022-10-29 20:19:51 +00:00
Mike Blumenkrantz 288d109ff3 util/tc: split out flush and deferred flush calls
it's useful to be able to separate these, and deferred flushes can also consume
slightly less memory

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19077>
2022-10-29 20:19:51 +00:00
Jordan Justen 2f32e8f64b ci/d3d12: Update quick_shader results with 24 fixes from !19128
Suggested-by: Jesse Natalie <jenatali@microsoft.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19128>
2022-10-29 19:45:44 +00:00
Francisco Jerez be6da31034 nir/lower_int64: Implement lowering of 64-bit integer to 64-bit float conversions.
This involves computing the significand with a 64-bit precision type,
and implementing the normalization and packing manually instead of
relying on u2f32, since the significand can no longer be represented
as a 32-bit integer.  This fixes 64-bit integer to 64-bit float
conversions on devices that support 64-bit float natively but lack
64-bit integer support, like Intel MTL hardware.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19128>
2022-10-29 19:45:44 +00:00
Francisco Jerez 29da985682 nir/lower_int64: Enable lowering of 64-bit float to 64-bit integer conversions.
The existing code for this appears to work okay for conversions
involving 64-bit floats, relax the assert and enable the lowering
path.  This fixes 64-bit float to 64-bit integer integer conversions
on devices that have native support for 64-bit floats but lack 64-bit
integer support, like Intel MTL hardware.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19128>
2022-10-29 19:45:44 +00:00
Alyssa Rosenzweig eac8cbb049 asahi: Identify counts for compute kernels
In the same place as for vertex/fragment.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19265>
2022-10-29 19:23:51 +00:00
Marek Olšák 8f1a9a8dae radeonsi: force the MSAA resolve shader to use 1 clause for MSAA loads
LLVM can't keep consecutive loads in a clause.

Using the optimization barrier for sample indices produces the optimal code.
Deduced by trial and error.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19243>
2022-10-29 18:38:33 +00:00
Marek Olšák 0ac37b595a nir: add nir_intrinsic_optimization_barrier_vgpr_amd for LLVM
We need this for the MSAA resolve shader.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19243>
2022-10-29 18:38:33 +00:00
Alyssa Rosenzweig 041f484588 panfrost: Add lots of perf_debug annotations
Should make it easier to diagnose performance issues in the future.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19358>
2022-10-29 18:23:55 +00:00
Alyssa Rosenzweig 1ff3b87ba2 panfrost: Enable rendering to 16-bit and 32-bit
Bifrost onwards handle this in hardware, and the Midgard lowering isn't
too terrible. Enable the format, otherwise desktop GL apps such as
Hacknet try to render to the format and get an incomplete framebuffer.

Cc stable because apparently we've been advertising this format
unintentionally as a result of some other interaction? Unclear how
Hacknet is hitting this, maybe it's an app bug. Shrug, it's not a big
deal regardless.

Additionally, we need to restrict texturing from 32-bit normalized due
to a restriction added with the v7 pixel format fiasco. That means
restricting rendering to 32-bit normalized on v7 onwards.

Closes: #7251
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Tested-by: Dang Huynh <danct12@disroot.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19358>
2022-10-29 18:23:55 +00:00
Alyssa Rosenzweig 3a9cdd780d panfrost/ci: Disable trace-based testing
Trace-based testing has not worked for Panfrost. It was a neat
experiment, and I'm glad we tried it, but the results have been mostly
negative for the driver. Disable the trace-based tests.

For testing that specific API features work correctly, we run the
conformance tests (dEQP), which are thorough for OpenGL ES. For big GL
features, we run Piglit, and if there are big GL features that we are
not testing adequately, we should extend Piglit for these. For
fine-grained driver correctness, we are already covered.

Where trace-based testing can fit in is as a smoke test, ensuring that
the overall rendering of complex scenes does not regress. In principle,
that's a lovely idea, but the current implementation has not worked out
for Panfrost thus far. The crux of the issue is that the trace based
tests are based on checksums, not fuzzy-compared reference images. That
requires updating checksums any time rendering changes. However, a
rendering change to a trace is NOT a regression. The behaviour of OpenGL
is specified very loosely. For a given trace, there are many different
valid checksums. That means that correct changes to core code frequently
fail CI after running through the rest of CI, only because a checksum
changed in a still correct way. That's a pain to deal with, exacerbated
by rebase pains, and provides negative value to the project. Some recent
examples of this I've hit in the past two weeks alone:

   panfrost: Enable rendering to 16-bit and 32-bit
   4b49241f7d ("panfrost: Use proper formats for pntc varying")
   ac2964dfbd ("nir: Be smarter fusing ffma")

The last example were virgl traces, but were especially bad: due to a
rebase fail, I had to update traces /twice/, wasting two full runs of
pre-merge CI across *all* hardware. This was extremely wasteful.

The value of trace-based testing is as a smoke test to check that traces
still render correctly. That is useful, but it turns out that checksums
are the wrong way to go about it. A better implementation would be
storing only a single reference image from a software rasterizer per
trace. No driver-specific references would be stored. That reference
image must never change, provided the trace never changes. CI would then
check rendered results against that image with tolerant fuzzy
comparisons. That tolerance matches with the fuzzy comparison that the
human eye would do when investigating a checksum change anyway. Yes, the
image comparison JavaScript will now report that
0 pixels changed within the tolerance, but there's nothing a human eye
can do with that information other than an error prone copypaste of new
checksums back in the yaml file and kicking it back to CI, itself a
waste of time.

Finally, in the time we've had trace-based testing alongside the
conformance tests, I cannot remember a single actual regression in one
of my commits the trace jobs have identified that the conformance tests
have not also identified. By contrast, the conformance test coverage has
prevented the merge of a number of actual regressions, with very few
flakes or xfail changes, and I am grateful we have that coverage. That
means the value added from the trace jobs is close to zero, while the
above checksum issues means that the cost is tremendous, even ignoring
the physical cost of the extra CI jobs.

If you work on trace-based testing and would like to understand how it
could adapted to be useful for Panfrost, see my recommendations above.
If you work on CI in general and would like to improve Panfrost's CI
coverage, what we need right now is not trace-based testing, it's
GLES3.1 conformance runs on MediaTek MT8192 or MT8195. That hardware is
already in the Collabora LAVA lab, but it's not being used for Mesa CI
as the required kernel patches haven't made their way to mainline yet
and nobody has cherry-picked them to the gfx-ci kernel. If you are a
Collaboran and interested in improving Panfrost CI, please ping
AngeloGioacchino for information on which specific patches need to be
backported or cherry-picked to our gfx-ci kernel. Thank you.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19358>
2022-10-29 18:23:55 +00:00
Rob Clark 5d3895d13b nir: Add way to create passthrough TCS without VS nir
In the case of disk-cache hits, radeonsi no longer has the nir shader
around.  So add a way to create a passthrough TCS with just the VS
output locations.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7567
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19382>
2022-10-29 17:46:23 +00:00
Rob Clark 4229d2e39c docs: Update features.txt
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19388>
2022-10-29 16:47:08 +00:00
Alyssa Rosenzweig b575f5ed6c gallium: Only use Asahi's software path on macOS
On macOS, we don't have DRM or any real WSI, so Asahi has to pretend to be a
software rasterizer to load. On Linux, we do have DRM and proper WSI, so we
don't want that. For faking Asahi devices on Linux, we should use drm-shim
instead. This makes sure we don't accidentally load Asahi on non-M1 Linux.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15940>
2022-10-29 12:04:41 -04:00
Alyssa Rosenzweig db8ab52447 gallium: Stub support for Asahi + DRM
Copy-paste a pile of winsys code from panfrost and find-and-replace the name to
asahi. This should contain all the glue code needed for asahi+kmsro.

The kernel driver is under way (led by Asahi Lina, not me), but it's not
wred up here. My goal was rather to run shader-db, which expects a
render node, which means drm-shim, which means DRM loader support. With
this patch and a trivial drm-shim, shader-db runs.

In general I am reticent to touch UABI related code when the UABI hasn't been
finalized upstream, or started design at all, hence the RFC. Realistically this
patch assumes the following about the future UABI:

0. It will be a DRM driver. This is nonnegotiable.

1. The render node will be named "asahi". The other reasonable name would be
   "apple", which I'm using for the display controller (not yet upstream, but
   getting close).

2. Display and rendering will be split in the kernel, requiring kmsro in
   userspace, as agreed in past discussions.

   The 3D accelerator (AGX) and the display controller (DCP) are completely
   orthogonal blocks with separate lineages. True, Apple A14 (~= M1) has AGX and
   DCP together, and it seems like all the chips that will get upstream support
   will have this for the forseeable future. Nevertheless, it's a historical
   coincidence. Apple A12 had an AGX block with a pre-DCP Apple display
   controller, which would use a completely different display driver. Older SoCs
   had a PowerVR block with an Apple shader core, with a pre-DCP Apple display
   controller. Even older SoCs had a pure PowerVR block (+ Apple display).

   The AGX and DCP kernel drivers are not expected to share any nontrivial code.
   We don't gain anything by bundling them together. Likewise, the many
   codec blocks are completely orthogonal. This is all standard practice
   for Arm SoCs.

   It is true that AGX has never been used with a non-Apple display
   controller; it is highly unlikely this would change (either by AGX
   licensing out or something like Mali-DP getting licensed in). But
   an extra kmsro user doesn't actually add more complexity to Mesa, so
   shrug.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com> [meson, ack on gallium]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15940>
2022-10-29 12:04:41 -04:00
Gert Wollny 27c8cddec1 r600/sfn: Add .clang-format file and apply style
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19379>
2022-10-29 12:28:50 +00:00
Karol Herbst e58c004870 nir/algebraic: add vec8/16 cmp lowering
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19150>
2022-10-29 10:31:39 +00:00