Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp404999imm; Mon, 21 May 2018 07:55:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoVE0t43n9oD5iz5NRBHd7Ypz05JS8n/tekdun6keuzN1NZb9TUzw7UgCGhFzM+N78I7uCx X-Received: by 2002:a63:7c04:: with SMTP id x4-v6mr15799802pgc.67.1526914515504; Mon, 21 May 2018 07:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526914515; cv=none; d=google.com; s=arc-20160816; b=vGdubgDItnNv+uOogQ7aXKdfvp2a49zNsGrx78rybgghFdU3L/rOPGBNfO0xfNTd6g lqiNprrh30PJJyqK1o0vXDtvWZC4kouIURRHgVAvp/tSJ7h8tvaj1Qoo8Fb1A8fhJKLR oP7U6MzAmY1gXIFS9p1iYyOkXXAYE2mNQCD2h6krbdQiVEzkv+QwBL+8qp7mjq2YlDYG jBazSYl8mLZwKTpJGyhNDwxAD9wgaSbiXd4KZksZVSXu+fbQqZX+RFKHfO/l80Pz27HQ jE2aH+6O33gAOjVltPZmN4qyebMskop1pW7o+LrJbODHjOMapNJYCuhPE+KJM9shfbEQ Z09A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=adgjokX25L8wJIS3eM1y6akt7TJzkskNFg0zllqkXTw=; b=w+x+wqKL5EuxlRV+j/x0QP1lFJTCB7JVqLdIIVyig0Za0Lj1JBvMV115yxuKTjKzc3 Iz6LlsB5nyOfCvOzzzOAsxOd/z0BgbZ5oVbAvTtnIAxKvs9EyyVC77Ec4VEEXF2VzZkZ GGJrJDyAWa4rrsvpJDwnmCGRXawFDH73VfQjkg7oSe2ZrHq5+5ZQXDlLIhvuCqTwpuPy DrNjzo3UoiaBON82Qk4SJMQJ3WNd6SKDq/V6Al6CA/JLmC+3qLO5LI9b0LTdibX44JY0 sGruOtCwdHxH6PWjSqv72Jl3juLNcw1stHPRzkQXSYDJhXo6ST6uvNhmQbHLMx/WVLCi GzJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TomEl7AW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1-v6si14133543pld.493.2018.05.21.07.55.00; Mon, 21 May 2018 07:55:15 -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=@linaro.org header.s=google header.b=TomEl7AW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752993AbeEUOxN (ORCPT + 99 others); Mon, 21 May 2018 10:53:13 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:43240 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752847AbeEUOxL (ORCPT ); Mon, 21 May 2018 10:53:11 -0400 Received: by mail-wr0-f194.google.com with SMTP id r13-v6so3953197wrj.10 for ; Mon, 21 May 2018 07:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=adgjokX25L8wJIS3eM1y6akt7TJzkskNFg0zllqkXTw=; b=TomEl7AWZEjRXbM9OyObSTWWcD9vVBu0lreF5BVastXxJcA1jl8S+oGZIqvAJRJ8fo 37Qfp1vT1yaBR+KckBkcSz/SfjjyR3pd2vMXJJia65/JGHwtpGFtl9JkracMOPOel772 mm87dO+4HiW+LtTfvQZX9fbVu7fmvVG7cEVBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=adgjokX25L8wJIS3eM1y6akt7TJzkskNFg0zllqkXTw=; b=eFNeEystWxR/rhymVnQKOSSI9G8rjRpDC7QC36nEEwfbAvkE9NsY+ajz7nxzy1xX5M Q0aPM4AWS4dybvG67B1k27XbmF6S/eSfCR/xtEyz+bb8Ms3DK8ZXaffYqSLGgOif2P0X 7YKJoMw4EFDijjDPHzI0UEwKFDo09vMIzzLFbQ+aYzewEHYJk8XEFBAi6OxnLYEiS6iu UHd1I+kSP+hTDFiEbm8zoAUd6db7r9Q1JkcN+IDx7HQhvMic7CwYMN/L7M2j8NDBrHVP 7KceLnfVoVW4RYSEXS/bse78EYaGDy7nJ5iAV9OlFCsFktyCZ2F/+hKzolzF8Sa5r7K/ Dw8A== X-Gm-Message-State: ALKqPwfeCU9HTAt8OrpYAqC7r7pVoES7LRvH4URkUVtPCDlc7JVKFZZ9 POIJcA0BgbqraSxNqkyiatSskQ== X-Received: by 2002:adf:a0fd:: with SMTP id n58-v6mr14898336wrn.217.1526914390138; Mon, 21 May 2018 07:53:10 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id b105-v6sm18537476wrd.64.2018.05.21.07.53.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 07:53:09 -0700 (PDT) Subject: Re: [PATCH v2 04/29] venus: hfi_cmds: add set_properties for 4xx version To: Tomasz Figa Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , vgarodia@codeaurora.org References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> <20180515075859.17217-5-stanimir.varbanov@linaro.org> From: Stanimir Varbanov Message-ID: <2bb37924-82cc-c38d-6f99-fd62d875c3ab@linaro.org> Date: Mon, 21 May 2018 17:53:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tomasz, On 05/18/2018 05:16 PM, Tomasz Figa wrote: > On Tue, May 15, 2018 at 5:13 PM Stanimir Varbanov < > stanimir.varbanov@linaro.org> wrote: > >> Adds set_properties method to handle newer 4xx properties and >> fall-back to 3xx for the rest. > >> Signed-off-by: Stanimir Varbanov >> --- >> drivers/media/platform/qcom/venus/hfi_cmds.c | 64 > +++++++++++++++++++++++++++- >> 1 file changed, 63 insertions(+), 1 deletion(-) > >> diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c > b/drivers/media/platform/qcom/venus/hfi_cmds.c >> index 1cfeb7743041..6bd287154796 100644 >> --- a/drivers/media/platform/qcom/venus/hfi_cmds.c >> +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c > > [snip] > >> + case HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE: >> + /* not implemented on Venus 4xx */ > > Shouldn't return -EINVAL here, similar to what > pkt_session_set_property_1x() does for unknown property? Probably the right error code should be ENOTSUPP, but I kind of following the rule to silently not return the error to simplify the callers of set_property (otherwise I have to have a version conditional code in the callers). > >> + break; >> + default: >> + ret = pkt_session_set_property_3xx(pkt, cookie, ptype, > pdata); >> + break; > > nit: How about simply return pkt_session_set_property_3xx(pkt, cookie, > ptype, pdata); and removing the |ret| variable completely, since the return > below the switch can just return 0 all the time? OK, I will do that way. > >> + } >> + >> + return ret; >> +} >> + >> int pkt_session_get_property(struct hfi_session_get_property_pkt *pkt, >> void *cookie, u32 ptype) >> { >> @@ -1181,7 +1240,10 @@ int pkt_session_set_property(struct > hfi_session_set_property_pkt *pkt, >> if (hfi_ver == HFI_VERSION_1XX) >> return pkt_session_set_property_1x(pkt, cookie, ptype, > pdata); > >> - return pkt_session_set_property_3xx(pkt, cookie, ptype, pdata); >> + if (hfi_ver == HFI_VERSION_3XX) >> + return pkt_session_set_property_3xx(pkt, cookie, ptype, > pdata); >> + >> + return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata); > > nit: Since we're adding third variant, I'd consider using function pointers > here, but no strong opinion. Let's keep that for future improvements. -- regards, Stan