From patchwork Thu Aug 27 09:24:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 248438 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp8970ilg; Thu, 27 Aug 2020 02:25:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwg5FettpL19NYUsyYajLXPWx0GjbfECZWCCjzY52yO2fGbefFJj+wWim8lPJwg/n7RKfv X-Received: by 2002:a17:906:4704:: with SMTP id y4mr16967103ejq.81.1598520324944; Thu, 27 Aug 2020 02:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598520324; cv=none; d=google.com; s=arc-20160816; b=QmKGZTQJ/0NZsZduGULJDFExOT2Xm6qSIMQ07MGiXTG5GnBUZH3B4EdkH6fAaZrk4k pE+VUqRNY6OzjBAqfjygB12jt6HCigxxiBe5+m5LzgshQR/SqGPumVK+Zgnsg4b4SF9x 4vzrQhUg3wK5JHZrmydzWhNinGvkcpEVMkJnwrFfzcY0caUCGjJXo/v0AHCl/4W4EL9v Pt6n/KO6u0jsh1+/Rpk/5kqg9p0uhrgTd+fSy+GGiljDqp7f+YwP9JupejhNrZXEmiup WgHR+rW6n4V9DX0ZV8JwvJFOki600q5l292SzrAsKIY9ZbHlAt8QHb/XKIAXdo3b0HU+ DpbA== 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; bh=OGj1U+RHEgRBo72Z19HJA/GgC9Z8W3lKprGNOAt6O6Y=; b=BUUi9gz4aVxIJ44bCEavidi7v4EKzf9EoI1Doc2q70dVMc+w0nf6wDczxNV4DZXfwX gCFCqjFiG1bVqoPmqBfcVhj8wGHlTy8KO/0XVavXiObaCo/cZiX2J1r2s/ZzQ+5oJT/E cCZzR+m3MLNz/Kb6RMjcnjs42Yl07sK1eLV1UI5UfCqny1+qezs73ToY0Wlz374C89NA CFOOxbId3v/yHVncXdrOo/VA4Z5y5G7qgFl3sVbip+DB30ZO912b2e9KdSRz44pV7Ih4 2FETHjtotRh1D2JlVL33JeGvuWzLizxkFaQWrlipJfDNP0ZaPyZPpgiKlhyGvkv1rO+a pjFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cv41kRwc; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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. [23.128.96.18]) by mx.google.com with ESMTP id bx1si998497ejb.370.2020.08.27.02.25.24; Thu, 27 Aug 2020 02:25:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cv41kRwc; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1728605AbgH0JZX (ORCPT + 15 others); Thu, 27 Aug 2020 05:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728238AbgH0JZT (ORCPT ); Thu, 27 Aug 2020 05:25:19 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C03FEC061234 for ; Thu, 27 Aug 2020 02:25:15 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id o21so4473948wmc.0 for ; Thu, 27 Aug 2020 02:25:15 -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=OGj1U+RHEgRBo72Z19HJA/GgC9Z8W3lKprGNOAt6O6Y=; b=cv41kRwcoHdV3sWpRs7mbvUjJRVliv/pz4A/l0BMxj2coUR0fsCcb99/qXgJ1rLRfc spDcdNghukbbUcGVCIS+FWZbMgLtoe3bfOjJMkgH/1X94cXUiqqBXYG6wx/sVf8SGs0G AxLPdokqciOf2YJguunK9y4a6EovAvpAIMJZVjL29IvjCICbsNngK10o37zVqvuXpDMh TCHocPyVEJn21Po4p9Yo3JJrtE8Mqe04O4P4vBZaSIUTpdsCOopVvwmGLlxNjkC9PiTP iGZWmJs1ecDRV4FV4+Pyr21lKPRZYOGvwAAsoAgxnuJ/VItPqBj1o1B6OIqqyntRoULi dhaw== 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=OGj1U+RHEgRBo72Z19HJA/GgC9Z8W3lKprGNOAt6O6Y=; b=CtnWBJh/kSUAvc6mw9/Vf5+kI5y/VP8+FuPT0THqvdQ5cgScwWUp7MQ5s5i+plmhXN CjDluBSW8jd3fhvAMgYuHuUOyz6ngSEtk7wcCqshHqb0WbUoGc9jBxv/KCvLK3oN89vX kee34U/4Qgi1J3H+vWmWK8fyd+ayGjLTVt3KCozRmEfdJbybXNh4/saIfi2RDZaSRNqJ 9AToArbgy1hVoXIQ18m3LfrftQ0fPd8KAJ1ug6nCD6yn3uqbHm2ptZ/InoOOs7mj4448 hIn3DeuCwg4uF/32+VqoYtyFIdGvTD+v7J9h/vp8FYZ/7H+L9VkxxWVUxEuozLggogoG 5e1A== X-Gm-Message-State: AOAM533c8QXYY7hNZqfutsJ3fYi3assdlu7rFJdv9xZ3TUnFIgKY5fnQ VyRrnVOQm8z3GMN4d//0wkYIcjKm99JeiH9i X-Received: by 2002:a05:600c:21d6:: with SMTP id x22mr10386181wmj.112.1598520314503; Thu, 27 Aug 2020 02:25:14 -0700 (PDT) Received: from localhost.localdomain ([195.24.90.54]) by smtp.gmail.com with ESMTPSA id z203sm4357330wmc.31.2020.08.27.02.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 02:25:14 -0700 (PDT) From: Stanimir Varbanov To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Dikshita Agarwal , Vikash Garodia , Stanimir Varbanov Subject: [PATCH 09/13] venus: hfi_plat: Add hfi platform buffers ops Date: Thu, 27 Aug 2020 12:24:13 +0300 Message-Id: <20200827092417.16040-10-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827092417.16040-1-stanimir.varbanov@linaro.org> References: <20200827092417.16040-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 >From Venus v6 and beyond the buffer size and count have to be calculated in the v4l2 driver instead of getting them from firmware. Signed-off-by: Stanimir Varbanov --- .../media/platform/qcom/venus/hfi_plat_bufs.h | 35 +++++++++++++++++++ .../media/platform/qcom/venus/hfi_platform.h | 3 ++ 2 files changed, 38 insertions(+) create mode 100644 drivers/media/platform/qcom/venus/hfi_plat_bufs.h -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs.h b/drivers/media/platform/qcom/venus/hfi_plat_bufs.h new file mode 100644 index 000000000000..6dfecaf5b0bd --- /dev/null +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + */ + +#ifndef __HFI_PLATFORM_BUFFERS_H__ +#define __HFI_PLATFORM_BUFFERS_H__ + +#include +#include "hfi_helper.h" + +struct hfi_plat_buffers_params { + u32 width; + u32 height; + u32 codec; + u32 hfi_color_fmt; + enum hfi_version version; + u32 num_vpp_pipes; + union { + struct { + u32 max_mbs_per_frame; + u32 buffer_size_limit; + bool is_secondary_output; + bool is_interlaced; + } dec; + struct { + u32 work_mode; + u32 rc_type; + u32 num_b_frames; + bool is_tenbit; + } enc; + }; +}; + +#endif diff --git a/drivers/media/platform/qcom/venus/hfi_platform.h b/drivers/media/platform/qcom/venus/hfi_platform.h index f5f019282eab..692152f2075d 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform.h +++ b/drivers/media/platform/qcom/venus/hfi_platform.h @@ -10,6 +10,7 @@ #include #include "hfi.h" +#include "hfi_plat_bufs.h" #include "hfi_helper.h" #define MAX_PLANES 4 @@ -49,6 +50,8 @@ struct hfi_platform { void (*codecs)(u32 *enc_codecs, u32 *dec_codecs, u32 *count); const struct hfi_plat_caps *(*capabilities)(unsigned int *entries); u8 (*num_vpp_pipes)(void); + int (*bufreq)(struct hfi_plat_buffers_params *params, u32 session_type, + u32 buftype, struct hfi_buffer_requirements *bufreq); }; extern const struct hfi_platform hfi_plat_v4;