From patchwork Tue Oct 5 08:10:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 515234 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp1794067imy; Tue, 5 Oct 2021 01:11:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrY+eiiTkHR4vsF0n6oX0uRXVV6ZtENSNrFfUuP1dfjn4/GY6+xOde4cEcnKikwrUHNtbb X-Received: by 2002:a17:906:c0d7:: with SMTP id bn23mr23983677ejb.426.1633421472691; Tue, 05 Oct 2021 01:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633421472; cv=none; d=google.com; s=arc-20160816; b=ehsgvd9fl6qRz9HO0lSoSJRmDi4+xa1p66RlMMMKuztmB3wrm3LuvHBGEF97GhXV7C 1yzIrvkp4QmWlO/wVX1tpMFyZ0gqOd6Pu724AhPgKU9cBviYSm3F9d1EEVGZcWyJiqrS tpwIWZxFzDrqVwy0M+nO3kNUwPVaZJOkWRAcOO7IIFGbEfS/ClNxvOcdiZqByhoXq1Cq 8FpnBR7sm3zcaaRekZa3NncG9X2loIJYDmpRljiGI0eoTH/mLTsjtk3wplhdfa7dpv9W BqW7ceFc2msH0RFCd91AW9wcjNcspQ8zb5oVB1oaY/RrDtThInWmg0IFXw37GQGxhTsP il+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5aa4vZiuIFSCPHF4dxekm5eLMC5HcT+Pb9Hlo0UAubI=; b=b9Dx1ODlPXvACIB0bPTOmZecwUTPrmAr2HHSsw64qnbBTdqCRwK6SnNkdNA99GfLxd fHyfhI7/XAafIfO3suYGc1xcmwKx5hrHiA1W0m/gU/XVZeY0/eAJasplJBsmcotw3BeK OhlwToio48zL7nxrfuRfG6JzLSz/aE5hj3LsJG6soowLYu8EgCui5qPsjjhBhiWEwjAF T2KQtecalxzZV/JzYJ6YSR7CiGBlrhQVgIcBOeG9mbdbLxtljXv7nilaLHKNXbjRdBFu rNTnfGw3YrwuM7rRIeWxl0aOH8wr/1pT30HEKFdV2vwbqGbHcOUOHYYWtnUm88kG8ZZt rAUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JYzfxac7; 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 ce16si24791463edb.634.2021.10.05.01.11.12; Tue, 05 Oct 2021 01:11:12 -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=JYzfxac7; 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 S232761AbhJEIM7 (ORCPT + 17 others); Tue, 5 Oct 2021 04:12:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232942AbhJEIM6 (ORCPT ); Tue, 5 Oct 2021 04:12:58 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3667DC06174E for ; Tue, 5 Oct 2021 01:11:08 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id bm13so24926715edb.8 for ; Tue, 05 Oct 2021 01:11:08 -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 :mime-version:content-transfer-encoding; bh=5aa4vZiuIFSCPHF4dxekm5eLMC5HcT+Pb9Hlo0UAubI=; b=JYzfxac7W+813vz3g6oISyCSz1sLUD4TZXUQfbe+Ap5PzbUCz8pDjLyYvazAS9erlY z3K037RE8QB+HZ06Sx1KP5VYA3uMLdY0lVEwCZ6ldhl56L4hZ83AuoJe1MF/JL6P0fWD Z0jgWVbjUB/K9WrR7rDiJ7+W+p12mI6/Z4WfeQLMeQUw7JoaR1C5WmOitJJLH39zviF4 rb6k5R+5hRqp7cDpsRqIgyRwmb1eSxOjrD1F2ofrkbv4IPj9lI90PPbTORFgOzRvZNeG ADejhdeUFvn6QQWdkOy52Yva9v9+FJgvUiXUmHRD9UCKGxJTlL2ClW4TWOar75Mia6Jj XHWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5aa4vZiuIFSCPHF4dxekm5eLMC5HcT+Pb9Hlo0UAubI=; b=VhbB7+XhXvRXAxTf6IF24rS1Q7+Xjxmk1emAUmSuXTfSfZ3yhHdtBo5ru2zjb4nvo+ Di7hXivtvE9/joyu6mxy5/UUrNobZs990ArK7dRb8h/WZX4BbHWHOmua6t5xjIKJwa4i FjpCOJopd063MnEXcFAHBWE4Bs6+chAR8Qkt5NPP5H/1fkSjV9+dvnII8hbBMfVF8Ef7 AeMhP3F2RTv6E0WiTBr2GS2ecq477OIMTQJ51MsHXieKeyNdyMh4IgmHT8nqshQsbKuj i5IkdWuSvd4YadOo+f8gm9tQNFmWdoOoCYC8rh/HC22HQNGOT5i72Iaj9IZ2upvXYvQQ OSSg== X-Gm-Message-State: AOAM533Zau+tlY6Q7PBu5kMK/pxfRCtqmevDruUNwykW/kSkSj79B/Yo VF9ebAgFhJHFitododjwPENOVg== X-Received: by 2002:a17:906:aed1:: with SMTP id me17mr23060476ejb.474.1633421466458; Tue, 05 Oct 2021 01:11:06 -0700 (PDT) Received: from localhost.localdomain ([84.238.208.199]) by smtp.gmail.com with ESMTPSA id f1sm3096258edz.47.2021.10.05.01.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 01:11:06 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal , Stanimir Varbanov Subject: [PATCH v5 1/7] venus: firmware: enable no tz fw loading for sc7280 Date: Tue, 5 Oct 2021 11:10:42 +0300 Message-Id: <20211005081048.3095252-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> References: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Dikshita Agarwal Enable no tz FW loading and add routine to reset XTSS. Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/firmware.c | 42 ++++++++++++++----- .../media/platform/qcom/venus/hfi_venus_io.h | 2 + 2 files changed, 33 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 227bd3b3f84c..14b6f1d05991 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -27,7 +27,12 @@ static void venus_reset_cpu(struct venus_core *core) { u32 fw_size = core->fw.mapped_mem_size; - void __iomem *wrapper_base = core->wrapper_base; + void __iomem *wrapper_base; + + if (IS_V6(core)) + wrapper_base = core->wrapper_tz_base; + else + wrapper_base = core->wrapper_base; writel(0, wrapper_base + WRAPPER_FW_START_ADDR); writel(fw_size, wrapper_base + WRAPPER_FW_END_ADDR); @@ -35,11 +40,17 @@ static void venus_reset_cpu(struct venus_core *core) writel(fw_size, wrapper_base + WRAPPER_CPA_END_ADDR); writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR); writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR); - writel(0x0, wrapper_base + WRAPPER_CPU_CGC_DIS); - writel(0x0, wrapper_base + WRAPPER_CPU_CLOCK_CONFIG); - /* Bring ARM9 out of reset */ - writel(0, wrapper_base + WRAPPER_A9SS_SW_RESET); + if (IS_V6(core)) { + /* Bring XTSS out of reset */ + writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET); + } else { + writel(0x0, wrapper_base + WRAPPER_CPU_CGC_DIS); + writel(0x0, wrapper_base + WRAPPER_CPU_CLOCK_CONFIG); + + /* Bring ARM9 out of reset */ + writel(0, wrapper_base + WRAPPER_A9SS_SW_RESET); + } } int venus_set_hw_state(struct venus_core *core, bool resume) @@ -56,7 +67,9 @@ int venus_set_hw_state(struct venus_core *core, bool resume) if (resume) { venus_reset_cpu(core); } else { - if (!IS_V6(core)) + if (IS_V6(core)) + writel(1, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); + else writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET); } @@ -162,12 +175,19 @@ static int venus_shutdown_no_tz(struct venus_core *core) u32 reg; struct device *dev = core->fw.dev; void __iomem *wrapper_base = core->wrapper_base; + void __iomem *wrapper_tz_base = core->wrapper_tz_base; - /* Assert the reset to ARM9 */ - reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET); - reg |= WRAPPER_A9SS_SW_RESET_BIT; - writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET); - + if (IS_V6(core)) { + /* Assert the reset to XTSS */ + reg = readl_relaxed(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); + reg |= WRAPPER_XTSS_SW_RESET_BIT; + writel_relaxed(reg, wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); + } else { + /* Assert the reset to ARM9 */ + reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET); + reg |= WRAPPER_A9SS_SW_RESET_BIT; + writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET); + } /* Make sure reset is asserted before the mapping is removed */ mb(); diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h index 300c6e47e72f..9735a246ce36 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus_io.h +++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h @@ -149,6 +149,8 @@ /* Wrapper TZ 6xx */ #define WRAPPER_TZ_BASE_V6 0x000c0000 #define WRAPPER_TZ_CPU_STATUS_V6 0x10 +#define WRAPPER_TZ_XTSS_SW_RESET 0x1000 +#define WRAPPER_XTSS_SW_RESET_BIT BIT(0) /* Venus AON */ #define AON_BASE_V6 0x000e0000 From patchwork Tue Oct 5 08:10:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 515236 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp1794100imy; Tue, 5 Oct 2021 01:11:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoOtnG2gOGlzn8BDmaH80Ngjb9jYdvkWH8/ZDXg2wQwY/AEAHKD97BAvQh2l5GE8IdmZAu X-Received: by 2002:a17:906:5282:: with SMTP id c2mr23776745ejm.162.1633421476965; Tue, 05 Oct 2021 01:11:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633421476; cv=none; d=google.com; s=arc-20160816; b=L598UNAg7LFZFkLg1LNA6TT0etbillM3BxaWVGG8RY8r9mQ3ZPI1+0qRQDihUD8hDS IYaAJ45MqVQ21xUBYx7xz1hJZMML8q+2nreTVSskwFjPKxN2VeceW8sTcquBDUvsKi+N cNvKnOo667gck/0QTuYibeWVaxNnWef5di0txnnldjMYiwbBPpiuh0sJeO/HU/fYMKz2 KEsA9aRZRPhyuTgsIu2QDyNKpIGIrxxIY8ZuPQ26R8Y/qyQr64oTojjv8BrNOLxAOSpB w/TECi+3Z/OfMyUWWbyVY2px0TbOvHWfZDsrT10nhmr9wJtAsYSRztpKHpAtTv7WmpO6 eTvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ls8RstZxqwEUsOoWPu8ndBv6d6AzlNnldZDH8PTFT0s=; b=irOV5+99zVAPOeff5vqQ6b5QDGqGlafnmlh7a931OEt/WPQN5KrzSO0ZsFtGN+OxBZ BVIhIEXcH/9eR9yH92/yiYt2qi77Dvg2R9ctasjnVjEel4JYz2Bj0+8kLGbeRMOgv3Cc dv41cIH/38sSTEU6wsZD59WMRJupblFgdVFG7B5vzOOtf+SCQEjMey3aWDAnI5h08r7O Thp/VX2tZpvdthqsIy3hXms52Awu8Gy6B3pNFIFh9Ac7hJAGjXdL/9JfC5nEwVcfeXLP +7SS4D9UsrFMCqHuHtgel41fjpDw0ujYF8pVki82x7wiI2CNczQlr6PrAI3z5z/lnMaq 8wsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nO4PomRi; 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 ce16si24791463edb.634.2021.10.05.01.11.16; Tue, 05 Oct 2021 01:11:16 -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=nO4PomRi; 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 S233389AbhJEIND (ORCPT + 17 others); Tue, 5 Oct 2021 04:13:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233344AbhJEINB (ORCPT ); Tue, 5 Oct 2021 04:13:01 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74AE5C061762 for ; Tue, 5 Oct 2021 01:11:10 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id g8so75300635edt.7 for ; Tue, 05 Oct 2021 01:11:10 -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 :mime-version:content-transfer-encoding; bh=Ls8RstZxqwEUsOoWPu8ndBv6d6AzlNnldZDH8PTFT0s=; b=nO4PomRi8oyFYlAiKXx3pgeRDpA6tK4u/+itS+BRrE3bXCb44RNKaDruBFZ49gqxZU dfwndLroqe4h5ihs8+0PLL3U8FcjbkLNr4JTAhvoT4/wNPPRaXmRK1D9qHByepPzOvwz sigWiLZIMlmuVAMOVYW4CoB/Y2iEyrgdJUMX1V7vHvOMV75yhgIQY57oOvSpKTp9QCmc 0H2He5ZxubbvMovD+e/2Fz5WTqiVkDMIcw3mdNnZCEsbow/CxIdKnZ0OCdVVfKiaCpJl ZkghlpXCH3t38FKJPT4w8H1JD6wgQOgzoqplAF2d9s8UOiYx+Ii06g+vTi7EahvV7zFM aMkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ls8RstZxqwEUsOoWPu8ndBv6d6AzlNnldZDH8PTFT0s=; b=Pk1vCwEQXBp5V5NOwqM2TJ62CCI8D3fixEtfQVVMk+JXgQzF+jf8QSt61aYb2qgWb1 oaAF8RnfXfOh/fxXK/TBTLg9NQWYsUgprbVNqvbQQAfh0nTBiPQVXH0txPBX9bOI67KE 7UGilgx4y55TBelc1V5/9C+1pXOMqbPfrABv4ssYQMZBOACjTbpQLbqI98/vTuiSLUoT KVNBe64aigR+70NAii4PW70LsUKMSgxVS7UD7lZBEc6PqsRnm+pd5svmy1m6pQBOtqlp oewEdsRMgm2bIateYwhNPUXNNL8sbYOUFnIddD4+kys0wGpJ7xb20CPFRw/+wFiLX+7E ERQA== X-Gm-Message-State: AOAM530cYAOVfh3pTmgAA4q0L9hHC1YA86Ek5tSEngxsyeoU7cDgriw5 UypP/gkPMroF84if+ZkmNdccsQ== X-Received: by 2002:a17:906:6dd4:: with SMTP id j20mr22885943ejt.316.1633421468984; Tue, 05 Oct 2021 01:11:08 -0700 (PDT) Received: from localhost.localdomain ([84.238.208.199]) by smtp.gmail.com with ESMTPSA id f1sm3096258edz.47.2021.10.05.01.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 01:11:08 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal , Mansur Alisha Shaik , Stanimir Varbanov Subject: [PATCH v5 4/7] media: venus: hfi: Skip AON register programming for V6 1pipe Date: Tue, 5 Oct 2021 11:10:45 +0300 Message-Id: <20211005081048.3095252-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> References: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Dikshita Agarwal AON register programming is used to set NOC to low power mode during V6 power off sequence. However AON register memory map is not applicable to 1pipe, hence skipping AON register programming. Co-developed-by: Mansur Alisha Shaik Signed-off-by: Mansur Alisha Shaik Co-developed-by: Vikash Garodia Signed-off-by: Vikash Garodia Signed-off-by: Dikshita Agarwal Acked-by: Stanimir Varbanov Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index ce98c523b3c6..3a75a27632fb 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -551,6 +551,9 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) if (IS_V6(hdev->core)) { writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6); + if (hdev->core->res->num_vpp_pipes == 1) + goto skip_aon_mvp_noc; + writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); ret = readl_poll_timeout(aon_base + AON_WRAPPER_MVP_NOC_LPI_STATUS, val, @@ -560,6 +563,7 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) if (ret) return -ETIMEDOUT; +skip_aon_mvp_noc: mask_val = (BIT(2) | BIT(1) | BIT(0)); writel(mask_val, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6); From patchwork Tue Oct 5 08:10:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 515237 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp1794167imy; Tue, 5 Oct 2021 01:11:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+/c/KRAIoUIRIT5SlnnPZ1QImcdmKP8Iiw94ABGBqF7gFzpNAyxg0GgeiQy4FTBEVYGc/ X-Received: by 2002:a17:906:c246:: with SMTP id bl6mr22628988ejb.80.1633421483827; Tue, 05 Oct 2021 01:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633421483; cv=none; d=google.com; s=arc-20160816; b=H+HuRHD/imeeEl81BrP/4VZj9VRqklG59G+vQ4oT+c0wvxRfDNYrgMKv91QBAvr0YK P5rkvou2c22L47z3YnLTpqsxZl5UryVzu3d6ZWrbLK3zAdirjBws5xxCuqWPrTi8CAv6 So1eUagctK6Z8FHlcWCfb1IkWxCanaovdpcXy2YA5yAZt9umPUXreUntSSuLIMy4AaPq ChfgrhZBSUTaUri2nOrNW3zi/c6oLvxS5f2Qr7/5YuLXRosSDHlgDCk0Po8YFrMIk4Cz D0Ks6B6sA/tg1imx9dstVnMc8KDu33h+ubr1sj7/ZcAxiegbEtwbCeFJV0wMKxEVGbrb VkrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=F0rxTAIDQUC00gIGQ2hZRmANNTx894FvV5JJnWTgTsY=; b=S8l7AYOjatbcVU7M9GG2vc+bRiaFyT3tTOFDxcvnjgKbrRB/ueeB20Cn+eunQCxWMQ /SbIKGtEHZ3/VNtpslgn+G7myi37MHVBlbfqWznlqsEZOid7bUJ0b3EEzv4ZlPDow9hG G2ZUWm5AQVR5FEEyF5Mc1m3Qg+sFHj/Zj7y9lgPHMOIEAkdcOEikvo5IK5WyLxRsMpxe 4rbF8Jw11jUxr2bIO3fiAMpv6Ruih/85lpGL7sfc7qWK4+kFoq7u3nDQTidJmJWbObZ3 KavWXdVzw4mGdjwdeIooSxYKk6LERUHN3V0VrxGbijvjGoADFQBVtvnL9duPxs9x2zu8 +I2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ralaYkL5; 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 ce16si24791463edb.634.2021.10.05.01.11.23; Tue, 05 Oct 2021 01:11:23 -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=ralaYkL5; 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 S232929AbhJEINE (ORCPT + 17 others); Tue, 5 Oct 2021 04:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233357AbhJEINC (ORCPT ); Tue, 5 Oct 2021 04:13:02 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0E43C06174E for ; Tue, 5 Oct 2021 01:11:11 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id p13so47102603edw.0 for ; Tue, 05 Oct 2021 01:11:11 -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 :mime-version:content-transfer-encoding; bh=F0rxTAIDQUC00gIGQ2hZRmANNTx894FvV5JJnWTgTsY=; b=ralaYkL5Xw7qbWeLgFH9tju3bNrClp1qrs40/XNH+JU1eDpEbbLPT2ItFrp/WwdzY7 X86qpw1ZLWfkBOY0nbQkOvUh+gmdd390wSlCufXebSRTBfI0BXQOcXSzKoyrgD4WOWUw ETvXsXHT2FzybdlBglxdaHCP4Nx6aR1p3CZF9xsL5Ww1Vk0GE4vD3Xj89ZmXVfYg7pdM MPOEvzOkVtIvMzDrml3C1ZXf3VLfb4GQHuK8wCiTp8q6GI7JFEKnUkvio5tXyUdtxT0h rRNqznL4oRzNcNX2RjMlTjr7H4xgRegF5MDf15vLE7k+yt7CjiFJYMm0rBLS3Zv+QWBO OMnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F0rxTAIDQUC00gIGQ2hZRmANNTx894FvV5JJnWTgTsY=; b=shGc6y+6ccYImRG+QwzAwdl1jHFBainTaCVtUERmvm1fQPDHSvh7UI0Q+lBtToMT4t LGrCzVz7tWOLKHDxWMVeBGEIVUyx+bQXfwjyLGxFhSvBGwlnrgsBENx7dtiWhmV6p15V +kpH9JMnLv+7J1PrwrlnKl+VcVQManvbWYEP6/Z/G/WTr4cc6pOHWltDHNhT368b93wp 9D1R5XYNqWPnlIQNeB/7NSEdrnAxNdRws9QyFpV/6DsOGI27EzhV8d7zIWrjZFvBun4W lfzivKNFq/ADU72Ivhg5g+8qe1zkczrId6oMe7bwcbJx6HOzIBy7cihXbrurRVGa5iDk oGjg== X-Gm-Message-State: AOAM532/CC+gaNIdj321JZ77x0D6tdKfiIqnoP+YEm7QPz7sTkA/cefs L/6jZhsrzCjJ5wz9pXNsp0D2sw== X-Received: by 2002:a17:906:f2cd:: with SMTP id gz13mr15507022ejb.278.1633421470068; Tue, 05 Oct 2021 01:11:10 -0700 (PDT) Received: from localhost.localdomain ([84.238.208.199]) by smtp.gmail.com with ESMTPSA id f1sm3096258edz.47.2021.10.05.01.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 01:11:09 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal , Stanimir Varbanov Subject: [PATCH v5 5/7] venus: vdec: set work route to fw Date: Tue, 5 Oct 2021 11:10:46 +0300 Message-Id: <20211005081048.3095252-6-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> References: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Dikshita Agarwal Set work route to FW based on num of vpp pipes. Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov --- Added space after 'if' Return directly hfi_session_set_property drivers/media/platform/qcom/venus/hfi_cmds.c | 7 +++++++ drivers/media/platform/qcom/venus/hfi_helper.h | 5 +++++ drivers/media/platform/qcom/venus/vdec.c | 17 +++++++++++++++++ 3 files changed, 29 insertions(+) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 60f4b8e4b8d0..5aea07307e02 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -1299,6 +1299,13 @@ pkt_session_set_property_6xx(struct hfi_session_set_property_pkt *pkt, pkt->shdr.hdr.size += sizeof(u32) + sizeof(*cq); break; } + case HFI_PROPERTY_PARAM_WORK_ROUTE: { + struct hfi_video_work_route *in = pdata, *wr = prop_data; + + wr->video_work_route = in->video_work_route; + pkt->shdr.hdr.size += sizeof(u32) + sizeof(*wr); + break; + } default: return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata); } diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index bec4feb63ceb..253911272b4c 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -448,6 +448,7 @@ #define HFI_PROPERTY_PARAM_MVC_BUFFER_LAYOUT 0x100f #define HFI_PROPERTY_PARAM_MAX_SESSIONS_SUPPORTED 0x1010 #define HFI_PROPERTY_PARAM_WORK_MODE 0x1015 +#define HFI_PROPERTY_PARAM_WORK_ROUTE 0x1017 /* * HFI_PROPERTY_CONFIG_COMMON_START @@ -873,6 +874,10 @@ struct hfi_video_work_mode { u32 video_work_mode; }; +struct hfi_video_work_route { + u32 video_work_route; +}; + struct hfi_h264_vui_timing_info { u32 enable; u32 fixed_framerate; diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index c129b061a325..88cd9e46c333 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -656,6 +656,19 @@ static int vdec_set_properties(struct venus_inst *inst) return 0; } +static int vdec_set_work_route(struct venus_inst *inst) +{ + u32 ptype = HFI_PROPERTY_PARAM_WORK_ROUTE; + struct hfi_video_work_route wr; + + if (!IS_V6(inst->core)) + return 0; + + wr.video_work_route = inst->core->res->num_vpp_pipes; + + return hfi_session_set_property(inst, ptype, &wr); +} + #define is_ubwc_fmt(fmt) (!!((fmt) & HFI_COLOR_FORMAT_UBWC_BASE)) static int vdec_output_conf(struct venus_inst *inst) @@ -1042,6 +1055,10 @@ static int vdec_start_output(struct venus_inst *inst) if (ret) return ret; + ret = vdec_set_work_route(inst); + if (ret) + return ret; + ret = vdec_output_conf(inst); if (ret) return ret; From patchwork Tue Oct 5 08:10:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 515239 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp1794213imy; Tue, 5 Oct 2021 01:11:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+1IYvJC/uh0GX22X0p0eHPCArLhMhd5mBr/WNzcpfRFppr7j0X/cgp2CbY26r+x9WmUNL X-Received: by 2002:a17:906:681:: with SMTP id u1mr22724667ejb.499.1633421489027; Tue, 05 Oct 2021 01:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633421489; cv=none; d=google.com; s=arc-20160816; b=o3ATqeDIu02DwzgQlv4/2GEj35dgxm/h21zT8EdWWdqCN0qOHZuB1ObXyYF/a12K6L cyWIz+lREv9wPmc4YTsejIlpoMBaodyKJu7VmZHnjEYFDnqCisLAG7pavIdfAtCfC+ap CqdGt0llrWMHYg3nWZjOu3k9662LUmorJ5csBefbpmd/FJeWphgwkAnctqH17IEE+Trn zwjzloR5iPBacOymn2MUDmyp21LlqqAoyy9k0GAcprvCR2gE+LQa3i6QD3L5kV3rb6hu +kGhgMltzwb+tbX/EepwHVRj5sj0dpFnFxrdodDbEgWcSglfuAAFQkXdudsQBIC0z1Oa +Z2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NmNy3i7s7hkAq0MWmGrwqRoyEBYaUhWJOlMgIBRIabE=; b=Q1hzc4XW7zaUKq8cwSV97tuOO8F7+zNhh3RvHeupGmojj85Isb4oGcWG1uWF7XoWZg Cglku30m+umMjzCWxOhDBHw3lUkFNOwGdhYXcsjGrSrj8lRyc48wLqA7qiinmWuHk6xu DqnUfapv8yRvh5pGW7nVZ/zZySP8XL1Secv8DLBTLXjONPxbAp7OF/ZgG190cCvRly9K GFqiFkf+8bAmJW58iePyJ4qPf7O9EnZ43ehEXyn2LVnPhO/3KAUkbx9a1SF0Yf/+0ssj VUnRLSBTrszrmQKRMgiVlYiWO+unj4Q39EFV6Fl63iBrSSC5q4ZSgdXJ6FNd1JAOpSEu ihAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fRACUKHw; 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 ce16si24791463edb.634.2021.10.05.01.11.28; Tue, 05 Oct 2021 01:11:29 -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=fRACUKHw; 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 S232511AbhJEINP (ORCPT + 17 others); Tue, 5 Oct 2021 04:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233321AbhJEIND (ORCPT ); Tue, 5 Oct 2021 04:13:03 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAADEC061745 for ; Tue, 5 Oct 2021 01:11:12 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id g8so75300951edt.7 for ; Tue, 05 Oct 2021 01:11:12 -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 :mime-version:content-transfer-encoding; bh=NmNy3i7s7hkAq0MWmGrwqRoyEBYaUhWJOlMgIBRIabE=; b=fRACUKHw5J6LBEjmv2sBLsFdyXBxC1V9ozedco1OMNDzAl2bKFx6eb3sF3bDF+dtZu nefergbhHmFMtaYDeK1LUm0ZOe1kISlmPKer5r1mhbds1hc6AnWhuM/296wWt0aK/zeS mQ0Y6owfsq534Ab2sc527Da0KqLgGKvY8tQTtxe5fAhtpkNuYr/YeTd0MtrOL1h7UZWb h8vNuf99nhynEXtUls0jIx3MADIdVXZ3R2AtGDuBAz26X+tYnT8RI9M0I9+keBJrQFju faPnfz9mW7zhXmyNeIt/l7V3jA7nc6m53qPaeXagQJKbkcKfTVlxWyhTtu2qSTkomP9B lZkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NmNy3i7s7hkAq0MWmGrwqRoyEBYaUhWJOlMgIBRIabE=; b=7gfF77hxXpGbvVtsmQsofUfw6wWOb/7AWdTxj3tRLfTXDsId4y963997O0aWkk/EFI qfrvcrNm+tFrPFQb2Oz72rUYX2PHNbb5IAVuD+0nKs3BbvpQkdSyUwCqjDM/H03Yz2aB pYmjdfk0IOCRhQlwzd4RB2eWzAdeG+69bVcAcZ6lnJdNkF/B6NFFt4o1iI2LgPCH2HCb KS2x4HYTgpOqIVN8L/UPvge2NDBFGQ0BNpx+VJ9LWD+Zrn6MHsKugUxx68KMlzgCwSpy fz/I3NYJak9MHJNAjeJd2MTQWyZ02Ai2Csfl5BlEypZIikMoLTz4llqBY9OJOZWAAx84 WIAg== X-Gm-Message-State: AOAM530fn/1WRe0mtrnYq201Y8JIubpOCw0ISSplZfHmnLKIq3IST/Hx vT3dF6t4vR5hhpw/EZeUxQDTLQ== X-Received: by 2002:a17:906:8e0c:: with SMTP id rx12mr23105415ejc.423.1633421471283; Tue, 05 Oct 2021 01:11:11 -0700 (PDT) Received: from localhost.localdomain ([84.238.208.199]) by smtp.gmail.com with ESMTPSA id f1sm3096258edz.47.2021.10.05.01.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 01:11:11 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal , Mansur Alisha Shaik , Stanimir Varbanov Subject: [PATCH v5 6/7] media: venus: helpers: update NUM_MBS macro calculation Date: Tue, 5 Oct 2021 11:10:47 +0300 Message-Id: <20211005081048.3095252-7-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> References: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Dikshita Agarwal Consider alignment while calculating NUM_MBS. Co-developed-by: Mansur Alisha Shaik Signed-off-by: Mansur Alisha Shaik Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov --- Dropped changes in the patch which are not related to it drivers/media/platform/qcom/venus/helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 1f46a6f4456a..196a24892176 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -18,8 +18,8 @@ #include "hfi_platform.h" #include "hfi_parser.h" -#define NUM_MBS_720P (((1280 + 15) >> 4) * ((720 + 15) >> 4)) -#define NUM_MBS_4K (((4096 + 15) >> 4) * ((2304 + 15) >> 4)) +#define NUM_MBS_720P (((ALIGN(1280, 16)) >> 4) * ((ALIGN(736, 16)) >> 4)) +#define NUM_MBS_4K (((ALIGN(4096, 16)) >> 4) * ((ALIGN(2304, 16)) >> 4)) struct intbuf { struct list_head list;