From patchwork Tue Jul 12 12:23:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswanath Boma X-Patchwork-Id: 12914894 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B11C5C43334 for ; Tue, 12 Jul 2022 12:24:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbiGLMYT (ORCPT ); Tue, 12 Jul 2022 08:24:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232278AbiGLMYS (ORCPT ); Tue, 12 Jul 2022 08:24:18 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BEA5A5E52; Tue, 12 Jul 2022 05:24:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1657628656; x=1689164656; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=NZcIxal9HP23HwdA1OYoFpYvchF31b6+LHpnoM9W5FA=; b=pmaJnJqG6JnmtfXgqPqYaN8mOG+7R5GHBUC6b2yY4fmyOeeBQPj+2f8Z URKxgqFRKt5+hp9GSW2CZcRgIpEjo3QO6/u/rrbmwgqT860CoX4a2u9bh qTeuvTIrokwwrArl7GmaInCCvZ/JS/ZoIcHmMmNWkXT/wOtwTA7nUnI7s M=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 12 Jul 2022 05:24:16 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 12 Jul 2022 05:24:14 -0700 X-QCInternal: smtphost Received: from vboma-linux.qualcomm.com ([10.204.65.94]) by ironmsg01-blr.qualcomm.com with ESMTP; 12 Jul 2022 17:54:07 +0530 Received: by vboma-linux.qualcomm.com (Postfix, from userid 72083) id BEF5E900883; Tue, 12 Jul 2022 17:54:06 +0530 (IST) From: Viswanath Boma To: video.upstream.external@qti.qualcomm.com, Stanimir Varbanov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Viswanath Boma Subject: [PATCH 4/7] venus : Addition of EOS Event support for Encoder Date: Tue, 12 Jul 2022 17:53:44 +0530 Message-Id: <20220712122347.6781-4-quic_vboma@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220712122347.6781-1-quic_vboma@quicinc.com> References: <20220712122347.6781-1-quic_vboma@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org V4l2 encoder compliance expecting End of sream Event registration support for Encoder. Change-Id: I85f7732a2ec08eba47c0d37181f739e90a7ab63a Signed-off-by: Viswanath Boma Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/venc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index b56960d7f6c89..30ddb84c24997 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -507,6 +507,20 @@ static int venc_enum_frameintervals(struct file *file, void *fh, return 0; } +static int venc_subscribe_event(struct v4l2_fh *fh, + const struct v4l2_event_subscription *sub) +{ + + switch (sub->type) { + case V4L2_EVENT_EOS: + return v4l2_event_subscribe(fh, sub, 2, NULL); + case V4L2_EVENT_CTRL: + return v4l2_ctrl_subscribe_event(fh, sub); + default: + return -EINVAL; + } +} + static int venc_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd) { @@ -572,7 +586,7 @@ static const struct v4l2_ioctl_ops venc_ioctl_ops = { .vidioc_g_parm = venc_g_parm, .vidioc_enum_framesizes = venc_enum_framesizes, .vidioc_enum_frameintervals = venc_enum_frameintervals, - .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, + .vidioc_subscribe_event = venc_subscribe_event, .vidioc_unsubscribe_event = v4l2_event_unsubscribe, .vidioc_encoder_cmd = venc_encoder_cmd, };