From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DE08C7EE2C for ; Tue, 30 May 2023 12:31:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbjE3Mbd (ORCPT ); Tue, 30 May 2023 08:31:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231520AbjE3MbY (ORCPT ); Tue, 30 May 2023 08:31:24 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 716BB18B for ; Tue, 30 May 2023 05:30:57 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f4b80bf93aso4813191e87.0 for ; Tue, 30 May 2023 05:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449840; x=1688041840; 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=F1axqNPjGLjogy6xSCaHfcBTXr5wHaN2QoDEVW2I44o=; b=nzb6gIvlQ4aKJ8Q3cB0kI7/hz8JZao8iRtKTTama0cj97b32ntEv9i+7wgaSKmTz1v gDYNNUz6HLfBSylcqBvsWwc3XRGt5k08YT/FNjJkQW8q6xUzZpdXsyTUH/i4RYvPukDE TDZ7/GekaQm7VIeuoF0aiJ29BDXgdCJKFyae1A2lvlj25WEWXU4P4PytjJIayM3MqFNZ ttZ66kkvI6u7kYOlm/jWn96IwBCJTueLsI1FnuPGf5ERxMjTiwgU6UFi8chZ1KLdvisa 6aZN1S/X+PRT02U2cA1yHFYbbTPp45v7xY2WY2nmNPy6KzAFegv5P/jiUlbSsAkgq9FD 4Bjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449840; x=1688041840; 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=F1axqNPjGLjogy6xSCaHfcBTXr5wHaN2QoDEVW2I44o=; b=TLAA2b22dL0AAzaDW904GYYOLF2zkOunPu8piJ1OK0cz39vZSCk1KgeIYATqQKSauM R4gaRJuZ8DjveXxsBzIk3vVROGipASOB/ia9Yyym4Iahs4Hde64rN3+KUippnqXDkikd Ht54hSY41nhfseLKvUX3CnOJBpTnVTRLIfgh7FUVgzHyijT1vksVyS0ruhhboEIxpw8A vE+X+9Ns9jLFj/3TpF3jVh4B6oxD7bM3tR795KtFSAWwWGj0RHZbF+VDI8j3QZk3Pg3Q 6BcRDNcSeQqUQvdeMovRxjnlcmleDFJQ9CLUk2FWsOSVYBmnAG76IyAktXSec7D+p8Td XmIg== X-Gm-Message-State: AC+VfDzDyvZsvtq0GiNW8T6FkKpJltvDxMachcQJu9iaabIki+vH3WTQ Ln+sB5u9X9LpmUeF7oWnDMvDeA== X-Google-Smtp-Source: ACHHUZ5vtGFblc7ILzF1jK+As2eSp0Dzr3xY7FvxZ6IFxNnLtJ4Rhd8eZ8lqoxA+YrXxLIyFjtFPxA== X-Received: by 2002:a2e:8ed4:0:b0:299:a7be:5775 with SMTP id e20-20020a2e8ed4000000b00299a7be5775mr668729ljl.35.1685449840144; Tue, 30 May 2023 05:30:40 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:39 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:35 +0200 Subject: [PATCH v4 01/17] media: venus: hfi_venus: Only consider sys_idle_indicator on V1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-1-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=2458; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=hvIZqkG858oUVv/9/D5T6FwxTNGe5nTsI4JSBUSHEXc=; b=gfFwBEKZNcaX0ECRSIpun8YMTAzBblotZ3BrrfkwhTF+DA138t16RryJYsEWkJB9+E/daHJMt SKZSXL/fEwJB4y/FR3FJyyUPy1hwBfaX8GqJaK35num6vah4gXomdFX X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As per information from Qualcomm [1], this property is not really supported beyond msm8916 (HFI V1) and some newer HFI versions really dislike receiving it, going as far as crashing the device. Only consider toggling it (via the module option) on HFIV1. While at it, get rid of the global static variable (which defaulted to zero) which was never explicitly assigned to for V1. Note: [1] is a reply to the actual message in question, as lore did not properly receive some of the emails.. [1] https://lore.kernel.org/lkml/955cd520-3881-0c22-d818-13fe9a47e124@linar= o.org/ Fixes: 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing I= S_V4() if locations") Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 f0b46389e8d5..918a283bd890 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 { =20 static bool venus_pkt_debug; int venus_fw_debug =3D HFI_DEBUG_MSG_ERROR | HFI_DEBUG_MSG_FATAL; -static bool venus_sys_idle_indicator; static bool venus_fw_low_power_mode =3D true; static int venus_hw_rsp_timeout =3D 1000; static bool venus_fw_coverage; @@ -927,17 +926,12 @@ static int venus_sys_set_default_properties(struct ve= nus_hfi_device *hdev) if (ret) dev_warn(dev, "setting fw debug msg ON failed (%d)\n", ret); =20 - /* - * 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 =3D true; - - ret =3D 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 =3D venus_sys_set_idle_message(hdev, false); + if (ret) + dev_warn(dev, "setting idle response ON failed (%d)\n", ret); + } =20 ret =3D venus_sys_set_power_control(hdev, venus_fw_low_power_mode); if (ret) --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5B21C77B7A for ; Tue, 30 May 2023 12:31:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231754AbjE3Mbh (ORCPT ); Tue, 30 May 2023 08:31:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231543AbjE3MbZ (ORCPT ); Tue, 30 May 2023 08:31:25 -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 DEE9A193 for ; Tue, 30 May 2023 05:30:58 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2af2f4e719eso47173191fa.2 for ; Tue, 30 May 2023 05:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449842; x=1688041842; 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=sbfKhEi6AP8oogWxHIUjADOArHuCuwJja0KhM7U85+Y=; b=vRUpZqjHX8gIg96+0FXtOpJ2hZUbOQ3/nAAEOW3FU2s1Q6TOPRx8r50flnJZYZrNX2 JVGKmM3YdFqHYHziwTHBrMk44DKqeWdhgsrPm4zPqVZaGl1FCX3icDyphQhKTUtIOjBv Rlk9TLhcEPzHkmVbtpPWzQvhDwvysNQHDWY8LqHkDBwX6lWA08/73Sl0mDuWhdxYouxR Gza9y3rf9IzmJObxzJ1FxbKTHvekPhgJ17SnZ2lkk+6RB1f410MbbO+hAyy2PoprH9Dd s/RiKpT2CLs4gKVr7fX0eKyz/ofuzJ+hLzQdFh43Z1Eiz48/gTkWZdpZNVWYwrXzHjMw Rczw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449842; x=1688041842; 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=sbfKhEi6AP8oogWxHIUjADOArHuCuwJja0KhM7U85+Y=; b=Cathd13KvkqChDyeMBJ7eS/bO7oeKXozYKxS/pHJjPORYi2j/lo2MINs8H5wQ+RAJ1 ctztPaZ9PMT4FZ69uiiCWhdiAnLER95r5rsnbUNNL0o0s3lyR78QTWAvHgcniuUgoKDz h8464u8uV0cq9sj4B//nb7teUrepC+TuJL2ekMRqZigUDWtc5gt/WAF0lS2yvT929dR2 IqJncdsiNHGl9+RKbGi2OyO8+xPsodP7ZR+2U+Tq19BOHJFDfvzTFSC6xejpEN6KO45R KttpobHMHBHI3xGwMwX160Wr88lIZopz7iFQCE0qY+pQO5hRC9xnfLkbNOJ0iSbpZyzc GWeQ== X-Gm-Message-State: AC+VfDzn+A7QM8/K+ao4lRD8m8nfQdOji5lPHWSEfaEd7i1CfFKWDC0C Ul+WGtNazhWOtBT3/3GK4GzVmQ== X-Google-Smtp-Source: ACHHUZ4fiaEB6l9xrvcHu6Ng1NM7TGxQ2cCfXI+eAVIk9J9KIJH3jnMej9GKtK0hJb/x9YP4CZlVsw== X-Received: by 2002:a2e:2e16:0:b0:2af:22a0:81fd with SMTP id u22-20020a2e2e16000000b002af22a081fdmr689378lju.11.1685449841843; Tue, 30 May 2023 05:30:41 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:41 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:36 +0200 Subject: [PATCH v4 02/17] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-2-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1518; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6Tn8t8czcTnx35lpk52WIN8IiuX0IKqs1GzlBMeyKQk=; b=YkKhxl3/ihamy1BEEQDPatQ+JPwks7Lxn+y7kclMML3j/mWQMghtFGtL7R0Jo7xbdfhZcO5oh rBHg1+d4v0KCCYNwh4lBl8mllhLQJSFw+dUDchB/5jOADrNxIwG7Yzj X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The startup procedure shouldn't be started with interrupts masked, as that may entail silent failures. Kick off initialization only after the interrupts are unmasked. Cc: stable@vger.kernel.org # v4.12+ Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 918a283bd890..5506a0d196ef 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 *hde= v) void __iomem *wrapper_base =3D hdev->core->wrapper_base; int ret =3D 0; =20 - writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); if (IS_V6(hdev->core)) { mask_val =3D readl(wrapper_base + WRAPPER_INTR_MASK); mask_val &=3D ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | @@ -464,6 +463,7 @@ static int venus_boot_core(struct venus_hfi_device *hde= v) writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); =20 + writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); while (!ctrl_status && count < max_tries) { ctrl_status =3D readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) =3D=3D 4) { --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5BA7C77B7A for ; Tue, 30 May 2023 12:31:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231858AbjE3Mbq (ORCPT ); Tue, 30 May 2023 08:31:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjE3MbZ (ORCPT ); Tue, 30 May 2023 08:31:25 -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 8803C19B for ; Tue, 30 May 2023 05:31:01 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2af1c884b08so53753971fa.1 for ; Tue, 30 May 2023 05:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449843; x=1688041843; 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=s0orgZ9VaZSXEKcYTGkUfYKaUqJC4FA3Wr38X+NX2Cs=; b=AHOELlFVnO1Holu06NLsIHbrTMEL1w8W+AUPz5+nw73lW50Utv4V75QyHMOKD/sSKP +Y1txM0AzF3gJzOWfXTXuEdfEQlM56vv25wABKQcdbFZCmPf8Bb+fuBWJTXH+XvJGGGH CAATTnW8dKPPNLCEDqSftnmqrontzfp/LsyMct6aToqByCB+nCtxxc95/TmTu+Vj5XjH 49bE+om8uzmeAIS5b0dbyO0HodGkCg3nw0cAGuO5D+SRB02utJA99OBpp+rxpQPD0R7w dXWwCNp4ZK+Frd0Auq311tsWLXRkpkoq687q0iaLHqrC+dEhRYcLFqSEsT//vxdpSs0N uVOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449843; x=1688041843; 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=s0orgZ9VaZSXEKcYTGkUfYKaUqJC4FA3Wr38X+NX2Cs=; b=gqHT5bO0Wr0Fb1iWrBLGrtYqp/I3jWFBGbiMk0djllnfZsRxJoFrlwScs/9/j7F5Ax O2tCbRucwfjRA8PJSxrkK/fg2Lh3clWndVc/OLakNuPG9h/0fUTffQPnASoJfMkVNAvZ Y5BH20XMTkh0ituenfkSvVrvY0g8nqQSLuc4x73cA1Czgg2SFqIa5enr/Rv0cAHvT6tK y59TwLeTG07+JvOKIfhx2+EHRHmY20SkaRzkUFVyzDiUiWpK6N8t5Xui1tab69Kws8q2 jpQq7lbS6YpmJE0RSCsSGE6no1Ua/Yze36Aacf2saYVvnn5StMABsTl3D4HiUGVgEift 6mrQ== X-Gm-Message-State: AC+VfDwgDo/GWRETsl4w+lu5u/rp7n9IUsrSNLBbgYGZxNBWtXMVdyQ4 mLhjPcrKA4iMrZSO15E/kEzUsg== X-Google-Smtp-Source: ACHHUZ6x0CcjsEwSio0P8rfzkYCU6CxHPb2yrikb/oGtCx4feVujsL2ho8keJKiS164BN6UXf7sKjQ== X-Received: by 2002:a2e:b626:0:b0:2ad:9edd:4e2 with SMTP id s6-20020a2eb626000000b002ad9edd04e2mr4094386ljn.20.1685449843259; Tue, 30 May 2023 05:30:43 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:42 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:37 +0200 Subject: [PATCH v4 03/17] media: venus: Introduce VPU version distinction MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-3-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=2053; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=a99fLFp1dm6W8vgH/KZB1/Be/9Fqdmq9iT5sHLbqduQ=; b=ZvS+29xPEpjcnTQognpm1gsvkygKOy1e0BEzruqFSraEGtaUtPzdLH7ez8NrL5h0w1PUJJZkc zsoYTh+LFCNDxrfjFc4o3ccV0gLVufhoncJxwkJuZNQ1ueCiN/HNs2q X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Video Processing Unit hardware version is the differentiator, based on which the video driver should decide which code paths to take. Up until now, we've relied on HFI versions instead, but that was just a happy accident between recent SoCs. Add a field in the res struct and add correlated definitions that will be used to account for the aforementioned differences. Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platf= orm/qcom/venus/core.h index 250342d27a6f..4f8ad9659907 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; }; =20 +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; @@ -503,6 +512,12 @@ struct venus_inst { #define IS_V4(core) ((core)->res->hfi_version =3D=3D HFI_VERSION_4XX) #define IS_V6(core) ((core)->res->hfi_version =3D=3D HFI_VERSION_6XX) =20 +#define IS_AR50(core) ((core)->res->vpu_version =3D=3D VPU_VERSION_AR50) +#define IS_AR50_LITE(core) ((core)->res->vpu_version =3D=3D VPU_VERSION_AR= 50_LITE) +#define IS_IRIS1(core) ((core)->res->vpu_version =3D=3D VPU_VERSION_IRIS1) +#define IS_IRIS2(core) ((core)->res->vpu_version =3D=3D VPU_VERSION_IRIS2) +#define IS_IRIS2_1(core) ((core)->res->vpu_version =3D=3D VPU_VERSION_IRIS= 2_1) + #define ctrl_to_inst(ctrl) \ container_of((ctrl)->handler, struct venus_inst, ctrl_handler) =20 --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7FE0C77B7A for ; Tue, 30 May 2023 12:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231883AbjE3Mbu (ORCPT ); Tue, 30 May 2023 08:31:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjE3Mb1 (ORCPT ); Tue, 30 May 2023 08:31:27 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BA1E19D for ; Tue, 30 May 2023 05:31:02 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2af30d10d8fso45109011fa.0 for ; Tue, 30 May 2023 05:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449844; x=1688041844; 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=jnsR9g/cD1+a55KbA0DPQEh1v8dBMUVwa/pGnmLJ+EVsv+7FrPJBwGBzq1awiJBwV4 5506xFpPIY5ajiUdPzQl+0g4iUuqY/im9vQ8uqpTGe17pRNVeP5rmg18J98QvNACxbs7 C27pNj3OghpqkdAoSBYLbylG/VO2qVD1EO2MH4RRlB2cuhU6Qbpt45+VkfJAul4wR2ar gT7I6v4GbsTEY0HQBvl8IerIJ6/Ccw8He7THDGAgTjH5KrsoI04ux/TeQ1UWkrBcO/bX Xaw3qxmXZ6fcCRbbVx3U8LYB9iUabRIHuipMCx7eQS+s1ZGctoT6p9MZwWtSwbelnpJA /P0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449844; x=1688041844; 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=WapNsN+ARgoToh/4+MmgQxfeikuRAM82Xn4JKpxEcbYWYftIgqHWnr53ViDsvFWhGV FmOs/V7HiLFtxCCYpV3Hd0WU6eAmEjy+OX5VOKAxJrEq0h3U2lFvWwrRxh9gyY81txk5 WDsDF4Y/DHDTVHgb9IK8Y9mfAwaxfCrZ9KaSxahwu6FsgiurxmUfVT9+ePCaR0/W8xSH vOV0DUFDl1N2nS9qYGVtTgYS/NjR1LAbTnoH/JVWXbsN+/HXoIUTh/2qo+LfPwZ/P1wB DkqMHCoRKn4PyySrK22RpT/zwJWgTRvjeWfG+cS9soibuPLcxDj38w+qPkBUqZfY6o8P dBcQ== X-Gm-Message-State: AC+VfDxacOW4pIBIXctl10e0q52dZ0Gvm+sRktCjkhSXJqBqtSGvppds G2SrCNFwukpih/0/y1cG/+faog== X-Google-Smtp-Source: ACHHUZ6/nBGT6VORi7yfg6oIBBu1olPvsuDxuH+z4vUTD91hksgdUQcZ4INGN63Dh75knKZ/1EJarA== X-Received: by 2002:a2e:b349:0:b0:2ad:dab5:fe8e with SMTP id q9-20020a2eb349000000b002addab5fe8emr696053lja.47.1685449844609; Tue, 30 May 2023 05:30:44 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:44 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:38 +0200 Subject: [PATCH v4 04/17] media: venus: Add vpu_version to most SoCs MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-4-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=2055; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=nc30HaKHpy9R0tdyW3Z01908RNfbGE4dIZSAtIHTLSQ=; b=FARdtRF1h/o8OTBryIzEh0kRUC7FIYB57opTKh9EHQjhSK1TwYa+NH420fna6UIVIQm8bPO2F hFfOaXBuRe1CHneEMbIbbAIPfWlInwcEMeQCizXxlpl4NMRJEgpiNmb X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add vpu_version where I was able to retrieve the information to allow for more precise hardware-specific code path matching. Reviewed-by: Dikshita Agarwal Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platf= orm/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 =3D { .vcodec_clks_num =3D 2, .max_load =3D 3110400, /* 4096x2160@90 */ .hfi_version =3D HFI_VERSION_4XX, + .vpu_version =3D VPU_VERSION_AR50, .vmem_id =3D VIDC_RESOURCE_NONE, .vmem_size =3D 0, .vmem_addr =3D 0, @@ -709,6 +710,7 @@ static const struct venus_resources sdm845_res_v2 =3D { .vcodec_num =3D 2, .max_load =3D 3110400, /* 4096x2160@90 */ .hfi_version =3D HFI_VERSION_4XX, + .vpu_version =3D VPU_VERSION_AR50, .vmem_id =3D VIDC_RESOURCE_NONE, .vmem_size =3D 0, .vmem_addr =3D 0, @@ -756,6 +758,7 @@ static const struct venus_resources sc7180_res =3D { .opp_pmdomain =3D (const char *[]) { "cx", NULL }, .vcodec_num =3D 1, .hfi_version =3D HFI_VERSION_4XX, + .vpu_version =3D VPU_VERSION_AR50, .vmem_id =3D VIDC_RESOURCE_NONE, .vmem_size =3D 0, .vmem_addr =3D 0, @@ -809,6 +812,7 @@ static const struct venus_resources sm8250_res =3D { .vcodec_num =3D 1, .max_load =3D 7833600, .hfi_version =3D HFI_VERSION_6XX, + .vpu_version =3D VPU_VERSION_IRIS2, .num_vpp_pipes =3D 4, .vmem_id =3D VIDC_RESOURCE_NONE, .vmem_size =3D 0, @@ -866,6 +870,7 @@ static const struct venus_resources sc7280_res =3D { .opp_pmdomain =3D (const char *[]) { "cx", NULL }, .vcodec_num =3D 1, .hfi_version =3D HFI_VERSION_6XX, + .vpu_version =3D VPU_VERSION_IRIS2_1, .num_vpp_pipes =3D 1, .vmem_id =3D VIDC_RESOURCE_NONE, .vmem_size =3D 0, --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8C33C7EE31 for ; Tue, 30 May 2023 12:31:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231909AbjE3Mb4 (ORCPT ); Tue, 30 May 2023 08:31:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231648AbjE3Mb3 (ORCPT ); Tue, 30 May 2023 08:31:29 -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 4E8971B3 for ; Tue, 30 May 2023 05:31:06 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2af1ae3a21fso46758061fa.0 for ; Tue, 30 May 2023 05:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449846; x=1688041846; 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=FPcrWx+S0QqRRp9vjxeUGVcIokY4/Nke+Ff+Q0JzM8PKBO4+rvXhn1bgO7zpzFOTNP 6BMA/Vey0ohHZ8ULcjp+Qc0nvj/j4EgCpMhld9J2LXcxMeccAmPQzHJSdpTFxWuhcFMb VAsjQA+LYAOsKhdpXM9W3TCxM+ZGRe/+424JuDbGMQpx3yjx4zcaVITqg8gXFN/14UY2 BHHIIHUDMbKMnqNdMRzeUY6rbZbmMTbqpg2v0zIauOVF4kUL8oBiOFuIn/EP6kwDR3af HP9P2GnOSLsIcLYJA/LojzJ4hQDut4jD93IsVYebz0b+1Rs7Z+2DBjEqg13q7bu0uRiQ Tr6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449846; x=1688041846; 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=VlRqXN5tXE/aQoqjvpYTF3juilCSkyEED1omc/QBkaYJQaBoRCyvZcedN0qNCXqqC0 seJhWbiO8id703HhU3CcwcIfcZR5q5WOAa+/WGr/mqCueNa8rmTrQNkXQGtFzJGc4nzs eTVqD7U4GX4V1VIR+jaz6jjQTSYhL0Azdvae4fhsEdQ7irq2iUjrqh1RDWjvDi5PkAbu WVpKEVws+fahFcXnKv/amN6wpdj8NZucXFoxkSfCsp77/j5+wWsPfUZosKV4C3JWihTw jVsIx8GEg7sUERC1RjntfNGIfKaFogXc/6VlrJBSWriRwdmm8CvHpWjqVCbiqkQd0koF AZrQ== X-Gm-Message-State: AC+VfDzojDSR7LZ6/X8RcJox5C3WwqsdNYxKtXlgk0xgqOBr6b3xiopk DoEZ37BJ+Q9Xn/IUk7Irzl1i/g== X-Google-Smtp-Source: ACHHUZ6425G16ZBREi/VznF6+jFFaaARjmy2zcNhdH6MNDBtZkLRadv/FvnFM8Rpluskkffqo1AaMg== X-Received: by 2002:a2e:97ca:0:b0:2ae:da46:7f62 with SMTP id m10-20020a2e97ca000000b002aeda467f62mr782022ljj.29.1685449846149; Tue, 30 May 2023 05:30:46 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:45 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:39 +0200 Subject: [PATCH v4 05/17] media: venus: firmware: Leave a clue about obtaining CP VARs MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-5-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1589; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=v9h9rG/TP42x17XwYSGnOJ0sfKKqjUawup8lEKzjmAc=; b=J7JzvBaATX4OCVY/zIqqe/aOUY/Ubry8yNokzE+j+EO1Y/vbLIyY1ZtEZo9hQK9FF0fPaY9FB uVJ+94MKZQZAw9fX+nNMzg4Ke59YMQPbMOfbWN/jOFeIbOUw5BDoF6w X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The qcom_scm_mem_protect_video_var accepts two sets of pairs as arguments. They describe the virtual address ranges of the CP (Content Protection) and CP_NONPIXEL regions. It is however not immediately obvious how to obtain these values. Leave a comment explaining how one can translate the vendor device tree properties for use with the mainline driver. Reviewed-by: Dikshita Agarwal Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/firmware.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/p= latform/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; =20 if (core->use_tz && res->cp_size) { + /* + * Clues for porting using downstream data: + * cp_start =3D 0 + * cp_size =3D 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 =3D venus_sec_non_pixel/virtual-addr-pool[0] + * cp_nonpixel_size =3D venus_sec_non_pixel/virtual-addr-pool[1] + */ ret =3D qcom_scm_mem_protect_video_var(res->cp_start, res->cp_size, res->cp_nonpixel_start, --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7A53C7EE2F for ; Tue, 30 May 2023 12:32:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231750AbjE3McA (ORCPT ); Tue, 30 May 2023 08:32:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231547AbjE3Mbb (ORCPT ); Tue, 30 May 2023 08:31:31 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1481B7 for ; Tue, 30 May 2023 05:31:08 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f3b9c88af8so5026720e87.2 for ; Tue, 30 May 2023 05:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449847; x=1688041847; 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=7X2YmPxQFhKCq03fcQ2JuiF4fVCtctwggowl35Zs1sw=; b=ca7h0aksE6lqaLTt5whA5LVMO73Bk/YrNfB1jvw8kSNKoz1jpQdCuxhJYXLsrm7MeI xUYIzUzUzmx+3YFLRFLgeufLPCXdFc5VtrVsoJ8hiPV7BJq1Bopei/WX3i6GfJH/ABrv nrjuFMK7hjo4gi/z5deVlB+B0KtkUzKXmhreAYc/sCpv8W6gnyFh9GNXMtoZ+At61SU5 aW3oYNclpB9gr+YFXsctJ1O5dOGiPXC1vHiCJ54KSxbSVzLvGm7TaZnkyrQo++52Zw+s F4mIRjw0uzpI4UibVzoq75I5tURDnwucGlu2Ezr0T36ZrXzEqnqj/wxxs7kJXko5rqnF 1dow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449847; x=1688041847; 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=7X2YmPxQFhKCq03fcQ2JuiF4fVCtctwggowl35Zs1sw=; b=ly9NDrR9iVdpZDllIJGY9hIMxk2bLZ+YpBE3aW0SVcpI8TkdydsvGSxbidvklxittQ +4LCUPggdYJXfMdTokPhtlZhZ0ZzR6BeN68wl9Y6XG+HXpiuSbpdnDwHWTY53lvCVSHC o3TDE6Yc0Xm9nAXHHqWFKfbE2e72hJCSyqOvoM5BNCUDVVpe1ZHxVo6QEZD0CvMZUAzz cf2zf5sdV4z2c+iOqLvQwhWh4yw6yQMByGpXlwb+2Lzx/k1Dah72hxLhNgLfLRF3mP90 vAJeYfg/7oI4ouq6W5X0dPLvs7H5W6UcdZbgMMxYAPzvf0nylQKw++bleLrFUIkB7m1l Hfng== X-Gm-Message-State: AC+VfDztNFlaeCEYzXxEmPRwivmU7lUElW3/LxbdIW6gLt95ftRw4Bi/ 1AzlfphzsA/1KOBg4loSgMVQEw== X-Google-Smtp-Source: ACHHUZ6sug8Jb6T0DVsEM2OIlTBPSQWVfDfYgOBvujKQ2Sa9PpU+updIylMFCueoeDmfNp6e4m+ApA== X-Received: by 2002:a2e:b349:0:b0:2ad:dab5:fe8e with SMTP id q9-20020a2eb349000000b002addab5fe8emr696149lja.47.1685449847537; Tue, 30 May 2023 05:30:47 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:47 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:40 +0200 Subject: [PATCH v4 06/17] media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-6-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1704; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=GIwAiWH9yip6A08qldobhtvjYZiRCRgkhQUH81kLo/0=; b=s4cSpf3PKrrmU9HsxpFz4ai3ElIyaSW/PvhbmUBdDBGfPGPk4wENmhxardXBtfi7UUOAfLG/E XAqhvTs6Pr0DBJz2jDcl7ivTQCp+eqfrQNCjVACGxBjeLc3F+289R// X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current assumption of IS_V6 is overgeneralized. Adjust the logic to take the VPU hardware version into account. Signed-off-by: Konrad Dybcio Reviewed-by: Dikshita Agarwal Reviewed-by: Vikash Garodia --- drivers/media/platform/qcom/venus/hfi_venus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/= platform/qcom/venus/hfi_venus.c index 5506a0d196ef..9e36ef9076a0 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 *h= dev) { struct device *dev =3D hdev->core->dev; static const unsigned int max_tries =3D 100; - u32 ctrl_status =3D 0, mask_val; + u32 ctrl_status =3D 0, mask_val =3D 0; unsigned int count =3D 0; void __iomem *cpu_cs_base =3D hdev->core->cpu_cs_base; void __iomem *wrapper_base =3D hdev->core->wrapper_base; int ret =3D 0; =20 - if (IS_V6(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { mask_val =3D readl(wrapper_base + WRAPPER_INTR_MASK); mask_val &=3D ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | WRAPPER_INTR_MASK_A2HCPU_MASK); } else { mask_val =3D WRAPPER_INTR_MASK_A2HVCODEC_MASK; } + writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); =20 @@ -479,7 +480,7 @@ static int venus_boot_core(struct venus_hfi_device *hde= v) if (count >=3D max_tries) ret =3D -ETIMEDOUT; =20 - if (IS_V6(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { writel(0x1, cpu_cs_base + CPU_CS_H2XSOFTINTEN_V6); writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); } --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A9A2C77B7A for ; Tue, 30 May 2023 12:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231974AbjE3McE (ORCPT ); Tue, 30 May 2023 08:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231710AbjE3Mbd (ORCPT ); Tue, 30 May 2023 08:31:33 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 277CA10A for ; Tue, 30 May 2023 05:31:12 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f3b4ed6fdeso4616556e87.3 for ; Tue, 30 May 2023 05:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449849; x=1688041849; 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=eyFXYw29tyYHnh7jUZGsXGdVkCfkSlUBmlV0J/bqh7E=; b=l29c14kS+E/k9kDpvUSsaoSoMSoOGaa7uEtNOCc+pvtVMZilXyTwYxL5NTdY6zWZGD a3++h1FVa8I4pmXyD5vJ/F70mJDQod7U1OafHsF3nDYxXUDEyQ4fTGUVhcsmc4VDti+p kHi14Enek42nmcHLBjqtIB//pkcSBxOq6mxj+Z9z+xi+UxpPucYbZ7NndkqKhkuCvWUr 60u1xBd81TW/eaugYEDzz7Hb1lIWXCgaoSGzufyP0B9Bkol8NRq6hGzaWNCuHIo5u3p4 ct1QRaR6STzNw/IU2XwUghEQ/FWOI0rxrS1GGqNSGwpwLXnpcdTc8tkDenE5kk1KsMKx xZxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449849; x=1688041849; 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=eyFXYw29tyYHnh7jUZGsXGdVkCfkSlUBmlV0J/bqh7E=; b=MC3UkYspxTlIa7RmDhVCa9Y3Ca/Md2Cs8VOIuGi8oAeCBHTnXqV0cZK0wfyjX8g1iJ dj8+yZncElIf6lqNkJ2UzWqL42oJ5NAD0YJb0AOr0P09uAKjD74PIayG0kcz7QhckR2e /tecrTArRx5OZaWBX+wRCglpmfju4RPzpKmZe4HVDUeiEoXO59AaOu4n8A5NBNmyrrXp a6yABaaBZRiD+CLt2yxGxJ0Y6l4zTBLLI10THHwhaaet1YxLr2Ejh5+MwSyKL+h4f3Wr HbQhb/vTm0il6Jvy+nDX8upINxM+OBRzwprtOC7s6cn/xclhwaiJi31bcMQrifd/OQRD rdfg== X-Gm-Message-State: AC+VfDzk7gApOMxEXaTwPGLex/2jYxGq5nuk+cq0fXsn/WDRqnAZWNcA 6JbDei5q5R2FTncwPtwvl5iYHQ== X-Google-Smtp-Source: ACHHUZ5H96w3r5Nr2GfN0aIY1qXkTny4w+kmfV2bIoO0UXxr+zVKEk9g699+0IR+//wfrCJPNLY7Qw== X-Received: by 2002:a2e:740e:0:b0:2ae:df5a:9637 with SMTP id p14-20020a2e740e000000b002aedf5a9637mr674229ljc.21.1685449848871; Tue, 30 May 2023 05:30:48 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:48 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:41 +0200 Subject: [PATCH v4 07/17] media: venus: core: Assign registers based on VPU version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-7-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=911; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jLkMwNqqG57kt4LLfCZOGle80CsutpLNKoM94v0Cd64=; b=ZadOsG66UgcLTo3X0cHb8UNZN5x0jCBfFaACQBzQpgsBcyGqvCeZtjHcxSxETIaI+Lhv5p3CH vQu9zy0kwbxBgxO1KQD0iLji/JjndvQ/N3nj87i+3d3AMHD4I1T6NlN X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current assumption of IS_V6 is overgeneralized. Adjust the logic to take the VPU hardware version into account. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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/platf= orm/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 *co= re, u32 type) =20 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 =3D core->base + VBIF_BASE; core->cpu_base =3D core->base + CPU_BASE_V6; core->cpu_cs_base =3D core->base + CPU_CS_BASE_V6; --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2624C77B7A for ; Tue, 30 May 2023 12:32:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231543AbjE3McI (ORCPT ); Tue, 30 May 2023 08:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231734AbjE3Mbg (ORCPT ); Tue, 30 May 2023 08:31:36 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C1FBE42 for ; Tue, 30 May 2023 05:31:16 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2af30a12e84so46128741fa.0 for ; Tue, 30 May 2023 05:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449850; x=1688041850; 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=txi3v40xeq1skICXUdS8mQdkH8Gx8cp0BEFL2/OQ3wI=; b=a4GmkCT4FYKvoO1zaqw+4yWcxhEgBiClLH8HcvBwpREQ5avFR9IIYRArPe7tZhG5gE Ub25UHyTPR9LXH4cEDutwUYkwZBVSdy0f/e8w9uArEE2fVfYWOeLlQRD+JI1wSh3PXYt F9VYjSjKypFzWMNwbIZn7zZhkDSFCJfTGyRpd1Jd0KzF1QHYXBShmW4myLELyn9zVi2e b5bktQubb4FMN8SJ+oKpJ0trNhjxlpFf26CMBUg9vHf3owTyd9bd02+8OiX1InGkwS2Z uxE8UZEO5cRrIn5IeP3sdinQi4q4QzWDvhn6pOrCO72CFNsQcd7gp27nvF9wU2sIOtq+ 6a4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449850; x=1688041850; 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=txi3v40xeq1skICXUdS8mQdkH8Gx8cp0BEFL2/OQ3wI=; b=GEnLTFShfUt4Vgz4Iu7gN2qxAvkJkyYoAvDdASCxR8WY0vkNvp83RhRz8T8Pa/d+Dl kJ4ClF4b1LxsCqDUNOhpcYahr+49dmAS1Y9BC6TlUyUba80N+Wwhz+Bg1WdlhhzG+2ST DucehszmzDzqrXgmYXu7y+RAPOy5w51eus9iW5Jrti5KMNvMMp51XnXOVHGsb+82s8te WjVosf+hZ95eqJ62dHJb61p5nnR/vgjtwkhCpHIhaePVPS1GZfBbJo/SiJgYKfTLFph/ lmWd8hIvJTa2gGpETaDLYhJmHZH7D9yLNlmuLgDIKsTvp3l/6r3SBvordk/K6q0owAru w19Q== X-Gm-Message-State: AC+VfDwAHCY3gjmdysfF+gCk/9YmvSqp/l8Tcgos2UrrvZDugVf3OF2o lWTHxFTCOGuc4xDg+vtfPds+tg== X-Google-Smtp-Source: ACHHUZ4ZaNTNJE75kVSt7ogTnm6YJPqnBOB9g0/YkhP8sbksz9DKJrt9ebpFWC5DuQP2BAncZjmJgQ== X-Received: by 2002:a2e:9884:0:b0:2ad:81ca:a52f with SMTP id b4-20020a2e9884000000b002ad81caa52fmr727410ljj.47.1685449850275; Tue, 30 May 2023 05:30:50 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:50 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:42 +0200 Subject: [PATCH v4 08/17] media: venus: hfi_venus: Sanitize venus_halt_axi() per-VPU-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-8-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1056; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=CwRrKkc56gP78vWbwj31mgvh7BvEJbPxU0vhFKBwos8=; b=1VSC8LRy2Yd6gP8VcoQDaPeCC2ljSd5bhpTsKRED/3emZGSDqHWLGNiYO0Q17KO7iqKjeNsj/ 7CTpQpJKX3mDK80Z4kDPVuxdJt0M9+EP412kVhMcl+BwaI4W89RjpMe X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only IRIS2(_1) should enter the until-now-IS_V6() path and IRIS2_1 can be used instead of openly checking the number of VPP pipes. Use VPU version comparison in both of these cases instead. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 9e36ef9076a0..60252d05781e 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -548,10 +548,10 @@ static int venus_halt_axi(struct venus_hfi_device *hd= ev) u32 mask_val; int ret; =20 - if (IS_V6(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6); =20 - if (hdev->core->res->num_vpp_pipes =3D=3D 1) + if (IS_IRIS2_1(hdev->core)) goto skip_aon_mvp_noc; =20 writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 063BDC77B7A for ; Tue, 30 May 2023 12:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231992AbjE3McL (ORCPT ); Tue, 30 May 2023 08:32:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbjE3Mbi (ORCPT ); Tue, 30 May 2023 08:31:38 -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 C661CE4E for ; Tue, 30 May 2023 05:31:18 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2af2e908163so47238781fa.2 for ; Tue, 30 May 2023 05:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449852; x=1688041852; 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=GHPVGbjJBA0Db5NX5/99pqJA6zhMyUu0sO+jgoxH74w=; b=TfJC3WPbzJ918/gievnznE/ZwcFlBinuavTQ4Po9BfAFOFkKLC6BMvsSMn2bgGAf4F ylbrPfgLRETekQXK3xs5uodxliYY50p5WViq/IErrz2My0QjIfqx2ujNBDWJ3t+waCWs siDh6kOP+1rgfM78KlGJ8yYUHKFaJD1hv5zuNPP30mJGW1gaTMw7UQW68g+E3NeydrYI oBzfAgxjTTudADMPd49sewz211f0wgdqLFZ+XFILN7x+gSRANDeAGft5AKprRqdh/NBb MhhMs8tIQ6PJ2VwWfqkO+cvYFvlsoyysuL6Mxkvn8vl81GoLn/xLheK+4D36WG7SX+Zg GxWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449852; x=1688041852; 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=GHPVGbjJBA0Db5NX5/99pqJA6zhMyUu0sO+jgoxH74w=; b=Xmd3ICdBkUrykoKAOqMIojM3Aw8+5Dfqn7hxeFqmybUjbZ7vLyOG7O0HcYIG6haEh0 AJ8DIJTD6QT2r9ZZLwX+Shc+E24e552sF696V4rJpmmfEd8dfcoXxEg4CdWgJfhISFhH SQBFelcGkiicj9H3U2qcyIMGcnRhdQgqMpOX41t/u6/cE47LOyk257Wry2OzeGKp2RKJ LvNWD6OGY5m69WzAuPR5yZnIO/xfwyod3rEjFd7wlH3asieS2XDDm4CVPB0C9xgL5BHh TtEP45Z7l94+tRF0tOgMwy7xSqW4lNP5B7/OUSDRBaJ7ugFreDMpr8UWmQmRFU+vlL4T vwfQ== X-Gm-Message-State: AC+VfDzxISYG8YTkw7a36DleS2RyuJGyrTJ9cOIBKD+J/l32IQxwfhWT /d8DMX4uYPXOmR09qQlIYu6NeA== X-Google-Smtp-Source: ACHHUZ7pYkqFll2vdHt0IWGzDg39n9bH07VlDBfSMSaNf8DRKQ7SWKFzD/dODWeEx+ArtrAaKHNn6Q== X-Received: by 2002:a2e:a212:0:b0:2ad:bb53:8b9a with SMTP id h18-20020a2ea212000000b002adbb538b9amr772535ljm.20.1685449851577; Tue, 30 May 2023 05:30:51 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:51 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:43 +0200 Subject: [PATCH v4 09/17] media: venus: hfi_venus: Sanitize venus_isr() per-VPU-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-9-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1296; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=F378bEBVQejn0ekkF/wJCvXE1cklNHMQZFzTNKZSqSE=; b=6cCLhcsld50rl+TGqoJgykbJLGOa1JqrHParUU3GM6CVGBKnKZF2l4Ix69R/uXef9M+pWNqdG lqI0ZcNJQVoAEA0S4rrrPx/3kk9oYpevUwfT+md++1QrzwrA/dVIYAv X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the general IS_V6 checks with more specific VPU version checks. Reviewed-by: Dikshita Agarwal Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 60252d05781e..5e4b97b0a4ae 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1109,7 +1109,7 @@ static irqreturn_t venus_isr(struct venus_core *core) wrapper_base =3D hdev->core->wrapper_base; =20 status =3D 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) @@ -1121,7 +1121,7 @@ static irqreturn_t venus_isr(struct venus_core *core) hdev->irq_status =3D 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); =20 return IRQ_WAKE_THREAD; --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D842C77B7A for ; Tue, 30 May 2023 12:32:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbjE3McV (ORCPT ); Tue, 30 May 2023 08:32:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231822AbjE3Mbo (ORCPT ); Tue, 30 May 2023 08:31:44 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A7C11C for ; Tue, 30 May 2023 05:31:26 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f3a611b3ddso6782860e87.0 for ; Tue, 30 May 2023 05:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449853; x=1688041853; 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=AuNT9Cruhplaf5M27x4h0WElwFVfgK7TB9z7U29d9j0=; b=ZSD/s6U/hvVdc5LUHI9NZ7bNxid4H+oOgpkQ+CQsqoYdvS5cHRSsdsqOGcZDPWZc2U 5bDU86pAFGD28wDDe3ivik9ncECfrBVhGl0/jUBJLoI7FYIBKVZzBRjuH2QJVwGc0Aqe qU2a4SfRWbVO48pRWDqj6ZVnyXWefwOEksKRR+/1Iseh45s79x5k/gpqHdY2IESnJ7j7 SGJN1vAWlLnBL+lYQ+q5FOfLm1ij1XV3BH4CZqGyxPOxo76UKbaUti1QUuVWXbDRgPUU uU8Dw8PLPgeIXGnmgzac2UZ7y4W1RVAj7g/62xpN2s5dp0NNzScwF656OAZ2OFv0auaG ua2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449853; x=1688041853; 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=AuNT9Cruhplaf5M27x4h0WElwFVfgK7TB9z7U29d9j0=; b=Q593zYH1bcso9BOQ00FdLm2CBKhBEWrktCXeLOoLC55UiR6eE+5B+CwPWR0YII96Qp zT+ELdvkICigthq8gxCaQo3aOYW5VHETLLEozARmO8OfPTmJU5QQFHhw32rx1dCLveOg GIPT/FTI/VGmgt512LzTMDq1L3swYIOz+J7DveHT37lrIen5w2CuIBxCDX9M1RtP5Ws9 rXGVn8FH3lJ3FHi1s6QRg24Cl/Exs4DzgpKVsltJrSwF+aWgbF4Kj07iOwsMC7MR1kiL KHBvCoovSgd695KB5HAAYRdPcfvxqtN7/hZEOaHo4ace2V+kwXpzg5EtAWhJtKA1Po9z 5MCg== X-Gm-Message-State: AC+VfDwjmf46lyHUeqH4uZXmnDpXeLJNAykilMs//zVbzN3XdWX6N+Pq xQSltPSlvsWkPDJkqsfZGsFXdA== X-Google-Smtp-Source: ACHHUZ43dfbnBCfl/ZdEAlewRPkC4kG5mka1e3GDE4iqfXWY4n4nzEGS+FyENrk0DVUwdUYfHDqfUw== X-Received: by 2002:a05:651c:32c:b0:2af:2965:8f78 with SMTP id b12-20020a05651c032c00b002af29658f78mr3477894ljp.12.1685449853629; Tue, 30 May 2023 05:30:53 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:53 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:44 +0200 Subject: [PATCH v4 10/17] media: venus: hfi_venus: Sanitize venus_cpu_and_video_core_idle() per-VPU-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-10-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=915; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=rs7GlV5yuEvpX7uzQTE/PpuhYQ091SJv7fj57bpy7Ik=; b=5vCoXTz9cnFhoxI98HGqjp6z1qPYbBiZjNhWqTzvtukFvbllkKQ8MaUBoafM4wRPQKdBoCR+i W5DZnz3kWcoDVaQiJgHysPReShHQxloTA7GwTU7cHFnyBNtzaHTjLBa X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 5e4b97b0a4ae..b5d7aab03bca 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1516,7 +1516,7 @@ static bool venus_cpu_and_video_core_idle(struct venu= s_hfi_device *hdev) void __iomem *cpu_cs_base =3D hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; =20 - if (IS_V6(hdev->core)) + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) cpu_status =3D readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status =3D readl(wrapper_base + WRAPPER_CPU_STATUS); --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6168C77B7A for ; Tue, 30 May 2023 12:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232029AbjE3Mcd (ORCPT ); Tue, 30 May 2023 08:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231920AbjE3Mb6 (ORCPT ); Tue, 30 May 2023 08:31:58 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22C7C19B for ; Tue, 30 May 2023 05:31:37 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4effb818c37so4739194e87.3 for ; Tue, 30 May 2023 05:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449855; x=1688041855; 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=sFh246SoG2jAhae1NbkulRcn/T0bmO2nXKY2ZVK5ddw=; b=kzsdELY83WMHUr3TgkmSvPNGp5L7NnLmYAy70Y9nga0RiFlkzkUvLCvQkDD1VLFwGT jX8Gk/l9fDOkKAuG98Kk27xM3S0QrgxI+cYP4Hl63IEhoKLrbrCMPrnhHsWEW2pwKfnF m2tW12N+fqxGkCnUWSQ1qBQdopPew7WBCvWpf3Z5GYic05Y864iIBSzBct05tBlaQ8uD uTMEb9LjpxdVmjHQEeFrCbmBSqrR52plkHAaqDaXN9UqOf8ETaFl9o7UVA2GWF3j5w2T g0tJWvXM4eRU4slDIHLOpdJ/wrzzUseWg51dddjydoisxqEF9ju0+ZErkdQLMB3YUXrU Eeqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449855; x=1688041855; 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=sFh246SoG2jAhae1NbkulRcn/T0bmO2nXKY2ZVK5ddw=; b=aJ6YkIlKQSVDzsxL4lDqaAhUkGiL38Hh3s8o6djcjaMsSH8JnF1Kmn7j9gKgB/j8ZO uPuTlysRHfNFcEvDgWKqOAzlBLg+pwif6eW8jDQL4U2XtRTJ2Fm6xTklvzdbpONUkTh5 ODSSzMKfXbQmrgVGyHfFE7gX7zS/L3AnD8ovVi5ivA1+CofO+Z4wkoC383A+t0Dx4LHy KGs/ueBPvx2L/fz2QoJ7Gljw6sOXiUKWGSJ/nBfthVeQIEXIhWGHuLYleDOhI/1jeN/e 6kATY4ExrxrtqzW9YRzcFof/pOTgQ26ZboxBZVQ3Ljw9+bz347gIgyqZHeFucSASgCF9 JGww== X-Gm-Message-State: AC+VfDwDtACsSgZoBDHezwex4nLMOGKes4wi9eXuQDr+jHFGK9PYX/04 PDt7asyCgZkqQk+C0LACGAF/ng== X-Google-Smtp-Source: ACHHUZ6FBBh+TYL3Qj4k12t8psjYlzNX4e+y/EFOteibMR3kVjbmUNjmRNVXbUTH3uIjFA91gixbJA== X-Received: by 2002:a2e:3a04:0:b0:2b0:790e:95ab with SMTP id h4-20020a2e3a04000000b002b0790e95abmr679359lja.31.1685449855058; Tue, 30 May 2023 05:30:55 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:54 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:45 +0200 Subject: [PATCH v4 11/17] media: venus: hfi_venus: Sanitize venus_cpu_idle_and_pc_ready() per-VPU-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-11-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=913; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=dir0ijhcjSzkrYz9ZlGYapAdRHdLVbJO06zeci6np7c=; b=wmAExUeiOkcUBkOn2uQmzgB+NkMlejP+e/YYR69HkfqIy+ssD9bcow7EML253GozmhgB2BqGf f8sqybGMqZHC61+jX+8T9TL0s7i5+cweIwY77aIPQjuGHbOHaNtEMAr X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 b5d7aab03bca..82854553f99e 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1536,7 +1536,7 @@ static bool venus_cpu_idle_and_pc_ready(struct venus_= hfi_device *hdev) void __iomem *cpu_cs_base =3D hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; =20 - if (IS_V6(hdev->core)) + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) cpu_status =3D readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status =3D readl(wrapper_base + WRAPPER_CPU_STATUS); --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E80C7C7EE23 for ; Tue, 30 May 2023 12:32:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232045AbjE3Mcn (ORCPT ); Tue, 30 May 2023 08:32:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231481AbjE3McO (ORCPT ); Tue, 30 May 2023 08:32:14 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1835DE61 for ; Tue, 30 May 2023 05:31:41 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f3a9ad31dbso5037695e87.0 for ; Tue, 30 May 2023 05:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449856; x=1688041856; 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=SyYkzqdDCC9q3w7GHxMV/UafzmkX5Zjo7MaFjCP76O0=; b=ODHH2/xiyrQVGlpxEkAyEQnT7M9/CCiIvDY7IH8HlfObOxLHSzOrz7rMm9tBJa+aHK osZbEmrwGlnpFnyonLf4jMuRA/D/CZ5M/asyNGSHtKLFqyBrrMuhcBrs8G6Jz7gx6KvA AoFJ7TBnr7IPH35Xu9xNOlvsXH6vEmAF+1A0PGZBi73HS7CbhQ+9VQGqE9V1J7b3rv5j dVwBI1U3261i2jOJGnh53jPbGUEn/wO+5tQWdxIxUu2a8d52+uFAiPNjIwe42HZINnaa lPmTdqiUFRAAja98C90flRDXM8CnKnlGMGVW69bIRWdazZKW33UFwywHaWYj4idoPYMJ Kgfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449856; x=1688041856; 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=SyYkzqdDCC9q3w7GHxMV/UafzmkX5Zjo7MaFjCP76O0=; b=by+Ud1srzTCljRHYAqCg2MpAHR5kv+s7iqZMqxRQYQTLZUlPgAniNXmRsU1ob8u0o+ QGbBRn2pRMNkA/ElXGpCNl0u7uTFc5rOvn61PIaHMjHHedny9JwPppByD76ayyOHBdaV cFx+WL3HbpNdq3E533zYFFT5AqTZBSye5JXFSa7Q2dugxbRQGvW+vZ1kamijqERttfEv JfDgalSapoBigznGZz8NYTJUga7Q2hwg9en8QuKfvolXwBlh4GU+tL4VHovmfJEmvRen gaFeOvbkXiu+cOzDs/Ybw4I9NHITZXTE94vjOP3Thzp/p9MvfVe+NcnLzC2IDLhQ1G4S rS4w== X-Gm-Message-State: AC+VfDwdNgB1oDNBDt6PI9GJEo+BanF/aFvuUphS/PCdoazL+utmnBg6 bvc8kOl6alUx7kKgQkmkfjL+1A== X-Google-Smtp-Source: ACHHUZ6EpWTY1acHGhOrV2DgzEt0DXB9F9/5GHnBsOlHHyCCThuALiUOGAonQJi6WtF33x0jIFXlfQ== X-Received: by 2002:a2e:8792:0:b0:2ad:87b3:7d62 with SMTP id n18-20020a2e8792000000b002ad87b37d62mr623302lji.46.1685449856399; Tue, 30 May 2023 05:30:56 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:56 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:46 +0200 Subject: [PATCH v4 12/17] media: venus: firmware: Sanitize per-VPU-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-12-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1814; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6YgBcnk5wJmY0h2UMmOrskDVPO7haGfbf8N3hZu0IXY=; b=nl3wP2X7tsd1Tm4R4+AGHUVOu2PspKZpQYRq5zaAqrZB1Dyr/OGl0Ou1UGxDWP/yzbWOGvsZK VpC3CTm6zapDgzGxt1BQzPtHT6RhUj1pET2XntH+Dqv6b2r17VWyJQs X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio Reviewed-by: Dikshita Agarwal Reviewed-by: Vikash Garodia --- drivers/media/platform/qcom/venus/firmware.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/p= latform/qcom/venus/firmware.c index 572b649c56f3..ef07eea38d93 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -29,7 +29,7 @@ static void venus_reset_cpu(struct venus_core *core) u32 fw_size =3D core->fw.mapped_mem_size; void __iomem *wrapper_base; =20 - if (IS_V6(core)) + if (IS_IRIS2_1(core)) wrapper_base =3D core->wrapper_tz_base; else wrapper_base =3D core->wrapper_base; @@ -41,7 +41,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); =20 - if (IS_V6(core)) { + if (IS_IRIS2_1(core)) { /* Bring XTSS out of reset */ writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET); } else { @@ -67,7 +67,7 @@ int venus_set_hw_state(struct venus_core *core, bool resu= me) if (resume) { venus_reset_cpu(core); } else { - if (IS_V6(core)) + if (IS_IRIS2_1(core)) writel(WRAPPER_XTSS_SW_RESET_BIT, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); else @@ -179,7 +179,7 @@ static int venus_shutdown_no_tz(struct venus_core *core) void __iomem *wrapper_base =3D core->wrapper_base; void __iomem *wrapper_tz_base =3D core->wrapper_tz_base; =20 - if (IS_V6(core)) { + if (IS_IRIS2_1(core)) { /* Assert the reset to XTSS */ reg =3D readl(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); reg |=3D WRAPPER_XTSS_SW_RESET_BIT; --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77293C7EE31 for ; Tue, 30 May 2023 12:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbjE3Mcs (ORCPT ); Tue, 30 May 2023 08:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231422AbjE3McW (ORCPT ); Tue, 30 May 2023 08:32:22 -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 257EFE7D for ; Tue, 30 May 2023 05:31:46 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2af20198f20so45020901fa.0 for ; Tue, 30 May 2023 05:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449858; x=1688041858; 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=SCYl3pwqYVglWX8Xi1vf6uiEsmGVPsuG8y5duX0ElHDXSNbjgyK40To93hnzuzqt1h QlrbquLEwsBRqv/zM2IcLd4ouCkstm6p5oTwH+sEwVxK1c1vFQF8CRBVAgNGeiY7yyo9 YUKh1eAcS8qF618AYUauKFWz1se69Hro5WClNfF3f+e71/AZPsS/KyJDo2zeG6QRawBp TGmyj6dNJYnm4WwFxz7EDT7wb8zafEoP3tjKaq0Yz1hUKQ23Gq30j6V4KOtbOQgY+Xeb ocZno5DSYZ7jF+A2UNh2kwcdgSY6eLCbwsiTVlnOGc+wKuvsf1mAsNRTrzDd3dwmqtiM +0fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449858; x=1688041858; 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=bypuN2B1fetTHngv3W4sAdGAqx3fQODUzaEIUCauHh6O7u3P6//pb2ThXlP03ds3S/ UwgIZebpFxEfCQyEmM1R1IJcud3WWWHbatzdcM9ZVVdaYNkXNK3Ee2/qDI+MKMrW9fqq kIv25OsUaG2Bq/wbaEi1D5GsHcjuVVgCnVUOrYbttWVHE+3+265CO+/rR1IgMh++4wSR nrTw6dDXmqhfEwBOGvmyQGUdYFLG+XvWAwVkWvf6llL/MOa8a9v0SN/WBuoW9kWJ5CE4 d/wvWx6OYjTN3rtrXLqlWSbzrMCHaAtheyt1ZZusryBXVtPM6GYP4PpghGscWiKjEwOo qy3A== X-Gm-Message-State: AC+VfDzwuETAXYyR3JRNMqYD8iojX6YYS7aDf0NO6TsNP8aPTLD1Ra03 nl7FpykZob91aSNPSCKdaBgrLQ== X-Google-Smtp-Source: ACHHUZ5QYGxZY7HU/diHNzd2HbY7SLguWgH6WN/zU7FGqFLt9FIqhJWue63p2k72hbAbG5qsjbEjFQ== X-Received: by 2002:a2e:98c7:0:b0:2af:23fe:98ef with SMTP id s7-20020a2e98c7000000b002af23fe98efmr657276ljj.50.1685449857841; Tue, 30 May 2023 05:30:57 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:57 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:47 +0200 Subject: [PATCH v4 13/17] media: venus: hfi_platform: Check vpu_version instead of device compatible MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-13-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1007; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=EUWf2T+I6vhFizSQGtxC124WvawcGCVn6gQZEf/m3uU=; b=yQW+ZmcZHz0nTsrcuohrVTl7N3UqRQ2dZPoS6Vn/18F3I0gbau/J1nJ4vwL7mmALeRZAAbw8X mBO38SlEvptC2xIm1JDuMfvGDzU4kZDGulCD008OT+2p3bGD79hL4L8 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is not a matter of the host SoC, but the VPU chip in Venus. Fix it. Reviewed-by: Bryan O'Donoghue Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/med= ia/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); =20 - if (of_device_is_compatible(core->dev->of_node, "qcom,sc7280-venus")) { + if (IS_IRIS2_1(core)) { *enc_codecs &=3D ~HFI_VIDEO_CODEC_VP8; *dec_codecs &=3D ~HFI_VIDEO_CODEC_VP8; } --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE16FC7EE23 for ; Tue, 30 May 2023 12:32:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231524AbjE3Mcv (ORCPT ); Tue, 30 May 2023 08:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231443AbjE3Mc2 (ORCPT ); Tue, 30 May 2023 08:32:28 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48B1F10CB for ; Tue, 30 May 2023 05:31:49 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f505aace48so1902442e87.0 for ; Tue, 30 May 2023 05:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449859; x=1688041859; 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=YRnWjbY4eUpy9oiw3Jwu9xibfYWN+hzyctbtgGIUQYc=; b=km8NCG0kZRfT8qnXV6rt816QmQM6EzBrPUyMg/8X0Qr20WzDkXOjCU7Y91USgTWtLb GgFdDM1fjtSmww+I6XUIooQ/CsrRU7mjNBccf2n9qQKkc49EOczsxb1H/wfWNMloap1b TkBf6jtSH8/j/HZ9tVDKwBbKw9n96BZC9rN4H76OsenTbkN/fTFSIsggrq/P236jUWwq xO2mV5FfHag9y0Ro8kJepCgpa3E0a/IJFn4bzC/dWo1L7gyMomsqh+GNyPpJzr5Dn8n8 qU5nRabs7Xg6DvMFZBHSkSE/NFS4h3qQy58qvCpdQlxnQ+k6t2DazBNLMcCExK6FeZ7j kRjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449859; x=1688041859; 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=YRnWjbY4eUpy9oiw3Jwu9xibfYWN+hzyctbtgGIUQYc=; b=dDdwzJ71Q3X97Jj5yajr8fx/N6Z2Cx5VpcX9+bBcfzN4ZkfEIqzbn4VphbnwMWUUy3 lEW4/hzyNwHgS14F+66lM8Zg/YcDIS3xqhR5a2uIZCFtFflpHkdS+AUKuPLUI2dzg5wa a31zR+1xYIC9FMRMnktXWpr2Tv0uynSMv1SdBMxLkOqQsNVDwUmhQ8BpJqeVRYRKStRB lJ1jKprl9TazR2FHpAOYu/AMiQe8C/VLQyIIN/7wM7lGzzxNp2ARzVRgZhPPM35/fOVy 0sFEC+JjsjjYmXiMMFyNkZZMu0bUIbUhM29AciciCpPeu5cyPsK0yzLlEKIC8NPpO5ay Apug== X-Gm-Message-State: AC+VfDxVUE28tqpQ3nUh/TTtR/LMYNYY400WG2redcUdJPVq51Jleemm sfgZSEs1KIQMrrFpow5wUXOQ1yTC07+LJHTKrqA= X-Google-Smtp-Source: ACHHUZ6tY6ffzc779ZZWx2WJPPraRkXITaw1tGxal7W29DC34kmYSkr2cepdPoW4rAJepXxPbodzsg== X-Received: by 2002:a2e:b1d3:0:b0:2ad:9751:8d79 with SMTP id e19-20020a2eb1d3000000b002ad97518d79mr695211lja.31.1685449859370; Tue, 30 May 2023 05:30:59 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:59 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:48 +0200 Subject: [PATCH v4 14/17] media: venus: vdec: Sanitize vdec_set_work_route() per-VPU-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-14-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=867; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=VGY5gPiqtp3BTJb/zA96U45nnyM1YeyDLDunCuTDVFE=; b=QkUtZtfy1Bmq8vawWj2OnYkiTfqBytb97u4bsYds4a47S03RWHQbiGtpEXfmwIrEFCOjZpjN6 SIhJpleXbiKAayuh71xUgC5V6dMI7JDvUCOsO7rCTthDQChW+drW2bq X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the general IS_V6 checks with more specific VPU version checks. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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/platf= orm/qcom/venus/vdec.c index 12a2e99508f5..063a8b0d357b 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -727,7 +727,7 @@ static int vdec_set_work_route(struct venus_inst *inst) u32 ptype =3D HFI_PROPERTY_PARAM_WORK_ROUTE; struct hfi_video_work_route wr; =20 - if (!IS_V6(inst->core)) + if (!(IS_IRIS2(inst->core) || IS_IRIS2_1(inst->core))) return 0; =20 wr.video_work_route =3D inst->core->res->num_vpp_pipes; --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99D15C77B7A for ; Tue, 30 May 2023 12:33:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231758AbjE3MdE (ORCPT ); Tue, 30 May 2023 08:33:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232022AbjE3Mcc (ORCPT ); Tue, 30 May 2023 08:32:32 -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 6597D1BF for ; Tue, 30 May 2023 05:31:57 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2af98eb6ef0so47169231fa.3 for ; Tue, 30 May 2023 05:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449861; x=1688041861; 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=fysaOYiCjviYo83FWRPC+oME16aSTNADlHkhbO2qk9Y=; b=TMi1Z8RvFyyvaVXE2GBU76CzOngLAQnbnL1weWU21JeGcVhlw2N+g6FXtyXhYC1Kxg k4mp5REQNtrvMkDxbJI/EHklFm2SHxIPhiiZxjt5gkaYCBar3Mz1aV/8oSapunVT61KD 7gT0W3K9+OPVM3nAsZG+gBjeQBfRP0rijsF9RLe68PET7d1ZBuImHjhIKfqXqqZZAP3Q iiZVLAAminVAYskLLVKWkh4ZLDTysLcmV2uLYoAAcZ0HC3JXWjzkXOoFKbakaqUUFIDt Y2bt0cyNQ4GzluW3lXdDrOMGIvreh9g8l9D+1BEIRmxNej5BFNocKrNYmXTYSDA/hMAm ZNbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449861; x=1688041861; 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=fysaOYiCjviYo83FWRPC+oME16aSTNADlHkhbO2qk9Y=; b=UJf7VjQEpDk242BrKOZ51HgFyKa+s+02LgsmICdMFZEnMZRdK3NMYqjn3a3k/xNspy oblEvIFvht/WxHLd58WjGBbZN5EgI0UvgEuvO6ligEHbZe0ZTqFflKX29PIKWtusWvW5 9KmCli+IAwkTCYTPEKnc4nZ6c7OGALbmySU6foaqPIPODF/plLjsk+3Weuy4oqVmuTbF BaHXJYoLd3IefuipxK+a3euhtaCXjIeG0ggEMWgWks+Z9EEK/+A+8NqePcSBJp6pEOue SvgQpHJZ0a3wt+2qeWo1DdEqVs+fCKTtpOkYmRzZbJcu4ZexM0JP53hh4xrNJs9PhRJn yOpQ== X-Gm-Message-State: AC+VfDxoZi6WVla5B05/fsKhri8K261E/lZxl1dIynkcDImh80PgDff2 dSxdrMBb0LFehjfNhwXyUAilXA== X-Google-Smtp-Source: ACHHUZ6omvYOgsmgIS5xtaJXMERrMogau4PJQOwqi9H/2VInoMhbTcrererlcSmWq8Tz4iodHgyROg== X-Received: by 2002:a2e:8895:0:b0:2af:2494:49ae with SMTP id k21-20020a2e8895000000b002af249449aemr710197lji.44.1685449861206; Tue, 30 May 2023 05:31:01 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:31:00 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:49 +0200 Subject: [PATCH v4 15/17] media: venus: Introduce accessors for remapped hfi_buffer_reqs members MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-15-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=7633; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=aA0naIs45zu3yNzQJ0HG4OVDJcjMhRj/HvlsjYQeb50=; b=/inUE1GgKPnZpyWe2gXCYBfHan/3lP2J8Zy/ajrDuYfv3sVd4GrBebFlxjZ3xefS1fkOVN6mL NNrlgzleL7vAGk/HNAD0BOzfGmE8A1x12waiLuYruLiAv4eOofkdITA X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently we have macros to access these, but they don't provide a way to override the remapped fields. Replace the macros with actual get/set pairs to fix that. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio Reviewed-by: Dikshita Agarwal --- 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/pl= atform/qcom/venus/helpers.c index 1822e85ab6bf..b70bd3dac4df 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; =20 - count =3D HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + count =3D hfi_bufreq_get_count_min(&bufreq, ver); =20 for (i =3D 0; i < count; i++) { buf =3D 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 0abbc50c5864..e4c05d62cfc7 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1170,14 +1170,6 @@ struct hfi_buffer_display_hold_count_actual { u32 hold_count; }; =20 -/* HFI 4XX reorder the fields, use these macros */ -#define HFI_BUFREQ_HOLD_COUNT(bufreq, ver) \ - ((ver) =3D=3D HFI_VERSION_4XX ? 0 : (bufreq)->hold_count) -#define HFI_BUFREQ_COUNT_MIN(bufreq, ver) \ - ((ver) =3D=3D HFI_VERSION_4XX ? (bufreq)->hold_count : (bufreq)->count_mi= n) -#define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver) \ - ((ver) =3D=3D HFI_VERSION_4XX ? (bufreq)->count_min : 0) - struct hfi_buffer_requirements { u32 type; u32 size; @@ -1189,6 +1181,59 @@ struct hfi_buffer_requirements { u32 alignment; }; =20 +/* 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 =3D=3D 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 =3D=3D HFI_VERSION_4XX) + return req->hold_count; + + return req->count_min; +}; + +static inline u32 hfi_bufreq_get_count_min_host(struct hfi_buffer_requirem= ents *req, + u32 ver) +{ + if (ver =3D=3D HFI_VERSION_4XX) + return req->count_min; + + return 0; +}; + +static inline void hfi_bufreq_set_hold_count(struct hfi_buffer_requirement= s *req, + u32 ver, u32 val) +{ + if (ver =3D=3D HFI_VERSION_4XX) + return; + + req->hold_count =3D val; +}; + +static inline void hfi_bufreq_set_count_min(struct hfi_buffer_requirements= *req, + u32 ver, u32 val) +{ + if (ver =3D=3D HFI_VERSION_4XX) + req->hold_count =3D val; + + req->count_min =3D val; +}; + +static inline void hfi_bufreq_set_count_min_host(struct hfi_buffer_require= ments *req, + u32 ver, u32 val) +{ + if (ver =3D=3D HFI_VERSION_4XX) + req->count_min =3D val; +}; + struct hfi_data_payload { u32 size; u8 data[1]; diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/p= latform/qcom/venus/hfi_msgs.c index 3d5dadfa1900..7cab685a2ec8 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, st= ruct venus_inst *inst, case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS: data_ptr +=3D sizeof(u32); bufreq =3D (struct hfi_buffer_requirements *)data_ptr; - event.buf_count =3D HFI_BUFREQ_COUNT_MIN(bufreq, ver); + event.buf_count =3D hfi_bufreq_get_count_min(bufreq, ver); data_ptr +=3D sizeof(*bufreq); break; case HFI_INDEX_EXTRADATA_INPUT_CROP: diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platf= orm/qcom/venus/vdec.c index 063a8b0d357b..2a1e038f92cf 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -899,13 +899,13 @@ static int vdec_num_buffers(struct venus_inst *inst, = unsigned int *in_num, if (ret) return ret; =20 - *in_num =3D HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + *in_num =3D hfi_bufreq_get_count_min(&bufreq, ver); =20 ret =3D venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); if (ret) return ret; =20 - *out_num =3D HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + *out_num =3D hfi_bufreq_get_count_min(&bufreq, ver); =20 return 0; } @@ -1019,14 +1019,14 @@ static int vdec_verify_conf(struct venus_inst *inst) return ret; =20 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; =20 ret =3D venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (ret) return ret; =20 - 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; =20 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 =3D venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); if (!ret) - ctrl->val =3D HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + ctrl->val =3D hfi_bufreq_get_count_min(&bufreq, ver); break; default: return -EINVAL; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platf= orm/qcom/venus/venc.c index b60772cc2cdc..d2e2d3108752 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1207,7 +1207,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; =20 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; =20 ret =3D venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); @@ -1215,7 +1215,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; =20 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; =20 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 *ct= rl) case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT: ret =3D venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (!ret) - ctrl->val =3D HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + ctrl->val =3D hfi_bufreq_get_count_min(&bufreq, ver); break; default: return -EINVAL; --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AFE5C77B7A for ; Tue, 30 May 2023 12:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232036AbjE3MdH (ORCPT ); Tue, 30 May 2023 08:33:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbjE3Mci (ORCPT ); Tue, 30 May 2023 08:32:38 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41903E42 for ; Tue, 30 May 2023 05:32:02 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2af2b74d258so46679621fa.3 for ; Tue, 30 May 2023 05:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449862; x=1688041862; 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=PlH+JrndcdKZN+GkTBs2kJnCffmk2uG9dhn2HilsGHU=; b=xc1RfU2UFkZhCxmLheuF2JOyZ2L94UpslMeBtsSQQzLQWtDjZpugYnmOnwo+NREg/4 3wXosgSxMp25oNEFxShqrgZYElxg7L+vDC3rW5Hsvz75UPk03caLhzA9xXYj2EZpjQJm AxLQtYAkQZehv72X2rApeI+YQgGobPTFDqL5ql7cHelL4Nz4ve4AczQ5OgoLAsrx8bht Gmg9yJDAftoWLG1i/6uopi6NTJ5agXpx9RPDT/xqV0Urr5k+uf/1GIc87Q4OFN4yR8xv 257jeHSMuo/pyvhlzik6CCYBdl28l69hzljT1v5XHHxIg55rEqjBHxMT8An4SvII3H6u 3byA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449862; x=1688041862; 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=PlH+JrndcdKZN+GkTBs2kJnCffmk2uG9dhn2HilsGHU=; b=ReEf19KHy0NwHPTAkFAD+v3HKErOmjucYlHxI6nhuaHmNZNoXCY67ftQjv8q+nqlQo PvO/yVu0pAwaw4y5MleQ2j2Ypa+Oc6cdCocAVI1V4Tx7laP2EO+9AHubzTu+ObhAqhv6 IR/B+BnHmcPMBaZqHWttVIZ12R4idWY4Y30C9Hnr54dfB7Sxb074oXGI8NzAnRXWpoEC witeArBBHKUH5ezQ0C2n19lDOopzTS610vyT+NF3JXOhdvGqp+UliFkr4oRf74IFdM4y j+Vn4uHn8ZLyi10DoGZrGHsny8Be8M+ntHTnNGJuyaQNvoFOuoy2OgO0IYEkbxV7x8dU eqmg== X-Gm-Message-State: AC+VfDw2RrZizlzqrlYFyFZFcap1Cf+GLlmTrJuCG4lfMGA2Gvzdl+Dc JT2TJalddeIRwCnEu2fO6Yx0sA== X-Google-Smtp-Source: ACHHUZ6aONWgizquCWUsTUUGKe9U4KpOmnFPOkVeG5BswDJO7RYPB9Yzqn/YopkVlNO3qbBBfIC0Xw== X-Received: by 2002:a2e:2c06:0:b0:2aa:3cee:c174 with SMTP id s6-20020a2e2c06000000b002aa3ceec174mr850031ljs.13.1685449862632; Tue, 30 May 2023 05:31:02 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:31:02 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:50 +0200 Subject: [PATCH v4 16/17] media: venus: Use newly-introduced hfi_buffer_requirements accessors MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-16-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=4427; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3p066I2lbVJExmECv9lPxRruVYg9txAn+/VwsZP5cd8=; b=dpAdiAsFt2CgjQ2eCjzVBnLTj8EtENen/rrPzlUeooH5+q4l55ldzCiLUoYTOCoxWLbDWxIRm jPZxigrlsu1CGienpW1mUszCwz4/mt1cL0la8aRM7y/jExYxAucQr9E X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we have a way which is independent of the HFI version to set the correct fields in hfi_buffer_requirements, use it! Signed-off-by: Konrad Dybcio Reviewed-by: Dikshita Agarwal --- 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/pl= atform/qcom/venus/helpers.c index b70bd3dac4df..8295542e1a7c 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -668,6 +668,7 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u3= 2 type, struct hfi_buffer_requirements *req) { u32 ptype =3D HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS; + enum hfi_version ver =3D inst->core->res->hfi_version; union hfi_get_property hprop; unsigned int i; int ret; @@ -675,12 +676,12 @@ int venus_helper_get_bufreq(struct venus_inst *inst, = u32 type, memset(req, 0, sizeof(*req)); =20 if (type =3D=3D HFI_BUFFER_OUTPUT || type =3D=3D HFI_BUFFER_OUTPUT2) - req->count_min =3D inst->fw_min_cnt; + hfi_bufreq_set_count_min(req, ver, inst->fw_min_cnt); =20 ret =3D platform_get_bufreq(inst, type, req); if (!ret) { if (type =3D=3D HFI_BUFFER_OUTPUT || type =3D=3D HFI_BUFFER_OUTPUT2) - inst->fw_min_cnt =3D req->count_min; + inst->fw_min_cnt =3D hfi_bufreq_get_count_min(req, ver); return 0; } =20 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 e97ff8cf6d64..f5a655973c08 100644 --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c @@ -1215,24 +1215,24 @@ static int bufreq_dec(struct hfi_plat_buffers_param= s *params, u32 buftype, =20 out_min_count =3D output_buffer_count(VIDC_SESSION_TYPE_DEC, codec); /* Max of driver and FW count */ - out_min_count =3D max(out_min_count, bufreq->count_min); + out_min_count =3D max(out_min_count, hfi_bufreq_get_count_min(bufreq, ver= sion)); =20 bufreq->type =3D buftype; bufreq->region_size =3D 0; - bufreq->count_min =3D 1; bufreq->count_actual =3D 1; - bufreq->hold_count =3D 1; + hfi_bufreq_set_count_min(bufreq, version, 1); + hfi_bufreq_set_hold_count(bufreq, version, 1); bufreq->contiguous =3D 1; bufreq->alignment =3D 256; =20 if (buftype =3D=3D HFI_BUFFER_INPUT) { - bufreq->count_min =3D MIN_INPUT_BUFFERS; + hfi_bufreq_set_count_min(bufreq, version, MIN_INPUT_BUFFERS); bufreq->size =3D calculate_dec_input_frame_size(width, height, codec, max_mbs_per_frame, buffer_size_limit); } else if (buftype =3D=3D HFI_BUFFER_OUTPUT || buftype =3D=3D HFI_BUFFER_= OUTPUT2) { - bufreq->count_min =3D out_min_count; + hfi_bufreq_set_count_min(bufreq, version, out_min_count); bufreq->size =3D venus_helper_get_framesz_raw(params->hfi_color_fmt, out_width, out_height); @@ -1269,7 +1269,7 @@ static int bufreq_enc(struct hfi_plat_buffers_params = *params, u32 buftype, u32 work_mode =3D params->enc.work_mode; u32 rc_type =3D params->enc.rc_type; u32 num_vpp_pipes =3D params->num_vpp_pipes; - u32 num_ref; + u32 num_ref, count_min; =20 switch (codec) { case V4L2_PIX_FMT_H264: @@ -1289,21 +1289,21 @@ static int bufreq_enc(struct hfi_plat_buffers_param= s *params, u32 buftype, =20 bufreq->type =3D buftype; bufreq->region_size =3D 0; - bufreq->count_min =3D 1; bufreq->count_actual =3D 1; - bufreq->hold_count =3D 1; + hfi_bufreq_set_count_min(bufreq, version, 1); + hfi_bufreq_set_hold_count(bufreq, version, 1); bufreq->contiguous =3D 1; bufreq->alignment =3D 256; =20 if (buftype =3D=3D HFI_BUFFER_INPUT) { - bufreq->count_min =3D MIN_INPUT_BUFFERS; + hfi_bufreq_set_count_min(bufreq, version, MIN_INPUT_BUFFERS); bufreq->size =3D venus_helper_get_framesz_raw(params->hfi_color_fmt, width, height); } else if (buftype =3D=3D HFI_BUFFER_OUTPUT || buftype =3D=3D HFI_BUFFER_OUTPUT2) { - bufreq->count_min =3D - output_buffer_count(VIDC_SESSION_TYPE_ENC, codec); + count_min =3D output_buffer_count(VIDC_SESSION_TYPE_ENC, codec); + hfi_bufreq_set_count_min(bufreq, version, count_min); bufreq->size =3D calculate_enc_output_frame_size(width, height, rc_type); } else if (buftype =3D=3D HFI_BUFFER_INTERNAL_SCRATCH(version)) { --=20 2.40.1 From nobody Wed Sep 10 02:40:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BEF8C77B7A for ; Tue, 30 May 2023 12:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231994AbjE3MdQ (ORCPT ); Tue, 30 May 2023 08:33:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232001AbjE3Mcm (ORCPT ); Tue, 30 May 2023 08:32:42 -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 8028A10E7 for ; Tue, 30 May 2023 05:32:08 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2af2c7f2883so45882031fa.3 for ; Tue, 30 May 2023 05:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449864; x=1688041864; 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=473x+lqpzUfA2jtVVPxgqLYhChW/9qnAzMi0phiVfDU=; b=SbDg3Cb800/J9YKHr/9xr/So94j1gdK2pCQq2DpZwtW0XYNJzdyj3g+EeFYCuKOswg V5g0jjllzu2HJqYY0SRrnpBMVkKsess1Ix85hkjezHpB4EXgk5CuWhzYuDk5A9ovS+HQ INCMunxkw/qkfq3euvf7XnrI3JgXorAG6UYdxl0p3pPqYl+io5+JoB24t0JJLX0W6wou AEFX7VHeDctfIiLhMkzRYEmR4KlD9p4TAYpz8fKAQyiY6OvGqbNOS8djWboPNLJaukdA mj1DcJVsvifEBc2p7JppBBDnL+xWOXUgmd9wqs1TwzdG+xo8+2IGcQzS+Hrckkmzl5t+ XWag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449864; x=1688041864; 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=473x+lqpzUfA2jtVVPxgqLYhChW/9qnAzMi0phiVfDU=; b=ZjqG9VpXkXW7wan5xTnTD4OutddxJQ6i58boimH5zh3L3wd8FUi+vx1Hq814VYdwZS DKhMsCmL+iCvqPzL627/D9y8e7BWjFAIWec6dunNxB19LvZN+edaSabgvGY/5gif4s4z 0XSUU3mt+OkadEbGvaqKShK71u/eaHLujIIteclW7Wwpwj0WXeeKdYYRsTfo1NRZcqYk zavhiYujBxAPX7JELfY4hEkDY53GbepDL5z+w0SQMmxBUBMksKQ5cUJZENFkTbz4n0jh W+F5HTdB4ibLuLhe0kzRXHF8lhKy2+WUS4SJRfoM1N5vfs/1q2SOr5j1CODTU61rrFnW RIQQ== X-Gm-Message-State: AC+VfDyZM+HpC5BeeXq0D2iQzWFPWmoJgMqZF7VzDFnIS1/A63yw75nM jCDjXd+k4NKdZadoYfYgwGweBA== X-Google-Smtp-Source: ACHHUZ7/QXbo3yHpNDSE14vxr/l3CfeUgwZfQCqZydr5pHp063/LWEiSvqmesyK56npYxU0ALEC2dw== X-Received: by 2002:a2e:93d5:0:b0:2ac:5905:eff9 with SMTP id p21-20020a2e93d5000000b002ac5905eff9mr690143ljh.6.1685449863993; Tue, 30 May 2023 05:31:03 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:31:03 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:51 +0200 Subject: [PATCH v4 17/17] media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v4-17-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1033; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=oNIm1Wj0FhsO3S/n6eYL1/VajszUoAmbnQl8ZF5tL0I=; b=EE9MNWA8F4kINCga1/UXPCIhBDawDBerb3GjKdXmHwemGRPPenW+uzKGjJDlutvnjbhxRuBrL n2qOIG5TDzJBQ2xwNRHxcaDBE2ggs1hhafCeMzDCs4pTESJoU7Dx3gQ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This write was last present on msm-3.10, which means before HFI3XX platforms were introduced. Guard it with an appropriate if condition. Does not seem to have any adverse effects on at least SM8250. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 82854553f99e..19fc6575a489 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 *hde= v) } =20 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); =20 writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); while (!ctrl_status && count < max_tries) { --=20 2.40.1