summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* egl: Fix typoKyle Brenneman2016-09-141-1/+1
| | | | | Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Tear down images and syncs at eglTerminateAdam Jackson2016-09-141-0/+22
| | | | | Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* egl: Rename MESA_configless_context bit to KHR_no_config_contextAdam Jackson2016-09-124-6/+8
| | | | | | | | | Keep the old name in the extension string, but refer to the KHR extension internally. Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* egl: QueryContext on a configless context returns zeroAdam Jackson2016-09-121-3/+8
| | | | | | | | | | | | MESA_configless_context does not specify the interaction with QueryContext at all, and the code to generate an error in this case predates the Mesa extension. Since EGL_NO_CONFIG_{KHR,MESA} are numerically identical there's no way to distinguish which one the application asked for, so use the KHR behaviour. Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* egl: fix gcc warning braces around scalar initializerTimothy Arceri2016-09-121-1/+1
| | | | Reviewed-by: Alejandro Piñeiro <[email protected]>
* egl/android: Set EGL_MAX_PBUFFER_WIDTH and EGL_MAX_PBUFFER_HEIGHTHaixia Shi2016-09-091-0/+2
| | | | | | | | | | | | Set config attributes EGL_MAX_PBUFFER_WIDTH and EGL_MAX_PBUFFER_HEIGHT to hard-coded non-zero values. These two attributes are required on Android. v2: use _EGL_MAX_PBUFFER_WIDTH/HEIGHT from egldefines.h (based on discussion on the first version) Signed-off-by: Tomasz Figa <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Fix up indentation on previous commitAdam Jackson2016-09-081-2/+2
| | | | | | This was requested in review but I pushed the wrong version. Signed-off-by: Adam Jackson <[email protected]>
* egl: Document why EGL_OPENGL{, _ES}_API are mostly identicalAdam Jackson2016-09-081-0/+10
| | | | | Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* EGL: Combine the GL and GLES current contexts (v2)Kyle Brenneman2016-09-074-107/+22
| | | | | | | | | | | | | | | | | | | | | | Only keep track of a single current context, instead of separate contexts for GL and GLES. In EGL 1.4 (and 1.5), EGL_OPENGL_API and EGL_OPENGL_ES_API are supposed to be interchangeable for all purposes except for eglCreateContext. The _EGLThreadInfo::CurrentContexts array is now a single pointer to the current context, which may be a GL or GLES context. In addition, it now keeps track of the current API as an enum instead of an index. eglMakeCurrent will now replace the current context, regardless of which client API is used for for the current and new contexts. It no longer checks for a conflicting context. In addition, calling eglMakeCurrent with EGL_NO_CONTEXT will now release the current context regardless of the current API. v2: Rebased against master (Adam Jackson) Reviewed-by: Adam Jackson <[email protected]>
* gbm: wire up fence extensionRob Clark2016-09-071-0/+1
| | | | | | | | v2: make fence extension optional to not break non-i965 classic drivers, and move __DRI2_FENCE into core extensions, based on comments from Emil Signed-off-by: Rob Clark <[email protected]>
* wayland-drm: add missing NULL checkFrank Binns2016-09-011-0/+2
| | | | | | | | Although malloc is unlikely to fail check its return value nevertheless. Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: only store device name when Wayland support is builtFrank Binns2016-09-015-18/+24
| | | | | | | | The device name is only needed for WL_bind_wayland_display so make this clear by only storing the device name when Wayland support is built. Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Introduce .editorconfigEric Engestrom2016-08-312-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | A few weeks ago, Jose Fonseca suggested [0] we use .editorconfig files to try and enforce the formatting of the code, to which Michel Dänzer suggested [1] we start by importing the existing .dir-locals.el settings. The first draft was discussed in the RFC [2]. These .editorconfig are a first step, one that has the advantage of requiring little to no intervention from the devs once the settings files are in place, but the settings are very limited. This does have the advantage of applying while the code is being written. This doesn't replace the need for more comprehensive formatting tools such as clang-format & clang-tidy, but those reformat the code after the fact. [0] https://lists.freedesktop.org/archives/mesa-dev/2016-June/121545.html [1] https://lists.freedesktop.org/archives/mesa-dev/2016-June/121639.html [2] https://lists.freedesktop.org/archives/mesa-dev/2016-July/123431.html Acked-by: Nicolai Hähnle <[email protected]> Acked-by: Eric Anholt <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* egl/x11_dri3: provide an authentication functionFrank Binns2016-08-311-1/+18
| | | | | | | | | | | To support WL_bind_wayland_display an authentication function needs to be provided but this was not being done for this platform as it's not strictly necessary. However, as this isn't an optional function there's the potential for a segfault to occur if authentication is mistakenly performed. Protect against this by providing a function that prints an error. Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* egl/x11_dri3: disable WL_bind_wayland_display for devices without render nodesFrank Binns2016-08-312-29/+7
| | | | | | | | | | | | | | | | | Up until now, DRI3 was only used for devices that have render nodes, unless overridden via an environment variable, with it falling back to DRI2 otherwise. This limitation was there in order to support WL_bind_wayland_display as it requires client opened device node fds to be authenticated, which isn't possible when using DRI3. This is an unfortunate compromise as DRI3 provides security benefits over DRI2. Instead, allow DRI3 to be used for devices without render nodes but don't advertise WL_bind_wayland_display in this case. Applications that need this extension can still be run by disabling DRI3 support via the LIBGL_DRI3_DISABLE environment variable. Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* egl/android: remove config post-processingEmil Velikov2016-08-301-9/+0
| | | | | | | | | No longer needed as of last commit, since we no longer add OPENGL to the ClientAPIs thus, RenderType and Conformant don't have the desktop GL bit set. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tomasz Figa <[email protected]>
* egl/dri2: check if the EGL API is valid before adding it to ClientAPIsEmil Velikov2016-08-301-4/+4
| | | | | | | | | | | | | In the rather unlikely case that the API is considered invalid, don't add it to the (supported) ClientAPIs bitmask. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tomasz Figa <[email protected]> --- Strictly speaking we only need this in the Android case for OpenGL. Adding it everywhere doesn't hurt us since the compiler will const propagate and optimise/remove these.
* egl/android: annotate static const data as suchEmil Velikov2016-08-301-1/+1
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tomasz Figa <[email protected]>
* egl: treat EGL_OPENGL_API as invalid on AndroidEmil Velikov2016-08-301-1/+7
| | | | | | | | At the moment one can use OpenGL in eglBindAPI() only to clear the EGL_OPENGL_BIT from RenderableType and Conformant for _each_ config. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tomasz Figa <[email protected]>
* egl: turn a couple asserts static (compile-time)Eric Engestrom2016-08-241-3/+4
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland-egl: Fix for segfault in dri2_wl_destroy_surface.Stencel, Joanna2016-08-242-0/+4
| | | | | | | | | | | Segfault occurs when destroying EGL surface attached to already destroyed Wayland window. The fix is to set to NULL the pointer of surface's native window when wl_egl_destroy_window() is called. Cc: [email protected] Signed-off-by: Stencel, Joanna <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/dri2: dri2_initialize: Do not reference-count TestOnly displayNicolas Boichat2016-08-231-20/+9
| | | | | | | | | | | | | | | In the case where dri2_initialize is called with a TestOnly display, the display is not actually initialized, so dri2_egl_display always fails, and we cannot do any reference counting. Fixes piglit spec@egl_khr_create_context@verify gl flavor (reproducible with LIBGL_ALWAYS_SOFTWARE=1). Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" <[email protected]> Reported-by: Michel Dänzer <[email protected]> Signed-off-by: Nicolas Boichat <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/dri2: remove error checks on return values from mtx_lock and cnd_waitDongwon Kim2016-08-231-35/+12
| | | | | | | | | | | | | This removes unnecessary error checks on return result of mtx_lock and cnd_wait calls as in all other places in MESA source since there is no chance that any of these functions return any of error codes in current implementation. This patch also removes a redundent _eglError call that follows EGL_FALSE check in the bottom of dri2_client_wait_sync. Signed-off-by: Dongwon Kim <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/dri2: dri2_make_current: Release previous context's displayNicolas Boichat2016-08-161-4/+5
| | | | | | | | | | | | | | | | | | | eglMakeCurrent can also be used to change the active display. In that case, we need to decrement ref_count of the previous display (possibly destroying it), and increment it on the next display. Also, old_dsurf/old_rsurf cannot be non-NULL if old_ctx is NULL, so we only need to test if old_ctx is non-NULL. v2: Save the old display before destroying the context. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97214 Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" <[email protected]> Reported-by: Alexandr Zelinsky <[email protected]> Tested-by: Alexandr Zelinsky <[email protected]> Reviewed-and-Tested-by: Michel Dänzer <[email protected]> Signed-off-by: Nicolas Boichat <[email protected]>
* egl/android: Set dpy->DriverData to NULL on errorNicolas Boichat2016-08-151-0/+1
| | | | | | | | | | Avoid use-after-free on error. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" <[email protected]> Signed-off-by: Nicolas Boichat <[email protected]> Tested-by: Martin Peres <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/drm: Set disp->DriverData to NULL on errorNicolas Boichat2016-08-151-0/+1
| | | | | | | | | | Avoid use-after-free on error. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" <[email protected]> Signed-off-by: Nicolas Boichat <[email protected]> Tested-by: Martin Peres <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/surfaceless: Set disp->DriverData to NULL on errorNicolas Boichat2016-08-151-0/+1
| | | | | | | | | | Avoid use-after-free on error. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" <[email protected]> Signed-off-by: Nicolas Boichat <[email protected]> Tested-by: Martin Peres <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: Set disp->DriverData to NULL on errorNicolas Boichat2016-08-151-0/+2
| | | | | | | | | | | Avoid use-after-free, fix spec@egl_khr_fence_sync@conformance. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" <[email protected]> Reported-by: Michel Dänzer <[email protected]> Signed-off-by: Nicolas Boichat <[email protected]> Tested-by: Martin Peres <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/x11: avoid using freed memory if dri2 init failsJan Ziak2016-08-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found with valgrind: ==4841== Invalid read of size 4 ==4841== at 0x56BDC80: dri2_initialize (egl_dri2.c:783) ==4841== by 0x56BAFE5: _eglMatchAndInitialize (egldriver.c:261) ==4841== by 0x56BB15E: _eglMatchDriver (egldriver.c:295) ==4841== by 0x56B58C9: eglInitialize (eglapi.c:480) ==4841== by 0x4F537DC: _glfwInitEGL (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F4BEFB: _glfwPlatformInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x402E59: main ==4841== Address 0x6a05824 is 148 bytes inside a block of size 480 free'd ==4841== at 0x4C2B680: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==4841== by 0x56C2AAE: dri2_initialize_x11_swrast (platform_x11.c:1233) ==4841== by 0x56C2AAE: dri2_initialize_x11 (platform_x11.c:1493) ==4841== by 0x56BDCEB: dri2_initialize (egl_dri2.c:805) ==4841== by 0x56BAFAF: _eglMatchAndInitialize (egldriver.c:261) ==4841== by 0x56BB0C9: _eglMatchDriver (egldriver.c:292) ==4841== by 0x56B58C9: eglInitialize (eglapi.c:480) ==4841== by 0x4F537DC: _glfwInitEGL (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F4BEFB: _glfwPlatformInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x402E59: main ==4841== Block was alloc'd at ==4841== at 0x4C2A868: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==4841== by 0x56C2A47: dri2_initialize_x11_swrast (platform_x11.c:1171) ==4841== by 0x56C2A47: dri2_initialize_x11 (platform_x11.c:1493) ==4841== by 0x56BDCEB: dri2_initialize (egl_dri2.c:805) ==4841== by 0x56BAFAF: _eglMatchAndInitialize (egldriver.c:261) ==4841== by 0x56BB0C9: _eglMatchDriver (egldriver.c:292) ==4841== by 0x56B58C9: eglInitialize (eglapi.c:480) ==4841== by 0x4F537DC: _glfwInitEGL (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F4BEFB: _glfwPlatformInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x402E59: main Signed-off-by: Jan Ziak (http://atom-symbol.net) <[email protected]> Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" <[email protected]> Reviewed-by: Nicolas Boichat <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: android: query native window default width and height (v2)Haixia Shi2016-08-093-0/+42
| | | | | | | | | | | | | | | | On android platform, the width and height of a native window surface may be updated after initialization. It is therefore necessary to query android framework for the current width and height. v2: remove Android specific #ifdef's and just implement the fallback directly if the platform query_surface() callback is not provided. TEST=dEQP-EGL.functional.resize.surface_size#* on cyan-cheets Reviewed-by: Kristian H. Kristensen <[email protected]> (v1) Reviewed-by: Tomasz Figa <[email protected]> Reviewed-by: Chad Versace <[email protected]> Change-Id: I673f7d2f1d90c3bf572b30f63da537f2cae1496e
* egl/android: Add support for YV12 pixel format (v2)Tomasz Figa2016-08-081-6/+50
| | | | | | | | | | | | | | | This patch adds support for YV12 pixel format to the Android platform backend. Only creating EGL images is supported, it is not added to the list of available visuals. v2: Use const array defined just for YV12 instead of trying to be overly generic. Signed-off-by: Tomasz Figa <[email protected]> Signed-off-by: Kalyan Kondapally <[email protected]> Tested-by: Rob Herring <[email protected]> Reviewed-by: Chad Versace <[email protected]> Change-Id: I4aeb2d67a95c5cdd10b530c549b23146c8f0b983
* egl/android: Make get_fourcc() accept HAL formatsTomasz Figa2016-08-081-9/+11
| | | | | | | | | | | | | There are DRI_IMAGE_FOURCC macros, for which there are no corresponding DRI_IMAGE_FORMAT macros. To support such formats we need to make the lookup function take the native format directly. As a side effect, it simplifies all existing calls to this function, because they all called get_format() first to convert from native to DRI_IMAGE_FORMAT. Signed-off-by: Tomasz Figa <[email protected]> Tested-by: Rob Herring <[email protected]> Reviewed-by: Chad Versace <[email protected]> Change-Id: I4674000fb5ccfd02e38b8fa89bc567ac1d4fc16b
* egl/android: Refactor image creation to separate flink and prime paths (v2)Tomasz Figa2016-08-081-42/+57
| | | | | | | | | | | | | | | | This patch splits current dri2_create_image_android_native_buffer() into main entry point and two additional functions, one for creating an image from flink name and one for handling prime FDs using the generic DMA-buf path. This makes the code cleaner and also prepares for disabling flink path more easily in the future. v2: Split into separate patch. Add error messages. Signed-off-by: Tomasz Figa <[email protected]> Tested-by: Rob Herring <[email protected]> Reviewed-by: Chad Versace <[email protected]> Change-Id: Ifdfb5927399d56992fe707160423c29278f49172
* egl/android: Respect buffer mask in droid_image_get_buffers (v2)Tomasz Figa2016-08-081-5/+15
| | | | | | | | | | | | | | Drivers can request different set of buffers depending on the buffer mask they pass to the get_buffers callback. This patch makes droid_image_get_buffers() respect this mask. v2: Return error only in case of real error condition and ignore requests of unavailable buffers. Signed-off-by: Tomasz Figa <[email protected]> Tested-by: Rob Herring <[email protected]> Reviewed-by: Chad Versace <[email protected]> Change-Id: I6c3c4eca90f4c618579f6725dec323c004cb44ba
* egl/android: Remove unused variables in droid_get_buffers_with_format()Tomasz Figa2016-08-081-3/+0
| | | | | | | | | | Fix compilation warnings due to unused variables left after some earlier code changes. Signed-off-by: Tomasz Figa <[email protected]> Tested-by: Rob Herring <[email protected]> Reviewed-by: Chad Versace <[email protected]> Change-Id: Iec09eb2a62887f3a38dff156756ed8385f3f3447
* egl/dri2: Add reference count for dri2_egl_displayNicolas Boichat2016-07-282-20/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android.opengl.cts.WrapperTest#testGetIntegerv1 CTS test calls eglTerminate, followed by eglReleaseThread. A similar case is observed in this bug: https://bugs.freedesktop.org/show_bug.cgi?id=69622, where the test calls eglTerminate, then eglMakeCurrent(dpy, NULL, NULL, NULL). With the current code, dri2_dpy structure is freed on eglTerminate call, so the display is not initialized when eglReleaseThread calls MakeCurrent with NULL parameters, to unbind the context, which causes a a segfault in drv->API.MakeCurrent (dri2_make_current), either in glFlush or in a latter call. eglTerminate specifies that "If contexts or surfaces associated with display is current to any thread, they are not released until they are no longer current as a result of eglMakeCurrent." However, to properly free the current context/surface (i.e., call glFlush, unbindContext, driDestroyContext), we still need the display vtbl (and possibly an active dri dpy connection). Therefore, we add some reference counter to dri2_egl_display, to make sure the structure is kept allocated as long as it is required. One drawback of this is that eglInitialize may not completely reinitialize the display (if eglTerminate was called with a current context), however, this seems to meet the EGL spec quite well, and does not permanently leak any context/display even for incorrectly written apps. Cc: "12.0" <[email protected]> Signed-off-by: Nicolas Boichat <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/android: Stop leaking DRI imagesTomasz Figa2016-07-201-0/+11
| | | | | | | | | | | | | | | | Current implementation of the DRI image loader does not free the images created in get_back_bo() and so leaks memory. Moreover, it creates a new image every time the DRI driver queries for buffers, even if the backing native buffer has not changed. leaking memory again. This patch adds missing call to destroyImage() in droid_enqueue_buffer() and a check if image is already created to get_back_bo() to fix the above. Cc: "11.2 12.0" <[email protected]> Signed-off-by: Tomasz Figa <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/android: Add some useful error messagesTomasz Figa2016-07-201-3/+10
| | | | | | | | | | It is much easier to debug issues when the application gives some meaningful error messages. This patch adds few to the EGL Android platform backend. Signed-off-by: Tomasz Figa <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/android: Check return value of dri2_get_dri_config()Tomasz Figa2016-07-201-0/+2
| | | | | | | | | It might return NULL if specific config variant is unsupported. Cc: "11.2 12.0" <[email protected]> Signed-off-by: Tomasz Figa <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/dri2: dri2_make_current: Set EGL error if bindContext failsNicolas Boichat2016-07-201-2/+8
| | | | | | | | | | | | | Without this, if a configuration is, say, available only on GLES2/3, but not on GLES1, and is rejected by the dri module's bindContext call, eglMakeCurrent fails with error "EGL_SUCCESS". In this patch, we set error to EGL_BAD_MATCH, which is what CTS/dEQP dEQP-EGL.functional.surfaceless_context expect. Cc: "11.2 12.0" <[email protected]> Signed-off-by: Nicolas Boichat <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/android: Remove unused variablesTomasz Figa2016-07-201-2/+0
| | | | | | | | | There are some unused variables left after previous clean-ups triggering compiler warnings. Let's remove them. Cc: "12.0" <[email protected]> Signed-off-by: Tomasz Figa <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Use correct names for dlopen()ed files on CygwinYaakov Selkowitz2016-07-151-0/+2
| | | | | Signed-off-by: Yaakov Selkowitz <[email protected]> Reviewed-by: Jon Turney <[email protected]>
* egl: restrict swap_available dri2_egl_display field to X11Frank Binns2016-07-072-3/+1
| | | | | | | This field is only ever set and read by the X11 platform. Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: Fix the bad surface attributes combination checking for pbuffers. (v3)Guillaume Charifi2016-07-071-21/+15
| | | | | | | | | | | | | | | | | Fixes a regression induced by commit a0674ce5c41903ccd161e89abb149621bfbc40d2: When EGL_TEXTURE_FORMAT and EGL_TEXTURE_TARGET were both specified (and both != EGL_NO_TEXTURE), an error was instantly triggered, before the other one had even a chance to be checked, which is obviously not the intended behaviour. v2: Full commit hash, remove useless variables. v3: [chadv] Add Fixes footers. Fixes: piglit "spec/egl 1.4/eglcreatepbuffersurface and then glclear" Fixes: piglit "spec/egl 1.4/largest possible eglcreatepbuffersurface and then glclear" Signed-off-by: Guillaume Charifi <[email protected]> Reviewed-by: Frank Binns <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl/display: remove unnecessary code and make it easier to readEric Engestrom2016-07-071-15/+14
| | | | | | | | | Remove the two first level `if` as they will always be true, and flatten the two remaining `if`. No functional change. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* Added pbuffer hooks for surfaceless platformGurchetan Singh2016-06-142-5/+215
| | | | | | | | | | This change enables the creation of pbuffer surfaces on the surfaceless platform. v3: Going back to single-buffered pbuffer plus additional code review changes Reviewed-by: Chad Versace <[email protected]>
* Android: move libdrm settings to top-level Android.common.mkRob Herring2016-06-131-6/+0
| | | | | | | | | | | | | | Fix warnings like these due to HAVE_LIBDRM being inconsistently defined: external/libdrm/include/drm/drm.h:839:30: warning: redefinition of typedef 'drm_clip_rect_t' is a C11 feature [-Wtypedef-redefinition] typedef struct drm_clip_rect drm_clip_rect_t; HAVE_LIBDRM needs to be set project wide to fix this. This change also harmlessly links libdrm with everything, but simplifies the makefiles a bit. Signed-off-by: Rob Herring <[email protected]> Acked-by: Emil Velikov <[email protected]>
* platform_android: prevent deadlock in droid_swap_buffersHaixia Shi2016-06-071-5/+12
| | | | | | | | | | | | | To avoid blocking other EGL calls, release the display mutex before we enqueue buffer to android frameworks and re-acquire the mutex upon return. v2: moved lock/unlock inside droid_window_enqueue_buffer(). TEST=verify pinch zoom in Photos app no longer causes hangs Signed-off-by: Haixia Shi <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: android: don't add the image loader extension for !render_nodeEmil Velikov2016-06-071-8/+7
| | | | | | | | | | | | | | | | | | | | With earlier commit we introduced support for render_node devices, which was couples with the use of the image loader extension. As the work was inspired by egl/wayland we (erroneously) added the extension for the !render_node path as well. That works for wayland, as the implementations of the DRI2 and IMAGE loader extensions converge behind the scenes. As that is not yet the case for Android we shouldn't expose the extension. Fixes: 34ddef39cef ("egl: android: add dma-buf fd support") Cc: <[email protected]> Reported-by: Mauro Rossi <[email protected]> Tested-by: Mauro Rossi <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* Revert "egl: Check if API is supported when using eglBindAPI."Marek Olšák2016-06-034-72/+10
| | | | | | This reverts commit e8b38ca202fbe8c281aeb81a4b64256983f185e0. It broke Glamor for Gallium at least.