-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support Linux DRM backend #69
base: main
Are you sure you want to change the base?
Conversation
What compatibility risks exist when using DRM legacy interfaces with newer Linux kernels? Could you verify the compatibility status of libdrm across different kernel versions? What prevents the DRM backend from rendering content across the full screen resolution? |
@a1091150, You might check DRM backend for your environment as well. |
|
||
return true; | ||
|
||
bail_crtc: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused about this. It should be as below.
/* Retrieve resources */
if (!get_resources(tx->drm_dri_fd, &RES(tx)))
goto bail_res;
....
bail_fb:
drmModeRmFB(tx->drm_dri_fd, tx->fb_id);
munmap(tx->fb_base, tx->fb_len);
bail_crtc:
drmModeFreeCrtc(CRTC(tx));
bail_conn:
drmModeFreeConnector(CONN(tx));
bail_res:
drmModeFreeResources(RES(tx));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase the latest main
branch and resolve conflicts.
Implemented DRM-based framebuffer setup, including: - Opening DRM device - Creating dumb buffers and mapping them to framebuffers - Setting mode and handling CRTC for connected display output Currently, using the DRM legacy interface is suitable for Mado's backend if we only need basic window display without advanced features. The DRM legacy is simpler to implement. Close sysprog21#60
@@ -83,6 +83,9 @@ For SDL backend, install the [SDL2 library](https://www.libsdl.org/). | |||
* macOS: `brew install sdl2` | |||
* Ubuntu Linux / Debian: `sudo apt install libsdl2-dev` | |||
|
|||
For DRM backend, install the [libdrm](https://cgit.freedesktop.org/mesa/drm/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the hyperlink to https://gitlab.freedesktop.org/mesa/drm
@@ -0,0 +1,24 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decouple linux VT changes in another pull request which adapts fbdev backend as well. That is, the linux VT routines should be shared between fbdev and DRM backends.
I need more time to research and adjust. |
return false; | ||
} | ||
|
||
/* Virtual terminal part is same as fbdev */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decouple this to another pull request to share the Linux VT manipulation.
{ | ||
*resources = drmModeGetResources(fd); | ||
if (*resources == NULL) { | ||
log_error("drmModeGetResources failed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the error messages consistent, starting with "Failed to ..."
Currently, using the DRM legacy interface is suitable for Mado's backend because we only need basic window display without advanced features.