summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglsync.c
Commit message (Collapse)AuthorAgeFilesLines
* egl: add EGL_ANDROID_native_fence_syncRob Clark2016-12-011-2/+20
| | | | | | | | | | With fixes from Chad squashed in, plus fixes for issues that Rafael found while writing piglit tests. Signed-off-by: Rob Clark <[email protected]> Tested-by: Rafael Antognolli <[email protected]> Reviewed-by: Chad Versace <[email protected]> Tested-by: Chad Versace <[email protected]>
* egl: un-fallthrough sync attr parsingRob Clark2016-12-011-3/+3
| | | | | | | | | | Doesn't work so well when you start having more than one possible attrib. Prep-work for next patch. Signed-off-by: Rob Clark <[email protected]> Tested-by: Rafael Antognolli <[email protected]> Reviewed-by: Chad Versace <[email protected]> Tested-by: Chad Versace <[email protected]>
* egl: initialize SyncCondition after attr parsingRob Clark2016-12-011-1/+2
| | | | | | | | | | | Reduce the noise in the next patch. For EGL_SYNC_NATIVE_FENCE_ANDROID the sync condition is conditional on EGL_SYNC_NATIVE_FENCE_FD_ANDROID attribute. Signed-off-by: Rob Clark <[email protected]> Tested-by: Rafael Antognolli <[email protected]> Reviewed-by: Chad Versace <[email protected]> Tested-by: Chad Versace <[email protected]>
* egl: Unify the EGLint/EGLAttrib paths in eglCreateSync* (v3)Chad Versace2016-10-101-37/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Pre-patch, there were two code paths for parsing EGLSync attribute lists: one path for old-style EGLint lists, used by eglCreateSyncKHR, and another for new-style EGLAttrib lists, used by eglCreateSync (1.5) and eglCreateSync64 (EGL_KHR_cl_event2). There were two attrib_list parsing functions, _eglParseSyncAttribList(_EGLSync *sync, const EGLint *attrib_list) _eglParseSyncAttribList64(_EGLSync *sync, const EGLattrib *attrib_list) This patch unifies the two attrib_list parsing functions into one, _eglParseSyncAttribList(_EGLSync *sync, const EGLattrib *attrib_list) Many internal EGLSync function signatures had *two* attrib_list parameters to accomodate both code paths: one parameter was an EGLint list and other an EGLAttrib list. At most one of the parameters was allowed to be non-null. This patch removes the `EGLint *attrib_list` parameter, leaving only the `EGLAttrib *attrib_list` parameter, for all internal EGLSync functions. v2: - Consistently use condition (sizeof(int_list[0]) == sizeof(attrib_list[0])). [for emil] v3: - Don't double-unlock the display in eglCreateSyncKHR. Reviewed-by: Emil Velikov <[email protected]> (v2)
* egl: Drop duplicate check on EGLSync typeChad Versace2016-10-041-6/+0
| | | | | | | | | | _eglInitSync checked that the display supported the sync type (such as EGL_SYNC_FENCE), and did it wrong. When the check failed it emitted EGL_BAD_ATTRIBUTE, but sometimes EGL_BAD_PARAMETER is needed. _eglCreateSync already does the error checking, and it does it right. Reviewed-by: Emil Velikov <[email protected]>
* egl: Cleanup control flow in _eglParseSyncAttribListChad Versace2016-10-041-6/+8
| | | | | | | | | | When the function encountered an error, it effectively returned immediately. However, it did so indirectly by breaking out of a loop. Replace the loop breakout with a explicit 'return'. Do the same for _eglParseSyncAttribList64 too. Reviewed-by: Emil Velikov <[email protected]>
* egl: Fix truncation error in _eglParseSyncAttribList64Chad Versace2016-10-041-3/+4
| | | | | | | | The function stores EGLAttrib values in EGLint variables. On 64-bit systems, this truncated the values. Cc: [email protected] Reviewed-by: Emil Velikov <[email protected]>
* egl: add EGL_KHR_reusable_sync to egl_driDongwon Kim2016-04-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: move Null check to eglGetSyncAttribKHR to prevent SegfaultDongwon Kim2016-02-191-3/+0
| | | | | | | | | | | | | | 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]>
* egl: add eglGetSyncAttrib (v2)Marek Olšák2015-06-051-2/+2
| | | | | | | | | v2: - don't modify "value" in eglGetSyncAttribKHR after an error - rename _egl_api::GetSyncAttribKHR -> GetSyncAttrib - rename GetSyncAttribKHR_t -> GetSyncAttrib_t - rename _eglGetSyncAttribKHR to _eglGetSyncAttrib Reviewed-by: Chad Versace <[email protected]>
* egl: use EGL 1.5 types without suffixesMarek Olšák2015-06-051-2/+2
| | | | | Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl/dri2: return the latest sync status in eglGetSyncAttribKHRMarek Olšák2015-04-301-1/+8
|
* egl/dri2: implement EGL_KHR_cl_event2 (v2)Marek Olšák2015-04-301-5/+57
| | | | v2: fix the SYNC_CONDITION query
* egl: remove #ifdef's for official extensionsChia-I Wu2011-12-201-6/+0
| | | | | | | There is no point in having them when we distribute eglext.h. As for unofficial extensions, there is a chance that we might remove some of them evetually. Keeping the #ifdef's for now should make that easier.
* egl: add copyright noticesChia-I Wu2011-07-021-0/+28
| | | | | The list of copyright holders could be incomplete. Please update directly or notify me if your name is missing.
* egl: Add reference count for resources.Chia-I Wu2010-10-231-4/+1
| | | | | This is a really simple mechanism. There is no atomicity and the caller is expected to hold the display lock.
* egl: Move fallback routines to eglfallbacks.c.Chia-I Wu2010-10-221-31/+0
| | | | We do not want them to be all over the places.
* egl: Add support for EGL_KHR_fence_sync.Chia-I Wu2010-08-171-1/+8
| | | | Individual drivers still need to support and enable the extension.
* egl: Add support for EGL_KHR_reusable_sync.Chia-I Wu2010-08-171-0/+121
Individual drivers still need to support and enable the extension.