Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp859821ybv; Thu, 20 Feb 2020 08:32:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwGUTNyO94Xt5dxCIxf/XZHSGT6fWBcNzhFNl4divXWUFumRxXPseCsomKMnaE84bKA4TP+ X-Received: by 2002:a9d:7305:: with SMTP id e5mr23173551otk.64.1582216326797; Thu, 20 Feb 2020 08:32:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582216326; cv=none; d=google.com; s=arc-20160816; b=m20AqkiJAOPIXKm5zi91YOFwBz2SwL+wAevln80sWxDPMpYGzzjzvbJGi4Ww2lbvIW cLlSLi1ShZF5CuF2P69haQ682Z90f80hiQa8q0oLGmLkYIEoEUVneAOl3tRhOA+QBhUw 8N6FBT85JhlyVkLWpbJ8JSrxRQ+uvLg0JdFiCRkmWYMEUFqCzTPjLVroVIQGLEjszYxs AdwqWKuY/9iQ8con+bXoTc/GEmi+LsYUZDsA+xK39K+tQMqEDXozMoZPb35c5mRWj3lc Vpk5nImirD23nfgtpS/sHX/5TeFEu1KkPVkqAo8HQDVUyZyfeai1iY2uDT0qYSZbU79U 4NYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+qDmwF2fZC3v6mYKRu4jhv6e1oUIyT9W9d0Ctx6G0aI=; b=t8fsOhwBlvRKSzNYD4vN9FLQ9UuoZ2a6zr08yZLb4gh2Fr4kp84nfhppPtIuzuxBeU 5KdecSY3kIHyYK70hpTeVITsHaTZYhnfHQPTb1a+HuvxGwh5U0+iJMG1w/N5nSdeHJql U4kvcgSAa+2ya25mgBYkPnWAzmrwI+46vaic1EO6Hq6fwpmIShZo8YUkRcHZ7ZIfNkCq 2+5L9mRaW4616ZxeBw24j3LiDAUv1fI9f8rwupR736RPXjonMhMbWo2R7zffy0742CnW P5rHafoePR52a8hORUK1tpppDlcuD3VNiLRENsXb8r6xQJ70FfYqoiOnr3xjf5Kxk535 MLOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t26si10432855oic.169.2020.02.20.08.31.51; Thu, 20 Feb 2020 08:32:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbgBTQaf (ORCPT + 99 others); Thu, 20 Feb 2020 11:30:35 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:47960 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728134AbgBTQae (ORCPT ); Thu, 20 Feb 2020 11:30:34 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 9F3142951E3 From: Ezequiel Garcia To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Laurent Pinchart , Rob Herring , Tomasz Figa , Nicolas Dufresne , kernel@collabora.com, Paul Kocialkowski , Jonas Karlman , Heiko Stuebner , Boris Brezillon , Sakari Ailus , Hans Verkuil , Ezequiel Garcia Subject: [PATCH v6 1/6] media: uapi: h264: Add DPB entry field reference flags Date: Thu, 20 Feb 2020 13:30:11 -0300 Message-Id: <20200220163016.21708-2-ezequiel@collabora.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200220163016.21708-1-ezequiel@collabora.com> References: <20200220163016.21708-1-ezequiel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonas Karlman Using the field information attached to v4l2 buffers is not enough to determine the type of field referenced by a DPB entry: the decoded frame might contain the full picture (both top and bottom fields) but the reference only point to one of them. Let's add new V4L2_H264_DPB_ENTRY_FLAG_ flags to express that. Signed-off-by: Jonas Karlman [Keep only 2 flags and add some details about they mean] Signed-off-by: Boris Brezillon Signed-off-by: Ezequiel Garcia --- Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 16 ++++++++++++++++ include/media/h264-ctrls.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst index 28313c0f4e7c..d4fc5f25aa14 100644 --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst @@ -2028,6 +2028,22 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - * - ``V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM`` - 0x00000004 - The DPB entry is a long term reference frame + * - ``V4L2_H264_DPB_ENTRY_FLAG_FIELD`` + - 0x00000008 + - The DPB entry is a field reference, which means only one of the field + will be used when decoding the new frame/field. When not set the DPB + entry is a frame reference (both fields will be used). Note that this + flag does not say anything about the number of fields contained in the + reference frame, it just describes the one used to decode the new + field/frame + * - ``V4L2_H264_DPB_ENTRY_FLAG_BOTTOM_FIELD`` + - 0x00000010 + - The DPB entry is a bottom field reference (only the bottom field of the + reference frame is needed to decode the new frame/field). Only valid if + V4L2_H264_DPB_ENTRY_FLAG_FIELD is set. When + V4L2_H264_DPB_ENTRY_FLAG_FIELD is set but + V4L2_H264_DPB_ENTRY_FLAG_BOTTOM_FIELD is not, that means the + DPB entry is a top field reference ``V4L2_CID_MPEG_VIDEO_H264_DECODE_MODE (enum)`` Specifies the decoding mode to use. Currently exposes slice-based and diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h index e877bf1d537c..1c6ff7d63bca 100644 --- a/include/media/h264-ctrls.h +++ b/include/media/h264-ctrls.h @@ -185,6 +185,8 @@ struct v4l2_ctrl_h264_slice_params { #define V4L2_H264_DPB_ENTRY_FLAG_VALID 0x01 #define V4L2_H264_DPB_ENTRY_FLAG_ACTIVE 0x02 #define V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM 0x04 +#define V4L2_H264_DPB_ENTRY_FLAG_FIELD 0x08 +#define V4L2_H264_DPB_ENTRY_FLAG_BOTTOM_FIELD 0x10 struct v4l2_h264_dpb_entry { __u64 reference_ts; -- 2.25.0