Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp347504rdb; Thu, 18 Jan 2024 05:34:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpMQx72ThW8u9/NFR3GMC+txx5v2k9J9DinWsZaFwzMSX6/PTB5JVIyvWtFQ+hNLRfD2yC X-Received: by 2002:a92:d14f:0:b0:361:9684:bcc with SMTP id t15-20020a92d14f000000b0036196840bccmr961738ilg.19.1705584875534; Thu, 18 Jan 2024 05:34:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705584875; cv=pass; d=google.com; s=arc-20160816; b=ncqQvUvEyiQcMOU1wIpmyllhUVDVmlRA4cdVEwnVMIbAHNmFKZ17tvAItur2c9rBh5 6RJxm220aMkJPFby3c/j7qjPyOMANbI/nLs+oHHllLE27N5JaCvOBFYVm8plOqxnH/Dm LYipAvnLpiFvqtZlP0eAhwjQxnKqd0RQ3rPS2GxEQ8TwEFt4HzzPpV9pSgVS6s1yGpza jWAGFLkQLxnPFE2PBmqnVo70uawFjijaxCmpiSNLeXk0K7+QmydJVwsZJSJANizQPIYi qFXsm8gyeL5TLlg1ZzdU7Ov5Z8HQ+PfrrCYE1u3nRUpMJcY/KjBLQ7EOzsDAj7quYsX3 B/ZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=4YHeLV0TQs3MeVFgQiX7V8lAzpJlQDaK5HPvbw2WeUM=; fh=XcqMyArCBhYdT4rCR9cXSWyx/78dIWTUhYx2Mumv8EY=; b=mmV5yjminxgRPpjbZYIeGVpC/HcIJyxONCDagO8oKmtgoEYYtslKKgARzcngm7lQe7 m/GsZJQXmFzUBTSdGfwnFQnst2xi5xznYvPSuQ/s7n3nUCZMHhM8NE0Fs3TgcYrQvne9 HRTYfgCEICyNhZi+vHuSuM71bDsVsjdTiua/cHHBMwSgeyeEhLmiyDHmlKG/46/Lv34+ WABtJ/t4cwi2oazMskxDNbUGKB/TGX3IiJRry3zRWContcLeFdxx7djR9eV0LZ7PLt36 h3CR9oHhH/FB1bz0ZTTSiEXqRWchmEA8cwAWdnFWcHxD1CQ1fvN4KSfIQqFiqOfH0vTp u3eA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B+Ix+HCw; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-30156-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30156-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n38-20020a634d66000000b005cee179d5c4si1430817pgl.230.2024.01.18.05.34.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 05:34:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30156-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B+Ix+HCw; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-30156-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30156-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2EAA9282A38 for ; Thu, 18 Jan 2024 13:34:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0C9F25611; Thu, 18 Jan 2024 13:34:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="B+Ix+HCw" Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F3FD25541 for ; Thu, 18 Jan 2024 13:34:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705584862; cv=none; b=gIKZ5/es5qjODXo6IFVVWtpbDNAffl4kI2I0KdZaFq7IfHd3j6SglERMK3yiHHC1do1242zMCwYSkVVJbHaKvl9k1mJacuBYtLjujD81Q4mU1thZRAw5DiVy9koFal+xVrwym0DSnkThlmdreM6l6CqGxBmfjF5AZgeJVtk4u/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705584862; c=relaxed/simple; bh=cvBbavxq/YxOjTZc3o8gTyrEuL5y+Usgr/yLRKRZpFI=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language: To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=CJQZhXrQE0pQ0G0AcUVujKTmAfgSUYTr933zLWtuVw8MU/oliJhEybIoQpDXyID8CQDPcC+iF9e3wjuThZ03yGmK55yB6SsEZfi3zyPXKx2imwwIB8gCQtjbUAsEJxB0H5uuMZUuoWnBQxQ7S5D9TVj+L27I5ZUkHHEdTJb4tYU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=B+Ix+HCw; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40e8801221cso17550305e9.1 for ; Thu, 18 Jan 2024 05:34:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705584859; x=1706189659; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4YHeLV0TQs3MeVFgQiX7V8lAzpJlQDaK5HPvbw2WeUM=; b=B+Ix+HCwDjC2JTCpcF/fKiYxYP8ABgwEwt6PPwomv8UGsiJjAGexglVJ5isGo9PAVN uuvqWjDfZ+3B9TcxERoMQttD4DxhiTHu2vGrJR+gR+qCFfgIvEb8hxIie+VJPDfFn/Lq bPXtS0nw2TvpIk2DOTwrExVq7i4Fdt/jCbcbBDAQ2xhVyej53uTode9SRuCyifgCveNq G8uI5CeEXAUueAjyNw2PpO2wXmqTXbQ9Ylr+17KAjD6DU3bi6vNBniDyIB+sGLSZ68ou P7PVN9Thte8BE6rkWL9hgoy5RcaJqAsfloH5++U5DxYgNOEdH/qjfqwAdxI7bnp57JGD +dZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705584859; x=1706189659; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4YHeLV0TQs3MeVFgQiX7V8lAzpJlQDaK5HPvbw2WeUM=; b=tPFcpWLSXZOrq/CSjIR1pxKiP4Td404l5tzKw7AIHeEThqE8vuAjhzuCqi753Y0lcd bUCeJ98RxwpUbxsbeeG0+fK+ejSY1rE31XQWvgkQ3w0aytQVfdKcpHH7yYCZ1wBAkkgz XV+0CWGwOVpZNyrdef0t6ksTe8f+oNGHOGXIwrjrTtOA4YbtFJGgitWgHKnnQd9yNwoS tETzPwD5rxqazDYN2qLLY0WtOKtOSkTYNYmkF6Nk/pKG+RoB6YKGjONtSbyZ9UWEMeYl QrdJYZrA5MOQdJShd2watTiFXWX0QuaLNnmJ5Isi1i0KEotpI5s2RORArUXFaAOktb6o th6Q== X-Gm-Message-State: AOJu0YwcHlwvYxN5sxzqmGC1VqtUNZBF+guvNB06gPB2kyourJQcXXzC q3/WTsZLnG1K2VeDlipm7PPjhDbtChKKfWyMcsj5R7RX9tTsrhQFfnk1CuB8YRs= X-Received: by 2002:a1c:7510:0:b0:40e:89da:7b71 with SMTP id o16-20020a1c7510000000b0040e89da7b71mr538405wmc.100.1705584858904; Thu, 18 Jan 2024 05:34:18 -0800 (PST) Received: from [192.168.100.86] ([37.228.218.3]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c190700b0040e52cac976sm29348312wmq.29.2024.01.18.05.34.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jan 2024 05:34:18 -0800 (PST) Message-ID: Date: Thu, 18 Jan 2024 13:34:17 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] media: venus: add new rate control type MBR for encoder Content-Language: en-US To: Sachin Kumar Garg , hverkuil-cisco@xs4all.nl, Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20240118105934.137919-1-quic_sachinku@quicinc.com> <20240118105934.137919-3-quic_sachinku@quicinc.com> From: Bryan O'Donoghue In-Reply-To: <20240118105934.137919-3-quic_sachinku@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 18/01/2024 10:59, Sachin Kumar Garg wrote: > > - switch (*in) { > - case HFI_RATE_CONTROL_OFF: > - case HFI_RATE_CONTROL_CBR_CFR: > - case HFI_RATE_CONTROL_CBR_VFR: > - case HFI_RATE_CONTROL_VBR_CFR: > - case HFI_RATE_CONTROL_VBR_VFR: > - case HFI_RATE_CONTROL_CQ: > - break; > - default: > - ret = -EINVAL; > - break; > + if (hfi_ver == HFI_VERSION_4XX) { > + switch (*in) { > + case HFI_RATE_CONTROL_OFF: > + case HFI_RATE_CONTROL_CBR_CFR: > + case HFI_RATE_CONTROL_CBR_VFR: > + case HFI_RATE_CONTROL_VBR_CFR: > + case HFI_RATE_CONTROL_VBR_VFR: > + case HFI_RATE_CONTROL_CQ: > + case HFI_RATE_CONTROL_MBR_CFR: > + break; > + default: > + ret = -EINVAL; > + break; > + } > + } else { > + switch (*in) { > + case HFI_RATE_CONTROL_OFF: > + case HFI_RATE_CONTROL_CBR_CFR: > + case HFI_RATE_CONTROL_CBR_VFR: > + case HFI_RATE_CONTROL_VBR_CFR: > + case HFI_RATE_CONTROL_VBR_VFR: > + case HFI_RATE_CONTROL_CQ: > + break; > + default: > + ret = -EINVAL; > + break; > + } The if/else you have here seems like a needless replication Just have => case HFI_RATE_CONTROL_MBR_CFR: if (hfi_ver == HFI_VERSION_4XX) --- bod