Commit Graph

1276 Commits

Author SHA1 Message Date
Manuel Stoeckl 19f62b4303 dri: add [ax]bgr16161616 to format lookup tables
Note: The format __DRI_IMAGE_FORMAT_ABGR16161616 was already
in the dri2_format_table, but had been hidden from outside view,
for lack of an official DRM fourcc. Since its fourcc has now been
assigned, it is safe to reveal the format.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14580>
2022-07-27 07:27:10 +00:00
Adam Jackson c123ab2137 kopper: Implement {EGL,GLX}_EXT_buffer_age
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17527>
2022-07-18 19:31:29 +00:00
Emma Anholt 4c6a1e3f33 egl: Just include driconf.h instead of redefining its values.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17470>
2022-07-12 21:57:23 +00:00
Sebastian Keller f50fe9b0b6 egl/wayland: Don't try to access modifiers u_vector as dynarray
The modifiers are u_vectors, but the code was trying to access them
as dynarrays. This resulted in a wrong number of modifiers, which then
later on would also lead to invalid reads used as modifiers.

In the case of the iris driver, a wrongly read number of modifiers > 0
would also trigger an error message.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6643
Fixes: b5848b2dac ("egl/wayland: use surface dma-buf feedback to allocate surface buffers")
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17180>
2022-06-23 16:12:15 +00:00
Dave Airlie c5dbb1139c egl/x11: add missing put_image cookie cleanups
These might not be required but be consistent with the wsi code.

Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17155>
2022-06-22 03:28:21 +00:00
Dave Airlie e6082ac62e egl/x11: split large put image requests to avoid server destroy
wezterm in fullscreen 4k was exceeding the xcb max request size
on the put image with llvmpipe. This fixes it to send sub-images,
the Xlib put image used in glx does this internally, but not
the xcb one, so just do it in sections here.

Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17155>
2022-06-22 03:28:21 +00:00
Mike Blumenkrantz 20ba759694 egl/wayland: skip buffer creation on zink
this happens through wsi, so don't create resources that aren't used

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16814>
2022-06-03 18:22:22 +00:00
Mike Blumenkrantz f67bd8adfa egl/wayland: manually swap backbuffer when using zink
this would usually occur through dri2_wl_swrast_commit_backbuffer(),
but zink triggers this functionality using vulkan wsi, which fails to
perform these updates as expected

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16814>
2022-06-03 18:22:22 +00:00
Adam Jackson 6f4b5fb675 egl/kopper: Hook up eglSwapInterval
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>
2022-05-04 15:06:51 +00:00
Jesse Natalie 06ae10bb92 wgl: Implement WGL_ARB_create_context_robustness
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15002>
2022-04-28 19:33:04 +00:00
Leandro Ribeiro c60fea8c22 Revert "egl/wayland: deprecate drm_handle_format() and drm_handle_capabilities()"
Commit af1ee8e010 dropped support to
wl_drm, as we thought that most compositors from active projects were
already supporting zwp_linux_dmabuf_v1.

But that's not true, so revert this commit in order to give these
projects a longer transition period.

Note that we didn't add back the support to GEM name API, and that was
on purpose.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15822>
2022-04-16 18:11:59 +00:00
Mike Blumenkrantz 3c4be122cc egl: implement more hooks for swrast
these just need to use swapbuffers instead of flush

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15784>
2022-04-07 19:22:14 +00:00
Adam Jackson e1e2de800e egl: Learn about kopper
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Yonggang Luo 24bc6c51e1 glx/egl: improve dri null screen related error messages.
Convert from `failed to create dri screen` to more exact error message
for easier debugging

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15480>
2022-03-21 09:31:31 +00:00
José Expósito 4c3f8d3af8 egl/wayland: fix crash in dri2_initialize_wayland_swrast
When "dri2_wl_formats_init" fails in "dri2_initialize_wayland_swrast",
the "dri2_display_destroy" function is called for clean up. However, the
"dri2_egl_display" was not associated with the display in its
"DriverData" field yet.

The following cast in "dri2_display_destroy":

  struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);

Expands to:

  _EGL_DRIVER_TYPECAST(drvname ## _display, _EGLDisplay, obj->DriverData)

Crashing.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13972>
2022-03-07 08:26:01 +00:00
José Expósito 43258dc802 egl/wayland: fix crash in dri2_initialize_wayland_drm
When "dri2_wl_formats_init" fails in "dri2_initialize_wayland_drm", the
"dri2_display_destroy" function is called for clean up. However, the
"dri2_egl_display" was not associated with the display in its
"DriverData" field yet.

The following cast in "dri2_display_destroy":

  struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);

