Support dmabuf in Cuttlefish wayland server#1602
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; |
|
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.
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.
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.
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? |
|
Hi @jmacnak, I checked the logs, and the dmabuf path is being exercised. For example, in I’m attaching the full launcher.log for reference. |
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/