linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Tomasz Figa <tfiga@chromium.org>,
	kernel@collabora.com, Jonas Karlman <jonas@kwiboo.se>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Alexandre Courbot <acourbot@chromium.org>,
	Jeffrey Kardatzke <jkardatzke@chromium.org>,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Maxime Ripard <mripard@kernel.org>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Ezequiel Garcia <ezequiel@collabora.com>
Subject: [RFC 5/7] media: uapi: h264: pad v4l2_ctrl_h264_pps to 64-bit
Date: Tue, 23 Jun 2020 15:28:07 -0300	[thread overview]
Message-ID: <20200623182809.1375-6-ezequiel@collabora.com> (raw)
In-Reply-To: <20200623182809.1375-1-ezequiel@collabora.com>

The struct does not contain 64-bit types, and therefore
doesn't suffer from compatibility issues.

However, having it aligned to 64-bits is cleaner and
has the advantage of allowing future extensions.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 3 +++
 drivers/media/v4l2-core/v4l2-ctrls.c                      | 5 +++++
 include/media/h264-ctrls.h                                | 1 +
 3 files changed, 9 insertions(+)

diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
index e3b5a28fb965..2c682f81aaad 100644
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
@@ -1662,6 +1662,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
     * - __u16
       - ``flags``
       - See :ref:`Picture Parameter Set Flags <h264_pps_flags>`
+    * - __u32
+      - ``reserved``
+      - Applications and drivers must set this to zero.
 
 .. _h264_pps_flags:
 
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index a751c14f9c22..003333b6c7f7 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1735,6 +1735,7 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx,
 	struct v4l2_ctrl_vp8_frame_header *p_vp8_frame_header;
 	struct v4l2_ctrl_h264_slice_params *p_h264_slice_params;
 	struct v4l2_ctrl_h264_decode_params *p_h264_dec_params;
+	struct v4l2_ctrl_h264_pps *p_h264_pps;
 	struct v4l2_ctrl_hevc_sps *p_hevc_sps;
 	struct v4l2_ctrl_hevc_pps *p_hevc_pps;
 	struct v4l2_ctrl_hevc_slice_params *p_hevc_slice_params;
@@ -1792,7 +1793,11 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx,
 		break;
 
 	case V4L2_CTRL_TYPE_H264_SPS:
+		break;
 	case V4L2_CTRL_TYPE_H264_PPS:
+		p_h264_pps = p;
+		zero_reserved(*p_h264_pps);
+		break;
 	case V4L2_CTRL_TYPE_H264_SCALING_MATRIX:
 		break;
 	case V4L2_CTRL_TYPE_H264_SLICE_PARAMS:
diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h
index a938d16b901c..4119dc4486f3 100644
--- a/include/media/h264-ctrls.h
+++ b/include/media/h264-ctrls.h
@@ -111,6 +111,7 @@ struct v4l2_ctrl_h264_pps {
 	__s8 chroma_qp_index_offset;
 	__s8 second_chroma_qp_index_offset;
 	__u16 flags;
+	__u32 reserved;
 };
 
 struct v4l2_ctrl_h264_scaling_matrix {
-- 
2.26.0.rc2


  parent reply	other threads:[~2020-06-23 18:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 18:28 [RFC 0/7] media: Clean and make H264 stateless uAPI public Ezequiel Garcia
2020-06-23 18:28 ` [RFC 1/7] media: uapi: h264: update reference lists Ezequiel Garcia
2020-06-23 18:28 ` [RFC 2/7] fixup! " Ezequiel Garcia
2020-06-25 14:53   ` Nicolas Dufresne
2020-06-25 17:42     ` Ezequiel Garcia
2020-06-25 17:47       ` Nicolas Dufresne
2020-06-25 15:30   ` Tomasz Figa
2020-06-25 16:52     ` Ezequiel Garcia
2020-06-23 18:28 ` [RFC 3/7] media: uapi: h264: clarify pic_order_cnt_bit_size field Ezequiel Garcia
2020-06-25 15:06   ` Nicolas Dufresne
2020-06-23 18:28 ` [RFC 4/7] media: uapi: h264: increase size of fields Ezequiel Garcia
2020-06-25 15:01   ` Nicolas Dufresne
2020-06-25 15:29     ` Ezequiel Garcia
2020-06-23 18:28 ` Ezequiel Garcia [this message]
2020-06-25 14:55   ` [RFC 5/7] media: uapi: h264: pad v4l2_ctrl_h264_pps to 64-bit Nicolas Dufresne
2020-06-23 18:28 ` [RFC 6/7] media: uapi: h264: Clean slice invariants syntax elements Ezequiel Garcia
2020-06-25 15:05   ` Nicolas Dufresne
2020-06-26 19:34     ` Ezequiel Garcia
2020-06-23 18:28 ` [RFC 7/7] media: uapi: make H264 stateless codec interface public Ezequiel Garcia
2020-06-25  7:52   ` Hans Verkuil
2020-06-25 17:51     ` Ezequiel Garcia
2020-06-25 14:42 ` [RFC 0/7] media: Clean and make H264 stateless uAPI public Nicolas Dufresne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200623182809.1375-6-ezequiel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=acourbot@chromium.org \
    --cc=hverkuil@xs4all.nl \
    --cc=jkardatzke@chromium.org \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=tfiga@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).