Commit Graph

116604 Commits

Author SHA1 Message Date
Dylan Baker 821cf6942a meson: Use cmake to find LLVM when building for windows
We don't use cmake normally because it always results in static linking.
This is very problematic for *nix OSes which expect shared linking by
default, but for windows this isn't a problem as LLVM doesn't support
shared linking on windows anyway.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-10-18 13:02:58 -07:00
Dylan Baker b962c7c971 meson: Add support for wrapping llvm
For building on Windows (when not using cygwin), users may want to use a
binary wrap of LLVM, this provides a fallback to the LLVM dependency
which may be used in this case

Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-10-18 13:02:58 -07:00
Dylan Baker dbd554ba05 meson/llvmpipe: Add dep_llvm to driver_swrast
This fixes build errors in gl-gdi on windows when using llvmpipe

Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-10-18 13:02:58 -07:00
Hal Gentz fa611b07f1 Revert "egl: Add EGL_CONFIG_SELECT_GROUP_MESA ext."
This reverts commit 173bc9d684.
2019-10-18 18:41:51 +00:00
Hal Gentz 94386d476c Revert "egl: Fixes transparency with EGL and X11."
This reverts commit 90a19074b4.
2019-10-18 18:41:51 +00:00
Hal Gentz 9997693960 Revert "egl: Puts RGBA visuals in the second config selection group."
This reverts commit a800d16e4f.
2019-10-18 18:41:51 +00:00
Hal Gentz 4ef2c53755 Revert "egl: Configs w/o double buffering support have no `EGL_WINDOW_BIT`."
This reverts commit 075a96aa92.
2019-10-18 18:41:51 +00:00
Jonathan Marek 9a7a92c1ec etnaviv: check NO_ASTC feature bit
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 19:30:41 +02:00
Jonathan Marek 15c5ec0024 etnaviv: fix TS samplers on GC7000L
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 19:23:59 +02:00
Jonathan Marek ad48411d72 etnaviv: fix linear_nearest / nearest_linear filters on GC7000Lite
MIN filter is only used when LOD MAX is at least 4 (I guess the 2 LSB don't
actually exist).

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 19:06:44 +02:00
Lucas Stach 95adc393eb etnaviv: GC7000: flush TX descriptor and instruction cache
The etnaviv kernel driver will only ever flush write caches. As both
the TX descriptor and instruction cache are read caches they must be
flushed from the user cmdstream at an appropriate time.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-10-18 19:06:39 +02:00
Lucas Stach 54dd288317 etnaviv: add linear texture support on GC7000
It's just a matter of writing the addressing mode into the
texture descriptor.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-10-18 19:06:35 +02:00
Wladimir J. van der Laan eda73d7127 etnaviv: GC7000: Texture descriptors
Create a separate implementation file with texture-descriptor-based
sampler views and sampler states. Initialize the one or the other
based on the GPU. There is so little in common that this seemed more
appropriate that keeping them as one type of state object would
only be confusing.

This commit is actually a combiation of the original commit by
Wladimir, fixes and TS implementation from Jonathan and changed to
use softpin by Lucas.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-10-18 19:06:20 +02:00
Lucas Stach 5bc3fcf620 etnaviv: check for softpin availability on Halti5 devices
Halti5 uses texture descriptors to control the samplers, and thus needs to
know the GPU virtual address for the texture buffers to fill into the
descriptor buffer. Without softpin userspace has no control over the GPU
VM and also no way to fix up the texture descriptor buffer, so there is
no point in creating a screen on a Halti5 device without softpin being
available.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-10-18 19:05:25 +02:00
Lucas Stach 0bdf5420f1 etnaviv: drm: add softpin interface
If softpin is available on the kernel side, we transparently replace the
relocs with self-managed GPU virtual addresses. This allows to skip some
work at the kernel side, as it doesn't need to touch the command stream
anymore before submitting it to the hardware.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-10-18 19:05:21 +02:00
Marek Vasut e5cc66dfad etnaviv: Rework locking
Replace the per-screen locking of flushing with per-context one and
add per-context lock around command stream buffer accesses, to prevent
cross-context flushing from corrupting these command stream buffers.

Signed-off-by: Marek Vasut <marex@denx.de>
2019-10-18 17:03:25 +00:00
Marek Vasut 0c38c5454b etnaviv: Command buffer realloc
Reallocate the command stream buffer in case it is too small.
The older kernel versions are limited to 64 kiB buffer, so
limit the size to avoid oversized buffers.

Signed-off-by: Marek Vasut <marex@denx.de>
2019-10-18 17:03:25 +00:00
Marek Vasut 1456aa61cc etnaviv: Rework resource status tracking
Have each context track which resources it marked as pending read and
pending write. Have each resource track in which context it is pending.
This way, it is possible to identify when a resource is both pending
read and pending write at the same time. Moreover, the status field
can be correctly calculated and updated when necessary.

