Skip to content
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

Transmission of the actual image size #61

Draft
wants to merge 1 commit into
base: celadon/u/mr0/master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/media/platform/virtio/virtio-camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static void virtio_camera_control_ack(struct virtqueue *vq)
vbuf->sequence = req->resp.u.buffer.sequence;
vbuf->vb2_buf.timestamp = req->resp.u.buffer.timestamp;
vbuf->planes[0].bytesused = req->resp.u.format.size.sizeimage;
req->vb->planes[0].bytesused = req->resp.u.format.size.sizeimage;
Copy link

@6ZhangWei 6ZhangWei Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think line159 is enough to provide the bytesused for userspace.
Do you verify the android image released in this week or last week. It should work.

buffer info in this struct can be seen from userspace.
struct vb2_v4l2_buffer {
struct vb2_buffer vb2_buf;
__u32 flags;
__u32 field;
struct v4l2_timecode timecode;
__u32 sequence;
__s32 request_fd;
bool is_held;
struct vb2_plane planes[VB2_MAX_PLANES];
__u32 reserved;
ANDROID_KABI_RESERVE(1);
};

vb2_buffer_done(req->vb, VB2_BUF_STATE_DONE);
pr_debug("virtio-camera: mark the buffer done. UUID is %d, ptr is %pK\n",
req->resp.u.buffer.uuid[0] + req->resp.u.buffer.uuid[1], req->vb);
Expand Down