From patchwork Mon Aug 8 09:28:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswanath Boma X-Patchwork-Id: 12938608 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 18AF4C25B0C for ; Mon, 8 Aug 2022 09:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242401AbiHHJbb (ORCPT ); Mon, 8 Aug 2022 05:31:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242392AbiHHJba (ORCPT ); Mon, 8 Aug 2022 05:31:30 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 641D62BC6; Mon, 8 Aug 2022 02:31:29 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2788eR7O028936; Mon, 8 Aug 2022 09:31:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=UaFdHaU9+pXeMOdy26VTVzNrFX4wxCgPhgOArXVCeB4=; b=BfK/bPDzVQvXSTtdx4a0t+PoWzoin+CZ0HfA8KmOC6eJqGQ6/VLIAkYiP6hPFYlq37dn rzt1r5fcZDj2lX2HAFuWpUVv9oGaagxXBdeSbW+kfDUc1uoPcHX13gAWs5o2r3yojivp r45BrljiicO3ETL+/r9+AJLUBUiGVbBY5I62zVevg8eZVxGszcM50nB/JnvMzB+XQG9n wjQ5c4MPdbFRE2T46Da8qg3slvKmwSvyJp5ZYgMUHcqV+m0T8lpVefW44TVWhG5xWUX6 CZNBqajCMH0ZaLVk19D0RRCPUk4ktPTFgPx2TXOY2U7sOzf5q6+djkMto2Ptezz3mA7/ ag== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3hshkeb06y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Aug 2022 09:31:01 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 2789UwOq018462; Mon, 8 Aug 2022 09:30:58 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3hshckgpmf-1; Mon, 08 Aug 2022 09:30:58 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2789UspS018414; Mon, 8 Aug 2022 09:30:58 GMT Received: from vboma-linux.qualcomm.com (vboma-linux.qualcomm.com [10.204.65.94]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 2789UvKc018453; Mon, 08 Aug 2022 09:30:57 +0000 Received: by vboma-linux.qualcomm.com (Postfix, from userid 72083) id 0C2BE900883; Mon, 8 Aug 2022 15:00:56 +0530 (IST) From: quic_vboma@quicinc.com To: 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 , Vikash Garodia , Dikshita Agarwal Subject: [PATCH V2 4/7] venus : Addition of EOS Event support for Encoder Date: Mon, 8 Aug 2022 14:58:31 +0530 Message-Id: <20220808092834.29775-5-quic_vboma@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220808092834.29775-1-quic_vboma@quicinc.com> References: <20220712122347.6781-1-quic_vboma@quicinc.com> <20220808092834.29775-1-quic_vboma@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: m00kLVQ6df8NEWgJYFa4cnyFQGv4P-5r X-Proofpoint-GUID: m00kLVQ6df8NEWgJYFa4cnyFQGv4P-5r X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-08_06,2022-08-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 mlxscore=0 phishscore=0 clxscore=1011 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208080047 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Viswanath Boma V4l2 encoder compliance expecting End of stream Event registration support for Encoder. Acked-by: Stanimir Varbanov Signed-off-by: Viswanath Boma Signed-off-by: Vikash Garodia Signed-off-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/venc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index b56960d7f6c89..17312d316f93d 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -507,6 +507,19 @@ 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 +585,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, };