Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2794239pxp; Mon, 14 Mar 2022 05:13:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRW8lDJNSIHRsYJ/qghnJscY4kH+/eiLYZGLpGt7xDLMWyvzGKYjaWTZlEk1AtBt+Tf0tY X-Received: by 2002:a17:907:96a6:b0:6db:1d4a:a8ed with SMTP id hd38-20020a17090796a600b006db1d4aa8edmr17914603ejc.317.1647260032877; Mon, 14 Mar 2022 05:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647260032; cv=none; d=google.com; s=arc-20160816; b=OEx1CO5T+ZB148ovqSOm1jwXTgLMqfgTvOR31i7R1pJW6C7dJPHivpoht9Pw7kKMX5 2/YvXO+CQ+FwxL3vfuC69+pfX6fEmHfvSLYCrSB1lTyvJJD252xqEzBEkkhJ0xElt5Yv ntOVfcAZcMLUeWXe9t3qdJzV6OWkVqKRQ+yAoM3vePvnuqr8bWQCeValzwft0FdB8CTq OFd1HIUeXeIwzWDtxNQj2WnBTPwRBd6AoixUzHfDeKieOXqHijA813V9ck6kQCc2Y14G iswkREqJaR+SHeyPoHzmrQC9ylBjf3pDdg2cQ512LjJZINhcd8BM6YldzkY2QhQpsKNA 983g== 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=lgDgw7JUqhwuHbJ39Pz9/PzeSGbaXLF0Pt+mQfAdgGA=; b=Hf32IGLWWyzH9NdD1bxXa92SOMbdsJ1guPJZcOBGiTaCnUvxWdI+0OAAigj8LLOyxc oN6cLpSpELLBoxUVv1XDP0rAkedx2FL7zgeUgbr35v/pJgu8AWctsSKp7p7zN+0wArzX WzdhGeh72Iui/rRgfPCNxUuFTwCtizzOWn3kJkLDlghQCV2SEXdWa2tyQCp8AwDtEdYx 2nYJ2nsz+ORWQ883+N0x8BNNq9nl9JZ/yxFeLjy6Th+PGa2T6YtzBpwrAf2IViiLwrGL s5Ntz5Aod3ZRoxu+sESy4iOP8wywEigYKI1DZRSQwMbWCUrNp/uWVk6yZn7QCI4Oxbof Wm1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=rJAIv9D1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg14-20020a170907a40e00b006db0979d43csi9713152ejc.182.2022.03.14.05.13.27; Mon, 14 Mar 2022 05:13:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=rJAIv9D1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237521AbiCNIGn (ORCPT + 99 others); Mon, 14 Mar 2022 04:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238752AbiCNIEg (ORCPT ); Mon, 14 Mar 2022 04:04:36 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81B7B3CA69; Mon, 14 Mar 2022 01:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1647244931; x=1678780931; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=lgDgw7JUqhwuHbJ39Pz9/PzeSGbaXLF0Pt+mQfAdgGA=; b=rJAIv9D18R+aOiA8Jk5pHpG504y7YORC+AiV1y/5vKtwoVFj2NT0qb68 RkKpahNVuTM/DOxRRVEY3OJ+STUgH1UpNaVHeOgH2TktvemybCjY8dswx n+9EMsikIzxAtbecWJjr58xT59/d09YAmr4ZkfCfTOhjGUIHJdNHZcr1W s=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 14 Mar 2022 01:00:24 -0700 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 14 Mar 2022 01:00:22 -0700 X-QCInternal: smtphost Received: from hu-dikshita-hyd.qualcomm.com (HELO hu-sgudaval-hyd.qualcomm.com) ([10.213.110.13]) by ironmsg02-blr.qualcomm.com with ESMTP; 14 Mar 2022 13:30:21 +0530 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id DB964467A; Mon, 14 Mar 2022 13:30:19 +0530 (+0530) From: quic_dikshita@quicinc.com To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, hverkuil-cisco@xs4all.nl Cc: linux-arm-msm@vger.kernel.org, ezequiel@collabora.com, stanimir.varbanov@linaro.org, quic_vgarodia@quicinc.com, quic_majja@quicinc.com, quic_jdas@quicinc.com, Dikshita Agarwal Subject: [PATCH v3 2/2] venus: venc: Add support for intra-refresh mode Date: Mon, 14 Mar 2022 13:30:09 +0530 Message-Id: <1647244809-25340-3-git-send-email-quic_dikshita@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1647244809-25340-1-git-send-email-quic_dikshita@quicinc.com> References: <1647244809-25340-1-git-send-email-quic_dikshita@quicinc.com> X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 | 4 +++- drivers/media/platform/qcom/venus/venc_ctrls.c | 8 ++++++++ 3 files changed, 12 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..3b38624 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -893,8 +893,10 @@ 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_PERIOD_TYPE_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..29dbe3b4 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_PERIOD_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_PERIOD_TYPE, + V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_RANDOM, + 0, V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_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