Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4571725imm; Fri, 18 May 2018 07:18:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpAvD8cBpxDbPBRRGci83GYonodVg1RB48M8eO/t1VhqmDZ7BUHSdXBzawIE13FQsA8xEKm X-Received: by 2002:a65:6151:: with SMTP id o17-v6mr7857386pgv.120.1526653095076; Fri, 18 May 2018 07:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526653095; cv=none; d=google.com; s=arc-20160816; b=R8+allG7jvVSmqg59jCF7UFgSSSfWW+51XqRq/w63CHuvx1vSbynN4GDh7jG9gMvCi AG9pEiKRRmLnZ3Y9mnY+00CqepQM7OBerdR8a0ZrLNl9ZEYbiOzBPY69sAgwFZbo9tWL OqZk7Mmhn5xp3ugnFad1bLYfQ2AXD4tImuzUB/PWJgJVx6lQVfejrxY6fTJ6DRYehe04 1LKFlcAi8AI2yp7DvXO8d4Q+e1f6NUxbVqeC/9ahmXFq1jmZin2RZL75xrYJQoaWyf39 pq5bLC17oZvHKBuRYKNUDjRc1OG7ejNlnHUEh+1z7BBZ1CcgoJqTnwHf4L/77kcrcdaQ VeaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=IzIdns+msXwht+OxJwDagabhIiiM7B65VMKoYXgOeNA=; b=JkK0SayxlsabOvG2k8iOAvzuHYy2EdOFQu/EB65+QvhQZ0dAItghlMDIPRmhH4HQHg 9LUssSEnUkyjwAbO0FDz/4glZvlrnxvSJ+buiv2ZFpS2dDRjrROpqrmcU9T8krQQesvt EzxNpIwG5MXxD1Oewua3brIN1D0VrSGkTXww05RU1geFLC/0q4ZcZoBFNvrc1BpbNg01 fnXgfkeu5LYj0ue/fWyHe8/dZeaVszatZiGSLKYDvY7XVOQm3dDMVEhRs7rfqnf8GM/c PVzOyWlWQx2WrwSu0nfXZCczPf2ueNIoARGQQtRjBy8/aqt2tD2doXIMiHlQFZE94yQm MVvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=E5ilSXPV; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b39-v6si7741474plb.456.2018.05.18.07.17.44; Fri, 18 May 2018 07:18: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=@chromium.org header.s=google header.b=E5ilSXPV; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752008AbeERORV (ORCPT + 99 others); Fri, 18 May 2018 10:17:21 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:40853 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbeERORL (ORCPT ); Fri, 18 May 2018 10:17:11 -0400 Received: by mail-vk0-f65.google.com with SMTP id e67-v6so4906524vke.7 for ; Fri, 18 May 2018 07:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IzIdns+msXwht+OxJwDagabhIiiM7B65VMKoYXgOeNA=; b=E5ilSXPVIEDMS2zObd6I8TQovSo4P5KEFG8JU14UlmPsfOYmHfDojL4L+XAUQ7gtPe o7h1+WDdMyJR0RrWX946oIhiLc/TcBnOez44UY0tSulvOZ6quxRxKOScuiqjKObGHwhL z/uftg/ekfY2sg/2K/P7YlT8F8ytzaj7XP45c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IzIdns+msXwht+OxJwDagabhIiiM7B65VMKoYXgOeNA=; b=S5CatMo3YczFnPKQiMG7DLWtw2/jcTVX3OkDU4tjDepDhXCoEuQj/QAB1q6o4yxbVO 7daUiXH/UyH6lphCD2+VLPG2Tm8hmFUJdyVQMGhyAzLd1Tcl6cMBZ3fGsjExEaYZSCtG zjGwDWBqjojpPIu7Yk1V97dz1Ub7gxpYylToQIuYL0PRCnwaplyiQVRykOkQIAPRXpFr Rv86ezHKVwrBne0y4VfIpgtHegTrwKDL/FgM1+WFLVWvUliYirvywzd1HxtId6wFyAW/ lG/XmMMh5zSAzgt/3890xeCheBLu9sLITGgVueN0sws3jtpJ3PVTSjeryk+vG0k9H6XZ cflQ== X-Gm-Message-State: ALKqPwdqXCxyGVklZjMncbcNoJkzsnzBjBrvYGwz16MIXEiIX+m9xBUm Fjl6hA4cz1mx9+fFNkIKFC7IE7oPl04= X-Received: by 2002:a1f:f888:: with SMTP id w130-v6mr6993935vkh.188.1526653030285; Fri, 18 May 2018 07:17:10 -0700 (PDT) Received: from mail-vk0-f53.google.com (mail-vk0-f53.google.com. [209.85.213.53]) by smtp.gmail.com with ESMTPSA id g28-v6sm1890866uab.15.2018.05.18.07.17.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 07:17:09 -0700 (PDT) Received: by mail-vk0-f53.google.com with SMTP id u8-v6so4919277vku.5 for ; Fri, 18 May 2018 07:17:08 -0700 (PDT) X-Received: by 2002:a1f:97d7:: with SMTP id z206-v6mr6880584vkd.183.1526653028452; Fri, 18 May 2018 07:17:08 -0700 (PDT) MIME-Version: 1.0 References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> <20180515075859.17217-5-stanimir.varbanov@linaro.org> In-Reply-To: <20180515075859.17217-5-stanimir.varbanov@linaro.org> From: Tomasz Figa Date: Fri, 18 May 2018 23:16:56 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 04/29] venus: hfi_cmds: add set_properties for 4xx version To: Stanimir Varbanov Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , vgarodia@codeaurora.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > + 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? > + } > + > + 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. Best regards, Tomasz