summaryrefslogtreecommitdiffstats
path: root/src/egl/main
Commit message (Collapse)AuthorAgeFilesLines
* egl: simplify loopEric Engestrom2019-07-011-3/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Sagar Ghuge<[email protected]>
* egl: Enable eglGetPlatformDisplay on Android Platformrenchenglei2019-06-293-0/+27
| | | | | | This helps to add eglGetPlatformDisplay support on Android Platform. Reviewed-by: Eric Engestrom <[email protected]>
* egl: replace dead vfunc with an errorEric Engestrom2019-06-252-14/+2
| | | | | | | | | | st/egl used to support eglCreatePbufferFromClientBuffer, but now that it's gone, any call to it would segfault. Let's return a nice error instead. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: delete unused vfuncsEric Engestrom2019-06-252-46/+7
| | | | | | | | | | | Nobody ever uses these, so let's just hard code them instead. If an EGL driver ever comes around that needs them they're trivial to re-add. Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: drop empty eglfallbacks.cEric Engestrom2019-06-253-51/+0
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: move eglGetSyncAttrib() fallback to eglapi.cEric Engestrom2019-06-252-2/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglSwapInterval() fallback to eglapi.cEric Engestrom2019-06-252-5/+8
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglSurfaceAttrib() fallback to eglapi.cEric Engestrom2019-06-252-3/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglQuerySurface() fallback to eglapi.cEric Engestrom2019-06-252-2/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglQueryContext() fallback to eglapi.cEric Engestrom2019-06-252-3/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglGetConfigAttrib() fallback to eglapi.cEric Engestrom2019-06-252-3/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglChooseConfig() fallback to eglapi.cEric Engestrom2019-06-252-3/+6
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglGetConfigs() fallback to eglapi.cEric Engestrom2019-06-252-2/+4
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Revert "egl: drop empty eglfallbacks.c" and "egl: move fallback calls to ↵Eric Engestrom2019-06-224-38/+73
| | | | | | | | | | | | | | | | eglapi.c" This reverts commits cc4b68a80193e2a132cb62309292984a9428f2bb and b27fb3eacab906ec06cd61b7d01e3425c3b3cbfc. These caused a bunch of EGLSync tests to crash when they were previously failing. I have a hunch the tests are doing something wrong, like using extensions without checking for they support, but until the issue is investigated I'm just reverting these commits. Signed-off-by: Eric Engestrom <[email protected]>
* egl: drop empty eglfallbacks.cEric Engestrom2019-06-223-51/+0
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: move fallback calls to eglapi.cEric Engestrom2019-06-222-22/+38
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: drop `_eglReturnFalse()` fallbacksEric Engestrom2019-06-221-24/+0
| | | | | | | | | v2: drop them altogether, they should never get called in the first place (Emil) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: remove unnecessary eglGetProcAddress() fallbackEric Engestrom2019-06-222-2/+1
| | | | | | | | | No need to add a function that returns `false` only to be cast into a pointer, we can just use the existing `return NULL` :) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: remove NULL assignments after calloc()Eric Engestrom2019-06-221-21/+0
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move bad_param check further upEric Engestrom2019-06-222-6/+8
| | | | | | | | | This way other functions added in these entrypoints don't need to check anything. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: add missing #includeEric Engestrom2019-06-191-0/+1
| | | | | | | | close() is in <unistd.h> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Don't add hardware device if there is no render node v2.Mathias Fröhlich2019-06-191-2/+2
| | | | | | | | | | | | | | | Do not offer a hardware drm backed egl device if no render node is available. The current implementation will fail on this egl device. On top it issues a warning that is actually missleading. There are finally more error paths that can fail on the way to a hardware backed egl device. Fixing all of them would kind of require opening the drm device and see if there is a usable driver associated with the device. The taken approach avoids a full probe and fixes at least this kind of problem on kvm virtualization hosts I observe here. Fixes: dbb4457d985 ("egl: add EGL_EXT_device_drm support") Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* egl: compare the whole list of attributesEric Engestrom2019-06-111-1/+1
| | | | | | | | | `memcmp()` compares a given number of bytes, but `EGLAttrib` is larger than a byte. Fixes: 8e991ce5397598ceb422 "egl: handle the full attrib list in display::options" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: add EGL_platform_device supportEmil Velikov2019-06-056-7/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new 'platform' is added by default with no guards. It is effectively a copy of the surfaceless one, with updated function names and brand new probe function. Due to the reuse, some of the ifdef HAVE_SURFACELESS_PLATFORM guards have been dropped. A worthy mention are the changes in _egFindDisplay, since the original and dup'd fd are required, we make use of the plat_opt argument. Note that no hacks for eglGetDisplay are added - the API works only with the eglGetPlatformDisplay* API. v2: - s/_eglCompareDeviceDisplay/_eglSameDeviceDisplay/ (Eric) - let ^^ return bool (Eric) - fixup meson build, move files() further up (Eric) - copy from plat. surfaceless w/o the visual cleanups - close and free when destroying the dpy - sprinkle a few _eglDeviceSupports - split fd handling into separate function - use directly the render node if no FD is given (Mathias) v3: - s/dpy/disp/g - drop swap_buffers* callbacks - drop loader_set_logger() - drop local define - re-introduce _eglGetDRMDeviceRenderNode() - EGL_WARN on ForceSoftware with HW device - continue using the HW device - bail out for "EGL_MESA_device_software" until it's fixed - wire-up the Android build v4: - use new style _eglFindDisplay() - split hw vs sw code paths - don't close the internal fd (already handled in FiniDisplay()) - make swrast work (bit hacky bit will do for now) - Android for real, drop autotools - Correct HW + LIBGL_ALWAYS_SOFTWARE check - use the dri2_create_drawable() helper v5: - enhance comment around fd checks (Mathias) - rebase for dri2_init_surface() changes Cc: Mathias Fröhlich <[email protected]> Acked-by: Marek Olšák <[email protected]> (v4) Signed-off-by: Emil Velikov <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* egl: keep the software device at the end of the listEmil Velikov2019-06-051-1/+13
| | | | | | | | | | | | | By default, the user is likely to pick the first device so it should not be the least performant (aka software) one. v2: Drop odd comment (Marek) Suggested-by: Marek Olšák <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]> (v1) Reviewed-by: Marek Olšák <[email protected]> (v1) Signed-off-by: Emil Velikov <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* egl: fold X11 attrib handling like other platformsEmil Velikov2019-06-051-34/+11
| | | | | | | | | | Since we no longer need special handling for X11, refactor the code to follow the style used by all other platforms. Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* egl: remove Options::Platform handlingAdam Jackson2019-06-052-10/+4
| | | | | | | | | | | | The full set of attributes is already handled with previous patches. Thus all this is not dead code. v2 (Emil) - split from a larger patch. Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* egl: handle the full attrib list in display::optionsAdam Jackson2019-06-053-11/+55
| | | | | | | | | | | | | | | | | | | Earlier spec is vague, although EGL 1.5 makes it clear: Multiple calls made to eglGetPlatformDisplay with the same parameters will return the same EGLDisplay handle. With this commit we store and compare the full attrib list. v2 (Emil): - Split into separate patches - Use EGLBoolean over int masked as such - Don't return free'd pointed on calloc failure Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* egl: flesh out a _eglNumAttribs() helperEmil Velikov2019-06-052-9/+16
| | | | | | | Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* egl: Allow EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY in ES and GLKenneth Graunke2019-05-171-2/+10
| | | | | | | | | | | | | | | | | | | | | | | EGL annoyingly defines a few variants of this token: EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT - 0x3138 EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR - 0x31BD EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY - 0x31BD The EGL_EXT_create_context_robustness extension specifies that the EXT token is only valid for ES contexts, not GL. The EGL_KHR_create_context extension defines the KHR version, and says it is only allowed for GL contexts, and specifically calls out that it's an error for ES contexts. But EGL 1.5 includes the new suffixless token, which has the same value as the KHR version, and specifically calls out that it's now valid to use with both GL and ES contexts. So we should allow this. Fixes KHR-NoContext.es32.robustness.no_reset_notification and KHR-NoContext.es32.robustness.lose_context_on_reset on iris, which apparently is exposing EGL 1.5. Reviewed-by: Tapani Pälli <[email protected]>
* egl: check if a window/pixmap is already used on surface creationPaulo Zanoni2019-05-141-0/+32
| | | | | | | | | | | The spec says we can't create another surface if we already created a surface with the given window or pixmap. Implement this check. This behavior is exercised by piglit/egl-create-surface. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Signed-off-by: Paulo Zanoni <[email protected]>
* egl: store the native surface pointer in struct _egl_surfacePaulo Zanoni2019-05-142-2/+8
| | | | | | | | | | | | | | | | | | | | | | | Each platform stores this in a different place: - platform_drm uses dri2_surf->gbm_surf->base - platform_android uses dri2_surf->window - platform_wayland uses dri2_surf->wl_win - platform_x11 uses dri2_surf->drawable - platform_x11_dri3 uses dri3_surf->loader_drawable.drawable - haiku doesn't even store it! We need access to the native surface since the specification asks us to refuse creating a new surface if there's already an EGLSurface associated with native_surface. An alternative to this patch would be to create a new API.GetNativeWindow callback that each platform would have to implement. While that's something we can definitely do, I prefer this approach. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Signed-off-by: Paulo Zanoni <[email protected]>
* egl: hard-code destroy function instead of passing it around as a pointerEric Engestrom2019-05-021-7/+5
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: return correct error code for a case req ver < 3 with forward-compatibleAndrii Simiklit2019-05-011-1/+4
| | | | | | | | | | | | | | | | | | | | The EGL_KHR_create_context spec says: "If an OpenGL context is requested and the values for attributes EGL_CONTEXT_MAJOR_VERSION_KHR and EGL_CONTEXT_MINOR_VERSION_KHR, when considered together with the value for attribute EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR, specify an OpenGL version and feature set that are not defined, than an EGL_BAD_MATCH error is generated." This case is already correctly handled a bit below in the same source file. The correct handling was added by commit: 63beb3df Reported-by: Ian Romanick <[email protected]> Here: https://bugzilla.freedesktop.org/show_bug.cgi?id=92552#c9 Fixes: 11cabc45b712 "egl: rework handling EGL_CONTEXT_FLAGS" Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Andrii Simiklit <[email protected]>
* egl: fixup autotools-specific wordingEric Engestrom2019-04-301-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* delete autotools input filesEric Engestrom2019-04-291-12/+0
| | | | | | | Leftovers from when autotools was deleted. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* egl: hide entrypoints that shouldn't be exported when using glvndEric Engestrom2019-03-291-0/+6
| | | | | | | | | | | From GLVND author: > From a functional standpoint, exporting additional symbols doesn't > really matter, since libglvnd will load the vendor libraries with > RTLD_LOCAL. Suggested-by: Kyle Brenneman <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Kyle Brenneman <[email protected]>
* egl: fix libdrm-less buildsEric Engestrom2019-03-052-15/+0
| | | | | | | | | | | | This function was never used, and isn't properly guarded by HAVE_LIBDRM, breaking the build on systems that don't have libdrm. Let's just remove it. Fixes: 7552fcb7b9b98392e6a8 "egl: add base EGL_EXT_device_base implementation" Reported-by: Timo Aaltonen <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* egl: fix KHR_partial_update without EXT_buffer_ageChia-I Wu2019-02-121-1/+6
| | | | | | | | EGL_BUFFER_AGE_EXT can be queried without EXT_buffer_age. Signed-off-by: Chia-I Wu <[email protected]> Acked-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: use coherent variable namesEric Engestrom2019-02-0616-246/+246
| | | | | | | | | | | | | | | | | `EGLDisplay` variables (the opaque Khronos type) have mostly been consistently called `dpy`, as this is the name used in the Khronos specs. However, `_EGLDisplay` variables (our internal struct) have been randomly called `dpy` when there was no local variable clash with `EGLDisplay`s, and `disp` otherwise. Let's be consistent and use `dpy` for the Khronos type, and `disp` for our struct. Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]> Acked-by: Eric Anholt <[email protected]>
* egl: Implement EGL API for MESA_query_driverVeluri Mithun2019-01-244-0/+38
| | | | | | | Signed-off-by: Veluri Mithun <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Revert "Implement EGL API for MESA_query_driver"Mark Janes2019-01-234-38/+0
| | | | | | | | | This reverts commit ff621a505594a3217f24fb785c51f43580f1bf78. with default warnings configuration, this commit generates: ../src/egl/main/eglapi.c:2654:1: error: no previous prototype for ‘eglGetDisplayDriverConfig’ [-Werror=missing-prototypes]
* Implement EGL API for MESA_query_driverVeluri Mithun2019-01-234-0/+38
| | | | | | | | | Signed-off-by: Veluri Mithun <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* egl: remove unused includeEric Engestrom2019-01-111-2/+0
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* egl: add missing includesEric Engestrom2019-01-115-0/+8
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* egl: add missing #include <stddef.h> in egldevice.hGurchetan Singh2018-11-281-1/+1
| | | | | | | | | | | | | | | | | | Otherwise, I get this error: main/egldevice.h:54:13: error: ‘NULL’ undeclared (first use in this function) dev = NULL; ^~~~ with this config: ./autogen.sh --enable-gles1 --enable-gles2 --with-platforms='surfaceless' --disable-glx --with-dri-drivers="i965" --with-gallium-drivers="" --enable-gbm v3: Use stddef.h (Matt) v4: Modify commit message (Eric) Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: Print the actual message to the console from _eglError().Eric Anholt2018-11-161-12/+20
| | | | | | | | | | | | | | Previously we would print errors on the console like: libEGL debug: EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize When we had everything we needed for: libEGL debug: EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize: DRI2: failed to find EGLDevice (for a gbm error in my case) Reviewed-by: Emil Velikov <[email protected]>
* egl/glvnd: correctly report errors when vendor cannot be foundEmil Velikov2018-11-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | If the user provides an invalid display or device the ToVendor lookup will fail. In this case, the local [Mesa vendor] error code will be set. Thus on sequential eglGetError(), the error will be EGL_SUCCESS. To be more specific, GLVND remembers the last vendor and calls back into it's eglGetError, although there's no guarantee to ever have had one. v2: - Add _eglError call, so the debug callback is executed (Kyle) - Drop XXX comment. Piglit: tests/egl/spec/egl_ext_device_query Fixes: ce562f9e3fa ("EGL: Implement the libglvnd interface for EGL (v3)") Cc: Eric Engestrom <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Kyle Brenneman <[email protected]>
* egl: Fix eglentrypoint.h sort order.Mathias Fröhlich2018-11-011-1/+1
| | | | | | | | Fixes a make check failure. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108617 Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* egl: enable EGL_EXT_device_{base,enumeration,query}Emil Velikov2018-11-011-0/+3
| | | | | | | | | | Now that we support the extensions, fully, enabled them. The specs mandate that we always have at least one device and each dpy has a device associated with it. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>