summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* egl: Account for default values of texture target and formatPlamena Manolova2016-06-021-0/+6
| | | | | | | | | | When validating attributes during surface creation we should account for the default values of texture target and format (EGL_NO_TEXTURE) since the user is not obligated to explicitly set both via the attribute list passed to eglCreatePbufferSurface. Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* egl: Check if API is supported when using eglBindAPI.Plamena Manolova2016-06-024-10/+72
| | | | | | | | | According to the EGL specifications before binding an API we must check whether it's supported first. If not eglBindAPI should return EGL_FALSE and generate a EGL_BAD_PARAMETER error. Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa_glinterop: remove mesa_glinterop typedefsEmil Velikov2016-05-303-12/+12
| | | | | | | | | | | | | | | | As is there are two places that do the typedefs - dri_interface.h and this header. As we cannot include the former in here, just drop the typedefs and use the struct directly (as needed). This is required because typedef redefinition is C11 feature which is not supported on all the versions of GCC used to build mesa. v2: Kill the typedef alltogether, as per Marek. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96236 Cc: Vinson Lee <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl/dri3: don't crash on no context.Dave Airlie2016-05-301-2/+4
| | | | | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94925 Pointed out by Karol Herbst on irc. Signed-off-by: Dave Airlie <[email protected]> Cc: "11.1 11.2" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: Additional attribute validation for eglCreatePbufferSurfacePlamena Manolova2016-05-261-0/+13
| | | | | | | | | | | | | eglCreatePbufferSurface should generate an EGL_BAD_MATCH error if: 1: The EGL_TEXTURE_FORMAT attribute is EGL_NO_TEXTURE and EGL_TEXTURE_TARGET is something other than EGL_NO_TEXTURE 2: EGL_TEXTURE_FORMAT is something other than EGL_NO_TEXTURE and EGL_TEXTURE_TARGET is EGL_NO_TEXTURE. This fixes the dEQP-EGL.functional.negative_api.create_pbuffer_surface test. Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* mesa_glinterop: make GL interop version field bidirectionalEmil Velikov2016-05-243-3/+3
| | | | | | | | | | | | | | This allows clear and easy communication between the two. Caller: Requesting information (struct vN) Callee: I know how to deal with older version (vN-1) only. Here is your data and the version I support. Caller: Older version ? Sure I'll cap all access to the fields provided by the older version (vN-1) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa_glinterop: remove unneeded GLAPI/GLAPIENTRY/APIENTRYP symbolsEmil Velikov2016-05-241-2/+2
| | | | | | | | | | | | | | | | These come from windows.h, gl.h, glcorearb.h and/or glext.h. The interop interface is aimed at non-Windows platforms while the macros are used/derived due to Windows specifics. Thus we can safely remove them. Strictly speaking there should be GLXAPIENTRY/EGLAPIENTRY and alike macros, although a) there is no GLX ones and b) this brings us even further from decoupling the file from the GLX/EGL header dependency. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Tom Stellard <[email protected]>
* egl: Add OpenGL_ES to API string regardless of GLES versionPlamena Manolova2016-05-231-7/+4
| | | | | | | | | | | | | | | | | According to the EGL specifications eglQueryString(EGL_CLIENT_APIS) should return a string containing a combination of "OpenGL", "OpenGL_ES" and "OpenVG", any other values would be considered invalid. Due to this when the API string is constructed, the version of GLES should be disregarded and "OpenGL_ES" should be attached once instead of "OpenGL_ES2" and "OpenGL_ES3". Fixes: dEQP-EGL.functional.negative_api* and dEQP-EGL.functional.query_context.simple.query_api Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* configure.ac: Add support for Android buildsNicolas Boichat2016-05-231-0/+5
| | | | | | | | | | | | | Add support for EGL android platform. Also, detect when --host finishes with -android. In that case, we do not set _GNU_SOURCE, and define autoconf symbol HAVE_ANDROID, so that Android-specific workarounds can be applied. Signed-off-by: Nicolas Boichat <[email protected]> Reviewed-by: Emil Velikov <[email protected]> [Emil Velikov: Rebase on top of HAVE_EGL_PLATFORM_NULL removal] Signed-off-by: Emil Velikov <[email protected]>
* egl: add missing link against $(CLOCK_LIB)Emil Velikov2016-05-231-1/+1
| | | | | | | | | | | | Some platforms require separate library in order to resolve the clock_gettime() symbol. Add the link or the build will fail. Fixes: 70299474f58 ("egl: add EGL_KHR_reusable_sync to egl_dri") Cc: Dongwon Kim <[email protected]> Reported-by: Pali Rohár <[email protected]> Tested-by: Pali Rohár <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl: android: remove explicit glFlush callEmil Velikov2016-05-231-6/+0
| | | | | | | The DRI flush extension should already do the same thing. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl: android: drop dri2_create_image_android_native_buffer argumentEmil Velikov2016-05-231-2/+2
| | | | | | | The drv is no longer used/needed as of last commit. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Rob Herring <[email protected]>
* egl: android: directly use dri2_create_image_dma_buf()Emil Velikov2016-05-233-3/+6
| | | | | | | | Make the function non static so that we can use it directly from the android platform code. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Rob Herring <[email protected]>
* gbm: rename gbm_dri_bo_{map,unmap} to gbm_dri_bo_{map,unmap}_dumbRob Herring2016-05-231-4/+4
| | | | | | | | | In preparation to add public map/unmap functions, rename the existing gbm_dri_bo_{map,unmap} functions to indicate that they are only for dumb buffers. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Android: Move setting DEFAULT_DRIVER_DIR to shared locationRob Herring2016-05-231-7/+0
| | | | | | | | | Move the defining of DEFAULT_DRIVER_DIR path to a common location so both EGL and GBM can use it. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/dri2: Don't check return result of mtx_unlock().Matt Turner2016-05-181-8/+2
| | | | | | | Coverity (CID 1358496) warns that the cleanup code doesn't unlock the mutex (which is arguably kind of stupid, since the only case that can happen is when mtx_unlock() failed!). But, mtx_unlock() isn't going to fail -- the mutex was locked by this thread just a few lines above it.
* 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]>