From patchwork Wed Jun 27 15:27:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140347 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1030665ljj; Wed, 27 Jun 2018 08:33:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIKUpOLf8JZpzuC/ksKImGwFmbSOalwFCop/QQ7+pw+cXQu/1gg6aZY4fd4MfuMk7YGd1Iu X-Received: by 2002:a65:44c3:: with SMTP id g3-v6mr5587936pgs.231.1530113605045; Wed, 27 Jun 2018 08:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113605; cv=none; d=google.com; s=arc-20160816; b=eSnO4Q0tYqzCH+yvYr3EhYTiY9ryr4WIPYxiNf7PCuYwJVBZ24bZL+nnJVWc4od5er Mkqn2WCh0lltGpsmQaHzEz8XkeJ3G6NXxG/X/F5bjnnJtpNaPwk4fvZm/sTglra3DhKr Wf2GixfMj4kw0ZRb9UUJtZGCRY1HGZ+GhVl6YeHSEYU8L1rH3KEu2D4XUnz5jgzb0tuY WUs3nYOBDBDehAffrneNTmglmLCfggGdOBiiILErVUqk2UJepb0yD75LR2wWVMOxcLbO KgGv/86ZViJp+x3hew4vBWahDvTMDV+W1Y+kX6dat8wRSsqiax5yEid8lg6KL2EMiV5R 5Rcg== 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=yh5Y1r5uz+JrK/BbOAzuU6//JjpR3Eo/scoSz5Qmbxo=; b=avoTbQbDP02LikCSA/JXeeuX3BFV9HYvbhqr2rgHZuX4SWmvJO2gyoKTdU3S5nmzIv 08FFq5l47HgV6swN9GAk/il9jMJdfhoIVDyR9mpGWg2GgTSaR5jScNr7td06wQDjwm8v GqWldscq+jL53onsEkLaYr54qC/UXK7N9rHgPIqEP2GQhdb6MAvUJ6fCpxZ7WVUCc43F K0CxCZAPIbUcNO67pTqVCKXqrIM0180LhWMvJWm3lLUYCnNh0mXuRi7ZrWc7TkJOLyTq Vmxb9nzJzEDyAmk2OV3bWIKoCQxRljYmFdqy+7asoAxZwlunumTvBSzF7ebyFXF2mvcM d7gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MkdE1Qsj; 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 190-v6si1202191pfe.136.2018.06.27.08.33.24; Wed, 27 Jun 2018 08:33:25 -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=MkdE1Qsj; 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 S1753232AbeF0PdW (ORCPT + 13 others); Wed, 27 Jun 2018 11:33:22 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:43059 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934850AbeF0P2O (ORCPT ); Wed, 27 Jun 2018 11:28:14 -0400 Received: by mail-wr0-f193.google.com with SMTP id c5-v6so2463412wrs.10 for ; Wed, 27 Jun 2018 08:28:14 -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=tpg/OEO6kmuXcfyGgT7M54n6/6j/1UYfIVpGWyjDnSc=; b=MkdE1QsjTmOmf+d/s1S21lCHKClpD/AcqM70krJNgJddYgavMPkqFNgHJfKBeEG7o8 faAElo9RcrU6hHjp/6tkNjw3ntrw+S/Um2o1l4fxuSGfWD9SuHl7B5SjRlFnQmbLGJDO WSQcvR8B1tvL+lFFyuZuORzci9Y74y/PYTeYw= 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=tpg/OEO6kmuXcfyGgT7M54n6/6j/1UYfIVpGWyjDnSc=; b=h6z7EqJjL89d/Y7wPQE8kfs8gmlwFPumcw1CH3UzFi8w9qWfpukfk4zkV7CAEgcsvZ FyY7HLBmZqUqSBnheZA+leZ2LoBn/mdrEmdqnCyHkhLGZ9jdAJvIii8oa+Us5jU+W7Y+ TuWWkINsVHjvPcCxzrxM44J5W/g/oifxvgzhKmNOvFxG43+s+ePu3H4YX2lvmU1ooGxo M6GD1HOqC4LqDpj63vDUGqF4yZQ4Tb8VhVMTGa9yFT1foBp6+BZNd+PIidWUOncHVpgP paVgHmuFWrNvMCpeQE033CkplRSs7i7zKHSRXDA0KkSoz0vNhbPhyd18YJ8Shm99MtX1 WKNg== X-Gm-Message-State: APt69E1FL+3LHvTLkt3hB/Y8CzJwQLWkLtThsRSKpLhfpPM8tJPkdi7B VJeancc+l2vK6Av74DO+/bhzyA== X-Received: by 2002:adf:8f2e:: with SMTP id p43-v6mr3463885wrb.193.1530113293515; Wed, 27 Jun 2018 08:28:13 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id o203-v6sm2916075wmd.30.2018.06.27.08.28.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:12 -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 , Stanimir Varbanov Subject: [PATCH v4 13/27] venus: helpers: rename a helper function and use buffer mode from caps Date: Wed, 27 Jun 2018 18:27:11 +0300 Message-Id: <20180627152725.9783-14-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180627152725.9783-1-stanimir.varbanov@linaro.org> References: <20180627152725.9783-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 228084e72fb7..03121dbb4175 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -354,18 +354,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) @@ -374,7 +372,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) { @@ -394,7 +392,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) {