-
-
Notifications
You must be signed in to change notification settings - Fork 144
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 shm key and drm for rawfb option, this will support both x11 and wayland. #227
Conversation
Sometime shmid is not same on different time or system, we should use a constant ID for shm. Here use shm key to instead.
@bk138 Do you have time to look at this? |
access GPU with DRM, this will support x11 and wayland
src/screen.c
Outdated
|
||
shmkey = shmid; | ||
size = w * h * b / 8; | ||
newshmid = shmget(shmkey, size, 0); |
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.
According to the man page,
A new shared memory segment, with size equal to the value of size rounded up to a multiple of PAGE_SIZE, is created if key has the value IPC_PRIVATE or key isn't IPC_PRIVATE, no
shared memory segment corresponding to key exists, and IPC_CREAT is specified in shmflg.
So this likely breaks the original behaviour where the user enters some shmid and expects the shmat() down below to attach this. With this change, it's very likely that a new shared memory segment is created; this is not what the users expect.
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.
Oh, I made a mistake. For an existed shared memory, the size for shmget should be 0. Then this will not alloc new shared memory segment and use the old way to seek shmid.
The change has committed, thanks for your review!
shmget should be 0 otherwise it would alloc a new shared memory but not for the frame buffer.
#229 Using drm backend will have a better performance. |
This will support both x11 and Wayland. (LibVNC#227) * Add support shm key for rawfb option Sometime shmid is not same on different time or system, we should use a constant ID for shm. Here use shm key to instead. * Add DRM support access GPU with DRM, this will support x11 and wayland * Fix a bug for shmget params. shmget should be 0 otherwise it would alloc a new shared memory but not for the frame buffer. * fix drm configure while compiling.
This will support both x11 and Wayland. (LibVNC#227) * Add support shm key for rawfb option Sometime shmid is not same on different time or system, we should use a constant ID for shm. Here use shm key to instead. * Add DRM support access GPU with DRM, this will support x11 and wayland * Fix a bug for shmget params. shmget should be 0 otherwise it would alloc a new shared memory but not for the frame buffer. * fix drm configure while compiling.
Sometime shmid is not same on different time or system, we should use a constant ID for shm. Here use shm key to instead.