How to exit drm completely?

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the FAQ and read the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.

Description

Hello, I have two apps App1 and App2 which use lvgl to create UI . I want to run App1, and then close its UI and exit lvgl of App1 when some event triggers , and then start App2 by App1.
At first, i used the framebuffer driver as display, and it works well.
Due to project requirements, i replaced the framebuffer driver with DRM driver and i met some errors when App2 starts.

It prints the errors:
error:drmModeAtomicCommit failed: Permission denied
error: Flush fail

Does the process App1 still hold DRM resources when drm_exit() called, resulting in another process App2 not being able to obtain DRM resources?
I tried to repeatedly initialize lvgl and DRM, exit lvgl and DRM in the same process App1, and there was no problem.
How to completely release DRM resources for a process?

What MCU/Processor/Board and compiler are you using?

armv8

What LVGL version are you using?

v7

What do you want to achieve?

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

void drm_init(void)
{
int ret;

ret = drm_setup(DRM_FOURCC);
if (ret) {
	close(drm_dev.fd);
	drm_dev.fd = -1;
	return;
}

ret = drm_setup_buffers();
if (ret) {
	err("DRM buffer allocation failed");
	close(drm_dev.fd);
	drm_dev.fd = -1;
	return;
}

info("DRM subsystem and buffer mapped successfully");

}

void drm_exit(void)
{
close(drm_dev.fd);
drm_dev.fd = -1;
}

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.