summaryrefslogtreecommitdiff
path: root/src/egl
AgeCommit message (Collapse)AuthorFilesLines
2015-01-06egl: Inform the client API when ancillary buffers may become undefined.Eric Anholt6-15/+43
This is part of the EGL spec, and is useful for a tiled renderer to avoid the memory bandwidth cost of storing the depth/stencil buffers. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-12-25egl: Fix non-dri SCons builds re #87657Alexander von Gluck IV1-10/+7
* Revert change to egl main producing Shared Libraries * Check for dri before including dri code
2014-12-23egl/haiku: Clean up SConscript whitespaceAlexander von Gluck IV1-13/+12
2014-12-23egl/dri2: Fix build of dri2 egl driver with SConsAlexander von Gluck IV1-0/+40
* egl/dri2 was missing a SConscript * Problem caught by Adrián Arroyo Calle
2014-12-23egl: Clean up Haiku visual creationAlexander von Gluck IV1-49/+47
* Only create one struct * 'final' also is a language conflict * Some style cleanup
2014-12-23egl: Add Haiku code and supportAlexander von Gluck IV7-3/+509
* This is the cleaned up work of the Haiku GCI student Adrián Arroyo Calle adrian.arroyocalle@gmail.com * Several patches were consolidated to prevent unnecessary touching of non-related code
2014-12-17egl: remove support for GCC older than 4.1.0Timothy Arceri1-1/+1
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au> Reviewed-By: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-12-12egl: Add files to distribution.Matt Turner1-0/+5
2014-12-12egl+gbm: Add symbols-check tests to distribution.Matt Turner1-0/+1
2014-12-12egl/dri2: Add headers to distribution.Matt Turner1-1/+2
2014-12-12egl: Drop unnecessary Makefile.am.Matt Turner1-1/+0
2014-12-08Use calloc instead of malloc/memset-0Matt Turner1-2/+1
See commit 6bda027e for the Coccinelle script. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-12-07egl: Expose EGL_KHR_get_all_proc_addresses and its client extensionChad Versace5-1/+23
Mesa already implements the behavior of EGL_KHR_get_all_proc_addresses and EGL_KHR_client_get_all_proc_addresses. This patch just exposes the extension strings. See: https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_get_all_proc_addresses.txt Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-12-04egl/dri2: Log a warning if no platforms are enabled.Matt Turner1-0/+1
If you hit this, you didn't compile with --with-egl-platforms=... Recompile with something like --with-egl-platforms=x11,drm and make clean and make again. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-14egl: remove egl_gallium from the loaderMarek Olšák1-14/+0
Acked-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Eric Anholt <eric@anholt.net> Informally acked-by: Jose Fonseca
2014-11-07egl_dri2: add a note about dri2_create_screenEmil Velikov1-0/+4
The function is not called by platform_drm. As such one needs to pay special attention at teardown. v2: Fix the comment block. Spotted by Ken. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-11-07egl_dri2: fix double free on drm platformsEmil Velikov1-3/+9
Earlier commit failed to attribure that for drm platforms one does not call dri2_create_screen, thus it does not create the screen and driver_configs but inherits them from the "display" - gbm. As such wrap cleanup in Platform != _EGL_PLATFORM_DRM to prevent the issue and still cleanup correctly for non-drm platforms. v2: - Drop the ifdef HAVE_DRM_PLATFORM, reindent the code and fix the comment block. Suggested by Ken. Reported-by: Kenneth Graunke <kenneth@whitecape.org> Reported-by: Mark Janes <mark.a.janes@intel.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-11-06egl_dri2: do not leak dri2_dpy->driver_configsEmil Velikov1-0/+4
Walk through the list and free each config, and finally free the list itself. Freeing approx 20KiB of memory, according to valgrind. Inspired by a similar patch by enpeng xu. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-27egl/drm: do not crash when swapping buffers without any renderingLionel Landwerlin1-0/+8
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-10-03util: Include in Android buildsTomasz Figa1-0/+1
This patch fixes Android build failures by including src/util directory in compilation. Files inside of this directory are compiled into libmesa_util static library and linked with resulting libGLES_mesa. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> CC: <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-29egl: setup screen iterator before using itTapani Pälli1-1/+1
commit 4ed23fd broke creation of pbuffer surfaces, patch fixes the failure, noticed when running chrome with '--use-gl=egl'. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-09-27configure: drop --with-egl-driver-dir switchEmil Velikov1-1/+1
The location of the egl driver(s) is matter that we should have never exposed to the user. Currently the dri2 driver is built into the libEGL loader, with the gallium based one soon to follow. v2: Fold EGL_DRIVER_INSTALL_DIR within the makefiles. Suggested by Matt. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80615 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-23egl: extra null checks for get_xcb_screen() return valuesJuha-Pekka Heikkila1-6/+24
verify get_xcb_screen() returned pointer before using it. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23egl/drm: expose KHR_image_pixmap extensionAndreas Pokorny1-0/+1
This changes enables EGL_KHR_image_pixmap in the egl drm platform, which is implemented there but has not been advertised yet. Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org> Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2014-09-03egl: Restrict multiplication in calloc arguments to use compile-time constantsCarl Worth2-2/+2
As explained in the previous commit, we want to avoid the possibility of integer-multiplication overflow while allocating buffers. In these two cases, the final allocation size is the product of three values: one variable and two that are fixed constants at compile time. In this commit, we move the explicit multiplication to involve only the compile-time constants, preventing any overflow from that multiplication, (and allowing calloc to catch any potential overflow from the remainining implicit multiplication). Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-01egl/dri2: use the correct screen indexMarek Olšák2-10/+30
Required for multi-GPU configuration where each GPU has its own X screen.
2014-08-16egl: don't exit process on initialization failureIlia Mirkin1-1/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-14egl_dri2: fix EXT_image_dma_buf_import fdsPekka Paalanen1-31/+6
The EGL_EXT_image_dma_buf_import specification was revised (according to its revision history) on Dec 5th, 2013, for EGL to not take ownership of the file descriptors. Do not close the file descriptors passed in to eglCreateImageKHR with EGL_LINUX_DMA_BUF_EXT target. It is assumed, that the drivers, which ultimately process the file descriptors, do not close or modify them in any way either. This avoids the need to dup(), as it seems we would only need to just close the dup'd file descriptors right after. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76188 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-13android: loader: prefix static libraries with libmesa_*Emil Velikov2-2/+2
Will make it easier on us as CleanSpec.mk comes along and improves consistency across the Android build. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13android: egl/dri2: use the installed libdrm headersEmil Velikov1-1/+1
Trying to get rid of the hardcoded dependency of DRM_TOP which expects that mesa is localted in /external/drm. Will Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13android: drop HAL_PIXEL_FORMAT_RGBA_{5551,4444}Emil Velikov1-4/+0
Upstream Android (system/core) has dropped these formats with commit 6bac41f1bf9(get rid of HAL pixelformats 5551 and 4444) yet does not mention why. These formats never really worked so we're safe to drop them as well. Identical commit is available in the android-x86 external/mesa repo commit 06a2d36edcd1e2247440e5800e6bf3028f37aee6 Author: Chih-Wei Huang <cwhuang@linux.org.tw> Date: Wed Sep 25 01:16:57 2013 +0800 android: get rid of HAL pixelformats 5551 and 4444 Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13android: egl/main: add/enable freedrenoEmil Velikov1-0/+6
For all everyone willing to give the freedreno driver a go they can now build it under Android. Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Cc: Rob Clark <robclark@freedesktop.org> Cc: freedreno@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13android: egl/main: resolve radeon linking issuesPaulo Sergio Travaglia1-4/+9
- link against libdrm_radeon - link the r600 driver against libstlport - linkin the newly added libmesa_pipe_radeon library required by r600 and radeonsi drivers v2: Include pipe_radeon after pipe_r600/radeonsi. Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> [Emil Velikov] Split up and add commit message. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13android: egl/main: fixup the nouveau buildEmil Velikov1-6/+2
For a while the nouveau pipe driver has been a static library and it has been using STL for even longer. Correct add the link and cleanup the gallium_DRIVERS. Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13egl/main: Bring in the Makefile.sourcesEmil Velikov4-75/+47
Rather than having the sources list duplicated across all three build systems, define it once and use it whenever needed. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04egl: Fix OpenGL ES version checks in _eglParseContextAttribList()Anuj Phogat1-1/+4
We would generate EGL_BAD_CONFIG because _eglGetContextAPIBit returns zero for the combination of EGL_OPENGL_ES_API and a major version > 3. By just returning zero, the caller can't tell the difference between a bad version (which should generate EGL_BAD_MATCH) and a bad API (which should generate EGL_BAD_CONFIG). This patch causes us to filter out major versions > 3 at a point where we can generate the correct error. Fixes gles3 Khronos CTS test: egl_create_context.egl_create_context V2: Fix commit message as suggested by Ian. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-30dri: Add a new capabilities for drivers that can't share buffersGiovanni Campagna2-3/+21
The kms-dri swrast driver cannot share buffers using the GEM, so it must tell the loader to disable extensions relying on that, without disabling the image DRI extension altogether (which would prevent the loader from working at all). This requires a new gallium capability (which is queried on the pipe_screen and for swrast drivers it's forwarded to the winsys), and requires a new version of the DRI image extension. [Emil Velikov] - Rebased on top of gallium-dri megadrivers. - Drop PIPE_CAP_BUFFER_SHARE and sw_winsys::get_param hook. The can_share_buffer cap is set at InitScreen. We use a different InitScreen (and thus value for the cap) function for kms_dri, due to deeper differences originating from dri megadrivers. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30Add support for swrast to the DRM EGL platformGiovanni Campagna1-21/+132
Turn GBM into a swrast loader (providing putimage/getimage backed by a dumb KMS buffer). This allows to run KMS+DRM GL applications (such as weston or mutter-wayland) unmodified on cards that don't have any client side HW acceleration component but that can do modeset (examples include simpledrm and qxl) [Emil Velikov] - Fix make check. - Split dri_open_driver() from dri_load_driver(). - Don't try to bind the swrast extensions when using dri. - Handle swrast->CreateNewScreen() failure. - strdup the driver_name, as it's free'd at destruction. - s/LIBGL_ALWAYS_SOFTWARE/GBM_ALWAYS_SOFTWARE/ - Move gbm_dri_bo_map/unmap to gbm_driiint.h. - Correct swrast fallback logic. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-17egl: Remove unused variable dri_driver_path.Matt Turner1-2/+0
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-09egl/dri2: do not leak dri2_dpy->driver_nameEmil Velikov3-3/+8
Originally all hardware drivers duplicate the driver_name string from an external source, while for the software rasterizer we set it to "swrast". Follow the example set by hw drivers this way we can free the string at dri2_terminate(). v2: Use strdup over strndup. Suggested by Ilia Mirkin. v3: Handle platform_drm in a similar manner. Cleanup swrast driver_name in error path. Cc: Chia-I Wu <olv@lunarg.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-09egl/dri2/x11: use standard strndup functionEmil Velikov1-19/+4
Using a custom version of the function brings no benefit. Cc: Chad Versace <chad.versace@linux.intel.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-09android, egl: typo dri2_fallback_pixmap_surface -> ↵Adrian Negreanu1-1/+1
dri2_fallback_create_pixmap_surface I used commit bc8b07a6 as reference, and only the droid_display_vtbl had this issue. This fixes: src/egl/drivers/dri2/platform_android.c:641:29: error: 'dri2_fallback_pixmap_surface' undeclared here (not in a function) Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09android, egl: add correct drm include for libmesa_egl_dri2Adrian Negreanu1-0/+1
Fixes: src/egl/drivers/dri2/platform_android.c:38: include/GL/internal/dri_interface.h:51:17: fatal error: drm.h: No such file or directory Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09android: add libloader to libGLES_mesa and libmesa_egl_dri2Adrian Negreanu2-1/+7
This fixes src/egl/drivers/dri2/platform_android.c:664: error: undefined reference to 'loader_set_logger' src/egl/drivers/dri2/platform_android.c:678: error: undefined reference to 'loader_get_driver_for_fd' Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-03egl: Check for NULL native_window in eglCreateWindowSurfaceSinclair Yeh1-0/+4
We have customers using NULL as a way to test the robustness of the API. Without this check, EGL will segfault trying to dereference dri2_surf->wl_win->private because wl_win is NULL. This fix adds a check and sets EGL_BAD_NATIVE_WINDOW v2: Incorporated feedback from idr - moved the check to a higher level function. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-02egl/main: Fix eglMakeCurrent when releasing context from current thread.Beren Minor1-2/+6
EGL 1.4 Specification says that eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) can be used to release the current thread's ownership on the surfaces and context. MESA's egl implementation was only accepting the parameters when the KHR_surfaceless_context extension is supported. [chadv] Add quote from the EGL 1.4 spec. Cc: "10,1, 10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-29egl_dri2: fix wayland_platform when drm_platform is not setEmil Velikov1-4/+6
The build fails with implicit delaration of drmGetCap (xf86drm.h) Were we're including the header only when building the DRM_PLATFORM. Wayland backend can operate without DRM_PLATFORM so replace the guard, and fold in drmGetCap() usage to silence compiler warnings. Cc: Chad Versace <chad.versace@linux.intel.com> Cc: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-23Fix build for darwinJon TURNEY1-1/+1
Fix build for darwin, when ./configured --disable-driglx-direct - darwin ld doesn't support -Bsymbolic or --version-script, so check if ld supports those options before using them - define GLX_ALIAS_UNSUPPORTED as config/darwin used to, as aliasing of non-weak symbols isn't supported - default to -with-dri-drivers=swrast v2: Use -Wl,-Bsymbolic, as before, not -Bsymbolic Test that ld --version-script works, rather than just looking for it in ld --help Don't use -Wl,--no-undefined on darwin, either Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-20egl: Add EGL_CHROMIUM_sync_control extension.Sarah Sharp11-0/+84
Chromium defined a new GL extension (that isn't registered with Khronos). We need to add an EGL extension for it, so we can migrate ChromeOS on Intel systems to use EGL instead of GLX. http://git.chromium.org/gitweb/?p=chromium/src/third_party/khronos.git;a=commitdiff;h=27cbfdab35c601f70aa150581ad1448d0401f447 The EGL_CHROMIUM_sync_control extension is similar to the GLX extension OML_sync_control, but only defines one function, eglGetSyncValuesCHROMIUM, which is equivalent to glXGetSyncValuesOML. http://www.opengl.org/registry/specs/OML/glx_sync_control.txt Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: Jamey Sharp <jamey@minilop.net> Cc: Ian Romanick <idr@freedesktop.org> Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>
2014-05-20Import eglextchromium.h from Chromium.Sarah Sharp1-0/+1
In order to support the (currently unregistered) Chromium-specific EGL extension eglGetSyncValuesCHROMIUM on Intel systems, we need to import the Chromium header that defines it. The file was downloaded from https://chromium.googlesource.com/chromium/chromium/+/trunk/ui/gl/EGL/eglextchromium.h It is subject to the license found at https://chromium.googlesource.com/chromium/chromium/+/trunk/LICENSE I have imported the header file and added the license text to the top. The only change was to fix the include guard on the Chromium header to change the last line from a #define to a #endif, which makes the header actually compile. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Cc: Jamey Sharp <jamey@minilop.net> Cc: Ian Romanick <idr@freedesktop.org> Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>