forked from rust-vmm/vhost
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Gpu socket final2 #7
Draft
mtjhrc
wants to merge
15
commits into
main
Choose a base branch
from
gpu-socket-final2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Endpoint was previusly generic only over the Request. This commit allows Endpoint to be used with a protocol with a slightly different header such as the QEMU GPU protocol on the socket from VHOST_USER_GPU_SET_SOCKET. https://www.qemu.org/docs/master/interop/vhost-user-gpu.html Signed-off-by: Matej Hrica <[email protected]>
This commit adds the basic definitions of GPU commands on the socket obtained from VHOST_USER_GPU_SET_SOCKET. This also introduces a new feature flag `gpu-socket` in the vhost crate. Signed-off-by: Matej Hrica <[email protected]>
The VHOST_USER_GPU_SET_SOCKET is only handled when the feature gpu-set-socket is enabled. This also introduces a GpuBackend for handling comunication over the socket. Signed-off-by: Matej Hrica <[email protected]>
The VHOST_USER_GPU_UPDATE and VHOST_USER_GPU_CURSOR_UPDATE contain image data and are larger than MAX_MSG_SIZE. Current value of MAX_MSG_SIZE isn't really a limitation of the protocol, just an implementation detail limitation in this crate. This commit introduces another constant MAX_MSG_SIZE that is part of the MsgHeader trait. For now this is only used for sending messages. Consider using the more specific trait constant everywhere.
Adds a method and related structs to send VHOST_USER_GPU_GET_DISPLAY_INFO and receive the reply. Signed-off-by: Dorinda Bassey <[email protected]> Signed-off-by: Matej Hrica <[email protected]>
Adds a method and related structs to send VHOST_USER_GPU_GET_EDID and receive the reply. Signed-off-by: Dorinda Bassey <[email protected]>
Adds a method that sends VHOST_USER_GPU_SCANOUT and doesn't wait for a reply. Signed-off-by: Dorinda Bassey <[email protected]>
Adds a method and related struct to send VHOST_USER_GPU_UPDATE. The data part of the messege is not part of the struct like sugested by the spec but a separate argument to update_scanout. This is necessary because of limitations of having an unsized array inside of struct in Rust. But this aproach seems preferable anyway, because it allows the consumer of the crate to store the array in a diferent location than the struct. Signed-off-by: Dorinda Bassey <[email protected]> Signed-off-by: Matej Hrica <[email protected]>
Adds methods and related structs to send the VHOST_USER_GPU_DMABUF_SCANOUT and VHOST_USER_GPU_DMABUF_UPDATE update messages. Signed-off-by: Matej Hrica <[email protected]>
Adds a method to send VHOST_USER_GPU_GET_PROTOCOL_FEATURES and receive the reply. Also adds a method to send SET_PROTOCOL_FEATURES. The VhostUserGpuProtocolFeatures bitmap defines possible feature flags. Signed-off-by: Dorinda Bassey <[email protected]>
Adds methods to send cursor related messeges: VHOST_USER_GPU_CURSOR_POS, VHOST_USER_GPU_CURSOR_POS_HIDE and VHOST_USER_GPU_CURSOR_UPDATE. VhostUserGpuCursorUpdate's `data` field is passed as a separate argument into cursor_update method. The type is also an u8 array instead of u32 array like in the spec. Having the type be u8 array makes it easier to work with the data without unsafe code for the consumer of this crate. Having it be a separate argument is useful, because the user of the method doesn't have to copy the array into a struct. They just have to provide a reference to it. Signed-off-by: Dorinda Bassey <[email protected]>
Adds a method and related struct to send the VHOST_USER_GPU_DMABUF_SCANOUT2 messege. Signed-off-by: Matej Hrica <[email protected]>
The tests just cover the message sending implementation, but not the actual public methods, as these just call the tested methods with specific arguments. Signed-off-by: Matej Hrica <[email protected]>
Signed-off-by: Matej Hrica <[email protected]>
Compile and test with `gpu-socket` feature enabled. Signed-off-by: Matej Hrica <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.