From patchwork Fri Jan 15 09:26:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 363536 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp118932jap; Fri, 15 Jan 2021 01:27:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWAjdV2FYrlUcUQI6TVI9PtdFMbzXMgQFrM+vjmBlym/xi5nk0AH5sKWiyY/SE1LzhItVR X-Received: by 2002:a17:906:c7d9:: with SMTP id dc25mr8355244ejb.138.1610702858171; Fri, 15 Jan 2021 01:27:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610702858; cv=none; d=google.com; s=arc-20160816; b=t6aUmx5VoqG2V6vs08Zdk5Nf7N3Os72f06HhHjbIwRH8HylcKiszMprK8osJ2cr90D ObzvSll79Kdgjz2KB5ccd+82ldcIFCH9PP09iYj4mwCM9JqF2luYSMTYtACIdUC0uOWt WR4pln4G7971mQYljZj4DIbj4Z59eoTHGneoxPhR/D76NCOULADep+7gncLxDLvgdtls N60VuR4cdvYMyjS+lPRypBMFoiLd5FXPokoQloWWreOAx5eDbda9Tam5Zbnziwzb+gqd eIKHDtMmrGwfHQuusnAuAJpURLp4sbqIL4r4xvASlE61qLfv+iQ7TPASQMtMozrvs/ZM jfqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=t+LIjSQQZkRT5kA7Y1VVVn+LaJzyPGxbVa/mAnWmpfM=; b=z+FBie+RdDR7ejtaQdmndaq5u00mk/2Yw8Mb7Rn2NJVp3H90JwWKOkqvze4mbeXSpX Die4SAaSGVTEqmKwoubDBJ805M5boRM0wHyO74DrJuaMeV8WyEe68mUZrFvcyeQ+Jgql 5F6ACKBMrnt2rLII7GdWfgLP+4KbHp2iBnllbrhgsrikl5RJL0WfpFH3kqRegEMkmKst 1cqrcedueeGoK0PvQMtIWx431LHaEGhyTuyr+wEURdM14x3ID/o8JQsbDWmyi7rqcuU0 6zi9COl+5E9tlV0VVrU2DjLEuP+bPL24quZpeQK+2vQPlSX71H9XiJgPYBAbzWavGA1l Qomg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Msso7Nqh; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mj22si3920088ejb.215.2021.01.15.01.27.37; Fri, 15 Jan 2021 01:27:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Msso7Nqh; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729549AbhAOJ1J (ORCPT + 15 others); Fri, 15 Jan 2021 04:27:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729451AbhAOJ1F (ORCPT ); Fri, 15 Jan 2021 04:27:05 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E22EC061794 for ; Fri, 15 Jan 2021 01:26:25 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id g12so12305654ejf.8 for ; Fri, 15 Jan 2021 01:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t+LIjSQQZkRT5kA7Y1VVVn+LaJzyPGxbVa/mAnWmpfM=; b=Msso7NqhPhEB4q0UnUA8XAPok6JM03bozuMhwDOETKKxRwPjxCwRautZMeGgx5AsdV lJSzMqlyjQBcrcJgp95PfoEI2Q6fRp28H1lGx72DAu/EKKMjuf5hDuDVSAdcze/LajF5 35/Tg8PdCZNZx9klkRPJrkGaBym+hZM/W9FDqYaRYe0Qw2YbSeMoM0S+rY/NFp/XyFgv jFc1wRHx2I55nWpib5/zg7V+aRYN25LHx/tD27UgnUYxCi887GcM3n3UFftH+ijkrGKY TIlANhAGkBILk0j01SuWILKsjurPq5GzAdGBTiwvGryMi5xAqY9dhVR/C/dzmj+igDEj d9MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t+LIjSQQZkRT5kA7Y1VVVn+LaJzyPGxbVa/mAnWmpfM=; b=Is4uNQIiJnAMOEBoxRwaTGJ1Z+YVM/3GrnsqRBT8QPzQ2uBobN0IJvzpKUurlshm0A Sp6uPs05L27ugV/y7m/A5IEd6BdX4cv2a84nPRWbr5rltkEYSHefBtk/A6oawg9xF260 m//cJ1HPIPqjOP0NXQMQDm9ARtsryZ7W/ZaKPMtNRwspEeVyBxmQsemiKYT5VVFUt04K ESXqNJTrlWARfq+4nEFMIg7mKZETllo1FZVYI6rciAtPJYCX06OPr+NDxUqnr94mcgcx 24EYHMLwROeylSDeP7IEqKnkv3zf/746kgjyjnNX2Y34bmO7/askHeq70HtHYYEdb47l lR5Q== X-Gm-Message-State: AOAM5306qMSyh+yqRS0OhT3VFRyW2Gc+MK899fc9svZsm1AzTZbVpaft /Z0IuE7+brfKJ3MxUo4vyWcPPw== X-Received: by 2002:a17:906:94d2:: with SMTP id d18mr8129364ejy.94.1610702783791; Fri, 15 Jan 2021 01:26:23 -0800 (PST) Received: from localhost.localdomain (hst-221-63.medicom.bg. [84.238.221.63]) by smtp.gmail.com with ESMTPSA id u24sm3004140eje.71.2021.01.15.01.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 01:26:23 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Hans Verkuil , Stanimir Varbanov Subject: [PATCH v2 1/4] v4l2-ctrl: Make display delay and display enable std controls Date: Fri, 15 Jan 2021 11:26:04 +0200 Message-Id: <20210115092607.29849-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210115092607.29849-1-stanimir.varbanov@linaro.org> References: <20210115092607.29849-1-stanimir.varbanov@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Make display delay and display delay enable MFC controls standard v4l controls. This will allow reuse of the controls for other decoder drivers. Also the new proposed controls are now codec agnostic because they could be used for any codec. Signed-off-by: Stanimir Varbanov --- .../userspace-api/media/v4l/ext-ctrls-codec.rst | 15 +++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++ include/uapi/linux/v4l2-controls.h | 3 +++ 3 files changed, 22 insertions(+) -- 2.17.1 diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index 00944e97d638..5d7c47837035 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -679,6 +679,21 @@ enum v4l2_mpeg_video_frame_skip_mode - otherwise the decoder expects a single frame in per buffer. Applicable to the decoder, all codecs. +``V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (boolean)`` + If the display delay is enabled then the decoder is forced to return + a CAPTURE buffer (decoded frame) after processing a certain number + of OUTPUT buffers. The delay can be set through + ``V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY``. This + feature can be used for example for generating thumbnails of videos. + Applicable to the decoder. + +``V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (integer)`` + Display delay value for decoder. The decoder is forced to + return a decoded frame after the set 'display delay' number of + frames. If this number is low it may result in frames returned out + of display order, in addition the hardware may still be using the + returned buffer as a reference picture for subsequent frames. + ``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (boolean)`` Enable writing sample aspect ratio in the Video Usability Information. Applicable to the H264 encoder. diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index f7b310240af2..2ae305d6db01 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -874,6 +874,8 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_HEADER_MODE: return "Sequence Header Mode"; case V4L2_CID_MPEG_VIDEO_MAX_REF_PIC: return "Max Number of Reference Pics"; case V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE: return "Frame Skip Mode"; + case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY: return "Display Delay"; + case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE: return "Display Delay Enable"; case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP: return "H263 I-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP: return "H263 P-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP: return "H263 B-Frame QP Value"; @@ -1241,6 +1243,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_FLASH_READY: case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE: + case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE: case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE: case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE: case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM: @@ -1276,6 +1279,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, break; case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE: case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: + case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY: *type = V4L2_CTRL_TYPE_INTEGER; break; case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 039c0d7add1b..4b361fdce231 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -797,6 +797,9 @@ enum v4l2_mpeg_video_frame_skip_mode { #define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MIN_QP (V4L2_CID_CODEC_BASE + 651) #define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MAX_QP (V4L2_CID_CODEC_BASE + 652) +#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (V4L2_CID_CODEC_BASE + 653) +#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (V4L2_CID_CODEC_BASE + 654) + /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ #define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000) #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+0)