Commit graph

159607 commits

Author SHA1 Message Date
Karol Herbst
af115c915b rusticl/mem: implement clCopyBuffer
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
883b218eff rusticl/queue: fix clReleaseCommandQueue
we have to flush the queue on every call

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
a4c0f59b5f rusticl/program: undefine __IMAGE_SUPPORT__ if images are unsupported
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
c5a535a5ef rusticl/kernel: implement clEnqueueTask
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
cbbd1617cc rusticl/kernel: implement clCreateKernelsInProgram
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
47a80d7ff4 rusticl/event: proper eventing support
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
50e981a050 rusticl/mesa: add fencing support
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
feb0689839 rusticl: hack for CL 3.0
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
ebfffa1dae rusticl/event: wrong but non crashing impl of clWaitForEvents
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
3baf270316 rusticl/mem: use helper context for COPY_HOST_PTR buffers
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
fe8789e674 rusticl/kernel: clGetKernelWorkGroupInfo allows a NULL device
In which case we have to get the only device associated with the kernel.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
ea02dfce88 rusticl/kernel: more clGetKernelWorkGroupInfo props
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
5795ee0e08 rusticl: translate spirv to nir and first steps to kernel arg handling
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
46ee5988cd rusticl: nir bindings
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
e8de580998 rusticl/kernel: basic implementation
still not able to run kernels, but most of the boilerplate code is there now

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
129b821638 rusticl/mem: support ops on subbuffers
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
c430459310 rusticl: implement clEnqueueReadBuffer
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
4ec5f7b822 rusticl: implement clFinish and clFlush
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
10413d1db5 rusticl/util: add static_assert macro
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
1a999e6379 rusticl: finish implementing clBuildProgram
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
Karol Herbst
20c90fed5a rusticl: added
Initial code drop for Rusticl :)

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
2022-09-12 05:58:12 +00:00
David Heidelberg
d431a01d9a ci/lava: collapse printing env
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18529>
2022-09-11 23:21:48 +00:00
David Heidelberg
9ba46289fa ci/test: collapse printing env
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18529>
2022-09-11 23:21:48 +00:00
David Heidelberg
8c956a859f ci/traces: do not keep a cache, which will be wiped a few steps later
The desired state is to revert this patch at that moment,
when we'll be able to verify traces by checksums,
but for now, let's disable caching.

10s for restoring cache: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/28137099#L17
?s for removing cache: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/28137099#L813
1s for saving cache: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/28137099#L1047

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18531>
2022-09-11 22:49:26 +00:00
Thomas H.P. Andersen
6d19b34571 spirv: avoid allocating memory twice
ptr_type was allocated twice. This drops the second allocation.

It has been like this since the introduction of the code in
b778e7bd6c

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18450>
2022-09-11 22:13:09 +00:00
Emma Anholt
c93b72d045 ci: Add support for Jetson TK1.
This is a farm of 5 (6, but one fails) TK1 boards for nouveau testing,
hosted and maintained by me.  Currently it runs GLES dEQP.

I've been using ./.gitlab-ci/bin/ci_run_n_monitor.py --stress --target
gk20a to test it and am pretty confident of the skips/flakes list.  Last
night it ran 318 jobs without fail, and prior to that there were two sets
of runs in the 100-200 range where only the one failing runner failed any
jobs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18497>
2022-09-11 04:23:38 +00:00
Mike Blumenkrantz
dcc5261895 zink: implement async nir creation
this just punts to the compile threads directly

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18198>
2022-09-10 19:01:56 +00:00
Mike Blumenkrantz
b8c82b50f7 mesa/st: add MESA_COMPUTE_PBO env var
this adds a variable which, when set, overrides the return of the
pipe_screen::is_compute_copy_faster hook to force using compute shader
downloads even on drivers that don't export the cap/hook, enabling easier
testing

it also adds MESA_COMPUTE_PBO=spec to force always using specialized pbo variants

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18198>
2022-09-10 19:01:56 +00:00
Mike Blumenkrantz
5dab7673e1 mesa/st: add specialized pbo download shaders
the goal of the pbo ubershaders was to have a very small number of
shaders that could handle lots of different readback operations

this is great for cases where an app is doing lots of different types
of readback, but it's not as optimal for apps which do only 1-2 types
of readback over and over

to handle this, track the usage for every readback which reaches compute pbo
and after the same readback is used N times, inline the constant data and
create a specialized version of the shader which will be more optimal

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18198>
2022-09-10 19:01:56 +00:00
Mike Blumenkrantz
c79fc40de5 st_pbo/compute: use new shader interface to perform async shader creation
this enables compatible drivers to initiate threaded creation of huge
compute shaders fully in a thread while falling back to software in
order to avoid blocking for several seconds, as slower progress is better
than no progress at all--especially in cases where the huge pbo shader
may only be used a single time

the mechanics are straightforward for thread-enabled drivers:
* check hash table for existing shader data
* if no shader exists, perform creation of nir shader fully in driver thread
  and return immediately, enabling software fallback without blocking
* once fence for nir shader is signalled, pass the nir back to the driver
  thread again to run common nir passes and execute normal shader creation
