summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* egl: android: do not feed invalid fourcc/pitch into the dri moduleEmil Velikov2016-05-011-8/+22
| | | | Signed-off-by: Emil Velikov <[email protected]>
* egl: android: add dma-buf fd supportRob Herring2016-05-011-7/+117
| | | | | | | | | | | | | | | | | | Add support for creating images from Android native buffers with dma-buf fd. As dma-buf support also requires DRI image loader extension, add that as well. This is based on several originally patches written by Varad Gautam. I've collapsed them into logical changes and done a bit of reformatting. Using dma-bufs vs. GEM handles is now a runtime decision similar to the wayland EGL instead of being compile time selection. The dma-buf support is also re-written to use common dri2_create_image_dma_buf function in egl_dri2.c. Cc: Varad Gautam <[email protected]> Cc: Rob Clark <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: android: factor out back buffer handling codeRob Herring2016-05-011-13/+23
| | | | | | | | In preparation to use the same code for dma-bufs, factor out the code to a separate function. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: android: factor out format conversion code to a functionRob Herring2016-05-011-24/+15
| | | | | Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: android: disable __DRI_DRI2_LOADER support on render nodesRob Herring2016-05-012-12/+22
| | | | | | | | | | | | Use of __DRI_DRI2_LOADER extension is only supported for card nodes. In order to support dmabufs, Android will be moving to using render nodes and we need to disable the DRI2 loader extension. This is based on the Wayland EGL code. Cc: Rob Clark <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* automake: drop "EGL_" from HAVE_EGL_PLATFORM_WAYLANDEmil Velikov2016-05-011-1/+1
| | | | | | Analogous to previous commit. Signed-off-by: Emil Velikov <[email protected]>
* automake: drop "EGL_" from HAVE_EGL_PLATFORM_X11Emil Velikov2016-05-011-1/+1
| | | | | | | The variable covers more than just EGL, let's try to untangle the confusion it brings. Signed-off-by: Emil Velikov <[email protected]>
* egl/x11: resolve "initialization from incompatible pointer type" warningMark Kettenis2016-05-011-2/+10
| | | | | | | | | | | | | | | | | With earlier commit we've moved a few functions and changing the argument type from _EGLDisplay * to struct dri2_egl_display *. The latter is effectively a wrapper around the former, thus functionality was preserved, although GCC rightfully warned us about the misuse. Add a simple wrapper that casts and propagates the correct type. Fixes: 9bbf3737f9c ("egl/x11: authenticate before doing chipset id ioctls") Cc: "11.2 11.1" <[email protected]> Reported-by: Matt Turner <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl: Remove every double semi-colonJakob Sinclair2016-04-262-2/+2
| | | | | | | | Removes all accidental semi-colons in egl. Signed-off-by: Jakob Sinclair <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: fix make check broken by interop supportMarek Olšák2016-04-261-0/+2
|
* egl/x11: authenticate before doing chipset id ioctlsJonathan Gray2016-04-211-54/+56
| | | | | | | | | | | | | | For systems without udev or sysfs that use drm ioctls in the loader drm authentication must take place earlier or the loader will fail "MESA-LOADER: failed to get param for i915". Patch from Mark Kettenis. Cc: "11.2 11.1" <[email protected]> Signed-off-by: Mark Kettenis <[email protected]> Signed-off-by: Jonathan Gray <[email protected]> [Emil Velikov: remove gratuitous white-space] Reviewed-by: Emil Velikov <[email protected]>
* egl: implement EGL part of interop interface (v2)Marek Olšák2016-04-204-0/+114
| | | | v2: - use const
* egl: add EGL_KHR_reusable_sync to egl_driDongwon Kim2016-04-054-8/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables an EGL extension, EGL_KHR_reusable_sync. This new extension basically provides a way for multiple APIs or threads to be excuted synchronously via a "reusable sync" primitive shared by those threads/API calls. This was implemented based on the specification at https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_reusable_sync.txt v2 - use thread functions defined in C11/threads.h instead of using direct pthread calls - make the timeout set with reference to CLOCK_MONOTONIC - cleaned up the way expiration time is calculated - (bug fix) in dri2_client_wait_sync, case EGL_SYNC_CL_EVENT_KHR has been added. - (bug fix) in dri2_destroy_sync, return from cond_broadcast call is now stored in 'err' intead of 'ret' to prevent 'ret' from being reset to 'EGL_FALSE' even in successful case - corrected minor syntax problems v3 - dri2_egl_unref_sync now became 'void' type. No more error check is needed for this function call as a result. - (bug fix) resolved issue with duplicated unlocking of display in eglClientWaitSync when type of sync is "EGL_KHR_REUSABLE_SYNC" Signed-off-by: Dongwon Kim <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* egl: android: enable EGL_FRAMEBUFFER_TARGET_ANDROID and EGL_RECORDABLE_ANDROIDRob Herring2016-04-011-0/+4
| | | | | | | | | | | | | | | | | | | Set EGL_FRAMEBUFFER_TARGET_ANDROID and EGL_RECORDABLE_ANDROID config attributes to true for Android. These are required in Marshmallow. The implementation of EGL_RECORDABLE_ANDROID support has 2 options in the definition of the extension. Android implements the 2nd option which is the encoder must support RGB input. The requested input format is RGB888, so setting the attribute on all the native Android visual formats should be sufficient. Similarly, setting EGL_FRAMEBUFFER_TARGET_ANDROID for all configs with a EGL_NATIVE_VISUAL_ID should be sufficient. Most likely, the HWC should support the same set of formats the underlying DRM driver supports. Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Add EGL_RECORDABLE_ANDROID attributeRob Herring2016-04-014-0/+9
| | | | | | | | | | This is used by Android to select an eglconfig compatible with screen recording. Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> [Emil Velikov: add the _eglIsConfigAttribValid check] Signed-off-by: Emil Velikov <[email protected]>
* egl: Add EGL_FRAMEBUFFER_TARGET_ANDROID attributeRob Herring2016-04-014-1/+10
| | | | | | | | | This is used by Android to select an eglconfig compatible with HWComposer. Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> [Emil Velikov: add the _eglIsConfigAttribValid check] Signed-off-by: Emil Velikov <[email protected]>
* egl: support EGL_LARGEST_PBUFFER in eglCreatePbufferSurface(...)Daniel Czarnowski2016-03-183-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Patch provides a default for a set pbuffer surface size when EGL_LARGEST_PBUFFER is used by the client. MIN2 macro is moved to egldefines so that it can be shared. Fixes following Piglit test: egl-create-largest-pbuffer-surface From EGL 1.5 spec: "Use EGL_LARGEST_PBUFFER to get the largest available pbuffer when the allocation of the pbuffer would otherwise fail." Currently there exists no API to query largest available pixmap size using xlib or xcb so right now this seems most straightforward way to ensure that we fulfill above API and also we don't attempt to allocate 'too big' pixmap which might succeed on server side but not work in practice when driver starts to use it as a texture. v2: add more explanation about the change (Emil) Signed-off-by: Matt Roper <[email protected]> Cc: "11.0 11.1" <[email protected] Reviewed-by: Emil Velikov <[email protected]>
* egl: clean up typedef madness in the backend APIMarek Olšák2016-03-102-155/+155
| | | | | | let's use the dd.h format Reviewed-by: Emil Velikov <[email protected]>
* egl/x11: check the return value of xcb_dri2_get_buffers_reply()Emil Velikov2016-03-091-0/+3
| | | | | | | | | | | ... before using it. The function can return NULL, which we should check prior to refererencing it in the next function(s). Cc: Fabian Vogt <[email protected]> Cc: "11.1 11.2" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93667 Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* egl: remove remnants of MESA_drm_displayEmil Velikov2016-03-092-10/+0
| | | | | | | Last set in st/egl, unused in mesa-demos and superseded by EGL_KHR_platform_gbm. Signed-off-by: Emil Velikov <[email protected]>
* egl: remove final pieces of KHR_vg_parent_imageEmil Velikov2016-03-092-2/+0
| | | | | | Similar to previous commit - unused/unset for a long time. Signed-off-by: Emil Velikov <[email protected]>
* egl/wayland: do not wrap header inclusion in extern "C"Emil Velikov2016-03-091-4/+4
| | | | Signed-off-by: Emil Velikov <[email protected]>
* dri: add backbuffer use flagAxel Davy2016-03-091-3/+5
| | | | | | This will be used by the next commit. Reviewed-by: Ian Romanick <[email protected]>
* Android: clean-up and fix DRI module path handlingRob Herring2016-02-291-3/+3
| | | | | | | | | | | | | | | MESA_DRI_MODULE_PATH is only getting set for classic DRI drivers and may or may not be set correctly for gallium_dri.so depending on the makefile include ordering. For Android 6 and earlier it is fine, but with build system changes in AOSP master, it is not. Move the path variables to a single place at the top level and introduce MESA_DRI_MODULE_REL_PATH for Android 5 and later which require relative paths. With this, there is a single variable to change. Cc: "11.1 11.2" <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: Try to use wl_surface.damage_buffer for SwapBuffersWithDamageDerek Foreman2016-02-261-3/+36
| | | | | | | | | | | | | | | | | Since commit d1314de293e9e4a63c35f094c3893aaaed8580b4 we ignore damage passed to SwapBuffersWithDamage. Wayland 1.10 now has functionality that allows us to properly process those damage rectangles, and a way to query if it's available. Now we can use wl_surface.damage_buffer and interpret the incoming damage as being in buffer co-ordinates. Cc: "11.1 11.2" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Pekka Paalanen <[email protected]> Signed-off-by: Derek Foreman <[email protected]>
* egl_dri2: set correct error code if swapbuffers failsDaniel Czarnowski2016-02-191-1/+6
| | | | | | | | | | | A return value of '-1' means that there was error during swap with a window drawable, in this case we set error as EGL_BAD_NATIVE_WINDOW. v2: coding style cleanup, better commit message Signed-off-by: Matt Roper <[email protected]> Cc: "11.0 11.1" <[email protected] Reviewed-by: Emil Velikov <[email protected]>
* egl: move Null check to eglGetSyncAttribKHR to prevent SegfaultDongwon Kim2016-02-192-5/+8
| | | | | | | | | | | | | | Null-check on "*value" is currently done in _eglGetSyncAttrib, which is after eglGetSyncAttribKHR dereferences it. Move the check a layer up (in the beginning of eglGetSyncAttribKHR) to avoid segfaults. Cc: "11.0 11.1" <[email protected] Signed-off-by: Dongwon Kim <[email protected]> Reviewed-by: Marek Olšák <[email protected]> [Emil Velikov: tweak commit message, add stable tag] Reviewed-by: Emil Velikov <[email protected]>
* Android: enable building on arm64Rob Herring2016-02-181-3/+2
| | | | | | | | | Use the LOCAL_CFLAGS_{32/64} instead of arch specific variants to define the DEFAULT_DRIVER_DIR. This enables building for arm64. Cc: Chih-Wei Huang <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: android: clean-up config attribute settingRob Herring2016-02-181-3/+9
| | | | | | | | Pass the additional config attributes to dri2_add_config to set them instead of open coding them. This is in preparation to add more attributes. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: android: fix visuals declarationVarad Gautam2016-02-181-1/+1
| | | | | Signed-off-by: Varad Gautam <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl_dri2: NULL check for xcb_dri2_get_buffers_reply()Daniel Czarnowski2016-02-151-0/+2
| | | | | | | | | Without the check, unsuccessful xcb_dri2_get_buffers_reply(...) causes segmentation fault in dri2_get_buffers. Signed-off-by: Matt Roper <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Cc: "11.0 11.1" <[email protected]
* egl/dri2: expose srgb configs when KHR_gl_colorspace is availableEmil Velikov2016-01-221-0/+2
| | | | | | | | | | | | | | | Otherwise the user has no way of using it, and we'll try to access the linear one. v2: - Bail out when KHR_gl_colorspace is missing and srgb is set (Marek) Cc: Chih-Wei Huang <[email protected]> Cc: "11.0 11.1" <[email protected]> Fixes: c2c2e9ab604(egl: implement EGL_KHR_gl_colorspace (v2)) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91596 Signed-off-by: Emil Velikov <[email protected]> Tested-by: Mauro Rossi <[email protected]>
* egl: don't forget to ship platform_x11_dri3.h into the tarballEmil Velikov2015-11-201-1/+3
| | | | | | Should have been a part of f35198badeb Signed-off-by: Emil Velikov <[email protected]>
* automake: egl: add symbols testEmil Velikov2015-11-202-0/+58
| | | | | | | | | | Should help us catch issues where we expose any extra symbols by mistake. Just like the ones fixes with previous commit. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Kai Wasserbäch <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Acked-by: Matt Turner <[email protected]>
* egl: make it clear which platform x11 backend is being used (dri2 or 3)Martin Peres2015-11-173-9/+13
| | | | | | | Signed-off-by: Martin Peres <[email protected]> Reviewed-by: Boyan Ding <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/x11_dri3: Implement EGL_KHR_image_pixmapBoyan Ding2015-11-172-1/+78
| | | | | | | | | | | | | v2: from Martin Peres - Replace a tab with spaces v3: from Martin Peres - disable EGL_KHR_image_pixmap when is_different_gpu is set (Axel Davy) Signed-off-by: Boyan Ding <[email protected]> Reviewed-by: Martin Peres <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/x11: Implement dri3 support with loader's dri3 helperBoyan Ding2015-11-176-15/+705
| | | | | | | | | | | | | | | | | | | | | | | | | | | | v2: From Martin Peres - Tell we are compiling the dri3 backend in configure.ac - Update the Makefile.am - get rid of the LIBDRM_HAS_RENDERNODE_SUPPORT macro - fix some warnings related to EGLuint64KHR to int64_t conversions - use dri2_get_dri_config to get the __DRIconfig instead of open-coding it - replace the occasional tabs with spaces v3: From Martin Peres - fix and indent problem (Matt Turner) - drop the authenticate function, use NULL in the vtable instead (Emil) - drop some useless includes (Emil Velikov) - mandate libdrm (Emil Velikov) - link to xcb-dri3 (Kristian Høgsberg) - convert to the new loader interface for drwable (Kristian) - remove some dead code after the dropping of some vfuncs (Kristian) - add a comment on the topic of rendering to the frontbuffer v4: From Martin Peres - do not expose the preserved swap behavior (Acked by Eric Anholt) Signed-off-by: Boyan Ding <[email protected]> Signed-off-by: Martin Peres <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl_dri2: Add a function to let platform code return dri drawable from ↵Boyan Ding2015-11-176-19/+38
| | | | | | | | | | | | | | | | | | _EGLSurface dri3 for EGL will use different struct other than dri2_egl_surface for an EGL surface, the common code only uses __DRIdrawable from that struct, so instead of converting _EGLSurface to dri2_egl_surface, let the platform code return the __DRIdrawable by its own (although the current platforms use the same function). v2: From Martin Peres - convert to the new drawable interface (Kristian) Signed-off-by: Boyan Ding <[email protected]> Signed-off-by: Martin Peres <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: Ignore rects from SwapBuffersWithDamageDaniel Stone2015-11-131-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eglSwapBuffersWithDamage accepts damage-region rectangles to hint the compositor that it only needs to redraw certain areas, which was passed through the wl_surface_damage request, as designed. Wayland also offers a buffer transformation interface, e.g. to allow users to render pre-rotated buffers. Unfortunately, there is no way to query buffer transforms, and the damage region was provided in surface, rather than buffer, co-ordinate space. Users could in theory account for this themselves, but EGL also requires co-ordinates to be passed in GL/mathematical co-ordinate space, with an inversion to Wayland's natural/scanout co-ordinate space, so transformations other than a 180-degree rotation will fail as EGL attempts to subtract the region from (its view of the) surface height. Pending creation and acceptance of a wl_surface.buffer_damage request, which will accept co-ordinates in buffer co-ordinate space, pessimise to always sending full-surface damage. bce64c6c provides the explanation for why we send maximum-range damage, rather than the full size of the surface: in the presence of buffer transformations, full-surface damage may not actually cover the entire surface. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Pekka Paalanen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* egl/dri2: Properly dereference array.Matt Turner2015-10-071-3/+3
| | | | | | | | | | Fixes a regression that broke EGL since commit 858f2f2ae6d72f338fdd6d544b0c733814e22724 Author: Emil Velikov <[email protected]> Date: Sun Sep 13 12:25:27 2015 +0100 egl/dri2: ease srgb __DRIconfig conditionals
* egl/dri2: enable EGL_KHR_gl_colorspace for swrastEmil Velikov2015-10-073-16/+19
| | | | | | | | | | No driver changes needed for softpipe/llvmpipe - things just work. v2: Whitespace fixes. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Boyan Ding <[email protected]> Acked-by: Alex Deucher <[email protected]>
* egl/dri2: ease srgb __DRIconfig conditionalsEmil Velikov2015-10-072-29/+14
| | | | | | | | One can simplify the if-else chain, by declaring the driconfigs as a two sized array, whist using srgb as a index to the correct entry. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Alex Deucher <[email protected]>
* egl: move memcpy to bring conf->base operations togetherVarad Gautam2015-10-071-1/+1
| | | | | | Signed-off-by: Varad Gautam <[email protected]> Suggested-by: Emil Velikov <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: restore surface type before linking config to its displayVarad Gautam2015-10-071-0/+2
| | | | | | | | | | | | | | commit c2c2e9a (egl: implement EGL_KHR_gl_colorspace (v2)) leaves _EGLConfig->SurfaceType set incorrectly before calling _eglLinkConfig(), and the bad value is passed around to platform_android. set it to zero as earlier. v2: Set SurfaceType to 0, rather than surface_type (Suggested by Emil) Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91596 Signed-off-by: Varad Gautam <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/dri2: don't require a context for ClientWaitSync (v2)Marek Olšák2015-10-031-2/+7
| | | | | | | | | | | The spec doesn't require it. This fixes a crash on Android. v2: don't set any flags if ctx == NULL v3: add the spec note Cc: 10.6 11.0 <[email protected]> Reviewed-by: Albert Freeman <[email protected]> Reviewed-by: Frank Binns <[email protected]>
* egl: rework handling EGL_CONTEXT_FLAGSMatthew Waters2015-10-031-5/+44
| | | | | | | | | | | | | | | | | | As of version 15 of the EGL_KHR_create_context spec, debug contexts are allowed for ES contexts. We should allow creation instead of erroring. While we're here provide a more comprehensive checking for the other two flags - ROBUST_ACCESS_BIT_KHR and FORWARD_COMPATIBLE_BIT_KHR v2 [Emil Velikov] Rebase. Minor tweak in commit message. Cc: Boyan Ding <[email protected]> Cc: Chad Versace <[email protected]> Cc: "10.6 11.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91044 Signed-off-by: Matthew Waters <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl: Fix missing Haiku include pathAlexander von Gluck IV2015-09-281-0/+1
|
* wayland: Add copyright notice for wayland-egl.cKristian Høgsberg Kristensen2015-09-241-0/+29
| | | | Signed-off-by: Kristian Høgsberg Kristensen <[email protected]>
* egl/dri2: don't leak the fd on dri2_terminateEmil Velikov2015-09-153-1/+3
| | | | | | | | | | Currently the check was incorrect as it did not consider the (unlikely) case of fd == 0. In order to fix this we should first correctly initialize it to -1, as the swrast implementations leave it set to zero (props to calloc()). Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Boyan Ding <[email protected]>
* egl/dri2/drm: compact existing device mgmtEmil Velikov2015-09-151-6/+4
| | | | | | | | | Move the fcntl(dupfd_cloexec) to the else branch where it belongs. Otherwise it's not immediately obvious that the code is hit, only when an existing device is used. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Boyan Ding <[email protected]>