platform/upstream/mesa.git
23 months agoac/llvm: fix 16bit varying llvm compile error
Qiang Yu [Fri, 18 Nov 2022 08:37:19 +0000 (16:37 +0800)]
ac/llvm: fix 16bit varying llvm compile error

Found when 16bit vec3 varying with llvm14 (not found
when llvm15), one 32bit vec4 slot is filled like this:
  vec3[0] | undef
  vec3[1] | undef
  vec3[2] | undef
  undef   | undef

LLVM error is for the elements with undef:
  %287 = insertelement float %280, half %279, i64 0

After this change, we get:
  %287 = insertelement <2 x half> %280, half %279, i64 0

Fixes: 279eea5bda2 ("amd/llvm: Transition to LLVM "opaque pointers"")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19848>

23 months agoasahi: Fix memory leak on error path.
Vinson Lee [Sun, 20 Nov 2022 21:41:55 +0000 (13:41 -0800)]
asahi: Fix memory leak on error path.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable rsc going out of scope leaks the storage it points to.

Fixes: 01964625eb2 ("asahi: Implement agx_resource_from_handle")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19887>

23 months agomapi: update gles 1.1 extention packet link
Yusuf Khan [Sun, 20 Nov 2022 02:33:31 +0000 (20:33 -0600)]
mapi: update gles 1.1 extention packet link

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19874>

23 months agoradv/rt: use explicitly named sbt entries in radv_pipeline_group_handle
Daniel Schürmann [Fri, 18 Nov 2022 12:58:26 +0000 (13:58 +0100)]
radv/rt: use explicitly named sbt entries in radv_pipeline_group_handle

This improves readability, makes it less error-prone and
allows for easier changes in future.

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

23 months agov3d(v): account for debug flags when using the cache
Eric Engestrom [Thu, 10 Nov 2022 12:14:12 +0000 (12:14 +0000)]
v3d(v): account for debug flags when using the cache

Signed-off-by: Eric Engestrom <eric@igalia.com>
Cc: mesa-stable
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19796>

23 months agoasahi: Advertise all supported renderable formats
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:28:05 +0000 (22:28 -0500)]
asahi: Advertise all supported renderable formats

Now that we have the new tilebuffer infrastructure in place, all renderable
formats should be working.

This reverts commit 32ab63b4fcaaaf832d549ddcf7b3a225c5f73df4.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi,agx: Use new tilebuffer infrastructure
Alyssa Rosenzweig [Sat, 19 Nov 2022 18:48:14 +0000 (13:48 -0500)]
asahi,agx: Use new tilebuffer infrastructure

Flag day change to replace the previous hardcoded background/end-of-tile shaders
and the API-style load/store_output in fragment shaders with the generated
shaders and lowered *_agx intrinsics. This gets us working non-UNORM8 render
targets and working MRT. It's also a step in the direction of working MSAA but
that needs a lot more work, since the multisampling programming model on AGX is
quite different from any of the APIs (including Metal).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add new clear/reload/store infrastructure
Alyssa Rosenzweig [Sat, 19 Nov 2022 18:12:02 +0000 (13:12 -0500)]
asahi: Add new clear/reload/store infrastructure

With multiple render targets, it's not practical to generate all
variants of the background and end-of-tile programs at start up. Rather
than trying, add a hash table of meta program keys to background
programs, and compile variants as they're needed.

With the new infrastructure, it's sensible to handle clears with the
same code path as reloads. In addition to getting us closer to multiple
render target support, this gets us support for non-RGBA8 render
targets, as the u8norm tilebuffer format was baked into the hardcoded
clear shader and store shaders used before.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Use correct tib settings for USC
Alyssa Rosenzweig [Sat, 19 Nov 2022 04:18:14 +0000 (23:18 -0500)]
asahi: Use correct tib settings for USC

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Extend texture descriptor packing for MSAA
Alyssa Rosenzweig [Sat, 19 Nov 2022 04:08:29 +0000 (23:08 -0500)]
asahi: Extend texture descriptor packing for MSAA

Multisampling uses different values of the dimension enum in tandem with a new
samples field. Handle this in agx_pack_texture (split off here) so we can use
the new functionality for texture descriptors in reloads too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Remove some bogus asserts
Alyssa Rosenzweig [Sat, 19 Nov 2022 04:07:24 +0000 (23:07 -0500)]
asahi: Remove some bogus asserts

Hitting in dEQP-GLES31

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Implement texture_barrier trivially
Alyssa Rosenzweig [Sat, 19 Nov 2022 04:00:48 +0000 (23:00 -0500)]
asahi: Implement texture_barrier trivially

