linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] media/doc: Allow sizeimage to be set by v4l clients
@ 2019-04-12 15:59 Stanimir Varbanov
  2019-05-02 12:55 ` Mauro Carvalho Chehab
  2019-05-14  8:54 ` Hans Verkuil
  0 siblings, 2 replies; 12+ messages in thread
From: Stanimir Varbanov @ 2019-04-12 15:59 UTC (permalink / raw)
  To: linux-media
  Cc: Mauro Carvalho Chehab, Hans Verkuil, linux-arm-msm, linux-kernel,
	Stanimir Varbanov

This changes v4l2_pix_format and v4l2_plane_pix_format sizeimage
field description to allow v4l clients to set bigger image size
in case of variable length compressed data.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst | 13 ++++++++++++-
 Documentation/media/uapi/v4l/pixfmt-v4l2.rst        | 11 ++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst b/Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst
index 5688c816e334..005428a8121e 100644
--- a/Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst
@@ -31,7 +31,18 @@ describing all planes of that format.
 
     * - __u32
       - ``sizeimage``
-      - Maximum size in bytes required for image data in this plane.
+      - Maximum size in bytes required for image data in this plane,
+	set by the driver. When the image consists of variable length
+	compressed data this is the number of bytes required by the
+	codec to support the worst-case compression scenario.
+
+	For uncompressed images the driver will set the value. For
+	variable length compressed data clients are allowed to set
+	the sizeimage field, but the driver may ignore it and set the
+	value itself, or it may modify the provided value based on
+	alignment requirements or minimum/maximum size requirements.
+	If the client wants to leave this to the driver, then it should
+	set sizeimage to 0.
     * - __u32
       - ``bytesperline``
       - Distance in bytes between the leftmost pixels in two adjacent
diff --git a/Documentation/media/uapi/v4l/pixfmt-v4l2.rst b/Documentation/media/uapi/v4l/pixfmt-v4l2.rst
index 71eebfc6d853..0f7771151db9 100644
--- a/Documentation/media/uapi/v4l/pixfmt-v4l2.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-v4l2.rst
@@ -89,7 +89,16 @@ Single-planar format structure
       - Size in bytes of the buffer to hold a complete image, set by the
 	driver. Usually this is ``bytesperline`` times ``height``. When
 	the image consists of variable length compressed data this is the
-	maximum number of bytes required to hold an image.
+	number of bytes required by the codec to support the worst-case
+	compression scenario.
+
+	For uncompressed images the driver will set the value. For
+	variable length compressed data clients are allowed to set
+	the sizeimage field, but the driver may ignore it and set the
+	value itself, or it may modify the provided value based on
+	alignment requirements or minimum/maximum size requirements.
+	If the client wants to leave this to the driver, then it should
+	set sizeimage to 0.
     * - __u32
       - ``colorspace``
       - Image colorspace, from enum :c:type:`v4l2_colorspace`.
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-05-16 15:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-12 15:59 [PATCH v2] media/doc: Allow sizeimage to be set by v4l clients Stanimir Varbanov
2019-05-02 12:55 ` Mauro Carvalho Chehab
2019-05-02 13:16   ` Hans Verkuil
2019-05-02 13:29     ` Mauro Carvalho Chehab
2019-05-07 16:54       ` Stanimir Varbanov
2019-05-14  8:54 ` Hans Verkuil
2019-05-14 12:19   ` Nicolas Dufresne
2019-05-14 12:23     ` Hans Verkuil
2019-05-16  8:09   ` Stanimir Varbanov
2019-05-16  9:56     ` Tomasz Figa
2019-05-16 10:40       ` Hans Verkuil
2019-05-16 15:09         ` Stanimir Varbanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).