Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W
weston
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 273
    • Issues 273
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 120
    • Merge Requests 120
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wayland
  • weston
  • Issues
  • #363

Closed
Open
Opened Feb 12, 2020 by Veeresh Kadasani@VKadasaniContributor

simple-dmabuf-egl: Wrong assertion used for eglClientWaitSyncKHR

In function wait_for_buffer_release_fence simple-dmabuf-egl.c

if (d->egl.wait_sync)

		ret = d->egl.wait_sync(d->egl.display, sync, 0);

else

		ret = d->egl.client_wait_sync(d->egl.display, sync, 0,
					      EGL_FOREVER_KHR);

assert(ret == EGL_TRUE);

in case EGL_KHR_wait_sync is not supported else clause is executed and call eglClientWaitSyncKHR and this returns one of three status values from specification EGL_KHR_fence_sync

eglClientWaitSyncKHR returns one of three status values describing
the reason for returning. A return value of EGL_TIMEOUT_EXPIRED_KHR
indicates that the specified timeout period expired before <sync>
was signaled, or if <timeout> is zero, indicates that <sync> is
not signaled. A return value of EGL_CONDITION_SATISFIED_KHR
indicates that <sync> was signaled before the timeout expired, which
includes the case when <sync> was already signaled when
eglClientWaitSyncKHR was called. If an error occurs then an error is
generated and EGL_FALSE is returned.

EGL_TIMEOUT_EXPIRED_KHR - when timeout is set and time expires

EGL_CONDITION_SATISFIED_KHR - when sync is signaled

EGL_FALSE - during error

It can never return EGL_TRUE but we have assert(ret == EGL_TRUE) after it even if the sync is signaled this may cause application to abort. we should add separate assertion for client_wait_sync with assert(ret == EGL_CONDITION_SATISFIED_KHR) this is because we will never get EGL_TIMEOUT_EXPIRED_KHR since we pass EGL_FOREVER_KHR.

Edited Feb 12, 2020 by Veeresh Kadasani
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: wayland/weston#363