Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2090766imd; Fri, 2 Nov 2018 05:58:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5eoA7GzUni3DBIZQTr72SFIniPCXI1g7WM139E/xtqLyMbsnQQ83yiMd3e2ZxUzR88Vpl+i X-Received: by 2002:a17:902:64:: with SMTP id 91-v6mr11712525pla.161.1541163528227; Fri, 02 Nov 2018 05:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541163528; cv=none; d=google.com; s=arc-20160816; b=qyks2Ox3HNqZXzqBvDIFrt/uLJuyf/kMYAGe4m8PKjVCxIRsabkZ5Xiw0p/XW/Uj0m +5Zg3FHagPbIVIyFMTkkESLLmGzXZtcJTRG5Srr47Ot5qZcOakYCUFl8mhwM/mrmtcfA YQlhd85utYsdpvxxk8Dvi5na6It7uu7cpjKw31fj9Gns5tsYXCtEFr8wCWQLOVAWYP90 MsLLS81P6Nc/DvPhoH5eY62VuYH7a/2mt0dGZrE1bsfjPB/72mBRUzqjpNMhoaGAYKGy 5X1XeoBRsbiE8B6hVQafynPdsRTu19Ob1wKg+0gcvYNzJku8+jznBGyB40WocvfiR7Nh FL1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Yy7MidC1NEeu6yHZFeJGH1gAQAZubwcT5/OZEpO1Z9c=; b=uSSjUaT7id+YMmSz7LDm8ccqx4KCuE+ABxl5kWCKW4RYBRRc8kWZpeCWI9baENbBZ7 OtJRkLp+lCrqml39cNR9uFW6ko1n1udKEboY+muJ45Y52y7r0IyPxz/ug7maf0B/FpKG /R7z2RhCI7FWCMvREbK+FiAvhSEl7Q6MDRNTXYrOLPfoSgXoHt2mXUQq+EDepqVqqtpU 0IvpCzp1QDxF4SCmHMDdEIPe3AT0gu0pNjqJ7tu/3wINeGoeVSeX3fhoX4c2VeDkWKKn mPDwHa6s9AzNWsNR7vn9Qc74BN3qJr5aan6pkFBCnlnv8/jGU1tSal9NnOCHiDZVB+F/ 446g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si11738124pge.18.2018.11.02.05.58.32; Fri, 02 Nov 2018 05:58:48 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbeKBWFH (ORCPT + 99 others); Fri, 2 Nov 2018 18:05:07 -0400 Received: from alexa-out-blr-02.qualcomm.com ([103.229.18.198]:25330 "EHLO alexa-out-blr.qualcomm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726200AbeKBWFH (ORCPT ); Fri, 2 Nov 2018 18:05:07 -0400 X-IronPort-AV: E=Sophos;i="5.54,455,1534789800"; d="scan'208";a="227543" Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by alexa-out-blr.qualcomm.com with ESMTP/TLS/AES256-SHA; 02 Nov 2018 18:27:59 +0530 X-IronPort-AV: E=McAfee;i="5900,7806,9064"; a="5622443" Received: from mgottam-linux.qualcomm.com ([10.204.65.20]) by ironmsg01-blr.qualcomm.com with ESMTP; 02 Nov 2018 18:27:57 +0530 Received: by mgottam-linux.qualcomm.com (Postfix, from userid 2305155) id DB18D1D4A; Fri, 2 Nov 2018 18:27:57 +0530 (IST) From: Malathi Gottam To: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, acourbot@chromium.org, vgarodia@codeaurora.org, mgottam@codeaurora.org Subject: [PATCH v3] media: venus: add support for key frame Date: Fri, 2 Nov 2018 18:27:56 +0530 Message-Id: <1541163476-23249-1-git-send-email-mgottam@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When client requests for a keyframe, set the property to hardware to generate the sync frame. Signed-off-by: Malathi Gottam --- drivers/media/platform/qcom/venus/venc_ctrls.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index 45910172..59fe7fc 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -79,8 +79,10 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) { struct venus_inst *inst = ctrl_to_inst(ctrl); struct venc_controls *ctr = &inst->controls.enc; + struct hfi_enable en = { .enable = 1 }; u32 bframes; int ret; + u32 ptype; switch (ctrl->id) { case V4L2_CID_MPEG_VIDEO_BITRATE_MODE: @@ -173,6 +175,19 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) ctr->num_b_frames = bframes; break; + case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: + mutex_lock(&inst->lock); + if (inst->streamon_out && inst->streamon_cap) { + ptype = HFI_PROPERTY_CONFIG_VENC_REQUEST_SYNC_FRAME; + ret = hfi_session_set_property(inst, ptype, &en); + + if (ret) { + mutex_unlock(&inst->lock); + return ret; + } + } + mutex_unlock(&inst->lock); + break; default: return -EINVAL; } @@ -188,7 +203,7 @@ int venc_ctrl_init(struct venus_inst *inst) { int ret; - ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 27); + ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 28); if (ret) return ret; @@ -309,6 +324,9 @@ int venc_ctrl_init(struct venus_inst *inst) v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, V4L2_CID_MPEG_VIDEO_H264_I_PERIOD, 0, (1 << 16) - 1, 1, 0); + v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, + V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME, 0, 0, 0, 0); + ret = inst->ctrl_handler.error; if (ret) goto err; -- 1.9.1