mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 06:47:34 +00:00
Kernel+Userland: Add ioctl to set process ownership of DisplayConnector
Now that the infrastructure of the Graphics subsystem is quite stable, it is time to try to fix a long-standing problem, which is the lack of locking on display connector devices. Reading and writing from multiple processes to a framebuffer controlled by the display connector is not a huge problem - it could be solved with POSIX locking. The real problem is some program that will try to do ioctl operations on a display connector without the WindowServer being aware of that which can lead to very bad situations, for example - assuming a framebuffer is encoded at a known resolution and certain display timings, but another process changed the ModeSetting of the display connector, leading to inconsistency on the properties of the current ModeSetting. To solve this, there's a new "master" ioctl to take "ownership" and another one to release that ownership of a display connector device. To ensure we will not hold a Process object forever just because it has an ownership over a display connector, we hold it with a weak reference, and if the process is gone, someone else can take an ownership.
This commit is contained in:
parent
1968aba69b
commit
977aa81310
5 changed files with 101 additions and 8 deletions
|
@ -101,6 +101,8 @@ enum IOCtlNumber {
|
|||
GRAPHICS_IOCTL_SET_HEAD_MODE_SETTING,
|
||||
GRAPHICS_IOCTL_GET_HEAD_MODE_SETTING,
|
||||
GRAPHICS_IOCTL_SET_SAFE_HEAD_MODE_SETTING,
|
||||
GRAPHICS_IOCTL_SET_RESPONSIBLE,
|
||||
GRAPHICS_IOCTL_UNSET_RESPONSIBLE,
|
||||
KEYBOARD_IOCTL_GET_NUM_LOCK,
|
||||
KEYBOARD_IOCTL_SET_NUM_LOCK,
|
||||
KEYBOARD_IOCTL_GET_CAPS_LOCK,
|
||||
|
@ -160,6 +162,8 @@ enum IOCtlNumber {
|
|||
#define GRAPHICS_IOCTL_SET_HEAD_MODE_SETTING GRAPHICS_IOCTL_SET_HEAD_MODE_SETTING
|
||||
#define GRAPHICS_IOCTL_GET_HEAD_MODE_SETTING GRAPHICS_IOCTL_GET_HEAD_MODE_SETTING
|
||||
#define GRAPHICS_IOCTL_SET_SAFE_HEAD_MODE_SETTING GRAPHICS_IOCTL_SET_SAFE_HEAD_MODE_SETTING
|
||||
#define GRAPHICS_IOCTL_SET_RESPONSIBLE GRAPHICS_IOCTL_SET_RESPONSIBLE
|
||||
#define GRAPHICS_IOCTL_UNSET_RESPONSIBLE GRAPHICS_IOCTL_UNSET_RESPONSIBLE
|
||||
#define KEYBOARD_IOCTL_GET_NUM_LOCK KEYBOARD_IOCTL_GET_NUM_LOCK
|
||||
#define KEYBOARD_IOCTL_SET_NUM_LOCK KEYBOARD_IOCTL_SET_NUM_LOCK
|
||||
#define KEYBOARD_IOCTL_GET_CAPS_LOCK KEYBOARD_IOCTL_GET_CAPS_LOCK
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue