From patchwork Thu Jul 5 13:03:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 141137 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1926167ljj; Thu, 5 Jul 2018 06:12:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd4sZwHxjvCGNggzVtlRR2L/hgT984H2OaXi6WXUKW62PJcScTzjApgKQr/kPmMBkBy477k X-Received: by 2002:a65:42c3:: with SMTP id l3-v6mr5364310pgp.398.1530796325990; Thu, 05 Jul 2018 06:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796325; cv=none; d=google.com; s=arc-20160816; b=ZwBORLGkihH63+E5DXQhI1OmpLDwS8N6fqSl+cJ/Oj2hg/ZI31uaGVIoUHOfefGG8f Casp6/Z02muxQTBNnxO+Vg61HdAb5z97GG+c2NSwUOR6lMnSnejiiHnQiwMAi9xtACaC oIdNN8ufKrCVfBk/bUxb2YxdiF081pFsl1VDMzueRtofZoURJxNEc7scxb/+/iglaD6J fnW6FfbK35ZczXOkepoUVCMdWcb5JL0GONQyuTKeWSBYtzhFFCwlkXyqYCGny2qr5PwO 4vQeLsvZqyvnHpp8AuZTTeenupK/V2ADQ7nHjf30nE63f/AQrDo9LkQUxLZyNvcIhMD5 gUfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=GZuNBMm7RtOdJYDfqJvFYuf4WYJ7NOe1IIgTYAMoy8g=; b=rjleBAQ12C36KODEQ9Yf+ysiE8hlm8ClesUasd2XQIJP26jxU0FcZAIZsSX4pbvHzx cwYxSfQttx/R+QFzptq6uBaAPyy9V/HLpSwr67w7Y13krNkMixb98i1AQ5QK6C15ZB9a WQX/JoMwevQYmpI7Q8GUb87A7nlIigmT1W2904afdYDFzAD3ZAzbC995/DDHfxtkZwDs MzDnVvYulu2rLP0W7+H4WiDFKbenPzxsxflqRKy6QuQy7B2Ctobkhj4sUwa3IeWeP0QF wogPrua9ymAeQj6A9FnBK2YBXWrocFNnGbYPIpiYs74FOHb7SpnWDfYFQVSgZV1O4zJD iU1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=G9VD4fRS; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 q136-v6si5463785pgq.483.2018.07.05.06.12.05; Thu, 05 Jul 2018 06:12:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=G9VD4fRS; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754506AbeGENMD (ORCPT + 13 others); Thu, 5 Jul 2018 09:12:03 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:40613 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754395AbeGENFW (ORCPT ); Thu, 5 Jul 2018 09:05:22 -0400 Received: by mail-wm0-f65.google.com with SMTP id z13-v6so10717867wma.5 for ; Thu, 05 Jul 2018 06:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3i8BckNk5AMxsFObk6sMQ2N4Vr3Tdy+vGDFQyGUXeZU=; b=G9VD4fRSgCR80eTzzW6fpSDt93wNTPBC3e0s5RsP7jgFooQXq9+g6TfnyaQfGGsh3M ++seMqYU6Piy38xXED9y9k9seeSGyRhcNUshc9B7JR2A5LaHq/oXrfgOtj6ycuVGpz9F IWejZK5y3eyLwFMMFFmClzAQThiLoyo18JZYA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3i8BckNk5AMxsFObk6sMQ2N4Vr3Tdy+vGDFQyGUXeZU=; b=FdCot8RJyC3FctwZsbFneRyfYYwXvz61I9uBHgZFmG5OzElIF47FNsHI8Y0JF8Kid4 8ekc7b+HfHXKKpvdxuCOhWUsgulqD2mBuMmUoYmmnEUy33V85aWVZ0a1+N82M9BY6ugQ fs132Mj9YEbMdfCHsBOPjyo/mbxCcrY5xlyLETCYwiKzC9bq5jig/L+IQvQPvYadEeME bC+1YOkerMCUPQtV2WAyNWbrnNH3Cx5OYHMzSAhpJPau6CCu5jxLc7YJ8lgp/GJXPFhj NX3tUP/hKdKf9o9s+cY7vPgjCJbCiYR43QvTeu4GwYTqOQucRkNz/Fm6mByhFiC40ow2 18lg== X-Gm-Message-State: APt69E0uKgs1zQthF1bCUoAQ8K42z7LPSiWyXmU3SF/uMMxXhY7h6Nlh KWNti5I/eLGJBNVSH/8PWx3E0Q== X-Received: by 2002:adf:a49a:: with SMTP id g26-v6mr4681005wrb.91.1530795921265; Thu, 05 Jul 2018 06:05:21 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 11-v6sm2109102wrw.67.2018.07.05.06.05.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:20 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 13/27] venus: helpers: rename a helper function and use buffer mode from caps Date: Thu, 5 Jul 2018 16:03:47 +0300 Message-Id: <20180705130401.24315-14-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180705130401.24315-1-stanimir.varbanov@linaro.org> References: <20180705130401.24315-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index c8c4a4be78e3..27c4a4060c4e 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -359,18 +359,16 @@ 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 bool is_dynamic_bufmode(struct venus_inst *inst) { - 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; + return caps->cap_bufs_mode_dynamic; } static int session_unregister_bufs(struct venus_inst *inst) @@ -379,7 +377,7 @@ static int session_unregister_bufs(struct venus_inst *inst) struct hfi_buffer_desc bd; int ret = 0; - if (!is_reg_unreg_needed(inst)) + if (is_dynamic_bufmode(inst)) return 0; list_for_each_entry_safe(buf, n, &inst->registeredbufs, reg_list) { @@ -399,7 +397,7 @@ static int session_register_bufs(struct venus_inst *inst) struct venus_buffer *buf; int ret = 0; - if (!is_reg_unreg_needed(inst)) + if (is_dynamic_bufmode(inst)) return 0; list_for_each_entry(buf, &inst->registeredbufs, reg_list) {