From patchwork Wed May 17 21:14:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245690 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DA12C7EE2D for ; Wed, 17 May 2023 21:14:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbjEQVOc (ORCPT ); Wed, 17 May 2023 17:14:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjEQVOa (ORCPT ); Wed, 17 May 2023 17:14:30 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EE236A69 for ; Wed, 17 May 2023 14:14:29 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2ac87e7806aso12712001fa.3 for ; Wed, 17 May 2023 14:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358067; x=1686950067; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=708w9bx/Wu04zRxH+k1/smuWapQNc4JobQVr0bsQL/8=; b=njSbkiKckHvpb8hxV2jEL9KYhmW8/M9Dc0FacwUqGf+iDgCcPUND+pZCz+NmPPi7gE mZ2r+XLte/5R23qH9/yEvoO+Y6L+MNXETRxxo1FwRhWyReb+pDcJp1nmaYI14Q8HdDkb IQyuUyC4oXuOxxHtPbS4NASX03PRymCtcg8qxQNpxCIQVS5Fb2kR2DoHfWKjSZ8SQ6Wx 4s5tTuOvyqb0F6/4ETJRhawi1axjT67op04vw+xJpCNN+8hFgBvDExxQLXQ3kXunFbZl iQO1ak07ZJhOGMOQzpM3rFwXpjqP6vskRAa/yxZtAUXubno2TpK7zHDn+HlWcPHcqfhs YjlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358067; x=1686950067; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=708w9bx/Wu04zRxH+k1/smuWapQNc4JobQVr0bsQL/8=; b=cUb2WSmRv8mbd7mbUvnggY2VNP3gKCK8raFztsUsiymyK7C6gBkgwU2pS/QgadArxZ OWAM6mmSH2BaIwEKYw64+cmwn01zHu/Ufkie6MFvPzB9Zl38PfD+WO6q3Gx0GkGBuur7 zl9JsCrWT6UUYMeSsRq7vlPr5Q5fY8+p8GlLpr4kVivH4z/FoISWnXfE/GnyPL6V6JxQ a2beiFMl090THQEZkinRDkktscEMKHNo1XOGkig//7JnfSeI141HnLCraRmiWfiFfYr9 eYI7qTqUgHjTZUpqPp7Pw5EbRqYATNNNSvv7svepESwSu0Gns97hdMYA3+tVPpPeEfb3 qj2A== X-Gm-Message-State: AC+VfDytrwPfXxLtLVKpLqopDslaB+xjjS4kwLOCqURfdYcQh5lX2sxY d+D68cfCAxrokqr9F1vLscYaZw== X-Google-Smtp-Source: ACHHUZ49UNq5CYUI/Rar5KqRX27VOcT7F9KMudjoLsPkGbSCIAYNUFyaXTJD7elmBmv9HHx1wAaTOw== X-Received: by 2002:a2e:730e:0:b0:2ac:78d5:fd60 with SMTP id o14-20020a2e730e000000b002ac78d5fd60mr8971440ljc.9.1684358067391; Wed, 17 May 2023 14:14:27 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:27 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:14 +0200 Subject: [PATCH v3 01/17] media: venus: hfi_venus: Only consider sys_idle_indicator on V1 MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-1-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=2458; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=LQtQ1yE07Bg59BEEMI3NIlj9dkGtgWhznhuEDogV/mw=; b=8bZZHS52TCNJujUVtOO26n+dBvbX9Q52dRMUi3DdTuy7raShvuSA/0FuFA/vdkyw+HZM/pYvz udKWg8qKprNCe1IBZwGRwGRdXExmnnQ97r6TrzyaT31sVbvPOyKI2Gh X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org As per information from Qualcomm [1], this property is not really supported beyond msm8916 (HFI V1) and some newer HFI versions really dislike receiving it, going as far as crashing the device. Only consider toggling it (via the module option) on HFIV1. While at it, get rid of the global static variable (which defaulted to zero) which was never explicitly assigned to for V1. Note: [1] is a reply to the actual message in question, as lore did not properly receive some of the emails.. [1] https://lore.kernel.org/lkml/955cd520-3881-0c22-d818-13fe9a47e124@linaro.org/ Fixes: 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations") Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 2ad40b3945b0..bff435abd59b 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -131,7 +131,6 @@ struct venus_hfi_device { static bool venus_pkt_debug; int venus_fw_debug = HFI_DEBUG_MSG_ERROR | HFI_DEBUG_MSG_FATAL; -static bool venus_sys_idle_indicator; static bool venus_fw_low_power_mode = true; static int venus_hw_rsp_timeout = 1000; static bool venus_fw_coverage; @@ -947,17 +946,12 @@ static int venus_sys_set_default_properties(struct venus_hfi_device *hdev) if (ret) dev_warn(dev, "setting fw debug msg ON failed (%d)\n", ret); - /* - * Idle indicator is disabled by default on some 4xx firmware versions, - * enable it explicitly in order to make suspend functional by checking - * WFI (wait-for-interrupt) bit. - */ - if (IS_V4(hdev->core) || IS_V6(hdev->core)) - venus_sys_idle_indicator = true; - - ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator); - if (ret) - dev_warn(dev, "setting idle response ON failed (%d)\n", ret); + /* HFI_PROPERTY_SYS_IDLE_INDICATOR is not supported beyond 8916 (HFI V1) */ + if (IS_V1(hdev->core)) { + ret = venus_sys_set_idle_message(hdev, false); + if (ret) + dev_warn(dev, "setting idle response ON failed (%d)\n", ret); + } ret = venus_sys_set_power_control(hdev, venus_fw_low_power_mode); if (ret) From patchwork Wed May 17 21:14:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E65F0C7EE2F for ; Wed, 17 May 2023 21:14:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjEQVOe (ORCPT ); Wed, 17 May 2023 17:14:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbjEQVOc (ORCPT ); Wed, 17 May 2023 17:14:32 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7B566A5F for ; Wed, 17 May 2023 14:14:30 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ad9f2926adso13498001fa.1 for ; Wed, 17 May 2023 14:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358069; x=1686950069; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1cmL4u+Slx7l2A0wEzo/2w7BTBeWrOV7Pv60ybojUJA=; b=ER9r6Br4mcYlDn9S+VCz1x5xjWCFtW3c+PQBQAsY4cIrB4K2FuU+obzKEKleoP6sfa 58m6n1C5IQg3svsG7p5CIM16Jt+CY8LFUv4GuKygxQCfEP0aWaW/g7rK67a4z3EtaFU2 N+3e61wLZSqq3NB96zrurirR9zjFoyttsryDBirZAiNiUpE2FLct/NRiDkomGJCBiPRp 974iJWrFULvjb6DV9jIgT2nvXkdqHQeAYPiHsn5V95rnMfxAih/ueCjfIdaCNnf0C6+D vGusEM5ZhRJG+x3AYWeZbxzWhjmgeHsubm287QeJDWt+Q5qAmVFxOv9prKuMVdrhSYoE f3Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358069; x=1686950069; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1cmL4u+Slx7l2A0wEzo/2w7BTBeWrOV7Pv60ybojUJA=; b=Nn1FSP7+3FUsC4kQSM6kLlgLkwG9x3uyi2tHS2JsKh+4MgYb7yiOdimhqwErDOCUzm Yolnf0yzjvl3c0HHzRlm6ALz8Zp2AObvy6vx+2Aet73XCR9CgwLYY9ZGm/sCfzKzX/0T VxxQQxPKM+uFpVFgoUrQuR7ceg546vQgsCLZF0AcAo7ZN7mxplLoLwQmhcxc5IJj4cOL HGg4Kd2vqGab0+jwn6aqm6R9j0Lc1gG8OUTQd37klyFPYumcjn9J4XQy9edXP1pFTZ4p e4KnT2eCVYM8/xLiUSwdGAQL535d56Ts9IoLOlZiwfmFOwpcBJhFOoKp/lxZeGe8FXty 1NrA== X-Gm-Message-State: AC+VfDw73BYC2DbaPugvv8h/jrjA7a0ZeKlF+JeHq9UYgwjXcN/PGR1h 70vzOGu+2fmbbfwbcCc4pXOqlA== X-Google-Smtp-Source: ACHHUZ40rSRd0kTcTtQFpmLfCfr2FarYLUQG4NFHRCdETeTyeuiqFxeeW7g+LCyD9Rd67VHir2d+cQ== X-Received: by 2002:a2e:9e0f:0:b0:2ac:7889:3aa3 with SMTP id e15-20020a2e9e0f000000b002ac78893aa3mr9695712ljk.18.1684358068921; Wed, 17 May 2023 14:14:28 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:28 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:15 +0200 Subject: [PATCH v3 02/17] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-2-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=1518; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=OBi3iN9xHm3GkjRVCscvcLpgwCmitvtLl8nO9ocX5Gw=; b=WsAuikeiUnp5EwlibVmUd2TDnT+hUdw/xJt1naAfDqykGAHiU3/qguA/UbO9iwLOPLS69a5Wf SpDduUtnPfYBsfaZbC+DCtIC48GX8tjNbe9ZT5P8/fyQv/HOzpyMM79 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The startup procedure shouldn't be started with interrupts masked, as that may entail silent failures. Kick off initialization only after the interrupts are unmasked. Cc: stable@vger.kernel.org # v4.12+ Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index bff435abd59b..8fc8f46dc390 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *hdev) void __iomem *wrapper_base = hdev->core->wrapper_base; int ret = 0; - writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); if (IS_V6(hdev->core)) { mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | @@ -464,6 +463,7 @@ static int venus_boot_core(struct venus_hfi_device *hdev) writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); + writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); while (!ctrl_status && count < max_tries) { ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) { From patchwork Wed May 17 21:14:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245692 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33926C77B7A for ; Wed, 17 May 2023 21:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbjEQVOj (ORCPT ); Wed, 17 May 2023 17:14:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbjEQVOe (ORCPT ); Wed, 17 May 2023 17:14:34 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3272E7A9A for ; Wed, 17 May 2023 14:14:32 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2ac836f4447so12947761fa.2 for ; Wed, 17 May 2023 14:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358070; x=1686950070; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=WB7o5JzliPqClTUxbFBIzOZ1VAPC2kTl85qPjyuvehw=; b=dla0xxAgw14sSQpkBy1XDqebun4ISYqPPRp1iSXhSPWTef6ck6itwp2Y98QnVkReZF GpvDIb4WuYYs7hm67HcHOgnCjKz6JtEsEmNq/QaYbzQ3ycn6vWCFCqSstIKDC6EFU6Tr dwNaL/ODPSlEq7vqgsAU7A6ZHwsqct8PwX2hdab8jmJupW6xJOmVKXTTV4fYI4LCcO6I Dg95G16BYEvbL+/WjGlddz3pqr5vOohpGHjaYrZDjxVhHV8vwdP2zDzBJytkkbSgKtiH iAyYVgBL0cqVwFEEgdKPmUoSGdXwLGzuE1jNwlHOJqQXQsZqTKSXToFuMCieKA3/CJoc Rzeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358070; x=1686950070; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WB7o5JzliPqClTUxbFBIzOZ1VAPC2kTl85qPjyuvehw=; b=Gto9iJlZyuDNKtSF2HET8ealpcMbaTH6H3wKk4urWgaghKnljn0XTBvciwrPah0YTL 3ruM2gZvKEPz8YCzT/ul9o77C1+C3VdCwijE7cBKz6MR/14224W/1POx0epT1SqxakF+ SvIUvn79COniGwmzxzLe1FNEeuNwD+92dAW+I7fMU4PKipKiQLa6P7TvsMiRHjYQ9Ila NA6AWUFhYA4AJO2YwO5aZ4ZuhUN8Bq33gGDbzSAlpXSWRGvEYyrUAAHv8gAxlTlOUJMY 9NvijXetP5wgZUHQGW9LWY6ZXWbY4IqiO+KjGryaIfikrJR8x4yd9SRYW6agLC5VIEL4 oKHw== X-Gm-Message-State: AC+VfDyCAVpg1hCOUB1gHD/iVIfkEhUB6gOJ/SMGYfNheuqXZAblFJv2 V1uOWE4Oia1BePUHWk7F4E5/tQ== X-Google-Smtp-Source: ACHHUZ4lOGnG43GrE7vnXDxP7lMKs4LnDRJldBcGumsVA2ZKj+4w3XNxxEJFQhMyvbtkAnx7pcuoqw== X-Received: by 2002:a2e:b172:0:b0:2a8:c01a:71b6 with SMTP id a18-20020a2eb172000000b002a8c01a71b6mr9519546ljm.3.1684358070367; Wed, 17 May 2023 14:14:30 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:30 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:16 +0200 Subject: [PATCH v3 03/17] media: venus: Introduce VPU version distinction MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-3-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=2053; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=fQWU9RHiaT/ZJ+YZvKDL3yk/Cmmu65hET4UaVHeDybg=; b=MSj/MTkdOBsAAjOd9xHOkLdhXg9K+8D9c9MSPTarCVdqji1cP3OQmoxQKYt78/xr3r/5WoKtn pbacGU+XiN4BUX2kagT66UT3scWB2nnycC4DnBAaGppaU9ABdFkffzw X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The Video Processing Unit hardware version is the differentiator, based on which the video driver should decide which code paths to take. Up until now, we've relied on HFI versions instead, but that was just a happy accident between recent SoCs. Add a field in the res struct and add correlated definitions that will be used to account for the aforementioned differences. Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 4f81669986ba..62c310b7dee6 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -48,6 +48,14 @@ struct bw_tbl { u32 peak_10bit; }; +enum vpu_version { + VPU_VERSION_AR50, + VPU_VERSION_AR50_LITE, + VPU_VERSION_IRIS1, + VPU_VERSION_IRIS2, + VPU_VERSION_IRIS2_1, +}; + struct venus_resources { u64 dma_mask; const struct freq_tbl *freq_tbl; @@ -71,6 +79,7 @@ struct venus_resources { const char * const resets[VIDC_RESETS_NUM_MAX]; unsigned int resets_num; enum hfi_version hfi_version; + enum vpu_version vpu_version; u8 num_vpp_pipes; u32 max_load; unsigned int vmem_id; @@ -481,6 +490,12 @@ struct venus_inst { #define IS_V4(core) ((core)->res->hfi_version == HFI_VERSION_4XX) #define IS_V6(core) ((core)->res->hfi_version == HFI_VERSION_6XX) +#define IS_AR50(core) ((core)->res->vpu_version == VPU_VERSION_AR50) +#define IS_AR50_LITE(core) ((core)->res->vpu_version == VPU_VERSION_AR50_LITE) +#define IS_IRIS1(core) ((core)->res->vpu_version == VPU_VERSION_IRIS1) +#define IS_IRIS2(core) ((core)->res->vpu_version == VPU_VERSION_IRIS2) +#define IS_IRIS2_1(core) ((core)->res->vpu_version == VPU_VERSION_IRIS2_1) + #define ctrl_to_inst(ctrl) \ container_of((ctrl)->handler, struct venus_inst, ctrl_handler) From patchwork Wed May 17 21:14:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F50AC7EE2A for ; Wed, 17 May 2023 21:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229892AbjEQVOk (ORCPT ); Wed, 17 May 2023 17:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229827AbjEQVOg (ORCPT ); Wed, 17 May 2023 17:14:36 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D631D83F3 for ; Wed, 17 May 2023 14:14:33 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ac8ee9cf7aso13433841fa.2 for ; Wed, 17 May 2023 14:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358072; x=1686950072; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=umRAJMqKc5zF6FOAntGSMEcHnMlgnfWakGEzWkoJKuw=; b=xCQfwTscEvtS2rrOux3FRlqc0g861cQHp8W+wx4MmACk6AbBbjvABF7ylMkB1utg2w iepKJ3Xe9+zKqFIvFu7T4N4ZOxfQZtFAJZHN2AAseg3aVfwMb56JDEz4f5oPCSZcU7yc mfAQmN3xhtCVo+1x/UKM/UJxXIxdcqzyKI12LH7OmLTecgSbPFbwJZQ5PamRAqhzz9Ua WARLlGezEb9UlUS15/atY9lZ10pDG4k06zgo6t8LQjIzcHPgpUjTYfk8El1vJcKGyVMO /XVh9H07d9UzUJ8hUHPxnK40T2DeFmGcleRB1g57ia59asuZVf47cROmRJzVBXGM9LrJ 2raQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358072; x=1686950072; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=umRAJMqKc5zF6FOAntGSMEcHnMlgnfWakGEzWkoJKuw=; b=k3W4WPOb8l12ZaNdIAIjjm0XBIxKikK0s/sNLWsrFT/6sE7hJcLsb/4EWn/FX6IFwP 27/LaM6cYdM8erlr7y3AJ8T3lw2gY1VgygnZJxR28UnxCeroxcSOHCjp5LWkf44ZIHfJ ayIpZm0mS6IEH7VmKfd35Vbn2sAvnSS2og/21uH+TeBcgp6ewWaI9bhwj5eLap9Qy6M+ /9GT43TMFK441pdF03AgkPbhrKVym8dNLJP0SI4N2k6gHDEeCx0v1ZaHOsEvndUBGDEt 4nEBlY0HkAA8Ujzhs8XQ4le6lqtYSmFv72KNNOnzb5KHo29RYb5iz0nSsDCZuWMcqzXk DS1A== X-Gm-Message-State: AC+VfDyJU7WL13y58bwfn/KSn+vHY06oOK5yBN7/xecuwIuK16516H9S EZkvFpwGOL0CFzt9LSShiDV9FA== X-Google-Smtp-Source: ACHHUZ6bRdZiWx4+kMVTtpzPkUtuso8ZdtBEASLvPQSebYOcaJbFL78oPbNh4Blk6kyNIKYSua7MvA== X-Received: by 2002:a2e:3201:0:b0:2ad:8f4a:1e52 with SMTP id y1-20020a2e3201000000b002ad8f4a1e52mr9502642ljy.30.1684358072091; Wed, 17 May 2023 14:14:32 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:31 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:17 +0200 Subject: [PATCH v3 04/17] media: venus: Add vpu_version to most SoCs MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-4-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=2055; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=nc30HaKHpy9R0tdyW3Z01908RNfbGE4dIZSAtIHTLSQ=; b=YXKIWgtmy6cmCJsJJvLU4SOyJogiI+vvX3h3IUV8wCW9zGscSByxBEcJEZbzB8DDLQbVhwW+j xKexNN9dYTyBNpkvH74EMqflr76LpD6nvs/cJ+BMjqxephMCpvg/TqE X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add vpu_version where I was able to retrieve the information to allow for more precise hardware-specific code path matching. Reviewed-by: Dikshita Agarwal Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 2ae867cb4c48..01671dd23888 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -684,6 +684,7 @@ static const struct venus_resources sdm845_res = { .vcodec_clks_num = 2, .max_load = 3110400, /* 4096x2160@90 */ .hfi_version = HFI_VERSION_4XX, + .vpu_version = VPU_VERSION_AR50, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, .vmem_addr = 0, @@ -709,6 +710,7 @@ static const struct venus_resources sdm845_res_v2 = { .vcodec_num = 2, .max_load = 3110400, /* 4096x2160@90 */ .hfi_version = HFI_VERSION_4XX, + .vpu_version = VPU_VERSION_AR50, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, .vmem_addr = 0, @@ -756,6 +758,7 @@ static const struct venus_resources sc7180_res = { .opp_pmdomain = (const char *[]) { "cx", NULL }, .vcodec_num = 1, .hfi_version = HFI_VERSION_4XX, + .vpu_version = VPU_VERSION_AR50, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, .vmem_addr = 0, @@ -809,6 +812,7 @@ static const struct venus_resources sm8250_res = { .vcodec_num = 1, .max_load = 7833600, .hfi_version = HFI_VERSION_6XX, + .vpu_version = VPU_VERSION_IRIS2, .num_vpp_pipes = 4, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, @@ -866,6 +870,7 @@ static const struct venus_resources sc7280_res = { .opp_pmdomain = (const char *[]) { "cx", NULL }, .vcodec_num = 1, .hfi_version = HFI_VERSION_6XX, + .vpu_version = VPU_VERSION_IRIS2_1, .num_vpp_pipes = 1, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, From patchwork Wed May 17 21:14:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245694 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6580BC7EE2C for ; Wed, 17 May 2023 21:14:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbjEQVOm (ORCPT ); Wed, 17 May 2023 17:14:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbjEQVOh (ORCPT ); Wed, 17 May 2023 17:14:37 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D4847DA3 for ; Wed, 17 May 2023 14:14:35 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2ad1ba5dff7so12940611fa.3 for ; Wed, 17 May 2023 14:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358073; x=1686950073; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5gG/GQ4bkNLXJnem7GziPpF9ACnuRetCT8nUsDWFQHk=; b=vSIj1+oZFAYVRtwioBnGxGaAXDLfKXNpJfbu5/rANdjHYWUiK6Bj0df1uAHEXBy8Qv tOH5d33onrkYsznkSUgVGz4FrKk57R91ULfaaMyeKoS+h59UARWZbmN+3siNEK9hZ/wn RZ7d9X05HOFVMxhAQvPZxTkhC/QROoYGWu7ZCMcQ1mEOH1+e0B8oDJq/Tr5jMYXveRPK sRACF9P4AfpZ8RkHZO5jsdWoayleb56OaNGtyGEetPFpfBdxes2W2xyZ8KnlkreNJkDj 0m1dvIP8HCW/9CTDdk7VmOUrhAQdACGjb6UJWwXorM/ggkLbd5Y2vBLsswz0Vjbv3xWo 3KTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358073; x=1686950073; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5gG/GQ4bkNLXJnem7GziPpF9ACnuRetCT8nUsDWFQHk=; b=bdBUEd7qSDJ0EaoilamElogF1DPYWnGUloZ/3SW8Z9Vr05icOZKAw5xNyR2EP2/Jpo iUAPSyHZgZfekgSVyVYBMxYcrBLqo+JDbW4Lpb5HJ1EteAoys9+zx8WtyX0m2VTLWc4y bkTHdcyTIZR6IHNRMf050URAidO70hva7YwkieLqZQdcdtjibupRYuP9IjI3vdbGCvfS cRK9MOJLwFtYh292Y9cedGZNODVy73ROKLh49kvBue2brGEcdHAAxrNPjoHwJjKbjdWq YpQtL1Dsfx6fnvZelPCzQ59erlKaetL0pvXdtA4hhJEJpSnNtMA//ch1v93I9tYxmKnz BBcA== X-Gm-Message-State: AC+VfDxW7UqEhtnWj+T1zPF+YW/QI4SXkDKx0Cqc4Ayz79pS0OVTtarT zNgGqYH0238YpMepETe5pr1EYQ== X-Google-Smtp-Source: ACHHUZ47dPN/yUfwtzFPQBsQNanqaTYmTSNJxzPm79fAGqBsWTcsMzZKpz0zDi4cW3weMgUcpFodJg== X-Received: by 2002:a2e:2405:0:b0:2ad:fef4:94f8 with SMTP id k5-20020a2e2405000000b002adfef494f8mr5031112ljk.6.1684358073668; Wed, 17 May 2023 14:14:33 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:33 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:18 +0200 Subject: [PATCH v3 05/17] media: venus: firmware: Leave a clue about obtaining CP VARs MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-5-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=1589; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=v9h9rG/TP42x17XwYSGnOJ0sfKKqjUawup8lEKzjmAc=; b=A5EEgQQqTZxOi6ejKxEA9oEfEBDTipRgEQMr+gx/nVDMyy8fYOae7ciOxHIEMRchnCpypoJqM GqjWy6f5X3ZDuoLE5VcFWurfDeNy8W4RY+BXSVuLaFeVC9vRYGz+5yj X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The qcom_scm_mem_protect_video_var accepts two sets of pairs as arguments. They describe the virtual address ranges of the CP (Content Protection) and CP_NONPIXEL regions. It is however not immediately obvious how to obtain these values. Leave a comment explaining how one can translate the vendor device tree properties for use with the mainline driver. Reviewed-by: Dikshita Agarwal Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/firmware.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index cfb11c551167..572b649c56f3 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -241,6 +241,16 @@ int venus_boot(struct venus_core *core) return ret; if (core->use_tz && res->cp_size) { + /* + * Clues for porting using downstream data: + * cp_start = 0 + * cp_size = venus_ns/virtual-addr-pool[0] - yes, address and not size! + * This works, as the non-secure context bank is placed + * contiguously right after the Content Protection region. + * + * cp_nonpixel_start = venus_sec_non_pixel/virtual-addr-pool[0] + * cp_nonpixel_size = venus_sec_non_pixel/virtual-addr-pool[1] + */ ret = qcom_scm_mem_protect_video_var(res->cp_start, res->cp_size, res->cp_nonpixel_start, From patchwork Wed May 17 21:14:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53D22C77B7A for ; Wed, 17 May 2023 21:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbjEQVOt (ORCPT ); Wed, 17 May 2023 17:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbjEQVOi (ORCPT ); Wed, 17 May 2023 17:14:38 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC0247A99 for ; Wed, 17 May 2023 14:14:36 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2ac7de2b72fso13466121fa.1 for ; Wed, 17 May 2023 14:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358075; x=1686950075; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/SMIxbzQsbA3j3Sn/cFi6oIH9U6UOcuGopU1jwYoxzI=; b=ENZ141snmw41TacxRPtH82IJeitzBbxUTAe2ew4flCFkoHjNyObBMHingajjyBeIkC rm2gIHCIpKWJwYdss5Fclm9rzqfdqsUMGZz5cyMZjgGz5mSSYhhdAtifYM8yn0r4qTy2 cKV8eiSqjqIRX2n26e0LSQGsPkbyVznqiSjHWm0zozqvD+2iBmb3pSsD3mWN1JOCA6GW VjP76btQMEFgm4dH8A6OmEITY16Z3c2AEm0T5U7TXF3ob1SA677eA+g70Ah33jOL3Y/4 Jhmvr6x686628QKBAIB5ogyP61oh+tiX4bChuNzlMX15U11tY2NWC6VSMeSpNwNRfQUI a6pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358075; x=1686950075; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/SMIxbzQsbA3j3Sn/cFi6oIH9U6UOcuGopU1jwYoxzI=; b=E//7+OnSBDKq5CQQ3ISNPcIhJ20+bCbaV+AvSpQ89fGf+6gZJViij0UnQfiHEDYMIW M0jGRn7HSu9VS8BhZ3EVHnxtyKZsEeblFU41ND69IFdIqkSN9bXn0rPoeHvZIzpc4Bna SKeU5qKgH3UHjDIeJ7DUjDR4xmHO1McMH75T8dHDM6ee3YtiUUHoH5LtmKeAPB4Bqh2E ByAJH1sNKt0CySmyk0QOpCtyXVGR6PN/mZRN7xgy2dahxoA/ONuI0i4hejOd6TRkEpbZ XSd05i2OwweeqepEhBO1tS9+/JuMM5AwnExASA6yWBvkNlnIjh7hYZB0fmHFj9y9FsjH 2cTA== X-Gm-Message-State: AC+VfDy2qH1YOMXo+HHTzQx6mTrS11WgCxfn2GJBUVkWF5y+pFuwH3i8 60A5BF88+XyrCZuYg5kZSCwKbw== X-Google-Smtp-Source: ACHHUZ7a4dFPFuSQ31F2rsmq/ckQkqlVG1wnkVuLSWa9zbc+zlig3Duk/oPDsoC5kQjcj4SQDpUG9g== X-Received: by 2002:a2e:910f:0:b0:2ad:9139:c871 with SMTP id m15-20020a2e910f000000b002ad9139c871mr10062316ljg.19.1684358075353; Wed, 17 May 2023 14:14:35 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:35 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:19 +0200 Subject: [PATCH v3 06/17] media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-6-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=1788; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=R/8X6NFLn14XxMVcEJ6kABO5lC3geO3MpBjA7WOBG7c=; b=hShc6PwEdR8dj70dMIWq8olCXlH/tw/vxVtWQbs/94pYFCPJAGVgfuKYA5jN6hzFHDj1f6GFL Kw9hTFCgUCWCr5D9gX2iYQ6Vr5TYoFbshK8FoSL9qpYWm3IdJCAFlnI X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The current assumption of IS_V6 is overgeneralized. Adjust the logic to take the VPU hardware version into account. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 8fc8f46dc390..5af24e98caf0 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -447,19 +447,20 @@ static int venus_boot_core(struct venus_hfi_device *hdev) { struct device *dev = hdev->core->dev; static const unsigned int max_tries = 100; - u32 ctrl_status = 0, mask_val; + u32 ctrl_status = 0, mask_val = 0; unsigned int count = 0; void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; void __iomem *wrapper_base = hdev->core->wrapper_base; int ret = 0; - if (IS_V6(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | WRAPPER_INTR_MASK_A2HCPU_MASK); } else { mask_val = WRAPPER_INTR_MASK_A2HVCODEC_MASK; } + writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); @@ -479,10 +480,11 @@ static int venus_boot_core(struct venus_hfi_device *hdev) if (count >= max_tries) ret = -ETIMEDOUT; - if (IS_V6(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) writel(0x1, cpu_cs_base + CPU_CS_H2XSOFTINTEN_V6); + + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); - } return ret; } From patchwork Wed May 17 21:14:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9E10C7EE22 for ; Wed, 17 May 2023 21:14:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbjEQVOy (ORCPT ); Wed, 17 May 2023 17:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbjEQVOk (ORCPT ); Wed, 17 May 2023 17:14:40 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64D7D6A7D for ; Wed, 17 May 2023 14:14:38 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2af16426065so1120881fa.0 for ; Wed, 17 May 2023 14:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358076; x=1686950076; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=9oPfJC6OBBAeuCH43x8eLqOMDvJk8T9kLQJRwnypwQw=; b=rPUwRZMsSj5d0jPUa5gYgmj4IUPRtKqIotpR1rwhyUTjExssuBItA+Lx3vcE1hysrq TcHYHHJU7PqblrLczMm5cJNtq1/9sTuiLdJb2ddcmw3fAGinQHx5X1WAcqZpxgOAgu7j VTTLJggCk5Me+L/ADAdFmkkDx3JzVhuXGGqm6jOK0VogupyUCuZA8t5uWcVXZ+UykJGp eWLaTC1jnMN2GBMKuTig9Z1CKXj87/lXxf3Tzg3oQWu3TD7P01f3ooiHEfexJFjtgda3 78ZGHEJzPe8ZjA6WLjkDVejVTd9VSzVz93thoXYcnj8xeAfABLEIWqRKhIR7w8+yk6H7 ajgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358076; x=1686950076; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9oPfJC6OBBAeuCH43x8eLqOMDvJk8T9kLQJRwnypwQw=; b=BRN7mzYVPiD1IWwE3KcoCvdScSvLL74bA48XbKv0jGRZTt7P7z/PioKgfnrhboe4jm orf2swaXyn2ua5eyR+GfHmy9c7ANfSY37uCCPB1td4+RarKSTIFjZiqmOQQ1/jW2N6iz 6UjB5qatdsqjxDJuKzsvdQXqu4SeY00epY3avU7D8JpZwqjRQSdBgd749Hn1FFaBejST QyeIT4u7wqk5+JjezRQp1sYHSAA3y7PIz0+8bEANoL/yt/oOHpGammoPN6Wc82m6Vb82 Aoyijjqib8nLTSO7caXexOOh3DluI0pfukgmlGIaTc5eQ11FPdjLGQBkBFqYeKUsIwhm c4OQ== X-Gm-Message-State: AC+VfDxsGqrh3zZ5XCHj8P7v26HY2fSc2h8EW/xC4Z0UzqEvjLUVY08R Yf39fwbhEhAm6TMOb6vrDweizQ== X-Google-Smtp-Source: ACHHUZ4u9EpfFiAx7OgNp+FzqCCGluMj/aGtSvhonn7dgME7pfs46oEJ7OQ9BhkzHC1TBLpNsY4mqg== X-Received: by 2002:a2e:3001:0:b0:2a7:73a2:d915 with SMTP id w1-20020a2e3001000000b002a773a2d915mr10026221ljw.5.1684358076759; Wed, 17 May 2023 14:14:36 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:36 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:20 +0200 Subject: [PATCH v3 07/17] media: venus: core: Assign registers based on VPU version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-7-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=963; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=9/pa6GP77zIAoaGrc5qIKA7KqFqqqTvo3gmVZwuXVQU=; b=yOkDY26HewJXTHuaB8SaqNGGAUn0dTTCsW2wQIU73tObHSEFJ/w4Eqq1yTEvgw9sMD3HNomcn JqBqmLhR0Z6BzsH/cktKAyHCxyE6qd0yCKFvN4R16ZrDl8dCctuxs5z X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org IRIS2(_1) has a different register map compared to other HFI6XX- using VPUs. AR50L uses the same offsets, but doesn't feature vbif_base and aon_base. Take care of it. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 01671dd23888..69c77b2137cc 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -246,7 +246,7 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type) static void venus_assign_register_offsets(struct venus_core *core) { - if (IS_V6(core)) { + if (IS_IRIS2(core) || IS_IRIS2_1(core)) { core->vbif_base = core->base + VBIF_BASE; core->cpu_base = core->base + CPU_BASE_V6; core->cpu_cs_base = core->base + CPU_CS_BASE_V6; From patchwork Wed May 17 21:14:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C1BEC7EE2A for ; Wed, 17 May 2023 21:14:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbjEQVOz (ORCPT ); Wed, 17 May 2023 17:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbjEQVOm (ORCPT ); Wed, 17 May 2023 17:14:42 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B6688A6C for ; Wed, 17 May 2023 14:14:40 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2ac8cc8829fso13409151fa.3 for ; Wed, 17 May 2023 14:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358078; x=1686950078; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=n8al+fUYTJ6+PEz9NPDS7tqKtmY4QMGdOMScxyZdTNw=; b=x+Gfsd4ueg48vKx4TnKfLz/AwaIQz+3WaLfB0edEvFCJ6KjZp3mBk1PYpn0V4D9N0P XSVFtaEUsWL5fVkVJNFtt45wV5RsC1gHw90WwlVom79QDp3uJC5tqPlqUYdMDrmIy352 8mRaq6f44b4qhrq7GzjNCb6r0UzNZtHQ55eqSByQpcwKxkCxyYVp799MJa+FRXSr3cr1 zptJcnPDST4SusUTrzwyQ7uhBJjyST+Uaj0+vfPt0tp8Z4Et14Keb+AP57TVi8lH133c Bu0insZJ9lSSEctWwwQPrBykVhpCXJhor/iJH/AyV2OoxME9vOP1qmNaW1JOU3ymABQV uXFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358078; x=1686950078; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n8al+fUYTJ6+PEz9NPDS7tqKtmY4QMGdOMScxyZdTNw=; b=jhwwIJGT8KaLjKD/PS1mi9WlTSIsbnwTkAOn/KK7iWkEX6EB4SaURQF9a00mguMTm0 mg33/IWcgQcQvBvor/77zqWOueenyhkY/khReWmhCZ7xoAZ9EUr5QXISI23BWwIrQs2C MtISMgB4k9ndZV8YCP0wUrPfElQEUd+2Z47m3KEHlG4Bk+Vou/n4bucirEybUsussjLB 12XqJV99N9XmcR5j8YD0WSOPiZOZNN69N9e+peswWUHyYJzklYtpnhbRYvJFAeimqIlr gOBPJqJxut/jlJ0DAmZwRCcSTj1F255hOXDXNLKpCT08qFOvaRE/sDVFwVSFgKxErCxx ZfIQ== X-Gm-Message-State: AC+VfDy5eaa7bPmZfmFq5PhYXsZmfudq8yB+C/MxVM1Bd/Q2FSyKBEIY KmW+anyu0f9B6R+E2TGcgiht+w== X-Google-Smtp-Source: ACHHUZ4KD/Q/7xNrqQNz+v+qn4QbB81qLid14El4RbQB4wuevWByR/m1DU3ejSst4j+sKyUF1aZh5Q== X-Received: by 2002:a05:651c:1045:b0:2aa:40dd:7a55 with SMTP id x5-20020a05651c104500b002aa40dd7a55mr10338038ljm.8.1684358078270; Wed, 17 May 2023 14:14:38 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:37 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:21 +0200 Subject: [PATCH v3 08/17] media: venus: hfi_venus: Sanitize venus_halt_axi() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-8-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=1056; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Ec1MN/ZRnQHIQIjMUfVoLM7+Of/DpbtvAPWcmBv7Ia8=; b=4d0CN7DjxeqmKugz1Y1UNz7adTZVr0CiA2yKMw2Fwg3Zt0sjASvd+QBwHLV5vbO0pG6ZUs1I6 Iwx0TvUt7cxApg5sSzXI4HW9fXzi93t7NY8PPAaA+veK0KpN4z1kMjz X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Only IRIS2(_1) should enter the until-now-IS_V6() path and IRIS2_1 can be used instead of openly checking the number of VPP pipes. Use VPU version comparison in both of these cases instead. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 5af24e98caf0..9082a2def687 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -549,10 +549,10 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) u32 mask_val; int ret; - if (IS_V6(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6); - if (hdev->core->res->num_vpp_pipes == 1) + if (IS_IRIS2_1(hdev->core)) goto skip_aon_mvp_noc; writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); From patchwork Wed May 17 21:14:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF5F8C7EE2A for ; Wed, 17 May 2023 21:15:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbjEQVPC (ORCPT ); Wed, 17 May 2023 17:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbjEQVOw (ORCPT ); Wed, 17 May 2023 17:14:52 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D25BB9019 for ; Wed, 17 May 2023 14:14:41 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2af1551b2a3so4222161fa.1 for ; Wed, 17 May 2023 14:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358080; x=1686950080; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=b+mqagyKbbLeYmxfLsA4ErQtn2tgWCu/qclngu8iHe4=; b=ve/z3Oz3wYDcUUCrrdAyhzuWlRw6PARpGt+5BepVq9mONktamsPUWOSDyeSbbzOfQy k6TI79VrGnZzHmj/wNgs1MREtQ9q9XQlwbFZyEt6bAxlC1R1ZffssbDW3LVlURtiCB/u rZWwuVsQyA2mGF8D04RtuHV9uwrMYBKboa497vKQ8h92S4KhwctouiM2Q8Ji1DlgZENx g7CFz0ibHy+098KTTn7R2T/XTXzE7rTaJA2ha7QU3zVjuHQ+kcfjMDSThcbJ2qZTKMpP BKROIOgDcmcvlJOdrDpts/NSi9APMvdwDPRDtUbQrQqm2wRnZSMx62dVy4akXlDfhwp7 PjPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358080; x=1686950080; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b+mqagyKbbLeYmxfLsA4ErQtn2tgWCu/qclngu8iHe4=; b=MqOU968OC4wYSuaPkd8SZcBKHt/vPzaLCJAfrbM0EBii41H8fPS4KF6rEx/LfWAbds CLhtSydr9ykBuFA16V5pEkYsMmajmxjjL4pT4Va9AieJGp1ZLTpwhylt5voaW0Wi9fnU YzPvWiOTlubARxjlD0L8VVMJE7bvIPathHu5MdcOVBPxbEAtg4RDF2QfBdRjUeB2RTPg kJ9fuxX6XMdiXyPvuJkBCK7E152dyQqcP+p8YjB/fk9fRu7HTnt6dKC22NBM4DnCSt5v bBzTE8jMUvni0qh+P3Ut2+loaHlKijdZ/ueYrzIc6JW6ktB0E07k2MU7+XUzzzLjHTNS W3Lg== X-Gm-Message-State: AC+VfDy6cJ61lt5uLYLFqMBHWqI7QJiqGynOC7lZNwHSi+JIwddeRljc qjjD7QgMpel+BwMneRJXtm1GuA== X-Google-Smtp-Source: ACHHUZ4WdpG34k7NQv5dmiGwwi4kmFQfQcMnvPE1r9yY2KxCl2gD0eQ+hINlRSn6C2kuMk9/dO4ioQ== X-Received: by 2002:a2e:a496:0:b0:2ac:75fa:eef0 with SMTP id h22-20020a2ea496000000b002ac75faeef0mr1183428lji.7.1684358079864; Wed, 17 May 2023 14:14:39 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:39 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:22 +0200 Subject: [PATCH v3 09/17] media: venus: hfi_venus: Sanitize venus_isr() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-9-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=1296; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ZwdlwLeKruTsDw0KULMN9qiT9PmoYnKtE1aX18zqNUU=; b=gz8BU8HTu41amrQv+L2yV5os7YaEiQCpyuP7RBdxDCTTfQ2GuVF2bR6aNQw+23vlxfRCoR4Dr oMuOL/b/PRQD9BdNxYm8HFsTxJt8+sBcv9meiaprvdDt3oGv4nCQzxt X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Replace the general IS_V6 checks with more specific VPU version checks. Reviewed-by: Dikshita Agarwal Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 9082a2def687..9665fdcfe8b2 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1130,7 +1130,7 @@ static irqreturn_t venus_isr(struct venus_core *core) wrapper_base = hdev->core->wrapper_base; status = readl(wrapper_base + WRAPPER_INTR_STATUS); - if (IS_V6(core)) { + if (IS_IRIS2(core) || IS_IRIS2_1(core)) { if (status & WRAPPER_INTR_STATUS_A2H_MASK || status & WRAPPER_INTR_STATUS_A2HWD_MASK_V6 || status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK) @@ -1142,7 +1142,7 @@ static irqreturn_t venus_isr(struct venus_core *core) hdev->irq_status = status; } writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR); - if (!IS_V6(core)) + if (!(IS_IRIS2(core) || IS_IRIS2_1(core))) writel(status, wrapper_base + WRAPPER_INTR_CLEAR); return IRQ_WAKE_THREAD; From patchwork Wed May 17 21:14:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B68F0C7EE2C for ; Wed, 17 May 2023 21:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230053AbjEQVPE (ORCPT ); Wed, 17 May 2023 17:15:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbjEQVOw (ORCPT ); Wed, 17 May 2023 17:14:52 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50DF59EFF for ; Wed, 17 May 2023 14:14:43 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2ac7f53ae44so13736481fa.2 for ; Wed, 17 May 2023 14:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358081; x=1686950081; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eGodNVX/frMkABBLHr47hHKAI4yOnNqADEGr8yuNWnc=; b=HilD8Z6Yn8MXx1FuSrj/gfL3Z2QlQ7NM05MZGgj+CHNjuUzXCbigE/ZtaU57VO9oFi 9I0Gf5M8/8DnVfzrUf+/NUlBhTObJhIDTJqh3KFI7wF5ZgOnbw40WbLI5hXMfDc8dGUN 6F7RPF4g5YeUbFilMkniHtDCJTY4iUlaJpd+oKTULXGZpJFO2ZHwJKdf0p0Y2o9iFnud J+srixZripfOyfj75nEbsAg/QxOyXwEZDtcDBAAY+d/Oek+ZNAeZ+awLYG4GiHbKiJJX SwFaTsdpbLrf8ss3wFALVPIFtHd9Chp3DU188UVW0lfgpOGILagi0P9ngYHSEaQDTbOl /Aqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358081; x=1686950081; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eGodNVX/frMkABBLHr47hHKAI4yOnNqADEGr8yuNWnc=; b=KAHzoLvKP9zusoohPJTQgTSk/Lp45O1UW5fx+2g63KqD48gPSFyIOFH+B3ClqJR9oO apNMrLckpGCh+dADtY78hhQ3pe/LBBVp6ycGWyFNkYsfrT41zC341Ad82zj2AHvWBR9d aVJyxJbZhlElQcxnb2B/nDx0zqw0Zng4XjlZkNLroOCQdktwHwJd8PqVTq+akgTAn1kz dZul8JZ7VOtvQq8q6DoHzk5DV0SWZ4SpXx66cU+VG1VM0p7tHHA6HaTIKeReWcLkb4j9 yvfhmpp5NBYi8bS7Qop1rfstNtMnH8hQjqQ0SnNc7pdAYFIyD/3FZ8wixKQzvcqXccsI cUKA== X-Gm-Message-State: AC+VfDwym384i4/8oR0w2uptYgpZX0QyDu6QlUK3GNm4xB8FJGSTim8i 0pMnAqMIwQFHdLBcG1TRKciopQ== X-Google-Smtp-Source: ACHHUZ4Pk7gv9/u3lGdJcdqYx3cDDJLUZRjzAiiB+N8Lbi0NEpOHL+DnmVQUi7y5k8kAuMPJ3mT0BA== X-Received: by 2002:a2e:90ca:0:b0:2a7:f1e8:b08 with SMTP id o10-20020a2e90ca000000b002a7f1e80b08mr9439220ljg.19.1684358081314; Wed, 17 May 2023 14:14:41 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:41 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:23 +0200 Subject: [PATCH v3 10/17] media: venus: hfi_venus: Sanitize venus_cpu_and_video_core_idle() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-10-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=915; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=7JZorB0pUApJvhWmRa0skblAX3OBAMRX8izC1hetESc=; b=bGbLMrqhUnj1TC2JbGm2E6a72BDHCzqWi7diiqThBzkw8Y3vPQ3eeUHJxDo5bclivNhQGqp82 FowJwNNcqK5CXa97p/DP8DXQIs3IJ9ufutXfgg7d2HHhhZX2fHk2D4R X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 9665fdcfe8b2..2db5361cd5df 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1537,7 +1537,7 @@ static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev) void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - if (IS_V6(hdev->core)) + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); From patchwork Wed May 17 21:14:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245700 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17D13C77B7A for ; Wed, 17 May 2023 21:15:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230078AbjEQVPN (ORCPT ); Wed, 17 May 2023 17:15:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229895AbjEQVOx (ORCPT ); Wed, 17 May 2023 17:14:53 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C54EB903C for ; Wed, 17 May 2023 14:14:44 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2af12685274so5802211fa.2 for ; Wed, 17 May 2023 14:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358083; x=1686950083; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=CAf0/qoqHKUIRtb0ngzMvnNiZNHVa6Jfr73oUt0pxKM=; b=FVnA6WsFW0zoAzCv6H+kbO9qraBaPBYxHMIKkzbr+A4UZdYwJCAxegNCMXkU3RVmfV ZFTz+XxYV2woaFChYQS6OGVtdO3DhC74kdmYxWG9gUWpeV/OaoXQQfF98vjG1DK4atAW 3S/G9YiaiR12TsQuudU/mAa8g4PDor/ch2Ex9OE+O/UZIaTcYwXgKrMOSW0Jx/5aZLxI c9n703kwEtkI6+x2DJ2ntcOFcWX5C3ACg0oR6V8pTHli+PCXdrxb8rnCc67AcGyZbYJP S+6uqgYK7jqIrVWZWjM/dXJF7kgF/y0K6XSogSJXOe+oFjLg7YB4HgR8CXRXt/osgBJJ pEhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358083; x=1686950083; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CAf0/qoqHKUIRtb0ngzMvnNiZNHVa6Jfr73oUt0pxKM=; b=I5+x1u/NgyNiSG1deLQp9zqEH6BT2MFjE86DQOM03riaHo4ogBSTtxXk0feC1tk6cm XsMWaIaMkb7BaLUltlfUZwgpVGZ1xQfy3xt7O8YmHXmS70kw4NXqdnx/Mqy57MnNtvkr nlN4FcLJ8EG6LDM0ka4K8uGDbC+3dzvQS7IbO6J9N/I6M3XGHWv6RMxJEZx8/7bsHgT+ 2phHvp5vGE0kV5DXcf7iVBRRLox9R+Vmm0RMihKX4PyeXfvTRps2+2P+G50r4W1vfS4P UDkX+mPC/56SzJ1a8x1C8QXuF8ZFP5fW+360BT2KxpKf/SH72y22EtrFvp7tuzkMAvdS 5w7g== X-Gm-Message-State: AC+VfDxEafOXXmqYWwYqrGT+5gTiESxGPUGc1k5fXijInDGMa2UyxWUn fMITPG7k/EopskgN1AM5Cq+l0A== X-Google-Smtp-Source: ACHHUZ5rRoX8gPjScShdz/mReax4WkVRDeJh8uSlCs+7I6yB2tMGKVvdW8+P+3Ns2nGjlTFTZ6+hGg== X-Received: by 2002:a2e:b709:0:b0:2ad:f8d:dea with SMTP id j9-20020a2eb709000000b002ad0f8d0deamr10982653ljo.11.1684358082955; Wed, 17 May 2023 14:14:42 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:42 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:24 +0200 Subject: [PATCH v3 11/17] media: venus: hfi_venus: Sanitize venus_cpu_idle_and_pc_ready() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-11-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=913; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=i7kHJHgzddaQidXryK/eoAjtHGCE1SThJBvwoun4KlE=; b=e+RcPjLVdkjjddFqjj7bF91NbgkvCaQSbjYiEeroR0nMP6OKy6b8cZbS93u9/4Grita12S1d7 LJqrf41c3VXDnn8T0wdfZxe+4bbXeTQQZhgCPIn9YOG+wkTcBQogMUh X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 2db5361cd5df..105d49fb72be 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1557,7 +1557,7 @@ static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev) void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - if (IS_V6(hdev->core)) + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); From patchwork Wed May 17 21:14:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E09F2C7EE22 for ; Wed, 17 May 2023 21:15:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbjEQVPP (ORCPT ); Wed, 17 May 2023 17:15:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229905AbjEQVOy (ORCPT ); Wed, 17 May 2023 17:14:54 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9E587ED5 for ; Wed, 17 May 2023 14:14:44 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2af16426065so1121971fa.0 for ; Wed, 17 May 2023 14:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358084; x=1686950084; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=tD8sADHcRsSq9QkDCRoE5JuqMpJE24bgCDvH91fnaag=; b=fWK4a3TxhnR4+vQWwKc78ULZk+l86K9r2wgGO6X4lcc9RvVrbaXbO5dXP3zbbpB2yk zrP5bqY/OoAwP6hAl59TRupUlWJ5wuP3TjNCzNT6HOTig4g1u9ZvaA3DPmGzFb8Lp6pD Pkfgc1GXRcuCxuI0+F2/R+vYZlgEoPZ13y5MCQF29S6KEyS/7pMjUKzKrFl57tDJ6X/1 zuxWu3dAxbRhKVQ84UXTV+kDGau6C0PTgoXI7oBr4I9d9d5GSIWf5hMUE3T82ERohHS3 +qhxvIWW/5iCPliEYUSZbQ9Pmw8FZLGZnyVA30knI/Sbub8b/89E/ivqE2s2R8fWkfdw qkWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358084; x=1686950084; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tD8sADHcRsSq9QkDCRoE5JuqMpJE24bgCDvH91fnaag=; b=k/kVfc/ukWbUlgRHcjoL/EeGHN7TLtWA5Nb5+qTPqG8swEUCZONnfhIVeJQlsSRR53 Z5S240IVQc60ZBy1RfKttjGFm4KZwkucr6ubsesNHpGBULPvfsqsHtMb466BmUDVeOw4 opTbA9dGrT8j9yBLsruJKewhTRC1oIgFh1bkAgsm1TavuzPUbdT6GoKAwZBwfD0A7tGf 2J9LF2xHFZLByvF00kcioXt4EO9mAgihxpE7wG+PaOkOi15K5i9VkbkNOnGIKNRIuhYO 0C2S9rwqAq8kbW8Ivdfo8GZ0a1t0zbCDyLnYSFPPfpuYppFH9VrPg+LUYnPOLiRPkNG3 31zw== X-Gm-Message-State: AC+VfDz5GwS+V2LU8WHXQgGpWTlLxpYjR5IL8Wnbv25KnqRPDePJXpVG ++5WDtr2cqIOMrCXGFa8LZbiUg== X-Google-Smtp-Source: ACHHUZ6Naxvu6Tu1jSreFZzq+4Iz+YoCyM5FeYh/8C4RBaOpE3flhosbS+/uIFvU2nHNrRodddS1Lg== X-Received: by 2002:a2e:81ce:0:b0:2ac:829f:487e with SMTP id s14-20020a2e81ce000000b002ac829f487emr10903563ljg.21.1684358084503; Wed, 17 May 2023 14:14:44 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:44 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:25 +0200 Subject: [PATCH v3 12/17] media: venus: firmware: Correct IS_V6() checks MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-12-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=2239; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=hZ+hgztR9wHWbz6QthMQ1eS50eS1f+OVy6D5ufbrrY8=; b=+RHQ9L/G1CxdtabVF8ID0djAkMzXA+4Uw4nLISy3nZw7hJ1zjcr/tvzoO2cg/oqgCnbcq0bV+ PG8dhBwIRkMDRCcw28F2yE07u7O0KnqbnLcY8Y8RuzxkGr4o22PgAja X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Most of these checks should have checked for TZ presence (or well, absence), as we shouldn't really be doing things that the black box does for us on non-CrOS platforms. The IS_V6() check in venus_shutdown_no_tz() should have checked whether the core version is IRIS2_1 (so, SC7280). Correct that. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/firmware.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 572b649c56f3..ceb917f2e0d4 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -29,7 +29,11 @@ static void venus_reset_cpu(struct venus_core *core) u32 fw_size = core->fw.mapped_mem_size; void __iomem *wrapper_base; - if (IS_V6(core)) + /* + * When there's no Qualcomm TZ (like on Chromebooks), the OS is + * responsible for bringing up the hardware instead. + */ + if (!core->use_tz) wrapper_base = core->wrapper_tz_base; else wrapper_base = core->wrapper_base; @@ -41,7 +45,7 @@ static void venus_reset_cpu(struct venus_core *core) writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR); writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR); - if (IS_V6(core)) { + if (!core->use_tz) { /* Bring XTSS out of reset */ writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET); } else { @@ -67,7 +71,7 @@ int venus_set_hw_state(struct venus_core *core, bool resume) if (resume) { venus_reset_cpu(core); } else { - if (IS_V6(core)) + if (!core->use_tz) writel(WRAPPER_XTSS_SW_RESET_BIT, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); else @@ -179,7 +183,7 @@ static int venus_shutdown_no_tz(struct venus_core *core) void __iomem *wrapper_base = core->wrapper_base; void __iomem *wrapper_tz_base = core->wrapper_tz_base; - if (IS_V6(core)) { + if (IS_IRIS2_1(core)) { /* Assert the reset to XTSS */ reg = readl(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); reg |= WRAPPER_XTSS_SW_RESET_BIT; From patchwork Wed May 17 21:14:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07525C7EE2C for ; Wed, 17 May 2023 21:15:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbjEQVPQ (ORCPT ); Wed, 17 May 2023 17:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbjEQVO6 (ORCPT ); Wed, 17 May 2023 17:14:58 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BDA97AA0 for ; Wed, 17 May 2023 14:14:46 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2af1551b2a3so4222991fa.1 for ; Wed, 17 May 2023 14:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358086; x=1686950086; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NCbmXotl4JHp6511qJyB6cem0LHm1+AqjQQ+gB6Kt5k=; b=UQjG0/WuV5etiyDEFOP94o2jTjOe5xRhvCKVl73vhfDmGmrmoPKZM9TbL7d2MMqSYm wESmm+0FW+v1QpAlutjXMT99Eves69zCtLY7SdsXo5dvFZbkhBuFIOjHDRS5ba6sHGV9 QJw7yG6oT1jZqx0xZmQSMC0t5j8Muy//u36CzJAAHS+APAwxpKHzmwmoGQS94hRi4XUK kLmwRzv3wVB9vlGSmQlRQ1bBQ6w486spfmfYe82it95DiK5rwdv5xx0aYx0+IY5fR5ZS 7sCchTViFV/BCsoIDiTb0tXxxtNBW4J8qxdnpMnAvqnUwGWSUqKzog1izUwYeLLRJSfv j+dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358086; x=1686950086; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NCbmXotl4JHp6511qJyB6cem0LHm1+AqjQQ+gB6Kt5k=; b=gUWyNmkeOgu+9ai2qj7YfcXb1A2ieNZcZovj3ErMU21xAYbhjP2yFsOt6KWlYzBpZB 6ik1VSYASsmX2Tqi0NqQImWfKgBm5x/e0wt2WZDK0/iVAwqauL48xHg2PAg8CF4TAgML ySASeSOOyzqgypEU+9He/atrKW0OrwsTjhPiyWt2ZNvK74G/7MkDIUwe4I6l94F3DwFd mTRCqPOpN7iOSz8P4fEgwCQ4m7/UCt5g7DI4lfMnoLL0fwa1MzfUKcUYb4wi1Ekk0dqk 2epiAOQXJSMiVpf+tND/wRQenWRomQGaX4vC7ZdOP+Xc6beGt1/6zpYZEmN/MGHeiEhF p0lg== X-Gm-Message-State: AC+VfDzoqKF37pYXCZv+R6FI8aNjJPgSi9LlVqMFVt9rKTqd7iGPj/B5 TCZ7yELyBusv7RZe+WwwCFlhVA== X-Google-Smtp-Source: ACHHUZ5rOHGPLn5W5f5+X+lyCQPlcGHnJtwKPUMcFBMVTZmagTmp4w3JjhMcYlHN/hzdlNE5TsvQrw== X-Received: by 2002:a2e:aa94:0:b0:2ad:90bf:a5a9 with SMTP id bj20-20020a2eaa94000000b002ad90bfa5a9mr1298857ljb.1.1684358085936; Wed, 17 May 2023 14:14:45 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:45 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:26 +0200 Subject: [PATCH v3 13/17] media: venus: hfi_platform: Check vpu_version instead of device compatible MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-13-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=1007; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=EUWf2T+I6vhFizSQGtxC124WvawcGCVn6gQZEf/m3uU=; b=UpdjgwgmzcU1sXtNPOGiLxsGyZkEb7Yb3IUpfGrtlJyrVgA12baH+lL/rASjTNvM2lvrLsbPS gxBq5TpxWgaAioFlLIcq6de3Jo54QZn9Zh1W3oWvMKGdDIkEhzA1UV8 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This is not a matter of the host SoC, but the VPU chip in Venus. Fix it. Reviewed-by: Bryan O'Donoghue Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/media/platform/qcom/venus/hfi_platform.c index f07f554bc5fe..d163d5b0e6b7 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform.c +++ b/drivers/media/platform/qcom/venus/hfi_platform.c @@ -80,7 +80,7 @@ hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codec if (plat->codecs) plat->codecs(enc_codecs, dec_codecs, count); - if (of_device_is_compatible(core->dev->of_node, "qcom,sc7280-venus")) { + if (IS_IRIS2_1(core)) { *enc_codecs &= ~HFI_VIDEO_CODEC_VP8; *dec_codecs &= ~HFI_VIDEO_CODEC_VP8; } From patchwork Wed May 17 21:14:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DA10C7EE22 for ; Wed, 17 May 2023 21:15:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbjEQVPS (ORCPT ); Wed, 17 May 2023 17:15:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbjEQVO7 (ORCPT ); Wed, 17 May 2023 17:14:59 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBF587ABF for ; Wed, 17 May 2023 14:14:47 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2ac8cc8829fso13411281fa.3 for ; Wed, 17 May 2023 14:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358087; x=1686950087; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nDGFzpmpMzEfdx1VC1Hii8Q1Q5+BqfzALqEO/TlStp0=; b=RVDZ3hYucDHtriDtggZ7B/vQ1NH6HgaCqdG8RdKUXujWODZJ7mMM41N1No5HaHDh45 6qnmqn+wibkOhyW6DJ2JUwKKcWwwkFQ00z6hk/AcpYVqDwnIcLBMPmxiUZPfm4o3Vgml J0NuUg0XFLPDwSpniYqpT/22Qj04euCFqdwqiiXfsoQIhwo5DXcGTNCsmYsSTZJdbV4e 8HWneU6OqoaxDRMK7x24HF5OkZfz0totOmbFvMRSziNUEVGgHDZ55rLJRY33Ydiy2zGF XVTyfximvcH1+rQiFL9hmN6Tm+yv3OuFF+i1s+0oTzFlsaTL9i0E11bDTeQgK5ZCYfFu C8gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358087; x=1686950087; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nDGFzpmpMzEfdx1VC1Hii8Q1Q5+BqfzALqEO/TlStp0=; b=S+lluXY+aqtNViig3m5N/UK7wVIJzXqu5ShVtV88x+HwAQBZ8t128kael3yC7a6k6x QX3fCvv8yLW+fCR7cQ9ZKWqeEX2IjdDhelSqK7VNMDDZui/4cMbK5l3aNxiH6eKx1s8d HuJRLEWAao96MoBfWW79SZjWgjpENZHGnTcJ5cXbuZVq8FbxsLWCc7sYRsiIOYZDs9LP KMsRkWvB5Dcx9mFZvHHhslo34JdUsYCqMvX0D3AZFD/wn1Q1ENY+mA20Gp3uuv9fsuVz F1OpuO7WyYl/fc1kakqbGVs2wgOlXl2k1ElW5x0yXMWUTIhpHLd7KIcfLkuOsktXq/Iw /Ogw== X-Gm-Message-State: AC+VfDyvofxlhZ8N3HxGjkrMYDcMI93b+mN6RFcDqEJYsyJKKiudPKRu nTuGH+6oWZtsjvl2ScuvFlfGZw== X-Google-Smtp-Source: ACHHUZ6k21x2x6MNJETwjbepZirGO9oOGF82ibWO4x17Az088t+bnqa57caBVPNtXX2C6R2s7DrG3w== X-Received: by 2002:a2e:8513:0:b0:2af:3f7:53fe with SMTP id j19-20020a2e8513000000b002af03f753femr1564839lji.50.1684358087507; Wed, 17 May 2023 14:14:47 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:47 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:27 +0200 Subject: [PATCH v3 14/17] media: venus: vdec: Sanitize vdec_set_work_route() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-14-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=867; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=APaBO7FviqfKlqEiE3ehDGGYRc2ypqRE0QzbhTatWLQ=; b=MHxc67Qgwqs4bXALR1ab343Uesn0bN5RPPf+MTD3Ca1Bh3j1c0Onb/wdqus87N3lmoUWNgU71 CU860m4dWsGBVNaPPV8hW/bzYr3xoObI4Jj5jM6x7oaTHZnsy5Ee3Ba X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Replace the general IS_V6 checks with more specific VPU version checks. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/vdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 51a53bf82bd3..b880e290a62f 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -701,7 +701,7 @@ 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)) + if (!(IS_IRIS2(inst->core) || IS_IRIS2_1(inst->core))) return 0; wr.video_work_route = inst->core->res->num_vpp_pipes; From patchwork Wed May 17 21:14:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245704 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9156EC7EE2E for ; Wed, 17 May 2023 21:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbjEQVPT (ORCPT ); Wed, 17 May 2023 17:15:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbjEQVPB (ORCPT ); Wed, 17 May 2023 17:15:01 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79A0E9011 for ; Wed, 17 May 2023 14:14:49 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2ac87e7806aso12715571fa.3 for ; Wed, 17 May 2023 14:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358089; x=1686950089; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zVbKXR6TkuL6mzIO8jr1tML/Qs51vqKPlZsOURKyzn8=; b=HpqHPqBJ3HV308jnTgGEc7EcQAWCm5gziORxglayJncV8PKoYDv9pJ3I6bSeH3EOCY O1uw1s0L4brdiDWX2E7Z152oPk2ErzlP4z6LsPUlphpLkOooKrknoFPi1tnbgWfsEjGG 7sNPPhqoUrjJQK3Fw+WaSvCGfeOuHAMbZ1E1lduIRvw9eDouPgaNceU0Z/sSPb+YAUct OPPBKpg391LJVKkMEGa8OslcAowTry6M0pG7ZGdxFDbXNiHhXVpPahdqO/Q3zEK2xlUW AoZq3ANC6x/gWmaeMstCnES7boecyBb22yL8O2AwBRRyVk6tGdrjmJ2ttLP+Dxdvd3fN mUIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358089; x=1686950089; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zVbKXR6TkuL6mzIO8jr1tML/Qs51vqKPlZsOURKyzn8=; b=kp3Utj14sGcJPC8nccnnYinME06iYFGYXHHnc55mbsOPuTyEYy7flP5UwyaY/9wuTs CXkVCOO3CbUhclG/J3PuUlC5HQPVAhqt7NJIUm1VQL+JB3Ra7lg2CVXDH/9rz4PvR+Zv TG0v1DZgRgHhti2Rl84b9m/bKwflbewJui53Tw/qJ9E3mKCtW8pGX5BW7jr0LlAVJAMN 4LbC1FB4VHneSRPRtOuQeqFHgI6JAQU8701ZGDQHOL52cGwQDgz/RgAWuYCVld5Zx7xa cpF7q/sB7BD+pXi8dE/BlEzzCC5e25rWo8oaSCzdEYnDMoTyGSNVBFF9KXJXKElTb2+Y 6mzA== X-Gm-Message-State: AC+VfDyVSQIr9ZfX3QE/EdL3xwAlTgjKKR8FQQuqCi0BGZURkdFrNlFR rviJrMX+3CWlYy9zR5P3L3FPxA== X-Google-Smtp-Source: ACHHUZ5exr7VAV5/LK7pMyI2/TNScAr7gJ/VEXcUFywReKvCQ4LT/JUNvghsizJOOdvE9f3NnffyTQ== X-Received: by 2002:a05:651c:1045:b0:2ac:79df:cb49 with SMTP id x5-20020a05651c104500b002ac79dfcb49mr10244952ljm.27.1684358089008; Wed, 17 May 2023 14:14:49 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:48 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:28 +0200 Subject: [PATCH v3 15/17] media: venus: Introduce accessors for remapped hfi_buffer_reqs members MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-15-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=7631; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=iJaK8zSvweyHC0tut2pjuo14EEF7DYLKvV7wmR+GmJM=; b=UIZ0DAmfzpJ7C7fnxRlVcfhPlh2XPyp+ADtFqitG5Wo1uh5Iv5QyYS27tTTr12IRpyM13g/WQ 0QqmxUvW417D9bC7B822Jgcp0Iv6FFD8f/6WAVYeV35G6xcNvuFWtvW X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Currently we have macros to access these, but they don't provide a way to override the remapped fields. Replace the macros with actual get/set pairs to fix that. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/helpers.c | 2 +- drivers/media/platform/qcom/venus/hfi_helper.h | 61 ++++++++++++++++++++++---- drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +- drivers/media/platform/qcom/venus/vdec.c | 8 ++-- drivers/media/platform/qcom/venus/vdec_ctrls.c | 2 +- drivers/media/platform/qcom/venus/venc.c | 4 +- drivers/media/platform/qcom/venus/venc_ctrls.c | 2 +- 7 files changed, 63 insertions(+), 18 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index a2ceab7f9ddb..1ce2624abc12 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -189,7 +189,7 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst) if (ret) return ret; - count = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + count = hfi_bufreq_get_count_min(&bufreq, ver); for (i = 0; i < count; i++) { buf = kzalloc(sizeof(*buf), GFP_KERNEL); diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 105792a68060..5ef5a78f64ef 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1168,14 +1168,6 @@ struct hfi_buffer_display_hold_count_actual { u32 hold_count; }; -/* HFI 4XX reorder the fields, use these macros */ -#define HFI_BUFREQ_HOLD_COUNT(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX ? 0 : (bufreq)->hold_count) -#define HFI_BUFREQ_COUNT_MIN(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX ? (bufreq)->hold_count : (bufreq)->count_min) -#define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX ? (bufreq)->count_min : 0) - struct hfi_buffer_requirements { u32 type; u32 size; @@ -1187,6 +1179,59 @@ struct hfi_buffer_requirements { u32 alignment; }; +/* On HFI 4XX, some of the struct members have been swapped. */ +static inline u32 hfi_bufreq_get_hold_count(struct hfi_buffer_requirements *req, + u32 ver) +{ + if (ver == HFI_VERSION_4XX) + return 0; + + return req->hold_count; +}; + +static inline u32 hfi_bufreq_get_count_min(struct hfi_buffer_requirements *req, + u32 ver) +{ + if (ver == HFI_VERSION_4XX) + return req->hold_count; + + return req->count_min; +}; + +static inline u32 hfi_bufreq_get_count_min_host(struct hfi_buffer_requirements *req, + u32 ver) +{ + if (ver == HFI_VERSION_4XX) + return req->count_min; + + return 0; +}; + +static inline void hfi_bufreq_set_hold_count(struct hfi_buffer_requirements *req, + u32 ver, u32 val) +{ + if (ver == HFI_VERSION_4XX) + return; + + req->hold_count = val; +}; + +static inline void hfi_bufreq_set_count_min(struct hfi_buffer_requirements *req, + u32 ver, u32 val) +{ + if (ver == HFI_VERSION_4XX) + req->hold_count = val; + + req->count_min = val; +}; + +static inline void hfi_bufreq_set_count_min_host(struct hfi_buffer_requirements *req, + u32 ver, u32 val) +{ + if (ver == HFI_VERSION_4XX) + req->count_min = val; +}; + struct hfi_data_payload { u32 size; u8 data[1]; diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index df96db3761a7..c320ebbdb24e 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -99,7 +99,7 @@ static void event_seq_changed(struct venus_core *core, struct venus_inst *inst, case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS: data_ptr += sizeof(u32); bufreq = (struct hfi_buffer_requirements *)data_ptr; - event.buf_count = HFI_BUFREQ_COUNT_MIN(bufreq, ver); + event.buf_count = hfi_bufreq_get_count_min(bufreq, ver); data_ptr += sizeof(*bufreq); break; case HFI_INDEX_EXTRADATA_INPUT_CROP: diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index b880e290a62f..f779ad97f584 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -870,13 +870,13 @@ static int vdec_num_buffers(struct venus_inst *inst, unsigned int *in_num, if (ret) return ret; - *in_num = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + *in_num = hfi_bufreq_get_count_min(&bufreq, ver); ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); if (ret) return ret; - *out_num = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + *out_num = hfi_bufreq_get_count_min(&bufreq, ver); return 0; } @@ -990,14 +990,14 @@ static int vdec_verify_conf(struct venus_inst *inst) return ret; if (inst->num_output_bufs < bufreq.count_actual || - inst->num_output_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) + inst->num_output_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (ret) return ret; - if (inst->num_input_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) + if (inst->num_input_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; return 0; diff --git a/drivers/media/platform/qcom/venus/vdec_ctrls.c b/drivers/media/platform/qcom/venus/vdec_ctrls.c index fbe12a608b21..7e0f29bf7fae 100644 --- a/drivers/media/platform/qcom/venus/vdec_ctrls.c +++ b/drivers/media/platform/qcom/venus/vdec_ctrls.c @@ -79,7 +79,7 @@ static int vdec_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); if (!ret) - ctrl->val = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + ctrl->val = hfi_bufreq_get_count_min(&bufreq, ver); break; default: return -EINVAL; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 4666f42feea3..42cbb1619463 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1202,7 +1202,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; if (inst->num_output_bufs < bufreq.count_actual || - inst->num_output_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) + inst->num_output_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); @@ -1210,7 +1210,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; if (inst->num_input_bufs < bufreq.count_actual || - inst->num_input_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) + inst->num_input_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; return 0; diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index 7468e43800a9..d9d2a293f3ef 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -358,7 +358,7 @@ static int venc_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT: ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (!ret) - ctrl->val = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + ctrl->val = hfi_bufreq_get_count_min(&bufreq, ver); break; default: return -EINVAL; From patchwork Wed May 17 21:14:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29B22C7EE23 for ; Wed, 17 May 2023 21:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230140AbjEQVPV (ORCPT ); Wed, 17 May 2023 17:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbjEQVPB (ORCPT ); Wed, 17 May 2023 17:15:01 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D4B4728D for ; Wed, 17 May 2023 14:14:50 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2ac7c59665bso13377391fa.3 for ; Wed, 17 May 2023 14:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358090; x=1686950090; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7/ezoAVw2YsuX0T7djrVDfZq5CgG+6MzZDD2YwmF/kg=; b=HFwqwF17LHAfzgxl9Ns8qmlFXTw6q0SxtN4zmS+Mkrb7gEQiJXcFCm5DE7oYFg8kSv 2NEohRc72jEEiBelXuLUKw1/MlCZ/RfZ7DjfcZMDcz5+OhWDQVwJOo4ieMM44/kpHovE Q9HPRQH+vJKpNzZm8i8/OV+vsIQGoOxoGUQD7ImlIexhvgPiZxl+ADW+nE+WNUVo7F3q 0HSob+Poo4TN3CBdbwcnCvtvN4ku3pxfA8YLnAPxq5ZqxpQeHGSbuJQn0UUzYlP3U91K jyuhpIp2Pm/DWIKra+lfHQK7Tpr+OnU+cLYGZ/I1uV/P8vcsarXOp2C/B3AYAuBHyZfm LCeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358090; x=1686950090; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7/ezoAVw2YsuX0T7djrVDfZq5CgG+6MzZDD2YwmF/kg=; b=R2Ob/J0oAYqXq4UXdHu3NGBtbgmvTyU8g7gjJiNqll79OA4GTN5YIS8hJHHQvlzzwd dvbevBDl2zEtOpYvsu4arZHThfT26As3YgArgoszLWNyaXkXm/0bsmIUYDyg9s056V2O 7J648xenO8J5mVnXqjSpXWlAxZItJfjVTox2xn8w4MTNe6JKK5EB7W7+bCbybB3UxelJ fsOg9qu9IUiI73TWWPD1w2gmYNFHJldtBJDlipNb+PfVtBO74GjUtHpaWlLJi3ckX1Mk +WvtXKHO88IACXSeL7hI+pDsUOebzZ6h7gQHb0KH8+s4aS9M/uwLfLqZ/UXSKVXqr8B+ 8IHw== X-Gm-Message-State: AC+VfDyN73dIli0dBM+c+TPG0m3mzrWVFD9hwkk76wUfn/vi/YI6zqGN H3QU2ZjReF4wz1poHLA/Qu/7Jw== X-Google-Smtp-Source: ACHHUZ5TIty5F2LcufCQmKNYq2Mp4i0o1e8H9puY+xwzmK5DPjwiD2YH7HKbBPdpuUIPtcA2ffNlzw== X-Received: by 2002:a2e:90cb:0:b0:29b:d2f1:de9b with SMTP id o11-20020a2e90cb000000b0029bd2f1de9bmr11317880ljg.47.1684358090480; Wed, 17 May 2023 14:14:50 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:50 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:29 +0200 Subject: [PATCH v3 16/17] media: venus: Use newly-introduced hfi_buffer_requirements accessors MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-16-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=4434; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3DU/aHZTwApMpAzleBOxmDEmeu3wMrZY4AjWxSwH9y0=; b=uNh3m2WlinfrixYZRgdZRSmwyHWtSuHFzqGMz7IQARjXxhD8HcBr5OUkLGimduMjVJ+Zy8e99 b9oytWtMGVECzTAQiOIGPEnEQGkoc1GQEwkF7yhRnjfeaf0Ife8pbGK X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Now that we have a way which is independent of the HFI version to set the correct fields in hfi_buffer_requirements, use it! Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/helpers.c | 5 +++-- .../media/platform/qcom/venus/hfi_plat_bufs_v6.c | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 1ce2624abc12..0268129ab9ac 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -667,6 +667,7 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type, struct hfi_buffer_requirements *req) { u32 ptype = HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS; + enum hfi_version ver = inst->core->res->hfi_version; union hfi_get_property hprop; unsigned int i; int ret; @@ -674,12 +675,12 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type, memset(req, 0, sizeof(*req)); if (type == HFI_BUFFER_OUTPUT || type == HFI_BUFFER_OUTPUT2) - req->count_min = inst->fw_min_cnt; + hfi_bufreq_set_count_min(req, ver, inst->fw_min_cnt); ret = platform_get_bufreq(inst, type, req); if (!ret) { if (type == HFI_BUFFER_OUTPUT || type == HFI_BUFFER_OUTPUT2) - inst->fw_min_cnt = req->count_min; + inst->fw_min_cnt = hfi_bufreq_get_count_min(req, ver); return 0; } diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c index a9be31ec6927..5eb4032bc551 100644 --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c @@ -1214,25 +1214,25 @@ static int bufreq_dec(struct hfi_plat_buffers_params *params, u32 buftype, out_min_count = output_buffer_count(VIDC_SESSION_TYPE_DEC, codec); /* Max of driver and FW count */ - out_min_count = max(out_min_count, bufreq->count_min); + out_min_count = max(out_min_count, hfi_bufreq_get_count_min(bufreq, version)); bufreq->type = buftype; bufreq->region_size = 0; - bufreq->count_min = 1; bufreq->count_actual = 1; - bufreq->hold_count = 1; + hfi_bufreq_set_count_min(bufreq, version, 1); + hfi_bufreq_set_count_min_host(bufreq, version, 1); bufreq->contiguous = 1; bufreq->alignment = 256; if (buftype == HFI_BUFFER_INPUT) { - bufreq->count_min = MIN_INPUT_BUFFERS; + hfi_bufreq_set_count_min(bufreq, version, MIN_INPUT_BUFFERS); bufreq->size = calculate_dec_input_frame_size(width, height, codec, max_mbs_per_frame, buffer_size_limit); } else if (buftype == HFI_BUFFER_OUTPUT || buftype == HFI_BUFFER_OUTPUT2) { - bufreq->count_min = out_min_count; + hfi_bufreq_set_count_min(bufreq, version, out_min_count); bufreq->size = venus_helper_get_framesz_raw(params->hfi_color_fmt, width, height); @@ -1264,7 +1264,7 @@ static int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype, u32 work_mode = params->enc.work_mode; u32 rc_type = params->enc.rc_type; u32 num_vpp_pipes = params->num_vpp_pipes; - u32 num_ref; + u32 num_ref, count_min; switch (codec) { case V4L2_PIX_FMT_H264: @@ -1284,21 +1284,21 @@ static int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype, bufreq->type = buftype; bufreq->region_size = 0; - bufreq->count_min = 1; bufreq->count_actual = 1; - bufreq->hold_count = 1; + hfi_bufreq_set_count_min(bufreq, version, 1); + hfi_bufreq_set_count_min_host(bufreq, version, 1); bufreq->contiguous = 1; bufreq->alignment = 256; if (buftype == HFI_BUFFER_INPUT) { - bufreq->count_min = MIN_INPUT_BUFFERS; + hfi_bufreq_set_count_min(bufreq, version, MIN_INPUT_BUFFERS); bufreq->size = venus_helper_get_framesz_raw(params->hfi_color_fmt, width, height); } else if (buftype == HFI_BUFFER_OUTPUT || buftype == HFI_BUFFER_OUTPUT2) { - bufreq->count_min = - output_buffer_count(VIDC_SESSION_TYPE_ENC, codec); + count_min = output_buffer_count(VIDC_SESSION_TYPE_ENC, codec); + hfi_bufreq_set_count_min(bufreq, version, count_min); bufreq->size = calculate_enc_output_frame_size(width, height, rc_type); } else if (buftype == HFI_BUFFER_INTERNAL_SCRATCH(version)) { From patchwork Wed May 17 21:14:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13245706 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 470AAC7EE22 for ; Wed, 17 May 2023 21:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbjEQVPa (ORCPT ); Wed, 17 May 2023 17:15:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbjEQVPM (ORCPT ); Wed, 17 May 2023 17:15:12 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F7AA768C for ; Wed, 17 May 2023 14:15:01 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ac88d9edf3so13075701fa.0 for ; Wed, 17 May 2023 14:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358092; x=1686950092; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=X7g4tYUCSnADCqdupnI6ZWhiqSVw5byFBn9Ee75pCtk=; b=E70vNCXLDgz8mutLEzPTMRQPL9zsJYV2fbpYj2M9dCTgYwOFO86MzzSOaBIs8f//uR Wl6Sddh65UrrQ9bi1I3USM79J3FwISK2S2d/rwj2SJ86QzCkYLlyEcxYXRZsB8nZYDz2 I5OIZ8RcLE/oMqurn9GkHpDfyNda6FmpN7L8Z+zrXCmOt3V0oHkYCiAlSs+mcRgRANdR gTSwLnqvvhfWbVmsmqr4wwn3rDF1H2Q0WD4/fFS4upF4wyKqUJjkGyX+ysINOeTpbldT ZE1jrzRzhxDzTn+sdZQcnv38T6bUGICzLOMgqkvNBKqP5cAfXqihCj+UaJGbO6KNIRKu H+xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358092; x=1686950092; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X7g4tYUCSnADCqdupnI6ZWhiqSVw5byFBn9Ee75pCtk=; b=EYarERx+3aO1/q5yRg7mTOzzRSHHpLCSxpCJ/bwm33qyMIU/ep5LK2fLPkStzBpMOg gXQxJEfO/lxi0XpI3QpCjrXTwRL7VU998Kg5nV8/0EU2ePKr5T5DfR8ET90UI/Wog98k UMogzlIeC06fD1xXTCSctpgU9jn48B89IIgaLejjUscSW0PVKHRTUcY+qeK4QUknfQsC umilkmIoMjTzg/msRAtPHA+wcWzhPr9S7gP7B2t+/jQpRzFj+72IQiPv0sxF2SKzuvgB yHk7SLX3Sh4iahSuXFd4HcCDhg8j/m0G7NttH4A5G6Vw8BA/MPmblPyzkAcn8d2dJkXw GR0A== X-Gm-Message-State: AC+VfDz7MweAO//gg+91vuHO9ZJkgP0mnliBzAFMl4EtckPsp/c43duS syGjz2rv23VFn4Qy8K92sjt6mQ== X-Google-Smtp-Source: ACHHUZ4JykT444pZCOuyCI+MvVKcjXoebBsi9OFSJTqQZdNYJXrAjL8SsQhQYwuadF7y0/w3lznuTQ== X-Received: by 2002:a2e:8782:0:b0:2a8:adf6:b0e2 with SMTP id n2-20020a2e8782000000b002a8adf6b0e2mr10150800lji.13.1684358091922; Wed, 17 May 2023 14:14:51 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:51 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:30 +0200 Subject: [PATCH v3 17/17] media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2 MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-17-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=1033; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=aCglDZnAfwj5KEsWFEt+s9yuCbYnCkOVxbgN1N7xiwc=; b=9kC+UvZMPpwn1xet5596Txb/EcLZKO4oPkdMyS+SXZGJBhMVAfM3Zmy8uJu5Y1I6f9uZO5/I8 L4T/MfdnDifDjMHFSXqopWzGLq2PZe2OeV03NsW6iq+zTN9g7bl70Mp X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This write was last present on msm-3.10, which means before HFI3XX platforms were introduced. Guard it with an appropriate if condition. Does not seem to have any adverse effects on at least SM8250. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 105d49fb72be..9a8aa3d8e0f3 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -462,7 +462,8 @@ static int venus_boot_core(struct venus_hfi_device *hdev) } writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); - writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); + if (IS_V1(hdev->core)) + writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); while (!ctrl_status && count < max_tries) {