For the advanced blending tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Calculate tilebuffer layout per batch
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:59:42 +0000 (22:59 -0500)]
asahi: Calculate tilebuffer layout per batch

It won't be fixed soon.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add agx_usc_shared_none helper
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:50:03 +0000 (22:50 -0500)]
asahi: Add agx_usc_shared_none helper

Convenience for vertex USC programs.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add R16 SNORM formats
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:49:45 +0000 (22:49 -0500)]
asahi: Add R16 SNORM formats

For completeness, since we do have hardware for this.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add more XML via PowerVR
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:48:20 +0000 (22:48 -0500)]
asahi: Add more XML via PowerVR

These bits are the same as RGX.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add note to XML about 16-bit varyings
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:47:52 +0000 (22:47 -0500)]
asahi: Add note to XML about 16-bit varyings

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Identify more depth-related fields in XML
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:47:28 +0000 (22:47 -0500)]
asahi: Identify more depth-related fields in XML

Needed for gl_FragDepth writes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add XML for layered rendering
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:46:55 +0000 (22:46 -0500)]
asahi: Add XML for layered rendering

We don't need to support this for a while but it's good to know the mechanism.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add NIR pass to lower tilebuffer access
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:35:05 +0000 (22:35 -0500)]
asahi: Add NIR pass to lower tilebuffer access

The compiler can't handle load/store_output directly for nontrivial tilebuffer
layouts. Add a NIR pass to lower these intrinsics, applying a given layout.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add tilebuffer layout helpers
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:31:58 +0000 (22:31 -0500)]
asahi: Add tilebuffer layout helpers

Laying out the tilebuffer is nontrivial and a task shared between GL and VK, so
add unit-tested helpers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add some notes about unknowns to the XML
Alyssa Rosenzweig [Sun, 23 Oct 2022 21:44:11 +0000 (17:44 -0400)]
asahi: Add some notes about unknowns to the XML

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Identify multisampling fields of shared layout
Alyssa Rosenzweig [Tue, 8 Nov 2022 01:01:40 +0000 (20:01 -0500)]
asahi: Identify multisampling fields of shared layout

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Add _with_bo pool uploads
Alyssa Rosenzweig [Sun, 23 Oct 2022 00:48:29 +0000 (20:48 -0400)]
asahi: Add _with_bo pool uploads

Will be useful for managing our meta shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoagx: Add block_image_store instruction
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:52:20 +0000 (22:52 -0500)]
agx: Add block_image_store instruction

This hw instruction writes out an entire block from the tilebuffer to an
attached render target (PBE descriptor). It is used (only?) in end-of-tile
shaders to implement write out. We need to handle it in the compiler as a
prerequisite to compiling end-of-tile shaders ourselves, instead of hardcoding.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoagx: Add helper to map pipe formats to agx_formats
Alyssa Rosenzweig [Sat, 19 Nov 2022 16:22:43 +0000 (11:22 -0500)]
agx: Add helper to map pipe formats to agx_formats

Or a restricted subset thereof anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoagx: Implement nir_texop_txf_ms
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:40:39 +0000 (22:40 -0500)]
agx: Implement nir_texop_txf_ms

Mutlisampled texture fetch (txf_ms) is encoded like regular txf. However, we now
need to pack the multisample index in the right place, which we do by extending
our existing NIR texture source lowering pass. 2D MS arrays use a new value of
dim which requires tweaking the encoding slightly. Otherwise, everything is
bog standard.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoail: Handle multisampling
Alyssa Rosenzweig [Sat, 19 Nov 2022 03:38:27 +0000 (22:38 -0500)]
ail: Handle multisampling

It appears that multisampled textures on AGX have all samples of the same pixel
contiguous in memory, effectively using the layout of a single-sampled texture
with a larger block size. Handle in ail.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Make libasahi_lib depend on libasahi_decode
Alyssa Rosenzweig [Sat, 19 Nov 2022 20:17:17 +0000 (15:17 -0500)]
asahi: Make libasahi_lib depend on libasahi_decode

The track_alloc and track_free symbols are used, we need to link them in.
Depending on build flags / environment / etc, fixes the potential build error
hit by a CI job:

mold: error: undefined symbol: agxdecode_track_alloc
>>> referenced by agx_device.c
>>>               src/asahi/lib/libasahi_lib.a(src/asahi/lib/libasahi_lib.a.p/agx_device.c.o):(agx_shmem_alloc)>>> referenced by agx_device.c
>>>               src/asahi/lib/libasahi_lib.a(src/asahi/lib/libasahi_lib.a.p/agx_device.c.o):(agx_bo_create)
mold: error: undefined symbol: agxdecode_track_free
>>> referenced by agx_device.c
>>>               src/asahi/lib/libasahi_lib.a(src/asahi/lib/libasahi_lib.a.p/agx_device.c.o):(agx_bo_unreference)

