Daniel Stone
ebdf9ad85c
egl/wayland: Add helper to check server format support
...
Often when we look up a dri2_wl_visual, the only thing we want to do
with it is check whether or not the server supports it. Add a helper for
this common pattern.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
a34d3c290e
egl/wayland: Use FourCC to look up wl_buffer support
...
No point in using a DRI_IMAGE_FORMAT, since we'll need to get a FourCC
for dmabuf/wl_drm support anyway.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
6a084e2b08
egl/wayland: Use pipe_format to look up configs
...
Instead of using the sizes and shifts to look up a dri2_wl_visual from a
config, just use the pipe_format we stash in the config.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
9ea9a963aa
egl/wayland: Fix EGL_EXT_present_opaque
...
This extension has been broken ever since the initial commit. It created
an XRGB DRIImage for the driver to render to, so whilst the presentation
was opaque, the buffer also completely lacked an alpha channel.
Fix it by making sure we only modify the FourCC we send to the Wayland
server when creating a buffer.
Closes : mesa/mesa#5886
Fixes: 9aee7855d2 ("egl: implement EGL_EXT_present_opaque on wayland")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
c74f480391
egl/wayland: Add opaque-equivalent FourCCs
...
Add a mapping for the opaque version of an alphaful format (e.g.
ARGB8888 -> XRGB8888) to better support EGL_EXT_present_opaque.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
084fea1e7d
egl/wayland: s/DRI_IMAGE_FORMAT/pipe_format/g
...
All the DRI_IMAGE_FORMATs we use are now pipe_formats, so eliminate the
old type names.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
ba3b867552
egl/wayland: Query image FourCC for linear copies
...
This entire pattern really wants to be a shared helper, to allocate a
shadow linear image from another device and then import it across into
the rendering GPU. Querying the FourCC from the DRIImage makes it easier
to pull out into shared code.
This temporarily makes the implementation more ugly, however it's
already pretty hard on the eyes, so probably no great loss.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
57c3343c2d
dri/kopper: Flatten pipe_format/DRIImage/FourCC conversion
...
No need to go through DRI_IMAGE_FORMAT_* tokens; we can just directly
convert from pipe_format to FourCC.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
3c46252570
dri/kopper: Reorder format tables
...
Just make it more obvious that they're identical.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
d60415bad5
dri/kopper: Add translations for sRGB formats
...
There was DRI_IMAGE_FORMAT -> FourCC format translation, but this was
unreachable as we only ever called image_format_to_fourcc() on the
result of get_dri_format().
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
ca0f94c805
dri/kopper: Move format -> FourCC translation up a level
...
There's no reason to use DRIImage formats here, given that it's only
ever used to immediately convert to a FourCC.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
a8cb490193
st/dri: Reuse stored texture format
...
When we create a texture, we allocate a pipe_resource for it with a
given format. When we export the texture to an EGLImage, we go look
up what the GL format was and try to re-derive the pipe_format back
again.
Instead of doing that, just immediately reuse the pipe_format for the
image's format.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
858ad38f8b
st/dri: Reuse stored renderbuffer format
...
When we create a renderbuffer, we allocate a pipe_resource for it with a
given format. When we export the renderbuffer to an EGLImage, we go look
up what the GL format was and try to re-derive the pipe_format back
again.
Instead of doing that, just immediately reuse the pipe_format for the
image's format.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
303b935dbd
egl/wayland: Remove format-query fallback
...
The DRI2 frontend should always be responsible for answering a FourCC
query, so just remove one use of DRI formats here.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
216d4613c3
st/dri: Store pipe_format in gl_config
...
When the DRI frontend generates configs to pass to the APIs, store the
pipe_format in the internal gl_config structure. Doing this allows us to
nuke a few places where we try to retcon our way back from the config to
a pipe_format.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
ad0edea53a
st/dri: Check format properties from format helpers
...
When populating DRI configs, driconf allows us to exclude
10bpc/RGBA/float configs. Rather than having a hardcoded set of formats
which satisfy those properties, just check the actual format
definitions.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
4025845137
st/dri: Use pipe_format for Z/S modes
...
Rather than just passing down the depth/stencil bits, pass the
pipe_format for the depth/stencil modes down to driCreateConfigs so we
retain the explicit information as long as possible.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
69d64812e2
st/dri: Rework depth/stencil format selection
...
When we're building configs, be a bit more explicit about which format
we're using, as a prelude to passing the formats down explicitly to
driCreateConfigs.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
4816cdd204
st/dri: Add transient HAS_ZS() helper
...
Just saves a load of redundant typing.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
e018c91384
st/dri: Completely remove mesa_format from config setup
...
We don't need to have mesa_format here at all, we can just work entirely
on pipe_format.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
4515bcf5af
st/dri: Remove format tables from driCreateConfigs
...
Just get all the information we need from u_format, rather than keeping
it in hand-written tables.
If you have bisected any kind of failure to this commit, please build
the previous commit in debug mode (so that assertions are enabled) and
check if there are any runtime failures. If so, there is a difference
between the u_format descriptions and the handwritten descriptions that
this commit deletes.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
d3ed00f38a
util: Add util_format_get_component_shift
...
Similar to util_format_get_component_bits, get the bit offset for a
particular channel in a given format.
Use this to calculate the shift/mask sets for formats when creating DRI
configs, as a prelude to ripping out and replacing the hardcoded table.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
b3d419ad24
st/dri2: Use u_format to get config format information
...
Now that we have both the pipe_format and the mesa_format available to
us, prefer the former so we don't need to map between the two worlds.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:02 +00:00
Daniel Stone
87955b67ae
st/dri2: Pass pipe_format to driCreateConfigs
...
Gently start removing some of the open-coded format work here.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:02 +00:00
Daniel Stone
5cdfc9a811
st/dri2: Remove __DRI_IMAGE_FORMAT conversion
...
It's now just a PIPE_FORMAT, so we can use that.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:02 +00:00
Daniel Stone
7e10601786
dri: Redeclare __DRI_IMAGE_FORMAT_* as PIPE_FORMAT_*
...
These aren't used by any external DRI callers, so unexport them and
redeclare them in terms of PIPE_FORMAT_*, so we can flatten them down
later.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:02 +00:00
Daniel Stone
e9891f9cf1
st/dri: Use correct pipe_resource for GL texture image export
...
When we're binding a GL texture to an EGLImage, we have to be sure to
check the right resource. A GL texture resource can contain multiple
pipe_resources on different levels; so once we get the texture object,
we have to chase that down to a texture image before we use the
pipe_resource.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:02 +00:00
Juan A. Suarez Romero
5d71eb60f3
v3dv/ci: remove crashes from expected list
...
These are now fixed.
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27813 >
2024-02-27 10:07:17 +01:00
Samuel Pitoiset
450b375b69
radv: disable VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 with minmax filter on GFX6
...
This doesn't seem supported and introduced regressions on
Pitcairn/Tahiti, but it seems fine on Bonaire (GFX7).
Fixes: 926d9f1cef ("radv: support minmax filter for more formats")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27760 >
2024-02-27 09:23:53 +01:00
Tapani Pälli
1b1afd7b24
iris: make sure DS and TE are sent in pairs on >= gfx125
...
We have couple of dynamic fields used on >= gfx125, ScratchSpaceBuffer
and TessellationDistributionMode. There are also 2 workarounds dealing
with TessellationDistributionMode. These changes make sure that we
always emit both DS and TE together when the dynamic fields need to be
changed.
This fixes KHR-Single-GL46.arrays_of_arrays_gl.AtomicUsage on MTL.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10636
Signed-off-by: Tapani Pälli <tapani.palli@intel.com >
Reviewed-by: José Roberto de Souza <jose.souza@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27753 >
2024-02-27 06:48:45 +00:00
Dave Airlie
d103b76ad6
radv/video: add VK_KHR_video_decode_av1 support.
...
This adds support for AV1 decode to radv, there are likely some
cleanups necessary.
Co-author: Charlie Turner <cturner@igalia.com >
(I wrote the initial mesa extension, and Charlie ported it to
the KHR extension and kept it up to date and fixed CTS things)
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27424 >
2024-02-27 15:03:54 +10:00
Dave Airlie
7c0e0b7462
radv/video: use proper struct sizes for decoder structs.
...
This just cleans it up before av1 lands.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27424 >
2024-02-27 15:00:52 +10:00
Dave Airlie
0466453d31
radv: rename it_ptr to it_probs_ptr in advance of adding av1
...
This is just a rename, just to make the name more meaningful.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27424 >
2024-02-27 15:00:39 +10:00
Dave Airlie
d599391ac9
radv/video: use vcn ip version in more places.
...
This parallels changes made to the radeonsi code, but since we have uvd
in here as well we still use family in some places.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27424 >
2024-02-27 14:59:42 +10:00
Dave Airlie
03f18be607
radv/video: fix filling out decode operations.
...
This just makes it consistent with the extension.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27424 >
2024-02-27 14:59:42 +10:00
Yiwei Zhang
e9290ec0bb
venus: fix to ensure sfb cmds can get recycled
...
The prior refactor has missed a case that timeline sempahore can be
ping-pong'ed between device signal and host wait.
Fixes: d63432012d ("venus: refactor semaphore feedback")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Reported-by: Juston Li <justonli@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27807 >
2024-02-27 03:05:32 +00:00
José Roberto de Souza
90e38bbb3b
intel/tools/error_decode: Parse Xe KMD error dump file
...
There is more to do but this is able to parse batch buffers, including
fetch and parse other bos like shader programs.
Some functions used by read_i915_data_file() could be shared with Xe
so I have moved those to aubinator_error_decode_lib.c/h.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27661 >
2024-02-27 01:04:16 +00:00
José Roberto de Souza
7e88176b0b
intel/tools/error_decode: Move code that can be shared between i915 and Xe error decoders
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27661 >
2024-02-27 01:04:16 +00:00
José Roberto de Souza
6f9a5f4811
iris/xe: Add VMs to error dump
...
To ask Xe KMD to dump BO/VMA content to error state it is necessary to
set DRM_XE_VM_BIND_FLAG_DUMPABLE during VM bind, so places that were
setting 'bo.real.capture = true' after the VM bind were useless for
Xe KMD.
To fix that BO_ALLOC_CAPTURE was added, alloc_fresh_bo() will set
'bo.real.capture = true' automaticacly for new bos before vm bind.
alloc_bo_from_cache() also required to check if capture states matches
between asked bo and bo in cache.
Only slabs might be left out of error dump if DEBUG_CAPTURE_ALL is not
set but that was already happening for i915.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27661 >
2024-02-27 01:04:15 +00:00
José Roberto de Souza
c26663eede
anv/xe: Add VMs to error dump
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27661 >
2024-02-27 01:04:15 +00:00
José Roberto de Souza
d40c48cac1
intel: Sync xe_drm.h
...
Syncs xe_drm.h with b2121f2bd223 ("drm/xe: Extend uAPI to query HuC micro-controler firmware version").
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27661 >
2024-02-27 01:04:15 +00:00
Sagar Ghuge
5e800ab6f7
anv: Implement VK_AMD_texture_gather_bias_lod
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447 >
2024-02-27 00:22:46 +00:00
Sagar Ghuge
269d2c4a3f
intel/compiler: Enable packing of offset with LOD or Bias
...
Move intel_nir_lower_texture just before nir_lower_tex since we need to
operate on the offset and those are getting lowerd.
v2: (Ian)
- Rename variable name to intel_tex_options
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447 >
2024-02-27 00:22:46 +00:00
Sagar Ghuge
30ead72e80
nir: Allow nir_texop_tg4 in implicit derivative
...
This allow us to invoke the quad helper.
v2: (Georg)
- Add check for is_gather_implicit_lod
Fixes: 48158636bf ("nir: add is_gather_implicit_lod")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447 >
2024-02-27 00:22:46 +00:00
Sagar Ghuge
6f0ab5e4d5
intel/compiler: Add texture gather offset LOD/Bias message support
...
v2: (Ian)
- Space formatting on conditional statement
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447 >
2024-02-27 00:22:46 +00:00
Sagar Ghuge
79af0ac29a
intel/compiler: Add gather4_i/l/[_c]/b sampler message
...
v2: (Ian)
- Format comment
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447 >
2024-02-27 00:22:46 +00:00
Sagar Ghuge
3c7f1feebf
intel/compiler: Add helper method to decide if header is required
...
v2: (Ian)
- Return immediately from the switch case
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447 >
2024-02-27 00:22:46 +00:00
Sagar Ghuge
2ea041e04a
intel/compiler: Pack texture LOD and offset to a single 32-bit value
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447 >
2024-02-27 00:22:46 +00:00
Sagar Ghuge
9b37b3ba73
intel/compiler: Pack LOD/bias and array index on TG4 messages
...
Bspec: 56996
Programming note:
When doing cube arrays on gather4_l and gather4_b with SIMD16 or
SIMD32 the AI parameters is combined with the LOD/bias parameter on
the 9 LSBs.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447 >
2024-02-27 00:22:46 +00:00
Sagar Ghuge
b34b2bdff3
intel/compiler: Adjust sample_b parameter according to new layout
...
On Xe2+, we need to pack LOD with array index for cube array surfaces,
with that mlod parameter gets adjusted to different indices based on the
layout.
So track if we are packing LOD with array index in fs_inst and propogate
that to sampler lowering code to adjust param location.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447 >
2024-02-27 00:22:46 +00:00