Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3007482pxb; Tue, 12 Jan 2021 04:12:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzf6afzOkotpcBJ22pPmhj+D6SU+ZNTbj39r97iv0EMq2Qpx9uWLi4n1G+kvC/gKZrjvo1s X-Received: by 2002:a50:f304:: with SMTP id p4mr3085236edm.118.1610453531593; Tue, 12 Jan 2021 04:12:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610453531; cv=none; d=google.com; s=arc-20160816; b=K7pPwZ4c5ng7zGqqeW1AXVIRmTiVHrsSPJXJuYnLdlYUDRthUzKXuksiPSQSKKdFqw BaGMLlkD5dc/9SXN/lq+PEGQt2xXeF6mQvusyzGK/32nEK/lm3wU6soxzvXF96Pf8oPk n2E2OR70uOsZwYNQ7rKP/H2Of7vNlicz2XRjdYX+2tG9iMn6qFqvsB5wFDDZTSE1DDC4 kWNNHTO92fWZnKfMaRw3uc7RiJatWI9zQZhymWxeaMFcBv3n+ibHtzZCHTMuijmqxxAq xBx8Bu8m7DoACpl0OigVmJcPrYrLqDYbcBr8JM3hue3V0Q9KxHwfPykinVZurwYJrGfU LWzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=w+eQNhQZnKJAllfIzv3g8UL7ixvpbCSLuEatvY5u/XI=; b=LGU1C2/IJTO52KeABAEsetOUAo+uNuvYl48BfDO1WyIdehqCMToYi2vURnfIVMGVYa ux0P3pqgTWsoK8EDL/NogsZTUjjKlkxI/HTBI4MIoaEQWkDTq4aF6ymSkUcWRTjBN+sr RVghZq4sbc95E5EsKhOQEOO/BBubccVZpy5jMDyf1zMbk9dRoWcsrzd1+2vFhiAiFZzX 8tZyd7QGLKEDhfXnfnkBOLvnJmcKcSJT25t4I+LRuHXyAqOhEvOXEtXPZZPphDmIpgaY Pa04Ea4cps+6Lr8evz/CSUkdYrEkeSMjczCN1iLlooBqx+vHGt358yp9UeyammDdfLJ8 dKoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b="KBbY/P7m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si1137691eda.177.2021.01.12.04.11.48; Tue, 12 Jan 2021 04:12:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b="KBbY/P7m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389422AbhALJFY (ORCPT + 99 others); Tue, 12 Jan 2021 04:05:24 -0500 Received: from lb3-smtp-cloud9.xs4all.net ([194.109.24.30]:60527 "EHLO lb3-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388856AbhALJFS (ORCPT ); Tue, 12 Jan 2021 04:05:18 -0500 Received: from cust-b5b5937f ([IPv6:fc0c:c16d:66b8:757f:c639:739b:9d66:799d]) by smtp-cloud9.xs4all.net with ESMTPA id zFbIkDFNAVfyLzFbLkopWg; Tue, 12 Jan 2021 10:04:31 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s2; t=1610442271; bh=w+eQNhQZnKJAllfIzv3g8UL7ixvpbCSLuEatvY5u/XI=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From: Subject; b=KBbY/P7mJw0U7W6AdLzOqfUcXsIvbj3VuzH2QfSeFCuPeFlsDUbPo321JOY711RVQ jkVL714w1GHgf3zdqlU+8jjm3z/wPele3KaPgZrrFDvGJszmpnG/y4OdOCdl3Q2BBL 6KubodHq54gb5Wc+vBOb8RPTdVq1cHDrliCD58s/V7mcf+UwSQOPR7fAD8R3pZdWAG BZE9VkyCXq70RoctikkJA+MnS0PxLBklpoH3t6CL0gH3iHqVBaSMjrwCzXc9XAOwLr rnSh57fRdo4Z/3D0kS+LNrC1X4FA2NUP3aWSsL5GJyxDYPxsUr3fq2E/n0qvLKGc6N +Bi48mk0NsNpA== Subject: Re: [PATCH v5 2/2] venus: venc: Add support for Long Term Reference (LTR) controls To: Dikshita Agarwal , linux-media@vger.kernel.org, stanimir.varbanov@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org References: <1609736971-14454-1-git-send-email-dikshita@codeaurora.org> <1609736971-14454-3-git-send-email-dikshita@codeaurora.org> From: Hans Verkuil Message-ID: Date: Tue, 12 Jan 2021 10:04:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <1609736971-14454-3-git-send-email-dikshita@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfNfNVDt7xI9xuvE28pakTe/RciRNCg7GGlZTvFiXs8nhuSsM/ARLZqkNolvXYjUWI8q6xAPEXTm2qTPk6C+KMppHZhHyxC90OftYJ9yerdRsdF9oqWS3 cnhrppwA5Tyqp9piHy0BO39n0rDMTTwJpHnjX+8VLuWA8W6+XxcTPbGZTzySN0FD29Y8BqVsCPDMBtn1U+Zc9pdr/iKbZAscijqEPHsBI8gFzOJJqZGC+1QD YOv8U9x+XdRYDX/aE7WMhaFPd7xrtrkI2lrdbasAIL1hLn5U6aEdTqzFEyirJAWY29nnGnCZpjvHJ4BjdFB2nJRcWPwzaeC47fb2nxTvqmPpmjDp77JGbzJS E1AcqhLtfOJjLWXky8GiDXcF8QutnMX7n4fbCntvmVGw2YQleis= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/01/2021 06:09, Dikshita Agarwal wrote: > Add support for below LTR controls in encoder: > - V4L2_CID_MPEG_VIDEO_LTR_COUNT > - V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX > - V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES This patch does not add any Request API support to the venus driver, so it makes no sense to merge this series. It's incomplete. The other two series (priority ID and QP and layer bitrate) look good to be merged. Regards, Hans > > Signed-off-by: Dikshita Agarwal > --- > drivers/media/platform/qcom/venus/venc_ctrls.c | 49 +++++++++++++++++++++++++- > 1 file changed, 48 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c > index 496ad4d..7d010d8 100644 > --- a/drivers/media/platform/qcom/venus/venc_ctrls.c > +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c > @@ -20,6 +20,7 @@ > #define INTRA_REFRESH_MBS_MAX 300 > #define AT_SLICE_BOUNDARY \ > V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY > +#define MAX_LTR_FRAME_COUNT 4 > > static int venc_calc_bpframes(u32 gop_size, u32 conseq_b, u32 *bf, u32 *pf) > { > @@ -72,6 +73,9 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) > struct venc_controls *ctr = &inst->controls.enc; > struct hfi_enable en = { .enable = 1 }; > struct hfi_bitrate brate; > + struct hfi_ltr_use ltr_use; > + struct hfi_ltr_mark ltr_mark; > + struct hfi_ltr_mode ltr_mode; > u32 bframes; > u32 ptype; > int ret; > @@ -259,6 +263,37 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) > case V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE: > ctr->frame_skip_mode = ctrl->val; > break; > + case V4L2_CID_MPEG_VIDEO_LTR_COUNT: > + ptype = HFI_PROPERTY_PARAM_VENC_LTRMODE; > + ltr_mode.ltr_count = ctrl->val; > + ltr_mode.ltr_mode = HFI_LTR_MODE_MANUAL; > + ltr_mode.trust_mode = 1; > + ret = hfi_session_set_property(inst, ptype, <r_mode); > + if (ret) { > + mutex_unlock(&inst->lock); > + return ret; > + } > + break; > + case V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX: > + ptype = HFI_PROPERTY_CONFIG_VENC_MARKLTRFRAME; > + ltr_mark.mark_frame = ctrl->val; > + ret = hfi_session_set_property(inst, ptype, <r_mark); > + if (ret) { > + mutex_unlock(&inst->lock); > + return ret; > + } > + break; > + case V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES: > + ptype = HFI_PROPERTY_CONFIG_VENC_USELTRFRAME; > + ltr_use.ref_ltr = ctrl->val; > + ltr_use.use_constrnt = true; > + ltr_use.frames = 0; > + ret = hfi_session_set_property(inst, ptype, <r_use); > + if (ret) { > + mutex_unlock(&inst->lock); > + return ret; > + } > + break; > default: > return -EINVAL; > } > @@ -274,7 +309,7 @@ int venc_ctrl_init(struct venus_inst *inst) > { > int ret; > > - ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 50); > + ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 53); > if (ret) > return ret; > > @@ -476,6 +511,18 @@ int venc_ctrl_init(struct venus_inst *inst) > (1 << V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT)), > V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_DISABLED); > > + v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, > + V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES, 0, > + (MAX_LTR_FRAME_COUNT - 1), 1, 0); > + > + v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, > + V4L2_CID_MPEG_VIDEO_LTR_COUNT, 0, > + MAX_LTR_FRAME_COUNT, 1, 0); > + > + v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, > + V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX, 0, > + (MAX_LTR_FRAME_COUNT - 1), 1, 0); > + > ret = inst->ctrl_handler.error; > if (ret) > goto err; >