Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3508369pxb; Mon, 24 Jan 2022 11:02:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPFNm+oM5vOpCwrzMfdI2xs6GUZyr8Bj//yJtSPAj8O1xYRdImZtvw1zZkuF97wDys6h6H X-Received: by 2002:a17:90a:6c62:: with SMTP id x89mr1346153pjj.48.1643050939352; Mon, 24 Jan 2022 11:02:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643050939; cv=none; d=google.com; s=arc-20160816; b=wVrQE9bC8GRaMKyNlU/9OKPhSGjmrdeOC6Z/B01YST5/5xSfGEYt+QFwkCj0qOumic wL1O5nnnW/OOG6js+A+hBmhD1nC8KvanF0apzgvhgys4wkfa6y51HPBbuyEl33RxprIN RHtlXHfAgpN579GP9sdbNCUaLWHPrb8GkVecT7md6opIhGwDC+VwQAvKk//MSMx+GxKU Q3dLpUGvYrBBBCHhjh9FRXMCnEUw3Dx+hqGNinGRU5zE3Qkd9s6Q3U4iv8I0zrv5jOKc 516lEKkEQK8H6EzU32NY4raJ0lFYVNZ0ivmbX4kOX1Tq7BukidAfmQLsLeuGBZe7OSD4 AoAA== 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=vm5DiUTCEYkRlWg/Yqxo3brxvgvVfzsEds8Oz6/FlS0=; b=j2qROH0QJySEKhsyYedA+ZbgE9vLa1j2YDlyNNs80fNit6tz4qr3V00KMDQ+xN9ahf 6BOXpM6tAsRihNSIBGclJu3EK7Ybc4idF3aFm+k590k04bFHSBR2mZJ/JzEA3xDEnztw D6rgSm+Wa6QrEnpbZf9PXbS+uqR0Wm+ppRcLx1oJTN84qmS1WVyxGhaSBECZuoNKjafo B0peCYlPaGZd3RK8bAvvQwLA4Q+zJabRtIzQc2MVBYvtBDd+/m3jXgBD4zs78qxEWtoL hkBAtNi9+5smKoemYWWeBW+ZKKbfh4EL+rXc7MzhFMVBvHnsQ6JaKeRp7A1tfBpyp3U0 QPrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@qti.qualcomm.com header.s=qcdkim header.b=FKrXGnsM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=qti.qualcomm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ju17si123306pjb.151.2022.01.24.11.02.05; Mon, 24 Jan 2022 11:02:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@qti.qualcomm.com header.s=qcdkim header.b=FKrXGnsM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=qti.qualcomm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237001AbiAXKMi (ORCPT + 99 others); Mon, 24 Jan 2022 05:12:38 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:35778 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235866AbiAXKMg (ORCPT ); Mon, 24 Jan 2022 05:12:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1643019156; x=1674555156; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=SmeMy60LdpA36LqQOAGJvLI4Z67XOS7PNX+kDj8r1rY=; b=FKrXGnsMrXNbS8Hb1T3HO7Uz3B9caabfdSWfjMq1yIDS4nZotZriTdvI aUyd5jUsnMSRlPyYvM9Bok88iW45PwODd95v9Y21BVELKtvdjM3e9stV5 Za3hD3llRijVl8EwwfQNrx/nakt4tXkHcNNFmrcsRNRsL4ctdxGSRWfAD Q=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 24 Jan 2022 02:12:36 -0800 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 24 Jan 2022 02:12:34 -0800 X-QCInternal: smtphost Received: from hu-dikshita-hyd.qualcomm.com (HELO hu-sgudaval-hyd.qualcomm.com) ([10.213.110.13]) by ironmsg01-blr.qualcomm.com with ESMTP; 24 Jan 2022 15:42:21 +0530 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id DB41244ED; Mon, 24 Jan 2022 15:42:19 +0530 (+0530) From: Dikshita Agarwal To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, ezequiel@collabora.com, vgarodia@codeaurora.org, stanimir.varbanov@linaro.org, Dikshita Agarwal Subject: [PATCH v1 2/2] venus: venc: Add support for intra-refresh mode Date: Mon, 24 Jan 2022 15:41:59 +0530 Message-Id: <1643019119-8309-3-git-send-email-dikshita@qti.qualcomm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1643019119-8309-1-git-send-email-dikshita@qti.qualcomm.com> References: <1643019119-8309-1-git-send-email-dikshita@qti.qualcomm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dikshita Agarwal Add support for intra-refresh type v4l2 control. Signed-off-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/core.h | 1 + drivers/media/platform/qcom/venus/venc.c | 3 ++- drivers/media/platform/qcom/venus/venc_ctrls.c | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 7c3bac0..814ec3c 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -260,6 +260,7 @@ struct venc_controls { u32 header_mode; bool aud_enable; + u32 intra_refresh_mode; u32 intra_refresh_period; struct { diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 84bafc3..e8b8135 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -893,8 +893,9 @@ static int venc_set_properties(struct venus_inst *inst) mbs++; mbs /= ctr->intra_refresh_period; - intra_refresh.mode = HFI_INTRA_REFRESH_RANDOM; intra_refresh.cir_mbs = mbs; + if (ctr->intra_refresh_mode == V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_RANDOM) + intra_refresh.mode = HFI_INTRA_REFRESH_RANDOM; } ptype = HFI_PROPERTY_PARAM_VENC_INTRA_REFRESH; diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index 1ada42d..c54b46f 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -316,6 +316,9 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY: ctr->mastering = *ctrl->p_new.p_hdr10_mastering; break; + case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_TYPE: + ctr->intra_refresh_mode = ctrl->val; + break; case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD: ctr->intra_refresh_period = ctrl->val; break; @@ -582,6 +585,11 @@ int venc_ctrl_init(struct venus_inst *inst) V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY, v4l2_ctrl_ptr_create(NULL)); + v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops, + V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_TYPE, + V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_RANDOM, + 0, V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_RANDOM); + v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD, 0, ((4096 * 2304) >> 8), 1, 0); -- 2.7.4