Expands to:

  _EGL_DRIVER_TYPECAST(drvname ## _display, _EGLDisplay, obj->DriverData)

Crashing.

Addresses-Coverity-ID: 1494541 ("Resource leak")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13972>
2022-03-07 08:26:01 +00:00
Rob Clark d2e498b6a5 egl+libsync: Add helper to complain about invalid fence fd's
Debugging fd lifetime issues can be hard.  Add a helper for debug builds
to print out an error if an fd is not a fence fd, and sprinkle it around

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15094>
2022-03-04 22:16:20 +00:00
Rob Clark 1e25f3b282 android: Push in-fence-fd down to driver
Rather than immediately stall on the CPU in SwapBuffers() if the
in-fence for the dequeued buffer is not yet signaled, push it down
to the driver.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6048
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15094>
2022-03-04 22:16:20 +00:00
Daniel Stone b561946497 egl/wayland: Don't replace existing backbuffer in get_buffers
If the surface already has a current backbuffer - say through a
buffer_age query - we do not want to replace it in get_buffers, because
it means the result we'd previously returned them is stale.

If we already have a backbuffer set on the surface, keep it locked in no
matter what until we hit SwapBuffers.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14873>
2022-02-07 09:57:41 +00:00
Daniel Stone 3da8300562 egl/wayland: Reset buffer age when destroying buffers
A buffer age of 0 means that the buffer is uninitialised or has unknown
content. We rely on the buffer age initially being 0 through zalloc when
the surface is first created; when they are first used for a swap, we
set their age to 1, and then we increment the age of every buffer in the
chain with a non-zero age when we swap.

Now that we can release buffers, both through dmabuf-feedback as well as
detecting when we're using a deeper swapchain than the compositor needs,
make sure to reset their age as they are released. Without doing this,
the age will stay as it was before it was released and be incremented,
returning the wrong age to the user the first time a previously-released
buffer slot has been reused.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5977
Fixes: 22d796feb8 ("egl/wayland: break double/tripple buffering feedback loops")
Fixes: b5848b2dac ("egl/wayland: use surface dma-buf feedback to allocate surface buffers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14873>
2022-02-07 09:57:41 +00:00
Adam Jackson b1d585ca36 egl: Use the new no-error driver interface
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>
2022-02-04 18:36:24 +00:00
Lucas Stach 0d65f229c5 egl/dri2: short-circuit dri2_make_current when possible
If an application calls eglMakeCurrent with the same context and the same
draw and read surfaces as the current ones, there is no need to go
through all the work of unbinding/flushing the old context and binding
the new one.

While the EGL spec is a bit ambiguous here, it seems that the implicit
flush of the outgoing context only needs to be done when the context is
actually changed.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14379>
2022-01-17 10:32:01 +00:00
Lucas Stach b33ed5406a egl/dri2: remove superfluous flush when changing the context
The flush of the outgoing GL context, as required by the EGL spec for
eglMakeCurrent and extended by KHR_context_flush_control, is already
performed in the unbindContext call. There is no need to pierce through
the layers and unconditionally call glFlush() here.

Getting the out-fence FD for explicit fencing needs to move behind the
unbindContext, to make sure we are getting the fence for the most
recently flushed commands.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14379>
2022-01-17 10:32:01 +00:00
Lucas Stach 22d796feb8 egl/wayland: break double/tripple buffering feedback loops
Currently we dispose any unneeded color buffers immediately if we detect that
there are more unlocked buffers than we need. This can lead to feedback loops
between the compositor and the application causing rapid toggling between
double and tripple buffering.

Scenario: 2 buffers already queued to the compositor, egl/wayland allocates a
new back buffer to avoid throttling, slowing down the frame. This allows the
compositor to catch up and unlock both buffers. EGL detects that there are
more buffers than currently needed, freeing the buffer, restarting the loop
shortly after.

To avoid wasting CPU time on rapidly freeing and reallocating color buffers
break those feedback loops by letting the unneeded buffers sit around for a
short while before disposing them.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14451>
2022-01-10 15:11:44 +00:00
Qiang Yu c7d5e91b6b loader/dri3: replace is_pixmap with drawable type
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13750>
2021-12-07 03:26:13 +00:00
Qiang Yu 13bf30583c loader/dri3: add drawable type set by GLX and EGL
Drawable type include more information which can be used
to distinguish pixmap and pbuffer which both treated as
pixmap before.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13750>
2021-12-07 03:26:13 +00:00
Leandro Ribeiro 7c57346dfd egl/wayland: fix surface dma-buf feedback error exits
This fixes a leak that was introduced in 89d15b9a "egl/wayland: add
initial dma-buf feedback support".

Do not leak dri2_surf->wl_dmabuf_feedback when we have to bail out
because of allocation issues.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13985>
2021-12-02 14:18:55 +00:00
Leandro Ribeiro 81361490ef egl/wayland: do not try to bind to wl_drm if not advertised
This fixes a bug that was introduced in 89d15b9a "egl/wayland: add
initial dma-buf feedback support".

Sometimes we have to fallback to wl_drm. But do not try to bind to it
when it is not advertised by the compositor.

This issue was found by n3rdopolis and reported here:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/5697

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13985>
2021-12-02 14:18:55 +00:00
Leandro Ribeiro b5848b2dac egl/wayland: use surface dma-buf feedback to allocate surface buffers
As explained in "egl/wayland: add initial dma-buf feedback support", we
still don't use the per-surface dma-buf feedback. In this patch we start
to use it.

If per-surface dma-buf feedback is advertised, use it to allocate
surface buffers. Also, the dma-buf protocol states that the feedback is
resent only when the client is using a suboptimal format/modifier pair.
So listen for new per-surface feedback events and reallocate the surface
buffers based on them. We can't change the format of a buffer, but we
can pick a new modifier.

This patch is based on previous work of Scott Anderson (@ascent).

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Leandro Ribeiro 5b56fc748a egl/wayland: move loader_dri_create_image() calls to separate functions
In get_back_bo() we have two calls to loader_dri_create_image() and some
overhead. As in the next commit we add another call to this same
function and more overhead to get_back_bo(), it starts to lose
legibility.

So move loader_dri_create_image() calls to separate functions, allowing
us to have an easier to read get_back_bo(). It also adds some minor
style changes.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Leandro Ribeiro 83916ae0b9 egl/wayland: add initial dma-buf feedback support
This bumps the supported dma-buf version up to 4 and adds the initial
dma-buf feedback implementation. It follows the changes in the dma-buf
protocol extension [1] to include the dma-buf feedback interface, which
should be incorporated by most Wayland compositors in the future.

From version 4 onwards, the dma-buf modifier events are not sent by the
compositor anymore, so we use the default feedback to pick the set of
formats/modifiers supported by the compositor. Also, we try to avoid the
wl_drm device event and instead use the dma-buf feedback main device. We
only fallback to wl_drm when the compositor advertises a device that
does not have a render node associated.

In this initial dma-buf feedback implementation we still don't do
anything with the per-surface dma-buf feedback, but in the next commits
we add proper support.

It's important to mention that this also bumps the minimal supported
version of wayland-protocols to 1.24, in order to include [1].

[1] https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/8

This patch is based on previous work of Scott Anderson (@ascent).

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Leandro Ribeiro cd39180cfa egl/wayland: remove unused constant EGL_DRI2_NUM_FORMATS
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Leandro Ribeiro aa6c900625 egl/wayland: move formats and modifiers to a separate struct
This will allow us to remove EGL_DRI2_NUM_FORMATS (as explained in
"egl/wayland: remove unused constant EGL_DRI2_NUM_FORMATS") and it will
also help to add the dma-buf feedback support. Both changes happen in
the next commits.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Leandro Ribeiro 6c37784400 egl/wayland: do not try to access memory if allocation failed
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Leandro Ribeiro af1ee8e010 egl/wayland: deprecate drm_handle_format() and drm_handle_capabilities()
Most Wayland compositors have already implemented the dma-buf protocol
extension. So we can stop relying on the wl_drm events and start to
depend only on the dma-buf interface to receive format/modifier pairs
and create wl_buffer's. So we can deprecate drm_handle_format() and
drm_handle_capabilities().

Note that we still use the wl_drm interface to find out the DRM device
that the compositor is using, so we can't deprecate it fully for now. In
the future (when the dma-buf feedback interface is added to the dma-buf
protocol extension [1] and most compositors incorporate it) we may be
able to fully deprecate wl_drm.

[1] https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/8

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Leandro Ribeiro 3022ad7e15 egl/wayland: replace EGL_DRI2_MAX_FORMATS by EGL_DRI2_NUM_FORMATS
Currently we have a weird design. We have a hardcoded array (named
dri2_wl_visuals) with all the formats that we support, which are 9.

And we also have EGL_DRI2_MAX_FORMATS, which is a constant set to 10. In
patches in which people added new formats to dri2_wl_visuals, this
constant had its value increased. This is confusing, as its name gives
the idea that we can't support more formats.

This constant is only used to define the bitset size of
dri2_egl_display::formats. And it should work just fine if we created
this bitset with the number of formats supported.

To make things clearer, replace EGL_DRI2_MAX_FORMATS by
EGL_DRI2_NUM_FORMATS, which must be equal to ARRAY_SIZE(dri2_wl_visuals)
(i.e. the number of supported formats).

In the next commits we get rid of this constant completely, as it is
prone to errors.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Scott Anderson 42a0e5caa9 egl/wayland: Remove unused wayland enum
Signed-off-by: Scott Anderson <scott@anderso.nz>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Leandro Ribeiro c53733b004 egl: remove unnecessary spaces after types
If we want to add a variable with a type name that is too long, we have
to realign all the variables within these structs. The other option is
to ignore and don't realign, and then we end up with a very ugly code.

So get rid of these unnecessary spaces, as they don't bring anything
useful. Instead, they are annoying.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
2021-11-26 16:06:09 +00:00
Jason Ekstrand f3843b11c9 c11/threads: Re-align return values for timed waits
They're supposed to return thrd_timedout (which we mistakenly named
thrd_timeout), not thrd_busy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13427>
2021-11-16 10:02:08 -06:00
Derek Foreman 28d12716e8 egl/wayland: Properly clear stale buffers on resize
The following chain of events results in an incorrectly sized buffer
persisting beyond its useful lifetime, and causing visual artifacts.

buffer is attached at size A
window is resized to size B
rendering takes place for size B
window is resized back to size A
swapbuffers with damage is called

In this scenario, update_buffers fails to recognize that the surface it's
about to commit is a different size than it has rendered. The
attached_width and attached_height are set incorrectly, and periodic
flickering is observed.

Instead, we set a boolean flag at time of resize and use this at the time
we latch the window dimensions as surface dimensions to decide whether to
discard stale buffers.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13270>
2021-10-16 19:13:58 +00:00
Adam Jackson 27054f737a egl/dri: Enable FP16 for EGL_EXT_platform_device
Why is this not the same code as EGL_MESA_platform_surfaceless.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13182>
2021-10-13 16:36:27 +00:00
Eric Engestrom 9aee7855d2 egl: implement EGL_EXT_present_opaque on wayland
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12373>
2021-10-12 21:40:54 +00:00
Chia-I Wu 8cce6281e6 util/vector: make util_vector_init harder to misuse
Make u_vector_init a wrapper to u_vector_init_pot.  Let both take
(element_count, element_size) as parameters.

Motivated by eed0fc4caf ("vulkan/wsi/wayland: fix an invalid
u_vector_init call")

v2: rename u_vector_init_pot to u_vector_init_pow2

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13201>
2021-10-08 00:15:11 +00:00
Derek Foreman 7fa6d3fc95 egl/wayland: Support RGBA ordered formats
There's no reason not to try to use RGBA ordered formats, and in some
cases doing so might lead to features such as AFBC being available when
they otherwise wouldn't.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13040>
2021-10-06 22:08:40 +00:00
Pierre-Eric Pelloux-Prayer e67083caf4 gallium: add PIPE_CAP_PREFER_BACK_BUFFER_REUSE
This will be used in the next commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12788>
2021-09-29 08:14:57 +00:00
Jesse Natalie 3415bf0268 egl: Add a basic Windows driver
This is enough to run wglgears ported to EGL (desktop GL)

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Jesse Natalie e76db0f165 meson, egl: Support building for the Windows platform
Add a stub EGL driver for Windows
Fix compiler issues in egl/main
Ensure Windows build produces libEGL.dll
Default EGL to enabled for Windows when building a Gallium driver

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
2021-09-15 20:17:31 +00:00
Qiang Yu 27d91fec04 gbm/dri: implement image lookup extension version 2
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>
2021-09-09 01:42:39 +00:00
Qiang Yu dcf38724c7 egl/dri2: seperate EGLImage validate and lookup
Version 2 of DRIImageLookupExtension add two interface for EGLImage
validate and lookup. This is for resolving deak lock in the following
commits.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>
2021-09-09 01:42:39 +00:00
Adam Jackson 18e7633b38 egl/dri2: Stop disabling pbuffer support on msaa configs
We started doing this in:

    commit 4d6d55deef
    Author: Tapani Pälli <tapani.palli@intel.com>
    Date:   Mon Sep 26 10:03:32 2016 +0300

        egl: stop claiming support for pbuffer + msaa

        This fixes a crash in egl-create-msaa-pbuffer-surface Piglit test
        and same crash in many dEQP EGL tests.

Whatever bug that was papering over appears to be fixed by now, I can
no longer reproduce that crash with piglit. Furthermore, disabling that
bit in the generic dri2 code had the side effect that the surfaceless
platform would advertise EGLConfigs with _no_ supported surface types
(since surfaceless only supports pbuffers).

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1859>
2021-07-23 19:22:44 +00:00