summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* egl/main: replace INLINE with inlineEmil Velikov2015-03-0515-68/+82
| | | | | | | | | | Drop the custom keyword in favour of the C99 one. All the places using it now directly include c99_compat.h which should handle things on platforms which lack it. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* egl: Take alpha bits into account when selecting GBM formatsDaniel Stone2015-03-041-5/+11
| | | | | | | | | | | | This fixes piglit when using PIGLIT_PLATFORM=gbm Tom Stellard: - Fix ARGB2101010 format Cc: "10.4 10.5" <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* scons: Use -Werror MSVC compatibility flags per-directory.Jose Fonseca2015-03-041-0/+2
| | | | | | Matching what we already do with autotools builds. Reviewed-by: Brian Paul <[email protected]>
* st/egl: Remove.Jose Fonseca2015-03-043-9/+8
| | | | | | | | | | | | | | | | | | Largely superseeded by src/egl, and WGL/GLX_EXT_create_context_es_profile extensions. Note this will break Android.mk with gallium drivers -- somebody familiar with that build infrastructure will need to update it to use gallium drivers through egl_dri2. v2: Remove the _EGL_BUILT_IN_DRIVER_GALLIUM define from src/egl/main/Android.mk; and update the src/egl/main/Sconscript to create a SharedLibrary, add versioning, create symlink - copy the bits from egl-static, per Emil Velikov. Reviewed-by: Emil Velikov <[email protected]> v3: Disallow undefined symbols in libEGL.so. Update release notes
* configure: Leverage gcc warn options to enable safe use of C99 features ↵Jose Fonseca2015-03-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | where possible. The main objective of this change is to enable Linux developers to use more of C99 throughout Mesa, with confidence that the portions that need to be built with MSVC -- and only those portions --, stay portable. This is achieved by using the appropriate -Werror= options only on the places they need to be used. Unfortunately we still need MSVC 2008 on a few portions of the code (namely llvmpipe and its dependencies). I hope to eventually eliminate this so that we can use C99 everywhere, but there are technical/logistic challenges (specifically, newer Windows SDKs no longer bundle MSVC, instead require a full installation of Visual Studio, and that has hindered adoption of newer MSVC versions on our build processes.) Thankfully we have more directy control over our OpenGL driver, which is why we're now able to migrate to MSVC 2013 for most of the tree. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "configure: Leverage gcc warn options to enable safe use of C99 ↵Kenneth Graunke2015-02-271-1/+0
| | | | | | | | | features where possible." This reverts commit 79daa510c7a871a33797308a2ccb4b83a067ffbe. I apparently hadn't done a clean build when testing this; it broke the build for Tom, Ben, and myself. We like the idea; let's try a v2.
* configure: Leverage gcc warn options to enable safe use of C99 features ↵Jose Fonseca2015-02-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | where possible. The main objective of this change is to enable Linux developers to use more of C99 throughout Mesa, with confidence that the portions that need to be built with MSVC -- and only those portions --, stay portable. This is achieved by using the appropriate -Werror= options only on the places they need to be used. Unfortunately we still need MSVC 2008 on a few portions of the code (namely llvmpipe and its dependencies). I hope to eventually eliminate this so that we can use C99 everywhere, but there are technical/logistic challenges (specifically, newer Windows SDKs no longer bundle MSVC, instead require a full installation of Visual Studio, and that has hindered adoption of newer MSVC versions on our build processes.) Thankfully we have more directy control over our OpenGL driver, which is why we're now able to migrate to MSVC 2013 for most of the tree. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl, wayland: RGB565 format support on Back-bufferVivek Kasireddy2015-02-231-3/+38
| | | | | | | | | | | | | | | | | | | | | | In current code, color format is always hardcoded to __DRI_IMAGE_FORMAT_ARGB8888 when buffer or DRI image is allocated in function calls, get_back_bo and dri2_get_buffers, regardless of current target's color format. This problem may leads to incorrect render pitch calculation, which eventually ends up with wrong offset of pixels in the frame buffer when the image is in different color format from dri surf's, especially with different bpp. (e.g. RGB565-16bpp) Attached code patch simply adds RGB565 and XRGB8888 cases to two functions noted above to resolve the issue. v2: added a case of XRGB8888, format and bpp selection is done via switch-case (not "if-else" anymore) Signed-off-by: Vivek Kasireddy <[email protected]> Signed-off-by: Dongwon Kim <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Cc: "10.5" <[email protected]>
* egl: Soften several HAVE_DRM_PLATFORM to HAVE_LIBDRMAxel Davy2015-02-121-7/+7
| | | | | | | | | | | | | | | | | | | | | To fix build when libdrm is not found, commit a594cec7e3ef275c386054127a357110a19dd823 did put several parts of egl code under #ifdef HAVE_DRM_PLATFORM. HAVE_DRM_PLATFORM means the egl drm platform is being built. What should have been used instead is HAVE_LIBDRM. At a few locations, the HAVE_DRM_PLATFORM introduced have already been replaced by HAVE_LIBDRM, this patch replaces the remaining occurences. This patch makes for example EGL_EXT_image_dma_buf_import be advertised by egl under x11 when the drm egl platform is not built, whereas previously it required the drm egl platform to be built. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Pass the correct X visual depth to xcb_put_image().José Fonseca2015-01-311-11/+13
| | | | | | | | | | The dri2_x11_add_configs_for_visuals() function happily matches a 32 bits EGLconfig with a 24 bits X visual. However it was passing 32bits depth to xcb_put_image(), making X server unhappy: https://github.com/apitrace/apitrace/issues/313#issuecomment-70571911 Cc: "10.4" <[email protected]>
* egl/wayland: Fix unused variable warningsChad Versace2015-01-131-2/+0
| | | | Remove ctx variables unused as of 70e8ccc459.
* egl: Inform the client API when ancillary buffers may become undefined.Eric Anholt2015-01-066-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 <[email protected]>
* egl: Fix non-dri SCons builds re #87657Alexander von Gluck IV2014-12-251-10/+7
| | | | | * Revert change to egl main producing Shared Libraries * Check for dri before including dri code
* egl/haiku: Clean up SConscript whitespaceAlexander von Gluck IV2014-12-231-13/+12
|
* egl/dri2: Fix build of dri2 egl driver with SConsAlexander von Gluck IV2014-12-231-0/+40
| | | | | * egl/dri2 was missing a SConscript * Problem caught by Adrián Arroyo Calle
* egl: Clean up Haiku visual creationAlexander von Gluck IV2014-12-231-49/+47
| | | | | | * Only create one struct * 'final' also is a language conflict * Some style cleanup
* egl: Add Haiku code and supportAlexander von Gluck IV2014-12-237-3/+509
| | | | | | | * This is the cleaned up work of the Haiku GCI student Adrián Arroyo Calle [email protected] * Several patches were consolidated to prevent unnecessary touching of non-related code
* egl: remove support for GCC older than 4.1.0Timothy Arceri2014-12-171-1/+1
| | | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-By: Jose Fonseca <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: Add files to distribution.Matt Turner2014-12-121-0/+5
|
* egl+gbm: Add symbols-check tests to distribution.Matt Turner2014-12-121-0/+1
|
* egl/dri2: Add headers to distribution.Matt Turner2014-12-121-1/+2
|
* egl: Drop unnecessary Makefile.am.Matt Turner2014-12-121-1/+0
|
* Use calloc instead of malloc/memset-0Matt Turner2014-12-081-2/+1
| | | | | | | See commit 6bda027e for the Coccinelle script. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* egl: Expose EGL_KHR_get_all_proc_addresses and its client extensionChad Versace2014-12-075-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 <[email protected]>
* 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]>