From nobody Sun Feb 8 14:33:37 2026 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 CF5ADC7EE22 for ; Thu, 4 May 2023 08:01:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbjEDIBh (ORCPT ); Thu, 4 May 2023 04:01:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjEDIBa (ORCPT ); Thu, 4 May 2023 04:01:30 -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 34BE819B7 for ; Thu, 4 May 2023 01:01:29 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f13ef4ad91so178888e87.3 for ; Thu, 04 May 2023 01:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187287; x=1685779287; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=708w9bx/Wu04zRxH+k1/smuWapQNc4JobQVr0bsQL/8=; b=OGR0tw0cEPJ5IWTGefJN3lh+ujc/nM4fchGGHuc04tW3JNrfrS77NsIXQGeFOKG1hF EUKXnKwxtzC+3qFTqNPiW00PTDig9FhjZTlFqJASN+jpCbXv1W0itvU9M82lEqtFd6DL jNJf8YtAvUIxDbC5csuTCl8CxNFmlDhSeGOmxvWhrkPv0JLJoL74Oci2/sHwDj+9ScCj tZgKEKBD0MffKm3wmMhMlt/wFo5oJZ86vXX4sso4WBrJgS4AeA+fi0IAKyxbm2xMsb48 2dEeN9g/QZzsdNjrEc6aO+R2guU5aCvcYIAOJ93h8cQdLIrUyqyTxwJBaEd/qhzZqUwL Kjwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187287; x=1685779287; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=708w9bx/Wu04zRxH+k1/smuWapQNc4JobQVr0bsQL/8=; b=B4U3MD5ukOLikxaMIg7wNaLQuFBiXRIuEWBhaibZa3ZRlukii71uTwjiyte74T0dl5 BaiwG2cbCdJ8K79YKJJ0FqwwlmKTVcltpwhYESVrotFvQrP8t7Ida8sA7qSbvkJFltHZ 7qaqrbteqzPqSxECGFv8Yy6XjBVn8fxzd6KNaNIIMn+Ld5OA0tgusr07YbPqZZGoEnYd P0PBELkUvQKU8BxfC1iT90Tz93NV9hqpR5XSsPIdbMiUht3bsksPXtrOse4yc+4wxtJn /BGYHOY16c/vdQXmsOf60VcEqovQ2//UTP4ttO598b2bjMS54GFVOt8LCabVBnMTPFbI B68A== X-Gm-Message-State: AC+VfDzomfTHrpbRVIhk9cH1F5xs2m255uesn6zuQEN9M01lYMw1cxtw oFbq593eE5uPmQ5slMZrpWPqVQ== X-Google-Smtp-Source: ACHHUZ6xPL1r6L+pLfcqK3QNzpyNbP9lYB+h9l7o6PVl0pwNOc0N4aZkHTFIwz8mAeFF8xzoK4cakA== X-Received: by 2002:ac2:42ca:0:b0:4ec:8853:136 with SMTP id n10-20020ac242ca000000b004ec88530136mr1300300lfl.12.1683187287469; Thu, 04 May 2023 01:01:27 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:27 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:00:57 +0200 Subject: [PATCH v2 01/18] 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-v2-1-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=2458; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=LQtQ1yE07Bg59BEEMI3NIlj9dkGtgWhznhuEDogV/mw=; b=Kws3buj9gak4YkC02btsKAwvOm9JWfGiV7pvaPoDuS0Xql4ESb80+IRE7Gica1xethqYxktGt ixyW96vm1WpDAjk47aOSfERSfhh6F+OY4cCW+lyjeIxcYcv5o7x853N 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 Tested-by here, I think we should define a set of coverage tests, run=20 --- drivers/media/platform/qcom/venus/hfi_venus.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/= platform/qcom/venus/hfi_venus.c index 2ad40b3945b0..bff435abd59b 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -131,7 +131,6 @@ struct venus_hfi_device { =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; @@ -947,17 +946,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 Sun Feb 8 14:33:37 2026 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 B6229C7EE29 for ; Thu, 4 May 2023 08:01:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbjEDIBq (ORCPT ); Thu, 4 May 2023 04:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjEDIBd (ORCPT ); Thu, 4 May 2023 04:01:33 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC5A09D for ; Thu, 4 May 2023 01:01:30 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4ecb137af7eso176216e87.2 for ; Thu, 04 May 2023 01:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187289; x=1685779289; 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=wx5dYQRwBkTI+vIENabmZFidu+UG6bsoT2w/E9azkMk=; b=Ms5+Av3job8E1NirdFNKWCSJStO92kIfaxqw+VlDjqCaZhN/Efha3zMGCWN79gHpm6 AYoNhZnRWQ9mpboNWew9+7ajEw1d4K/Xe6khT7s1u3m7cb81rm8QRb1qyBClKM4Bwdvk XF1fy4+eiM9SKrtyWY7+hv1TyqVZhuSlHj7dsbVOcvP62ynjzhKFPx48lhLRjMvjiArs PM3nsodeZfLfyymZbj+LVVubsodwoxVLtg/5F2SC9T4T7WA2AP7NdrmgNRgFB+1Sc2zG p1GH22purCn1XKxIjU8l01PR8N/5xVG6bmsVO8uLsN0D/11cQ/5JBPi4rUk2bQePDbFp v9ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187289; x=1685779289; 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=wx5dYQRwBkTI+vIENabmZFidu+UG6bsoT2w/E9azkMk=; b=A6BCRKcK3FDITnwAMy7xWjM5DFpVswvH3JxY8GQ6mNGdo9F6S671vqWivbOg6+rTpy q1R8ynEB2eXX+I5PCDgdjOynyPGjcPt+NPXOlAKs7JeLlHhH7mwNE3n8QhIFxqlqVajz YCxT9jLPFRud3NEGiPcG0zcGrgzIP9VTFTFtitz9DaaSV2Ld/UIQ6LCSRtNol4VIINpt jPviFMg5j/ymrAWoDPbblDTEZwC/nqureYy4ihXR3Uvxh+hZvTECv3fG+zUpicx8BaYe NdrJ04JLkHhNHNsPiojZV07/dx9soGCMEI9ToP4q5aWaxjwewMPo8QZB+6qjOL4Jr4oC RkeQ== X-Gm-Message-State: AC+VfDwEQq5NhKdvY3f8hZvzz5U6K/N/fjukMuPjLPt/HHatL+O/DTh4 irbRBSFQ1g0bJeilvryNtfkvvQ== X-Google-Smtp-Source: ACHHUZ6CyMNlAZTEzik9cGKDzfRA1RlhDbXEVY0QlyDTBymjy/GmJD7hBMdMn0kMtxJXRttKUIbCgw== X-Received: by 2002:ac2:5237:0:b0:4ef:d573:c8a7 with SMTP id i23-20020ac25237000000b004efd573c8a7mr1613614lfl.32.1683187289004; Thu, 04 May 2023 01:01:29 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:28 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:00:58 +0200 Subject: [PATCH v2 02/18] 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-v2-2-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1480; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=0Uv5fE0exjmqzKoKkMe6XjqGKp8vRm4Af+NoaiadWoA=; b=p8XdYya25TcMY0FfaMTCVG6sx7I3fHtL6U+tbVXguByuFj0SbJNHB2/NIZMhEKfLrj5xnCFBx cYuHLgF7x4LD9tjzFro39MJA/tVrZd6hjnrRRYtXA4l4c3Km44/4ybo 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 downstream driver signals the hardware to be enabled only after the interrupts are unmasked, which... makes sense. Follow suit. Cc: stable@vger.kernel.org # v4.12+ Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Konrad Dybcio Tested-by here, I think we should define a set of coverage tests, run=20 --- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/= platform/qcom/venus/hfi_venus.c index bff435abd59b..8fc8f46dc390 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *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 Sun Feb 8 14:33:37 2026 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 25A31C77B78 for ; Thu, 4 May 2023 08:01:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbjEDIBu (ORCPT ); Thu, 4 May 2023 04:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbjEDIBe (ORCPT ); Thu, 4 May 2023 04:01:34 -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 3E9D53C19 for ; Thu, 4 May 2023 01:01:32 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ac78bb48eeso2064061fa.1 for ; Thu, 04 May 2023 01:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187290; x=1685779290; 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=C1wrHdE9iKrmB/WxNypIy4J2UJNGNaaQcU0qAUemPII=; b=WDHW2yNAhW01kMfJX7yGsyy6Gm+EE6cCAyf/9TIZh/Xbpz6NeleG58b44v9i/qahSH EAs8+5YKk3uDuzqKIaNKUciaZ7kbWStZMrVSsK3t1IMJ86+PZGfrqNfJ8Ha/uP2O6CoE 3kVdb/6t4Mhaq0ippPDLk+I7PXd5NfJ6AzHy5jvkgSk5gC0+3zsOY44DlPi0W0BjGf7B gsCAoWrwF+kqT5H2mroGxqsnJ4Y+HI1WYWBCJD6c34ATI3Drqx4KscXdGSqn+iO0MK3b TEnwILA4FXpR5Dr5pyNomkfuYmBShqEbSjsmqUbjiFATvdZE/VGg51cWp1R/HAKIKyrw 8z7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187290; x=1685779290; 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=C1wrHdE9iKrmB/WxNypIy4J2UJNGNaaQcU0qAUemPII=; b=kfA9LZigX+ljTHOOvRQP/LYONxuwRgIWdPMkeJHNrMoXxTMb2uswF01W2mxbBqeLLw tkNMElEZI/qGe3R2ClXENzin2k62J/vQX4or9gYsfFfCvHR0oZMyCc6ANUT2+e+G3I5Z 4dr9vyrKOp5usj8HjYQ5nRi+2mCsKv/z2jKlwig9rRiVKec9U26MjPLpboQ9O/UBTTyo a/L3xJI5RI9Lsec1DWh1GXzgl3h73D7eyaoS0VqlXMl1S5EZrSOAkH2knHoVFu5B9aV9 k7db8XwlDCccTxn0PEUDUXEYT/vfOpZuVyDk6CYA/8dEx9+N2fO4mzg8jzjYCMtq9vzp qwog== X-Gm-Message-State: AC+VfDzUVWt0S9dmhuNx5bTAWDcGLf6eprOhdve25fTh7KISq7Hbbiv/ XHVuuppa2jeDkkL0x96k6cM3ow== X-Google-Smtp-Source: ACHHUZ7AGjDXW8IJKxCiGE93VGJ9cDvW8UI3O+wuSm+ZqEPQzLp2QbdQzxnJsJrVCD2pYXeYbbBnFw== X-Received: by 2002:a05:651c:201:b0:2a8:e4d3:11e2 with SMTP id y1-20020a05651c020100b002a8e4d311e2mr711499ljn.39.1683187290499; Thu, 04 May 2023 01:01:30 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:30 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:00:59 +0200 Subject: [PATCH v2 03/18] media: venus: Remap bufreq fields on HFI6XX MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v2-3-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1455; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Y7O3kXJUMALOc0Q0JhoHuikwOvvLDtLGeWfKw337F/E=; b=jCZB3nnLtzrwBc/9nUK3HW69Wl7+UodaZZct6VGWvDO/jIlFm2QK2OjGO7+uIAfMRHFqyHcBt DsDW6iF+tIQDZ5vspOGLVJfq/1AzMQT9Pm7VLtQPpb7Nd3CdmnqIeSo 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 Similarly to HFI4XX, the fields are remapped on 6XX as well. Fix it. Cc: stable@vger.kernel.org # v5.12+ Fixes: 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing I= S_V4() if locations") Signed-off-by: Konrad Dybcio Tested-by here, I think we should define a set of coverage tests, run=20 --- drivers/media/platform/qcom/venus/hfi_helper.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media= /platform/qcom/venus/hfi_helper.h index 105792a68060..e0c8f15644df 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1170,11 +1170,14 @@ struct hfi_buffer_display_hold_count_actual { =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) + ((ver) =3D=3D HFI_VERSION_4XX || (ver) =3D=3D HFI_VERSION_6XX \ + ? 0 : (bufreq)->hold_count) #define HFI_BUFREQ_COUNT_MIN(bufreq, ver) \ - ((ver) =3D=3D HFI_VERSION_4XX ? (bufreq)->hold_count : (bufreq)->count_mi= n) + ((ver) =3D=3D HFI_VERSION_4XX || (ver) =3D=3D HFI_VERSION_6XX \ + ? (bufreq)->hold_count : (bufreq)->count_min) #define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver) \ - ((ver) =3D=3D HFI_VERSION_4XX ? (bufreq)->count_min : 0) + ((ver) =3D=3D HFI_VERSION_4XX || (ver) =3D=3D HFI_VERSION_6XX \ + ? (bufreq)->count_min : 0) =20 struct hfi_buffer_requirements { u32 type; --=20 2.40.1 From nobody Sun Feb 8 14:33:37 2026 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 AAA30C7EE21 for ; Thu, 4 May 2023 08:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230151AbjEDIB7 (ORCPT ); Thu, 4 May 2023 04:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbjEDIBi (ORCPT ); Thu, 4 May 2023 04:01:38 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9AD740C2 for ; Thu, 4 May 2023 01:01:33 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2a8b082d6feso1982521fa.2 for ; Thu, 04 May 2023 01:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187292; x=1685779292; 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=yzxlUp4GevQo4zepiewLcHPe74bB2xBOAHPwd2eLqVk=; b=WSR6igftGzl/n19F+ivPAwwjgS3NkuZOc0nOXB79LVGDUnvoLSnGzoAFvyL+GiK8yT bHUjsRKYbkyos6N1khLh2385eoKbTQkXz8sIVOAdjc64AnUyaAagPBZvnjhlZXRdhO5o us8bEIlvvFJTYHPq3XUOAv0FbFsggaElghw4O/AjLagT3Ns6e4ciGm9NSp091ombSTnt Pn8BXrVi1dG4BQylgQw7RedOcSQuZhiMDaMR17pT1TuDC2evWcdbMel4nnULgG8vjhqR Vxk2WCkN8L++KB8RqldXIg3Tf4PWmiYu+NvmwYQI52TH7PEkWuQz3ziONVoLnYWx1Xsj +6ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187292; x=1685779292; 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=yzxlUp4GevQo4zepiewLcHPe74bB2xBOAHPwd2eLqVk=; b=SHSsn3r+UvXIqaVKYFr2ohKB2WIzDoTZnh8IdAdhCFM4X/28dPxYyGPzWWz/uNFfe0 O/809EwuhyfuLRh0+ZbkI75LRfhqO+HO1FKb8em/XHKFdfpHEGhDcd8G/B7wOBpGsAx1 jtOPKS01zeF+1xZtkrVbMByI9exWJyFj7oMFbVwQ6L2JtCmrcPKYg4PNCVfrN+49ClkX F3RShOgOE/v4k+QjBXCDmF4RG1SaY9p0hM7M2AN+a0nKkT7yMVVD+qQG8LS59BZy2h9I IOTqw215rJ4mUbXJlITqyk+a1ZTky8F2NVgC1j2+QxhptIj8AXj/XPROaV7Sre7jM70a Begw== X-Gm-Message-State: AC+VfDz2qtUeFg+Vxmvflt16BjKvhJboAea7xaBaJCx1ExfNfhEEhjg/ aWDUVC4dX7t2lsLHYyi3bDlMgQ== X-Google-Smtp-Source: ACHHUZ4ckv52wOwgtQLC+dHGPcaSmZPAvrQ3dT8+o9kSVCyvPl9JapLOsXVHo6Zw0GaVPlStbmb7ag== X-Received: by 2002:ac2:5237:0:b0:4ef:d573:c8a7 with SMTP id i23-20020ac25237000000b004efd573c8a7mr1613683lfl.32.1683187291973; Thu, 04 May 2023 01:01:31 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:31 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:00 +0200 Subject: [PATCH v2 04/18] 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-v2-4-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1983; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=HzABoJBacsfN8IA/HbPbvHnBAN4Alo5yV3JV9j0U0iY=; b=To1WkTJnLXLSw48ogxPQ3YmXryfFfCKO+6KFtrPSzA1dHUlfBUkToGVGYWYr3k2ukttZB02Xr uGbPA5Ykh1iDKVnYx3VRe/HTccaQkmQUyQhwXfQV32XRNScUzchS/kB 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 we should decide which code paths to take in hw init. Up until now, we've relied on HFI versions, 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. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 4f81669986ba..62c310b7dee6 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -48,6 +48,14 @@ struct bw_tbl { u32 peak_10bit; }; =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; @@ -481,6 +490,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 Sun Feb 8 14:33:37 2026 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 5A03BC7EE21 for ; Thu, 4 May 2023 08:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229941AbjEDIBy (ORCPT ); Thu, 4 May 2023 04:01:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjEDIBi (ORCPT ); Thu, 4 May 2023 04:01:38 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AB4D40CA for ; Thu, 4 May 2023 01:01:34 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ac80fe9facso1096691fa.3 for ; Thu, 04 May 2023 01:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187293; x=1685779293; 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=BDmBIF6Y44gX79pnQMyT5DRSZ/9AxwD6dwqNk+EZPk8=; b=MHbqK33JgS0axtQcdvgU9TcYSWkAhYQCWUCF/YZDTSgIqlPNHwNHP2i1PbcGRFDedG jTxV7Kdbuu82B9anxCuDCw9Ft/B2liBnx73kIFdoG72sVUnuoEcDhmYJCo91us2cmJF3 6rQzYhlym1+rOK5YQoUff7mqpWzBbqmWwjOptc1uGUj1kpJ2jpZNxkvsGHNspAj4rQYZ pCypFUQEln6itSexDK1cyQ2BjWg9i+CbZdRoM3dYH2KI3+qBfminxpFZM0VnllumYj0m lIvpq9Gzp4IzznTmNlU0HYfJWtMRYM7sKDnvQtjcQcOdmgnpXFHlY6RD12vL80qEjyWS Y1wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187293; x=1685779293; 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=BDmBIF6Y44gX79pnQMyT5DRSZ/9AxwD6dwqNk+EZPk8=; b=UJusLeHfCIauTNBmHIeQm33iDiu4VxI/iHdFtvrTs9ASGhs/KqPPIqLwvhKAMwDplu EE1pOGnnoxC3wAn7603+q7W5NLA+bbsfVlM76simEyy5xSP0PdpGhz2VtP2bAx9ssnGk ExWJc98VCFh4cWC9ZFns/8POvcWSXvKJNMhOAilhgT5jh20mvaZOGze6DT8jfYSd69js HS3yhGmKBeiDATFX7ZKdUfsuHSjRM1DvBhoyIKHP/aFSJEj6AoToQbmOtXRxndnuh81g VtBaaikVf6ugUAR5y6zrWBY+gDH1Du+AhEC+Lk8HfjwLIyDVSJK/oyKnMWNSJakl3XTr hAcg== X-Gm-Message-State: AC+VfDzmipO+uniaN3L6RpCZG7oQi8m/0xb31SPqRLZk2TGmQSwxr3Om JCvpAip8kYId1rBQC69UqHZMqA== X-Google-Smtp-Source: ACHHUZ76Tv+u6xmHCKSd01Dh7EVcTXoRDPpvwVq/ExtPhxsabNqIj67Odz+oL/j/63fOAAg44debuA== X-Received: by 2002:ac2:4943:0:b0:4f0:1149:c875 with SMTP id o3-20020ac24943000000b004f01149c875mr1538841lfi.31.1683187293566; Thu, 04 May 2023 01:01:33 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:33 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:01 +0200 Subject: [PATCH v2 05/18] 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-v2-5-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1998; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=s9xCNGDsq440Iu3/b5ZyYc59czGdU6SE4WtTXaMHwdU=; b=AQ1D0N86iXcaboS6CgN7GlpWPksHa7YyngiCZKPd6Wmzjnx8oNjO1ikfZCU+quDMrdSyjRZZv P7OIfelt13eC2W9ifDF7jg+ZKaeQ1mDSxe2hGijjafDJtLQ4a9JeZLh 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 Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 Sun Feb 8 14:33:37 2026 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 4C58BC7EE21 for ; Thu, 4 May 2023 08:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230165AbjEDICC (ORCPT ); Thu, 4 May 2023 04:02:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbjEDIBk (ORCPT ); Thu, 4 May 2023 04:01:40 -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 D1C863ABF for ; Thu, 4 May 2023 01:01:36 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4eff50911bfso178773e87.2 for ; Thu, 04 May 2023 01:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187295; x=1685779295; 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=pHuJqh6clnMhDFgSRdYKRfsY4OFox3kTZVS9qASymWE=; b=zUipfNWaazL6ADynZcrfI01DUbRNogvA6LUhNvy2poxcQQzU2Jpsb0ktYJC/nSpVFf DkqZSLSzujw/tun5InCQmu35+nV9qnAWVgoGQlOzqQqBMgpw//jzw2E/3xRqDvQ0W91y KaEuNlbZYNYmCO+QChSO4QTI36SicJPWc33Z01H57/lVqzQNH90zBipn4cfencFclMqz KkhcRtp4zyHBFgl3MlqCvU5dvDQ9C8rrbPMR7aHzZaUvUhg48RwhHcK5CcYfG3UdvHuY FNyXAMDHDisRWW2jQifShPgdk61CGuq17aL9bRnNk1V5QX8nlnvsBPlzJ+gJtH80ixOz wPwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187295; x=1685779295; 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=pHuJqh6clnMhDFgSRdYKRfsY4OFox3kTZVS9qASymWE=; b=Np79NfvvFN9O/0PWzeCpwRfSg49xNAhlBWANbs/mQn5U2ue24A8kuLi3k2d2mHkWIF 412MgPV0o36VtSENA8heuh8Wo+lQaLgmGGKZHe+itWxLgvcluTruifri/L8YauwPRWKP CZdNo3b18MSd+U7XgI8kG7jqXuFR3hINkA5eZGzs1rOp7n2EIq4qC8bDJueel2g6Qs9b M2dBQuGwYGOKcJSawByeiGTIhLEPxzDw9oJWvd/QTfECkUW/nsuz7Oh0feQjMInSG3t4 c95imSaikHeGl8ocye2uVDg5zdrDPZcA9MhUCEcAuqf9Rztpm3tGG0pC9cO0KBly43hY MBsg== X-Gm-Message-State: AC+VfDzoR6UMkL8eYjl+G1m7OcdBnjV4m7WADj27HrjymGwJcvVHV35N SJDUY67gkLY28fmJ92zO0RuzkA== X-Google-Smtp-Source: ACHHUZ4jXpNAXiNQ+8fkcQL4xLCnog3hMv3MDLsB0HYPtmUb77QHwSrtkX4hvj4cHiv5ONLcRZrciA== X-Received: by 2002:a19:7503:0:b0:4f0:4b:538f with SMTP id y3-20020a197503000000b004f0004b538fmr1601126lfe.29.1683187295132; Thu, 04 May 2023 01:01:35 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:34 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:02 +0200 Subject: [PATCH v2 06/18] media: venus: firmware: Leave a clue for homegrown porters MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v2-6-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1135; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=EgjRQOY12/YgIbWH62eZ5y8nBX3H3pJik8G0F4SYRFY=; b=nQEw2k9F74MAxmf470Mil8wFjXEeWKtb4BAhs5r6xj+O8SHhrmSmWKpItUFOnSd0pmnBcqWBf EfAAgrecd0rDMOpthvvcK/aABUI8hm23nzqEXoXqbALT36JM+Qmn8SL 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 Leave a clue about where the seemingly magic values come from, as it is not obvious and requires some digging downstream.. Reviewed-by: Dikshita Agarwal Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia Tested-by here, I think we should define a set of coverage tests, run=20 --- drivers/media/platform/qcom/venus/firmware.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/p= latform/qcom/venus/firmware.c index cfb11c551167..a4cd919e1dbe 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -241,6 +241,13 @@ 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, addr not size) + * 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 Sun Feb 8 14:33:37 2026 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 35C0AC7EE21 for ; Thu, 4 May 2023 08:02:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230084AbjEDICU (ORCPT ); Thu, 4 May 2023 04:02:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbjEDIBl (ORCPT ); Thu, 4 May 2023 04:01:41 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5A4240D9 for ; Thu, 4 May 2023 01:01:37 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f1394cb0d1so175008e87.3 for ; Thu, 04 May 2023 01:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187297; x=1685779297; 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=PaAO6KbucUD7sHLqAUICCg61yVdFTkFkYPZOacYDIUA=; b=YWeqp4eIilP1QTmr9LlCR+XFh3h3RwZBNg5GrOa6+n2wSitL7fNb6un47ABP5pOMNP l9bc4Z0eg4If7ffQ5viyJTDrmfU7j/SwxH9hCwRZMJdjZZnqGRoHZKEkI4Tj4pziN3AU CWl4mQJUHJxDUqT9plBZ5V5NFMrSlo5vTq/0Z8R2EnqtO3lBGk/atYmsAT8mzn9rpwOR z75CgJlCX0pql/9uw4X5BxWgptsA3axkYUCtHO9yZDFXJhgbqA00OyntjWrBcP7wKxuH QM13MJy8Er0UV4o0IbFy4Sw3A8yK0kJwBo00tH1eNEfAqzG1j6+8WkI6MQXvN8/6cTbM kkMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187297; x=1685779297; 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=PaAO6KbucUD7sHLqAUICCg61yVdFTkFkYPZOacYDIUA=; b=i58F0Iz3eu6I5xNqBdR46t/HMugyg4co/4qQHH6tU4zN+wT0vu+0QNWSNLYRkkzzvP VyGepy7NIznlVldepFwmZP23Jm1ppbyY8+fvgYPCs+YeePaYJvnyX9VmW1G+lRoiCosP Tos/cuKFs39fKThzRDp2QbbrelIP/BSSw1cs1JiqZmZ02hHLtD2//K3rqm07hbw2PTvx FfH0Roy88Ap7ptjLqh+XBC7GzET0f73EJJ3v/ZBnE1bCpfQm1mcjkOXZpbEOfozYZEAp Uw+YLQHyfwstP1XAyrPXbZgYMhYJOW2bPLN89jK0cq8Z9KhUHH6gEs0pya2ujAR3UhQT B7Ig== X-Gm-Message-State: AC+VfDzL1/V2PHt8M/FVoahE0WLHO2lYy1UWKK/9WI0/aD3rx2o4wtc2 c0Z9tc9nTGQwi19AKIDXHtMo+g== X-Google-Smtp-Source: ACHHUZ69PmJuZEEsn/7Rao4cWdVRqYPLQ+gr+DPp0icoV/BNUsb++4UpSyuhJyrWdiN6ylRL46IW5A== X-Received: by 2002:ac2:5551:0:b0:4ec:85f6:5bf4 with SMTP id l17-20020ac25551000000b004ec85f65bf4mr1560630lfk.67.1683187297204; Thu, 04 May 2023 01:01:37 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:36 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:03 +0200 Subject: [PATCH v2 07/18] 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-v2-7-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1840; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jgU7eoLOdocZ2/cCE0wfh1hS/YMFv/9bQw2DJ7khniY=; b=rkj9z6gxfeKGh/ipIT6gpC8Zndl9khftLdh9zsxLYTn3gIX2EfNqR3vjS9w7D4yFoUzHe/ewq vWfYg/7gh4uB37EtSzzr325y6WxIgn4XLTvdbNyRTrgJ/txsIqG8841 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 Tested-by here, I think we should define a set of coverage tests, run=20 --- drivers/media/platform/qcom/venus/hfi_venus.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/= platform/qcom/venus/hfi_venus.c index 8fc8f46dc390..9b840440a115 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_IRIS1(hdev->core) || 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,10 +480,11 @@ static int venus_boot_core(struct venus_hfi_device *h= dev) if (count >=3D max_tries) ret =3D -ETIMEDOUT; =20 - if (IS_V6(hdev->core)) { + if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->= core)) writel(0x1, cpu_cs_base + CPU_CS_H2XSOFTINTEN_V6); + + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); - } =20 return ret; } --=20 2.40.1 From nobody Sun Feb 8 14:33:37 2026 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 A2757C77B78 for ; Thu, 4 May 2023 08:02:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230191AbjEDICX (ORCPT ); Thu, 4 May 2023 04:02:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbjEDIBu (ORCPT ); Thu, 4 May 2023 04:01:50 -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 BBAE840E4 for ; Thu, 4 May 2023 01:01:40 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f00d41df22so8585511e87.1 for ; Thu, 04 May 2023 01:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187299; x=1685779299; 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=tGZfzDtDtbp7luOgtk5iRa02ZQGrQVsSDa0gZJuVtLo=; b=w3BJtmBXcJXJRwjtG4nutFaMmClGQ4CYwe0KrY7MKGyHrO0K94hQvAEEMr6d1UtzOM /pvVqwMW+xZKloMnDFFFp8USqSH1UTzKwS0LRXKeQDJvAklxiHDFjsgKGngrCc+TfpUa cXCayqpjXo7RwJ4Bh+h3XqzklV7gvVoEHUv5IDyLfYzTXUa4ZST3t1QjjUN3ZzlVmdKq H+Ow9hEBZFbsdJtFiqui1t9QFksbbufSlnYd1Slqy5h2f0vkViO5/4FcOt7rom/toOMq tSbklD81Wb39+TBVQs6hF/7qy7fGyjC+pGbB3X0fI6IthV57ejmjkG0zf97dFO5frJUd C9WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187299; x=1685779299; 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=tGZfzDtDtbp7luOgtk5iRa02ZQGrQVsSDa0gZJuVtLo=; b=deqAYcQEXOFD/lHBtYfXL6qB8oLzc30MVDbKbrhAO5gBmC2DCI7rrduLrigDPtfRpv pdz0F89wO73f/nJB5MyO7DmTqQXba2x8vA9RKFta3SWXC5ACE44D5iV2ArEZe1Okgt86 3N535Xihlt32IIbvT9pifNf3r68klBxeK5gzVqpYayi6KZVRn2oxt9tI44Oed9w6K//c I9gP88mEmc0n88UjnpnPzjUAB/t3riKF2wBU3m+NVx8e6T57oDxMtCH9kLssuydmdp9b 5Mq2NG2tRqpb9KV2bkz3IRgVQyJlzE1XmtHipGonz4gnb9nF2oZNNJWeU5dyi8OpNAKf 27JA== X-Gm-Message-State: AC+VfDwvbaNq05WCjVrJHMLQ38VlObd4kS60zKH7ZfrhYE66CTMxLSU8 3L5hnxtcWeJk6lcQb9QCBK6bIA== X-Google-Smtp-Source: ACHHUZ4SgSbZzRe+Cbjm53ZX1wv37cfpnxLas5HwxtmwYK+qMBrQ//pZ87lVL6eLlSNm18gnE/VEKg== X-Received: by 2002:ac2:5690:0:b0:4f1:4074:b4fd with SMTP id 16-20020ac25690000000b004f14074b4fdmr491615lfr.29.1683187298830; Thu, 04 May 2023 01:01:38 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:38 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:04 +0200 Subject: [PATCH v2 08/18] 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-v2-8-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1460; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=m2Osp2Xf2pUATOq+7urWFmKXQd2Ed5bGWf9T651mWII=; b=1Tkmqz2YbLpV0808lxCYKvHKCyO6BlreCh4HSpHw5yOUcSKTUVoZOggBR2sMnjj3Pjnsrc9zG 2L32SF9lguJD1MZ7utfeL6JvH66cU0YdtMYj8QTo09aWzIA0og6EwmZ 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 IRIS2(_1) has a different register map compared to other HFI6XX- using VPUs. AR50L uses the same offsets, but doesn't feature vbif_base and aon_base. Take care of it. Signed-off-by: Konrad Dybcio Tested-by here, I think we should define a set of coverage tests, run=20 --- drivers/media/platform/qcom/venus/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platf= orm/qcom/venus/core.c index 01671dd23888..51cead91571d 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -246,14 +246,14 @@ static int venus_enumerate_codecs(struct venus_core *= core, u32 type) =20 static void venus_assign_register_offsets(struct venus_core *core) { - if (IS_V6(core)) { - core->vbif_base =3D core->base + VBIF_BASE; + if (IS_AR50_LITE(core) || IS_IRIS2(core) || IS_IRIS2_1(core)) { + core->vbif_base =3D IS_AR50_LITE(core) ? NULL : core->base + VBIF_BASE; core->cpu_base =3D core->base + CPU_BASE_V6; core->cpu_cs_base =3D core->base + CPU_CS_BASE_V6; core->cpu_ic_base =3D core->base + CPU_IC_BASE_V6; core->wrapper_base =3D core->base + WRAPPER_BASE_V6; core->wrapper_tz_base =3D core->base + WRAPPER_TZ_BASE_V6; - core->aon_base =3D core->base + AON_BASE_V6; + core->aon_base =3D IS_AR50_LITE(core) ? NULL : core->base + AON_BASE_V6; } else { core->vbif_base =3D core->base + VBIF_BASE; core->cpu_base =3D core->base + CPU_BASE; --=20 2.40.1 From nobody Sun Feb 8 14:33:37 2026 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 3C7E4C77B78 for ; Thu, 4 May 2023 08:02:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230105AbjEDICb (ORCPT ); Thu, 4 May 2023 04:02:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbjEDIBx (ORCPT ); Thu, 4 May 2023 04:01:53 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F22AC4207 for ; Thu, 4 May 2023 01:01:42 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4ec9c7c6986so183380e87.0 for ; Thu, 04 May 2023 01:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187300; x=1685779300; 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=wLWIf5AJktVcUGdZu7o/1TfCD4Dmn96OdaFzmDBQ/Dg=; b=Df4dlbvM8+/gwDtSxIjKjpEqaBK/y7rpL+azsxYVWnzuOrMjoh0Y1FMB8YH+n/oFvH b0Gy78TbyzYk2LC1Z8WPG0uilaC8GTcumgrVDL9BtoPF6NDun47JEvQ96OXWs21FtMQ8 ckWrvgncWcAV2VOcPK7NosS6acZ5nCFSHLB1JjKPcV0QCxDlIc+8h422QmDeTwRj7MJz 9TuCK3lfNkA2hepVj0oLa1ILq5+h2S2GPSaOMq9zUJa4bBI53bc62W71twV/ycGhMyS/ eKIvB+K/D0KGBGG6dw4nubBlG+YwI1IubyQt0vd+184diUsJ+cVuNssLy/oMD+bG2P1L aZ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187300; x=1685779300; 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=wLWIf5AJktVcUGdZu7o/1TfCD4Dmn96OdaFzmDBQ/Dg=; b=foBcHoWYWaH5/iNo5MrgONGhQKVDirqqOxWtj0hybNepa0r/c23S9UA/8sIFosZYXl UKtkBaGZWiNd8snnDC20Iq99EhA9qafqYHi+79gaJ2c4y6p6WvFS8mjO4hsXtbY6Pyg/ GDDPX8KQ/yyoZxSiFK90gXnMiod3QY3pwhl/qj9f0YrY8bpXGYZ4J0np4kOoZg5RmoLJ f1gncuYLJOpEfdJfFiw3b9Rib29USIy4ITirD6Ccb+7K1YPrhE6ijyXXxDMcIf6Wt+jp lmQIpXY6utk4SrfgGKG7oownrqBr2s6ZPNQuC0K21wuCKviPh9e10A8Vg+fTGQ3wjKTX P6Ig== X-Gm-Message-State: AC+VfDwsbQOaVGMIPbJhxiGDu+1f6jp/PPGqkFHzdiBgOpFawXOeBcUa d+qj2CP9xZbpy8NxLcJkEzNpIQ== X-Google-Smtp-Source: ACHHUZ6Ik23hnDj0QNZILPmdNF9TUFNthX8A5QSCFTIe4MaH/AB9MPD8spGlukcP2XF8Z0xKxEeYPA== X-Received: by 2002:a19:7417:0:b0:4eb:c12:df1c with SMTP id v23-20020a197417000000b004eb0c12df1cmr1520892lfe.65.1683187300652; Thu, 04 May 2023 01:01:40 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:40 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:05 +0200 Subject: [PATCH v2 09/18] media: venus: hfi_venus: Fix version checks in venus_halt_axi() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v2-9-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1179; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=2TN022IG90w1W+WW41ndXOwXiJsz29XNAp4fcB4/bxA=; b=zAqIh0c4vPxL8UYZPaH/GKZD5YzmAXx5SKQ26zh3K3OdP7Z2VReAs2NFUcC353sxLq2vDyDf4 DBb7zZZF9ckCQR+c5lfDna5ojcjDKQUtW+IoUz0Ax6PXQC2riY0nT3F 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 the condition for skipping part of it should be IS_IRIS2_1 and not the number of VPP pipes. Fix that. Fixes: 4b0b6e147dc9 ("media: venus: hfi: Add 6xx AXI halt logic") Fixes: 78d434ba8659 ("media: venus: hfi: Skip AON register programming for = V6 1pipe") Signed-off-by: Konrad Dybcio Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 9b840440a115..ca56b1a8eb71 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -549,10 +549,10 @@ static int venus_halt_axi(struct venus_hfi_device *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 Sun Feb 8 14:33:37 2026 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 C917BC77B78 for ; Thu, 4 May 2023 08:02:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbjEDIC1 (ORCPT ); Thu, 4 May 2023 04:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbjEDIBw (ORCPT ); Thu, 4 May 2023 04:01:52 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0D574204 for ; Thu, 4 May 2023 01:01:42 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f1394cb0d1so175190e87.3 for ; Thu, 04 May 2023 01:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187302; x=1685779302; 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=vPLFybUnSCLJz0oCMRR9jsL5keYJ4n9HhX1ELcMGsYM=; b=Rm6vE69ZkFmGqXM10Qu7Ec++Ds4AHAx4PppyIKKpic8AdFYrX368gLcW9X1gubcFvB IFxP9d5hM/UCRNYFS4TgtMLgzYXfm4QANLnwhgpeLqJzVoAJFyuitM37B8p/i9i7mKrX Ik+Qnm8Lnqecmdtr9wNViTilkVjwDekSBIvhBRtum7hQLSgbWpkBD+Obnsuf6ZMHY6UY pRz1uR8UtpIlGYpYrVTJ9GfGLtPD+LWMdq4U6xMW+MuI9eULIVKExe90DmRe4oiNXoi0 B08Zhv2yOUe9hhjlZ0cCj7mUt+KF1z+VREumVuiDz3ptdbsnddlpyk4JiHbpkqoBUBR6 RZSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187302; x=1685779302; 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=vPLFybUnSCLJz0oCMRR9jsL5keYJ4n9HhX1ELcMGsYM=; b=iemWIgfjUfaNizG6jaiQVGEN3ROCwzHetnT6xqM+fgccaeQ6NQKpBfieSIcykO+AGu YrMSVcjaWRckou36CXOVXCctL06uUbBG9PCrXGj7BGHG9I0XsnjqR8N5pvahKRmV4tkR IPCBTVZSKGKMMdCBdRyo6Y/FPm4ftyV/7w9vMUIVhTfu3zfWSgDmLq+zvPTQz/tgc/aw 0naKJY9S13h7wR0tFkZcOXUUim6OnII0BbswqvMkZl8ma1SwtYrbZYbO4JyuBGKg4kYC /IYXps3dfH+CS5jDsR1jKHRjarlWu6wuOB8ancfqVqe4oXgbrfu9AQVhFR/FPIMXb4Hd 1cXQ== X-Gm-Message-State: AC+VfDyACAqYY7gQLMyeYzGKK7ewPxn17Z/AFwIGan81/uof1kcqajJJ iZad8cmPOrN7UR+l15H/U8diGA== X-Google-Smtp-Source: ACHHUZ4QIj9WDDN9cnR7O3jT4v+wOw0gXEM13W3Etrtc70lp0Wm/Pt2n1R4YQ8SQxwcuJibxBk+2ug== X-Received: by 2002:ac2:5921:0:b0:4e8:c81b:1a11 with SMTP id v1-20020ac25921000000b004e8c81b1a11mr1655084lfi.49.1683187302126; Thu, 04 May 2023 01:01:42 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:41 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:06 +0200 Subject: [PATCH v2 10/18] media: venus: hfi_venus: Fix version checks in venus_isr() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v2-10-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1475; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ibQkhpaLOkmp/Wq5qNMd5hbG2R/lmbg93apEMw7+R/s=; b=jehrky/1ouQ53cSiRDAu4XyUT8R4vJlTkCW4cUtU5rc8nk3rsH37v8m5njowOHaF1lBOpjZfi bXJ7lPH/JDiB3MdQrsQkyVwlfBSY0E2l/3cpXWZ7nrPrmDhI7A6Dq1E 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 IS_V6 was used there IS_IRIS2(_1) should have been and the !IS_V6 condition was only correct by luck and for now. Replace them both with VPU version checks. Fixes: 24fcc0522d87 ("media: venus: hfi: Add 6xx interrupt support") Reviewed-by: Dikshita Agarwal Signed-off-by: Konrad Dybcio Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 ca56b1a8eb71..6d5906fab800 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1130,7 +1130,7 @@ static irqreturn_t venus_isr(struct venus_core *core) wrapper_base =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) @@ -1142,7 +1142,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_AR50_LITE(core) || 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 Sun Feb 8 14:33:37 2026 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 89651C7EE23 for ; Thu, 4 May 2023 08:02:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230117AbjEDICe (ORCPT ); Thu, 4 May 2023 04:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbjEDIBx (ORCPT ); Thu, 4 May 2023 04:01:53 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 440DF422B for ; Thu, 4 May 2023 01:01:45 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f13bfe257aso169784e87.3 for ; Thu, 04 May 2023 01:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187303; x=1685779303; 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=RLzwYe07Ua0iWuXYI18glxIVscBHmMu8Vsc9c8pgxmk=; b=a6jNEwlsHRKGsAhlDZXWwcU+vptB3800vh4s8+quTBtjpEizpiW6LijeyHj+bV7d25 2NUgE9AQUHf0rQ1Mn/oCX3APH7N4kKb1kW49gWBZDbb0pTIswXtl28DctQEiFgcTxAfT YQ5oN8SRWB8eRvT7QZQwKDYkOAk7l+CSqIPZATGxnfvbQVUrJOuokCrabmNHP1hPpjH/ 5G/AoqylBXbWyK0PT4v5iiYk78GA7to3cIdyUXb/Zyy8vq/iBVPQRDyVygZl6CYYm+TF VvKRwz5BvhVazI7aUNws2d9IsutyYyZ+iwnM+MUhrAdch6d6gezmeOPL6owlqzV63udD fomg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187303; x=1685779303; 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=RLzwYe07Ua0iWuXYI18glxIVscBHmMu8Vsc9c8pgxmk=; b=U3zS7EfVm0b7BTnb/0IFdZNWbMha+fn9OOTCmsQgr0OyXy/spbw01TaLMaHZ3m8KMJ SjjddX1a7EZuGj8mylAbSWFOadoe8gvJrdAeFXq2UqQvucCCAnpNbZgDW2KQvrygHT8q TATcn+vRR1H9BLvkSBgWdnc8pAc0OsB+Och+moV0EjY/PHga3YhcoKEEAs2E30XhnJkH XvMVzk50y7t8zrnzfbmFsE+6IMOrMX41aOZM8ZBAm9ShoVekXNdnh30Di7pc26n+nkGt m4HegRp/YiEWO1WDhHoSicvNRtYZd2jaPaoYk8H43LVn16BNFoB5TI5SwNMkZTIbMzJt 9Hwg== X-Gm-Message-State: AC+VfDy/T5xr1AvtViI+7fp5Te6QFADuoktlqtDtKiLpR/1wzXLAYtER UqTOvZLOlJ1faAGQg8XQlZRIFg== X-Google-Smtp-Source: ACHHUZ5gDgLDur7lUA0lukwvOxsFloKP3wPin8QpkMJCrjsxxefpJLvkwxERawO9zDOiItDFibz0lg== X-Received: by 2002:a05:6512:11c7:b0:4d8:5238:ae97 with SMTP id h7-20020a05651211c700b004d85238ae97mr1344193lfr.36.1683187303588; Thu, 04 May 2023 01:01:43 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:43 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:07 +0200 Subject: [PATCH v2 11/18] media: venus: hfi_venus: Fix version check in venus_cpu_and_video_core_idle() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v2-11-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1023; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1ifUdAT3ZHQBYgMADooIxCbatMIomtIxcid/wNFwLLU=; b=GbYkuKWaOiyIrl6/vhQgecr6tiCf5clf43NBvZwwmmoRPkt9ZJo3TBMGYRtoc+9FePflPoK4O gE5O2mywGyWDN5NflxKQVTVTSqskT0iw0eoy5PUHGSM+Jlk5WXOWAU/ 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 IS_V6() should have instead checked for specific VPU versions. Fix it. Fixes: e396e75fc254 ("media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6= xx") Signed-off-by: Konrad Dybcio Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 6d5906fab800..82aa7deeafa1 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1537,7 +1537,7 @@ static bool venus_cpu_and_video_core_idle(struct 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_AR50_LITE(hdev->core) || 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 Sun Feb 8 14:33:37 2026 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 A1159C7EE25 for ; Thu, 4 May 2023 08:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229613AbjEDICp (ORCPT ); Thu, 4 May 2023 04:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbjEDIB4 (ORCPT ); Thu, 4 May 2023 04:01:56 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E14194493 for ; Thu, 4 May 2023 01:01:46 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2a8baeac4d1so2020101fa.1 for ; Thu, 04 May 2023 01:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187305; x=1685779305; 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=XaTET6I6Chlike4b1aelQ66mWsgrpXX+pZVYbCKm7nw=; b=YUgFU5sMXvCPA0Ws9/d+bhPa1YbJkUH0i8oeUrxAlICS2e6hha231etQK99tXZ7C6y 1wQOufMin6XZWyJ4SmIeqXz9CEYqi/B4oBNrX+t4D4rK7zHSBDa/TAc2mAX2PkcRt6CG NBYBvYL0c8dJOHT+WW2qdYP+HopoexNr/801YMuOqESa+r6YIAwaeq/NWn0e3MgGIhbT vpYKjwoZmg8JaSZ2zREkFT3vhsMRRRuK82ApY+RTZh+uWxVpvMP38HaqY9u39eLEDfnx mxSKkxpzn7y7HCtV0Ea+HHayugaTyi1mmr4ARrv3PMKlsDD2NMlUTDqyJwvNVqbmhOGM Ne3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187305; x=1685779305; 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=XaTET6I6Chlike4b1aelQ66mWsgrpXX+pZVYbCKm7nw=; b=fKUorotmsatiEDVe3Sq+9OYEonHAqPJ0xEo53VMyCa9eTzgwp1Pk7ACPcM5mvor/2Z 1MPEy1557KsaC+I2lFCvvHgUogks+ZPCjoBv/4daDtEMQBbgPiAQLY5s4pPb9BJd1mle /87Wgu19x4NHxDn5TNKzCMIM1/Ta8oHwi4tYb1Muh6xdIAcfyB+glD1ZYvGJf6W3L/uQ P6+kIRzAJYYdTKQLW/okGcY9Tu+SIG55fRIaO7akKTrGlBZVQyA4vbuBBkG0DuiEwBxZ DeCiRbaN6Qek1eD2Ig9KUvwxIM80UkHy+Zl2JLysXyW1X9YunmfyeSicPHIXTrTYxcwh Thog== X-Gm-Message-State: AC+VfDyYjsq76L2GtRp8+YVqDMMW9DgvD2MskR2DYPhuq2hWPt5m5a/W Gb3I4oiaFNromK58d7eloYUqLw== X-Google-Smtp-Source: ACHHUZ50XmpCPgmWw0NN363CZF8Fbn3moQBl4zNyY9vkMb9MSB3Uxn+XAignsD/uR7rsAj/Wwr7geQ== X-Received: by 2002:a05:651c:1204:b0:295:b0cd:517 with SMTP id i4-20020a05651c120400b00295b0cd0517mr681510lja.35.1683187305068; Thu, 04 May 2023 01:01:45 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:44 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:08 +0200 Subject: [PATCH v2 12/18] media: venus: hfi_venus: Fix version check in venus_cpu_idle_and_pc_ready() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v2-12-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1021; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=8zfWzMcpL3GpjtgMJa9NGDyn8/IKM9ZLPIj9iHUztqo=; b=oFPFCaIJsqshA/+ulg13SPuJfH68My4z6Enu3TNb8ypHKqyJhbkqVR7VRJa7c+3w1rySeeTQn TYp4Kfb69uWC8eOaxksAA9M9XnAzNY+Mewc+9UayiCSweTSuwLlyJ2R 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 IS_V6() should have instead checked for specific VPU versions. Fix it. Fixes: e396e75fc254 ("media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6= xx") Signed-off-by: Konrad Dybcio Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 82aa7deeafa1..d6df99a921bb 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1557,7 +1557,7 @@ static bool venus_cpu_idle_and_pc_ready(struct venus_= hfi_device *hdev) void __iomem *cpu_cs_base =3D hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; =20 - if (IS_V6(hdev->core)) + if (IS_AR50_LITE(hdev->core) || 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 Sun Feb 8 14:33:37 2026 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 805C7C7EE29 for ; Thu, 4 May 2023 08:02:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230167AbjEDICt (ORCPT ); Thu, 4 May 2023 04:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbjEDIB6 (ORCPT ); Thu, 4 May 2023 04:01:58 -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 46A2D4219 for ; Thu, 4 May 2023 01:01:48 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4efec123b28so181110e87.1 for ; Thu, 04 May 2023 01:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187306; x=1685779306; 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=IWMwiYoEjocS38Czi4DBdZu7qtny70oMkcbZd0u1Q7A=; b=Ulrq4+bRHU42xZ5xWNyBgbPoQtU9Jr7O1eLonanrs0bAeTTcaT3ZcduwdqxBU6pCmh r+GZPzQxqLVLgV+tlA05Yq7g1t72HeYB3zlVJXVMsZmEXDtMYgQPON0bDXUg+fgitHYH n0m6pwMQ1ULiMGXiHFM+OHWS3xAGPO52sIwDuk+wKseXt3pCkQ3bYxSIc3/BNN1F6TWV pWLz+RdzKs6bUbvt/L4j7zyIxmfLnQudDIvQXkJgxXHcUTurPqUYNCcRsT1zsuDzrYyJ EZsPB6jCfruYWV1TAQ//OJUk8trbQyOkSUSPY2IAwM9duRY9GsFP6i+9wq+qfjJ9lvU8 UZ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187306; x=1685779306; 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=IWMwiYoEjocS38Czi4DBdZu7qtny70oMkcbZd0u1Q7A=; b=ktCTzDOfR0yYf6XnXycvauYlLaCeknciC3nrUmTZ1qtwNIwkQvMsaYoc9Cdytz50Dv +/LX32C6QO07Bld/mpKszMfy+W2Tjt8dz0NdBxtbpHIDd62eBm/iLfaTI5yFWBBVpr// uWpUd2sd1UNuJajkusX4E+7B/+9GforAZLG/vOQU0wV2rZ/dBKCP0DJhIh5lb91LXWii AOspehR4EbONjRdzWQSQQHRGnn9rJvarWus9eJlPqpHEToM+B9h4OhMHYmfUjKT5T5ct Sdhm58amKR1hKFgtdTt+eouSmFd4DRwa9YSm41ZVjrJD0KgcKOUQcGCAbYPYEmnPy7MH X1Gg== X-Gm-Message-State: AC+VfDzKccY28VjVAcoKzitidBib3bfMtok3adxIM2UBOrdH2/5Ky7Fu 9o61cZAHKmU9dLxnz682fGQwVwdnEzTRusiLmHo= X-Google-Smtp-Source: ACHHUZ51783nMZCbYi7BiWPyUdDB7S9A+1nMYD01cPyM1zmmgpx/RDMOaROcZNXnTzsk4h1aNeEtdw== X-Received: by 2002:ac2:4186:0:b0:4ea:5902:5af1 with SMTP id z6-20020ac24186000000b004ea59025af1mr1903379lfh.52.1683187306627; Thu, 04 May 2023 01:01:46 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:46 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:09 +0200 Subject: [PATCH v2 13/18] media: venus: firmware: Correct IS_V6() checks MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v2-13-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=2319; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6xrIXn1LM019O5ggn7yfRmQJ+yV2jlf4XGTfINFwf1M=; b=V0SoVnzgNLdbrnRmf+7uzFU8FSG3h5A82T8szAjDOwZtTkDZWL3SnCOsHqqpe1pdqvxw/VOI4 IGFUOTtJi1gA0jJqzHp/CBmCB0ydAo07vLNgIrHCPexJtNyVXZcspRA 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 Most of these checks should have checked for TZ presence (or well, absence), as we shouldn't really be doing things that the black box does for us on non-CrOS platforms. The IS_V6() check in venus_shutdown_no_tz() should have checked whether the core version is IRIS2_1 (so, SC7280). Fix that. Fixes: afeae6ef0780 ("media: venus: firmware: enable no tz fw loading for s= c7280") Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio Tested-by here, I think we should define a set of coverage tests, run=20 --- drivers/media/platform/qcom/venus/firmware.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/p= latform/qcom/venus/firmware.c index a4cd919e1dbe..be59f2017155 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -29,7 +29,11 @@ static void venus_reset_cpu(struct venus_core *core) u32 fw_size =3D core->fw.mapped_mem_size; void __iomem *wrapper_base; =20 - if (IS_V6(core)) + /* + * When there's no Qualcomm TZ (like on Chromebooks), the OS is + * responsible for bringing up the hardware instead. + */ + if (!core->use_tz) wrapper_base =3D core->wrapper_tz_base; else wrapper_base =3D core->wrapper_base; @@ -41,7 +45,7 @@ static void venus_reset_cpu(struct venus_core *core) writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR); writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR); =20 - if (IS_V6(core)) { + if (!core->use_tz) { /* Bring XTSS out of reset */ writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET); } else { @@ -67,7 +71,7 @@ int venus_set_hw_state(struct venus_core *core, bool resu= me) if (resume) { venus_reset_cpu(core); } else { - if (IS_V6(core)) + if (!core->use_tz) writel(WRAPPER_XTSS_SW_RESET_BIT, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); else @@ -179,7 +183,7 @@ static int venus_shutdown_no_tz(struct venus_core *core) void __iomem *wrapper_base =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 Sun Feb 8 14:33:37 2026 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 58255C7EE21 for ; Thu, 4 May 2023 08:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230257AbjEDICy (ORCPT ); Thu, 4 May 2023 04:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230159AbjEDICB (ORCPT ); Thu, 4 May 2023 04:02:01 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF8FEFB for ; Thu, 4 May 2023 01:01:49 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4edc114c716so178252e87.1 for ; Thu, 04 May 2023 01:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187308; x=1685779308; 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=HycEk6C3Un7NkbfcbNqLuTVGgeLRsCvnGR39vR7pD+U=; b=sQEI3Es2dtjywxv6v+eHUS96veU6RZ6X33s0Ynnsgxa43h5DEMZ4IuRdQk02wKvclJ tvz947L9i7vESyoayarPuL90QVOho8EIIX0KR1Xvy8ARhS+Qzx28L2+KObA6Fawy00Nq xJDygpr/5PoQJpTcSc0HTAWYQAuCPkigHq++QB/lYABi9PYOHXQEdn48/BOBW4XS83kg 3908FyClnfRNaEjQj2E1E49skzg6hdV9ubgsAb9Mu0/F18zJCQB2P11Gt/QtfwR62dTu tm9fCnSIRH9sOHG2nLtHBWlL8nv9dvMbuvLfOJdb1+5aQZ/FUUNKPCjGGf7LY6iKTN3d xTZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187308; x=1685779308; 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=HycEk6C3Un7NkbfcbNqLuTVGgeLRsCvnGR39vR7pD+U=; b=VYf4PscL8/DXGkzDZGvW4Bs785Wbcrtm8dPODSlqzuOKvv8iq7CFv/epW2fBMGJTNS rSedaBuVmLWX3kPKzSZQ5Bv1jBG60rQuZuTId5gUGLTtgNB3OTvEk83/kUxIgRlhNtLe S895rrWse6iV6JWdXNI99+dFfawbiXBISdXsbPdh5lvbgruvurB8xeH7YWDSJjphvte8 1RIrk9H3+VwcSH2rHpZxOfNvLB207Y8lrX0Gb4QhdhJxspxe3+Uzgv+BH903o89i4mYv tjUiovCG9jeVhVk91WrSsM9cJY6OSiNsqdwXlVFSLycSym36q+XJQ5DmTtmyUMVpp1n6 wUHQ== X-Gm-Message-State: AC+VfDxJWKLNIBrm0MmHdyqAGRMBehJNlMzcznmjwfxhUnQgBoOdnzGD UhkpRQqz8eVEJv3cEHhF+T6X9w== X-Google-Smtp-Source: ACHHUZ5eT/yLKuBw7lyPul0yOBAU16GffGoYtPQSCuYctg0rT+nPjTK4uZ1zYU0+e6lf8Mhaw7vJ0g== X-Received: by 2002:a19:5519:0:b0:4b5:9b8f:cc82 with SMTP id n25-20020a195519000000b004b59b8fcc82mr1643764lfe.0.1683187308135; Thu, 04 May 2023 01:01:48 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:47 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:10 +0200 Subject: [PATCH v2 14/18] 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-v2-14-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=950; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=q/vSdQIzdh7d45tOHVzWO20BSTczLeC5udvlzu3X2PM=; b=2XRbyAXvi8yZVch7RQ9IDxIiFk8izKf5ejhV1HJZ+scF3YCqriEQ0bIj3aMQMnb2R0lu7C+KX FNkVJTKF+NlB3iPKzkwdgzEYx/lreDn1whr4WieHhDnVI39tiNpO/nd 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 Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 Sun Feb 8 14:33:37 2026 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 1B73BC7EE21 for ; Thu, 4 May 2023 08:03:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbjEDIC7 (ORCPT ); Thu, 4 May 2023 04:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbjEDICF (ORCPT ); Thu, 4 May 2023 04:02:05 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0091540C9 for ; Thu, 4 May 2023 01:01:51 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f13a72ff53so185555e87.0 for ; Thu, 04 May 2023 01:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187309; x=1685779309; 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=Gmh3QMl0vM3P+SsAKhPqtUWQqJrL9cfiujmVg23UbYw=; b=tXlmsu808ieo/MGeji0bU10a8QIdPqAsymprNBulh1El7cx84cOhNh+M/wUBcO8KnT tgJi8KDmLNuq5m49YoWoaW7TzrFb1XrmdLXYkIys4YBQWz45rI1KpdTambR8kZpjcWeh f0LuZ3ieNhWDp9tBPMBHHNFoqwg6nSKbAqEFa9dp2Z4cfKUwCxGYfwn33hkPrWEzBub8 TrkuzuBBsPS/+jm66s0VRJwa0G9zcZbhuzCbMzOgD+OcQviMFUOZdASoofLt4wrs9lty 6zRMU6frGxt7cx/a4d6ISe/FZJDy4dhDE30a95yX35gM3wwN9lsRP54Y1Ry2rkTnrVnK /v3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187309; x=1685779309; 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=Gmh3QMl0vM3P+SsAKhPqtUWQqJrL9cfiujmVg23UbYw=; b=Gg5yKI0gOdYPNQ4C3yaWTIpnOJ64DFxTE1+G9ho2DHNJsoWcLf/7cCAH1qY1lkqFpT /m4w/WNAkU7Kz+mR6a0UG5NCD7MUtny5WyJsW031BrcF70tbtDD5v7AW/sU95+xkaFod V54EznHeRGhoj9xGA3WMJg+WI0v8P3Paja77WCIOcU8F1yjrrEkiOzpYQB7FyYpQnNz8 4KiOp+fEO9K9blTpIaT+lXavuElI3jxM7H7c+pgaA94wFm/C8ZwZs5lpPK7p0PAjOz+l 6r14s2QljpoVr0ND3ZWOQChhdMH7VtZi/QFPd9zj4nfOSKGNKGb7qLODpRZB6QDZ+s4q QQFw== X-Gm-Message-State: AC+VfDycbuTYzgP8w1ckZ2N8y8HuhyPIgYxyDMA38U7aBxZctVoT0Gvh esM2f4guayYFmGjIL/7wRwplsA== X-Google-Smtp-Source: ACHHUZ5oRM5V+EZh6kIq/2iypM6QV6wWqlFyeOuwbRRdSSu7IrQSyRLY9R82pvILzPj64vExzyLYsQ== X-Received: by 2002:ac2:599c:0:b0:4ef:f630:5c1e with SMTP id w28-20020ac2599c000000b004eff6305c1emr1417050lfn.51.1683187309645; Thu, 04 May 2023 01:01:49 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:49 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:11 +0200 Subject: [PATCH v2 15/18] media: venus: vdec: Fix version check in vdec_set_work_route() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v2-15-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=949; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=V/UGltlLWzlzUZNyrcqVl2X6sG5k2nSoHaxfv6KAids=; b=WtOwVMLsPygfuOE/M19QhQt6sE2ZYkfB4FjsG/HcddOYKMC+fTHbC05xXxHT4EpQlkl7qsff0 mjhayIDddOHAfsOiuUNXMgf4oIyAFjkAM36KmNnSsRI+iWP23l3jHIc 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 so much V6-dependent as it's IRIS(1|2|2_1). Fix it. Fixes: 6483a8cbea54 ("media: venus: vdec: set work route to fw") Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 51a53bf82bd3..33e3f7208b1a 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -701,7 +701,7 @@ static int vdec_set_work_route(struct venus_inst *inst) u32 ptype =3D HFI_PROPERTY_PARAM_WORK_ROUTE; struct hfi_video_work_route wr; =20 - if (!IS_V6(inst->core)) + if (!(IS_IRIS1(inst->core) || IS_IRIS2(inst->core) || IS_IRIS2_1(inst->co= re))) return 0; =20 wr.video_work_route =3D inst->core->res->num_vpp_pipes; --=20 2.40.1 From nobody Sun Feb 8 14:33:37 2026 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 58F8FC77B78 for ; Thu, 4 May 2023 08:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230204AbjEDIDF (ORCPT ); Thu, 4 May 2023 04:03:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbjEDIC2 (ORCPT ); Thu, 4 May 2023 04:02:28 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3610A4217 for ; Thu, 4 May 2023 01:01:53 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f139de8cefso7575054e87.0 for ; Thu, 04 May 2023 01:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187311; x=1685779311; 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=Z6QWtJjp2q6c2N1q1GDC5npabf74EYiHpQvEEQaOQAA=; b=TSL586EtVmIibnbaXNKWqcoukdk8iBfoZ2PL2zgZt+FYAuWhx7qVRx6wDiFReJufDh 10JomKzFdoV4BbXaE/jYD1xuLPPx8TuSg4pxFarqFV+yGSiD0fEBj8PMd98pf01E8HMt NNaBAV7pYt0imjwR5catlUn6fnPXUi8zhsJpYIEn8YtfcuhMI6R8y3tnIvrsdd8snlpK TN+xOH/I0xqw6+iJATFMuVAGBTrGP3drQWTEwgBeYMxARubwdmnnzoQhR8qGVXKmb+1S zqcvXi6vRMaNEV9tcep+1wH7kFrFOZ/DTw7l78Gy+Yh60P+d2Evrl1PWz2xsdOAYmE6I ArvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187311; x=1685779311; 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=Z6QWtJjp2q6c2N1q1GDC5npabf74EYiHpQvEEQaOQAA=; b=NUxFYSfQ7JGaxOkEaJl2FNeYQya0BXtZmy2cTjguwNNFMB9uk+VL7Amq3E1Bz9CaIK Hzb/NrRUwskcush4LLL3saN2B2eRLIa9sVc8hkHpXUxAjRfDDs32LoW8Pt8PAtc7Cie5 LdB4rTEZPsiD4e8X78QR6AwzxSIq3L8eFa7W3bolNzZ2waErd6eZ3509E4dFnduWbijV /g9CdxZMYU+Jt9Ma/AVNiQ6ZbArjAWpGw6n5f2KgcClfkif5Vgjt3/yyUjalkRdCmW1L h1gcrkMNLEC076PyrlWw4hKqZllLdV7oXTqxiVoAle4i9hNd/5qZIT/QKLVlE3Xk72Ne WOCQ== X-Gm-Message-State: AC+VfDyDw4a08OpOaK9pbUqTzNEFUy4M+pKQ4uEMm9tQ03cEgqyOYt8s h+P6KxkAJeNkov0scbB32coxNg== X-Google-Smtp-Source: ACHHUZ4r/6NvEVmBchNgDGeeYNpUo3a8919S0BgkOLNingtqsvP6zjDp3OwMNA1fsmMeZwBIxQiP5A== X-Received: by 2002:a05:6512:31c8:b0:4ec:83fd:1599 with SMTP id j8-20020a05651231c800b004ec83fd1599mr1392472lfe.33.1683187311279; Thu, 04 May 2023 01:01:51 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:50 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:12 +0200 Subject: [PATCH v2 16/18] 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-v2-16-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=7882; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=JFgOhkeOt67nc44HF+GqE6foLvDaV58jvlZqT/rckfI=; b=v8Yq5IZVIa4LQuuTAiStlhuqUHgjSLjAoEfAzxe64ZzOehkZdzRdbRfoBe18cD6IwhO+Lz3BZ UeYXne8c4vSCDhDlQBxACqwfEfEdRPCZ0q5wFVKUziocn9ndKFiR5NX 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 Tested-by here, I think we should define a set of coverage tests, run=20 --- drivers/media/platform/qcom/venus/helpers.c | 2 +- drivers/media/platform/qcom/venus/hfi_helper.h | 64 +++++++++++++++++++++-= ---- 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(+), 21 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/pl= atform/qcom/venus/helpers.c index a2ceab7f9ddb..1ce2624abc12 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -189,7 +189,7 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst) if (ret) return ret; =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 e0c8f15644df..1e06227ad240 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1168,17 +1168,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 || (ver) =3D=3D HFI_VERSION_6XX \ - ? 0 : (bufreq)->hold_count) -#define HFI_BUFREQ_COUNT_MIN(bufreq, ver) \ - ((ver) =3D=3D HFI_VERSION_4XX || (ver) =3D=3D HFI_VERSION_6XX \ - ? (bufreq)->hold_count : (bufreq)->count_min) -#define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver) \ - ((ver) =3D=3D HFI_VERSION_4XX || (ver) =3D=3D HFI_VERSION_6XX \ - ? (bufreq)->count_min : 0) - struct hfi_buffer_requirements { u32 type; u32 size; @@ -1190,6 +1179,59 @@ struct hfi_buffer_requirements { u32 alignment; }; =20 +/* Starting with HFI 4XX, some properties were swapped.. */ +static inline u32 hfi_bufreq_get_hold_count(struct hfi_buffer_requirements= *req, + u32 ver) +{ + if (ver =3D=3D HFI_VERSION_4XX || ver =3D=3D HFI_VERSION_6XX) + 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 || ver =3D=3D HFI_VERSION_6XX) + 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 || ver =3D=3D HFI_VERSION_6XX) + 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 || ver =3D=3D HFI_VERSION_6XX) + 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 || ver =3D=3D HFI_VERSION_6XX) + 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 || ver =3D=3D HFI_VERSION_6XX) + 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 df96db3761a7..c320ebbdb24e 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -99,7 +99,7 @@ static void event_seq_changed(struct venus_core *core, 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 33e3f7208b1a..2f0a95860c94 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -870,13 +870,13 @@ static int vdec_num_buffers(struct venus_inst *inst, = unsigned int *in_num, if (ret) return ret; =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; } @@ -990,14 +990,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 4666f42feea3..42cbb1619463 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1202,7 +1202,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; =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); @@ -1210,7 +1210,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 Sun Feb 8 14:33:37 2026 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 823FDC77B78 for ; Thu, 4 May 2023 08:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230296AbjEDIDJ (ORCPT ); Thu, 4 May 2023 04:03:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbjEDIC3 (ORCPT ); Thu, 4 May 2023 04:02:29 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 842F1421B for ; Thu, 4 May 2023 01:01:54 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ac7f53ae44so2015361fa.2 for ; Thu, 04 May 2023 01:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187313; x=1685779313; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7/ezoAVw2YsuX0T7djrVDfZq5CgG+6MzZDD2YwmF/kg=; b=kLenHnDCd0uBsKrSo1WGh78cZTh9Ra3zVmHLL4gndv8ZleajftHuLyHS3D5fezkMOr WSMdKVvRSRukQniAoZj5cvlK1hmjJmwXsyAqZpccM38y9Ko8BEvOW/5buqQ0oAQ2LjxM SnsjZW9r66m51bB0WBrMDS2jDAmUc0kCgZF4WSA9G68QKVr/3bj9j1TK8g4/U2G6G/qZ EZPlPR56wdKsTspC1CaGZ9SZlpWCJcBahFv+edw1hr8IBmgpjEWOLEUr5b0l/G5Hh0O4 CC5DRGXbfNjfJwRkSiT+ShE2u1LxiLSzx0EpkQVupLKMXBXc6yleYaq5TvdSC6cSRvhc Xckw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187313; x=1685779313; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7/ezoAVw2YsuX0T7djrVDfZq5CgG+6MzZDD2YwmF/kg=; b=kY+ME3ZkaKGN6ORq6S4Fq3yZqSBtfocJw3gryNQPdQ19pj3e2lE+zWYXXK1cmhjnQ2 ic8Z/w1c1fd9CZOtIBHC49ddEVcDxSCtNKVB4gep8X4sPA2wSahqp7MLCyR4OLWb8F6J nWMNH/+Tt3gyOwszNxNwJ7dOR6Wh6HgsrX4Sl09KXa+wi4+z0tynOhkYAOiO0cDnrL7N b5ZBDYHbywdRl2HIRjABjruzAn4rlWATC2/m0HB9RCqIN7p/lk4hlfDT6plMicVc14x4 g5BcvTmMrkpUtNJEPPlYOlTzFNldtFLRbtB9RJuvR9rQizrrFo3ssYNLHuN+iiBWIT9i smaQ== X-Gm-Message-State: AC+VfDwTj4XsZbt2Cdm3Gc5EqCK2suuJTPPRIu8kCLD5tFrT94pdbnAY 1vdjOuYLxA4ruYXQqHUi5/XDZA== X-Google-Smtp-Source: ACHHUZ7SjeFgvK6nG6qtBdpqsELpBYDXq4bDezFMSZJUZ+zWtJyorg/du54Mm4TQBT6B+si38l3WTA== X-Received: by 2002:ac2:5976:0:b0:4d8:6540:a731 with SMTP id h22-20020ac25976000000b004d86540a731mr1454565lfp.47.1683187312943; Thu, 04 May 2023 01:01:52 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:52 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:13 +0200 Subject: [PATCH v2 17/18] 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-v2-17-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=4434; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3DU/aHZTwApMpAzleBOxmDEmeu3wMrZY4AjWxSwH9y0=; b=9IA8yX1+nsMn6XchQoCxp1wd6G+ibq7ZxKdRzqfGpLjOauwbHOGMVdZCFeUChEHEN7xfLqT+s fwK2smrptb9BbTMppDZxwJGyF5mMRqzK8YhnFfv9x2mzqZuijYKnGRg 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 Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 1ce2624abc12..0268129ab9ac 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -667,6 +667,7 @@ int venus_helper_get_bufreq(struct venus_inst *inst, 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; @@ -674,12 +675,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 a9be31ec6927..5eb4032bc551 100644 --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c @@ -1214,25 +1214,25 @@ static int bufreq_dec(struct hfi_plat_buffers_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_count_min_host(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, width, height); @@ -1264,7 +1264,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: @@ -1284,21 +1284,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_count_min_host(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 Sun Feb 8 14:33:37 2026 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 5AFCCC7EE22 for ; Thu, 4 May 2023 08:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230306AbjEDIDN (ORCPT ); Thu, 4 May 2023 04:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbjEDICb (ORCPT ); Thu, 4 May 2023 04:02:31 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB2444A6 for ; Thu, 4 May 2023 01:01:56 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ac770a99e2so1985801fa.3 for ; Thu, 04 May 2023 01:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187314; x=1685779314; 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=U/UccTAcuhBCUZ5FF6aUwvykUnIdd379ssRafTBI8b8=; b=k2wfBVJ9WXNUj0tgbgW8gkMU+/1meB/9vIXZndgxm10dezJlhYaNqAPsHBh9q1qZXh Kuzy0NH+RKCmcAn0b/jTlJi0hdiXCA3gFuqeN9yHD5AccDS8ZPHDOGwV0/CpD6CpSVeb k7iUiSekl9SQqyFw58h/RnWjkyaeBgx9MPRTqAjdLjYST/x9x4IJv/EMWxMHjF5vOBjK WnhfME2HEuhEMZEKe3g26jLri7ePZ7f3r05v2O3ejxVPa/+HQ1GN44m8ljadhbrCAa0C sSMWTn65rUyY8YDNDnJvpVAyibwd/Z6wyf5b7wy+e4Tz53+i8b1Pc0ZV4+XGst10qHFg hVuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187314; x=1685779314; 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=U/UccTAcuhBCUZ5FF6aUwvykUnIdd379ssRafTBI8b8=; b=OBnI04KTGEM/XCVOdhMb6++jF7vy5/ICngmqOrxzIIgkkyrULPpjN0Uo8JJsSQEmy1 6Nq7yEl5NIO2yBfvjfD54ZVXKaPmTgg3e6yBp+dWKFNV8vCOMc67XaCIYmqWhjBRbVkk 8LpM4w/LPepi2Ef1XaA1A1XJayMvpVXzwJ7v++W96+Dvz4bq6WXmAd/h9xwCc3uCbahZ zXF7eJuat9VGVHBbn44+zkQOvkd6yM4iRHi8SruOLumMc6xlXoatmR7SHaw1OJjp5JET IX5+farPzNOz8aciZqKkJzOCEAf1MWPenPoKJYBZ73XPYesxcn11gsY4PPQsLfCYjBiT 2Tvg== X-Gm-Message-State: AC+VfDx4Idwycn9HGv/L8Ara8zfT/bMpHHh7MGIA1t+7pc30XMEh2Y4P pGJBoPb1HTaFOcHOP8aS8b/yQw== X-Google-Smtp-Source: ACHHUZ6vO4z0T75jgR0++P5IOouAIDe27JjNuh4RcoH0KoDzBwzm0rdiclGAxrYSwR2VBML3esgORw== X-Received: by 2002:a19:ac08:0:b0:4ef:e990:8a53 with SMTP id g8-20020a19ac08000000b004efe9908a53mr1563858lfc.18.1683187314397; Thu, 04 May 2023 01:01:54 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:54 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:14 +0200 Subject: [PATCH v2 18/18] 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-v2-18-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@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=1683187284; l=1033; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Heez1R9g/upp/lte+28AqBemWtRoQ6abP6tBXj2nEJo=; b=dlplnoZoob7e3VzE6E58BXJl+xaZE0aZvFCtEc6T9JXS3KuWqNZRqSdT20GugI1L0NPZI0gc8 ikoGUOm0MXWB6U7pfzKbOSW8+HPXRQE4CGqJwARcFQfYAN/c1rUZA2G 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 Tested-by here, I think we should define a set of coverage tests, run=20 --- 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 d6df99a921bb..6405771568d1 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