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: 95562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp63582vqo; Wed, 17 May 2023 14:30:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4z+sgTtEP/EcuRz9tlJLdryxw/1v9PLSfZHE22dhJl5j49i/U1x2SKJyD7nTwb6gCCZsB4 X-Received: by 2002:a05:6a20:429c:b0:102:4597:de69 with SMTP id o28-20020a056a20429c00b001024597de69mr34595429pzj.30.1684359022332; Wed, 17 May 2023 14:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684359022; cv=none; d=google.com; s=arc-20160816; b=e/G1wDpBYCwniLNw/EIk2vWDMhg4ptIwnzCAtp+un6jWk4pGB684OJiKiObliLg8br Mrc5XlbyN8IfT5Pts37e7rpPRQMRU/qPvHYV0GfEL4QIDGL4rrEHku3XVAfkasZML8RL MxKX652LBCZ12jzQGbljqaoHZHdfad9oK4DqGsmDzBXCxB6tWB5QpMA4AYJ6pKsE2Xuk 4u2PLF4RcW+ImX8xdX0Rz604JTJacqGtlnr1GzczNaCHLHQu4j3aC473xQTtaL4UVuT/ 2lyktOMNAZZBqTIfOSf6309w0yhzne1s9bl/uhDZNrp8Fl8NkbSn8KT3dPJGfuzaKryB ISjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=708w9bx/Wu04zRxH+k1/smuWapQNc4JobQVr0bsQL/8=; b=hSRV/LxSZrJJhPJoWP51O98Kjt9g5/N84i2pDPkeI8lX6rTjbxDlJRosiHYlO8qj7d C97bIqvP4lvCsXmZHGuuuQBDidsoaP4A9e1P93UwW2bV3i5LhdWRkRHXnHLQUmUnJowG 3OqtRwOhD11hCryzio9rAPVfPLhgq+hGr+1SyVQ7Bb3UUcdY8ap0UWa8mEa3n6cvDEXv D0Q2eqi5VIJ/TD9HfrJa02hqXUKaiADPvBVeOWgK5P/SBvFQgK06ivg46CpJawy03j0q X6VnZEdwVA+n5WJBFEJMWR7EiXxLZuIRhsb86iJldJGG/lIFBOAnwO6rbHngOe3od7rb +DwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=njSbkiKc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fz9-20020a17090b024900b0024dec84c2fcsi2524233pjb.122.2023.05.17.14.30.05; Wed, 17 May 2023 14:30:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=njSbkiKc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbjEQVOe (ORCPT + 99 others); Wed, 17 May 2023 17:14:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbjEQVOa (ORCPT ); Wed, 17 May 2023 17:14:30 -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 42EDF6E8C for ; Wed, 17 May 2023 14:14:29 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2af0eb50b4aso8192751fa.2 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=OMqZzIwAt3P3nNcDxVdu0z/rlUO69pHYV7iacUk2AzjelqR1fIGWQnylpvML4Pjg5r WQU6mASZBwDrCVYf3P2nZaQ6tP3KqT6XekY0ZLeKIwUQ133FeCAYLwIMKp0ZpB1V0QNR Dn+aEArwqAJ9uYozPNDABN5MG/cw+96yaxjASb4FCl5HtjX9EMQzkkhxSpiW5d+v5arC 7rR6Ngy7EygWX8NL9Y30JZcPuNC5/58wVv8THvnFGUKsi/nCnq5rXIc24qkxpZei9zOq yRz5YKQQ0Ty3c1YCr8qRD/3UFh3C6O0qPPqAHZnZbws8FADhX2MZ5AGURaAfo6iHZJ6u ZvIQ== X-Gm-Message-State: AC+VfDz8f2amHj3D4paZoCoL7AvtReKaIOUwb5DcrLWHK5QcJ8S52+jl SsJ8wSpBS3vzAs16IPkf2zaZzg== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766178446218828688?= X-GMAIL-MSGID: =?utf-8?q?1766178446218828688?= 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: 95561 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp63549vqo; Wed, 17 May 2023 14:30:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zc9RyILfuIKCY1p7BmfxCeF32kb00l5x2r8KmXdtYunTFbaz0C3fY9/yxV6lZS7MF/nND X-Received: by 2002:a05:6a00:b83:b0:640:f313:efba with SMTP id g3-20020a056a000b8300b00640f313efbamr1423840pfj.19.1684359019417; Wed, 17 May 2023 14:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684359019; cv=none; d=google.com; s=arc-20160816; b=Q43OUvf8e101pGq4Aq5ETby7fgCF3EmiKeefPXYa+x2JjdcVuRYHj7OTlb3dVh0Rch IK3ydsmn+dzxz/72SGsRO+4LQcjjVEXwTQQ+Qrbatz/9CuMguiXFGqok/yoZTrzVJe2N f4mC3Dad7pv1p7VbexSE0EwtqBgzULTpcIdodfYRYnXOG8siKxz9zF5GNHiD/CZ53nmw 41MxR4I0FNPJ77rtLQ/NyaisOo2UkBc8Y7nFVZsUQVoN/OnpSjzx0fekdm1aIyCEXpaN Sckd0+feukfSMt8qqvw3Qja5k3TyJ95SBL/IGB9/Tv0U+hVT8peML0+LZq+VZk2pFA81 QZbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=1cmL4u+Slx7l2A0wEzo/2w7BTBeWrOV7Pv60ybojUJA=; b=hia86VVd1yzcWBU4HApgtLKr2fdPcYJ/zFtrbiz7nKQxLRVZW95JysTQ1eaPoqv6Me 6Uzu5Qde9m8DvMNyDfKgzKhckJyIIvEd/hLRLp0MWAf5QKrD/Bg9gNc9Lkjm38rRZb85 a8JTFNL69X5KdM0LIN37R9638DcMO6ZYg4FiouvV6Uow8dSHxhatgm6iWPTfx4CWh890 K8KS825wDs+Vi4k7F72V+SVc7TIS4OGYezGhYqzuNwvoOHWOBAdS0BjypzWHD7EPO7Nr x5CRaYlKPn940MHhNjVd4FIvdva0EeqAtsoyWKtpatFiAaM8UyZH4fD3FRNgEQKwIRrc s9Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ER9r6Br4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t15-20020a63780f000000b0052c6b5537easi21909254pgc.47.2023.05.17.14.30.06; Wed, 17 May 2023 14:30:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ER9r6Br4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbjEQVOh (ORCPT + 99 others); Wed, 17 May 2023 17:14:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbjEQVOc (ORCPT ); Wed, 17 May 2023 17:14:32 -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 A99866E91 for ; Wed, 17 May 2023 14:14:30 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ad89c7a84fso13440481fa.2 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=JmXTUBYJ05ZXNAsreYR/JcKLSFpOUp21X0HU8SOhKI72WPQLNwjc6cQ7zIoYxngxHC JU1+CFzssZIfLQoUFEaIs3yd1jfrQwFH5uAS6Q9Zun+9LNKAIVziFzjwX74Q+2BBGO+4 GLo01gowBgZIzKLcujiHbj38KL7gYWFsScwlDf8xo1guHy+DPlSBIJ2iNjTK+oiyi62q eJwSILRCF66JWSSxhbLf5qA37Nt76vvZzP6oXizQoxb4wxQzcnQXlhyg6XBaV9yc5oR3 c6P5s4gz/kP5l2TN9Aayie72UW26KVds6at1TqcqIPKpsQha4sJi8jXtT+GL1m5nWU3m mkqw== X-Gm-Message-State: AC+VfDx56pZ/pAebjV5B9L7oqF9Oy1bJemgDuTINXRuLTWLug3Wlqu2t FcZgxXlJ++xI/r7UxEqySMfnzw== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766178443155874942?= X-GMAIL-MSGID: =?utf-8?q?1766178443155874942?= 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: 95573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp72065vqo; Wed, 17 May 2023 14:50:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4g/3ou0AGR0HDHf+RnvA0nCjBIlMrcc30ArgJtmBJaur9f9zpThj10EUCyt2c6DrGIKuhp X-Received: by 2002:a05:6a20:7da7:b0:101:6513:49bd with SMTP id v39-20020a056a207da700b00101651349bdmr38846992pzj.33.1684360207656; Wed, 17 May 2023 14:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684360207; cv=none; d=google.com; s=arc-20160816; b=BHQ3+utcGd1o4Yu51fLmAvA3nckCKvRqX9lyxqDrgXXcs3v9Hjb7Ao6dhC+GxEnQB8 JInFJDWLkAXMltaFXiPt2C9Bqii+Ove92zBmbil0dqigrtPPmaCtPs2v5PUllU3N2vA0 tlSKP9nV5EAYrLUHMTtKoJEwxZMRvLQ/6Ffhatv+XJ/56Y6qVKo0RVX5NkXySCo5swAf UE+LaMHbYzA6ZLjILmBobE6bCLPrNb0AFjwuyXCQ0Z/aoGM8/mfLw1ab3uX+orWo7CrM UJ3zFTgHWHU80E0AIPW8xdHIG7W9+qBRevL1LW0K3aT7yibpc1pF38/XuiBdrDEeU+7n JsvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=WB7o5JzliPqClTUxbFBIzOZ1VAPC2kTl85qPjyuvehw=; b=IyQPTetd1M8bj4saP//6vzcSCYN3LDjwUU7jUCJVALejjv2oCJT/UlkgHLq+POmuju MwQm69mtlwWbhEBOfxkH68xS5V4g8/Hms/sxE4WIzXc4sB7RSfn9k4KWP/AVe0Rylzax 3tSr2Om+eSOo+AaBiXhklFwTA60emWGygWgOyKNXxir6R8vYw7euJ1RTjqL+Y8VfF8ge 3/q+Trbp0gayZ0hkgh/OffDhRO5oaXaamxmc9Uv3T9iZj3+cVsnMOvcRPI+bUGXHGNq/ t+SLakOtcRU2coG+XC7cirLIZRsuK4rgc4OPsMKnWG4xSfVRpOKblOBEwKiwZN0ZC6Rc eWtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dla0xxAg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a63eb45000000b005308fb9619asi15995518pgk.54.2023.05.17.14.49.32; Wed, 17 May 2023 14:50:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dla0xxAg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229827AbjEQVOk (ORCPT + 99 others); Wed, 17 May 2023 17:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjEQVOe (ORCPT ); Wed, 17 May 2023 17:14:34 -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 3216F7A98 for ; Wed, 17 May 2023 14:14:32 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ac836f4447so12947751fa.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=H3DOIlldN31UWa4m2vhAz+hxx9xo2aAo1aeGOmvWDuKqM6hKTpV9g9FgiFk4pUWN1g qrakKEkC/Tx81cjrA2rmJG2C+bCI0y+JvxnUSbhGQK2Cyx4XP4XsETeUT2rNFRBOsdBa xo0OHyF6Ro6tJBFljb8gf8UJASP1N9xWd3GNxEz2YjFdQCMYSazZbjI2/yhoB/Uyt8bs zHtSSyhv/tX76p0xrc0w5nxvnXm12kNYkZq8aofFHEeTPN9Nm2x09pnsZK0HqsGmWFlt kEgP0Vjv/8bTjohDr0YShVm23RujPDLZdkED9hmVlUM3piiNFphdu2X9ZfIsr38UjF3G fVmg== X-Gm-Message-State: AC+VfDyUzlWJrgQ6jYmNn5F4MccnGZpIcQ7o+8hdTgubf3+8mvHvlu3D ePBK9pCoTndFVNTRtFXbpezX5A== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766179688934799438?= X-GMAIL-MSGID: =?utf-8?q?1766179688934799438?= 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: 95559 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp62960vqo; Wed, 17 May 2023 14:29:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4QkpjhFrj7iGcRoGDko6rgZLtpBGBai7pTJb3l0SNZzzAL+/ZxKxv3ihvmgmZm+G+i/i3B X-Received: by 2002:a17:902:d483:b0:1ad:7bc5:b9ea with SMTP id c3-20020a170902d48300b001ad7bc5b9eamr129512plg.60.1684358942977; Wed, 17 May 2023 14:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358942; cv=none; d=google.com; s=arc-20160816; b=hc2UqvohZuqSg11KguAZbghfqW6p9tNwAmMOFozbr/x3WIuot0I/OAj/85jkHV6pGw zbf1cDQ47wlHsmgMgtisRMApVIPzxZ4Qwo6d+dgvy+R9cETsCNYU72v/+9+wsvkjZYEW Kf/a2DJ03a5N07LWAbWHfImUVUU3NapUY6jnyGM5hTiw6dOZZT3LmzuJyiEiL4BKbajf FORDAyv1kcicyFEIganQ5nO4zpQmTLzNwCMnXTgCjfodieeWXVkjrrB+6QMtUYtvF5Ts f3yO7HSRj3j7beuA7S089TaQc2D28UDQ5a7tqc1DnsOnUxPr6/Ysppb24nl0qtNmpM1G Doaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=umRAJMqKc5zF6FOAntGSMEcHnMlgnfWakGEzWkoJKuw=; b=WOB/w9Go8GlvXn85S3yVE7NcAbq0ROUZA/JXnpKebTeWWDA2hR23BP/jelGHdKaSch M6tC/YgPajr8daG78r8v/KkmwHC/gOzkjyLRFBhzjwBv9SVlKV72RYwDPTS4G5lQHP0T DK3XFWQl7tTPEv2MqwU7Zv9AISggKPnNCqNhTs4q1/3t2qmpAuozqAEgA9pX31sVlWAd RJ7brSMT6dC8Fe8DHE2NeNm4T+2oMSHPNgQcd0lC+NBLzSMIh5hdNdAXivfhAH8spDj5 OfBxmUfOBK82Kd4Z3Q3CBl68GbL5Vv1khEVcGVzvgHNrQxXYHyF5w3dtdcIVPAro9G0J hORg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xCQfwTsc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a1709028f8200b001aadd02b88fsi16596525plo.233.2023.05.17.14.28.50; Wed, 17 May 2023 14:29:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xCQfwTsc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbjEQVOn (ORCPT + 99 others); Wed, 17 May 2023 17:14:43 -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 S229836AbjEQVOg (ORCPT ); Wed, 17 May 2023 17:14:36 -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 D507C83F2 for ; Wed, 17 May 2023 14:14:33 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2ac7c59665bso13373721fa.3 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=c5dIYwf1fkSSE108361bmGcs3jk9X3BK+i5EnmhhzbuAJj3qAAItQFqxWE6AwCrPEo 1oIGYBVhmQeSQyYUIJmBJ3Ek+HUGUmJKOgsFRcyOaTFUG5Uv3cyvhCFNdMNPe6byzEib xIW2McA5ULF3fkGtaJQYRUcCOVLfjABQ63/au1VdOOkTANsy2ibVzBuncQF5mwY7iM0T HaRuSotSPvT1jcm8RXj7aUiz0mg++oen5rGXP0QWB0W/Si00nJ4C2fCQv0jrh+xUg7XI RWX3B45S9+uK4h7vf4dkfZfPE3ig+Z7MFq5RXmlwgZkHySZagAtUVE1gVnfU0zo2PTnR 0Q6Q== X-Gm-Message-State: AC+VfDwi7jB8nLPYSa4Ea3h8zg5ftRYyesfBRitujflLWjr8pWDuSn1N WbGZ0qsv23UOTHV31yEL1v4azw== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766178362724348414?= X-GMAIL-MSGID: =?utf-8?q?1766178362724348414?= 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: 95550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp56987vqo; Wed, 17 May 2023 14:15:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Lng+RCF9cpncJOCNWcHifyW81ZBYZJ4WBsyX3RCALHy7Vs30qAGeurmzSMMXyl6gTRsys X-Received: by 2002:a17:902:d48e:b0:1ae:4ca9:dc14 with SMTP id c14-20020a170902d48e00b001ae4ca9dc14mr254814plg.27.1684358140060; Wed, 17 May 2023 14:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358140; cv=none; d=google.com; s=arc-20160816; b=I4fYQg/VxbCTnMDKSGRjeZtVpvGTtJp17+PT6vQPkmqh/MNgMUy8vzo3nAd+Yb4o+F WesJVThqqx6AQ2XsSg7g4Vja/0WFRiXRP5Fu53Fcq6uADjPKPktEehejVZkob/aotbrk lHCkgcXvcg84ugxaA6CwVesoVJqiiObIZrKfbkw8EqTi9qBFQVVg5Fm5md9UK/tlCl61 zYQP1/qpGhZKtQq4v6xDhmfoyVAbpE5b74pjQqcV9P9IpuQC9PlMqbXvzG1pJHbZg/XS Jy2eczQoi5bqkolz0e0sszgh6SQxfbedZTpi59btLL5DWR/GcJl0VbZkZUgHqlz+Cyq4 pecw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=5gG/GQ4bkNLXJnem7GziPpF9ACnuRetCT8nUsDWFQHk=; b=cScbWIO62WmSOEZcrp9BQCE8howjJKIHUaBaSdauLIDRvnz61MX2riO8XugEJhq1Lp mOrSS/XvzWeZboA3yC1SlIIKmiGWodwfeFX1++nXcvQl5ZSJgP/ug7DLRkNeGbKcFpWA EPMmerSeeYWc1jwnpeLgPXIYq2mlSKb2RNkFpCj6pdhtgBZnUjofsNMx2OmDHuEWMjot wIQr4YIJjNdXb/JFlvag9tqcFRqXUSzCVgeGccyUfC8BfNTYaihS/NGgbvwrpujFES8Y Q93zjQricP+V/82P4bCIt5oHAaP5t5iNsJxgevobXnmutQq92OaquqSFgipygFV+6gpL pvKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vSIj1+oZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a170902ed1100b001ab18eb1764si9657034pld.131.2023.05.17.14.15.23; Wed, 17 May 2023 14:15:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vSIj1+oZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbjEQVOq (ORCPT + 99 others); Wed, 17 May 2023 17:14:46 -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 S229851AbjEQVOg (ORCPT ); Wed, 17 May 2023 17:14:36 -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 5D1967289 for ; Wed, 17 May 2023 14:14:35 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2af0f1301f7so7841891fa.1 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=f8a52zOG+0R1jTTUGOO4f23UKfKU1h8m+LlEdMhTVvASkDk9wm9eC+WWNNH4X4YQ1c FeGx5eWOjg+cdnihZtDT1kj7NewU9I2vd8NzQq2GSjZTziI10/htiQcdonMygF9BaAqc p30Nz2rjZCa9fsexoj73404t4E809y73EoGGXJvw4AD608eotIUjowl0eXjOyCG7m8S7 0EyZzZF13M2/fXC5ofK+Rs0prE6IcR0eKfdrv15QAf3qVRAwIz7oU+64FeMFi4eqlgJl HtzfEJBtVEhQSGEG4scH35soFGf1wCzIfL1ew2h2tTKojpci7va/43ix1F87TvvM6HiA LpHQ== X-Gm-Message-State: AC+VfDy6nVAxGuiaC/USakdryaKzMRfueAkbbqldjcXfQDoMxZlkmnve o+6RRkdgPtp8mheDr+bzRj7JFA== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766177521116257992?= X-GMAIL-MSGID: =?utf-8?q?1766177521116257992?= 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: 95563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp63612vqo; Wed, 17 May 2023 14:30:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Pmmt/i+9oKfT9GRRXU/hBMubnTrCWmnb8WcxHRb+RIdbVAh4R+jGTbOGPYC9sT2iQPHGc X-Received: by 2002:a05:6a20:7286:b0:105:b75e:9df9 with SMTP id o6-20020a056a20728600b00105b75e9df9mr16232657pzk.22.1684359024630; Wed, 17 May 2023 14:30:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684359024; cv=none; d=google.com; s=arc-20160816; b=NlpBy12C47L05eNCKBL1dqmLkG5NhxVHdlv8QLtqGlqZj/gjMFDVvKExU8QB5Ay/vt Pb/rvLgr3dJtNAckOq55oLr//oF3ZzzODMD098pjem8aAUn0c1BOU0wa8ANOvJycIXfn eCKqM9D9g52VtN5Jub/BAzhi8/Ri/qRa5DK9fFe9lgd0rga9rHcJjXfGv1DeNzyW/XJ5 7KM9w3HaUk57GFmmhd2kgg3VqRwwbYl553folewgOBIP83kH+Bv7y00asP3ueNHRFVc3 Pu4gjZ+QnC1xMsr3I9HsfSt9uBVv8ChcWUppakf4b107Q8ve6n0WMAYRpB9go8heTW3g A2+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=/SMIxbzQsbA3j3Sn/cFi6oIH9U6UOcuGopU1jwYoxzI=; b=qcmBdGKwFNItxqXwtd0Jl2dCrfKmBph/rXSJ9B9FPhDwebVz4Ql5ApMDCVentvwAiX etsQbzWUAImxzXJFgoL337P0iaW+IMNd7ZZkftFgGy3Ws5D80x5iBrnhI5p0aOJMHVCv DjrIJurx+puTIutV4UK5vmVOT84+m58GPln3+ZlNpF7RkBuCAnP4T5ZBTjUrCrWttp2T rPDpQtPil5zwg03XDHNecTpXAfKe/SiTGBvgtQrSxAeNlLBgXIaf8iofT3I/aA1TB81V 6itJcyCZffuOg06IwNx33T2oHeilVBKIW+iaHJP6igr8FqqWneDNmoIWpTxvTTUiebDz Um7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ENZ141sn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a17090a564600b0025042fae398si48185pji.45.2023.05.17.14.30.12; Wed, 17 May 2023 14:30:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ENZ141sn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229944AbjEQVOv (ORCPT + 99 others); Wed, 17 May 2023 17:14:51 -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 S229879AbjEQVOh (ORCPT ); Wed, 17 May 2023 17:14:37 -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 D7058869A for ; Wed, 17 May 2023 14:14:35 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ac8ee9cf7aso13434441fa.2 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=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=NFrleXR56HGVrFhI8rtTNd9biOOtv2k+Gencl6Zb7tLShAYZwdt6CKrOqfb2DMjbdt tIi41/9F/iaUeKNOUOj7939KjmPcLE9CAt4sI1xcwomqsDPj9EnV6ULYkL1BbwqXPBwv OuYhU2/EGMQHywX5iW64dwkIiyAGIU8prHOilUqkhXQpnnH5MWWC+LCZrP/CUyEnbZK8 G2MDmGcxE8s7YIhPpsZizciL/64qupUSKXO3H2nu1pZgpprUAPyN/5E3pLSPOXgB88D5 FvpHgqQ13YVxcIvQKtjEGzVFvjVMJqkD890l81Yo5TO3G/QTFLgDFIDvwuZPVFooXZi7 nlqQ== X-Gm-Message-State: AC+VfDwnflKDyDC/HR80lo7ulSJu99TWcNwALixwcaQbfs6jUG+WfkH2 Y3a8aoup/fL6Z/Nky+Hfdwfvqw== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766178448136226641?= X-GMAIL-MSGID: =?utf-8?q?1766178448136226641?= 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: 95551 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp57067vqo; Wed, 17 May 2023 14:15:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7A8Uh5p327xDUKPqB00qGHLW3riROE+nwQFhy5ZjkSM6bItJB/Cw/6+VEMb76KhOLN3m6D X-Received: by 2002:a05:6a00:cc3:b0:643:aa8d:8cd7 with SMTP id b3-20020a056a000cc300b00643aa8d8cd7mr1292055pfv.32.1684358148467; Wed, 17 May 2023 14:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358148; cv=none; d=google.com; s=arc-20160816; b=YzH6Fc2kOc6SNVkCwr4Gaa4JBMEFN49cUAUbuwJkV/os6mGLKGLmILTtLAcdnWdZCL MwufrNFr+2eW69GOsZRkfCPv6Nx6oEqvBHhW6e40z4w5Gy1LGPN9OdtrnVKazUW/jkTx ACDef6OR8JP31IzS5li5Yzszj1jxDjqxBZalAcDV+0QEOD8nFYQf9iMOpnkzLPDk6VvD NxNIW6q0t6DCYiMoWjuuKKL3JUcPlpLGXZL1NzbHAdd4LsnGqjUW0XTpDtK8Hne9fINc fjwKAjrxQUkvZcDQXYKk04T6W7dBT0zz0ppYO7Huk9eyVa4/LRn3Z9z0JNBSkeKf09Tt V2Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=9oPfJC6OBBAeuCH43x8eLqOMDvJk8T9kLQJRwnypwQw=; b=jWTR+QYduwDh3w13tiEXE5Q/LLowOIz5BPlaia67VtgPJ2IY0A+BXQrnjkaYS19nHG iwNji116hqaUSbv+akBtkx8IqQla0bKX84zjytJLfntbApYCrfGEC2FyppG6zHxOpj8M enhfMUqTCCrgWbv9drNbVm1yLa5vcWCwkulyDDl+u6sNgVMKr3jfY25dvd5L0hzygxR2 3bZ6ab6Jg3c61cvUvvwFZgVkpUxb9iDrBWdKe95qPG1P7BgFwVZCI+OexAcRNg/b1fi1 363I8ojcoxWgCOI6fnz8JVZ9k0oCBCHpQY3QQfw1/hpxzIoSn1dzGmostrjW+tyqK9tz ZAbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rPUwRZMs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s28-20020a63525c000000b00519c3475f12si21302394pgl.572.2023.05.17.14.15.34; Wed, 17 May 2023 14:15:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rPUwRZMs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbjEQVOz (ORCPT + 99 others); Wed, 17 May 2023 17:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbjEQVOk (ORCPT ); Wed, 17 May 2023 17:14:40 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87DFC6E91 for ; Wed, 17 May 2023 14:14:38 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2ac90178fdaso12970431fa.3 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=LtAxlpBHt0ju7jt95XyYmE21kRV16zcMtWPRpd8yecL/uWksbhnSCpdWhQUUrjGfmB 6HqnqB+eY6vc2oAC1bP6UmkaD5A3NOelxxD6XotFsyh7KEHEW++T+B149qIJ0UKHVs85 i+HlOpLjCdH7/nS9mArUzMr06DVPD1AJbWk8Tc7cEq1hdpCZsobn2Ci041VQ9TRYMvm/ 2VP/yzV5J9bIIb4M35uyPgaMSHh1ayvX1jhMMXvbfEbWczwYVf4CrP0yvmro2JuZKfmf 2nKL/FrpI/q+probAhZHrocu/VV+z2H9vniiPf7AxqR8vO30T1bjkcgAOBm8QP8A+3L7 EPFQ== X-Gm-Message-State: AC+VfDwPMrd80XXM7H9ummpbHby/Xnn5dhaVhvhfxjEq4IM1EtXcSijg D/AmW3hAKlEQRIOu0TCU4z/kNQ== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766177529569951672?= X-GMAIL-MSGID: =?utf-8?q?1766177529569951672?= 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: 95552 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp57103vqo; Wed, 17 May 2023 14:15:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WeQSrXB42+UFDSxyVSairCFWXAkbO3aLd6D+ZKoKmE1SkbcNy2Hwyv1D5cJzA2xDsGPmO X-Received: by 2002:a05:6a20:549c:b0:102:7aec:6dcc with SMTP id i28-20020a056a20549c00b001027aec6dccmr36819525pzk.27.1684358152813; Wed, 17 May 2023 14:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358152; cv=none; d=google.com; s=arc-20160816; b=Csq5fKbH2WWLyB1+Q8rLfNn2nVnSz6v1l2fbgrPrKo56DIGlo8P+AeFST3D+EndcL6 fwENDnnyXH82fnycu3CVcJIu2OoEuDAT686V5dgza1pr0TiGCB0rNpNs/fazS2lDh3Q9 hA6HnurHU0g83y77Nb4R2YUspVxCi7NF1gHEqjxx5GJ+UXBhE7h9qO7k1wy78LuHhXnS OXQNQC3VRx/OEBkh5PKVBDkG6P6KIxu2MK9KBZe6pEm4q9Qh2qTxHCcXAeUA2a/FB5go Rwnq24eVaAgVDT0SFoq2H7jur5qxBrjhDmRD5ppxoCUfOGf+djB7lW9+9kkEWoz0W3eI JHIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=n8al+fUYTJ6+PEz9NPDS7tqKtmY4QMGdOMScxyZdTNw=; b=l4afY+EsOs0DnqusDB1pQc6M1OQqLXUhOu8bMqydwJUkeizbB4VbDzx9BDzDQjhyJw 2R8ul18L1QK6K4kfMEjn4UJq7h99ppfSxKpBjMjAUU0I3zDRlntXRo3Ni8WUZkwmVYEe QROt87d2VgY+pGToy7BIa/mxb0w2wz8NPc5DS09BJBvuPmo4BqZDHuCvWt7saHaCeer0 WJztK+S1/PeX3ZkRKFvs32AqzJn3Xlwx5qW+6WIk/HtyepRFo9J8K0zM6BLl5kFg94et UetGWK18r6U8MTsh6k6cFrox72y7G4Z4UohXYE9BY5PaNLvy3OKaXOOArVOP0l1wxVE7 MiMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x+Gfsd4u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k67-20020a633d46000000b0053045acfebdsi20782528pga.34.2023.05.17.14.15.38; Wed, 17 May 2023 14:15:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x+Gfsd4u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229936AbjEQVPA (ORCPT + 99 others); Wed, 17 May 2023 17:15:00 -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 S229696AbjEQVOs (ORCPT ); Wed, 17 May 2023 17:14:48 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AEA46EB5 for ; Wed, 17 May 2023 14:14:40 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2ac7462d9f1so13514181fa.2 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=U79ExGSiq/tTevWldr6uEg+abNET6r74rH5gWIz208dlE3vA4Do9M65H7FkqOQBhak tAZ8jqJhqAS5dFTY4qnMp5gVHz7M8Ql9fo6K12Lu/dkkHUZus7GYoaDZ/Vgfswm7KUIm tP80ZrwpCmQbhXQ9WTR59xHp0JWtZAs5vys29EuwmuPykxlgWgYn9fj1wFkDpw9YjMzQ sHYBfa62ea5IWscSwA8fBE9KP/wrgeUYPaL/9Un24+72M94GvoATFk/MhQ4nN/7J6K+R WyUghNAhy0wZ8iNRMn0biFjh8SnFO2Q5Q7OK8JDiCBE8yVK/oPA2b4diKac9aJmXxH1A musA== X-Gm-Message-State: AC+VfDyE/PHQNSxqiZJPE7AwYadCxcm2d6FOElglOFKKvN32/Ns+VXXI 3a1oH+5VlEZ2ATnxa7vMcYWUmw== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766177534566407046?= X-GMAIL-MSGID: =?utf-8?q?1766177534566407046?= 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: 95553 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp57134vqo; Wed, 17 May 2023 14:15:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4jiUTb8+K1iTAVITk55Xp6XG/s796O3JYc5QpcMG6I5CYr9CjGlqLrqdMhEvofxGLuE1jv X-Received: by 2002:a05:6a20:6a2a:b0:f6:d4d:2d with SMTP id p42-20020a056a206a2a00b000f60d4d002dmr48085580pzk.31.1684358157941; Wed, 17 May 2023 14:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358157; cv=none; d=google.com; s=arc-20160816; b=0aYMQJ/qONHzJUzZXEsH/UhAnVNw41bMTY/rj8ZVryI19WT22zKuXncmC6fGoFdDKO 3UPyFvMiiM6iVayh5jVmEtniQv1nwcD00v04BX3mnTyaZaY7yOlxGfnr0758L2qAUlsz mLndGd40PwZdzCIxxGtrXTQVm1wQwBenu+Rgoz/DwmUTygyNZQFwetW2CA4kpMSKSkdy pSa2xchkLPvMiZ50X1bVKJ7+qgQh3iedofzeAgDeu9SoiedsSfX1q5K3yhOXCuTSYcBG yo2J0Y4wVwEIQ5RZzH0ywiMKJRVt3edyL+Zxij1oc9UtTOuii9hJ7JZzFjQzk4OT/N52 k5ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=b+mqagyKbbLeYmxfLsA4ErQtn2tgWCu/qclngu8iHe4=; b=W5mWt9bIHWzpt7MkkxAWPodWfz+4sr5K/KoUfsFsBZHTo1VBm/AhtmsQLRy6QAbVaO 7ZzD6Ga5PTz6Qrdt2Ks/AvR2F5PjqmNipu9p4HT16O7TuCSbDghPUZyK7sETY1q2/A+K y5p6wg+gxYHTAhGu2b/ZzwNepHhYT8gXg47VDFKdWdWISrXH1bjtmoZ4lSxXrWiWK0/D NGi7NOMDD1XznPcbpdAhQzzyenAYRhLM4baT50T4zF8x5ly4STnGPJQABqT8MlAmuXvR wFAFnpuHNmBt58CkZXfDPalnYE4IkPmLF+mcYpnrutXWsusWOi3BbXXCjzJyeX6TZNK7 lmNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ve/z3Oz3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n9-20020a63b449000000b0053045acfebbsi386200pgu.48.2023.05.17.14.15.43; Wed, 17 May 2023 14:15:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ve/z3Oz3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbjEQVPD (ORCPT + 99 others); Wed, 17 May 2023 17:15:03 -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 S229948AbjEQVOv (ORCPT ); Wed, 17 May 2023 17:14:51 -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 852FC9006 for ; Wed, 17 May 2023 14:14:41 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2ac735fee70so6100941fa.0 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=Dv2SNZFwZlk0RhiewtsmLIQXlCZvThTzPP/u2FBIfkGcFtVYpmnVOHA+pTj+JJs9mT 39mPzE3Vfs6GV3xghwAo1VuNmlvszfIsCI4iFjO7CHYuGYmdHpfyI1GDbRvBUqjf0vtz GR7twwRAGn8g3FqqozoU/GYr3yUGKto3UzuaERapErtoEmYuBg0/oS9N4llvWlYXVRzf qlR9mEm1LSzvHpVEbhboEv0efkvyvz/dR6AAXZoSJowJdVN39XJmXWvFnt/zJdTzJkE8 OvF3HLHSMLiSkHkJXkKwnh+374jwdOV7uTFdW2KWfiOvaKjz2HfU8ojntIAWrALkGNNm qz1A== X-Gm-Message-State: AC+VfDysZqZBNvjVnA/cnpsR9CpqVfU9Uqc0ceiveM8uAP4LRta1dIRj WMnXHxyHKBQQkWUH8VfJVzZkcA== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766177540183542904?= X-GMAIL-MSGID: =?utf-8?q?1766177540183542904?= 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: 95557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp62247vqo; Wed, 17 May 2023 14:27:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ42WeIdbcCzKDPqirQMKxGZJVFmydq+hQqZSw66yZxKM+DxvXsSouWg+L3g2C4Heq7/xVks X-Received: by 2002:a05:6a00:1943:b0:63d:3981:313d with SMTP id s3-20020a056a00194300b0063d3981313dmr1413834pfk.10.1684358844168; Wed, 17 May 2023 14:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358844; cv=none; d=google.com; s=arc-20160816; b=rxqi73xpZicKzY+zETWSUmoiimHzB7tVntWePOhs29TOrIENHH7IbTLs4FNhKwLRM2 Sjuo6c8sx2AuZNDKhhaEw8WzxHihKlCIoSVBCeaAzT+CUNB5GFwMg3cC3pFgKihb9hNb CYW8CiPHo7ZNjnGw7NNfm9OFqj5yFyggLsNNxPTz9vJOBks36lSBaDiFDAnL6xqTCmPf 5SQXkoUavWWgX21yIjgtHUg0vpeOead2PlaA0uDF2S81hM09QMklXR/5ttOAhGTShwq6 EEZtMrffLkd5wTBXcIvZ01RbKCOmM+s5gk2t4FYo3QRq8UzjFWLnZ91eyhwAzyoImKUn ajUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=eGodNVX/frMkABBLHr47hHKAI4yOnNqADEGr8yuNWnc=; b=pGT/VbCu5/n7t7kHRPLbKTwabRdM5XAWHw/p0UTLTTPpUxkXddOjYEhp+AJbcQnPYi 8ZHsFsCOV8ux9BC/8spmomg2uoMh8V2axsENkl4TaMMsWHAS9PJma005KWXI4excjOgB LVW8rcjrpJuj+c1AUyvV2Kq1SOd0v7wsINlli/l0260HuQwdTQFOB/KsAm+Mj8ecGoJV k7YdTEaehqEVOjGVkxKhZmPLQnp7bIa4ata1WJ/7QS4g8e0z6RFT2IyLqJPxC+Y1WzhT 6UwTAnKuecbnkeM2xLZ5+Y8KZp4o71KosEXTnYp+SqmIoAxJLtuvifakPVjlMTKPYnAQ PraQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HilD8Z6Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020aa79e04000000b006455d53001fsi26765pfq.40.2023.05.17.14.27.09; Wed, 17 May 2023 14:27:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HilD8Z6Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbjEQVPG (ORCPT + 99 others); Wed, 17 May 2023 17:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229962AbjEQVOw (ORCPT ); Wed, 17 May 2023 17:14:52 -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 352639EFB for ; Wed, 17 May 2023 14:14:43 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ac7f53ae44so13736471fa.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=NYYSgvXTpkL87IjSZ1Oy8VZgkjwcc5Qg2K1Im2q1MBYUH5ya7DbUEWpnD1nPT5btQa poc7pod2sWAm2nm8DKzL2By79jk48HHr+5cSzxofuQpjhtZt3oARDf9d6NVhiQhcFnHR cLWqrQaC2fmyTpV50K22fcOwCOR+OkBO4/dFZcSb8q5rqHdn7M74Sa+pOfftpbu6LVHU M4r9PGQXSebwdN5BKz7UIA0UjtLu5vNtATjaw7BmTLAVYqFnGbBTrcHLGSvITTqDNd/U U6pWh4BUgR3q0KpTj20I2twjn3bKkFs3A54LlbZ1QLEh8t3xlwNq53CLr7PenteBLqGT FubQ== X-Gm-Message-State: AC+VfDw4DxA2AqQrlpET8HEq1bev59BP4RlcoLgy5rh/ffssOF9StGSR 6FDpb6ZuG9P6jQBYOFHJ00oexg== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766178259118239698?= X-GMAIL-MSGID: =?utf-8?q?1766178259118239698?= 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: 95571 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp69617vqo; Wed, 17 May 2023 14:44:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4VAedOqJqmt3AT3m0E27vSm1mg4+wH4dKnjwdli1NoT7Uk759XlF/shsSpi85tDt1ObByT X-Received: by 2002:a05:6a21:6d9a:b0:104:4558:b412 with SMTP id wl26-20020a056a216d9a00b001044558b412mr26650167pzb.25.1684359877310; Wed, 17 May 2023 14:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684359877; cv=none; d=google.com; s=arc-20160816; b=J328ndoN554jhrYhAOyLeIogan06QidkF+Ngqff/uSnjYfZKskiWU0OoRNKLslq6Ma CB5uTmUvRoZUniLGK4ukXnMEYGSBfSyi7T33/ZDlBw0Z4/HzO9n1P+cG01fiuijtDkc+ 9DdTaRGIeLJ4HA4zaBzJ5znTngLS6JoPcuklzT4kHcVwW9SAqeKN17WPgiUPHLD5vruK Y/ihuRRB9wkOGOpkQNhQ0c30WW8K/9vmI8Om6vfXXem/nl/6f02lPlz2XqKmFKVuQJ4B 9eMTdjYrdycCm7vkkELFgu64zV+ZkLUVhgYgdoL9yKJs4F1cz2aAkZRCbgzl5lo9/vqQ MC7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=CAf0/qoqHKUIRtb0ngzMvnNiZNHVa6Jfr73oUt0pxKM=; b=GHm4J+HJY63SgPX3UnQvgtGJHnjbY3oWWeKD6fukjE/mtomB2W4oXyuFMpmHRhU01x UIR11VJeKQNYVU+xeEEC7e1q7tk3cCR+y7kIZnOibn16MrRsrNiFjMFjQsXy2VKhFtNg adcy8oY0MxivCs1fcTcM9Vp+T5b/qw3BcTrf8l2vwNNbe6IZMPuqehmBJyH+gKaFY8xn ACsOPx30KPrD1mtg8ugYbPaXRwSiud4vyjLqCz2SeKlRmiVU+Mov5sAklEwxQBw8ESlQ VU1jJI9YSD24n4WVcgllwdNsNZeq/I84e76u8YWOPhqcJNhWeKPCRDsMiUguCD0POLep Nfjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FVnA6WsF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l65-20020a639144000000b005307ce6fcfdsi16888846pge.472.2023.05.17.14.44.23; Wed, 17 May 2023 14:44:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FVnA6WsF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230109AbjEQVPO (ORCPT + 99 others); Wed, 17 May 2023 17:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjEQVOx (ORCPT ); Wed, 17 May 2023 17:14:53 -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 C584D93F8 for ; Wed, 17 May 2023 14:14:44 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2ac733b813fso13463191fa.1 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=CU0V+wUDjGYYPZs4RGzJ1lN7QGB7pmc/fF43lHbB/85JtUR9Ytac6vm4LaRqtKZcta qZuOk4gzZthY3qmfojMVEravXBxpW98mcTVNhFpUrEAtpT2Gxz6csoubF/GEvORdJLqS 2PfraVAao2WXAkg1SQmKO/Qv7VIPDsjYYHznu0VAvRcvTRlarffEMQ+eP+Wo44UWy+hM 2G1OfDTTR9rJg4jR6PZ+kxQicARQTtbMy98I4sYwDBHqGpMhPyfDqDcvRf88R58qcfVg TrF5aJW+0iD2/4XR9wnIgnVjVNdIIF+VwhTEu5IG3LfLYkRxMfwczopYbOFN0yLfn4DO iwCg== X-Gm-Message-State: AC+VfDyDkPTlCCTbay0psC4sD+3qqh+TT/P3GQpEFadkdAwULVCsaNJu dD+bGBwInZm0SftuEjVRDdjIIg== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766179342853644511?= X-GMAIL-MSGID: =?utf-8?q?1766179342853644511?= 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: 95555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp57979vqo; Wed, 17 May 2023 14:17:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4QzigxUFmagThcEsX1P73r0FbMtY8LWJ9e+45ykV87kqpg5icq8vxTDC7CQrhyqi8imaAI X-Received: by 2002:a05:6a20:1611:b0:104:62a9:9006 with SMTP id l17-20020a056a20161100b0010462a99006mr26317225pzj.36.1684358268004; Wed, 17 May 2023 14:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358267; cv=none; d=google.com; s=arc-20160816; b=Z6X++H0NJODId5maYnoVkpKUCYcGWhb67JydNk1qw1vTowB6bviwqtKBbxlcyAhURo 80swcsiYNeZq6CCTB2y5DohgHFAYV/NIHSZtyEdwlJCc1arwtTuk3g54zZUsWlFqG/2i OL5V+DLk6tZNtSxA2l/Exv/q0qQVyKt3x9qkgLKoWRRqHS39euWoSe2scBE3pmpk5KOz GIUDaR3bX6FGaSPfCwPm6ZtR60QsNojt1QPiI89nIXje/Q/HGFnepox/DL3KuSs2al3v JU79xaIQdzqUkAD0N8Zk9mGnOYvySFF3ZvStqPS49eZMd8Lm7ld9sQA9FS6cUXghHUlh 1GjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=tD8sADHcRsSq9QkDCRoE5JuqMpJE24bgCDvH91fnaag=; b=JRi1AyoKpJj8YRnZ0AMOv6nBAYMDubYblyQ2GGQgQP+KjtlBFlLPGb0iEuU9cVxq/B mSy9VxgnOeWFD1Vm1OkSKLdV3Y7hSELGRBq/6F8zscqsE+/wr/PDQ9vhAgPTpQ0uqH9p 9BTwOK2T3OG5BuZq9CNNnJ0M8PkzL9XhHKxfQpDbjaKkAlchC5dl0xyYS7nbGzTw427e tMA14lxj9ueSgFa9MqLN838PsKgwOazmQYPpFX6WC3Og9lRwykdThNFcni2AP3qV8RmS VQUqBaK0ApY0unOZPj32OngM1KG+DQ9rvpVAHVSUVhQ4+TcOFcYmEIu7w73Vh6stHvFj jovg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fWK4a3Tx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w21-20020a639355000000b005303b3df73bsi20543388pgm.320.2023.05.17.14.17.33; Wed, 17 May 2023 14:17:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fWK4a3Tx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbjEQVPY (ORCPT + 99 others); Wed, 17 May 2023 17:15:24 -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 S229915AbjEQVO5 (ORCPT ); Wed, 17 May 2023 17:14:57 -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 E9FB8A5F8 for ; Wed, 17 May 2023 14:14:44 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2af16426065so1121981fa.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=dgg653KuJKbdqXvNmVXUWa+p0CQNWKgH0TmnC+iWSBIslYrlqGOSnYKQ0n7jodqr+5 D8Wi52vbELUX+mhlLZ7ST+iP9nb2YnQUoaaKbBh9qY8k3ItiEeaWTTsrbVBBocs2ujOa uTw6THyGt3UbtrVwJRBDegDKWAfTm+G5nReAXtWD2rBVUsjaxUXVBLYkL8/v77IilAi7 3M1Wxd9Ob+BArhJgB9MqLCK2n5OPJzl3P6/BCbf5Xa/nzm8Aq1JUZ3KI7oxbcdZZjMoR k7m7xCvIpN/iEm4eczFo7XuT0W5ECRaJoWz0sCinS/yydw3SaOXixb9JUZVRI3/2Sqyz qAAQ== X-Gm-Message-State: AC+VfDzjiOMBqEeAaAvTVxlRQpDzTnuiG7g5FUnIu+U8DR0Tw5WvIkB6 3tGqoKhiYq3M0UI7cns7sh/39Q== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766177655212542973?= X-GMAIL-MSGID: =?utf-8?q?1766177655212542973?= 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: 95567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp66704vqo; Wed, 17 May 2023 14:37:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ65bKKjGDCEGSPyqTU85lZ0yUGUb2tawMHQZYj8F7k3w9Cs9rj/ZtMFkbrCwh3JQMSK0jCn X-Received: by 2002:a17:90a:ccf:b0:24e:37c6:9681 with SMTP id 15-20020a17090a0ccf00b0024e37c69681mr263993pjt.38.1684359433030; Wed, 17 May 2023 14:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684359432; cv=none; d=google.com; s=arc-20160816; b=fLfypVkKV6oihVPpXx9oJyN6CMr8i6Car3/pVRJ3Z+oBVV45vCL9wDGcBT81R07dPQ bNNX87Za77hQ1ZY6auD8FT2AtdEzYSJcy3wqQ65tS3GHXAo1eLIm8JiD6zGROWU0nqnx xpLY12QSm7NQnTRze7Osu+7SVJ/Xqbtn5us4Tzkhc172Lbo1zk6X0FBRRq315gyU+1HP mC+KGt1S/EX28FtM3TO6pviQignn/PVAymCemdBtaw54gCbKKNYwb0h41jPzy1zR7s82 gc3RMD7tkYKI0jy0TNjKfXjk2dxWryMWHoq8Zi8CaVUbCT9IIjCNgJRwhRkNVnxER+jB vS9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=NCbmXotl4JHp6511qJyB6cem0LHm1+AqjQQ+gB6Kt5k=; b=qn2ladkjGHnhx6IElxUOZQ+WrrUNuMcPANnCch0oxtVVTlYgafGtnkofFejsJuOIii Ykl3IymRHLMLXNkVUt8Oe0cj4LIwgi+nM9pFpnI03DKCARrEA6AwOsTSh/97YZrfYJm7 oEnUurEf/32LAta9503A7p8+H28xFBOVT5QgU7g/OPbOhnPlDwDtbXj/hVhOBOBvYRTh 2xKMApkw8xO4ygGxlXVYRAIler3qRK3RFBcOzE70KwmtoWKrc9I5RGefm/GRAKHuDm4w NZmubpFM1TipOU2sukSPhGgs0bg0I7dUt6ga17QdI89oRel61IGIKcRgmIgQlv5Q0sL6 AM7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UQjG0/Wu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 144-20020a630096000000b00528a60cc065si21582155pga.380.2023.05.17.14.36.42; Wed, 17 May 2023 14:37:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UQjG0/Wu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230033AbjEQVPV (ORCPT + 99 others); Wed, 17 May 2023 17:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbjEQVO6 (ORCPT ); Wed, 17 May 2023 17:14:58 -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 7BEE18A67 for ; Wed, 17 May 2023 14:14:46 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2af1551b2a3so4223001fa.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=cbfQlYxrCfYlQRum4CH1OV1ECksfGVkLZFgbypEbeIDYYq/R+cEKBBgaF7WC9moveo R49LLPzu3mWDONYfhV4BKHfYcB5hNJKjHHiztYfYzWdvdlYjxm2V2YEFENiXQGQdNIlE SpKg6efmVRvsn73JwNmbv57636qbsxZIbck8CiN0CQKrWCRWZ/5EZOvuEktpp8RKjeRS B7rhdZUvE7G9QxEF+cf+OPoFTow4IlN+d9q7TMOJeiN/xNDbM5MIC0enLBn/5chtYnSC j4WBrDkccJO+XyLbEITDDiS32rZBjELTpkdxiFf70m0Er23wdIhzBe1MYhH8m8eohuYy DUAg== X-Gm-Message-State: AC+VfDzGGOEK2mojdKrj1Ccr+51qQgRfqN2X+iBVY6sJQvS9zihgWzxd xflM8bKLNisVPDsHevJhtFDcZw== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766178876526727388?= X-GMAIL-MSGID: =?utf-8?q?1766178876526727388?= 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: 95560 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp63120vqo; Wed, 17 May 2023 14:29:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5nXLiw3zpJR8tg+gJ4TCuAF0NpM9K2Bljj4emc3mwNh9VnBURrEk6KM/QZvFFFwrq2tYln X-Received: by 2002:a17:902:ed97:b0:1a9:f425:5409 with SMTP id e23-20020a170902ed9700b001a9f4255409mr128851plj.49.1684358966085; Wed, 17 May 2023 14:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358966; cv=none; d=google.com; s=arc-20160816; b=MdsKG/SKIrGjb3ynmtfgaMWXkKryEQO4YKb6qTw84FzItm+KjEWQqDvAOUm4F8nY3+ 8GgC/V9qCON/5THmLMyH7DupdLkVuUzhxRzvS1iSFXFxV2Hgfgd4L3kQB597YZ/xdnxM T5O5GbK3vjoNELIUnjb2tbnETiL3JuApnjHZTZxXNH9iX/l6eu/HeXkioMHVOLrYzs/z iqI4F5e+hvOGIKTCG22wmN4zlIlQUV8gytJcYRywGZGetUYKbjIGqYqnWPz03g5lU4p6 sfFr8JG1tblcJba2UHFyhyW6ORhzp0Eba74cVCOSBlfAP830jF0P4+Rn2opOv1WUzQNQ z+ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=nDGFzpmpMzEfdx1VC1Hii8Q1Q5+BqfzALqEO/TlStp0=; b=WiQ8ASFRaosH6zryJsR3yOTSYKRyOGfEV5J6yW9MYMVmQ4HeWPENxNK88f/dBmL+IH LQ+59iyu1B70QUIG19Yt3+SPnRPgp3PjRYQpZuepqP82tuM7FQeTaf+XK+EXfqwCZ5X5 ifuzkpNBqib3vzCWV4MNMRtv4mmkX3OWf7kyFxCmPnjE5IRineb5oFBjTtvyhvdYvbJp JUNwKLGQ1jlGXk9axcP5zMum54/u10iGj6pTn+ZTlcADp0mp8sI0PcTfLvcIhHhWMyGQ lTwP92oMlgIOJmGpr3BzCpp0AUnUB86glllHnTBX/uwzIolbDvaOMotFylhnadymPqoE s3hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RVDZ3hYu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a1709028f8200b001aadd02b88fsi16596525plo.233.2023.05.17.14.29.13; Wed, 17 May 2023 14:29:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RVDZ3hYu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbjEQVP1 (ORCPT + 99 others); Wed, 17 May 2023 17:15:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbjEQVPC (ORCPT ); Wed, 17 May 2023 17:15:02 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BE627A99 for ; Wed, 17 May 2023 14:14:52 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ad714536cfso13608581fa.0 for ; Wed, 17 May 2023 14:14:52 -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=aEkI7GMzMXobFcbH+gtjwGgIdI+TL/KLItDJGiOkDeUFwHvzeI0MoK/DlFisb/JMOE dzFoCVtxmlRndON07PxaxhX7VHFCxKW24wDG5DhHMXUI1QA5SzOcetaISC8Js7fUs5jC uqkwERQFPpHhNNuyPWCg9wtLfhukaxE61FagXA/k5Zvu/WhlIwESNTi5CkJ7EEnUIByi zvGm9IbKHNzR+z2qok75pFUeqddyOV5XukucEsra3pax+cvsImVMgXDwut8KCP4VQrTG +CPZ9ou0+fFhuOb7EljVTTrP37a2o7eDsGSB57cahl89fPmMGOpxOOPCJGo1RUZuArOw GEvQ== X-Gm-Message-State: AC+VfDxQh1xkqY1ae4BBJZ/28Ts0ZWxsKSibWDwXgIHED6SkSvgFQmC1 ywVyC8tgGfOoNEcwEe+t8bsStA== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766178387179820136?= X-GMAIL-MSGID: =?utf-8?q?1766178387179820136?= 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: 95554 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp57784vqo; Wed, 17 May 2023 14:17:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7a/15xcg9H+BPjtiXFkMN2KSdh5aUghVpNiZMFdo8ztLYvrFMLa7HHs8s55+1516mppJ8H X-Received: by 2002:a17:902:e842:b0:1ac:63ac:109d with SMTP id t2-20020a170902e84200b001ac63ac109dmr305801plg.15.1684358240566; Wed, 17 May 2023 14:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358240; cv=none; d=google.com; s=arc-20160816; b=eUge617xQpRfYSGP+6Y6pXbi2ppURj0txPs5ecFGi7nkCIJovYoV82KRIaCNm9SdSi DoLpRMkLomhzVZiQtmN99VdnDGizCfeya6nGui5HiqW5YB3BhLY5AtOrekTZOdirbpF9 McPpeuuqLHkZNd7vR0e5wI82gg3CpyGT7nvCFQCoQME/9Zf/MPYwgK6aHNUtNyziXhXF AJ8O9Xg3A5LlxnTP0g/3Kln1jSc6jJUKmF4igQbh+FhRzGCqjo2u6regw/m7lOVsQxG6 WNWaSxtbsNxUSC4r6lWlfJyDTKs+qrBBSA6uGwrJfflYv4hTQsiM2t6LmoqXkmrHaSaR f8dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=zVbKXR6TkuL6mzIO8jr1tML/Qs51vqKPlZsOURKyzn8=; b=x4HiM+Jg3kmLG54KomG0xMXi9ZYEyEZlCp/YOXcNQ6DBbkIS0soUujuvJudqbu/FzN WVs2IH2RTCAPOdsA8nIFjhBh1w67HIAY6aDCh2NglMQnA5WUHvpGX1YTPBkhrCvQAjlU nMLNJKgcRVfsEJFpbs+NvNoZ26ijg8rph5WRphsXjv/vmgsAdJlDC3VPmhqxEzy1ZDQy Jj44qJj2Q42uBLjPt2ZCSKmRFCbqEB1Gc88iN2clYfIELNKhjpTTQzX2bVxF4EYrAHhW P47hUzZpdjtX12GEwVUQ9ZAfTTW8WLior5+Hm1/7AZ3q15X4WAfMf82/924tAvAQKJVR DZ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HpqHPqBJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020a17090322ce00b001aada12d628si22574149plg.585.2023.05.17.14.17.05; Wed, 17 May 2023 14:17:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HpqHPqBJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbjEQVPT (ORCPT + 99 others); Wed, 17 May 2023 17:15:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbjEQVO7 (ORCPT ); Wed, 17 May 2023 17:14:59 -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 7941D65B9 for ; Wed, 17 May 2023 14:14:49 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2af15b5f726so3202101fa.1 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=k36qaI6bwv3geGuIexFh9a8dwQcAI+UkeKWocUfzzzVu8qfjPdkgMjfB2rtQTpKcg/ BUITXZyCrNnOmVGrfU0ay893VUWPaAhv54AmLzgzyvp94DB2zawPbiGYXiIxYJ4hVAQ5 Ad/vtsBP6/YxJhZ/nv7sNCCujJaMTMy4y3n1gA523fMyx+WLhG28aVfJYImw3xVH8IDi hfYJs38k41sr3gBNDAIz3MRWspJKQUoOU6ecI7Cdw4oiMhqbXmDeXjAEQtA2BOrx9iwr eQYjOGKfth68m26qLJ4CzG+wI8W5X7GISA9lRZSFE3FVBUwKNdYbhXVCglNcVUwpAhuf kzHw== X-Gm-Message-State: AC+VfDwfR60ITfl4NN+r0VBpAB2dBH+ekUBe59i3GEd7BMw+RiQJqVRT zeuRPYX5B1Nk6NvVkCCWC3rTXw== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766177626616224941?= X-GMAIL-MSGID: =?utf-8?q?1766177626616224941?= 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: 95572 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp71914vqo; Wed, 17 May 2023 14:49:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oB70VR0ezz0d2l9oGgXqg1Yhx9RaF7V3w6yCIZu46f/nEpsEToos4kuBv0/onJoaWqyx6 X-Received: by 2002:a17:902:cecb:b0:1a6:413c:4a3e with SMTP id d11-20020a170902cecb00b001a6413c4a3emr302170plg.5.1684360188698; Wed, 17 May 2023 14:49:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684360188; cv=none; d=google.com; s=arc-20160816; b=CJCphQClRO8AQLEaYXkxeHtYjUf3OMERcpx2m42avFltwx/z59P5QGk4lR3lDA8kv1 HVAfy5A39hXdmttB4GVfnpTEzzk2hC7ulyYZGyIpB9ikQbU0Nm4mZ67HvdpvBS90aWJc tylBxAiSrUBvrRgE+Kwl9riYOK/EKRsTy4x0WGX1Y+FBvACGxZobQa278VIrJFwPCUjE TwJ7IlR9kwc3+PdGWZwWcTz1NynbPDv2Y21vact2e1SPWBWSjcKy362epnhf3Oa6Q5qN 1wpkQdNCY2GTJ1Cf7jzFU8dYjuPBgcT114MSpMU06Vv+btHmvOtc1SvrqBkgaUflkbzd JjBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=7/ezoAVw2YsuX0T7djrVDfZq5CgG+6MzZDD2YwmF/kg=; b=LknECJL8rv7UuqruPtHZkHFnn2MV7/OCan65h2P+GgvSAhDzNNHp44ViXNztgfZKaz UY2B9wEl3Kjc8Z22YqpyG4bvSqa4WbZCdfcz5WDdUb/LPJzrmYQxUmcQJqPXwJL+PuWv emPeRK13NmUQbTXEDyywa0es2BK2aYawAxbqmaVwEsisDZg/WCW8p0QL2SYuuQdw4Qdu 5Q9DxbYKvocXEdglOMBDXucjU6WnH5XDf8JDERfJMmtw2VtOfq3B3rH5Obk1k+jhVmqh cqORwmlL+EHxd038jwWD8ht2ESuEksCIVg4pBfYoB4ZZ8DGYH4HWZYw7lJx/0n4tAWEH BQdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HFwqwF17; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j8-20020a170903024800b001aad6ad4ebcsi5366997plh.150.2023.05.17.14.49.12; Wed, 17 May 2023 14:49:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HFwqwF17; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230073AbjEQVPi (ORCPT + 99 others); Wed, 17 May 2023 17:15:38 -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 S230061AbjEQVPL (ORCPT ); Wed, 17 May 2023 17:15:11 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 817449EE8 for ; Wed, 17 May 2023 14:14:57 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ac7c59665bso13377421fa.3 for ; Wed, 17 May 2023 14:14:57 -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=l1NndWHTF/ZpCd3mGH+lfIMpOCb85jTQwZn72rgGiWQzplxQJVOHgNWOKyh3VinKk6 4xJjQAAZR57WDpA+DE8QcNlGlDqeWCqgsdAExxxykN0L4IvaZSiIWKfgVSmUlXHCwNGx sFTK27WYKfsStktIodvh2XfgPLOP64lDr1jgVlHwNImuOlVMmkSp4mFqT+krhQYM2g3m WutsSYKOcb5g9wIfakOik2QxLFA4WhZ9xfYy8kVTtSa0e38/RZm+JYHftp4hym7P+D4v awY47DxbEhx/OX8hi21NyK0T5Kpqp7/HGSoPypudWc0YnNNjoeEPUQl2I9IVXb3soGRr ZWAw== X-Gm-Message-State: AC+VfDykpOPhw3vZdeUB5LIW+8XMwZM17OoWAn+pJrz1Jj2X2WhbI1m7 mX41AsmJ9oNa75GNlVteddrNYw== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766179669072043327?= X-GMAIL-MSGID: =?utf-8?q?1766179669072043327?= 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: 95558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp62904vqo; Wed, 17 May 2023 14:28:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IZXe25Ge6OCk8CzX3LDwZSFbEQbozmTUk/vqz6GFFZ3u8dNlh4h93FmdMB86E+l7fGz0o X-Received: by 2002:a17:90a:fa95:b0:247:8ce1:996e with SMTP id cu21-20020a17090afa9500b002478ce1996emr255667pjb.29.1684358936261; Wed, 17 May 2023 14:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358936; cv=none; d=google.com; s=arc-20160816; b=eqk9gd64CFJ9Kyf7ImDXFx/v8GchF1WpUssoM7/Cwzl8vIkUFm1RgJs30ZsuIHJNps MkjC+H8O5CxXF9NVSNoUgqM5qoJ2HTEOxifHdckMTIWN1DWxqZYUlr9+zGlXR7JsO0tn TeQCxZq+3EImCXXTSIYCUwdkVVnRhMOXRKMW08yIK83acr5YsvzdKxreSgqNkbl/ByBc lWODmJ0NVS/xevYTL7cpi+J+mWtR0xCoQC44NuBMqUVkljI7NA570sOmNJK2Ahx/UnCo bRNMpxfr3krMidXCR8yqtY+iNrfOIcCtA8tUkK7z3NeGNwZrxo/GdFF0uW6+oJbtmt27 OsRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=X7g4tYUCSnADCqdupnI6ZWhiqSVw5byFBn9Ee75pCtk=; b=P/CofArOPOJFxsKMdKYK31UQU5iQuBqyZbVjudoUugCGYFBwR8Xt5/bRTen/yd0cma GrHbK6hRIK2B1mUuju1ci5jN8mdPV3baNUyTTsVIjiLhA+h2UA3DcUNxbsnGGekv8V8F YR9VI4zqYFdQy2WEhV6dSmd9MY4RDvDoXOj7mmQUagwFZoc1wOVUnbdnfgakRftSamLQ 4VQWycs+xRk8VLLOLaUq4GIZsO71DW21ydQK9bxBZ5Y1yCroiE3Ks8D9PJVGL/co8GQW 3BEYS/fDldrh71HEOcpT26JugNNWbyNpVrj/OZPDjqFUig+p4BTU43azTqfrWclSG/B9 fxww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E70vNCXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f29-20020a63381d000000b0051820b42b57si22194482pga.619.2023.05.17.14.28.41; Wed, 17 May 2023 14:28:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E70vNCXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbjEQVPb (ORCPT + 99 others); Wed, 17 May 2023 17:15:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbjEQVPC (ORCPT ); Wed, 17 May 2023 17:15:02 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CCE183FE for ; Wed, 17 May 2023 14:14:52 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ac88d9edf3so13075681fa.0 for ; Wed, 17 May 2023 14:14:52 -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=FQ64NaA/kP5f6ZOMV2PMsXcQypkiH0+V0tci9/4XFqkvWuZNoCDWZ2mrmOR8nDde8m FkwPboqIXX1t8khZRtO5yW80j+uyf7ntFKItgh/n5BKqjRrfm4gMcEE8/UyJtRtREHt5 uBXzgurkqplYyO/VP6n/zqyBYkKWxaMzBw7IRbk3DMK9B+w/2jCuy7CAnuj2QZl7rc46 x+ZcqFdMXOVjFJXovhLfBRoEAe2wCLPsHzLuVqGMl6saeA0thTSk+0rKTzFfOQoHL7S0 wDv24DkJ1/xEEKb6YQNErZUPugEqOGcd2wwbd+Mrqjh5Z2NsC72y/kZFkurJtMLcoU4y djoQ== X-Gm-Message-State: AC+VfDzrTHhgrw4Tkkew9XIqk+Ehtwdf3TBQjsWVQINwgMOVyEzu6xkw 4QQM75n+JYwwdUzCgLWQ2/bAbg== 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766178356223783197?= X-GMAIL-MSGID: =?utf-8?q?1766178356223783197?= 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) {