...when trying to link with libasahi_lib without libasahi_decode for unit tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoasahi: Use PIPE_FORMATs for driver-compiler ABI
Alyssa Rosenzweig [Sat, 19 Nov 2022 15:58:08 +0000 (10:58 -0500)]
asahi: Use PIPE_FORMATs for driver-compiler ABI

This avoids exposing the ISA-internal agx_format to the driver, instead hiding
it behind a real PIPE_FORMAT. This lets us use real pipe formats in formatted
intrinsics in NIR, which is convenient; it will allow us to simplify the
compiler/driver ABI; and it lets us use common format helpers (e.g.
util_format_get_blocksize) for the internal formats in driver lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agonir: Define AGX intrinsics for local pixel access
Alyssa Rosenzweig [Tue, 8 Nov 2022 01:30:45 +0000 (20:30 -0500)]
nir: Define AGX intrinsics for local pixel access

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>

23 months agoturnip: Apply the RB_DBG_ECO_CNTL_blit workaround.
Emma Anholt [Wed, 12 Oct 2022 16:15:23 +0000 (09:15 -0700)]
turnip: Apply the RB_DBG_ECO_CNTL_blit workaround.

On blob v512.490 on a615, using WRAP_GPU_ID to fake GPU versions, I see
0x41 used everywhere, except for BLIT_OP_SCALE on a630.

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

23 months agofreedreno: Don't WFI and set RB_DBG_ECO_CNTL if it's not changing.
Emma Anholt [Thu, 17 Nov 2022 00:07:03 +0000 (16:07 -0800)]
freedreno: Don't WFI and set RB_DBG_ECO_CNTL if it's not changing.

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

23 months agofreedreno: Update RB_DBG_ECO_CNTL/RB_DBG_ECO_CNTL_blit.
Emma Anholt [Thu, 17 Nov 2022 00:02:36 +0000 (16:02 -0800)]
freedreno: Update RB_DBG_ECO_CNTL/RB_DBG_ECO_CNTL_blit.

On blob v512.490, using WRAP_GPU_ID to fake GPU versions, I see 0x41 used
everywhere, except for BLIT_OP_SCALE on a630.  Define the magic number in
dev info so it can be reused in the two places that set the
non-BLIT_OP_SCALE value.

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

23 months agor600/sfn: sort FS color outputs before all other outputs
Gert Wollny [Fri, 18 Nov 2022 15:53:34 +0000 (16:53 +0100)]
r600/sfn: sort FS color outputs before all other outputs

The color outputs must be checked against the number of available
color buffers, therefore it is best to sort the color outputs to be
on the driver locations before the other FS outputs.

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
   r600/sfn: rewrite NIR backend

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7530

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19804>

23 months agor600: Print RAT instruction names in disassembly
Gert Wollny [Wed, 16 Nov 2022 17:17:13 +0000 (18:17 +0100)]
r600: Print RAT instruction names in disassembly

Also print the swizzle of the address to indicate what
values may be used.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19804>

23 months agor600: Update scratch buffer late
Gert Wollny [Wed, 16 Nov 2022 16:38:41 +0000 (17:38 +0100)]
r600: Update scratch buffer late

For some reason the setup that comes after the scratch buffer
setup calls clobber the PS output configuration. Emitting the
scratch buffer setup as last action before the actual draw commands
seems to fix this.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19804>

23 months agofreedreno/drm/virtio: Defer flush on BO free
Rob Clark [Thu, 17 Nov 2022 22:36:45 +0000 (14:36 -0800)]
freedreno/drm/virtio: Defer flush on BO free

Freeing BOs tends to be bursty (ie. when a submit is retired, or
expiring entries from BO cache).  Sending lots of small SET_IOVA
messages to the host can quickly eat up the available virtqueue
slots, resulting in (eventually) starving the guest waiting for
free virtqueue space.  By batching, we can avoid this and handle
things more efficiently on the host (ie. in a single wakeup rather
than many).

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

23 months agofreedreno/drm: Support for batched frees
Rob Clark [Thu, 17 Nov 2022 22:34:52 +0000 (14:34 -0800)]
freedreno/drm: Support for batched frees

