-
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.
I need more time to research and adjust. |
Check the DRM implementation for reference: https://github.com/zlgopen/awtk-linux-fb/blob/master/awtk-port/lcd_linux/lcd_linux_drm.c |
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 utilize backend/linux_vt.h
.
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
|
||
/* Register the Linux DRM backend */ | ||
|
||
const twin_backend_t g_twin_backend = { |
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.
You should add poll
operation as it is required in recent main
branch.
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.
As the original implementation, we creates another thread to handle the events in function twin_linux_evdev_thread
. So do you suggest refactoring linux_input.c#L255~278?
Or we just assign NULL to .poll
?
/* Register the Linux DRM backend */
const twin_backend_t g_twin_backend = {
.init = twin_drm_init,
.poll = NULL, /*without implementation*/
.configure = twin_drm_configure,
.exit = twin_drm_exit,
};
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.
@alanjian85, can you comment this?
$ sudo ./demo-drm | ||
``` | ||
|
||
The DRM device can be assigened via the environment variable `DRI_CARD`. |
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.
DRI_CARD
is not common for understanding. How about DRMDEVICE
?
Currently, using the DRM legacy interface is suitable for Mado's backend because we only need basic window display without advanced features.