History log of /external/mesa3d/src/egl/drivers/dri2/platform_wayland.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
81d40e66ad1c0c53c1de2f183a4987a3159c7c55 21-Jan-2013 Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> egl/wayland: Destroy the pending buffer callback with the egl surface

Otherwise, we crash when the callback is executed, since the dri2_surf
pointer may point to invalid data.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
f2da7e720f60e8df96bf2530f35e3e79897e0cb7 25-Dec-2012 Jonas Ådahl <jadahl@gmail.com> wayland: Don't cancel a roundtrip when any event is received

Since wl_display_dispatch_queue() returns the number of processed events
or -1 on error, only cancel the roundtrip if an -1 is returned.

This also fixes a potential memory corruption bug happening when the
roundtrip does an early return and the callback later writes to the then
out of scope stack allocated `done' parameter.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
f9d8d0c3b5e11c4ae08b078dca2aa48a3218f8d9 22-Nov-2012 Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> egl/wayland: Dispatch the event queue before get_buffers

When a client frame callback is executed and the client starts rendering
again, the egl event queue might not have been dispatched so that the
buffer release event for the previous frame hasn't been processed. In
that case a third buffer is allocated, even though it would be possible
to reuse the buffer that was just released.

The wl_display_dispatch_queue_pending() entry point is available from
wayland-client 1.0.2, so require that in configure.ac. Also, just
let the pkg-config macro throw its own error, which will show what version
we were looking for and failed to find.

Note: This is a candidate for stable branches.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
b49d9338d7e79752e886eede34db08e37c34f8ed 30-Nov-2012 Kristian Høgsberg <krh@bitplanet.net> egl/wayland: Add invalidate back in eglSwapBuffers()

Commit ca3ed3e024864e91ca3cccc59fb96950e1d079b5 fixed the problem where
eglMakeCurrent would trigger a getbuffer callback that then breaks the
following wl_egl_window_resize() call. However, we still need to
invalidate buffers in eglSwapBuffers, since in wayland we always swap
buffers, so the dri driver needs to come out and ask us for the next buffer
after each swapbuffer.

Note: this is a candidate for stable branches.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
eaf6884621661288624fc060974c3aa485771324 30-Nov-2012 Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> egl/wayland: Don't invalidate drawable on swap buffers

We used to invalidate the drawable after a call to eglSwapBuffers(),
so that a wl_egl_window_resize() would take effect for the next frame.
However, that leads to calling dri2_get_buffers() when eglMakeCurrent()
is called with the current context and surface, and a later call to
wl_egl_window_resize() would not take effect until the next buffer

Instead, add a callback from wl_egl_window_resize() back to the wayland
egl platform, and invalidate the drawable only when it is resized.

This solves a bug on wayland clients when going back to windowed mode
from fullscreen when clicking a pop up menu, where the window size
after this would be the fullscreen size.

Note: this is a candidate for stable branches.
CC: wayland-devel@lists.freedesktop.org
2332bc26d435e465a6f6571ab267db2a33ce05d2 28-Oct-2012 Jonas Ådahl <jadahl@gmail.com> wayland: Destroy frame callback when destroying surface

If a frame callback is not destroyed when destroying a surface, its
handler function will be invoked if the surface was destroyed after the
callback was requested but before it was invoked, causing a write on
free:ed memory.

This can happen if eglDestroySurface() is called shortly after

Note: This is a candidate for stable branches.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit a3b6b2d3055070da9bf7054fecfd0b171c398eb7)
2a81037439afb04d4170f674646cdae59619707d 16-Oct-2012 Kristian Høgsberg <krh@bitplanet.net> wayland: Drop support for ill-defined, unused wl_egl_pixmap

It doesn't provide the cross-process buffer sharing that a window system
pixmap could otherwise support and we don't have anything left that uses
this type of surface.
a5776ac0b8c015bf5d6a8513cefec5920895cc8e 11-Oct-2012 Kristian Høgsberg <krh@bitplanet.net> egl/wayland: Update to Wayland 0.99 API

The 0.99.0 Wayland release changes the event API to provide a thread-safe
mechanism for receiving events specific to a subsystem (such as EGL) and
we need to use it in the EGL platform.

The Wayland protocol now also requires a commit request to make changes
take effect, issue that from eglSwapBuffers.
03eca9d92d407c71a59ff8a43067759769da0ae4 27-Mar-2012 Kristian Høgsberg <krh@bitplanet.net> wayland: Stop using wl_buffer.damage
b60120608f6ddf4098bc324363197c979ee04cb7 10-Dec-2011 David Fries <David@Fries.net> Set close on exec flag FD_CLOEXEC

Set the close on exec flag when opening dri character devices, so they
will be closed and free any resouces allocated in exec.

Signed-off-by: David Fries <David@Fries.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
e6aa32ac7f8d7b843f4d4f8bf9d8e9db790b0868 05-Mar-2012 Benjamin Franzke <benjaminfranzke@googlemail.com> wayland: Use new wl_display_disconnect

This replaces the previously used wl_display_destroy.
wl_display_destroy was povided by wayland-client.so and
wayland-server.so, to resolve that conflict its renamed client-side.
58dc1b28d1ef4d1931c52b079d304f2e1546329d 11-Jan-2012 Kristian Høgsberg <krh@bitplanet.net> wayland-drm: Drop the non-premul formats, use format codes from drm_fourcc.h
2a58453e25899e726f02db005de0e1296c326845 13-Dec-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2: Fix some valgrind reported leaks

Free the device_name, reported by Pekka Paalanen.

Destroy wayland display and drm resources,
if created by dri2_initialize_wayland.
0763b978eea5f133e43fb223d50c08fcca5397a2 15-Sep-2011 Jørgen Lind <jorgen.lind@nokia.com> wayland: Flush before blocking in swapbuffers.

Make sure that we've sent the frame request that we're going to block on.
11f64668a91259b876d6b6bccd902f875531502d 01-Sep-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2: Destroy callback in release_pending_buffer
7b1d94e5d1f53ac5f59000176aea1d02fc9a1181 31-Aug-2011 Kristian Høgsberg <krh@bitplanet.net> wayland: Track changes to drop wl_visual
c661ecce1089000c3fca9a543713f8264221be50 22-Aug-2011 Kristian Høgsberg <krh@bitplanet.net> wayland: Track server side wayland changes
6602bda23ba6c4351eb7f04d34803103a68ac2db 17-Aug-2011 Kristian Høgsberg <krh@bitplanet.net> wayland: Use new wl_callback mechanism
f811c1e6d637a556f36271ee4abeb30aaeb07204 31-Aug-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2: Drop dri2_surface_type enum

Was only used in platform_wayland, and the remaining egl stack
uses _EGLSurface::Type with one of EGL_{WINDOW,PIXMAP,PBUFFER}_BIT.
58911b86a15676f116c693e84ea6b9ebabb906ed 05-Aug-2011 Chia-I Wu <olvaffe@gmail.com> egl_dri2: allow RGBA masks to be specified for matching

Add rgba_masks to dri2_add_config. When it is non-NULL, the DRI config
is accepted only when the offsets and sizes of the its channels match

Reviewed-by: Chad Versace <chad@chad-versace.us>
0cb356dd5c93f745bb1b17987d206a24ab708f31 06-May-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2/wayland: Hook up new buffer.release event
16a04e019dcb0f1d50ceab5c8c2eafb56fa60853 20-Jun-2011 Kristian Høgsberg <krh@bitplanet.net> wayland: Pass use_invalidate extension to driver
b8325fd2554aafde3d0b784b7944b1473af7d144 11-Jun-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2/wayland: Add support for EGL_DEFAULT_DISPLAY
aa87a938fb4cec30dad48642e8d12810e947bc8b 31-May-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2: Fix usage of bool values
dc520d4fefa6a92b3a8f2eed3c5a1044dfccb3ff 29-Apr-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl/wayland: Fix possible lockup in drm initialization

Lockup happens when wl_drm interface is not available.
b1a91722773152ea96de79d2b446ae488561bb0c 07-Mar-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl/wayland: Update to buffer.damage addition
f09c66b3cc9542b0a8f795e34b882c2b8f9f26f7 21-Apr-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2: Create wl_buffers for pixmap surfaces

Needed since wayland-egl doesnt do this anymore.
2225397d1cf5e4f4a1293495f3a26bd33e5d7ac3 21-Apr-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl/wayland: Fix prefixes for interface names
c0f8c9911c82c576cdd82dabad4a2370ac53565c 14-Apr-2011 Kristian Høgsberg <krh@bitplanet.net> wayland-egl: Update to wayland-egl.h changes, drop struct wl_egl_display
f05751aa2af1a8ec83c2d110385aab1b7e735238 16-Mar-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl/wayland: Update to per-surface frame events
981e338611699ed965966a161b7ba0aaa3e87ee0 08-Mar-2011 Kristian Høgsberg <krh@bitplanet.net> egl_dri2: Enable image extensions in one place

We know what we can support in egl_dri2.c so just enable the extensions
6b369c4c7cd8a52f99bbff2a57fb316b33a87495 21-Feb-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl: Add EGL_WL_bind_wayland_display
f55d027ac2e0423eba5d0664cc36668520597703 17-Feb-2011 Haitao Feng <haitao.feng@intel.com> egl_dri2: add swrast

This enables the egl_dri2 driver to load swrast driver
for software rendering. It could be used when hardware
dri2 drivers are not available, such as in VM.

Signed-off-by: Haitao Feng <haitao.feng@intel.com>
3104e5cb4f8524e9852300aa1e112d7fe31545ca 09-Feb-2011 Haitao Feng <haitao.feng@intel.com> egl_dri2: rename loader_extension to dri2_loader_extension

Signed-off-by: Haitao Feng <haitao.feng@intel.com>
51f2820922b669af3947fcedd17109524644bb94 11-Feb-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2 wayland: Sync front buffer release
87dde5b1cd596c4008695ff2db9469f88c09f925 09-Feb-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2: Use double buffering for window surfaces
56758c839ff29bd168529535a4816bff3b79cde5 04-Feb-2011 Kristian Høgsberg <krh@bitplanet.net> wayland-egl: Force roundtrips to get device name and authenticate correctly

If the client hasn't done the initial wl_display_iterate() at the time
we initialize the display, we have to do that in platform_wayland.c.
Make sure we detect that correctly instead of dup()ing fd=0, and use
the sync callback to make sure we don't wait forever for authorization that
won't happen.
93aea84f472f5f9ff588f7b2d4f7320ec43bc216 04-Feb-2011 Benjamin Franzke <benjaminfranzke@googlemail.com> egl_dri2: Add wayland platform