Batch up handles before closing them to give the drm backend a chance to
batch up any extra handling needed (ie. virtio batching up messages to
host to release IOVA).

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

23 months agofreedreno/drm: Add optimized path for freeing many BOs
Rob Clark [Thu, 17 Nov 2022 21:53:07 +0000 (13:53 -0800)]
freedreno/drm: Add optimized path for freeing many BOs

Submits tend to hold references to a lot of BOs, which get unref'd when
the submit is destroyed/retired.  For now, all this does is reduce lock
aquire/release, but the next commit will build on it.

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

23 months agoasahi: Add batch tracking logic
Alyssa Rosenzweig [Thu, 17 Nov 2022 23:10:11 +0000 (18:10 -0500)]
asahi: Add batch tracking logic

We already have the notion of an agx_batch, which encapsulates a render
pass. Extend the logic to allow multiple in-flight batches per context, avoiding
a flush in set_framebuffer_state and improving performance for certain
applications designed for IMRs that ping-pong unnecessarily between FBOs. I
don't have such an application immediately in mind, but I wanted to get this
flag-day out of the way while the driver is still small and flexible.

The driver was written from day 1 with batch tracking in mind, so this is a
relatively small change to actually wire it up, but there are lots of little
details to get right.

The code itself is mostly a copy/paste of panfrost, which in turn draws
inspiration from freedreno and v3d.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>

23 months agoasahi: Use the batch for submission
Alyssa Rosenzweig [Thu, 17 Nov 2022 23:31:41 +0000 (18:31 -0500)]
asahi: Use the batch for submission

So we can submit background batches.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>

23 months agoasahi: Use batch_reads for sysvals
Alyssa Rosenzweig [Thu, 17 Nov 2022 23:31:11 +0000 (18:31 -0500)]
asahi: Use batch_reads for sysvals

Required for proper resource tracking.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>

23 months agoasahi: Use a pipe_framebuffer_state batch key
Alyssa Rosenzweig [Thu, 17 Nov 2022 23:23:23 +0000 (18:23 -0500)]
asahi: Use a pipe_framebuffer_state batch key

More convenient for batch tracking.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>

23 months agoasahi: Use batch instead of ctx for pipelines
Alyssa Rosenzweig [Thu, 17 Nov 2022 23:17:50 +0000 (18:17 -0500)]
asahi: Use batch instead of ctx for pipelines

So we can support multiple batches later.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>

23 months agoasahi: Hide ctx->batch
Alyssa Rosenzweig [Thu, 17 Nov 2022 22:22:45 +0000 (17:22 -0500)]
asahi: Hide ctx->batch

This will make it easier to support multiple batches.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>

23 months agoasahi: Factor out prepare_for_map
Alyssa Rosenzweig [Thu, 17 Nov 2022 18:37:36 +0000 (13:37 -0500)]
asahi: Factor out prepare_for_map

This will be expanded, let's expand in the direction of less spaghetti.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>

23 months agointel/fs: put scratch surface in the surface state heap
Lionel Landwerlin [Mon, 14 Nov 2022 13:54:01 +0000 (15:54 +0200)]
intel/fs: put scratch surface in the surface state heap

In 4ceaed7839af we made scratch surface state allocations part of the
internal heap (mapped to STATE_BASE_ADDRESS::SurfaceStateBaseAddress)
so that it doesn't uses slots in the application's expected 1M
descriptors (especially with vkd3d-proton).

But all our compiler code relies on BSS
(STATE_BASE_ADDRESS::BindlessSurfaceStateBaseAddress).

The additional issue is that there is only 26bits of surface offset
available in CS instruction (CFE_STATE, 3DSTATE_VS, etc...) for
scratch surfaces. So we need the drivers to put the scratch surfaces
in the first chunk of STATE_BASE_ADDRESS::SurfaceStateBaseAddress
(hence all the driver changes).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ceaed7839af ("anv: split internal surface states from descriptors")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7687
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19727>

23 months agoiris: move bindless surface state heap inside the surface state heap
Lionel Landwerlin [Tue, 15 Nov 2022 12:26:38 +0000 (14:26 +0200)]
iris: move bindless surface state heap inside the surface state heap

We're about to make scratch surface states part of the surface state
heap. Because those are required to be in the low 26bits parts surface
state heap (we're limited in bits handed in the CFE_STATE, 3DSTATE_VS,
etc... instructions), this change splits the 32bit surface state heap
as follow:

   - 8Mb of surface states for scratch
   - 1Gb - 8Mb of binding tables
   - 3Gb of surface states

That way all of the surfaces are located within a 4Gb region visible
from STATE_BASE_ADDRESS::SurfaceStateBaseAddress

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19727>

