]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: uapi: h264: Drop SLICE_PARAMS 'size' field
authorEzequiel Garcia <ezequiel@collabora.com>
Tue, 25 Aug 2020 03:52:34 +0000 (05:52 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 1 Sep 2020 12:13:28 +0000 (14:13 +0200)
The SLICE_PARAMS control is intended for slice-based
devices. In this mode, the OUTPUT buffer contains
a single slice, and so the buffer's plane payload size
can be used to query the slice size.

To reduce the API surface drop the size from the
SLICE_PARAMS control.

A follow-up change will remove other members in SLICE_PARAMS
so we don't need to add padding fields here.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
drivers/staging/media/sunxi/cedrus/cedrus_h264.c
include/media/h264-ctrls.h

index 3808c46718ad6500efb8704473c6226c07a19016..e74a2531ab679ee0296f3538fb9737556c3d1964 100644 (file)
@@ -1760,9 +1760,6 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
     :stub-columns: 0
     :widths:       1 1 2
 
-    * - __u32
-      - ``size``
-      -
     * - __u32
       - ``start_byte_offset``
         Offset (in bytes) from the beginning of the OUTPUT buffer to the start
index d5636dbbb622433364c17bedb8e336fa13432147..7d9bd5860a1be1a57ff2be4ffe8d94526ed43a25 100644 (file)
@@ -324,17 +324,16 @@ static void cedrus_set_params(struct cedrus_ctx *ctx,
        struct vb2_buffer *src_buf = &run->src->vb2_buf;
        struct cedrus_dev *dev = ctx->dev;
        dma_addr_t src_buf_addr;
-       u32 len = slice->size * 8;
+       size_t slice_bytes = vb2_get_plane_payload(src_buf, 0);
        unsigned int pic_width_in_mbs;
        bool mbaff_pic;
        u32 reg;
 
-       cedrus_write(dev, VE_H264_VLD_LEN, len);
+       cedrus_write(dev, VE_H264_VLD_LEN, slice_bytes * 8);
        cedrus_write(dev, VE_H264_VLD_OFFSET, 0);
 
        src_buf_addr = vb2_dma_contig_plane_dma_addr(src_buf, 0);
-       cedrus_write(dev, VE_H264_VLD_END,
-                    src_buf_addr + vb2_get_plane_payload(src_buf, 0));
+       cedrus_write(dev, VE_H264_VLD_END, src_buf_addr + slice_bytes);
        cedrus_write(dev, VE_H264_VLD_ADDR,
                     VE_H264_VLD_ADDR_VAL(src_buf_addr) |
                     VE_H264_VLD_ADDR_FIRST | VE_H264_VLD_ADDR_VALID |
index 91f6f0d43e116bf6cabba092e4a4f42a4ecfc4bc..77d0ec51ae432ccc37a9d547f843d95ecba7318b 100644 (file)
@@ -163,9 +163,6 @@ struct v4l2_h264_reference {
 };
 
 struct v4l2_ctrl_h264_slice_params {
-       /* Size in bytes, including header */
-       __u32 size;
-
        /* Offset in bytes to the start of slice in the OUTPUT buffer. */
        __u32 start_byte_offset;