-
Notifications
You must be signed in to change notification settings - Fork 182
Support dmabuf in Cuttlefish wayland server #1602
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
base: main
Are you sure you want to change the base?
Conversation
Based off of wenz@'s ag/25579081 and migrated from aosp/3173701
Bug: b/353330529
Test: bazel run cuttlefish/package:cvd -- create --host_substitutions=all
and interact with device at https://localhost:1443/
8328dfe to
e20474d
Compare
|
|
||
| if (dmabuf_plane.fd.ok()) { | ||
| buffer_drm_format = dmabuf->format; | ||
| buffer_stride_bytes = dmabuf_plane.stride; |
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.
Here
|
We've been using this patch in our custom Cuttlefish builds for over a year now, and would very much like to see it merged. It's been well tested in upstream Mesa CI since last year with our Venus + drm_hwc build, and this year with |
|
|
||
| bool IsDmabufResource(struct wl_resource* resource) { | ||
| return wl_resource_instance_of(resource, &wl_buffer_interface, | ||
| &zwp_linux_dmabuf_v1_interface); |
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.
Forwarded comment: 3rd argument should be buffer_implementation
| uint32_t height = 0; | ||
| uint32_t format = 0; | ||
| uint32_t flags = 0; | ||
| DmabufParams* params; |
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.
Forwarded comment: this should not be a pointer as the params accumulator "DmabufParams" object is destroyed right after the dmabuf is created.
| buffer_drm_format = dmabuf->format; | ||
| buffer_stride_bytes = dmabuf_plane.stride; | ||
| buffer_size = buffer_h * buffer_stride_bytes; | ||
| auto mapped = mmap(nullptr, buffer_size, PROT_READ | PROT_WRITE, |
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.
Forwarded comment: drop the PROT_WRITE, the dmabuf's being sent might be read only
|
Hi @valentineburley , I originally just posted this for sharing but it was pointed out that there are some existing issues with the current implementation in this PR. Could you confirm that the dma path was indeed actually being tested even with these issues? |
Based off of @z-wen-z 's ag/25579081 and migrated from aosp/3173701
Bug: b/353330529
Test:
bazel run cuttlefish/package:cvd -- create --host_substitutions=alland interact with device at https://localhost:1443/