Sebastian Wick
a00f9c401b
loader/wayland: Add fallback wl_display_dispatch_queue_timeout
...
This is almost a 1:1 copy of the same function in libwayland. If the version
with the symbol propagates far enough the fallback can be removed again.
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com >
Reviewed-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27511 >
2024-02-27 13:10:13 +00:00
Sebastian Wick
df801bec1e
util: Add timespec_sub_saturate to avoid negative time for deadlines
...
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com >
Reviewed-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27511 >
2024-02-27 13:10:13 +00:00
Connor Abbott
a80a23dc49
tu: Enable UBWC for storage images on a7xx
...
I'm not sure exactly when this was introduced. It doesn't work on a650,
but does work on a7xx, I'm not sure whether it works on the a660
generation.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27506 >
2024-02-27 07:34:15 -05:00
Connor Abbott
b9e04f8293
tu: Enable UBWC for SNORM formats on a740+
...
The fast-clear value is now the same for SNORM and UNORM, so our trick
of reinterpreting SNORM as UNORM when copying now works with UBWC. We
can also freely reinterpret UNORM, SNORM, and UINT formats, as tested by
dEQP-VK.image.mutable.*.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27506 >
2024-02-27 07:33:59 -05:00
Connor Abbott
4529b2ea54
tu: Reenable MSAA UBWC on a6xx gen1
...
This passes a full CTS run now, probably due to other fixes in the
meantime.
Closes : #7438
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27506 >
2024-02-27 07:17:29 -05:00
Daniel Stone
dcbf61f5df
egl/dri: Use pipe_format instead of DRI_IMAGE_FORMAT
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
68eaf820e1
st/dri: Use pipe_format from config directly
...
The driver already stores the pipe_format within the mode, so we can
just reuse that rather than trying to re-derive it back from a hardcoded
set of masks.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
832d814852
egl: Remove shifts/sizes from dri2_add_config argument
...
All the callers now do their own filtering on driver configs to decide
whether or not to add them.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
e66305d681
egl/x11: Compare config shifts/sizes locally
...
Rather than getting the egl_dri2 core to compare our shift/size arrays,
do it in the caller, as X11 is the only caller that constructs configs
like this.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
273e54391a
egl/android: Remove hard-coded color-channel data
...
We don't need to write out tables of the shift/size of every colour
channel, because we already have that as part of the format description
if we use pipe_format.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
d8d153d4c2
gbm: Remove hardcoded color-channel data
...
We don't need to write out the shifts and sizes everywhere; we already
have them as part of the format description.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
a10f10c4ce
gbm/dri: Query DRIImage for FourCC directly
...
No need to go through the DRIImage format query when we can just get the
FourCC directly.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
6b04b64a21
egl: Use pipe_format for pbuffer configs
...
There's no need to pass shifts and masks now; we can just take a list of
pbuffer configs to add.
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
630fda2492
egl: Automatically set EGLConfig ID
...
There's no reason to make the users go through and count all their
configs; just set it ourselves in the core.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
487016796b
egl/{surfaceless,device}: Remove check for EGLConfig presence
...
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
e12a55c979
egl/android: Remove check for EGLConfig presence
...
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
ac304d0393
egl/x11: Remove check for EGLConfig presence
...
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
6770921918
egl/gbm: Remove check for EGLConfig presence
...
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
bf7ebe6ff8
egl/wayland: Remove check for EGLConfig presence
...
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
cbb6f62135
egl: Fail display creation if no EGLConfigs created
...
If we failed to create any EGLConfigs, throw an error and refuse to
create the display. This lets us eliminate a bunch of copy-and-wasted
code throughout the drivers.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
97c435c926
egl/wayland: Remove shift/size masks
...
We don't need these anymore.
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
7889c9dc92
egl/wayland: Use pipe_format for format names
...
We don't need to carry our own strings.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
84bb6d0e0a
egl/wayland: Remove WL_SHM_* format listings
...
We don't need to type all of these out, because they're exactly the same
as the DRM ones, with the exception of ARGB8888 and XRGB8888 which carry
their own format codes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
5ac70182e8
egl/wayland: Simplify alternate-format fallback for configs
...
Rather than doing everything to add the config twice, we can simply
reuse the helpers to check if the different formats are supported, then
add the config only once.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
ee04cc5d2b
egl/wayland: Eliminate double loop for configs
...
We used to loop like this:
foreach (config_supported_by_driver) {
foreach (config_wl_knows_about) {
dri2_add_config(wl_config.rgba_masks, wl_config.rgba_shifts)) {
if (wl_config.rgba_masks != driver_config.rgba_masks ||
wl_config.rgba_shifts != driver_config.rgba_shifts) {
return NULL; /* driver config != wl config */
}
}
}
}
This is a pretty painful way to discover the relationship between the
different sets of configs, especially as we can just look up our Wayland
visual entry directly.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
f63e676370
egl/wayland: Use helper to look up visual
...
No functional change.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
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