* continue to use software fallback until the shader is fully ready

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18198>
2022-09-10 19:01:56 +00:00
Mike Blumenkrantz
b36a741aa4 gallium: add pipe_screen::driver_thread_add_job
this allows a frontend to punt creation of a nir shader down to the
driver's compilation thread, which is useful in the event that the
shader being created is so big that it will cause immediate blocking
from running common nir passes

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18198>
2022-09-10 19:01:56 +00:00
Mike Blumenkrantz
6b8339fa54 mesa/st: move compute pbo shutdown to compute pbo file
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18198>
2022-09-10 19:01:56 +00:00
Mike Blumenkrantz
7f9dfcd2bf st_pbo/compute: use split shader finish funcs
no functional changes

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18198>
2022-09-10 19:01:56 +00:00
Mike Blumenkrantz
e7f2f050c4 mesa/st: split out builtin shader finish
it's useful to be able to run the nir passes separately

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18198>
2022-09-10 19:01:56 +00:00
Gert Wollny
95cea62a9b virgl: Report CONSTANT_BUFFER_SIZE according to GL_MAX_UNIFORM_BLOCK_SIZE
GL_MAX_FRAGMENT_UNIFORM_COMPONENTS may not report a size that
is useful to calculate the supported UBO size. Use the value
GL_MAX_UNIFORM_BLOCK_SIZE instead when the host supports this.

Related: https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/286
Fixes: 5b683ba19a
  virgl: Only progagate the uniform numbers if the numbers are actually right

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18512>
2022-09-10 15:23:57 +00:00
Gert Wollny
d5394296be r600: set nir option lower_cs_local_index_to_id
Fixes:  7662a5e9d3
  mesa: Remove PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED/lower_cs_derived.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18518>
2022-09-10 07:40:37 +00:00
Isaac Bosompem
36d050210e virgl: Set use_staging in resource_from_handle
This flag controls virgl's behavior when buffers
are accessed on the guest through Mesa's GBM interface.

As such, this flag needs to be consistent in both the
resource creation and fd import case. Previously, the
fd import resource's flag value would be inconsistent
with the original resource's value.

This patch fixes this by inferring the value of this flag
based on the resource's size.

Signed-Off By: Isaac Bosompem <mrisaacb@google.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18477>
2022-09-10 06:29:00 +00:00
Alyssa Rosenzweig
e6cdffa0fc docs/envvars: Document Asahi variables
There aren't too many.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18508>
2022-09-09 21:25:55 +00:00
Mike Blumenkrantz
43a8a92430 zink: add a ci skip for anv
taking too long

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18523>
2022-09-09 18:42:56 +00:00
Roman Stratiienko
b8c026a365 lima: Ensure jobs initialized before calling lima_job_fini()
To avoid crash during cleanup if lima_context_create fails.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7196
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18407>
2022-09-09 18:25:17 +00:00
Caio Oliveira
027b8b4249 intel/compiler: Add helper for barrier message payload setup for gfx >= 125
CS-like and TCS control barriers converged in gfx >= 125, so use a
common helper for the message payload setup.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18362>
2022-09-09 09:35:08 -07:00
Caio Oliveira
55db3aaa3a intel/compiler: Create fs_visitor::emit_tcs_barrier()
Allow us to implement this in brw_fs_visitor.cpp, which then will
let us deduplicate code between the CS-like barrier and the TCS
barrier in a later patch.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18362>
2022-09-09 09:35:08 -07:00
Danilo Krummrich
b97590371a nv50/ir: handle U8/U16 integers converting to U64
We can't directly convert from unsigned integers smaller than 64 bit to
unsigned 64 bit integers. Hence, converting from 32 bit to 64 bit is
handled by just merging with 0. To support U8/U16 integers handle them
just the same way.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18109>
2022-09-09 17:32:30 +02:00
Danilo Krummrich
caba679e56 nv50/ir: handle S8/S16 integers converting to S64
We can't convert directly from signed integers smaller 64 bit to signed
64 bit integers. For 32 bit integers this is handled with SHR and MERGE.
In order to also support 8/16 bit singed integers convert them to 32 bit
first.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18109>
2022-09-09 17:32:27 +02:00
Danilo Krummrich
2aaa315eee nv50/ir: split and cvt 64bit integers for {i,u}2{i,u}{8,16}
We can't convert from a 64 bit integer to any integer smaller than
64 bit directly, hence split the value first and then cvt / mov to the
target type.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18109>
2022-09-09 17:32:24 +02:00
Danilo Krummrich
8ccba4ea5c nv50/ir: add intermediate conversion for f2{i,u}{8,16}
Directly converting from a float to an 8 bit integer and from a 64 bit
float to an integer smaller than 32 bit is not supported, therefore add
an intermediate conversion to an 32 bit integer.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18109>
2022-09-09 17:32:22 +02:00
Danilo Krummrich
6a9825bc1b nv50/ir/nir: always round towards zero for f2i/f2u
Conversions to integers must be rounded towards zero, hence, actually
do this for all integers including 8/16 bit sources.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18109>
2022-09-09 17:32:18 +02:00
Danilo Krummrich
109d56f612 nv50/ir/nir: convert 8/16 bit src to 32 bit for {i,u}2f64
Converting signed and unsigned integers from 8/16 bit sources to a 64 bit
floating point destination (i2f64 / u2f64) isn't possible, hence convert
the source to 32 bit first.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18109>
2022-09-09 17:32:16 +02:00
Danilo Krummrich
78fc5e3773 nv50/ir: add isUnsignedIntType() and isIntType() helpers
Add helper functions to check whether a DataType is an unsigned integer
type and whether a DataType is either an unsigned or signed integer
type.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18109>
2022-09-09 17:32:13 +02:00
Danilo Krummrich
ec60dcd870 nv50/ir/nir: avoid 8/16 bit dest regs for OP_MOV
Instructions like

  mov u16 %r78s 0x00ff (0)

are dropped, since they're not supported by the HW, hence avoid using
8/16 bit destination registers for OP_MOV and use the full width of the
register instead.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18109>
2022-09-09 17:32:10 +02:00