Signed-off-by: Marek Vasut <marex@denx.de>
2019-10-18 17:03:25 +00:00
Lucas Stach 1194afdfe3 etnaviv: rework the stream flush to always go through the context flush
This way we can ensure that the pipe driver tracking of pending resources
stays in sync with the actual command buffer state, even if a space
reservation triggers a forced flush.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-10-18 17:03:25 +00:00
Lucas Stach 1864fcd8c7 etnaviv: drm: remove unused etna_cmd_stream_finish
It's not used by anything and gets in the way for the refactoring of
the flush handling.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-10-18 17:03:25 +00:00
Lucas Stach 9e672e4d20 etnaviv: keep references to pending resources
As long as a resource is pending in any context we must not destroy
it, otherwise we'll hit a classical use-after-free with fireworks.
To avoid this take a reference when the resource is first added to
the pending set and put the reference when no longer pending.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-10-18 17:03:25 +00:00
Marek Vasut 90e223646b etnaviv: Make contexts track resources
Currently, the screen tracks all resources for all contexts, but this
is not correct. Each context should track the resources it uses. This
also allows a context to detect whether a resource is used by another
context and to notify another context using a resource that the current
context is done using the resource.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Guido Günther <guido.gunther@puri.sm>
Cc: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 17:03:25 +00:00
Brian Paul 2946bd6628 REVIEWERS: add VMware reviewers 2019-10-18 16:42:40 +00:00
Samuel Pitoiset 7c50214aab radv: implement VK_KHR_shader_float_controls
This exposes what's required for DX and this is what we already
configure. The driver flushes denorms for FP32 and preserves them
for FP16/FP64. Note that we can't allow both preserving and
flushing denorms because this won't work for merged shaders. This
will require LLVM to update the float mode register to make it work.

Only enabled on GFX8+ with the LLVM path because it's untested on
previous chips and ACO doesn't support it.

This extension is required for SPIRV 1.4.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-10-18 16:55:58 +02:00
Samuel Pitoiset 2c2aaf275c ac/llvm: force fneg/fabs to flush denorms to zero if requested
LLVM optimizes these instructions with XOR/AND and it loses
the sign bit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-10-18 16:55:55 +02:00
Samuel Pitoiset 7dfb15fff1 ac/llvm: add AC_FLOAT_MODE_ROUND_TO_ZERO
Because some instructions will be optimized by the backend compiler,
the driver has to manually flush to zero to keep the result exact.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-10-18 16:55:51 +02:00
Samuel Pitoiset d94bd4e512 ac/llvm: add ac_build_canonicalize() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-10-18 16:55:48 +02:00
Eric Engestrom 3ad6154f4e travis: test meson install as well
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-18 15:27:37 +01:00
Eric Engestrom b0853a43da travis: don't (re)install python
The new Mac OS X images apparently already have python2 and python3,
and `brew` considers asking to install something already installed
as a fatal error...

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-18 15:27:37 +01:00
Lepton Wu a651926884 gbm: Add GBM_MAX_PLANES definition
This removed hard coded "4".

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
2019-10-18 13:18:28 +00:00
Jose Maria Casanova Crespo f8da0f6198 v3d: Explicitly expose OpenGL ES Shading Language 3.1
This will expose GL_EXT_primitive_bounding_box and
GL_OES_primitive_bounding_box after previous commits
expose OpenGL ES 3.1 once Compute Shaders are available.

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-10-18 14:08:52 +02:00
Iago Toral Quiroga db87439232 v3d: request the kernel to flush caches when TMU is dirty
This adapts the v3d driver to the new CL submit ioctl interface that
allows the driver to request a flush of the caches after the render
job has completed. This seems to eliminate the kernel write violation
errors reported during CTS and Piglit excutions, fixing some CTS tests
and GPU resets along the way.

v2:
  - Adapt to changes in the kernel side.
  - Disable shader storage and shader images if the kernel doesn't
    implement cache flushing.

