From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEBADC6FA8E for ; Tue, 28 Feb 2023 15:24:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229959AbjB1PYv (ORCPT ); Tue, 28 Feb 2023 10:24:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjB1PYk (ORCPT ); Tue, 28 Feb 2023 10:24:40 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3680F23DBC for ; Tue, 28 Feb 2023 07:24:37 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id f41so13645403lfv.13 for ; Tue, 28 Feb 2023 07:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597875; 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=qXugSA6r2tV+X0iFO+lGhptFx82s88fjNq0jEwrsdR0=; b=RPRIrotIE+koozd7vn/zocKpX5RSWm/6VDAD2UGrFh0IctGRRyHRnEGh+sSpoDTvRW ksd+hq83BAcnNyvyyxR8mcsHaW5kTw/hPn4rRjxpwpe74lDJvyKE5XReeUYZE3shedp/ FuNQw5+aYrryJlzGHXh+uUgxQvl2+MQpfSdpBNzfZX0nL3d6mwJI+J/Bd+gZUSVEUP2U VvrFr+johfkEaj7kJ0rmBFYyB+dj2egWh1mSU3QbsPC1ZMeft4JFzA/GQePiQc0GzxFP 0mi71GPNpc+ULpMi7owlLwbtBaG3rHwr9lYsUy/dRKxNpoDIVSg7E42CWllIVB4d2OA8 9BZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597875; 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=qXugSA6r2tV+X0iFO+lGhptFx82s88fjNq0jEwrsdR0=; b=z6WO7U3UARtlSGFTLQ9XctJBGi8/jlmUAL8ZypKb66svJ9HsEJkh27pKzhSNEdBHFt AfgIYArY1ia1jbYhHzPXmYJoLM2Wo0tHVeEMeHWLq9CsGUmTLmU/8FTmIk5F/M5EajD5 /h40hZu9tdl9RRDjR9Vjm4xPIwz9vbqfltNd7o7WQn21oagNWurhCiKlvhMLj0e6s07m eA+9UpWNdO/TlIlmDqn626lBxqtScozr1lGbziH9n8iHNVppxjxr6aIa7H4knihz8kwu 1ATYFeX6wjlfx8Jr2sJWDPdj1b4cbMUd+P8bAO1rP00QG5fBMkIzl/iNrVgL2bd5IJlw lzTA== X-Gm-Message-State: AO0yUKVZqCacZofUFKJ81/fnDUL1WMvTvFb/uODo3qp5aN7Wy/qW555y W817wfsRstOicsQHuZD5ElAgVg== X-Google-Smtp-Source: AK7set/ETuGKMpQpJ4OQLtd/G98Lx8jAQPHrQ5KgigYJm1favsWQ3qmU/avdWBaWD5bBi2H3RAmQxg== X-Received: by 2002:ac2:5df8:0:b0:4df:998d:79d7 with SMTP id z24-20020ac25df8000000b004df998d79d7mr771300lfq.8.1677597875450; Tue, 28 Feb 2023 07:24:35 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:35 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:25 +0100 Subject: [PATCH 01/18] media: venus: hfi_venus: Set venus_sys_idle_indicator to false on V6 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230228-topic-venus-v1-1-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1210; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=l21Hj3clKvJ5WDgOnhsicYzRTtdql9epuJV12nTy5r8=; b=WE/7f4vV02g5I5rmyHXeuw4wZOzwD2LPxcq1Q+IVLDzZ+6E2EdCHTjVF6JVDiYpFBH2ghcDOvGJx 1Bj0zUymCybQ0fyG7CTW50knq8ZpeeEk14URBba4rDbYpJ6L6gOl 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 call does not seem to have been cast on any kernel with support for VPU-1.0 or newer (and by extension, HFI6 and newer). Restrict it to V4 only, as it seems to have been enabled by mistake and causes a hang & reboot to EDL on at least one occasion with SM6115 / AR50L Fixes: 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing I= S_V4() if locations") Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/= platform/qcom/venus/hfi_venus.c index 2ad40b3945b0..4ccf31147c2a 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -952,7 +952,7 @@ static int venus_sys_set_default_properties(struct venu= s_hfi_device *hdev) * 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)) + if (IS_V4(hdev->core)) venus_sys_idle_indicator =3D true; =20 ret =3D venus_sys_set_idle_message(hdev, venus_sys_idle_indicator); --=20 2.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 533FEC64EC7 for ; Tue, 28 Feb 2023 15:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbjB1PYo (ORCPT ); Tue, 28 Feb 2023 10:24:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbjB1PYk (ORCPT ); Tue, 28 Feb 2023 10:24:40 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1F5924100 for ; Tue, 28 Feb 2023 07:24:38 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i28so971042lfv.0 for ; Tue, 28 Feb 2023 07:24:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597877; 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=rc6RN3xd6zhAOa0UniFbQ5+ZDyipjjg8if7hSJwNayQ=; b=VUwBjh2ERF8LYTz+KF9QEFEOZzDW4X95x4kirUH5CoxXjYou/BYrh+qs+0dkDl1+LZ ri4Sb6uofUt+ZcXScmzAImUBg21KWjSlcP+19N3XS4CMn7ekBWROgoxPW+u4WrKDnCAd UgZi/MNSDGUJUJTaNuXTpjgvQh/HAKAjw+T1XE/2gQGlGR1cN7+cBpzro2bolDhivDth nMv+3HUeWc+iv8Dfc2AkKBE/6PyXiQPPli3DxPlFkap5HIu8QYQggH0dpcfyBtNv4vxG 20PmCzCuXw+fUNBnjhFctW9ehUEdDzdfOTTatauE1WL2LOea3poz7Jsr9ic5l9OgFD7x FMug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597877; 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=rc6RN3xd6zhAOa0UniFbQ5+ZDyipjjg8if7hSJwNayQ=; b=miYBl/YNkQrOYQIW2cHR38VrTIKEiIpbcx+LjuoJWBkOHOkvDwxGu5McQPNGWaO6ha vSEDAr8nJ9iRAvze8Bgab/0X3q3yxvBOz1en/JzGYrN3uVACrf66o6Azr9C6igzA+wQB m62W/oj8p0IyS+oOUUF6px96ov/l9mMbzLiWFb2IiOUl7zpk3WzK71N6aXfw7dVpzjws j1VIZoRHyP8y+JaeNTVht1l8dkfjz+SzUXtHXuQxb/Nf/UzBcuenqxUy1xEP14kpwnCb GAO2FUorg+go5xAHoUC+Kbdnz45rrF5Xr/NrEHU7q/bFVagnPb7JWmGsqm0D0B9KO75d oEdg== X-Gm-Message-State: AO0yUKXLO0ODcKNpy7acul1C2Qj9JpjcFWOeyWsQkPYWCtUlVass8CHq wfEL9Y4PuNJb1x/+F2qosLPyHA== X-Google-Smtp-Source: AK7set/94+7THEHG/Uoy/IIGa7hBayT2hRAQTaPQxuruESoN15XU0e29HiCzJl+bYW+hIALrsNPohQ== X-Received: by 2002:ac2:5ecc:0:b0:4dd:b479:1ca1 with SMTP id d12-20020ac25ecc000000b004ddb4791ca1mr742982lfq.3.1677597876978; Tue, 28 Feb 2023 07:24:36 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:36 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:26 +0100 Subject: [PATCH 02/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-v1-2-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=2018; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=8+CFl9UOfZsXychZVCS3rhjkRarB22qAKqY/ChcPXRU=; b=/uwB4DFOETcB67/k2z90ex27AHGQnuTnuzVYnJjmQb4G1VKhbXJoyIL3r8ugZdXoBuqgEAOWZlVG ZxaI8QmcCNjHc58ohhSRUoD+IZgchgbpqvB+42Xmp/618gcsL2u3 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 --- 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 32551c2602a9..4b785205c5b1 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, /* VPU4 */ + VPU_VERSION_AR50_LITE, /* VPU4.4 */ + VPU_VERSION_IRIS1, /* VPU5 */ + 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; @@ -473,6 +482,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 162A2C7EE31 for ; Tue, 28 Feb 2023 15:25:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbjB1PZG (ORCPT ); Tue, 28 Feb 2023 10:25:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbjB1PYm (ORCPT ); Tue, 28 Feb 2023 10:24:42 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65DEE241C5 for ; Tue, 28 Feb 2023 07:24:40 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id g17so13712182lfv.4 for ; Tue, 28 Feb 2023 07:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597878; 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=QaGduNCU1ULlQ2WtlYAAuJDe5x2zJJiEdNeq0M5C+Gk=; b=Fa/Hki05PBoukLOCE5VDxKeIcqwy+HqoIfP3kRLrzJCnjjZCsz0bgxY2M9/qoOJ4HZ u39h6etpitITUN7Jy8VhyJZue+YXfLhJ55iKdUy9aPEYuqrNfR6FDTNjV42MZ0M0ZK+Y AvNiNGMYd4YzRr6PLB/qNZKU0cIPXlcSQWRsE+kwej9AR8GCGx9A7TDZxzpJGTCYS0Qr cyAtH/1ejx3VmNwh89hvZNyfFSb5Sz/p/4+ZoqUEbvpv7KqVhEAly4e+wf6Hg7EUbgSR dLD5FxVfXGj7CnfiEl7M6mypRwFk+rDF7KxB/1Rrh88AGBLb1RHiL1vDDaEBe1dTS7RZ 6+Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597878; 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=QaGduNCU1ULlQ2WtlYAAuJDe5x2zJJiEdNeq0M5C+Gk=; b=n44w8Qqx4Vkn5UDduVqtmKzQWnyyD4XVVluhXpK9+Oys6SwjirDVJu87wM1e2BKHZD KZFwg/U8QdmTw9W/S1RvG5YoYz1bN+HUVY4MB0XkM2c4EP8v3fVB3lFApkq/6PzxONfv 4ClQp3OE2/8te6S1OI+1fLPcpKqfmr+afU4MkoReTWsLxFeqRMqC3DWF9TG6dyz7gSjx ZSiMTcII4TD1YEC4qFmKTm6Hryg3+/neW4wMjeqEBJkG7JiDh00B9u1uo0AMWxA6AcNh oI+03mXdxOk4fTVpYHTYH9wdmC5XMIJdpUkcTXnbH6yLTSsgjZd5Op5J5Pr9c8eCxFvM kXSA== X-Gm-Message-State: AO0yUKXWYGZjuUX+4OJH80mpmSSIMoglfir0kjJ6yXtQl22OSoemTqm5 h0lN8eJJmPIbb6zUPKNVA6qJGw== X-Google-Smtp-Source: AK7set/+0/f3JmH9P6brEOJU0OMj4vy9VZG90QBqe7KsHWNIoXK3Ag2pk2j78rRHq8/ukF9DBMfqww== X-Received: by 2002:ac2:54b8:0:b0:4dc:537c:9229 with SMTP id w24-20020ac254b8000000b004dc537c9229mr981894lfk.30.1677597878555; Tue, 28 Feb 2023 07:24:38 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:38 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:27 +0100 Subject: [PATCH 03/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-v1-3-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1939; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=35x7tSloOwjwMyZxSi42rizc5msFf8OvUc6xn5LhOF8=; b=1YtZEMsw3wAb0TnoxRkEQKQh9U09FypcPXueNkxnks0ZMptpyQAYsGhUDWuyHVRi9uIjKKxK9Pkh 5TPNzwzYCkcb5TvZgTSMLDHeIzTChoiKoQsMUM7F0Vkkq2uyMLEm 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. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platf= orm/qcom/venus/core.c index 990a1519f968..c13436d58ed3 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -686,6 +686,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, @@ -711,6 +712,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, @@ -758,6 +760,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, @@ -811,6 +814,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, @@ -868,6 +872,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 507E6C6FA8E for ; Tue, 28 Feb 2023 15:25:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjB1PZE (ORCPT ); Tue, 28 Feb 2023 10:25:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjB1PYm (ORCPT ); Tue, 28 Feb 2023 10:24:42 -0500 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 66F0B241CF for ; Tue, 28 Feb 2023 07:24:40 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id bi9so13729751lfb.2 for ; Tue, 28 Feb 2023 07:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597880; 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=Ouo8uuwT0BL/iQ4qXVVvn9es2W+dnKtqVS64weaqnUQ=; b=MXojN0LQNc12UfetxbjfKcOeN3fOc8ssW4PDbnrCCAwiuiISZAMi8iZJXruAU5Dzsy dheXR6o+/1DWsozRRmd1phRIQHszUZRdmmxGq1r8y+oqBrrOQfenBMSxH2R/soLlXnqE Ru3OgG5WZFHRniWrMaM4viC7ymV85fEM3Yqt+jjhDOYCXafe6GAE5RMKckfrde+LaEZM sEaIq0VvYpgS6s00z9zH7TqnM4r3dVoyzB2f/vOlIR99WPnLJiO3BfvZ/RJUhhJ2rxCB 4+QXRnpXxmxvzjrU333C8uJn6Po1Ep6EmbDT1P0YzJgsN/2kedLNS/zfO4qIdqjeM+Om SkAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597880; 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=Ouo8uuwT0BL/iQ4qXVVvn9es2W+dnKtqVS64weaqnUQ=; b=LKUhjvmfJKEf3x2uJeuW44paSYsywLTAkwNy8L3TdYr1HjA2eIP4uWoQIDQ2/3TqjE Fn8O4t1lTWTprEQBYTz2Xp7NoCKXul2QB79/iy1uxsVea15tt1axPgvowrhOdxLb+/cq TRcallPXzWR1a+dGxC9hHG+JQU5OdXS50ARYENRNpov5T5Ih6DhzY3aqO4xVI2JT7QNn M53vhP0iE/RYZwWm90hf73eTMiLdcU2uuzqy5igAi/Rmp84VY5KHkf98QVKMrJm7YzlW TyIw56aIA8PAsZ2Mo9eYbMG32BU3x5Lcxf3cyN+OSfwG8CnVbTuxXw+j+5rVQfPScfPe ne5Q== X-Gm-Message-State: AO0yUKVyCOe/oXpbcqlfFNh9MX1beettOkZ9G+JnZOaICLcDt2btpFJy ZZEqsv5N9wiiKmHS/ZNg4DKArw== X-Google-Smtp-Source: AK7set+v1RYt9YnAyku5oDjya9Oq9ZbPSki6r6U/t468yKs+brqB6FzGHVTYwK2Szcb+U4KdUjFgyQ== X-Received: by 2002:a19:520c:0:b0:4e1:27d5:1245 with SMTP id m12-20020a19520c000000b004e127d51245mr737241lfb.49.1677597879962; Tue, 28 Feb 2023 07:24:39 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:39 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:28 +0100 Subject: [PATCH 04/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-v1-4-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1076; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=LhE7R96rM2LJyxG+NTkMKHvW3mNwrGGFDkZtGywlnuE=; b=oMSaelWO7J6BsFG1tAJQU96xUGll1OWl5vsqn0f7Yz13BEhTSShoDxY6os/RVoqCN/DUbBRzdvqv rwCrO1vsBpSJEGD31GNpS9AHeprFsLKg7QRhIilIkuW86fl1zSp8 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.. Signed-off-by: Konrad Dybcio reviewed-by: Dikshita Agarwal --- 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 61ff20a7e935..1bb6406af564 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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01F74C64ED6 for ; Tue, 28 Feb 2023 15:25:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbjB1PZI (ORCPT ); Tue, 28 Feb 2023 10:25:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229940AbjB1PYo (ORCPT ); Tue, 28 Feb 2023 10:24:44 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04F0028218 for ; Tue, 28 Feb 2023 07:24:41 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i28so971323lfv.0 for ; Tue, 28 Feb 2023 07:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597881; 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=XR97t0vv1eCXn18PURYfzYkLTv3CB1qpCk7uOk1LjA4=; b=j7igxwPlJ9BZPas8I+MoCiShBmXS/UAf/QUDhGhej2SAJ4CambOCAU2pbuaHfzxlR2 vwyl7zMF6TZDUTImvA/++pkTUaXGKkHoPPx/nGljXhZ3zj+/GlBrEQC+yRuIdL5g234Z FS+PBZL1AAtQynHPBtzi1sSL6cFws0lfp5lB61NSrij9qKbi3hbOKgvSaZ1oSqiiVxSo OZJxhUGHfECFRvLDXPPMMc7HqFwpjK8DnQkuJTnuZKCn3fbj5r9c2W0/dLHN1cwfVs9V eCBVLcdVSfFpANSRgAEy0HxLEstzZOiEdfL+ay5bGhMMuXwCtZZNyFQa3RvxXPvSmBwq RjTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597881; 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=XR97t0vv1eCXn18PURYfzYkLTv3CB1qpCk7uOk1LjA4=; b=lTbr+U0KMSs9clw3WMK1rhIHC4MHwqwYgWR7gWqVFk0KgKrP+t9cLWQOhR12k2mRom ipUWhrrve/cBBMhdk73c4RKIO0W8y247ZnKqW/4wHugSI0jE6Cd/KIUWfCi7Ew0NQnhw f21ibnossEV3EkUYr+lVSOqKjIOG8/wxkXvONL/RLTI8EDGUC1WHGHvRrl2LUKxSli3u GnodaQcqi9VQRPbt2pDqflpkU5ZI+vPfmCEbD3BIhrsEarX9UEqORe7QW0MtXlWfHcdZ QY0hRySR4spM5y0M96wFPMFmwnGA/Aug7y7Ijlc80JO+K0GQ9zQibh499nDMKzAriDR/ dJkg== X-Gm-Message-State: AO0yUKXIB/p3IAimBzbAy5xgOTzNV8XFwQCt2ej9HOR1BNCKcDKMvHmG DxuId1Aie0gQrWERaY3qAwKL7w== X-Google-Smtp-Source: AK7set83w32q2oxDqzKgIwmoyEnUeJXEwvj8k44uOTUziukjlsVg1GWPGZNRNHe/VolkWn6yZQ4vCw== X-Received: by 2002:ac2:4c26:0:b0:4db:2cdf:4c12 with SMTP id u6-20020ac24c26000000b004db2cdf4c12mr702484lfq.43.1677597881420; Tue, 28 Feb 2023 07:24:41 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:41 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:29 +0100 Subject: [PATCH 05/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-v1-5-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1913; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=8YSW7Fu2jndgl/WxEEUigTPoBYrgxNe8jMMj7hfx/lY=; b=eZ46AiY3nhnu+cy0+y1yQj4bdcJFZ1gHXkkMCflRQXkQ3MH8Q0iTHj3iMafScPFEp64ToPtdlzJH 4WenP9s0DhOZrMVabSSDtUsxV662HGzrEnYhfRGAm3SNPsOH/R3+ 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 --- 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 4ccf31147c2a..772e5e9cf127 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -448,20 +448,21 @@ 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 writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); - 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 @@ -480,10 +481,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3AD4C6FA8E for ; Tue, 28 Feb 2023 15:25:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbjB1PZM (ORCPT ); Tue, 28 Feb 2023 10:25:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjB1PYr (ORCPT ); Tue, 28 Feb 2023 10:24:47 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B19D25965 for ; Tue, 28 Feb 2023 07:24:43 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id m7so13685179lfj.8 for ; Tue, 28 Feb 2023 07:24:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597883; 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=S4xuvAnYE2JZwfKFXp7AV+YC6//bPuJqtQS+4kWNGBM=; b=EZ2y2iBNaR+gVD9Ez/YMS/EJijOdC3Fep1XtCvcrLkyiJ1L+rjamEbj055LVNVS/+P C23M6BNJV3xNALvnMI+ZJKsfNEdYtGgsvc9hUNsJgkauUMEtj+Ag2tRpFVbqGWcVywm2 SU/LHyGPIkYSYzzEpMZRQvXTUGngjc/TZthmUJOSMhis6zk+q7pulNReWj9WxnPo9INP YKYsWEi+/WGNFXqbiM9BpHyjkZSuvlb8hSwZ/EzJTzGFyRvMgI5QTOM6PHsnzwPj+Kya I45qAhzyChisUPYNIU9kTkB36hCRq1ADNrKdWDyGLVg4ZLEgJT4GDhb6SVTp+UJDJmHf gCAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597883; 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=S4xuvAnYE2JZwfKFXp7AV+YC6//bPuJqtQS+4kWNGBM=; b=vOqaTBwmJ5p8jw/8ZtdGSBMK0OOkvTFsB7b120Lhm8RuFXCwlY3e3QtYWUgEt9Hsqm lw7njjrzXtHBDLEnr0/ooBKmMn8hWJ+X6UA3+SQql8fq8vhyDMt1ZYNmo13IKwLZFjw6 CR40lvZXt7Yk9WH1oSsqFcBgHjDR4lu2AZDwqqaeQ+mQIFLrDa+uzd3sXI65isqS8PVb 9QQ9/CZeLmZJzh5pojXJFV60gYKpQWdzaf1hQCpBRi/A0HyVAdqN/7gRYjt1ep1fLVbk dIv4+hgnAt6mLqfF11TKLRaPljFOl+3nrEErT29IIA/x5R9V07Vs2Za0Wusk/4cK4WY+ Uvxw== X-Gm-Message-State: AO0yUKW045XpzMvzK9ndPvRlXzxG27ggOnvAxU64C70GkLsdcNPvJjrH ZbUYvh7eL4010m17kLzslPWfew== X-Google-Smtp-Source: AK7set9Nx09q1xk3UMtxKXhFCB8Jru+j76Kv0PINz7jERmz0uIcjocFFwO4OgZenXTVeACxtmgyBnQ== X-Received: by 2002:ac2:539b:0:b0:4dd:821c:3688 with SMTP id g27-20020ac2539b000000b004dd821c3688mr754024lfh.66.1677597882849; Tue, 28 Feb 2023 07:24:42 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:42 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:30 +0100 Subject: [PATCH 06/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-v1-6-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1424; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=4cqdrxrrUgh13B8sLIuOgZXxifYwhKNgm7jLLB9azJ0=; b=B8st5MyNmMBX79EtSQ6MZuilPEoKwlnJ0Rs0FLW47HrlhaXrxRM6spie1IVShxpnLMDf1R4BW8jF 9PWFeIsyDn7dNIV63jc3/QbMaq8OINVGSmzY++FcZ6+EZGg9DLkZ 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. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/= platform/qcom/venus/hfi_venus.c index 772e5e9cf127..4d785e53aa0b 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -454,7 +454,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_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 | @@ -466,6 +465,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9DCEC64EC7 for ; Tue, 28 Feb 2023 15:25:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230024AbjB1PZO (ORCPT ); Tue, 28 Feb 2023 10:25:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbjB1PYv (ORCPT ); Tue, 28 Feb 2023 10:24:51 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C253244A6 for ; Tue, 28 Feb 2023 07:24:45 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i28so971605lfv.0 for ; Tue, 28 Feb 2023 07:24:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597885; 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=QOZJv5Al1O3Nf++ajfeJZ7JKg8b2Wm5p9dwHgpwfHnI=; b=T7ur33ww7+Maj6xcpM1Jp5Se+aSgDMOHmTLf1HO1vei0brYJ2BDAluQ9iq8UbEjiCC IEVEYVn1C3T6jUhwOxiPAO9sQ8c7CNrppHI1auLgv5yhH3M0mhljelAlW8kMJx7ECJ4r EAzNz+VyG/YI3u1ZoN9nUDWKNJhMymXn+wA7PeJGDhOuFvHnZbFTzB7YylrHTPKN8gpC 6w07B1KgEBxMyugRRdTaC8Bngjo5Yocmmaxq4q90QgcR7/S10pLcBw7hZzJ10nzPwYMC /aft9RXS/0Nv8Sw1iJTKKrDXKvCYm7cx4+6BtHORQZ3tH6kNIbXHGwR8UUYJtc3AaR7q HClg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597885; 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=QOZJv5Al1O3Nf++ajfeJZ7JKg8b2Wm5p9dwHgpwfHnI=; b=LS6e64SocGsqGjsbgzLsXKC3fHrNjzQHHA+RR5K8DmGOKG44w6Wpd1Dgk94lJftijN Yg8UYE/D2YWkN2AXt2SgcznOCrlSqLiMnjdIXiafg7jMfhRaKiEODFXboIA/KwYxvMEL R4jgdUyZXPrmu+sbjuObLCZLZshPNCVndoM1A+Pv9YdfxqKu0qHK9/L1p5IYnxei4c/u jIzEKTcMUPPwhI5xs8MRHzdf4iH0BpJwcU+xNe+QD0bsSssT/xiO5cffirJKNpueDt1J Exg0Sj+eFvJOLodjSWH16hNJ3LslyrsMkU8oP2pCL7ZxRBNPlTHwYMcHyAwJhVtDC7RK aWfg== X-Gm-Message-State: AO0yUKU8/xQ8ZdsmuqIXHhqQXmSGE094ghwjlf4f8KA/Bg3n1IsXumsJ DJox/4Rya9OiQawQWwm9LIff2A== X-Google-Smtp-Source: AK7set+O868kh/0KamQVaXo+Z+pRaMIpeU1oSERhi2KFO4LYHMFct3n5rQwzSHvyQzeY9WpQ268myw== X-Received: by 2002:a05:6512:1021:b0:4a4:68b7:d64b with SMTP id r1-20020a056512102100b004a468b7d64bmr838403lfr.50.1677597885374; Tue, 28 Feb 2023 07:24:45 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:43 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:31 +0100 Subject: [PATCH 07/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-v1-7-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=889; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=sx/AsEeutDVEzb05mFqQidBHgnDp5m3CRWWH6EqqBeA=; b=m4cuQUCpvYiAZQbjgycB0N68xXrrz6IIK6w4NiPk96vWScEx1BdCbbgSAriCj8PHJlR7g3nxtMqb //Wbg3VED9QLsRST2RgL4dngMe81BMwYI8DxA/obxxyOj59mrOtw 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. Take care of it. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platf= orm/qcom/venus/core.c index c13436d58ed3..bdc14acc8399 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -246,7 +246,7 @@ static int venus_enumerate_codecs(struct venus_core *co= re, u32 type) =20 static void venus_assign_register_offsets(struct venus_core *core) { - if (IS_V6(core)) { + if (IS_IRIS2(core) || IS_IRIS2_1(core)) { core->vbif_base =3D core->base + VBIF_BASE; core->cpu_base =3D core->base + CPU_BASE_V6; core->cpu_cs_base =3D core->base + CPU_CS_BASE_V6; --=20 2.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6015C64ED6 for ; Tue, 28 Feb 2023 15:25:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230031AbjB1PZQ (ORCPT ); Tue, 28 Feb 2023 10:25:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbjB1PYx (ORCPT ); Tue, 28 Feb 2023 10:24:53 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 949FF30E8C for ; Tue, 28 Feb 2023 07:24:47 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id k14so13675216lfj.7 for ; Tue, 28 Feb 2023 07:24:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597887; 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=pfXCDnSGYPCMSV9KjGFpz0bE/u8I9Ovc8VZm+qsFkfI=; b=Q6oE6tw9A5p6GgBxquD0kIGwuwm6O4I/lh0LBv3v+d24PbHvCqA1EpI4+VmTDZyh/w WySG95QOp5/siDHdL+d0YJGVBDR++d52SmB+gITzSpvCyPyZdEopn1Ku8h35PsUd9OFW RxlLUJsw+WoLePiODBj+L5NXJ/KoJcgbNpFqtXyfve+NhTj/3JChLMKF76dXCkp+9+0c srl1OyYSjsXAZ+9Q5bCGujYKhdZbFGEWa/k8EC+vT5po6urdYMualTO21dnjExEzLK1e NVMaKm55nqziA+Gs0Bur4EfcBnjODJ/Ezzd6gOPLmKyrPdq9k80iVyVdIvrw98VzrmB+ U8+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597887; 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=pfXCDnSGYPCMSV9KjGFpz0bE/u8I9Ovc8VZm+qsFkfI=; b=Zf6Iy9f8qD6tlvjHq8cag8DmFnsTFLWiyfX3Z9zwvIbbCyRYBmzZ6t3Qdx72Ip8eys jeLh7KIBwg8hX8EwwV6O4L985BikstqpuBjpJFPHFM9qfsOMiGmyQYWuZ0Xbi7jUM1+t CAq4xWeKP/nuU9jtoJ5Mt++uZelf7TzBjlKN5Ldufc+L9RnaXJ0GUh1hqXlddAwWprFg ysK5f0cl7fa15pAOfcZdEeIlZxacf2rMRm/yvcPWB7ATFj0mt/LouXpK1IjfwDS35P2f J7aZN75q3v+MJk4WTCCIxeKpGWgJxArpMTDpnRjP7oJ48p8MYXuXFLrPU8i4j7tB3Iex if5Q== X-Gm-Message-State: AO0yUKVBkIkEt4q+HGAJyCEGjmrfxRrhspUu+dudCU8uMYCQPS4UK9Xe tKivFIhLnHV3sNXWLbNnxPfUKQ== X-Google-Smtp-Source: AK7set/RWrkF30CJYtmVxOARcAfI8MHJoux1IqIAE9xsQO1Ls7jT4+jOPVXNQHaN613N+SuC/shyeg== X-Received: by 2002:ac2:52af:0:b0:4da:f436:d423 with SMTP id r15-20020ac252af000000b004daf436d423mr752939lfm.21.1677597887017; Tue, 28 Feb 2023 07:24:47 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:46 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:32 +0100 Subject: [PATCH 08/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-v1-8-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1179; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=vcJCyKKGC7W2leXuwnA0vfyXrDyJXcgxDMnLgbkLNUQ=; b=s9z0ihnhSdd53PCcE7vAgn1D8+UghQlKIAvON5ygD8Wwgjm4G2pXiVypjRpWXierXW9LevxoYJJi XBCfNQAxCUGjXBX/3Agz/jqF8gVvKtcrGF+/CoWqjcK2UE+cIKBr 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 --- 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 4d785e53aa0b..0d137e070407 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -550,10 +550,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69DCBC6FA8E for ; Tue, 28 Feb 2023 15:25:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbjB1PZX (ORCPT ); Tue, 28 Feb 2023 10:25:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbjB1PYz (ORCPT ); Tue, 28 Feb 2023 10:24:55 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9426B30E8A for ; Tue, 28 Feb 2023 07:24:50 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id n2so13656592lfb.12 for ; Tue, 28 Feb 2023 07:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597889; 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=5zJn479IcitDv9y2x8/xGaUK4fklDoWt49Sew7oDQTk=; b=awJOG1x6vvDifU8IO+8pYduD09ixIs0ijf8kY0Lj9ZERnN0/d33XytUi3bfHwIAspP Zh1CexMr4O4vkLNRNuR7mtmxaFX1oNSdPuD/IZqLRY6LEXlMDL+U8BXO3xjXRGh8kZXP g/Fer7Y9BHi44jt04itYxiZcScRxOOtIqpUZhb204GwEm1MPU+rcXJ+oZBe7cUzRFrUX 5Nn+rNCUDMJFA2or8YIgp2Hetzz2aQLO8pMjEwavCMOtBVXhaB/Fr5x8hyzz/TsezJcz 2mdXUHy651+YdHU2l+1WLhxmA/JsODoR8m4t5KxASNTwedjcYQ/mZiUzJMmYPkTbNqTd jvxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597889; 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=5zJn479IcitDv9y2x8/xGaUK4fklDoWt49Sew7oDQTk=; b=3dF3Pc3LJihyZboRi+kojoQfdXwNpuicKtt4sZ3Q1QjLiOvACTk8+x/uCGV9h7BPAM aVbe8AFuk7aXlJpNUcW1g84tJtNSGsnyZ62RYTvbfvjKdzx0iBW35pEmsuL9CicaF1GP bRUE/2VXmaWkUlB7JkI1xQ2K9Cf4Aj9VwcWafaLSP4GOuDk4dL9rnybMj4ggEwcBIWHp qURCRcJ0t/n/rx3ZSd1+coU8JDhOLrVm7AWDJnHtxk69bWGBPze1YwP/qh6TTiFU3/Ob 5+La4rKo1kjcnV6zWf5i00Lz+vBWlDOCLzYjJbmiu7Vd60nO9zwBDhDOwaTMAFICT6sR 3hvA== X-Gm-Message-State: AO0yUKVDFx6q1BXKJQ6GJ9psnJbmdz+V6QMduSND11RQx2RuhXXah1sW hRzeWIIGnQgZKf+yev5qLHjoIg== X-Google-Smtp-Source: AK7set+LuimS/qwgMAM/OiVqoaphc/qdq8Zno+c6ljdc1DPhe5d0rox1juH27r8CC5IvDEYLWrkEig== X-Received: by 2002:ac2:4159:0:b0:4dd:9f73:f3f7 with SMTP id c25-20020ac24159000000b004dd9f73f3f7mr770788lfi.64.1677597888954; Tue, 28 Feb 2023 07:24:48 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:48 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:33 +0100 Subject: [PATCH 09/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-v1-9-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1416; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=0FyKqrw1Z2G70EdUUzUQkOOkBEgG1egwrSn1MIrNYrM=; b=UN8UtyczdV8UrzDPjLnovtj6Qv0MdUw/ClSqkBV90i2Hmtes5INpWmt+IHINqWRSxMRs3JHoxcLB d6Scg9q6BSWRjG5AEzM1IciXaVnlrNv2b+Jp+ZGk0ypDxaxpUEdo 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") Signed-off-by: Konrad Dybcio reviewed-by: Dikshita Agarwal --- 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 0d137e070407..ecfbac36de20 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1136,7 +1136,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) @@ -1148,7 +1148,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1D85C7EE32 for ; Tue, 28 Feb 2023 15:25:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230097AbjB1PZ1 (ORCPT ); Tue, 28 Feb 2023 10:25:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbjB1PYz (ORCPT ); Tue, 28 Feb 2023 10:24:55 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1613B30EA7 for ; Tue, 28 Feb 2023 07:24:51 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id f18so13728462lfa.3 for ; Tue, 28 Feb 2023 07:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597890; 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=q2YOQCGUDR6LVZWl352w6X7jU8EvLQncBoIP/WOJkXQ=; b=DjaJv76Zk4rCmcRuGunlj0ep9NWS6zyfIYu7YtftiZRp9XSogaZWIrjwLSBkqKBrSY UwHRP4KC1Wuf8utc5VwOjbDOJXafiQoTunnMuCtvTfp1vuGGM6zIabUcVhJs+u+Vhh8e PxnsfrecdvR79S7DuFsFmBs6KTLFMBCTlh7bdm1FndrJVrOeloyLJmcl+Y8Njpx+ODJ+ fLerzZeHBUFc+TSzuFQCj2QYEha4IX772QEUCsUIAA4pJ8DgxdkJM+Ba+lKyHEViKsdy X/cRjUTCqTEh38M0HFqE/d0BMmKTSum3srfh5G9FnuwDxm7Yr2Kr6ODogfYyW4+epu65 72LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597890; 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=q2YOQCGUDR6LVZWl352w6X7jU8EvLQncBoIP/WOJkXQ=; b=OA+cMRHBfqJW9TAQY896P42qR4CcDhU+R3laJegxklm1UqO006FHeOZwsbPbhKTOh0 cd8HtqhGmCfbBKg1jHFEgDPWsLTjDv1oFkV7mD2oT3H7I9zgT2dHHT4uBDC33nrBWtZR Yqaq9Lz4j3aJmvO3p/Og/EstB+Aaav4CVnPnSlywiln00TH32M5ijMZIgsNTK/O0/+Ju qOILxF/1t4cKGWuDkWrH7UsZv6BIy0JOXnv3kKaxa/zN0Qx3v4XaAKrd8Xawe4j/kEZB XOhcNk6VkY4aRDxDFuGETIBpcrFGe4ElYu9BdwRhNlzs9OG2lQ+tVrNz1MDXoBNKzuKg 6mVw== X-Gm-Message-State: AO0yUKVQ93YZSfVqYnYnXFgEvcVIlY3gINTozue0eQgZ/cqktNcX4fra YNVjVWLzQGTOdDI4hYZCR6SRwA== X-Google-Smtp-Source: AK7set/a1fp1jeDKrc0EDY1QxtskC/0PyKb2F5C8WAhtnjPc02nxuFJ7jF7xX9Obt2MUyfSZhNGAmg== X-Received: by 2002:ac2:4c89:0:b0:4dc:84b3:bc5f with SMTP id d9-20020ac24c89000000b004dc84b3bc5fmr853961lfl.30.1677597890509; Tue, 28 Feb 2023 07:24:50 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:50 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:34 +0100 Subject: [PATCH 10/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-v1-10-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1023; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=xcjWJ5FvVHrRZk+7AUmASQ5Umxw+WM1469ajK0AMX5Q=; b=NT8sLJ0hPyGLMNFmZj3Ojb+rbgBq3CUiqsTP0/kwI+y700b2+PK9Qo/SpgBYegJnTPFoDLaRNmKt DlKPUMFSCO6P/lFTSi9XBfd45L5VyOjnFiJkaKQKjLJc+m2GV0vn 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 --- 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 ecfbac36de20..584c84125887 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1543,7 +1543,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 667B3C7EE31 for ; Tue, 28 Feb 2023 15:25:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229929AbjB1PZa (ORCPT ); Tue, 28 Feb 2023 10:25:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbjB1PY7 (ORCPT ); Tue, 28 Feb 2023 10:24:59 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 828922CC6E for ; Tue, 28 Feb 2023 07:24:52 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id i28so972115lfv.0 for ; Tue, 28 Feb 2023 07:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597892; 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=ZJKby1etsQJsllCrJh6jNuq7BGyySsQgLQcWxf9td0M=; b=FNAAp+L1mjP7wXirSyAnaA+f+qxBmWL+t6LCR1PQ77rO+N0YBedv9B9b834hLtkfOc zJxBpLFILWTMK0q3fviIYARGqxedttKeH2+Zd9Juw/Mgf9EwHmGMT2ryqEYdikBVUJF9 xf35aPKyROPrUdrbURlyimSj35XPGCGP86iZenLYVoGqdVAwpTeKN7lOR9PRzG1D/joJ jcjhfta8IUwLoG9kxX6U3vczWgfBsHNPSRHK8ZvV0mD+3a7XU3MFBs8mh+St6EbsmV3c srS5ipHLSL5QHJNWurzy+nblDFQ7cwKniM4Z/DP9R9h0U8/V8kbU38nj+HO8+d0aFoh3 1AXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597892; 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=ZJKby1etsQJsllCrJh6jNuq7BGyySsQgLQcWxf9td0M=; b=caA87PNSUK/y3NrmEU8vak4tz0mZp1owzVUeidLNXEsmlh82jKL5fFstRKU7P5swbe hdhak2aTWrnEg2GM9GOkxPjkVRun8Z78c3KU01KUeDMWNbfkmA4SLVlQYl8KWHR4JWNn x+98tU/EeFpPP4Vh8fRwziY+/vU7QB0foA9lP4Vg+tHia1M+NJkShMkDODmVHO7qUoPZ Mi05A7m0iAaH6D3oBfZu33WM+x/xjyjqtC4qJsqUFx57VZMjRYkaudz7N2rGKKLTEdhI cGak2JLBh7TrzqpawXSFYjED1RPCDa7l3BGPjhLOdjRFGM9LihzhHJGsVRifzIZ7NRd8 8qXA== X-Gm-Message-State: AO0yUKXyYNtW0+aDCHvQWpWl2u/QQxpWWalOU9Gk8kTAouI8DXUye6/q oj53paA0JXowhLw+f0uYt0zbWQ== X-Google-Smtp-Source: AK7set/AQ6YZAiURXkQvm9aWq/Uoeu0gY7URJDbOH5dKAUBFUMn8XKel8bpY4nppr3hNtxX+gTlJbQ== X-Received: by 2002:ac2:4347:0:b0:4cc:a107:82f4 with SMTP id o7-20020ac24347000000b004cca10782f4mr722161lfl.64.1677597891979; Tue, 28 Feb 2023 07:24:51 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:51 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:35 +0100 Subject: [PATCH 11/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-v1-11-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1021; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=NAz9W7wy6ZAwlY7CWxe3uTkj0TQJe8T3RoBED0bE9S8=; b=qtjNKvtA0yoqyrxQM0xDnZpRdingZm2zdMqL9NlB53Shbi1eO7NMqR/X3sZ9Mk+VEEGmYonr/kM1 nbVgOYKuB+sFfAJsOZ9f7Jc2AR72I4wjhXfuhh4Tllov3iBHKjs+ 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 --- 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 584c84125887..c2d134e04c30 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1563,7 +1563,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6471C7EE32 for ; Tue, 28 Feb 2023 15:25:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbjB1PZq (ORCPT ); Tue, 28 Feb 2023 10:25:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230051AbjB1PZW (ORCPT ); Tue, 28 Feb 2023 10:25:22 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EE8F2B29E for ; Tue, 28 Feb 2023 07:24:55 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id s20so13653990lfb.11 for ; Tue, 28 Feb 2023 07:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597893; 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=bZkaCJiZZhP7M4QpTnBKecqE3oGLYQNzII/qpkWF2DU=; b=pSUhAczdlcMpDN3XecezofrJ6Vn6cJgvRcxuLYVuzXR12HPdwJN2GFJlUze0lceQyG 7iV8TTth2D/JCmiICmPMWcTT1Weo9ZEqy3VuKpIqEMm+JM0lBaYsdLMHSprI3JJWb8Rj XF7Za336KhapXU7OE4KFKsGg9T6tw4dNmE3tfYE9QwqCYHatNb/4r1A/Il51TVRa5nYy 8OVVUIz/x7N2RhJf2mrCGI6xHaoUOycHECV1U6xVYrx9qLQVazwn5VXIJ41dWK3gXXYZ Q+lPuwU3S34HUCn8DRwDjQrhv4EJ9CWEVepvP7m5wvXOHfE0R2jmkEUE0OVEdR1VbiFn yLqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597893; 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=bZkaCJiZZhP7M4QpTnBKecqE3oGLYQNzII/qpkWF2DU=; b=Q0uMLPWDr7RBr1IpnoEJHR6/AW76Ug44DVfttv93Wu2D+P3G4fFmIuXkPLPjH27Z3I 2d3rg+QYH9//P0M5RmkPJSJYV0vobiNxzX7JOUD/f7lZ2lIWwKArN1TgOPvyae8uG3pc 6T4Tj8TXAmwlKoBvX1rIpy++WXj0ne2oJZB3dMclY7xHayvluNW2ui4RkbayHzRXp3hC ovSVmaJp7SCqIcdjr9HKDtV2ubuk3QcRNJN62YVzwEn/o8ePe1Om9UCQgPIKn1y54lEh r8xyJGiupIXluGZhkXBMTv4/R6IF9qS+64yGPR6eG2rke6ho1Ue/zDgSgBoVzO35I1fZ gdLQ== X-Gm-Message-State: AO0yUKU6HTzsFappu0dUCzjq+MUkZN97pvjGJlWOn2kyWMO0oiUltl7d SWRIG7kVsHMM0C1WxC94L7etugamXeuwrLPE X-Google-Smtp-Source: AK7set8GxrfZrFbu2G+dj6kvtuj6U3ZATUJ5KdP+qZVThilMOPaW6ic4cY5gVLbnoD/47yYhmWxbHw== X-Received: by 2002:a05:6512:230d:b0:4bc:af5:b8d9 with SMTP id o13-20020a056512230d00b004bc0af5b8d9mr1095288lfu.6.1677597893419; Tue, 28 Feb 2023 07:24:53 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:53 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:36 +0100 Subject: [PATCH 12/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-v1-12-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=2314; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=DnkwDzLQUiE5JvVncPl6/mqiwBIKHuhJRybXTxaOOyI=; b=+DebxnCvGPvYpYTlwV3brQl9RuhOYNr/o9edS5Tl0a0hYrTjoEBsDmNO5WO5R71OLSEZ/aEJ0kiS WkAtvxPAAKN49hkxSDw6S9PAY61oHFHaPtflX/6OHteLI87vNv29 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") Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/firmware.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/p= latform/qcom/venus/firmware.c index 1bb6406af564..10d3805dc2cb 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -29,7 +29,12 @@ 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)) + /* + * This may sound counter-intuitive, but when there's no TZ, we gotta + * do things that it would otherwise do for us, such as initializing + * the hardware at a very basic level. + * */ + if (!core->use_tz) wrapper_base =3D core->wrapper_tz_base; else wrapper_base =3D core->wrapper_base; @@ -41,7 +46,7 @@ static void venus_reset_cpu(struct venus_core *core) writel(0, wrapper_base + WRAPPER_NONPIX_START_ADDR); writel(0, 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 +72,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 +184,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49AFCC64EC7 for ; Tue, 28 Feb 2023 15:25:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbjB1PZt (ORCPT ); Tue, 28 Feb 2023 10:25:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230064AbjB1PZY (ORCPT ); Tue, 28 Feb 2023 10:25:24 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 878D730E8D for ; Tue, 28 Feb 2023 07:24:56 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id f41so13646774lfv.13 for ; Tue, 28 Feb 2023 07:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597895; 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=mv+5dN06QajiFNtKq3cylP0qYElk+b0EFltGbtCWW5s=; b=KLqV2kBPxpqQedLLP2jyVH3dv78B+IiH2UApRHAUkV6hehtDudrXUtxm8t7KBLwV/S JrT4Ua/HFFKaXd4XObOSCVdRFZTO1uRpw9yHezvZomea882YUXrYb6FytSllzRIVCGRH 2ieI6yRUz/4xVuD9yyQ65jQ1yTO40+KBj7mQsh0MMWEI8zWW7fPy1Ec+MbZ3HpGY1Jmu n67+NSUzlPoRvkyozoDJSPfA3mxTIdxDB2RCxT5y9NkIEhgP4CHI0NGRRzYe/wer8wgV Qv8xFXApmHJ1BUARK91jPZJnmnAkJa9OCOEiAOKZJUR8UWYK6Pax2/HQrzvkleBYiU1g KTQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597895; 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=mv+5dN06QajiFNtKq3cylP0qYElk+b0EFltGbtCWW5s=; b=BRpG6UUg6wvT0JsLWqzVXqKIL1E6SS3kT2W8UjjmxGukNVFHGrt7gxi0C4ifv67y1u k6kIkfmf7mbStwYengRnlCzpXkktZClp22bv9nUfttu7Wi1h1H6N53O1QpRZ7Xh1QIfv pTADGgSLEXuqw5sWdpH4BibwSV0o/gmV2O4FMVC18EL130wcykOObUF/zM5BffDDBi6I hmh7teG4dK2PwiqP+11EBIhXDWBJEri+S1Btu2WX1nc4+/wGPx9UncEAFPuotaDQGfM/ YpiiioS6d/Jm2bR1gP8B9Cl/gbhwW7s6dTtwoOwclZMrWUV3/cwWP1VqC1c6U+kgazfG nWBQ== X-Gm-Message-State: AO0yUKUJzJqa09etyB33JR6JOsrGQ5GOtcjxXLxt5nYuxBornymm8X3A 8vxrNrQBteP9kwqdbxKM0bLCUQ== X-Google-Smtp-Source: AK7set8V7zZSECX4B4EzCidKb2bc4mpAjprKUNmvbZsREWvIVZfvcp54SeRwDyRFYNl1B7n7ElgSnQ== X-Received: by 2002:ac2:59c5:0:b0:4b5:6042:d136 with SMTP id x5-20020ac259c5000000b004b56042d136mr918294lfn.22.1677597894820; Tue, 28 Feb 2023 07:24:54 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:54 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:37 +0100 Subject: [PATCH 13/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-v1-13-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=890; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3bmF96yM+QeLlPRbGOz/QxxJqjmwlG7of1Yk2fGr9GA=; b=jpgQaZLqM13yEMK+h/OFBgzPaEzZbooIJVn7HfPIUyzKP41ZQlz6Xd2WOp+5KcfwsiUhV7XhBk+H 1O/uvXECBU7gwqicK5TcpgMawKJblW3ZeTIB+4G7OajEe+qtLvM+ 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. Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue --- 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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF3D6C64EC7 for ; Tue, 28 Feb 2023 15:26:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230162AbjB1P0B (ORCPT ); Tue, 28 Feb 2023 10:26:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbjB1PZg (ORCPT ); Tue, 28 Feb 2023 10:25:36 -0500 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 1A679311F4 for ; Tue, 28 Feb 2023 07:25:00 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id g17so13713552lfv.4 for ; Tue, 28 Feb 2023 07:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597896; 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=rGxFL4MVhFGQlNfkdvC0F8xmFUE9FZn8c53afBHcPpw=; b=Sz1rSd05Z20rHlYSzZ38KwCwlmpPalfs6vDSUJvu85qVs0S3SdHjRnZTdSvG2k0KW9 XJiuKbJRFxyntrgCrBpPkLDmlrR1GlLORpr0gDIr0DxN8R6vBjWHze6YtZ3DxKgj+L0A vwHZDgAb6jSHDCGNvUz4Mv+5VTcnkA57Jx11qRoHYV9ybOMr51AXn5EsAE7WuX1qkV/x eQDo7wNcXM8g0YWjjVqlJRWEj3gBvjrAot+pIcZl1Y8fCOYT8iuvNXOMZ+nJ5xmxi3a4 Hfg7gVf4BhT5e+Ggam3o4e7QhRmW3ag52g5DENCEIQ6fdJMuIHE2XKQq7HzanKzx1+yc THDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597896; 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=rGxFL4MVhFGQlNfkdvC0F8xmFUE9FZn8c53afBHcPpw=; b=YV9CqRrJNdb5uF3RO2OsJ4kWvQV6TiEpQJXUfgeWGlwcHl5gPnC9hRW+H1QFQ3aXyM BpyNtkVfRv0wtDDJbkbXLgGtuHeoeI8Oq0ilp4r385ddEnmLNTx07/J5TD44q8emP3U+ AlLAybF2V8MwHrbKMfXTpFvnmnRzqLUOcx3RJcfJoWI953uqSghK0w+QKOJ5BHWmEsix +N5YmgHNGZyYOan5q3Wh+xJpN+Bb4ew0tIBDAlnCDna2ubJk/lsFSAH4zCHUlBx5ppI4 mg8wy8L+dyhre3yC7RMjDrSkQUt+rqdTkykHr8Bpq8qyLjJzaCzGOj8Hu+BU3d2qdPky 7xCA== X-Gm-Message-State: AO0yUKXHe55Y7e0Y+Tkx8UpEEyYEB2rKbcDEq+zxiBLPng0NGyu971dW 1K/9bAxOMIGzo4Gm6Rk0kvi0cA== X-Google-Smtp-Source: AK7set9ExYDRDA5/DRFbFN76ugSfsnisPOu/hE32eU9BnT6XpxnnIIUTVCIuGZwPNA6O4iUVGLcbdg== X-Received: by 2002:a05:6512:15c:b0:4dd:a633:2ae4 with SMTP id m28-20020a056512015c00b004dda6332ae4mr747452lfo.39.1677597896457; Tue, 28 Feb 2023 07:24:56 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:56 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:38 +0100 Subject: [PATCH 14/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-v1-14-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=889; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=NR98BB9al4sSkxNIa6+yGGigc06GdfYg0LINSGvViP4=; b=bq1okqrJvNNOMyG7tqrD1u4NAbhi5TdjqmEpSiH61gAAHn93cFWepoEQeNmUOWEqDPCUA+8apBAS o9+CJ0S9Bkl1stfo1KlchiZ070Wsl3ZZ0Mwgq0ubcaCkZLBqbpCN 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") Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue --- 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 4ceaba37e2e5..f55d6cce163c 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -688,7 +688,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3054C64ED6 for ; Tue, 28 Feb 2023 15:25:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbjB1PZx (ORCPT ); Tue, 28 Feb 2023 10:25:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbjB1PZZ (ORCPT ); Tue, 28 Feb 2023 10:25:25 -0500 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 7C1BC311EA for ; Tue, 28 Feb 2023 07:24:58 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id t11so13742264lfr.1 for ; Tue, 28 Feb 2023 07:24:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597898; 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=fJjwnbg62VoIV+g3wGZJB6SG8RdF3Rb2KodyCGNCoVc=; b=cJfVw7oQOlKU4uqeWqmtJ5mDnND5Gv9eSCxPp0BsF5PoDjIjVMRJC2MxwQZSXgymI+ dKLGvLOpWWq4rCY3ksf51uDjqPHyOYKZNMboWomL8t2gFZ0MvoEbesMBgzGD+NdkH+oI VQRyH6H7pU4aMb6H28lg6dlXhaRsDe67xkrJln6CAfm3PfR45iygkKA8oX6mAg595wva cLYBFWDgstzW3PAsHNuoIE86yox1/pB8lbGe7kyYsq3x1OM/6TJyAtBfy+yJpjtapSxZ aGEHL9VQu+EUnf37xz86UOrIfT8zpzS1TdbtytWkc25YUL7zsW52odFjqO9qZhFpd7dk dLRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597898; 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=fJjwnbg62VoIV+g3wGZJB6SG8RdF3Rb2KodyCGNCoVc=; b=BmskRjH7ygjNLcayKD7eP3cEV4bGY7iSPXqMTW5DPow7Db4H8zmtGTXNx3ltxMIlKN KjPbDIXfhqzWCTvCxpxbIp35kuuQp61xnpqHrwq7mlV6PJsSmmrF2dRL9oxJZE/FqHsa uakC2HBw3j7tPkTaEw6kcce5sE4MDCHS6lNYorCvwaibDWJpJPyphLRh/tVheLRsdIUe RcQJprYtr+D1BOEhJenVJwe2kjoby0wYHqeXwUlNTE7Xz730dItIQXwYTTmLT6bveT6B SiWAlyWuJLwXm6qpX7aQOCw8KqswIn6ggzKTyAgy5R0iB5Wbs6TDMvV3qJSnR46lwRh4 asZg== X-Gm-Message-State: AO0yUKWhN0Nq3MKYswsKxSn793zaWdiv9VueRAD43jOhk6g8SCa0x4jo zeJB1wBCJlsKr6LMc7kPveYagA== X-Google-Smtp-Source: AK7set8UYDVFnY2+lyiFY7qPi22KfVMPxTjtT30Ki4wGunWOCQOsWO3ZMXvyYbHOlXkTCUkSAm0Hzg== X-Received: by 2002:ac2:5495:0:b0:4db:3ddf:2fc5 with SMTP id t21-20020ac25495000000b004db3ddf2fc5mr750310lfk.26.1677597898068; Tue, 28 Feb 2023 07:24:58 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:57 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:39 +0100 Subject: [PATCH 15/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-v1-15-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=1320; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Ipj+E/2GvopXMeiZXXenFNo3rbuaiPJoqniqEV4u6f4=; b=yYpFAHD9FEt/i9ifsU+1GvHIR8MWYsRt5J4PXpoTTHuH+fNa/f/UmbQduZ8iuroDwnbr9T8jzEte F9wZPOoRA4hpSNdmzRjSj7VBvuKLMUjW+xb+rmSqKHWb2KihgCFb 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. Signed-off-by: Konrad Dybcio --- 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 d2d6719a2ba4..8d683a6e07af 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1152,11 +1152,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D074C6FA8E for ; Tue, 28 Feb 2023 15:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230175AbjB1P0E (ORCPT ); Tue, 28 Feb 2023 10:26:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbjB1PZj (ORCPT ); Tue, 28 Feb 2023 10:25:39 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6017D311DC for ; Tue, 28 Feb 2023 07:25:02 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i9so13703546lfc.6 for ; Tue, 28 Feb 2023 07:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597899; 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=rAMzs8/D3GkG+CLqKGbHIOZMNVZdBT4zUxTTserKPM8=; b=fTgj4BQCye+QFJd+TGndcz2V9/HhFq0+naoyvEm/uDRLku4WyQtKvAtlJhPp4SupqG 03d2+CGa5rPvz/RZhx2iXmyHJNE01HNe5B3hc1OS8n21Wrge8iMKG77irEA6svfiWRwP Chye183mpWQXFhJ0EMNbdGh1P0q8LwNFlRHuEwLOFwc2I4GPMRDJO2fhkoIXkmK/YOA+ Ad1hKGU709/4exBqQukrrr+ZTW8uhr5Ys/rfSQQ1wovXl842tG1BdiHzdYVAbWLhOrNN 2sxY1jF67YahceJ4mXwxntNkWRwwZdD9zbKfYFDcrrWAd7odpz+vUf6+eASTY4Rwf76f CO+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597899; 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=rAMzs8/D3GkG+CLqKGbHIOZMNVZdBT4zUxTTserKPM8=; b=lv2qWRr/9HdiGnmuEHildSwuh+wFhLlBZvKQxb0x4AbSEm4PqQ2IIGxqwkReinzkdH N9k/xWdDIKoLZOIrHxgI9G4QZLo9lfzVo3TQVRqx3NiXnN1jJbuQWTrjVV80XEXgLepm fdJeuKb0SUzyLl4hlt7g9mk1Tp3o9GLo//reXYdzsZid290Arqwvrd/dz8m6l1VJ0IuJ vpybMffy9bnRCp59WxPDM7r8mg40tn8DeT1mWwJA1zVATqm/TVGnqgGKT6hxEZL5cd11 oxMOvoE1nEK9nQw3gtNBaSIQsiXQAOJooe/wVjd+nKRhQ/JP83kyGJ+dnhXj5Uc1gcgh HTMg== X-Gm-Message-State: AO0yUKWQYGrh9w3MwkJrXrGmqP/u4c7qAe4ZW2fzvjS267mbyWJh2KOC RFVfYEKmzo6LQyEhxMca3Gq0TA== X-Google-Smtp-Source: AK7set+/cCDe2GEbeV+EAu62iuyEYXwZj8GsS0QpzdKFcLS0jioAOhtq4u3WdA8CdzDzg9ZhKNPzUQ== X-Received: by 2002:a19:ad05:0:b0:4dc:4c4e:4e57 with SMTP id t5-20020a19ad05000000b004dc4c4e4e57mr780174lfc.57.1677597899573; Tue, 28 Feb 2023 07:24:59 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:24:59 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:40 +0100 Subject: [PATCH 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-v1-16-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=7822; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=L4FYzle02y9uvKTHIHpQ1Os6j/IrMhV3ERNraLbSNOQ=; b=OT8V9DbcUPVFRNWzvCmVFMGfnPjmVy1mAj8oY+MnaHdgURKutDemmqwPiXnJHsx+SCwt84zmCfPM tv9qsk06DaPi1xq4YlQJlZdrKeZYCUPmbV0C3/67Y0r5TeIZOcO6 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. Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue --- 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 ab6a29ffc81e..502f45da84fb 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 8d683a6e07af..8c35670f02f3 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1150,17 +1150,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; @@ -1172,6 +1161,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 f55d6cce163c..3149b032a1e8 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -857,13 +857,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; } @@ -977,14 +977,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 cdb12546c4fa..0ad5f9926c2e 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1131,7 +1131,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); @@ -1139,7 +1139,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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31112C64ED6 for ; Tue, 28 Feb 2023 15:26:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230052AbjB1P0K (ORCPT ); Tue, 28 Feb 2023 10:26:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbjB1PZk (ORCPT ); Tue, 28 Feb 2023 10:25:40 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEB8D311FC for ; Tue, 28 Feb 2023 07:25:04 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id f18so13729207lfa.3 for ; Tue, 28 Feb 2023 07:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597901; 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=eihSZiwgZ6E2xYB6tBxQwPxo/1weB3lZJYhUgr716R0=; b=iZne8soTXQSAFkA31CLy56qpAcfb3w8dOqu2GvAqQAOoh2F6nv0pUllNXziBTLDKgg TMJWrdGit7aMLmqSlNn1Clkm6H8z3LOnf6JLIqEAT6LSypohzhubatiC+vmydQhKVlOa M7Bk+eeLR/vV7u5DBjF4LtjLIcYgSN/59BFYNFkKWNcHVWfwYU6jLXCC5ABp2qoMgOpH obtcCBJiMFm+P9/FPkcr5leTZeCaw0RlKochX25oyqVv+jv0ORRulsgbPJxSJr3mmtF4 Fd/ZqqrSPfO+o1CiFIt54K3IE9DYZTlzTpws3QqdDjpTEJjL7s5Z8V3vQuX/XVfwDt6s FspQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597901; 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=eihSZiwgZ6E2xYB6tBxQwPxo/1weB3lZJYhUgr716R0=; b=qUCZYgbh1rv6X5DP7EhgNfyAATKfUzzgBDvLwN6hobZ2W4hx2MuE5lZSvBtcZ9WjgN df97Z5NQ1ItkP9/pLJ922qSSzymYgfAcyUE2pYoWvhxOe5BN2mxCM/vm6g8vVa47PiW1 8u1hO0w/HF8z0TB2MvA00jm93ofONLU9T0iqupMkXJRIBR6JNiFFTE8OqciAuJZG4aJH aO6HzmI9jGSFCDNWAVE1BCBDuhexHyiOVtzxbIrfAxfCKvBn04fPdgTJzlwSNJa45uI0 h1YGs1VCNrQ6V/lPcO97ZVyDtAS0ktt6n6A8XKH120rTZxXYoXAxR7lWNEGQdv0UwM/1 asMQ== X-Gm-Message-State: AO0yUKXmjKCCui/Fmg+O1zDfKbsxO70SVF4V8MXvrklW0qGqGmKKFxiB susWeEaHpQEDdBWBsbkoBKeSmg== X-Google-Smtp-Source: AK7set8AAkv5WYBlc9LciR0jKllGR7cHtpOxJpq2SPV9qTKjK9shySAtaU5Gw41Fhy7qmuUcPRW0Ww== X-Received: by 2002:a19:7404:0:b0:4dd:a02c:5817 with SMTP id v4-20020a197404000000b004dda02c5817mr822266lfe.22.1677597901101; Tue, 28 Feb 2023 07:25:01 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:25:00 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:41 +0100 Subject: [PATCH 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-v1-17-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=4416; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=wZmtHBSeLXcghfRfyraSJEKtKF8I/yxpGdSokA4JG+Y=; b=a2zLs3lnOrnkrQugMN+EC1ojEqX1ZH7Pl0s5cY1pmw4Cby63ZtuKxki1I6AsfowIQTxKJWXL2J8D b58Dao15DaG8aVoP9qyrtm2vogQoDn2FcMSQB3HXe162Z202dWIM 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 to HFI-ver-independently set the correct fields in hfi_buffer_requirements, use it! Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/helpers.c | 5 +++-- .../media/platform/qcom/venus/hfi_plat_bufs_v6.c | 22 +++++++++++-------= ---- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/pl= atform/qcom/venus/helpers.c index 502f45da84fb..aa7a2059bec1 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 ea25c451222b..d3466b46c868 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.39.2 From nobody Wed Sep 10 02:27:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8E3AC64ED6 for ; Tue, 28 Feb 2023 15:26:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbjB1P0H (ORCPT ); Tue, 28 Feb 2023 10:26:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbjB1PZk (ORCPT ); Tue, 28 Feb 2023 10:25:40 -0500 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 8BEAD311FF for ; Tue, 28 Feb 2023 07:25:07 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id g17so13713955lfv.4 for ; Tue, 28 Feb 2023 07:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597902; 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=kE5qtocuEKQZmcQnu8pU7d1MvorKMTiIpTuHnp8IGa4=; b=RRNTWmHDO9f9TjVnKvzAUhBW18p6cwnxJ10EVuM8khyXpQ+Kd172+fQVK1tC0e8YRl FUbODvvXN84ZskjHNFelg8FsL6gviqtAHE8Ng+l7i66+gziandxiRxnpyCYOeaUWxbzx 6qz0J/4FoTact7/3LDmzbaYv51GsUuMKTcXcMJErpQOOp14Zvw09p8lcPpGbPrO9M5RI 7kYsAkzKoD4BzzbrMoejgJnO7l0+rSzMMb4VwmKJgJqh8l+YZ/NAmdCYhWrb3qR8PpEr 1b2Z8nyqUlf6dqbn8ra8TyCJBePAvFGQB3dBqV3vOJO8fkIjWH89Zq8ByyExU2zljsLP dn/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597902; 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=kE5qtocuEKQZmcQnu8pU7d1MvorKMTiIpTuHnp8IGa4=; b=ahqmZrL/j0/p9l9HGRIsPCpvneLD9qL39kr7U0Tzo923JtgI9KQxNYb/Eut9gzQM+q u4oulsfWlu6iXJogvf+R0tvpnEiYZOcUAl5aRNRmRdNlHT/59tm0tN+cm7LdCHlSr+AT ylHtrwie1In4ba9Y/6YNaWng+/eh4Ht0EqKcjwyXjA2+vlUwmWY0P5fvUMiBHq1GdG1N qEJOL4ElbjebbQGhVu2r5Cd6bmMWAFKOGuS1+Q//sTI4ucQ4+S4kd/csfxvcT/Kj3N9n zZ3T/p31wdrIwJq8NKyLlwuNCFS+cS0ZKnO3n/aBOCf8+8tHSXKnT9LgkCWsFEoDmAr2 Mwdw== X-Gm-Message-State: AO0yUKUqdQWdwTdJuzZkGT0ltLq44gwteGKFe/gsCTaAU3NZI7GTB1HS JdKDdHwQyPakoy2Eov4ss0R2iA== X-Google-Smtp-Source: AK7set+FlYasr5pZxVZslOfG11xgRQjPkUPGnKe5ks/4VC8Mu6RGiXXHErfDUrC74z7gaMNOOqvL9A== X-Received: by 2002:ac2:5544:0:b0:4db:3a92:2c85 with SMTP id l4-20020ac25544000000b004db3a922c85mr986601lfk.67.1677597902650; Tue, 28 Feb 2023 07:25:02 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id h17-20020ac250d1000000b004db3aa3c542sm1363688lfm.47.2023.02.28.07.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 07:25:02 -0800 (PST) From: Konrad Dybcio Date: Tue, 28 Feb 2023 16:24:42 +0100 Subject: [PATCH 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-v1-18-58c2c88384e9@linaro.org> References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> In-Reply-To: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677597872; l=968; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=TA6Y71ujk1J+6LBhrDCzy3CI0cvIyzMJnngRH2CONjk=; b=73eGCYgde7y49wr+JZDw9uQEq4HEl69TZbPfizpfeZbAYRX4K4+0qMEOzoJk4g+BHSk19+wmjqKR Mrva4271DNcX5bTlY1y4xzXI/+bjdHrPjo+I+/YiXQhvBg+IOKIy 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. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/= platform/qcom/venus/hfi_venus.c index c2d134e04c30..deeceb86414d 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -463,7 +463,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.39.2