We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4296

Summary: kmsdrm video driver leaks 1 bo in KMSDRM_GLES_SetupCrtc()
Product: SDL Reporter: Icenowy Zheng <icenowy>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.8   
Hardware: ARM   
OS: Linux   
Attachments: [PATCH] Catch the lost BO in KMSDRM driver

Description Icenowy Zheng 2018-10-05 16:54:27 UTC
Created attachment 3341 [details]
[PATCH] Catch the lost BO in KMSDRM driver

One front buffer is locked in GLES_SetupCrtc() and overrides the next_bo just locked in KMSDRM_GLES_SwapWindow, then the next_bo gets lost and is not released even when quitting the video.

It may leads to problems with GLES drivers that doesn't clean up GBM correctly if there's any bo left (e.g. the Mali Utgard r6p2 blob). In the case of Mali Utgard r6p2 blob, the DRM device file is still hold by the blob, and if you try to SDL_Quit to let another program to run (this is done by EmulationStation), the new program will fail to open DRM device.
Comment 1 Sam Lantinga 2018-10-06 00:06:23 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/d8683d6ff2f8