Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2211743ima; Mon, 22 Oct 2018 06:16:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV606IBQR9R/rUKwZ1+W7UxT3FnW/wOohXBkHsaozG3SbOC2q+HtTiyUk+z1YIXUSg8A8VCTF X-Received: by 2002:a62:5b43:: with SMTP id p64-v6mr46604603pfb.122.1540214162215; Mon, 22 Oct 2018 06:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540214162; cv=none; d=google.com; s=arc-20160816; b=VgQVM2U8sAqWpPX9B+ZdGT4SdaXIlrl5C8y0RYEBeE/hjlvDEu4Ino0E41SV3mXwH+ ds6Ajk8ScvH7g1eayS6e3z3rVH8XvA/qLYD2tYQ/Kh3924Nreh6kvYwi2vZVkAy7Smqa mbhR50K90SwyL5HgLFjA9/87Ir8rd2OCYcTwV05b3E1Gm1MpNNVGB2k4xqM5Gqw7JqdY qdKbBF+o/ldGJrqm5rgfoFlKYl/M7SjeXnI8aPqQfGibVBmB4EZ/6iTVDI7fJBrjSF0C 2rokdHFTqWSYYT4cTPYeWvQsdHStF7rC7k3sPhtWpNYNjlA6s+iLvK5douxjYTf1l1ef sR5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=tcxFioI1wufRKpCu0Zh9FPARIdosplwXfvlEdIH0IvE=; b=qfSS5O49YCEhNNyWiQm+b5iEDTMxGQ7CBhjmXu+QdUaJTTr8gMUQPEt1jNA1wmsG1Y QLuoLbXvms7LigOV+4/VTuGH9sf+k54FSLb/iyBoipg1SDlUgCa1Pyxw47eZJDE4TaXZ LjkYHc70bDSe4uQ0wFmR3oSECRmQcC631dLI/ROjRqQ74SoGC9HVqxOcV4sAT8N//0r4 aph5PcOe3eCIEQMFAd0aIO/jH3CN7GtsnwZiH3khNGKH2JePBckje57ifzxgMUwWD4V4 KPoUvQOn/D5X3STExsGTgqhH4pNu2LEBusnp7bWpJT0VsVPD5KfXpi6/gKIYberexrXh SOyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=IcDprEXH; dkim=pass header.i=@codeaurora.org header.s=default header.b=IcDprEXH; 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 r1-v6si32770915plo.165.2018.10.22.06.15.46; Mon, 22 Oct 2018 06:16:02 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=IcDprEXH; dkim=pass header.i=@codeaurora.org header.s=default header.b=IcDprEXH; 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 S1728893AbeJVUWn (ORCPT + 99 others); Mon, 22 Oct 2018 16:22:43 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:37020 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727787AbeJVUWm (ORCPT ); Mon, 22 Oct 2018 16:22:42 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B380C6050D; Mon, 22 Oct 2018 12:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1540209865; bh=jPA4y+GnEDaAxA5o0/d55VuHVENgGGSvdO4aifNciaE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IcDprEXHb1BVUMs8Dh0fBFWkva+VQyLafjbRDOYXIBQq84kq4AR8vRq4HUtuYCYxb 21dWJ23TByIXCw8TnZyEpjevymf3Kl2mjWj5j3IiIEcfp26N9LntGqHSiSbsMwqKZj Bc/azRuVodHjji9aZuTEL+C31IQdta+QPjkcElso= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 41057601CF; Mon, 22 Oct 2018 12:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1540209865; bh=jPA4y+GnEDaAxA5o0/d55VuHVENgGGSvdO4aifNciaE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IcDprEXHb1BVUMs8Dh0fBFWkva+VQyLafjbRDOYXIBQq84kq4AR8vRq4HUtuYCYxb 21dWJ23TByIXCw8TnZyEpjevymf3Kl2mjWj5j3IiIEcfp26N9LntGqHSiSbsMwqKZj Bc/azRuVodHjji9aZuTEL+C31IQdta+QPjkcElso= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 22 Oct 2018 17:34:25 +0530 From: mgottam@codeaurora.org To: Stanimir Varbanov Cc: hverkuil@xs4all.nl, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, acourbot@chromium.org, vgarodia@codeaurora.org Subject: Re: [PATCH] media: venus: handle peak bitrate set property In-Reply-To: <274a112a-604c-82b4-130a-c3718abcf141@linaro.org> References: <1539071483-1371-1-git-send-email-mgottam@codeaurora.org> <274a112a-604c-82b4-130a-c3718abcf141@linaro.org> Message-ID: <1c2db4af132609460b1cf6cf0c25a024@codeaurora.org> X-Sender: mgottam@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-10-09 20:29, Stanimir Varbanov wrote: > Hi Malathi, > > Thanks for the patch! > > On 10/09/2018 10:51 AM, Malathi Gottam wrote: >> Max bitrate property is not supported for venus version 4xx. >> Add a version check for the same. > > I'd like to avoid version checks in this layer of the driver. Could > just > black-list this property in pkt_session_set_property_4xx? Hint, see > HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE in the same function. > >> >> Signed-off-by: Malathi Gottam >> --- >> drivers/media/platform/qcom/venus/venc.c | 22 ++++++++++++---------- >> 1 file changed, 12 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/media/platform/qcom/venus/venc.c >> b/drivers/media/platform/qcom/venus/venc.c >> index ef11495..3f50cd0 100644 >> --- a/drivers/media/platform/qcom/venus/venc.c >> +++ b/drivers/media/platform/qcom/venus/venc.c >> @@ -757,18 +757,20 @@ static int venc_set_properties(struct venus_inst >> *inst) >> if (ret) >> return ret; >> >> - if (!ctr->bitrate_peak) >> - bitrate *= 2; >> - else >> - bitrate = ctr->bitrate_peak; >> + if (!IS_V4(inst->core)) { >> + if (!ctr->bitrate_peak) >> + bitrate *= 2; >> + else >> + bitrate = ctr->bitrate_peak; >> >> - ptype = HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE; >> - brate.bitrate = bitrate; >> - brate.layer_id = 0; >> + ptype = HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE; >> + brate.bitrate = bitrate; >> + brate.layer_id = 0; >> >> - ret = hfi_session_set_property(inst, ptype, &brate); >> - if (ret) >> - return ret; >> + ret = hfi_session_set_property(inst, ptype, &brate); >> + if (ret) >> + return ret; >> + } >> >> if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264) { >> profile = venc_v4l2_to_hfi(V4L2_CID_MPEG_VIDEO_H264_PROFILE, >> Hi Stan, Though this property is bypassed in the function "pkt_session_set_property_4xx", it is set to firmware in hfi_venus layer. So we can return -ENOTSUPP from packet layer. If hfi_venus layer receives error as ENOTSUPP, treat it as normal and return 0 to venc layer. I will post the updated patch, with this implementation.