Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RendererDRMPRIMEGLES: Fix leak of EGL fences #23272

Merged
merged 1 commit into from
May 16, 2023

Conversation

popcornmix
Copy link
Member

Description

Fix leak of EGL fences

Motivation and context

When running on wayland in a desktop window, kodi will crash with 'Too many open files' after a minute of so of video playback.

I've tracked it down the EGL fences. Render gets called more often than ReleaseBuffer (I'm seeing two Render calls per ReleaseBuffer call).

As we allocate a fence in Render and free in ReleaseBuffer this leaks.

It's safe to call DestroyFence on a non-created fence so use that to stop the leak

How has this been tested?

I've had kodi running on a Pi4 in a wayland window looping video for most of the day

What is the effect on users?

Stops it crashing on video playback

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

When running on wayland in a desktop window, kodi will crash with
'Too many open files' after a minute of so of video playback.

I've tracked it down the EGL fences. Render gets called more often than ReleaseBuffer
(I'm seeing two Render calls per ReleaseBuffer call).

As we allocate a fence in Render and free in ReleaseBuffer this leaks.

It's safe to call DestroyFence on a non-created fence so use that to stop the leak
Copy link
Contributor

@lrusak lrusak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lrusak lrusak merged commit 2fb797a into xbmc:master May 16, 2023
2 checks passed
@popcornmix popcornmix deleted the drm_egl_leak branch May 16, 2023 10:25
@lrusak
Copy link
Contributor

lrusak commented May 28, 2023

@popcornmix can you backport please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants