lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230206043308.28365-7-ayaka@soulik.info>
Date:   Mon,  6 Feb 2023 12:33:05 +0800
From:   ayaka <ayaka@...lik.info>
To:     linux-media@...r.kernel.org
Cc:     randy.li@...aptics.com, Brian.Starkey@....com,
        boris.brezillon@...labora.com, frkoenig@...omium.org,
        hans.verkuil@...co.com, hiroh@...omium.org, hverkuil@...all.nl,
        kernel@...labora.com, laurent.pinchart@...asonboard.com,
        linux-kernel@...r.kernel.org, mchehab@...nel.org,
        narmstrong@...libre.com, nicolas@...fresne.ca, sakari.ailus@....fi,
        stanimir.varbanov@...aro.org, tfiga@...omium.org,
        Helen Koike <helen.koike@...labora.com>
Subject: [PATCH v7 6/9] media: vivid: use vb2_ioctls_ext_{d}qbuf hooks

From: Helen Koike <helen.koike@...labora.com>

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 d4ed55aef1bb..f033c9c4e9aa 100644
--- a/drivers/media/test-drivers/vivid/vivid-core.c
+++ b/drivers/media/test-drivers/vivid/vivid-core.c
@@ -728,6 +728,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 3e3a94a2e3d6..bbe0fc2a3627 100644
--- a/drivers/media/test-drivers/vivid/vivid-vid-cap.c
+++ b/drivers/media/test-drivers/vivid/vivid-vid-cap.c
@@ -170,6 +170,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 936ba93c00cc..5f224f13aa99 100644
--- a/drivers/media/test-drivers/vivid/vivid-vid-out.c
+++ b/drivers/media/test-drivers/vivid/vivid-vid-out.c
@@ -137,6 +137,7 @@ static int vid_out_buf_prepare(struct vb2_buffer *vb)
 			return -EINVAL;
 		}
 	}
+	vb2_set_pixelformat(vb, dev->fmt_out->fourcc);
 
 	return 0;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