Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp629579ima; Wed, 24 Oct 2018 06:54:15 -0700 (PDT) X-Google-Smtp-Source: AJdET5ee8CXvprYySgN8BnW63Fj2snjXtKCM0cmTVLbaLqcfan8e15nYVSweXXUtoZNBbErUblox X-Received: by 2002:a17:902:1004:: with SMTP id b4-v6mr2581171pla.172.1540389255856; Wed, 24 Oct 2018 06:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540389255; cv=none; d=google.com; s=arc-20160816; b=PZPyD5HNtb7cLYsYOb9njOXcsXHr/uxViYQjHw+G61cN03ODO6vUCHjwMGY7u4szbv LyMNBFxKrTyYZPd8rEbATNAQZGWA+W/EeHGBWU4Paeia6pgg1PDhl4VHnGEe3E6fAKsV wj6X5/VGLInNFISpEgIwNK/oKwsZBZ1DV5gXDmw6p0b2Loe6FSkY129wski/xggU1BqO F2Cz8Ds21dArKmEyCqcBBfwP/nzlGAOjS8jQZsAmZ3Q04gzvo/LvBGlSTLi9zJ6MBjTV /VnVTl7ADcEcpc7iZgZ+rvO91uRL8Pk5px8M2RMrdGNDCmoKEoiwPmU0jOBuuy/qF0r0 Z4IA== 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=mev91gs/bIwgbCQt1o4odxzwuiZXAsEPDMJv72cSmMw=; b=nW7e6uKjpwIWujIwEleVFPCbNB3snM94s2Sl3ymlx52voPx60CzxxsJgarK5MWSMIb F8xKVDMvSETPWjSp1QrRYEa0ulBeDfyCUmbQOlkZzXwG8uM82+TudIz8PFJH/HYu4ruG HQ0ki73f6BJy69hGAhrM6HcKujrHNDn6uxyrCHcfnOxuDQJ1nOgku9IpzbeUhJrgLlO0 Zclv9xG/AvL7jyr4QGMiZm5bLqFPYcJZGwAMzpTEVfHNZ0/aCO7FZzOM2I5+ge6k9Fo3 qZOK2vxUhWMnz9IWh2vXcaWqiCZ6YNJg2HD8QyDD6BKHqyBOyt/CvqgaDyIzpndZsssk SFGw== 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 a20-v6si145290plm.397.2018.10.24.06.53.59; Wed, 24 Oct 2018 06:54:15 -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 S1727126AbeJXWVA (ORCPT + 99 others); Wed, 24 Oct 2018 18:21:00 -0400 Received: from alexa-out-blr-01.qualcomm.com ([103.229.18.197]:4626 "EHLO alexa-out-blr-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbeJXWVA (ORCPT ); Wed, 24 Oct 2018 18:21:00 -0400 X-IronPort-AV: E=Sophos;i="5.54,420,1534789800"; d="scan'208";a="259607" Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by alexa-out-blr-01.qualcomm.com with ESMTP/TLS/AES256-SHA; 24 Oct 2018 19:22:45 +0530 X-IronPort-AV: E=McAfee;i="5900,7806,9055"; a="4810413" Received: from mgottam-linux.qualcomm.com ([10.204.66.66]) by ironmsg02-blr.qualcomm.com with ESMTP; 24 Oct 2018 19:22:45 +0530 Received: by mgottam-linux.qualcomm.com (Postfix, from userid 2305155) id 3E1463063; Wed, 24 Oct 2018 19:22:44 +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 v2] media: venus: add support for key frame Date: Wed, 24 Oct 2018 19:22:42 +0530 Message-Id: <1540389162-30358-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 | 16 +++++++++++++++- 1 file changed, 15 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..6c2655d 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,15 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) ctr->num_b_frames = bframes; break; + case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: + 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) + return ret; + } + break; default: return -EINVAL; } @@ -188,7 +199,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 +320,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