[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210114180738.1758707-7-helen.koike@collabora.com>
Date: Thu, 14 Jan 2021 15:07:33 -0300
From: Helen Koike <helen.koike@...labora.com>
To: linux-media@...r.kernel.org
Cc: hverkuil@...all.nl, mchehab@...nel.org, hans.verkuil@...co.com,
laurent.pinchart@...asonboard.com, sakari.ailus@....fi,
boris.brezillon@...labora.com, hiroh@...omium.org,
nicolas@...fresne.ca, Brian.Starkey@....com, kernel@...labora.com,
narmstrong@...libre.com, linux-kernel@...r.kernel.org,
frkoenig@...omium.org, stanimir.varbanov@...aro.org,
tfiga@...omium.org
Subject: [RFC PATCH v6 06/11] media: vivid: use vb2_ioctls_ext_{d}qbuf hooks
Add vb2 ext hooks and call vb2_set_pixelformat().
This allows more flexibility with buffer handling.
Signed-off-by: Helen Koike <helen.koike@...labora.com>
---
Changes in v6:
- New patch to exemplify how drivers would easily support features from Ext Buf
---
drivers/media/test-drivers/vivid/vivid-core.c | 2 ++
drivers/media/test-drivers/vivid/vivid-vid-cap.c | 1 +
drivers/media/test-drivers/vivid/vivid-vid-out.c | 1 +
3 files changed, 4 insertions(+)
diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c
index 0dc65ef3aa14..eacb23808c7e 100644
--- a/drivers/media/test-drivers/vivid/vivid-core.c
+++ b/drivers/media/test-drivers/vivid/vivid-core.c
@@ -723,6 +723,8 @@ static const struct v4l2_ioctl_ops vivid_ioctl_ops = {
.vidioc_querybuf = vb2_ioctl_querybuf,
.vidioc_qbuf = vb2_ioctl_qbuf,
.vidioc_dqbuf = vb2_ioctl_dqbuf,
+ .vidioc_ext_qbuf = vb2_ioctl_ext_qbuf,
+ .vidioc_ext_dqbuf = vb2_ioctl_ext_dqbuf,
.vidioc_expbuf = vb2_ioctl_expbuf,
.vidioc_streamon = vb2_ioctl_streamon,
.vidioc_streamoff = vb2_ioctl_streamoff,
diff --git a/drivers/media/test-drivers/vivid/vivid-vid-cap.c b/drivers/media/test-drivers/vivid/vivid-vid-cap.c
index b9caa4b26209..882b0c4a6591 100644
--- a/drivers/media/test-drivers/vivid/vivid-vid-cap.c
+++ b/drivers/media/test-drivers/vivid/vivid-vid-cap.c
@@ -169,6 +169,7 @@ static int vid_cap_buf_prepare(struct vb2_buffer *vb)
}
vb2_set_plane_payload(vb, p, size);
+ vb2_set_pixelformat(vb, dev->fmt_cap->fourcc);
vb->planes[p].data_offset = dev->fmt_cap->data_offset[p];
}
diff --git a/drivers/media/test-drivers/vivid/vivid-vid-out.c b/drivers/media/test-drivers/vivid/vivid-vid-out.c
index ac1e981e8342..6be61112065d 100644
--- a/drivers/media/test-drivers/vivid/vivid-vid-out.c
+++ b/drivers/media/test-drivers/vivid/vivid-vid-out.c
@@ -136,6 +136,7 @@ static int vid_out_buf_prepare(struct vb2_buffer *vb)
return -EINVAL;
}
}
+ vb2_set_pixelformat(vb, dev->fmt_out->fourcc);
return 0;
}
--
2.29.2
Powered by blists - more mailing lists