Fixes CTS tests:
KHR-GLES31.core.shader_image_size.basic-nonMS-fs-float
KHR-GLES31.core.shader_image_size.basic-nonMS-fs-int
KHR-GLES31.core.shader_image_size.basic-nonMS-fs-uint
KHR-GLES31.core.shader_image_size.advanced-nonMS-fs-float
KHR-GLES31.core.shader_image_size.advanced-nonMS-fs-int
KHR-GLES31.core.shader_image_size.advanced-nonMS-fs-uint
KHR-GLES31.core.shader_atomic_counters.advanced-usage-many-draw-calls2
KHR-GLES31.core.shader_atomic_counters.advanced-usage-draw-update-draw
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-int
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std140-matR
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std140-struct
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std430-matC-pad
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std430-vec

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-10-18 14:08:52 +02:00
Eric Anholt 66e2d3b69f v3d: Add Compute Shader support
Now that the UAPI has landed, add the pipe_context function for
dispatching compute shaders.  This is the last major feature for GLES 3.1,
though it's not enabled quite yet.
2019-10-18 14:08:52 +02:00
Iago Toral Quiroga 2d8b51ea4d broadcom: document known hardware issues for L2T flush command
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-10-18 14:08:52 +02:00
Iago Toral Quiroga 46182fc1da v3d: add new flag dirty TMU cache at v3d_compiler
That we set for any TMU write on spills and general tmu. It is then
used as part of v3d_emit_gl_shader_state later.

v2: add a new flag instead at v3d_compiler instead of dirty the flag
    at v3dx if there is any spill (change suggested by Eric, added by
    Alejandro)

v3: set this for anything that is not a load and do it also in
    v3d40_vir_emit_image_load_store (Eric)

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-10-18 14:08:52 +02:00
Iago Toral Quiroga d2203d74c6 v3d: trivial update to obsolete comment
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-10-18 14:08:52 +02:00
Bas Nieuwenhuizen fd21ee8b52 radv: Fix single stage constant flush with merged shaders.
e.g. a VERTEX only flush with tess on Vega should look at the TCS
to see which bits are needed.

CC: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1953
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2019-10-18 10:49:29 +00:00
Lucas Stach 1b65c49c58 rbug: remove superfluous NULL check
The SCR_INIT macro used to install the rbug resource_changed method
will only do so when the driver below rbug exposes this method, so
the check will always evaluate to true.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 10:12:07 +00:00
Lucas Stach 93d47932b8 rbug: implement resource creation with modifier
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 10:12:07 +00:00
Lucas Stach 5b3e57059c rbug: forward can_create_resource to pipe driver
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 10:12:07 +00:00
Lucas Stach 8eea8c9691 rbug: forward texture_barrier to pipe driver
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 10:12:07 +00:00
Lucas Stach 024eaa7fec rbug: implement missing explicit sync related fence functions
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 10:12:07 +00:00
Lucas Stach 5f76d3cce8 rbug: move flush_resource initialization
All the other context method initialzation follow the order of the pipe_context
structure definition making it easy to find unimplemented methods in rbug.
Move the flush_resource init to follow the same order.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 10:12:07 +00:00
Lucas Stach a75eb888e0 rbug: unwrap index buffer resource
All resources passed to the drivers below rbug need to be unwrapped before
being passed down. We missed to do this for the index buffer resource when
this was made part of the draw_info structure.

Fixes: 330d0607ed (gallium: remove pipe_index_buffer and set_index_buffer)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 10:12:07 +00:00
Lucas Stach 6174cba748 rbug: fix transmitted texture sizes
The rbug wire format defines the texture size parameters to be uint32_t sized
and uses memcpy to move the function parameters to the message structure.
This caused totally wrong transmitted texture sizes since the height and depth
paramterds have been changed to uint16_t in the gallium API. Fix this by doing
an explicit conversion to the correct representation before packing into the
wire message.

Fixes: e6428092f5 (gallium: decrease the size of pipe_resource - 64 -> 48 bytes)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 10:12:07 +00:00
Lucas Stach f6461df63a gallium/util: don't depend on implementation defined behavior in listen()
Using 0 as the backlog argument to listen() is exploiting implementation
defined behavior and will lead to no connections being accepted on some
libc implementations.

Quote of the listen manpage: "A backlog argument of 0 may allow the socket to
accept connections, in which case the length of the listen queue may be set to
an implementation-defined minimum value."

Fix this by using a more sensible backlog value.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2019-10-18 10:12:07 +00:00
Iago Toral Quiroga 5be5b53b6d mesa/main: GL_GEOMETRY_SHADER_INVOCATIONS exists in GL_OES_geometry_shader
It seems that for desktop GL this was included with ARB_gpu_shader5, but
for OpenGL ES this is already included with the base extension and there is
a CTS test that checks this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 09:03:21 +00:00
Pierre-Eric Pelloux Prayer af60187153 mesa: implement glTextureStorageNDEXT functions
Implement the 3 functions using the texturestorage_error() helper.
_mesa_lookup_or_create_texture is always called to make sure that 'texture'
is initialized (even if the texturestorage_error() generates an error afterwards).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer 50533d408d mesa: add EXT_dsa NamedCopyBufferSubDataEXT function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer da21435a7a mesa: add EXT_dsa NamedRenderbufferStorageMultisampleEXT function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00