From patchwork Thu Aug 27 09:24:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 248439 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp9074ilg; Thu, 27 Aug 2020 02:25:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH4BT14QJTKGL0sacvHH7aq/UES5VcxFozSbLHRgbEhgV89kNnL0OdFnUnhjILf1mxWNuq X-Received: by 2002:a50:e448:: with SMTP id e8mr4439231edm.29.1598520333873; Thu, 27 Aug 2020 02:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598520333; cv=none; d=google.com; s=arc-20160816; b=PbSGy+Cvm1Qn9lTjpaxIaozhTo2dUJ0IiW+mkjxlEVk14rU15eq9KO0bwSjT7lccZo SD/WD03HEWKriXONELWmMPRIUMxwiVs5kIObo6hNIS/QguXurjBh4ZQPlCzHQC7epcH9 9I0k0F141gNaBxRS7MTYyS7b6Z0iaSz04pptpZw5F1H5h73aVDGpzCjARa98+A2+BLma oYw+dxhOs8LMGWcGe0uLvT//AHm9F9DU3DPk+h1fdwC9srG8hfkq5Tg9tV//dFBQaWoI Y4I87oR35QT/8kIElVlldtK/92NcRHasQQjPrIPPiv06ndKGZxttCi+1BSASZe3A/0wA iXZg== 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=IjADWSzCT4tmeYYeqMnXWFvGOJch/PV6F9uHmYRiMqE=; b=rLs1QnNBndQ+U78jmI31oJdCvJeiaFoK6MVb1r0aR6tcPyD5OArgVuZSzfvGqYNQ6V XuPPonGgT2pG+N0z9mh1xoo8gr/dalxlpCV8uf7sf1MNg6WPvMR0mWkxMd0opRWaiE6P Y7zWIOg9/N2xBFQHs5mQvfm0rLqGS8tgTlwhd+dISi11Lz+Wd5RUVHlg6E0fxzx36ouT DXbvX/Eb/zRVD44mbrnHRm/Puj1FN4TMt7QSak1Kfu2iLSc574gV7GKAEMM7TE6QC8as 3hkRs5Reym3hUg2PhSxWBY1XmNF/SUWwWQsF0O6vGtMfIUWPokhpqpKSROZG6E1oVCgS aKlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H5LzqCfe; 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.33; Thu, 27 Aug 2020 02:25:33 -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=H5LzqCfe; 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 S1728241AbgH0JZ3 (ORCPT + 15 others); Thu, 27 Aug 2020 05:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728590AbgH0JZW (ORCPT ); Thu, 27 Aug 2020 05:25:22 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFA3AC06121B for ; Thu, 27 Aug 2020 02:25:20 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id h15so4639528wrt.12 for ; Thu, 27 Aug 2020 02:25:20 -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=IjADWSzCT4tmeYYeqMnXWFvGOJch/PV6F9uHmYRiMqE=; b=H5LzqCfeFZyNCB8pFfEUZDJVEbwg3Q4f9eQe6thXzFWYdZdONwgHO86GMtBhyn8IL5 0RER+QCmlz5nDZEkIgPsvGJOARpWjuFRNK5xy6qg0AqcnVrcJRHQAn1sC9hRWR/MZoo1 FbDpQZvuJ4FNVgV2C6lI6+DIoTtxlvBAeJuPzj4X8a+w/qyW3b5YJ9AecYk1EoDyhUH2 kccxfi8L5RvDEPwdipli08No/B+MVkIiI8Sa7Hy3kZpeCGoZEPeSPvIjKKQpI/7Nuen8 8hMdO3deTxfFBQiEcBkHjSdMGHOXS/+wi+ZPyeROthYZFCMXuItg2DTE40Y09PygkQbL OH4w== 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=IjADWSzCT4tmeYYeqMnXWFvGOJch/PV6F9uHmYRiMqE=; b=ETeU6+eWCfOXLpaxtkdO+cEWFD8EXtddCZcphzi49ergZuNvvTl9/UMAMSK6dBHTcm 00E7SHHXyosviTve0zkEzxX1ptR+igCvd+t8bC4HJt6InR57rGy1TjUEG//47toSs8i1 FK4M8GJnc19ZwJ6hR6H/UdPBgMopCC95hA5b2uvXRSIGY0W3uR1bX/qV5S1n9W5uqzRR XbQ2LweRTVwAk0AvDxB02S03fNzLM7FvVAcbb5jHTKdZYBwOfRbOcmG5WQ/+KPxJf9t/ 2qm3CHGfIZsqdSPS+pfKTRDs/uD7O3YgPi15NaX7CM/2aMI2TQIiivveS+Lxq1rYVn2L kxzQ== X-Gm-Message-State: AOAM5338lm8WZHDJcZ/xVGgVRIZR5RtbThymhAkIze7OcED0+dTf/MhL Dx1xoYIzAEdr+xbEhjcsSSpj8Q== X-Received: by 2002:adf:f20b:: with SMTP id p11mr13232088wro.388.1598520319384; Thu, 27 Aug 2020 02:25:19 -0700 (PDT) Received: from localhost.localdomain ([195.24.90.54]) by smtp.gmail.com with ESMTPSA id z203sm4357330wmc.31.2020.08.27.02.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 02:25:18 -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 11/13] venus: Get codecs and capabilities from hfi platform Date: Thu, 27 Aug 2020 12:24:15 +0300 Message-Id: <20200827092417.16040-12-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 Wire up hfi platform codec and capabilities instead of getting them from firmware. Signed-off-by: Stanimir Varbanov --- .../media/platform/qcom/venus/hfi_parser.c | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index ecf68852c680..f0c9f73f842d 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -228,11 +228,48 @@ static void parser_fini(struct venus_inst *inst, u32 codecs, u32 domain) } } +static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst) +{ + const struct hfi_platform *plat; + const struct hfi_plat_caps *caps = NULL; + u32 enc_codecs, dec_codecs, count; + unsigned int entries; + + if (inst) + return 0; + + plat = hfi_platform_get(core->res->hfi_version); + if (!plat) + return -EINVAL; + + if (plat->codecs) + plat->codecs(&enc_codecs, &dec_codecs, &count); + + if (plat->capabilities) + caps = plat->capabilities(&entries); + + if (!caps || !entries || !count) + return -EINVAL; + + core->enc_codecs = enc_codecs; + core->dec_codecs = dec_codecs; + core->codecs_count = count; + memset(core->caps, 0, sizeof(*caps) * MAX_CODEC_NUM); + memcpy(core->caps, caps, sizeof(*caps) * entries); + + return 0; +} + u32 hfi_parser(struct venus_core *core, struct venus_inst *inst, void *buf, u32 size) { unsigned int words_count = size >> 2; u32 *word = buf, *data, codecs = 0, domain = 0; + int ret; + + ret = hfi_platform_parser(core, inst); + if (!ret) + return HFI_ERR_NONE; if (size % 4) return HFI_ERR_SYS_INSUFFICIENT_RESOURCES;