From patchwork Tue Feb 28 15:24:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657626 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 72B7BC7EE32 for ; Tue, 28 Feb 2023 15:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229504AbjB1PYj (ORCPT ); Tue, 28 Feb 2023 10:24:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbjB1PYi (ORCPT ); Tue, 28 Feb 2023 10:24:38 -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 26B4323DAB for ; Tue, 28 Feb 2023 07:24:37 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id m7so13684644lfj.8 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=eqwAJhTG29l7qm8brepG82DqrHTl5gU1d8zFWDGv4uXHm6H1stMA/V4vbdDY9/ZkOH gfyZNFvFm7dCodADxyiTa7jG57c50TFQUI49bpYj/5U5ob3JrfLbKiEbSw9YsHRW45P/ QXuAcEwIAA8cXNxUD6Ta2/ftVnPBPGUM/gUj3pTVf1aGKdVqVOIlElp6kFEs/wFzGgl8 OqH8Iltq4q/YQTbRuV9hMIMbP53Ki9hsH7CdBHLHZG0WWx3iaLWrAuJv55im9Iq4ihSJ SWLRbU/Zb28du/Lu9aoYXcA9HWRNi5apUqeaJLdYboCXfHkEtEA7gKSIy5KwwJix/aSX 0n3A== X-Gm-Message-State: AO0yUKVUSiDhv9TMF9v69HAjshRAezyZRIlcykRldt9VoHfgY/dOVvPu JUj1uRWirp+nbVCBT4vWMpymTA== 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 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-media@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 IS_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 venus_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 = true; ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator); From patchwork Tue Feb 28 15:24:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657625 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 5BF86C6FA8E for ; Tue, 28 Feb 2023 15:24:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbjB1PYr (ORCPT ); Tue, 28 Feb 2023 10:24:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229589AbjB1PYl (ORCPT ); Tue, 28 Feb 2023 10:24:41 -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 9F4D923C7E for ; Tue, 28 Feb 2023 07:24:38 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id k14so13674495lfj.7 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=5sOHvGI9NjZvlUX0oA39BkUnb2zVAvQY97PdFt22nh2sdJJsQSHmYFegBIW8uhjYtY GHc+U5n6hYJANXJik2XtTraSn+X0Lh4Dqx7R/5xMQbpQI77bbPm3DUDIfrqBpyKZ4+R7 jKhoubDT+zxTgzGrWkD0snyxna2hgnCdBxHHhY2lXamFpuOLngAIY4ZYq3JHCyKbIe7O 9nx7e+SQbmQb6jvngNOkL1hE3GZ2ZE2AnBr4BZg0Gc4+uJ08Lq4DgtUOe11mm12eWKsh tHKjdUgWSIabJB2wWFjdgxbGZ1Y9v9aX+6x4oO/htZbIdapRsLo2zgdJk7/obcI52ycJ py0Q== X-Gm-Message-State: AO0yUKXhqb9dO4pQQx+l507GeUJ6zigSBYMw/xJJ+WIiDMRuzH7QVO3v JmbQ29QIJtPMao2JjB7UC2sqEA== 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 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-media@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/platform/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; }; +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 == HFI_VERSION_4XX) #define IS_V6(core) ((core)->res->hfi_version == HFI_VERSION_6XX) +#define IS_AR50(core) ((core)->res->vpu_version == VPU_VERSION_AR50) +#define IS_AR50_LITE(core) ((core)->res->vpu_version == VPU_VERSION_AR50_LITE) +#define IS_IRIS1(core) ((core)->res->vpu_version == VPU_VERSION_IRIS1) +#define IS_IRIS2(core) ((core)->res->vpu_version == VPU_VERSION_IRIS2) +#define IS_IRIS2_1(core) ((core)->res->vpu_version == VPU_VERSION_IRIS2_1) + #define ctrl_to_inst(ctrl) \ container_of((ctrl)->handler, struct venus_inst, ctrl_handler) From patchwork Tue Feb 28 15:24:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 658011 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 EF0D4C64EC7 for ; Tue, 28 Feb 2023 15:24:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbjB1PYu (ORCPT ); Tue, 28 Feb 2023 10:24:50 -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 S229921AbjB1PYl (ORCPT ); Tue, 28 Feb 2023 10:24:41 -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 F1C1923DAF for ; Tue, 28 Feb 2023 07:24:38 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id t11so13740832lfr.1 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=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=ld7my3mv9og+/X5Y0NYOkPs9cAemTrrZIbV/iIUqiJ585W4XAxlv4/N4mzhEq1tkmH Hdvy2jMuS5gKCfe8fxcUEmG9tGJSqzGIIVrYNCtMERv2YZv3Vlu2lhzaxH1k8u8Dbcf4 tuDXxz9qzz1B3CSkMnXqmPArGx9Nf00/fIa9e23/k3dP02c7uCwg8A7TZDkSLKAnzjxN Puq3r5iBBDbUEGSk/7GlFF9CGEeyzLmfkB3hBffo3QTVxuc/n5Y7hIFDcr6hTOhXpLeB fBBqIth4VoS4yGIwn98ZvwQf4pv6rpFXwGfzd5+V1RnS0fb7YXB/aKC88LqtKDxP9IzS LkoQ== X-Gm-Message-State: AO0yUKXLo8K0SMR7IKty789e9kxSmYc88sxAYt6Z7eFuS1j4vSwAJKHN Ywbqihnf8D6V7AXrToqh8gMbOQ== 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 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-media@vger.kernel.org Add vpu_version where I was able to retrieve the information to allow for more precise hardware-specific code path matching. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 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 = { .vcodec_clks_num = 2, .max_load = 3110400, /* 4096x2160@90 */ .hfi_version = HFI_VERSION_4XX, + .vpu_version = VPU_VERSION_AR50, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, .vmem_addr = 0, @@ -711,6 +712,7 @@ static const struct venus_resources sdm845_res_v2 = { .vcodec_num = 2, .max_load = 3110400, /* 4096x2160@90 */ .hfi_version = HFI_VERSION_4XX, + .vpu_version = VPU_VERSION_AR50, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, .vmem_addr = 0, @@ -758,6 +760,7 @@ static const struct venus_resources sc7180_res = { .opp_pmdomain = (const char *[]) { "cx", NULL }, .vcodec_num = 1, .hfi_version = HFI_VERSION_4XX, + .vpu_version = VPU_VERSION_AR50, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, .vmem_addr = 0, @@ -811,6 +814,7 @@ static const struct venus_resources sm8250_res = { .vcodec_num = 1, .max_load = 7833600, .hfi_version = HFI_VERSION_6XX, + .vpu_version = VPU_VERSION_IRIS2, .num_vpp_pipes = 4, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, @@ -868,6 +872,7 @@ static const struct venus_resources sc7280_res = { .opp_pmdomain = (const char *[]) { "cx", NULL }, .vcodec_num = 1, .hfi_version = HFI_VERSION_6XX, + .vpu_version = VPU_VERSION_IRIS2_1, .num_vpp_pipes = 1, .vmem_id = VIDC_RESOURCE_NONE, .vmem_size = 0, From patchwork Tue Feb 28 15:24:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 658010 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 6BA9FC64ED6 for ; Tue, 28 Feb 2023 15:25:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjB1PZC (ORCPT ); Tue, 28 Feb 2023 10:25:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbjB1PYn (ORCPT ); Tue, 28 Feb 2023 10:24:43 -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 9470523DA0 for ; Tue, 28 Feb 2023 07:24:41 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id s20so13652996lfb.11 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=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=zBkOSXvBhUgI2I+pp2Xh8gupgm8IkzWU82BIPv6cwF8OLBbKF03OnPjKpcXDvQ3OcC 2AIj42uG8DkN8EIZIGhQ2R4Lc+1OiRCQiV5vse6tMhCoULs0fBD6/PHfNAFHmpl9X6Ns bUPhAqEPAv9P9AlXH36W2gVFMDrAh8GF8INQJ+v5Q47/VH2tG8aoY2wySzMK3D+SZAGd ZAORg0kJPKE751L0wR8l6Ve/4eJzybpxI4pXP281tY9ijxOXHrDl4UgFYBw76Hv6oti4 Mg1q9JsNa6LMTLyAt+NQhERv/ZG/6ZNMFPgqNKvcPmEkaprQjDghIxPmhwKB7EyXCyX4 2ynA== X-Gm-Message-State: AO0yUKXKNeCw0XqlITr7l7eShdxRBGS3KeTFk7fhXP1IrkDbA85dG7vn TmW/xQPQoYlq4NaxknsTXgEjIA== 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 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-media@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 --- 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/platform/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; if (core->use_tz && res->cp_size) { + /* + * Clues for porting using downstream data: + * cp_start = 0 + * cp_size = venus_ns/virtual-addr-pool[0] (yes, addr not size) + * cp_nonpixel_start = venus_sec_non_pixel/virtual-addr-pool[0] + * cp_nonpixel_size = venus_sec_non_pixel/virtual-addr-pool[1] + */ ret = qcom_scm_mem_protect_video_var(res->cp_start, res->cp_size, res->cp_nonpixel_start, From patchwork Tue Feb 28 15:24:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657624 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 9E830C64ED6 for ; Tue, 28 Feb 2023 15:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbjB1PY6 (ORCPT ); Tue, 28 Feb 2023 10:24:58 -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 S229939AbjB1PYn (ORCPT ); Tue, 28 Feb 2023 10:24:43 -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 E349027D50 for ; Tue, 28 Feb 2023 07:24:41 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id t11so13741046lfr.1 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=6HH3i67WFv+SS5A+P/1qIgwK8cbjuuRbfi4gJ/tH21SfBdSX5r4y7fu06Nxcl2eOyn QYqUskZEhoKkKxtZ1XeLqOBFPwz9xNZikLOtBuM+p2ohl91C3jnqYb66e16JRlTx8AL6 OZmOxkbrWUAnIlFBscOAjb+sJOn728uKJB70Aw7rb2HfI66PLmvvqYHvBAGCvKgG+0C9 N6PWUPg7pg99uWd1//94RGA1/tVaNE0O6l4vuf3DrxhN2KSKJX/FIgmU8m/jZOJqk1qZ 2Fnv5Y7rEBm7oMQckHGrZD6NIcYrBbDiqmZmktMzV35DQtiHif3r4DL6In5JPzREa679 ocYA== X-Gm-Message-State: AO0yUKV1zCWmx/LGU32y+5MQAGdhuRvb70k8YDS8n2v3tu60vgwCMeUZ b4B8lrpfT4IJMBi269mDEYGlZA== 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 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-media@vger.kernel.org The current assumption of IS_V6 is overgeneralized. Adjust the logic to take the VPU hardware version into account. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 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 *hdev) { struct device *dev = hdev->core->dev; static const unsigned int max_tries = 100; - u32 ctrl_status = 0, mask_val; + u32 ctrl_status = 0, mask_val = 0; unsigned int count = 0; void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; void __iomem *wrapper_base = hdev->core->wrapper_base; int ret = 0; 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 = readl(wrapper_base + WRAPPER_INTR_MASK); mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | WRAPPER_INTR_MASK_A2HCPU_MASK); } else { mask_val = WRAPPER_INTR_MASK_A2HVCODEC_MASK; } + writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); @@ -480,10 +481,11 @@ static int venus_boot_core(struct venus_hfi_device *hdev) if (count >= max_tries) ret = -ETIMEDOUT; - 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); - } return ret; } From patchwork Tue Feb 28 15:24:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657623 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 E8E14C7EE32 for ; Tue, 28 Feb 2023 15:25:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229935AbjB1PZE (ORCPT ); Tue, 28 Feb 2023 10:25:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjB1PYr (ORCPT ); Tue, 28 Feb 2023 10:24:47 -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 ABB8324115 for ; Tue, 28 Feb 2023 07:24:44 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id i28so971422lfv.0 for ; Tue, 28 Feb 2023 07:24:44 -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=1rBjlg8YkJA9ebQmlFPajjxk7oqODRudiVgMbguyI0e9mPIZs1bYWycNgMdCS1ksfm V6/pXboGpY+PTIMpzVozLMwBm98N97u7rABdwGiy62SD7W5cjnDhQKUOlXcNeQfEzaXN YXqh2XbaHug8X7Fl5Ga1OT2RMHc6MMDOmKDbyo1QAA+9is6uXE+vV3naa811jDPK9azf OLC4ci27fXBoWdlc7pPUeIbDlVfIs+2YmZVReg7J/BvMUxCsKRHw2bbmAQ1aUn4r+F8B h1Er3JRgQNdUtBFLYi+h+C01/oazWGIrCvlPI61rzCWdOqJ0WN8qtRsW3MgjKVQAbdKL os7g== X-Gm-Message-State: AO0yUKULm86NMLJ83AHxIXnT6ochOQLtfkEoCTbmCb+lhTz3G+28KFjk Y2227DLhgTiiXRHHWX9znVjY3w== 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 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-media@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 *hdev) void __iomem *wrapper_base = hdev->core->wrapper_base; int ret = 0; - writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); if (IS_IRIS1(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | @@ -466,6 +465,7 @@ static int venus_boot_core(struct venus_hfi_device *hdev) writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); + writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); while (!ctrl_status && count < max_tries) { ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) { From patchwork Tue Feb 28 15:24:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 658009 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 BA7F4C64EC7 for ; Tue, 28 Feb 2023 15:25:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229972AbjB1PZG (ORCPT ); Tue, 28 Feb 2023 10:25:06 -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 S229964AbjB1PYw (ORCPT ); Tue, 28 Feb 2023 10:24:52 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D2582CC6F for ; Tue, 28 Feb 2023 07:24:45 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id t11so13741337lfr.1 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=GymEurDsKftqX5YBWUuD+qtxg9o3hdNo5xDolEZ7dkR+/FVRodk7ccAZo5gnpQrDq1 dnUnAAAmOidUWOu8UAIxLkDidZ1VuGhGg7odVevkbfP8VGKv7Cb9Vr+11c+U25HEtsLs Pq/i0HCmk/SGiodJ87a5BiA9NgcaG9CJPHUuFySMR2OCxD/wY9nc9rF9N8uIwU7BiJxG 2Plr/zC10W9ztHAXU7H7PzUpdaWmCokau4SaCG7o30016e5eKe0i+ozVWKbkfMCNTBti zVZE5l8eXYJJTqh4ki1NqJajypKJ1OqUL46rVj7MOXWfXZ7vAoL7Tdk0SOq+qi6vsuJd vm5w== X-Gm-Message-State: AO0yUKWcE5dU2EhPlVFjEjloaPHxYr8jR/i64CG1jkgqYXIaZkIkJyJm kRB53hBdd48Bthad+sW4ZZhBtg== 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 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-media@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/platform/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 *core, u32 type) static void venus_assign_register_offsets(struct venus_core *core) { - if (IS_V6(core)) { + if (IS_IRIS2(core) || IS_IRIS2_1(core)) { core->vbif_base = core->base + VBIF_BASE; core->cpu_base = core->base + CPU_BASE_V6; core->cpu_cs_base = core->base + CPU_CS_BASE_V6; From patchwork Tue Feb 28 15:24:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657617 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 F33EBC64EC7 for ; Tue, 28 Feb 2023 15:26:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbjB1P0v (ORCPT ); Tue, 28 Feb 2023 10:26:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbjB1PYx (ORCPT ); Tue, 28 Feb 2023 10:24:53 -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 94B2930E8D for ; Tue, 28 Feb 2023 07:24:47 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id f41so13646186lfv.13 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=O3TnwHz1U1ly19yiY0luiGn4KmIoDftDyklmMrgXqPd4WOlRULMsnO4LXnMIKarWVy fwqEK6a6lR251NtYS11MlWel96sJLr9zQhpMQtQrOI++4ktXYTKW9Yb+kUwx4imaJnJe eCHx8f0zN6dD/T2zP/l/leY5jCwa8YF6CyuDJN0zRswGNddzAvIaBZJWaQ9RFr7X1QfU 6dce1DnbGdJITkf2i+glDhkoq6+DPlukBrzD2izht2l3QHITrrPVf7nG+dUCVi54IFq7 OlVBVg0IXyD+T+t2cBdTLmlKWC9FX/mG5GZN4ONHxRTXM8ERc3g69s34X8HPoj1Rocqs dSsw== X-Gm-Message-State: AO0yUKWYlIKDqm3yrQbiZpqxEMPp1EjyapHSnnH63/PRDGvmKxkM239V VYFgnAXqZTQggNiODDr15ICvVg== 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 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-media@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 *hdev) u32 mask_val; int ret; - if (IS_V6(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6); - if (hdev->core->res->num_vpp_pipes == 1) + if (IS_IRIS2_1(hdev->core)) goto skip_aon_mvp_noc; writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); From patchwork Tue Feb 28 15:24:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657622 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 E7BD8C64EC7 for ; Tue, 28 Feb 2023 15:25:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230049AbjB1PZW (ORCPT ); Tue, 28 Feb 2023 10:25:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbjB1PYy (ORCPT ); Tue, 28 Feb 2023 10:24:54 -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 66A08311E8 for ; Tue, 28 Feb 2023 07:24:49 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id m6so13710789lfq.5 for ; Tue, 28 Feb 2023 07:24:49 -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=WPPl71zcS6Ym1KXDRVjJei+2rG/lwoYpsgPDrjCIEYj8Y7NMWR3RGYiUlEM9LeuXvS Oi+8iLZyH3tjFdWc37ToLciAeiBY75Acnv4eU30mivE+WK3DStjf1gRjyzR1znWS73O1 aHAMOksAF+o1SBOIB7jospR+FbwQOwDmHO53GNG8oTUKVT1DCM4ets8TQqUXv9ZYMAcG XG+4qWXbwENOan1QC8AHnkaxTH5qhfcQ30YmirTCrfjh2Bo16vDmNmGRsCVPpUc/0GmE snR24aUaTwhBAglbCYjDpo9mBxWVZMquu6VceDWpA1TnZnYgRt2vp8sNK9qHlEgKFPhm jhCQ== X-Gm-Message-State: AO0yUKV4usLs7++OO2OvsIVdo7BHgglBfe/IiSP4xx6QUacwcb/Ch9kh 5nK1/tpXUikkgtsFbB4pliV/hA== 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 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-media@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 = hdev->core->wrapper_base; status = readl(wrapper_base + WRAPPER_INTR_STATUS); - if (IS_V6(core)) { + if (IS_IRIS2(core) || IS_IRIS2_1(core)) { if (status & WRAPPER_INTR_STATUS_A2H_MASK || status & WRAPPER_INTR_STATUS_A2HWD_MASK_V6 || status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK) @@ -1148,7 +1148,7 @@ static irqreturn_t venus_isr(struct venus_core *core) hdev->irq_status = status; } writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR); - if (!IS_V6(core)) + if (!(IS_AR50_LITE(core) || IS_IRIS2(core) || IS_IRIS2_1(core))) writel(status, wrapper_base + WRAPPER_INTR_CLEAR); return IRQ_WAKE_THREAD; From patchwork Tue Feb 28 15:24:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 658008 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 E79F7C64ED6 for ; Tue, 28 Feb 2023 15:25:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230085AbjB1PZZ (ORCPT ); Tue, 28 Feb 2023 10:25:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjB1PY6 (ORCPT ); Tue, 28 Feb 2023 10:24:58 -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 52CB02594E for ; Tue, 28 Feb 2023 07:24:52 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id s20so13653776lfb.11 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=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=EPm4kKCXqNzTZID5g8IXYUZQmN5UCtfkzVxl5e1A3bHOSkxRFODZxxVBL0SJtCPML0 pmQRD26IXzvXl+Kvx39t++p4a6B3OFD2j8Wdr1KdkU56iDwuwWLvgXOllK/r9V9w7Rc8 R/ErK2GHhVglVNvic1s+sJofK+mb2Lqt+jN34C6SHV3DHaQEU3RiNZNX6ZmfIYJCcGWw c2AYfm/WgnDKctafV2HoGA8Kw33MNlrYAHqAUEFgPRGBDfMe9JTqoZkeY5oj0QCuV182 2KnNNqqgcyIZUaiBZHb8DzxnJl7q0i+bOdxK2UGer14rdQCG3lWq6qnjJpxdJ7oN5kFC +wXw== X-Gm-Message-State: AO0yUKVPeYK+NQWvlbUjudmQr3rvgTwXN4HEtzdv3mJ9vZPINh9HBKYO HhPJm3Iv6xlO5wtd0q2i5LPJcQ== 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 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-media@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 6xx") 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 venus_hfi_device *hdev) void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - if (IS_V6(hdev->core)) + if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); From patchwork Tue Feb 28 15:24:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657621 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 7AE05C6FA8E for ; Tue, 28 Feb 2023 15:25:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230098AbjB1PZ1 (ORCPT ); Tue, 28 Feb 2023 10:25:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbjB1PY6 (ORCPT ); Tue, 28 Feb 2023 10:24:58 -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 8B96F2CC77 for ; Tue, 28 Feb 2023 07:24:52 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id f41so13646571lfv.13 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=6aWvgdptJb9ua/Ejhi4o7AyiUXYRje04AH6VkqkaA9diy7rjsIofARpDmdXQPPI0B4 e27j8rgF7OagsZRJ4Tw4XdNMDblM/W20vJjNuS8UJvoCOvyDtN08L1fGbZ8vyCl3ohQx gd7HXiMHpZBboZDYYcL+llAC18QGUfGHZa1ERc6xh5wTc6GI9IHYOL4bBbFupTYLR40d KshG8l7996njERe3QtHttUGqdnaFdE1mbPJjy43dcyhCpz6ik6jte2RYVPl8TYJAK9xA vC1bsiZ9Lc6UltrHr+jy7yED0cZ6abag/aWBeQbU2q7JnoUm5vMrUV6zvD4HAmC6H6Dc DhdA== X-Gm-Message-State: AO0yUKWCsuk3Fipd8FbEC7oQ4CATY0wAG9NQ8fylNVkJfsHminP1+ud7 RvuB9nlV7cOrUlKYwCW+uuGRQ8Ml9tKqGAmw 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 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-media@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 6xx") 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 = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - if (IS_V6(hdev->core)) + if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); From patchwork Tue Feb 28 15:24:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 658007 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 A1DDFC64EC7 for ; Tue, 28 Feb 2023 15:25:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbjB1PZl (ORCPT ); Tue, 28 Feb 2023 10:25:41 -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 S229976AbjB1PZV (ORCPT ); Tue, 28 Feb 2023 10:25:21 -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 EB33A25965 for ; Tue, 28 Feb 2023 07:24:53 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i28so972221lfv.0 for ; Tue, 28 Feb 2023 07:24:53 -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=8QpX3X2aAHZ+/yjyRNnBxEvECX3nr1ggHbcGo+0RzMEj2DUbbmAceadYDqzVnT+xYF 8YVo+IGyZ9WFer13nd7n6IHLCSRWs8DY02O7q15aWLKyCmCuOcaBbrtFgaBuswwvSH5K euvliuoWxg00nHA6fZeOgLrPVq3EKKJUsjupXeuo4PKSCVd8jIs0KQhVs3f65bgKUIEb U6XJa85bVr8x5/sS4aQYCVzll28s2eaBOfQt2r0TY5pfh211Qpkd2yiYLqVeU4MQnlZf ko/J6h3bFrUEtwBcEm3V2stw41AyAd0GJlUS0cew3o7ChtDI5PffNCFPLbUVI8rQ1LZf rDmw== X-Gm-Message-State: AO0yUKUyx7KOU1shtWpbFIHeHrEkh6GR1zzLbxX6xMJu/4mHV0zopUFp 8KHwV0wM6e1Y25xMP7yVCgWFvg== 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 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-media@vger.kernel.org Most of these checks should have checked for TZ presence (or well, absence), as we shouldn't really be doing things that the black box does for us on non-CrOS platforms. The IS_V6() check in venus_shutdown_no_tz() should have checked whether the core version is IRIS2_1 (so, SC7280). Fix that. Fixes: afeae6ef0780 ("media: venus: firmware: enable no tz fw loading for sc7280") Signed-off-by: Konrad Dybcio --- 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/platform/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 = core->fw.mapped_mem_size; void __iomem *wrapper_base; - 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 = core->wrapper_tz_base; else wrapper_base = 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); - 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 resume) if (resume) { venus_reset_cpu(core); } else { - if (IS_V6(core)) + if (!core->use_tz) writel(WRAPPER_XTSS_SW_RESET_BIT, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); else @@ -179,7 +184,7 @@ static int venus_shutdown_no_tz(struct venus_core *core) void __iomem *wrapper_base = core->wrapper_base; void __iomem *wrapper_tz_base = core->wrapper_tz_base; - if (IS_V6(core)) { + if (IS_IRIS2_1(core)) { /* Assert the reset to XTSS */ reg = readl(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); reg |= WRAPPER_XTSS_SW_RESET_BIT; From patchwork Tue Feb 28 15:24:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657620 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 9F209C6FA8E for ; Tue, 28 Feb 2023 15:25:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbjB1PZo (ORCPT ); Tue, 28 Feb 2023 10:25:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbjB1PZW (ORCPT ); Tue, 28 Feb 2023 10:25:22 -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 62BAC30E98 for ; Tue, 28 Feb 2023 07:24:55 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id g17so13713425lfv.4 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=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=fbb4R9hTZ0+5x3fbYOmRkYp5PaXnEYklqA4e2o221emPY+BZs9adj5SvWaGjxLEMvD xKabRuYgbGftGdObCgLbwGEwCCrqQDbswrxu6IQOtus8HUIOA7xdEBY5iqa0s1HeEKpY 1G1Xjr8V5u991aznDW3yVIfSRSboqGz+zZTACEHmfBDtiW5oer1YcO1f9hdOL2GcK1Zt LhgsaQzqVIS5SYj9bL0DVGKar9bbrWmNnuahXx/9lrEUyeJ700qxkG6kBaR38Or12p4E 5UNzjaM2xTiZGGTRn/4adJpC9rFTO0XfcFxvSYKULcttetu9+IVcp6wfNGMivoHsHXDc O/Nw== X-Gm-Message-State: AO0yUKUIhLJIZLqzrdx5rZJSfqOF4V/DzGdvfIvTWMVoU7cDsLLOIzXN Bk1kjL+YSjqs0Goyty6W/JAYpA== 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 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-media@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 --- drivers/media/platform/qcom/venus/hfi_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/media/platform/qcom/venus/hfi_platform.c index f07f554bc5fe..d163d5b0e6b7 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform.c +++ b/drivers/media/platform/qcom/venus/hfi_platform.c @@ -80,7 +80,7 @@ hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codec if (plat->codecs) plat->codecs(enc_codecs, dec_codecs, count); - if (of_device_is_compatible(core->dev->of_node, "qcom,sc7280-venus")) { + if (IS_IRIS2_1(core)) { *enc_codecs &= ~HFI_VIDEO_CODEC_VP8; *dec_codecs &= ~HFI_VIDEO_CODEC_VP8; } From patchwork Tue Feb 28 15:24:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 658005 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 E7436C7EE32 for ; Tue, 28 Feb 2023 15:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230154AbjB1P0A (ORCPT ); Tue, 28 Feb 2023 10:26:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229932AbjB1PZf (ORCPT ); Tue, 28 Feb 2023 10:25:35 -0500 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 182ED311F3 for ; Tue, 28 Feb 2023 07:25:00 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id s22so13686338lfi.9 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=TLFKw+n3qv135a0Eusi49hIhe6FOkDkKGGzCfTq0EZZx2191BmsOYD1tunl1YZfhSi RDmijb4o6bKcj/83eXrZIGIowa1H0HdnkAZqV27ScjGwm88CoijCA8Gny9iduYd7Yn6T Z1GSppHxtMIwNppZnA/LwKc14FImLb4MTr+0Obek52Qnn8w5MFMxbjDTraObOayDD7JO +cDSnCWdDaEY/hjZJUKAwC2VY0MNgPow8wOzVIqZaolmYJZjDjTf5SrWlu+X11OwQCJe GCvrVG8jgG/InGNK/j1QhhnXrveCP4BrEfq9AbxsjMRjyKymm/z594Z6iW9+2XbW5ZZK 0NIg== X-Gm-Message-State: AO0yUKURFjKxiqa8anhW22SnjL9UU14sc1lcq1ryjDY61aVyDatvtsCA uh6ABajYrWrNVv4kFS46Uq/ImQ== 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 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-media@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 --- drivers/media/platform/qcom/venus/vdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 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 = HFI_PROPERTY_PARAM_WORK_ROUTE; struct hfi_video_work_route wr; - if (!IS_V6(inst->core)) + if (!(IS_IRIS1(inst->core) || IS_IRIS2(inst->core) || IS_IRIS2_1(inst->core))) return 0; wr.video_work_route = inst->core->res->num_vpp_pipes; From patchwork Tue Feb 28 15:24:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 658006 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 4F997C64ED6 for ; Tue, 28 Feb 2023 15:25:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230073AbjB1PZs (ORCPT ); Tue, 28 Feb 2023 10:25:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230082AbjB1PZZ (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 7D964311ED for ; Tue, 28 Feb 2023 07:24:58 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id bi9so13731047lfb.2 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=sm47Y2VQ1AAEWrmmMHwQbkrvEUke5j4k3wPfZ+iqLWt3rCblETpsYvdaVB3Mq+N/Xh 94LaB9PXrSldeg0lZRMUgDt5CIKlhiuUkxYhUszvsZDZDEOWrioJEbe+M0EIujRg82XV Rhs+85H4EkPKzazDhvztr7kH+p/6XEEwB7VcCIXsSZ62pU4dBM5Wcv7wKogVPcen0BUK RC2he76cvDXq7WjYwB1mUSanSMg5hTdrY34jO+bDBXeW2EHEjLtTIJVuKgsE1kXiByAm fAACSPF9417xQzUPPWfLZd6E+eiMY3ZexUzuBBcoOvw8bACvgxR64Fc9E+DfuzCJPWxK HMOw== X-Gm-Message-State: AO0yUKWHwyZxq4AXvJGOTG5N4bBaZwCcLmFwoZZiQbsNQBOyuNUJiIqq HkwqNG0twL9h8lODS5PaBRb9Iw== 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 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-media@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 { /* HFI 4XX reorder the fields, use these macros */ #define HFI_BUFREQ_HOLD_COUNT(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX ? 0 : (bufreq)->hold_count) + ((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \ + ? 0 : (bufreq)->hold_count) #define HFI_BUFREQ_COUNT_MIN(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX ? (bufreq)->hold_count : (bufreq)->count_min) + ((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \ + ? (bufreq)->hold_count : (bufreq)->count_min) #define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX ? (bufreq)->count_min : 0) + ((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \ + ? (bufreq)->count_min : 0) struct hfi_buffer_requirements { u32 type; From patchwork Tue Feb 28 15:24:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657619 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 A01C0C64EC7 for ; Tue, 28 Feb 2023 15:26:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbjB1PZ7 (ORCPT ); Tue, 28 Feb 2023 10:25:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjB1PZ0 (ORCPT ); Tue, 28 Feb 2023 10:25:26 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0599F311F2 for ; Tue, 28 Feb 2023 07:25:00 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id t11so13742377lfr.1 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=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=o9asF+GRU+rWlSxwSwODE8csNt3ih1PsJA2c/dO6+NzW9SDuszbdYtKIpot14DIhqm nK8ER17y/wqRPsOakXH+jowZI7CgbTRXcDJ2QZ295RbuPNHbyp9dTTSGDroR7L532zs5 cBX5o1VKEwxeS6g04N6HN2gGnfS0eGbnsFCTybQeQltWBxgAup86A9As3rFIYh0I3YKi 7h2ilGoNrP1/PLCpQzp/JhKCo8nMKJySChPr0bmWQ4Gd+65FDhMwPAhy2vA4KJTJlwvx b9P9zep3+EyZcJJiBaVAikfKZipLKDnouyybm/ivH4ktqhuOb9mu1srUXisJFMeEOPqF Z58A== X-Gm-Message-State: AO0yUKV2VmngvBs5mR2bzX0avzSm9x+XUf1Vc/DYp1bld+nBXo0OsHOB ZuhnGQAk5bC0mhXHBIvJGLcbAA== 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 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-media@vger.kernel.org Currently we have macros to access these, but they don't provide a way to override the remapped fields. Replace the macros with actual get/set pairs to fix that. Signed-off-by: Konrad Dybcio --- 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/platform/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; - count = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + count = hfi_bufreq_get_count_min(&bufreq, ver); for (i = 0; i < count; i++) { buf = kzalloc(sizeof(*buf), GFP_KERNEL); diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 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; }; -/* HFI 4XX reorder the fields, use these macros */ -#define HFI_BUFREQ_HOLD_COUNT(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \ - ? 0 : (bufreq)->hold_count) -#define HFI_BUFREQ_COUNT_MIN(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \ - ? (bufreq)->hold_count : (bufreq)->count_min) -#define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX || (ver) == 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; }; +/* 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 == HFI_VERSION_4XX || ver == 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 == HFI_VERSION_4XX || ver == HFI_VERSION_6XX) + return req->hold_count; + + return req->count_min; +}; + +static inline u32 hfi_bufreq_get_count_min_host(struct hfi_buffer_requirements *req, + u32 ver) +{ + if (ver == HFI_VERSION_4XX || ver == HFI_VERSION_6XX) + return req->count_min; + + return 0; +}; + +static inline void hfi_bufreq_set_hold_count(struct hfi_buffer_requirements *req, + u32 ver, u32 val) +{ + if (ver == HFI_VERSION_4XX || ver == HFI_VERSION_6XX) + return; + + req->hold_count = val; +}; + +static inline void hfi_bufreq_set_count_min(struct hfi_buffer_requirements *req, + u32 ver, u32 val) +{ + if (ver == HFI_VERSION_4XX || ver == HFI_VERSION_6XX) + req->hold_count = val; + + req->count_min = val; +}; + +static inline void hfi_bufreq_set_count_min_host(struct hfi_buffer_requirements *req, + u32 ver, u32 val) +{ + if (ver == HFI_VERSION_4XX || ver == HFI_VERSION_6XX) + req->count_min = val; +}; + struct hfi_data_payload { u32 size; u8 data[1]; diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index df96db3761a7..c320ebbdb24e 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -99,7 +99,7 @@ static void event_seq_changed(struct venus_core *core, struct venus_inst *inst, case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS: data_ptr += sizeof(u32); bufreq = (struct hfi_buffer_requirements *)data_ptr; - event.buf_count = HFI_BUFREQ_COUNT_MIN(bufreq, ver); + event.buf_count = hfi_bufreq_get_count_min(bufreq, ver); data_ptr += sizeof(*bufreq); break; case HFI_INDEX_EXTRADATA_INPUT_CROP: diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 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; - *in_num = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + *in_num = hfi_bufreq_get_count_min(&bufreq, ver); ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); if (ret) return ret; - *out_num = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + *out_num = hfi_bufreq_get_count_min(&bufreq, ver); return 0; } @@ -977,14 +977,14 @@ static int vdec_verify_conf(struct venus_inst *inst) return ret; if (inst->num_output_bufs < bufreq.count_actual || - inst->num_output_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) + inst->num_output_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (ret) return ret; - if (inst->num_input_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) + if (inst->num_input_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; return 0; diff --git a/drivers/media/platform/qcom/venus/vdec_ctrls.c b/drivers/media/platform/qcom/venus/vdec_ctrls.c index fbe12a608b21..7e0f29bf7fae 100644 --- a/drivers/media/platform/qcom/venus/vdec_ctrls.c +++ b/drivers/media/platform/qcom/venus/vdec_ctrls.c @@ -79,7 +79,7 @@ static int vdec_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); if (!ret) - ctrl->val = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + ctrl->val = hfi_bufreq_get_count_min(&bufreq, ver); break; default: return -EINVAL; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 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; if (inst->num_output_bufs < bufreq.count_actual || - inst->num_output_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) + inst->num_output_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); @@ -1139,7 +1139,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; if (inst->num_input_bufs < bufreq.count_actual || - inst->num_input_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) + inst->num_input_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; return 0; diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index 7468e43800a9..d9d2a293f3ef 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -358,7 +358,7 @@ static int venc_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT: ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (!ret) - ctrl->val = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + ctrl->val = hfi_bufreq_get_count_min(&bufreq, ver); break; default: return -EINVAL; From patchwork Tue Feb 28 15:24:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 657618 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 B6A71C64ED6 for ; Tue, 28 Feb 2023 15:26:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbjB1P0C (ORCPT ); Tue, 28 Feb 2023 10:26:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbjB1PZi (ORCPT ); Tue, 28 Feb 2023 10:25:38 -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 8AD23311C9 for ; Tue, 28 Feb 2023 07:25:01 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id s22so13686653lfi.9 for ; Tue, 28 Feb 2023 07:25:01 -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=teCDvilQzQwMnaJINKHkGNSQXcKwav0K9rSvaEVJSoD+zajdVd5UBuJnKFQXBHUQqR bIZ8gu51g3hRCwGB0ML7CeO2Y4oi5lZifUjjPNVNBmzf0nQHQyvg32+3ryxwR7GS77oI BmovsyA6En0odbuFk+Dm4q5f08dK/uPY6Klwk8y71KYf3f6620KxlQg5/QbODpA+/S7n nVduumbVjz0Velsn56FvbRO9ZKEzi9kNf5QGMu5B/ND1L6j9PEqBYahFiKonoJX4bt5q pf2HA6MsvFsFuVXpKxzK+zDdBceomxdk9OPQri65rXtn/TKob18AQDb02b7dxCWh1uGU +AnA== X-Gm-Message-State: AO0yUKU83U+BbgBCzYycK+0pk+gJwZfUTHTknfTo3Rmy+mXkJ/BkNLa5 t4SQdYUuJZslsIBw/br2taVc2g== 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 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-media@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/platform/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, u32 type, struct hfi_buffer_requirements *req) { u32 ptype = HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS; + enum hfi_version ver = inst->core->res->hfi_version; union hfi_get_property hprop; unsigned int i; int ret; @@ -674,12 +675,12 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type, memset(req, 0, sizeof(*req)); if (type == HFI_BUFFER_OUTPUT || type == HFI_BUFFER_OUTPUT2) - req->count_min = inst->fw_min_cnt; + hfi_bufreq_set_count_min(req, ver, inst->fw_min_cnt); ret = platform_get_bufreq(inst, type, req); if (!ret) { if (type == HFI_BUFFER_OUTPUT || type == HFI_BUFFER_OUTPUT2) - inst->fw_min_cnt = req->count_min; + inst->fw_min_cnt = hfi_bufreq_get_count_min(req, ver); return 0; } diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c index 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_params *params, u32 buftype, out_min_count = output_buffer_count(VIDC_SESSION_TYPE_DEC, codec); /* Max of driver and FW count */ - out_min_count = max(out_min_count, bufreq->count_min); + out_min_count = max(out_min_count, hfi_bufreq_get_count_min(bufreq, version)); bufreq->type = buftype; bufreq->region_size = 0; - bufreq->count_min = 1; bufreq->count_actual = 1; - bufreq->hold_count = 1; + hfi_bufreq_set_count_min(bufreq, version, 1); + hfi_bufreq_set_count_min_host(bufreq, version, 1); bufreq->contiguous = 1; bufreq->alignment = 256; if (buftype == HFI_BUFFER_INPUT) { - bufreq->count_min = MIN_INPUT_BUFFERS; + hfi_bufreq_set_count_min(bufreq, version, MIN_INPUT_BUFFERS); bufreq->size = calculate_dec_input_frame_size(width, height, codec, max_mbs_per_frame, buffer_size_limit); } else if (buftype == HFI_BUFFER_OUTPUT || buftype == HFI_BUFFER_OUTPUT2) { - bufreq->count_min = out_min_count; + hfi_bufreq_set_count_min(bufreq, version, out_min_count); bufreq->size = venus_helper_get_framesz_raw(params->hfi_color_fmt, width, height); @@ -1264,7 +1264,7 @@ static int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype, u32 work_mode = params->enc.work_mode; u32 rc_type = params->enc.rc_type; u32 num_vpp_pipes = params->num_vpp_pipes; - u32 num_ref; + u32 num_ref, count_min; switch (codec) { case V4L2_PIX_FMT_H264: @@ -1284,21 +1284,21 @@ static int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype, bufreq->type = buftype; bufreq->region_size = 0; - bufreq->count_min = 1; bufreq->count_actual = 1; - bufreq->hold_count = 1; + hfi_bufreq_set_count_min(bufreq, version, 1); + hfi_bufreq_set_count_min_host(bufreq, version, 1); bufreq->contiguous = 1; bufreq->alignment = 256; if (buftype == HFI_BUFFER_INPUT) { - bufreq->count_min = MIN_INPUT_BUFFERS; + hfi_bufreq_set_count_min(bufreq, version, MIN_INPUT_BUFFERS); bufreq->size = venus_helper_get_framesz_raw(params->hfi_color_fmt, width, height); } else if (buftype == HFI_BUFFER_OUTPUT || buftype == HFI_BUFFER_OUTPUT2) { - bufreq->count_min = - output_buffer_count(VIDC_SESSION_TYPE_ENC, codec); + count_min = output_buffer_count(VIDC_SESSION_TYPE_ENC, codec); + hfi_bufreq_set_count_min(bufreq, version, count_min); bufreq->size = calculate_enc_output_frame_size(width, height, rc_type); } else if (buftype == HFI_BUFFER_INTERNAL_SCRATCH(version)) { From patchwork Tue Feb 28 15:24:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 658004 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 CBC7DC7EE32 for ; Tue, 28 Feb 2023 15:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229976AbjB1P0F (ORCPT ); Tue, 28 Feb 2023 10:26:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbjB1PZi (ORCPT ); Tue, 28 Feb 2023 10:25:38 -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 10F73311F6 for ; Tue, 28 Feb 2023 07:25:03 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id s20so13654606lfb.11 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=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=leQcoG6wR9+pZ9hirMbzNKNFXsIoredFDJBKi8kRme9jcA0MG+S3Nxubh7KKgbhYMh Y4z0q0KwHxjB0WHi6PN/mkKfkZiIPvGzb1RWM048jTfYPwlq+y+g/WWRnl7aZAY5j+4p wTCjUoH3DFKWiU16Y5B6NC2fIHJXsmDfYG5LscOxjbN53KAZfbI33HamL1MFBSmai7Jn qBAOIi3uMuw0D01O9K7SgLVk+1gvDX1qssOGn3kD0UTgdYOlp/KTmpJmra47NzK5EQNS PCQ/SDBCD+jETsUNN/YsnJs4UoTquPQFUOmuB3aCRejSrDf/2cPnoWThkhWUHMr7N0kl 1GJA== X-Gm-Message-State: AO0yUKXsGShNDprGXJ84LtPC1nQHtEk5r3miARuRknotbNllgzMs2uzm OlvP/jy/zHYwGaWvk3zmx9zypg97ViLZcjAb 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 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-media@vger.kernel.org This write was last present on msm-3.10, which means before HFI3XX platforms were introduced. Guard it with an appropriate if condition. 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 *hdev) } writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); - writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); + if (IS_V1(hdev->core)) + writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); while (!ctrl_status && count < max_tries) {