summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* egl/dri2: Log a warning if no platforms are enabled.Matt Turner2014-12-041-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 <[email protected]>
* egl: remove egl_gallium from the loaderMarek Olšák2014-11-141-14/+0
| | | | | | Acked-by: Kristian Høgsberg <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Informally acked-by: Jose Fonseca
* egl_dri2: add a note about dri2_create_screenEmil Velikov2014-11-071-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 <[email protected]> Reviewed-and-tested-by: Kenneth Graunke <[email protected]> (v1)
* egl_dri2: fix double free on drm platformsEmil Velikov2014-11-071-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 <[email protected]> Reported-by: Mark Janes <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-and-tested-by: Kenneth Graunke <[email protected]> (v1)
* egl_dri2: do not leak dri2_dpy->driver_configsEmil Velikov2014-11-061-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 <[email protected]>
* egl/drm: do not crash when swapping buffers without any renderingLionel Landwerlin2014-10-271-0/+8
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* util: Include in Android buildsTomasz Figa2014-10-031-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 <[email protected]> CC: <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: setup screen iterator before using itTapani Pälli2014-09-291-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 <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]>
* configure: drop --with-egl-driver-dir switchEmil Velikov2014-09-271-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 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: extra null checks for get_xcb_screen() return valuesJuha-Pekka Heikkila2014-09-231-6/+24
| | | | | | | verify get_xcb_screen() returned pointer before using it. Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* egl/drm: expose KHR_image_pixmap extensionAndreas Pokorny2014-09-231-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 <[email protected]> Signed-off-by: Andreas Pokorny <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* egl: Restrict multiplication in calloc arguments to use compile-time constantsCarl Worth2014-09-032-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 <[email protected]>
* egl/dri2: use the correct screen indexMarek Olšák2014-09-012-10/+30
| | | | Required for multi-GPU configuration where each GPU has its own X screen.
* egl: don't exit process on initialization failureIlia Mirkin2014-08-161-1/+1
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* egl_dri2: fix EXT_image_dma_buf_import fdsPekka Paalanen2014-08-141-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 <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* android: loader: prefix static libraries with libmesa_*Emil Velikov2014-08-132-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 <[email protected]>
* android: egl/dri2: use the installed libdrm headersEmil Velikov2014-08-131-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 <[email protected]>
* android: drop HAL_PIXEL_FORMAT_RGBA_{5551,4444}Emil Velikov2014-08-131-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 <[email protected]> Date: Wed Sep 25 01:16:57 2013 +0800 android: get rid of HAL pixelformats 5551 and 4444 Cc: "10.1 10.2" <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* android: egl/main: add/enable freedrenoEmil Velikov2014-08-131-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" <[email protected]> Cc: Rob Clark <[email protected]> Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]>
* android: egl/main: resolve radeon linking issuesPaulo Sergio Travaglia2014-08-131-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" <[email protected]> [Emil Velikov] Split up and add commit message. Signed-off-by: Emil Velikov <[email protected]>
* android: egl/main: fixup the nouveau buildEmil Velikov2014-08-131-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" <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl/main: Bring in the Makefile.sourcesEmil Velikov2014-08-134-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 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: Fix OpenGL ES version checks in _eglParseContextAttribList()Anuj Phogat2014-08-041-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: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* dri: Add a new capabilities for drivers that can't share buffersGiovanni Campagna2014-07-302-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 <[email protected]>
* Add support for swrast to the DRM EGL platformGiovanni Campagna2014-07-301-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 <[email protected]>
* egl: Remove unused variable dri_driver_path.Matt Turner2014-06-171-2/+0
| | | | | Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* egl/dri2: do not leak dri2_dpy->driver_nameEmil Velikov2014-06-093-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 <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl/dri2/x11: use standard strndup functionEmil Velikov2014-06-091-19/+4
| | | | | | | Using a custom version of the function brings no benefit. Cc: Chad Versace <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* android, egl: typo dri2_fallback_pixmap_surface -> ↵Adrian Negreanu2014-06-091-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" <[email protected]> Signed-off-by: Adrian Negreanu <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]>
* android, egl: add correct drm include for libmesa_egl_dri2Adrian Negreanu2014-06-091-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" <[email protected]> Signed-off-by: Adrian Negreanu <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]>
* android: add libloader to libGLES_mesa and libmesa_egl_dri2Adrian Negreanu2014-06-092-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" <[email protected]> Signed-off-by: Adrian Negreanu <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]>
* egl: Check for NULL native_window in eglCreateWindowSurfaceSinclair Yeh2014-06-031-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 <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "10.1 10.2" <[email protected]>
* egl/main: Fix eglMakeCurrent when releasing context from current thread.Beren Minor2014-06-021-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" <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl_dri2: fix wayland_platform when drm_platform is not setEmil Velikov2014-05-291-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 <[email protected]> Cc: Kristian Høgsberg <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* Fix build for darwinJon TURNEY2014-05-231-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 <[email protected]> Reviewed-by: Jeremy Huddleston Sequoia <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Add EGL_CHROMIUM_sync_control extension.Sarah Sharp2014-05-2011-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 <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: Jamey Sharp <[email protected]> Cc: Ian Romanick <[email protected]> Cc: Stéphane Marchesin <[email protected]>
* Import eglextchromium.h from Chromium.Sarah Sharp2014-05-201-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 <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: Jamey Sharp <[email protected]> Cc: Ian Romanick <[email protected]> Cc: Stéphane Marchesin <[email protected]>
* wayland: Move version 2 request to end of interface specificationKristian Høgsberg2014-05-121-16/+19
| | | | | | | | | | We're moving towards requiring interface additions to be appended to the end of the interface block. No functional change, opcodes are assigned as before, but version 2 additions are now grouped together, which prevents a scanner warning. Cc: "10.2" <[email protected]> Signed-off-by: Kristian Høgsberg <[email protected]>
* egl_dri2: cleanup memory leak in dri2_create_context()Emil Velikov2014-05-101-2/+3
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: Don't attempt to redefine stdint.h types with VS 2010.José Fonseca2014-05-021-1/+2
| | | | | | | Just include stdint.h. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* egl_dri: rework dri extension handlingEmil Velikov2014-04-282-11/+12
| | | | | | | | | | | Use designated initialisers, and store the extensions pointers as const. The loader extensions __DRIdri2LoaderExtension and __DRIswrastLoaderExtension are setup by the platform backends so they should not be constified. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* dri_interface: Update __DRItexBufferExtensionRec to version 3Emil Velikov2014-04-283-6/+21
| | | | | | | | | | | | | | | | | | | | With commit e59fa4c46c8("dri2: release texture image.") we updated the extension without bumping the version number. The patch itself added an interface required to enable texture_from_pixmap on certain platforms. The new code was effectively never build, as it depended on __DRI_TEX_BUFFER_VERSION >= 3, which never came to be in upstream mesa. This commit bumps the version number, drops the __DRI_TEX_BUFFER_VERSION checks and resolves all the build conflicts. Additionally it add a version check as egl and dri3, as require version 2 of the extension which does not have the releaseTexBuffer hook. Cc: Juan Zhao <[email protected]> Cc: Kristian Høgsberg <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* egl: Protect use of gbm_dri with ifdef HAVE_DRM_PLATFORMAnder Conselvan de Oliveira2014-04-251-0/+2
| | | | | | | Otherwise it fails to compile if the drm egl platform is disabled. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* wayland: Fix the logic in disabling the prime capabilityNeil Roberts2014-04-251-1/+1
| | | | | | | | | | It looks like this bit of code is trying to disable the prime capability if the driver doesn't support createImageFromFds. However the logic looks a bit broken and what it would actually do is disable all other capabilities apart from prime. This patch fixes it to actually disable prime. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/build: Sort egl sources alphabetically.Matt Turner2014-04-071-15/+15
| | | | Acked-by: Emil Velikov <[email protected]>
* egl/build: Remove unused -DXF86VIDMODE.Matt Turner2014-04-071-4/+0
| | | | Acked-by: Emil Velikov <[email protected]>
* egl/build: Include headers and XML in distribution.Matt Turner2014-04-073-2/+11
| | | | Acked-by: Emil Velikov <[email protected]>
* egl/build: Drop two unnecessary Makefiles.Matt Turner2014-04-072-50/+0
| | | | Acked-by: Emil Velikov <[email protected]>
* egl/dri2: use drm macros to construct device nameJonathan Gray2014-04-051-1/+6
| | | | | | | | | | | | | | Don't hardcode /dev/dri/card0 but instead use the drm macros which allows the correct /dev/drm0 device to be opened on OpenBSD. v2: use snprintf and fallback to /dev/dri/card0 v3: check for snprintf truncation Signed-off-by: Jonathan Gray <[email protected]> Cc: "10.1" <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl/dri2: don't require libudev to build drm/wayland platformsJonathan Gray2014-04-051-2/+0
| | | | | | | | | | | | After the loader changes libudev is no longer required to build gbm or the egl drm/wayland platforms. Remove a libudev ifdef which allows the the drm egl driver to be loaded on OpenBSD. Signed-off-by: Jonathan Gray <[email protected]> Cc: "10.1" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>