-
Notifications
You must be signed in to change notification settings - Fork 20
Support VT switching for fbdev backend #89
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
Conversation
Specify which environments and hardware models have been validated with the proposed updates. |
These updates have been validated on Ubuntu 24.04 in a virtual machine. However, they cause a error on the Raspberry Pi 3B. I am currently investigating the issue. |
I will help reviewing the pull request this week. |
When I switch back and forth between tty2 and tty3, the Pi 3B would shut down. Pi.mp4 |
Raspberry Pi 4B requires power supply that can sustain at least 1.2A, and the recommended value is 3A, could you check for that? |
For my Raspberry Pi 3B, the recommended power supply is a 2.5A micro USB adapter. However, I am currently using a 1.5A micro USB adapter. |
This is the experimental result obtained on a Raspberry Pi 3B. Pi_3B.mp4 |
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 VT switch code reusable with DRM by consolidating linux_vt.h
.
backend/linux_vt.h
Outdated
|
||
static int *vt_fd; | ||
|
||
static bool *is_vt_active; |
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.
Rename to is_vt_actived
.
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.
What is is_vt_active
used for?
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.
After setting is_vt_active
, it can help twin_fbdev_work
determine whether to proceed with screen rendering.
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.
After setting
is_vt_active
, it can helptwin_fbdev_work
determine whether to proceed with screen rendering.
Check the necessity.
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.
Without the is_vt_active
flag, proper VT switching cannot be ensured. The primary reason for utilizing is_vt_active
is the need to pass tx->vt_fd
and tx->vt_active
as parameters to the signal handler for configuration. However, achieving this directly is challenging. This discussion on passing multiple parameters to a signal handler using sigaction() suggests using global variables as a solution.
A similar scenario is discussed in Updating global variable in signal handlers, which provides valuable insights. It highlights that variables of type sig_atomic_t
are guaranteed to be updated safely in signal handlers. Furthermore, it cautions against using locks in signal handlers, as they might be invoked while a lock is already held.
The code can be updated as follows:
static volatile sig_atomic_t *vt_fd;
static volatile sig_atomic_t *is_vt_actived;
The fbdev backend supports framebuffer rendering on a specifiend VT. To enhancce its compatibility in environments with multiple TTYs, the following improvements ensure that each framebuffer device operates independently on its own VT without affecting others. - Implement signal handlers to manage virtual terminal switching. - Pause screen rendering when switching to another VT. - Resume screen rendering when switching back to the original VT. The improvement has been validated on Ubuntu 24.04 running in a virtual machine and on a Raspberry Pi 3B.
Thank @huaxinliao for contributing! |
The fbdev backend supports framebuffer rendering on a specifiend VT. To enhancce its compatibility in environments with multiple TTYs, the following improvements ensure that each framebuffer device operates independently on its own VT without affecting others.