23 months agoiris: prevent crash in decoder
Lionel Landwerlin [Thu, 17 Nov 2022 10:42:16 +0000 (12:42 +0200)]
iris: prevent crash in decoder

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19727>

23 months agoradv: Convert instance bvh address to node in bvh build.
Bas Nieuwenhuizen [Sun, 13 Nov 2022 02:13:55 +0000 (03:13 +0100)]
radv: Convert instance bvh address to node in bvh build.

So we don't have to do it in the traversal loop. Should 2 and
instructions and a 64-bit shift, so 4/8 cycles per instance node
visit.

Totals from 7 (0.01% of 134913) affected shaders:

CodeSize: 208460 -> 208292 (-0.08%)
Instrs: 38276 -> 38248 (-0.07%)
Latency: 803181 -> 803142 (-0.00%)
InvThroughput: 165384 -> 165376 (-0.00%)
Copies: 4912 -> 4905 (-0.14%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706>

23 months agoradv: Fiddle with opaque flag positions to reduce instructions.
Bas Nieuwenhuizen [Sat, 12 Nov 2022 01:52:25 +0000 (02:52 +0100)]
radv: Fiddle with opaque flag positions to reduce instructions.

Totals from 7 (0.01% of 134913) affected shaders:

CodeSize: 209076 -> 208460 (-0.29%)
Instrs: 38374 -> 38276 (-0.26%)
Latency: 803899 -> 803181 (-0.09%)
InvThroughput: 165530 -> 165384 (-0.09%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706>

23 months agoradv: Skip and for node_to_addr with bvh_base.
Bas Nieuwenhuizen [Sat, 12 Nov 2022 01:13:17 +0000 (02:13 +0100)]
radv: Skip and for node_to_addr with bvh_base.

Cause the bvh base is always 64 byte aligned.

Totals from 7 (0.01% of 134913) affected shaders:

CodeSize: 209216 -> 209076 (-0.07%)
Instrs: 38402 -> 38374 (-0.07%)
Latency: 804537 -> 803899 (-0.08%)
InvThroughput: 165663 -> 165530 (-0.08%)
Copies: 4919 -> 4912 (-0.14%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706>

23 months agoradv: Move ray flag compares out of the loop.
Bas Nieuwenhuizen [Fri, 11 Nov 2022 21:43:25 +0000 (22:43 +0100)]
radv: Move ray flag compares out of the loop.

To save on and+cmp combos with VALU instructions.

Totals from 7 (0.01% of 134913) affected shaders:

CodeSize: 208476 -> 209216 (+0.35%)
Instrs: 38384 -> 38402 (+0.05%)
Latency: 805725 -> 804537 (-0.15%)
InvThroughput: 165906 -> 165663 (-0.15%)
Copies: 4936 -> 4919 (-0.34%)
PreSGPRs: 393 -> 430 (+9.41%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706>

23 months agoRevert "nir/lower_shader_calls: put inserted instructions into a dummy block"
Lionel Landwerlin [Wed, 16 Nov 2022 13:23:35 +0000 (15:23 +0200)]
Revert "nir/lower_shader_calls: put inserted instructions into a dummy block"

This reverts commit 35d82ecf1ee117bef575731100fa6ae532f225fc.

Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19820>

23 months agonir/lower_shader_calls: wrap only jumps rather than entire code blocks
Lionel Landwerlin [Wed, 16 Nov 2022 15:34:08 +0000 (17:34 +0200)]
nir/lower_shader_calls: wrap only jumps rather than entire code blocks

Moving entire chunks of code into a dummy if block is causing issues
in some situations. To work around the issue that we tried to fix in
35d82ecf1e ("nir/lower_shader_calls: put inserted instructions into a
dummy block") which is that we cannot cut and past a block of
instruction that ends with a jump if there are more instruction behind
where we're going to past. We can instead just wraps the jumps into
dummy if blocks.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19820>

23 months agonir/lower_shader_calls: update metadata before validation
Lionel Landwerlin [Wed, 16 Nov 2022 15:36:19 +0000 (17:36 +0200)]
nir/lower_shader_calls: update metadata before validation

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19820>

23 months agoradv/bvh: Adjust sah cost based on depth
Konstantin Seurer [Tue, 15 Nov 2022 17:36:09 +0000 (18:36 +0100)]
radv/bvh: Adjust sah cost based on depth

Adds a cost field to radv_ir_node and uses it to model the cost of tree
depth. This improves framerates by 2% if my benchmarking is correct.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19756>

23 months agonir/range_analysis: Set higher default maximum for max_workgroup_count
Ian Romanick [Thu, 17 Nov 2022 20:47:59 +0000 (12:47 -0800)]
nir/range_analysis: Set higher default maximum for max_workgroup_count

Fixes: c2a81ebe19f ("nir: Add default unsigned upper bound configuration.")
Closes: #7676
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19835>

23 months agoiris: Pass devinfo directly in iris_setup_uniforms
Caio Oliveira [Fri, 18 Nov 2022 00:16:06 +0000 (16:16 -0800)]
iris: Pass devinfo directly in iris_setup_uniforms

Instead of reaching through brw_compiler.  This will make easy
future changes on brw_compiler side.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19836>

23 months agointel/compiler: Require C++17
Michael Skorokhodov [Thu, 17 Nov 2022 22:59:38 +0000 (00:59 +0200)]
intel/compiler: Require C++17

Fixes: 6c194ddd18f ("intel/compiler: Prepare SIMD selection helpers to handle different prog_datas")

Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19833>

23 months agoasahi: Don't support 16-bit vertex attributes
Alyssa Rosenzweig [Thu, 17 Nov 2022 17:12:29 +0000 (12:12 -0500)]
asahi: Don't support 16-bit vertex attributes

Currently broken, let vbuf deal with it. "Fixes" sysprof.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Fix logic ops
Alyssa Rosenzweig [Thu, 17 Nov 2022 16:22:25 +0000 (11:22 -0500)]
asahi: Fix logic ops

Need to set colour mask correctly. Fixes spec@!opengl 1.0@gl-1.0-logicop@GL_AND,
at least the non-MSAA portion.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Restrict rendering to what we support
Alyssa Rosenzweig [Tue, 8 Nov 2022 20:18:28 +0000 (15:18 -0500)]
asahi: Restrict rendering to what we support

Noticed with Kodi that tries to use rgb10a2.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Don't validate WSI (twiddled) strides
Alyssa Rosenzweig [Thu, 17 Nov 2022 22:44:27 +0000 (17:44 -0500)]
asahi: Don't validate WSI (twiddled) strides

These are made up and won't necessarily be aligned.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Split out agx_usc.h into a common file
Alyssa Rosenzweig [Thu, 10 Nov 2022 03:41:04 +0000 (22:41 -0500)]
asahi: Split out agx_usc.h into a common file

So the tilebuffer helpers can build the "shared" USC word. Also because Ella
will probably want to use these O:)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Note some magic bits used with memoryless RTs
Alyssa Rosenzweig [Thu, 10 Nov 2022 01:17:42 +0000 (20:17 -0500)]
asahi: Note some magic bits used with memoryless RTs

Obviously there can't *actually* be memoryless render targets, because
how would partial renders work? The control stream with memoryless looks
like everything would if it went to memory (e.g. full 2D MSAA
attachments for the partial loads/stores even if only a resolved
2D image for the final store). Except the memoryless attachments all
load from the same address 0xeeee0000. Clearly that's not actually what
happens, so what gives? Unclear... but I see the magic bits mentioned
here set, and I assume there are some firmware (or kernel) shenanigans
used to JIT allocate the backing storage for partial renders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Identify "Sample mask after depth/stencil" bit
Alyssa Rosenzweig [Sun, 23 Oct 2022 20:50:00 +0000 (16:50 -0400)]
asahi: Identify "Sample mask after depth/stencil" bit

Corresponds to Metal [[sample_mask,post_depth_coverage]].

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Identify the pass type enum
Alyssa Rosenzweig [Sun, 23 Oct 2022 17:43:25 +0000 (13:43 -0400)]
asahi: Identify the pass type enum

Via PowerVR.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Identify PBE sample count
Alyssa Rosenzweig [Sun, 23 Oct 2022 16:28:48 +0000 (12:28 -0400)]
asahi: Identify PBE sample count

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Identify Dimension for Render Target
Alyssa Rosenzweig [Sun, 23 Oct 2022 16:20:52 +0000 (12:20 -0400)]
asahi: Identify Dimension for Render Target

Metal uses when rendering to multisampled 2D.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Fix agx_set_framebuffer_state for MRT
Alyssa Rosenzweig [Sun, 23 Oct 2022 14:54:33 +0000 (10:54 -0400)]
asahi: Fix agx_set_framebuffer_state for MRT

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Set data_valid for the correct level
Alyssa Rosenzweig [Sun, 23 Oct 2022 14:54:12 +0000 (10:54 -0400)]
asahi: Set data_valid for the correct level

By inspection.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Implement stencil texturing
Alyssa Rosenzweig [Sat, 22 Oct 2022 15:36:47 +0000 (11:36 -0400)]
asahi: Implement stencil texturing

Stencil texturing is easy: S8_UINT is textured like R8_UINT (with a
little swizzle fixup), and stencil is always S8_UINT thanks to
u_transfer_helper. So we just need to do some fixups to make
u_transfer_helper's seperate_stencil work and everything will work out.

Passes dEQP-GLES31.functional.stencil_texturing.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Add internal formats for RGB10A2
Alyssa Rosenzweig [Sun, 23 Oct 2022 03:37:43 +0000 (23:37 -0400)]
asahi: Add internal formats for RGB10A2

We need to use I16 as the interchange format here. Fixes:

   dEQP-GLES3.functional.fragment_out.basic.uint.rgb10_a2ui*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Implement perf_debug
Alyssa Rosenzweig [Sun, 13 Nov 2022 02:22:00 +0000 (21:22 -0500)]
asahi: Implement perf_debug

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoasahi: Free the scanout resource
Alyssa Rosenzweig [Sun, 13 Nov 2022 01:28:34 +0000 (20:28 -0500)]
asahi: Free the scanout resource

Fixes memory leaks with renderonly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoagx: Handle collects in backwards isel
Alyssa Rosenzweig [Sat, 12 Nov 2022 16:51:21 +0000 (11:51 -0500)]
agx: Handle collects in backwards isel

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoagx: Assert more invariants in RA
Alyssa Rosenzweig [Sat, 12 Nov 2022 16:37:49 +0000 (11:37 -0500)]
agx: Assert more invariants in RA

Was helpful for debugging.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoagx: Validate part of SSA form
Alyssa Rosenzweig [Sat, 12 Nov 2022 16:35:26 +0000 (11:35 -0500)]
agx: Validate part of SSA form

To debug backend pass problems.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoagx: Split off NIR preprocessing from compiling
Alyssa Rosenzweig [Tue, 8 Nov 2022 01:51:36 +0000 (20:51 -0500)]
agx: Split off NIR preprocessing from compiling

So we can specialize after lowering I/O.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoagx: Handle scalar texture destinations
Alyssa Rosenzweig [Thu, 10 Nov 2022 14:49:42 +0000 (09:49 -0500)]
agx: Handle scalar texture destinations

Fixes dEQP-GLES3.functional.shaders.texture_functions.texturelod.sampler2dshadow_fragment.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoagx: Don't depend on GenXML
Alyssa Rosenzweig [Tue, 8 Nov 2022 01:36:35 +0000 (20:36 -0500)]
agx: Don't depend on GenXML

Separation of concerns, unused #include.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoagx: Lower packs/unpacks and bitfields
Alyssa Rosenzweig [Tue, 8 Nov 2022 01:00:17 +0000 (20:00 -0500)]
agx: Lower packs/unpacks and bitfields

Needed for GLES3. These could be optimized.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>

23 months agoutil: Move src/gallium/include/pipe/p_format.h to src/util/format/u_formats.h
Yonggang Luo [Wed, 16 Nov 2022 15:49:50 +0000 (23:49 +0800)]
util: Move src/gallium/include/pipe/p_format.h to src/util/format/u_formats.h

Because p_format.h shared between vulkan drivers and opengl drivers

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19629>

23 months agoci/freedreno: disable flaking Civilization V
David Heidelberg [Sat, 19 Nov 2022 00:09:20 +0000 (01:09 +0100)]
ci/freedreno: disable flaking Civilization V

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7491

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19862>

23 months agoutil: Rename PIPE_ALIGN_STACK to UTIL_ALIGN_STACK and moved into util/compiler.h
Yonggang Luo [Sun, 13 Nov 2022 02:47:55 +0000 (10:47 +0800)]
util: Rename PIPE_ALIGN_STACK to UTIL_ALIGN_STACK and moved into util/compiler.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19676>

23 months agollvmpipe: fixes error: ‘enum pipe_blendfactor’ declared in lp_test_blend.c
Yonggang Luo [Mon, 7 Nov 2022 06:43:20 +0000 (14:43 +0800)]
llvmpipe: fixes error: ‘enum pipe_blendfactor’ declared  in lp_test_blend.c

error  message:
In file included from ../../src/gallium/drivers/llvmpipe/lp_test_blend.c:44:
../../src/gallium/drivers/llvmpipe/lp_bld_blend.h:47:21: error: ‘enum pipe_blendfactor’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
   47 |                enum pipe_blendfactor factor_src,

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19676>

23 months agoutil: convert usage of uint to unsigned in u_format.h
Yonggang Luo [Mon, 7 Nov 2022 09:43:20 +0000 (17:43 +0800)]
util: convert usage of uint to unsigned in u_format.h

Because uint comes from pipe/p_compiler.h, and that depends will be removed in future

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19676>

23 months agoutil: use void * instead of byte * for util_copy_rect in u_format.h
Yonggang Luo [Mon, 7 Nov 2022 06:12:11 +0000 (14:12 +0800)]
util: use void * instead of byte * for util_copy_rect in u_format.h

As ubyte comes from p_compiler.h,  so do not use it,
and the code calles util_copy_rect may use args with type uint8_t*, ubyte* or unsigned char*,
so use the type void* that consistence with memcpy

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19676>

23 months agotgsi: fixes error: ‘enum pipe_shader_type’ declared in tgsi_info.h
Yonggang Luo [Mon, 7 Nov 2022 05:53:53 +0000 (13:53 +0800)]
tgsi: fixes error: ‘enum pipe_shader_type’ declared  in tgsi_info.h

error message:
../../src/gallium/auxiliary/tgsi/tgsi_info.h:92:30: error: ‘enum pipe_shader_type’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
   92 | tgsi_get_processor_name(enum pipe_shader_type processor);

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19676>

23 months agoaco: fixes error: 'uint' was not declared in aco_instruction_selection.cpp
Yonggang Luo [Mon, 7 Nov 2022 10:05:40 +0000 (18:05 +0800)]
aco: fixes error: 'uint' was not declared in aco_instruction_selection.cpp

uint is from pipe/p_compiler.h

error message:
../../src/amd/compiler/aco_instruction_selection.cpp:11061:4: error: 'uint' was not declared in this scope; did you mean 'rint'?
11061 |    uint en_mask = 1;

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19676>

23 months agoutil: Remove the usage of enum pipe_error in u_hash_table.*
Yonggang Luo [Sun, 6 Nov 2022 13:31:35 +0000 (21:31 +0800)]
util: Remove the usage of enum pipe_error in u_hash_table.*

Use 0 instead of PIPE_OK in u_hash_table.c

Because pipe_error and PIPE_OK is comes from pipe/p_defines.h that doesn't belong
to src/util/

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19676>

23 months agoutil: Remove redundant #include "util/u_inlines.h" in u_trace.c
Yonggang Luo [Sun, 6 Nov 2022 13:21:41 +0000 (21:21 +0800)]
util: Remove redundant #include "util/u_inlines.h" in u_trace.c

util/u_inlines.h is comes from src/gallium/auxiliary/util/u_inlines.h,
so when possible, do not use it under src/util folder

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19676>

23 months agointel/compiler: Remove redundant argument from brw_nir_create_passthrough_tcs
Caio Oliveira [Thu, 17 Nov 2022 22:49:56 +0000 (14:49 -0800)]
intel/compiler: Remove redundant argument from brw_nir_create_passthrough_tcs

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19831>

23 months agointel/perf: fix printf formatting of size_t for 32bit builds
Mark Janes [Fri, 18 Nov 2022 18:59:41 +0000 (10:59 -0800)]
intel/perf: fix printf formatting of size_t for 32bit builds

Fixes: bdacd6df5adc ("intel/perf: add a non installable tool to print metrics")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7736
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19856>

23 months agoci/dzn: add flake
David Heidelberg [Fri, 18 Nov 2022 21:17:21 +0000 (22:17 +0100)]
ci/dzn: add flake

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19858>

23 months agodocs: update Python requirement to 3.7
David Heidelberg [Wed, 16 Nov 2022 23:13:12 +0000 (00:13 +0100)]
docs: update Python requirement to 3.7

Reported in https://gitlab.freedesktop.org/mesa/mesa/-/issues/7716

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19791>

23 months agoinclude: Update the OpenCL headers
Jason Ekstrand [Thu, 17 Nov 2022 17:06:53 +0000 (11:06 -0600)]
include: Update the OpenCL headers

This syncs all our headers with their canonical versions from Khronos.
Of particular note, CL headers repo does not have cl.hpp and cl2.hpp has
been depricated all in favor of opencl.hpp which is the new canonical
header.  Fortunately, nothing in Mesa uses any of the C++ headers so
this shouldn't break anything.

Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19816>

23 months agoclover: Use braces arround a union initializer
Jason Ekstrand [Thu, 17 Nov 2022 17:55:08 +0000 (11:55 -0600)]
clover: Use braces arround a union initializer

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