Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp338430imm; Thu, 31 May 2018 01:03:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKITi1UGh7nvPTnFrsK5Xgwdl1TKl7CVIFETsBSf+/g4Eeh0+JGCRQRmQh5gOcOWSOFj7b8A X-Received: by 2002:a65:4e8b:: with SMTP id b11-v6mr4594005pgs.392.1527753808906; Thu, 31 May 2018 01:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527753808; cv=none; d=google.com; s=arc-20160816; b=KT1k0Z01+I1pdpM7VZYeePs+E5ehm2H8AB9rQi2sF5oGwF7lSwc34IlsTL6YBv7Vqe L1//wtUqhcBhZIQyROqtmlYd0hsqGu3tmkY3AQd9gpoy9fGfsQMGcGvgXuCeKz2FpnKG kKdZscQsspmkGp8wS9ybojs3lVgA8gmeonvkJnTJmsB6eeraAPGwUJaAjG2bq76sLH/r Rrb7AhHvidgvc2l8ttORDqG26AR6cybjxuisGIKKygZJncd9CODyhXKOZRT3sYmRFMDW 4b1uNp/7g42mOUKT9Qt2p4G2oK2tW1yNpS4metGHVXSXNd/tsH52vD1tkLh7Fo4uSSM4 ESkw== 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=8N+mIEnF1MLL6SX6wI8/c9/S99DY2RInUkOKgVPX2Do=; b=XgmJpgnuvioF7sMYyolbpSIitKg3VvfBu9iim12s0XAq9Uwk5Ebc7Osm632lvkaPXy 8gZOu7o7Bv2609dhL8D98UMwlrxnXRlEi3wDDoYQylg9TW8AZPKvLtwi17YGCBLvgHr0 M9HbP9fk4oE11rVkM1f47nyjLEHsjAJrWl7A939fgVyOwX80WFXvN1Wek49IE9OPGHL0 CITtc2vqwUCgiwDqxGUK1j0xJyxghhCch+jptnlBbl+WaTL4uODuTxDN4Coy0dvoKtea UGtNzNSqu7lBzU4xpod04NRi8PkxhYFgUXEZpNvVEMRctxn/gPNWX+z3HWqKNpuzK/cT lhyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dEnXWKid; 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 x15-v6si30010418pgq.442.2018.05.31.01.03.03; Thu, 31 May 2018 01:03:28 -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=dEnXWKid; 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 S1754130AbeEaIAj (ORCPT + 99 others); Thu, 31 May 2018 04:00:39 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:41178 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754072AbeEaIAF (ORCPT ); Thu, 31 May 2018 04:00:05 -0400 Received: by mail-ua0-f195.google.com with SMTP id a3-v6so14402496uad.8 for ; Thu, 31 May 2018 01:00:04 -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=8N+mIEnF1MLL6SX6wI8/c9/S99DY2RInUkOKgVPX2Do=; b=dEnXWKidHmimsCpLtSGtJnQyw+KhYw/SEDim003tt1Zu8i+1xpA57YyOxSybh6hNNX FlemzIcY69PD7rQCdJieSteyO4EsaLi+T49x2I0++bBUklXHwTyhbd6pWzW5XO4Ch00N SBn5iPDFP8K5zbMNha8TFdBYaiMbTNbfB/s6Q= 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=8N+mIEnF1MLL6SX6wI8/c9/S99DY2RInUkOKgVPX2Do=; b=C/M62vGxxhkgwcmnIq2yiX+dQshVpsWTArz+AeVy/sydGxU9iMdt6zqYgVzTzEEpH/ paWFYVn02g5JDa5smyqu96TXhcdzBac1szhlX4UXLnZtwrjeSwa86UWeKvLWqdLurrD8 8WAYt2ga+z1wMqOIlBA/ckmvoeTrsmsi8ff5V0zVGLOcAresjAPJ6KM0LhroDqio6s7d LqJGs/YzfKNv11ynep9dcArBetACvCUMANEUcsXAqQ/l9bTU7B4kXKSifJwEFK65zZkI 3cDWX6IA+2QC0UKy3i4tX2ddmJwfV+lHaGfJwRF4jkbqkIAcSYKmkpGAw2wYjBSEwKmQ XqiQ== X-Gm-Message-State: ALKqPwf+h+o9bwcO2ZDApz5fwWMBmmNpQe9iChCrE8pdFOomz2OETaps bCaYCnOq7lmPuDYFqHOKaBGDKvKwY5c= X-Received: by 2002:ab0:598a:: with SMTP id g10-v6mr4225265uad.118.1527753603769; Thu, 31 May 2018 01:00:03 -0700 (PDT) Received: from mail-vk0-f48.google.com (mail-vk0-f48.google.com. [209.85.213.48]) by smtp.gmail.com with ESMTPSA id 123-v6sm9342550vkg.47.2018.05.31.01.00.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 01:00:02 -0700 (PDT) Received: by mail-vk0-f48.google.com with SMTP id y137-v6so12782400vkd.6 for ; Thu, 31 May 2018 01:00:02 -0700 (PDT) X-Received: by 2002:a1f:e686:: with SMTP id d128-v6mr3566390vkh.176.1527753602144; Thu, 31 May 2018 01:00:02 -0700 (PDT) MIME-Version: 1.0 References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> <20180515075859.17217-16-stanimir.varbanov@linaro.org> In-Reply-To: <20180515075859.17217-16-stanimir.varbanov@linaro.org> From: Tomasz Figa Date: Thu, 31 May 2018 16:59:51 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 15/29] venus: helpers: rename a helper function and use buffer mode from caps 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:06 PM Stanimir Varbanov wrote: > > Rename is_reg_unreg_needed() to better name is_dynamic_bufmode() and > use buffer mode from enumerated per codec capabilities. > > Signed-off-by: Stanimir Varbanov > --- > drivers/media/platform/qcom/venus/helpers.c | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c > index 2b21f6ed7502..1eda19adbf28 100644 > --- a/drivers/media/platform/qcom/venus/helpers.c > +++ b/drivers/media/platform/qcom/venus/helpers.c > @@ -354,18 +354,19 @@ session_process_buf(struct venus_inst *inst, struct vb2_v4l2_buffer *vbuf) > return 0; > } > > -static inline int is_reg_unreg_needed(struct venus_inst *inst) > +static inline int is_dynamic_bufmode(struct venus_inst *inst) nit: Could be made bool. > { > - if (inst->session_type == VIDC_SESSION_TYPE_DEC && > - inst->core->res->hfi_version == HFI_VERSION_3XX) > - return 0; > + struct venus_core *core = inst->core; > + struct venus_caps *caps; > > - if (inst->session_type == VIDC_SESSION_TYPE_DEC && > - inst->cap_bufs_mode_dynamic && > - inst->core->res->hfi_version == HFI_VERSION_1XX) > + caps = venus_caps_by_codec(core, inst->hfi_codec, inst->session_type); > + if (!caps) > return 0; > > - return 1; > + if (caps->cap_bufs_mode_dynamic) > + return 1; > + > + return 0; nit: return caps->cap_bufs_mode_dynamic; Best regards, Tomasz