summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* egl/x11: Remove unneeded free() on always null stringVadym Shovkoplias2017-12-011-1/+0
| | | | | | | | In this condition dri2_dpy->driver_name string always equals NULL, so call to free() is useless Signed-off-by: Vadym Shovkoplias <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: Convert int to attrib in eglGetPlatformDisplayAdam Jackson2017-11-173-25/+25
| | | | | | | | ... because converting attrib to int truncates, and that's bad. Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: pass the dri2_dpy to the $plat_teardown functionsEmil Velikov2017-11-161-2/+2
| | | | | | | | | Cc: Mark Janes <[email protected]> Fixes: 40a01c9a0ef ("egl/drm: move teardown code to the platform file") Fixes: 8d745abc009 ("egl/wayland: move teardown code to the platform file") Signed-off-by: Emil Velikov <[email protected]> Tested-by: Dylan Baker <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103784
* egl: fix var typeEric Engestrom2017-11-161-1/+1
| | | | | | | | | | | | | queryImage() takes an `int*`; compiler is warning about the signed<->unsigned pointer mismatch. Fixes: 0db36caa192b129cb4f2 "egl/wayland: Add a fallback when fourcc query isn't supported" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Frank Binns <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Derek Foreman <[email protected]>
* egl: add note about missing $plat_teardownEmil Velikov2017-11-161-0/+1
| | | | | | | | Some platforms are missing a proper teardown function. Add a small TODO to make it obvious. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/wayland: move teardown code to the platform fileEmil Velikov2017-11-163-20/+27
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/drm: move teardown code to the platform fileEmil Velikov2017-11-163-5/+12
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/x11: move teardown code to the platform fileEmil Velikov2017-11-163-5/+11
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: Provide meaningfull error when built w/o requested platformEmil Velikov2017-11-162-11/+41
| | | | | | | | | | | The current "No EGL platform enabled." is misleading and wrong. We reach said code when $platform is missing. To make this more obvious and clear provide wrappers in the header file, making the code a bit easier to follow. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/wayland: Add a fallback when fourcc query isn't supportedDerek Foreman2017-11-141-2/+30
| | | | | | | | | | | | | | | When queryImage doesn't support __DRI_IMAGE_ATTRIB_FOURCC wayland clients will die with a NULL derefence in wl_proxy_add_listener. Attempt to provide a simple fallback to keep ancient systems working. Fixes: 6595c699511 ("egl/wayland: Remove more surface specifics from create_wl_buffer") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103519 Signed-off-by: Derek Foreman <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/haiku: Correct invalid void* conversion in callocAlexander von Gluck IV2017-11-131-1/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: EXT_pixel_format_float plumbingTapani Pälli2017-11-135-0/+15
| | | | | | | | | | | | | | | Patch adds support and capability to match with new surface attribute, component type. Currently no configs with floating point type are exposed. With this change, following dEQP test starts to pass: dEQP-EGL.functional.choose_config.color_component_type_ext.dont_care dEQP-EGL.functional.choose_config.color_component_type_ext.fixed dEQP-EGL.functional.choose_config.color_component_type_ext.float Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* meson: move wayland-egl into egl folderDylan Baker2017-11-101-0/+4
| | | | | | | | This ensure that it's properly guarded, but also makes the code clearer by grouping related things together. Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* threads: update for late C11 changesNicolai Hähnle2017-11-091-11/+13
| | | | | | | | | | | | | | | | | | | | C11 threads were changed to use struct timespec instead of xtime, and thrd_sleep got a second argument. See http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1554.htm and http://en.cppreference.com/w/c/thread/{thrd_sleep,cnd_timedwait,mtx_timedlock} Note that cnd_timedwait is spec'd to be relative to TIME_UTC / CLOCK_REALTIME. v2: Fix Windows build errors. Tested with a default Appveyor config that uses Visual Studio 2013. Judging from Brian's email and random internet sources, Visual Studio 2015 does have timespec and timespec_get, hence the _MSC_VER-based guard which I have not tested. Cc: Jose Fonseca <[email protected]> Cc: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (v1)
* egl/android: add a note about .swap_buffers_with_damageEmil Velikov2017-11-081-1/+1
| | | | | | | | | | | | | Android implements the API and does the native damage handling itself. At the same time it a) does call the vendor's eglSwapBuffersWithDamageKHR b) does not implement eglSetDamageRegionKHR There's something strange happening here. For now simply note about the 'lack' of eglSwapBuffersWithDamageKHR support. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* wayland-drm: static inline wayland_drm_buffer_getEmil Velikov2017-11-082-38/+36
| | | | | | | | | | | | | | | | | | | | The function is effectively a direct function call into libwayland-server.so. Thus GBM no longer depends on the wayland-drm static library, making the build more straight forward. And the resulting binary is a bit smaller. Note: we need to move struct wayland_drm_callbacks further up, otherwise we'll get an error since the type is incomplete. v2: Rebase, beef-up commit message, update meson, move struct wayland_drm_callbacks. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> (v1) Reviewed-by: Eric Engestrom <[email protected]> # meson bit only Acked-by: Eric Engestrom <[email protected]> # for the rest Reviewed-by: Dylan Baker <[email protected]> # meson
* meson: standardize .so version to major.minor.patchEric Engestrom2017-11-071-1/+1
| | | | | | | | | | | | | | This `version` field defines the filename for the .so. The plan .so as well as .so.$major are always symlinks to this. Unless I'm mistaken, only the major is ever used, so this shouldn't matter, but for consistency with autotools (and in case it does matter), let's always have all 3 major.minor.patch components. (The soname isn't affected, and is always .so.$major) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* egl: Implement EGL_KHR_context_flush_controlAdam Jackson2017-11-066-1/+24
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* egl/dri2: Factor out context attribute initializationAdam Jackson2017-11-061-24/+7
| | | | | | | Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* meson: Set c visibility args for wayland-drmDylan Baker2017-11-021-0/+1
| | | | | | | Because otherwise gbm will expose wayland symbols that it shouldn't. Signed-off-by: Dylan Baker <[email protected]> Reviewed-and-Tested-by: Eric Engestrom <[email protected]>
* gbm: Don't traverse backwards for includesDylan Baker2017-11-021-0/+2
| | | | | | | | | | | | | | This is just a bad idea and should be avoided. Instead, make the #include flat and fix the build systems to pass the proper -I flags v2: - add an inc_wayland_drm instead passing a path to include_directories (Emil) - update commit message (Emil) Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> (v1) Reviewed-by: Eric Engestrom <[email protected]> (v1)
* automake: Remove unused include pathDylan Baker2017-11-021-2/+1
| | | | | | | Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* meson: pass correct args to wayland-egl symbol testEric Engestrom2017-10-311-1/+4
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* automake+meson: don't run egl symbol check on libglvnd libEric Engestrom2017-10-312-6/+15
| | | | | | | | We might want to add a symbol check for the glvnd variant though. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* meson: pass correct env/args to egl testsEric Engestrom2017-10-311-2/+8
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* wayland-egl: fail symbol check if lib is missingEric Engestrom2017-10-311-1/+9
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: fail symbol check if lib is missingEric Engestrom2017-10-311-1/+9
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* meson: wire up egl/androidEric Engestrom2017-10-301-1/+4
| | | | | | | Cc: Rob Herring <[email protected]> Cc: Tomasz Figa <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* wayland-egl: fix wayland cflagsEric Engestrom2017-10-271-1/+1
| | | | | | | | Fixes: 80bfff5c4f1d4d8c842a0 "wayland-egl: adds CFLAGS for wayland.egl.h include" Suggested-by: Daniel Stone <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]> Acked-by: Tobias Klausmann <[email protected]>
* Android: egl: add dependency on libnativewindowRob Herring2017-10-261-0/+4
| | | | | | | | | | | system/window.h is no longer available by default and is part of libnativewindow, so add it to the shared libraries. It has to be conditional because the library is only present in O and later. Really, we should only be depending on vndk/window.h now, but that's only in O and changing would be pretty invasive. Signed-off-by: Rob Herring <[email protected]>
* meson: wayland-egl depends on wayland-clientDaniel Stone2017-10-261-0/+1
| | | | | | | | | | | | Since wayland-egl.h is currently provided by the core Wayland package, depend on wayland-client to make sure we get it in our include path. Signed-off-by: Daniel Stone <[email protected]> Acked-by: Emil Velikov <[email protected]> Fixes: 108d257a16 ("meson: build libEGL") Cc: Tobias Klausmann <[email protected]> Cc: Dylan Baker <[email protected]> Cc: Gert Wollny <[email protected]>
* meson: fix egl build for meson version < 0.43Dylan Baker2017-10-231-5/+4
| | | | | | | | | | | | | Meson 0.43 added the ability to pass nested lists to include_directories, so the code that we have works for 0.43, but not for 0.42. This patch changes the include_directories list to be flat so it works with 0.42 fixes: 108d257a16859898f5c ("meson: build libEGL") Tested-by: Vinson Lee <[email protected]> Reviewed-by: Rhys Kidd <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Dylan Baker <[email protected]>
* meson: Add support for EGL glvndDylan Baker2017-10-201-2/+44
| | | | | | Signed-off-by: Dylan Baker <[email protected]> Tested-by: Eric Engestrom <[email protected]> Reviewed-by: Lyude Paul <[email protected]>
* meson: build libEGLDylan Baker2017-10-203-0/+200
| | | | | | | | | | | | | | | | | | This is based heavily on Daniel Stone's work for the same, rebased on master and with a number of TODO's fixed. This does not implement glvnd (which is coming in a later patch) Meson builds egl slightly differently than autotools, namely it doesn't build an intermediate shared library. It doesn't do this because meson doesn't have problems with the name of the library being dynamically generated, so the glvnd and non-glvnd code can follow the same path. v2: - Don't reuse variable (Eric E.) Signed-off-by: Dylan Baker <[email protected]> Tested-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* meson: move wayland_drm_protocol generation to wayland-drmDylan Baker2017-10-201-1/+13
| | | | | | | | | | | These files are needed by both vulkan wayland-wsi and by egl wayland-wsi, since the XML file is in src/egl/wayland/wayland-drm and we can include this directory in such a way that it will be loaded before egl and vulkan this allows us to avoid multiple calls to the same generator. Signed-off-by: Dylan Baker <[email protected]> Reviewed-and-Tested-by: Eric Engestrom <[email protected]>
* egl,dri: Propagate context priority hint to driver->CreateContextChris Wilson2017-10-201-7/+31
| | | | | | | | | | | | | | | | | | | | Jump through the layers of abstraction between egl and dri in order to feed the context priority attribute through to the backend. This requires us to read the value from the base _egl_context, convert it to a DRI attribute, parse it again in the generic context creator before passing it to the driver as a function parameter. In order to not require us to pass back the actual value of the context priority after creation, we impose that drivers should report the available set of priorities during screen setup (and then they may chose to fail if given an invalid value as that should have been checked at the user boundary.) Signed-off-by: Chris Wilson <[email protected]> Acked-by: Ben Widawsky <[email protected]> # i915/i965 Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl: Support IMG_context_priorityChris Wilson2017-10-205-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IMG_context_priority https://www.khronos.org/registry/egl/extensions/IMG/EGL_IMG_context_priority.txt "This extension allows an EGLContext to be created with a priority hint. It is possible that an implementation will not honour the hint, especially if there are constraints on the number of high priority contexts available in the system, or system policy limits access to high priority contexts to appropriate system privilege level. A query is provided to find the real priority level assigned to the context after creation." The extension adds a new eglCreateContext attribute for choosing a priority hint. This stub parses the attribute and copies into the base struct _egl_context, and hooks up the query similarly. Since the attribute is purely a hint, I have no qualms about the lack of implementation before reporting back the value the user gave! v2: Remember to set the default ContextPriority value to medium. v3: Use the driRendererQuery interface to probe the backend for supported priority values and use those to mask the EGL interface. v4: Treat the priority attrib as a hint and gracefully mask any requests not supported by the driver, the EGLContext will remain at medium priority. Signed-off-by: Chris Wilson <[email protected]> Cc: Rob Clark <[email protected]> Reviewed-by: Ben Widawsky <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "egl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}"Marek Olšák2017-10-185-18/+31
| | | | | | This reverts commit 8cb84c8477a57ed05d703669fee1770f31b76ae6. This fixes crashing shader-db/run.
* Revert "egl: drop EGL driver `name`"Marek Olšák2017-10-185-1/+10
| | | | | | This reverts commit 6414d6bd8d2897f4ba643357fe3037f3acd60879. This is needed to apply the next revert.
* egl: set UseFallback if LIBGL_ALWAYS_SOFTWARE is setEric Engestrom2017-10-184-6/+7
| | | | | Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Eric Engestrom <[email protected]>
* egl: drop EGL driver `name`Eric Engestrom2017-10-185-10/+1
| | | | | | | | | | | | | | The "DRI2" name was reported as confusing when printing EGL infos (one user reported thinking DRI3 was not working on his X server), and the only alternative is Haiku, which can only be used on a Haiku machine. The name therefore doesn't add any information that the user wouldn't know already, so let's just drop it. Cc: Kai Wasserbäch <[email protected]> Suggested-by: Emil Velikov <[email protected]> Related-to: b174a1ae720cb404738c ("egl: Simplify the "driver" interface") Signed-off-by: Eric Engestrom <[email protected]>
* egl: drop always-false TestOnly optionEric Engestrom2017-10-185-18/+9
| | | | Signed-off-by: Eric Engestrom <[email protected]>
* egl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}Eric Engestrom2017-10-185-31/+18
| | | | | | | | Note: dropping the EGL_BAD_ALLOC in egl_haiku because it's overwritten by the EGL_NOT_INITIALIZED in eglInitialize(). Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl_dri2: drop dri2_egl_driver structEric Engestrom2017-10-182-58/+50
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl_dri2: move glFlush out of struct dri2_egl_driverEric Engestrom2017-10-182-27/+22
| | | | | | | There's no reason to store this there, it doesn't depend on the driver. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* wayland-drm: constify the callbacks struct, take 2Emil Velikov2017-10-133-11/+7
| | | | | | | | | | | Now that wayland-drm (correctly) keeps a local copy of the callbacks, this should not longer cause explosions. After all the symbol is a local, constant data. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Tested-by: Derek Foreman <[email protected]>
* wayland-drm: use a copy of the wayland_drm_callbacks structEmil Velikov2017-10-131-5/+5
| | | | | | | | | | | The callbacks may be called even when they are no longer valid. Say, the user is dlclose(ing) libEGL while the buffers are being destroyed. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Tested-by: Derek Foreman <[email protected]>
* egl/dri: don't crash when createImageFromRenderbuffer2 is NULLEmil Velikov2017-10-131-1/+2
| | | | | | | | | | | The __DRI_IMAGE version can be 17 or over, while the function pointer is NULL. Guard for that instead of crashing. Fixes: bad24395d91 ("egl/dri: use createImageFromRenderbuffer2 when available") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* egl_haiku: drop haiku_egl_driver structEric Engestrom2017-10-121-20/+14
| | | | | | | The struct only contained the one field we're interested in. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: remove left over _EGLMain_tEric Engestrom2017-10-121-3/+0
| | | | | | | Fixes: b174a1ae720cb404738c "egl: Simplify the "driver" interface" Cc: Adam Jackson <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>