Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4545372imm; Tue, 9 Oct 2018 01:01:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV63wt7zy1wl+aaGrTGVV1o+z1JYeE7ae31LuT7I7kbJIaG3/oAk13ly47uRNIFvnD6/Z5TeE X-Received: by 2002:a63:1d10:: with SMTP id d16-v6mr23523577pgd.228.1539072064016; Tue, 09 Oct 2018 01:01:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539072063; cv=none; d=google.com; s=arc-20160816; b=QolbGt8/ZP+u2Y/osGh47p39U6YHj9BxysI3MvthB16e2zu6Ovq7I655exgKx6yI4s KUddAhp+KxnCtgpPtRv1CgP9wb7SxHnq7V5lzj9Lj7SXiFW3ETqn4xuOyehFJ/NVmD6E ecKTHAarCrl/A4i7AUhf8u9u79qIHZW4jrurRYSwJG6iH+ObYc2UZGUEDGVrgOnzxfG+ +RBFwbe8rDHafA05lq9/+YK82Cc2IPOeIFJgAP1wBTfDswyAZnFRJP82jBWnH2X0eLEQ SyColOVcdbi3/kxDSE9MvMrEfWa9oH58cKCI49a/9KDCADLNrlxmlAOtV90I/99enLVP ENSw== 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=6HD6jBHTQBOX61dwf8arS7WCgOAmxOR/Y+g9pFWBiuU=; b=JL2atIkZHuj1iRP+xIq+wWJ4TcFo8nOLL6t4fmbAGV8Fkdlf7Nw8C4Nu6N7hGG3ew4 lWOEWAv/Y+bh8VtOtVoyn29bBrWLc8H1dNLrNSBLFyLFSpnoRuprd/oV6kUAGyX1LBzJ 8g7hJ9Mv1hOzhDXFgqG7uDLla4WkpVgsTXvkpBxR2Sr+bL3BpKmwh+IQHMiHPt/4A7T5 HmuS60o6qfefL0krK+/zS1/wt83SjCA/43oEuxoK5Zd0066epnAz7judMNbTOiVtXpVj zXbi4FZsG5BYPBCbIhTGNaRg5CyftMKwf705D/PsGl5LY4FkclW4LX27NAyaKgIlaEmj D0Tw== 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 u66-v6si20354571pgu.94.2018.10.09.01.00.49; Tue, 09 Oct 2018 01:01:03 -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 S1726985AbeJIPP6 (ORCPT + 99 others); Tue, 9 Oct 2018 11:15:58 -0400 Received: from alexa-out-blr-01.qualcomm.com ([103.229.18.197]:35662 "EHLO alexa-out-blr-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbeJIPP6 (ORCPT ); Tue, 9 Oct 2018 11:15:58 -0400 X-IronPort-AV: E=Sophos;i="5.54,359,1534789800"; d="scan'208";a="240336" Received: from ironmsg03-blr.qualcomm.com ([10.86.208.132]) by alexa-out-blr-01.qualcomm.com with ESMTP/TLS/AES256-SHA; 09 Oct 2018 13:24:02 +0530 X-IronPort-AV: E=McAfee;i="5900,7806,9040"; a="1605185" Received: from mgottam-linux.qualcomm.com ([10.204.66.66]) by ironmsg03-blr.qualcomm.com with ESMTP; 09 Oct 2018 13:24:01 +0530 Received: by mgottam-linux.qualcomm.com (Postfix, from userid 2305155) id 6DA732E3B; Tue, 9 Oct 2018 13:24:00 +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] media: venus: add support for key frame Date: Tue, 9 Oct 2018 13:23:54 +0530 Message-Id: <1539071634-1644-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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index 45910172..f332c8e 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -81,6 +81,8 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) struct venc_controls *ctr = &inst->controls.enc; u32 bframes; int ret; + void *ptr; + u32 ptype; switch (ctrl->id) { case V4L2_CID_MPEG_VIDEO_BITRATE_MODE: @@ -173,6 +175,14 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) ctr->num_b_frames = bframes; break; + case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: + ptype = HFI_PROPERTY_CONFIG_VENC_REQUEST_SYNC_FRAME; + ret = hfi_session_set_property(inst, ptype, ptr); + + if (ret) + return ret; + + break; default: return -EINVAL; } @@ -309,6 +319,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