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: 62519 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3079219wrd; Tue, 28 Feb 2023 07:26:00 -0800 (PST) X-Google-Smtp-Source: AK7set91rcEcsCRANblS+SDLJKTmOAZo2xxexigmi4udpEy5Rl0h839yjGP4XlAB9S7WJm8QGFR+ X-Received: by 2002:a17:907:2cc4:b0:8a9:e031:c4b7 with SMTP id hg4-20020a1709072cc400b008a9e031c4b7mr3637790ejc.4.1677597960291; Tue, 28 Feb 2023 07:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677597960; cv=none; d=google.com; s=arc-20160816; b=ZH0ZAGqjwSrRdnIT+4YwcIwnRODTxiAhQtjwfmm4olavs/nGed6+5leLL3Ip0Jgtsf PtsUxW9mrRNrUxlXyUA1KTBjayGANAbOqiuCjgn2kU1TtXuDq112Sjga+cGmJajiq4zM +BDT1Zqaw7r/E6UsDEJavJVrsDUpmdLSRFRqVGiZNZgotafBoe8sszY/VKZCPTEh94CR VpDeZepxk47/TBHQFfpox6zOQ/9jLigwbFozA1p40/n0PaAwgNqZDHu7rmpqUwiJoW47 IvgtkGO6UTIAz5RSX0m6LAJ06KoJYt5BX3yMRvPx6cvbFTY0Ihae7yU62xZdM0xxoihU Zr/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=qXugSA6r2tV+X0iFO+lGhptFx82s88fjNq0jEwrsdR0=; b=gqI4fAUu5UXp8HppOv0TOlugXpG5pb+v9ICQa0oX/McY4rkJJV7it+L+WsW3yzZ7oO TadHVdGBytNdocIX42R2AdGrg3p4e5Kgcv9+1g3G1p1NfVEqmE93qNbYZSN2vy6kl1qh C4VsxtRa/zh7gIQ+iZv8d6mhupL1nE2zyOFErOyZNqmPzspp0/HtALi2Up7nG72jdRrU w8zgk16/JTw1rl6Eg6NU1e6bSuF9w7uqbyJJMjAskO4mxPz9jOM+mWS04JYr6ChtMYID Rs899nRy8yPwz/TZnhgzJQTp0N5SD2UyhEYNnO9Z8CqnC3Y14T7hygX6SpIbehK78K7A /iAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RPRIrotI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gv6-20020a1709072bc600b008b17bca9226si422402ejc.312.2023.02.28.07.25.38; Tue, 28 Feb 2023 07:26:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RPRIrotI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbjB1PYt (ORCPT + 99 others); Tue, 28 Feb 2023 10:24:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjB1PYk (ORCPT ); Tue, 28 Feb 2023 10:24:40 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3680F23DBC for ; Tue, 28 Feb 2023 07:24:37 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id f41so13645403lfv.13 for ; Tue, 28 Feb 2023 07:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597875; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qXugSA6r2tV+X0iFO+lGhptFx82s88fjNq0jEwrsdR0=; b=RPRIrotIE+koozd7vn/zocKpX5RSWm/6VDAD2UGrFh0IctGRRyHRnEGh+sSpoDTvRW ksd+hq83BAcnNyvyyxR8mcsHaW5kTw/hPn4rRjxpwpe74lDJvyKE5XReeUYZE3shedp/ FuNQw5+aYrryJlzGHXh+uUgxQvl2+MQpfSdpBNzfZX0nL3d6mwJI+J/Bd+gZUSVEUP2U VvrFr+johfkEaj7kJ0rmBFYyB+dj2egWh1mSU3QbsPC1ZMeft4JFzA/GQePiQc0GzxFP 0mi71GPNpc+ULpMi7owlLwbtBaG3rHwr9lYsUy/dRKxNpoDIVSg7E42CWllIVB4d2OA8 9BZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597875; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qXugSA6r2tV+X0iFO+lGhptFx82s88fjNq0jEwrsdR0=; b=z6WO7U3UARtlSGFTLQ9XctJBGi8/jlmUAL8ZypKb66svJ9HsEJkh27pKzhSNEdBHFt AfgIYArY1ia1jbYhHzPXmYJoLM2Wo0tHVeEMeHWLq9CsGUmTLmU/8FTmIk5F/M5EajD5 /h40hZu9tdl9RRDjR9Vjm4xPIwz9vbqfltNd7o7WQn21oagNWurhCiKlvhMLj0e6s07m eA+9UpWNdO/TlIlmDqn626lBxqtScozr1lGbziH9n8iHNVppxjxr6aIa7H4knihz8kwu 1ATYFeX6wjlfx8Jr2sJWDPdj1b4cbMUd+P8bAO1rP00QG5fBMkIzl/iNrVgL2bd5IJlw lzTA== X-Gm-Message-State: AO0yUKVZqCacZofUFKJ81/fnDUL1WMvTvFb/uODo3qp5aN7Wy/qW555y W817wfsRstOicsQHuZD5ElAgVg== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759088958934454291?= X-GMAIL-MSGID: =?utf-8?q?1759088958934454291?= 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: 62518 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3079155wrd; Tue, 28 Feb 2023 07:25:54 -0800 (PST) X-Google-Smtp-Source: AK7set+bS+GeCp+kSjh4KyisHCVGzBSz1luKxx52iqOMdS7BId9iBPCE09B0D2DD2gxGDb9Jf0IN X-Received: by 2002:a17:906:1390:b0:8b1:949a:28da with SMTP id f16-20020a170906139000b008b1949a28damr2550472ejc.42.1677597954245; Tue, 28 Feb 2023 07:25:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677597954; cv=none; d=google.com; s=arc-20160816; b=xN731guEdiryvFIeYj/mZ96q6bPrmljiThNR1U4s7Ro+Gu98BCC5CzqJsqjzKIgo+/ 21R+2+9qJIXcKK9haMQMFpYmB6HCXhEOK3fPzAvjH2eStQZc2y++2H7awCqn5bWO1KuU QhMJZAoyrZKASPGtVSXtM6aHGHDpNFw8l1tykf8qtJVWR6+JA2VzLKwWfhSXmOWrjgBv bUNYI8298qhWukMEM5splOL6pXvMjy/1fM0YLf2Y8rz6EUgZ/RlO+Cnwp178kKQSbhUZ FYSW6dAIIF51gi7EmMSqOtsq9aN6yFcm27LOA8fqdQaU54wh2DwKHnl1HVBVRSOe1Odn fa2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=rc6RN3xd6zhAOa0UniFbQ5+ZDyipjjg8if7hSJwNayQ=; b=AamUcO7SYEzXKNm7E+euGkuxo03jUdj5bsTY+B78m1W3xXfBK3I5c49D26+wRpEazD wgfpMiCqQhggsDN5BJiRfQcOjrvWPOfy7HsLbseLrNhTPG6y1XUbjlOuj80HX1P30Aa2 OrAXh3MXDC7xo1d+8P7FwDhdzjuUjjErbWEb8uM3Ri+uFtv/3oRdFINuEoHEEo4uHxgj VcHjPvK73eXRYctgSKwCgu3pREsCOsyMnR04gU0NF2txBv05grWJtaykEW4JBqcbKsRi RQ6skv59y23XEHjORISGu1c5qpnYpMHAGUffRI3kV5dFCsvShYjZ/YqW+h3NJk6efoTq G1sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VUwBjh2E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020a170906bc4600b008b17f6b8c9bsi11310626ejv.86.2023.02.28.07.25.31; Tue, 28 Feb 2023 07:25:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VUwBjh2E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229926AbjB1PYm (ORCPT + 99 others); Tue, 28 Feb 2023 10:24:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbjB1PYk (ORCPT ); Tue, 28 Feb 2023 10:24:40 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1F5924100 for ; Tue, 28 Feb 2023 07:24:38 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i28so971042lfv.0 for ; Tue, 28 Feb 2023 07:24:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597877; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rc6RN3xd6zhAOa0UniFbQ5+ZDyipjjg8if7hSJwNayQ=; b=VUwBjh2ERF8LYTz+KF9QEFEOZzDW4X95x4kirUH5CoxXjYou/BYrh+qs+0dkDl1+LZ ri4Sb6uofUt+ZcXScmzAImUBg21KWjSlcP+19N3XS4CMn7ekBWROgoxPW+u4WrKDnCAd UgZi/MNSDGUJUJTaNuXTpjgvQh/HAKAjw+T1XE/2gQGlGR1cN7+cBpzro2bolDhivDth nMv+3HUeWc+iv8Dfc2AkKBE/6PyXiQPPli3DxPlFkap5HIu8QYQggH0dpcfyBtNv4vxG 20PmCzCuXw+fUNBnjhFctW9ehUEdDzdfOTTatauE1WL2LOea3poz7Jsr9ic5l9OgFD7x FMug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597877; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rc6RN3xd6zhAOa0UniFbQ5+ZDyipjjg8if7hSJwNayQ=; b=miYBl/YNkQrOYQIW2cHR38VrTIKEiIpbcx+LjuoJWBkOHOkvDwxGu5McQPNGWaO6ha vSEDAr8nJ9iRAvze8Bgab/0X3q3yxvBOz1en/JzGYrN3uVACrf66o6Azr9C6igzA+wQB m62W/oj8p0IyS+oOUUF6px96ov/l9mMbzLiWFb2IiOUl7zpk3WzK71N6aXfw7dVpzjws j1VIZoRHyP8y+JaeNTVht1l8dkfjz+SzUXtHXuQxb/Nf/UzBcuenqxUy1xEP14kpwnCb GAO2FUorg+go5xAHoUC+Kbdnz45rrF5Xr/NrEHU7q/bFVagnPb7JWmGsqm0D0B9KO75d oEdg== X-Gm-Message-State: AO0yUKXLO0ODcKNpy7acul1C2Qj9JpjcFWOeyWsQkPYWCtUlVass8CHq wfEL9Y4PuNJb1x/+F2qosLPyHA== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759088952597885814?= X-GMAIL-MSGID: =?utf-8?q?1759088952597885814?= 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: 62527 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080165wrd; Tue, 28 Feb 2023 07:27:47 -0800 (PST) X-Google-Smtp-Source: AK7set9ce8f17E+jZWMChKjpjlM4w8maXGZm4+5TWjxiTRN6CLdpbRFEwXQiowKMYeo0PdaOwSYA X-Received: by 2002:aa7:c60e:0:b0:4ae:eb0f:42a9 with SMTP id h14-20020aa7c60e000000b004aeeb0f42a9mr4084870edq.23.1677598067001; Tue, 28 Feb 2023 07:27:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598066; cv=none; d=google.com; s=arc-20160816; b=xaRfgjMstmMHdwacWG7dBBD+xr3rUTNISW52XXeQJlzN5U4vE7X4AfADkSEVcQuCiZ W6PNu6EyGnyo+Co/OchJoDopa4tnTLCVZdtSFWXtHf0oI9WLDR9yDIMMCovzfRVLq8vJ BpF4aOLFFyGeHRIFoLfVJf3Bnl7x4pGwHIgNPQYOzt+TiurSl5+Hc8YsEjVLv+hq9k8l hlUi+JhDNs8pwu8mB1N3MXnzwoJUOr00RYhuFvPhReqQhVZ7sCn2Mn7RHTMcpbqTCNI4 QuK2M+/xM2xygoekhdjfv9U6MQOKwr/OxBEligvO7oG+hFbxlB7CV3w+dUcGQWFvwjAc WRWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=QaGduNCU1ULlQ2WtlYAAuJDe5x2zJJiEdNeq0M5C+Gk=; b=Sxl76mOQB8LmNX7oWDfG95sr4rYnpZvmKCGO9WQgZR16818/BTndGG98QV9yc4LHuU LJ2LD5gCw/dbCqpVkjnpjfxIUprXzwAcKAV86Gzmdq/5kj9oQyHguXObucHQgEAkKIwX 7S7zy/Arzdbgb4pAwqzh8dXmZPWMvKWroNapGSXwDOYdRBFOIUs6cExOewFkPShrcOoj 3d5sZgX9Rsa6uAJbEtPo15QhfpDqa0YYQGYvMp4oUn6jjtKdY/rAClRybmGIajs9zMY7 5+fl1x1SfAncsc6hbvB5O1Vy8KCHYOl+4bKKQSYCHVlQVCONeypEMTyZKdf0WDwLomKg nknQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Fa/Hki05"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i19-20020a056402055300b004acbdb25b3bsi11767329edx.628.2023.02.28.07.27.24; Tue, 28 Feb 2023 07:27:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Fa/Hki05"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229595AbjB1PZF (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbjB1PYm (ORCPT ); Tue, 28 Feb 2023 10:24:42 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65DEE241C5 for ; Tue, 28 Feb 2023 07:24:40 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id g17so13712182lfv.4 for ; Tue, 28 Feb 2023 07:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597878; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QaGduNCU1ULlQ2WtlYAAuJDe5x2zJJiEdNeq0M5C+Gk=; b=Fa/Hki05PBoukLOCE5VDxKeIcqwy+HqoIfP3kRLrzJCnjjZCsz0bgxY2M9/qoOJ4HZ u39h6etpitITUN7Jy8VhyJZue+YXfLhJ55iKdUy9aPEYuqrNfR6FDTNjV42MZ0M0ZK+Y AvNiNGMYd4YzRr6PLB/qNZKU0cIPXlcSQWRsE+kwej9AR8GCGx9A7TDZxzpJGTCYS0Qr cyAtH/1ejx3VmNwh89hvZNyfFSb5Sz/p/4+ZoqUEbvpv7KqVhEAly4e+wf6Hg7EUbgSR dLD5FxVfXGj7CnfiEl7M6mypRwFk+rDF7KxB/1Rrh88AGBLb1RHiL1vDDaEBe1dTS7RZ 6+Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597878; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QaGduNCU1ULlQ2WtlYAAuJDe5x2zJJiEdNeq0M5C+Gk=; b=n44w8Qqx4Vkn5UDduVqtmKzQWnyyD4XVVluhXpK9+Oys6SwjirDVJu87wM1e2BKHZD KZFwg/U8QdmTw9W/S1RvG5YoYz1bN+HUVY4MB0XkM2c4EP8v3fVB3lFApkq/6PzxONfv 4ClQp3OE2/8te6S1OI+1fLPcpKqfmr+afU4MkoReTWsLxFeqRMqC3DWF9TG6dyz7gSjx ZSiMTcII4TD1YEC4qFmKTm6Hryg3+/neW4wMjeqEBJkG7JiDh00B9u1uo0AMWxA6AcNh oI+03mXdxOk4fTVpYHTYH9wdmC5XMIJdpUkcTXnbH6yLTSsgjZd5Op5J5Pr9c8eCxFvM kXSA== X-Gm-Message-State: AO0yUKXWYGZjuUX+4OJH80mpmSSIMoglfir0kjJ6yXtQl22OSoemTqm5 h0lN8eJJmPIbb6zUPKNVA6qJGw== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089070477102262?= X-GMAIL-MSGID: =?utf-8?q?1759089070477102262?= 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: 62524 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080140wrd; Tue, 28 Feb 2023 07:27:44 -0800 (PST) X-Google-Smtp-Source: AK7set/QrIm6ICS7uQQ2cMiHgrOnj/SYh1t85vL3u9h5CT0J+Gqpd4mOU6bDyvgHN9LnY1Xd7QD3 X-Received: by 2002:a17:906:ac6:b0:8af:5403:992d with SMTP id z6-20020a1709060ac600b008af5403992dmr2901222ejf.28.1677598064640; Tue, 28 Feb 2023 07:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598064; cv=none; d=google.com; s=arc-20160816; b=eNLh68zByG4j90o/nMfI3NjjEMYZ8uOgqd3tuDDJuKboyn7eGJc0+OBqXRrWpFHNhg AHafgVomFpeEt0czbG3dCykIphrJhrPzccjgM5CqrvBeIs7dnP+Q/T7vdwca4kPADoDl a2wtrJYgwrbPvOLwuUdLEqBQkDShzeGG0XnsPQnWFMCFvVmkfxfjC02g5qir85qqDEbj sF1RQw0vEnMv4RYimE9B7sRuQIAIaBGZ91i9NQ9tZ1lWKG3ARlx+w1aXmmXqVt7uz9fu RdOtklITPBYe1+Kv6/3qfJeDWclGEJPRuOEegLJvV0pu6bxlo2LYMgWDPcuJQ4DfnXyC 5tQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Ouo8uuwT0BL/iQ4qXVVvn9es2W+dnKtqVS64weaqnUQ=; b=rqFM3hTgxg5Yur3+KxcYLixvwq/iJBOTy4/kbeMM0bFI3mboOSuVGDZuwTXZmzmVRn lTMChp/G64FPecK+fJnM6A+VPwyHkZUzR7BTlDL6q4X42LH4vXUuC2nLMam23NDd+r5G d8+WqV5u9a7HnSnacI8dslUjbttEho8rEf3Pb/FdSmvrwZRikX3uYtOddCls3zfsf/Zq tL2IXxktklmxMw5zyLaXEslpW+jAHHm8XMosvg2HNyC01id0KcO1ZWBcyBrQazgswVeB XpFKxAaGXJGqfSqCxRDexfyTdEi8uTyoHpzpywfhFe4j4l9NMQu73S7XX8d7qf/ZjH3F 9nVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MXojN0LQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s25-20020a170906961900b008b177beb99esi9969551ejx.363.2023.02.28.07.27.22; Tue, 28 Feb 2023 07:27:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MXojN0LQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229982AbjB1PZB (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjB1PYm (ORCPT ); Tue, 28 Feb 2023 10:24:42 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66F0B241CF for ; Tue, 28 Feb 2023 07:24:40 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id bi9so13729751lfb.2 for ; Tue, 28 Feb 2023 07:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597880; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ouo8uuwT0BL/iQ4qXVVvn9es2W+dnKtqVS64weaqnUQ=; b=MXojN0LQNc12UfetxbjfKcOeN3fOc8ssW4PDbnrCCAwiuiISZAMi8iZJXruAU5Dzsy dheXR6o+/1DWsozRRmd1phRIQHszUZRdmmxGq1r8y+oqBrrOQfenBMSxH2R/soLlXnqE Ru3OgG5WZFHRniWrMaM4viC7ymV85fEM3Yqt+jjhDOYCXafe6GAE5RMKckfrde+LaEZM sEaIq0VvYpgS6s00z9zH7TqnM4r3dVoyzB2f/vOlIR99WPnLJiO3BfvZ/RJUhhJ2rxCB 4+QXRnpXxmxvzjrU333C8uJn6Po1Ep6EmbDT1P0YzJgsN/2kedLNS/zfO4qIdqjeM+Om SkAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597880; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ouo8uuwT0BL/iQ4qXVVvn9es2W+dnKtqVS64weaqnUQ=; b=LKUhjvmfJKEf3x2uJeuW44paSYsywLTAkwNy8L3TdYr1HjA2eIP4uWoQIDQ2/3TqjE Fn8O4t1lTWTprEQBYTz2Xp7NoCKXul2QB79/iy1uxsVea15tt1axPgvowrhOdxLb+/cq TRcallPXzWR1a+dGxC9hHG+JQU5OdXS50ARYENRNpov5T5Ih6DhzY3aqO4xVI2JT7QNn M53vhP0iE/RYZwWm90hf73eTMiLdcU2uuzqy5igAi/Rmp84VY5KHkf98QVKMrJm7YzlW TyIw56aIA8PAsZ2Mo9eYbMG32BU3x5Lcxf3cyN+OSfwG8CnVbTuxXw+j+5rVQfPScfPe ne5Q== X-Gm-Message-State: AO0yUKVyCOe/oXpbcqlfFNh9MX1beettOkZ9G+JnZOaICLcDt2btpFJy ZZEqsv5N9wiiKmHS/ZNg4DKArw== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089068185732173?= X-GMAIL-MSGID: =?utf-8?q?1759089068185732173?= Leave a clue about where the seemingly magic values come from, as it is not obvious and requires some digging downstream.. Signed-off-by: Konrad Dybcio reviewed-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/firmware.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/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: 62526 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080156wrd; Tue, 28 Feb 2023 07:27:46 -0800 (PST) X-Google-Smtp-Source: AK7set+OA21kZ4csWCjPVLaXqH0SGv6fryXdpQDXvCA2iKjB5eef9G0V3WnTp2cNfX9D0sJYzIhH X-Received: by 2002:a05:6a20:4320:b0:b8:8a19:d6ad with SMTP id h32-20020a056a20432000b000b88a19d6admr4152355pzk.24.1677598066093; Tue, 28 Feb 2023 07:27:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598066; cv=none; d=google.com; s=arc-20160816; b=h/KLl9rl2iuv9w9vHzifq+AXwZFgezz/vno3ajZcaGdSratzvJt+ABivhulKz+HHbz 3cGrCl6P/Xj7h4/EuKmiFNwu0cGICX52wzbYUJFaDdTC5E1IlTHuVSwH0kF5y5HdG4Te 8Yl1MdvlHK4S9iLFzAgAfCGfAv0uWkuKSYmo1ZcuunpBDkZT8TLFqyPhJSpd6KAFz+3f t+88syHv4G8Y8kFKCfZVUMga32eaK+F8MsdzXALRGz+JvedTJMASJu+ioTRLU73qXJRZ BnRasheq6VRwaskvgC5eZ5S8Di73zZyj4Rrr0SA9Ks8QEfkT+iaQjkBHBqVz0evhK+Ru tRAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=XR97t0vv1eCXn18PURYfzYkLTv3CB1qpCk7uOk1LjA4=; b=NGRrkWW3CXBvCDrdj6qoCapfDD5zJedXMLMicxfnx2fjTuInD23Hcbrya1oS8dBlgq bkZAHoUuRLLG9FVogItnkomPhbMCNE5i8+7NbHnt7LXqQhM1vIc1X9XV0C1y4x2pbaxJ aUuc1cHes49Qs+Nc+LDrIEKARuZp9W57ANKlxk0FGDhmHJe7bOr/A28PlcWeeGoyom5U dTfmIPa0SITLvAPsxHa+m+Z0+xWxkjSavdVwezU/IWxrQLyJXUNJxdfarXVsEB8dba7g GUtKmBIdq1PP5TGzCfoVsEU5Bf7elsB9nVg27jRdiYk7y2IOMp5h8xHzjri++4owy5cD Sl6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j7igxwPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 69-20020a630248000000b004fbbc2aff2asi10239345pgc.549.2023.02.28.07.27.31; Tue, 28 Feb 2023 07:27:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j7igxwPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbjB1PZI (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229940AbjB1PYo (ORCPT ); Tue, 28 Feb 2023 10:24:44 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04F0028218 for ; Tue, 28 Feb 2023 07:24:41 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i28so971323lfv.0 for ; Tue, 28 Feb 2023 07:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597881; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XR97t0vv1eCXn18PURYfzYkLTv3CB1qpCk7uOk1LjA4=; b=j7igxwPlJ9BZPas8I+MoCiShBmXS/UAf/QUDhGhej2SAJ4CambOCAU2pbuaHfzxlR2 vwyl7zMF6TZDUTImvA/++pkTUaXGKkHoPPx/nGljXhZ3zj+/GlBrEQC+yRuIdL5g234Z FS+PBZL1AAtQynHPBtzi1sSL6cFws0lfp5lB61NSrij9qKbi3hbOKgvSaZ1oSqiiVxSo OZJxhUGHfECFRvLDXPPMMc7HqFwpjK8DnQkuJTnuZKCn3fbj5r9c2W0/dLHN1cwfVs9V eCBVLcdVSfFpANSRgAEy0HxLEstzZOiEdfL+ay5bGhMMuXwCtZZNyFQa3RvxXPvSmBwq RjTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597881; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XR97t0vv1eCXn18PURYfzYkLTv3CB1qpCk7uOk1LjA4=; b=lTbr+U0KMSs9clw3WMK1rhIHC4MHwqwYgWR7gWqVFk0KgKrP+t9cLWQOhR12k2mRom ipUWhrrve/cBBMhdk73c4RKIO0W8y247ZnKqW/4wHugSI0jE6Cd/KIUWfCi7Ew0NQnhw f21ibnossEV3EkUYr+lVSOqKjIOG8/wxkXvONL/RLTI8EDGUC1WHGHvRrl2LUKxSli3u GnodaQcqi9VQRPbt2pDqflpkU5ZI+vPfmCEbD3BIhrsEarX9UEqORe7QW0MtXlWfHcdZ QY0hRySR4spM5y0M96wFPMFmwnGA/Aug7y7Ijlc80JO+K0GQ9zQibh499nDMKzAriDR/ dJkg== X-Gm-Message-State: AO0yUKXIB/p3IAimBzbAy5xgOTzNV8XFwQCt2ej9HOR1BNCKcDKMvHmG DxuId1Aie0gQrWERaY3qAwKL7w== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089069645224186?= X-GMAIL-MSGID: =?utf-8?q?1759089069645224186?= 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: 62529 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080247wrd; Tue, 28 Feb 2023 07:27:54 -0800 (PST) X-Google-Smtp-Source: AK7set+ZsIsbv3+AtdNxE4cEUj4nIjbkFhP7s1Y907fU3+uMux1TavG7OTsDav9q7BTVGmEAgil5 X-Received: by 2002:a17:903:11d0:b0:19c:b7da:fbe0 with SMTP id q16-20020a17090311d000b0019cb7dafbe0mr3662985plh.16.1677598074028; Tue, 28 Feb 2023 07:27:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598074; cv=none; d=google.com; s=arc-20160816; b=ZIf6FFw7EhhvO2OgCA3hlFKbziXNkMgN/JhODxk+E278FoRNV1f7SkLnQ8gNiU5B3J 6KFxhXIInaWJYvlOr8KxJK+zOC5paFMrRl3bXopIGLmmwfTh5JjPEC/bplXNyBTh8cWX ysZ+AfHmTTv7f/V+s0Bqm0jfwHbiFxtowRfrmyIse+TRxMNzy+sDBv8FkOckNPnftgOo KMDCrMO7SXQ/gVXv2ZK2GN/dQnKia1GiLvmfm1T3TgRbodw/IynC2YYyi9gq9kjVuMou fF8R/TlOFe2+Z8k8xSLPf8Oq9H+Xu3eoAs7wlxj68e4hhtuHRtWYNxyDbxvNCUlGSGJb Lv5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=S4xuvAnYE2JZwfKFXp7AV+YC6//bPuJqtQS+4kWNGBM=; b=ezBXDMzXv3CFKInOU9zFJAeWfkGcuCwiFdfO7y+UMxtZRcOZHE5+sgRNblHkmh9pCB QlweqmhEjvTVZxcOuFQlEnAD3WEM/4Ov7+wF3Ka6A4ZSEf3koSGIh1LneMGb3ARstq/t Twfyp4XJKvHx+9CY2mc4DXxo0LZ6mtdcN+CGmAFYAjysB1UqmF7JvMTfzcw/gLAn4HBv 6GCJZWZnf402aIvO37b4Ttt5/XEqwyMoIGR+HsUPQKas8XTTrmhFABCGzPT6YgJoNPLp wqbHPNCG64hpX0hD+HZ6B/wPZfSCiRo4j6CHqO6t7Zp/bWknG2QBHckhvUoQCt9vJAjJ AD1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EZ2y2iBN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a170902cf4600b0019cd4cc77bbsi9242585plg.557.2023.02.28.07.27.41; Tue, 28 Feb 2023 07:27:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EZ2y2iBN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230000AbjB1PZL (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjB1PYr (ORCPT ); Tue, 28 Feb 2023 10:24:47 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B19D25965 for ; Tue, 28 Feb 2023 07:24:43 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id m7so13685179lfj.8 for ; Tue, 28 Feb 2023 07:24:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597883; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=S4xuvAnYE2JZwfKFXp7AV+YC6//bPuJqtQS+4kWNGBM=; b=EZ2y2iBNaR+gVD9Ez/YMS/EJijOdC3Fep1XtCvcrLkyiJ1L+rjamEbj055LVNVS/+P C23M6BNJV3xNALvnMI+ZJKsfNEdYtGgsvc9hUNsJgkauUMEtj+Ag2tRpFVbqGWcVywm2 SU/LHyGPIkYSYzzEpMZRQvXTUGngjc/TZthmUJOSMhis6zk+q7pulNReWj9WxnPo9INP YKYsWEi+/WGNFXqbiM9BpHyjkZSuvlb8hSwZ/EzJTzGFyRvMgI5QTOM6PHsnzwPj+Kya I45qAhzyChisUPYNIU9kTkB36hCRq1ADNrKdWDyGLVg4ZLEgJT4GDhb6SVTp+UJDJmHf gCAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597883; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S4xuvAnYE2JZwfKFXp7AV+YC6//bPuJqtQS+4kWNGBM=; b=vOqaTBwmJ5p8jw/8ZtdGSBMK0OOkvTFsB7b120Lhm8RuFXCwlY3e3QtYWUgEt9Hsqm lw7njjrzXtHBDLEnr0/ooBKmMn8hWJ+X6UA3+SQql8fq8vhyDMt1ZYNmo13IKwLZFjw6 CR40lvZXt7Yk9WH1oSsqFcBgHjDR4lu2AZDwqqaeQ+mQIFLrDa+uzd3sXI65isqS8PVb 9QQ9/CZeLmZJzh5pojXJFV60gYKpQWdzaf1hQCpBRi/A0HyVAdqN/7gRYjt1ep1fLVbk dIv4+hgnAt6mLqfF11TKLRaPljFOl+3nrEErT29IIA/x5R9V07Vs2Za0Wusk/4cK4WY+ Uvxw== X-Gm-Message-State: AO0yUKW045XpzMvzK9ndPvRlXzxG27ggOnvAxU64C70GkLsdcNPvJjrH ZbUYvh7eL4010m17kLzslPWfew== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089078283626922?= X-GMAIL-MSGID: =?utf-8?q?1759089078283626922?= 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: 62520 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3079461wrd; Tue, 28 Feb 2023 07:26:28 -0800 (PST) X-Google-Smtp-Source: AK7set+QphCWy5L7DL8/C3gv8BAj+0vbyvVLctbeu1GoC9CEMDIO+bPlNzMuxJLPoTrZPwnCIHQa X-Received: by 2002:aa7:cb99:0:b0:4ab:178d:3d9f with SMTP id r25-20020aa7cb99000000b004ab178d3d9fmr3294510edt.28.1677597988152; Tue, 28 Feb 2023 07:26:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677597988; cv=none; d=google.com; s=arc-20160816; b=GCzzq6VhhCD2dK7DC8qPUYdOxB7nggBOAVHKVSzNEsFAb/Yeim/4B+QrdWOjl/mboW WiTKoNcrEFO5oorE6CFreK2bc9VgsRgxUZP36Z2uL5mJs8k1wYDaPrxaPLInqnEATOal ImyVCcvuZta/PKTTpDxjyefksSdM7U5xeT2/0pWWxvv71D3ncPnDdmKj9tkCSrx8eJmG tzzKSf8rAxHN7Nqj7dvt4lUZSPmJjB8zGZ324rhPVlvISrO8NpJkURBND5AFS1KMfR1b O3hYuE62hLfNmkYYfaECC6YrSwq8rTw8rZFi0qGMqgMTid2DrJeZLy2gT0oqNk/Ncgb0 fUXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=QOZJv5Al1O3Nf++ajfeJZ7JKg8b2Wm5p9dwHgpwfHnI=; b=hhF9z4U3/91mLH2LHfz8bx7Mdj0/IstXDQF7nW2Mb4mNaxTBU1O433RoFp2Mq/MKHq u+UggWcd3p2aBWAm/5S4c3FYzBzzo9DNCEaFMuqdJtpU2hltbG8skd+E4EYrvKI0YAcO TETFXJsw24CY1VGQ46WiWLeRrDLoEIyFHJW66okLsJrtwUMB5i5cADFQ4M9Hl87kuNrv rAENFn0MsT0nKn+gpKJ4tFNyv6Ps8IcUWasbEH2fDkV8XgAPLmv/pb9fu1Ii8hL4AfyH faEmEG5Kf0Th6HmqOkQraIzpGv0rW7b91VG6yFDZTv4LsjcAJWw6rXGvSz5pzeR+Gxar M74Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T7ur33ww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020aa7c707000000b004aef1baf38asi1121514edq.96.2023.02.28.07.26.05; Tue, 28 Feb 2023 07:26:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T7ur33ww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbjB1PZN (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbjB1PYv (ORCPT ); Tue, 28 Feb 2023 10:24:51 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C253244A6 for ; Tue, 28 Feb 2023 07:24:45 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i28so971605lfv.0 for ; Tue, 28 Feb 2023 07:24:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597885; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QOZJv5Al1O3Nf++ajfeJZ7JKg8b2Wm5p9dwHgpwfHnI=; b=T7ur33ww7+Maj6xcpM1Jp5Se+aSgDMOHmTLf1HO1vei0brYJ2BDAluQ9iq8UbEjiCC IEVEYVn1C3T6jUhwOxiPAO9sQ8c7CNrppHI1auLgv5yhH3M0mhljelAlW8kMJx7ECJ4r EAzNz+VyG/YI3u1ZoN9nUDWKNJhMymXn+wA7PeJGDhOuFvHnZbFTzB7YylrHTPKN8gpC 6w07B1KgEBxMyugRRdTaC8Bngjo5Yocmmaxq4q90QgcR7/S10pLcBw7hZzJ10nzPwYMC /aft9RXS/0Nv8Sw1iJTKKrDXKvCYm7cx4+6BtHORQZ3tH6kNIbXHGwR8UUYJtc3AaR7q HClg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597885; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QOZJv5Al1O3Nf++ajfeJZ7JKg8b2Wm5p9dwHgpwfHnI=; b=LS6e64SocGsqGjsbgzLsXKC3fHrNjzQHHA+RR5K8DmGOKG44w6Wpd1Dgk94lJftijN Yg8UYE/D2YWkN2AXt2SgcznOCrlSqLiMnjdIXiafg7jMfhRaKiEODFXboIA/KwYxvMEL R4jgdUyZXPrmu+sbjuObLCZLZshPNCVndoM1A+Pv9YdfxqKu0qHK9/L1p5IYnxei4c/u jIzEKTcMUPPwhI5xs8MRHzdf4iH0BpJwcU+xNe+QD0bsSssT/xiO5cffirJKNpueDt1J Exg0Sj+eFvJOLodjSWH16hNJ3LslyrsMkU8oP2pCL7ZxRBNPlTHwYMcHyAwJhVtDC7RK aWfg== X-Gm-Message-State: AO0yUKU8/xQ8ZdsmuqIXHhqQXmSGE094ghwjlf4f8KA/Bg3n1IsXumsJ DJox/4Rya9OiQawQWwm9LIff2A== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759088987723633457?= X-GMAIL-MSGID: =?utf-8?q?1759088987723633457?= 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: 62522 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3079790wrd; Tue, 28 Feb 2023 07:27:09 -0800 (PST) X-Google-Smtp-Source: AK7set8PZqVfVcErWrd7nsvrFu8VRWZ1B8em8Tr7o4LlImjxH2zgpZ5hXL+VjMdf/AOQqtaJFP/V X-Received: by 2002:a62:64d5:0:b0:5a9:c2b0:428f with SMTP id y204-20020a6264d5000000b005a9c2b0428fmr2460060pfb.31.1677598029648; Tue, 28 Feb 2023 07:27:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598029; cv=none; d=google.com; s=arc-20160816; b=tiI23Fsb/q7ri//F2gqp9gNN6YOVUlLNZOrNVZfoVpU+FOskzAsoBAxJRc2kEf58ef KD83pLwgLjYwDaasMCzG7nBk7U0FARvKC8DMyZn962jD2fKAQSH2DwSDpgmKQ1vdVAzv LFfbMbfpb92D3WLUK+JS/bsjAZfP1OrZEWDWrCPnC1MeTrhNb9XeTdwFGcJugJknSiUS xVYpCkJIvxKyuhlDz23GfLIGjR6/EavgdEXWt3zRk8bztjES1YIbGf8BVaG1e1GSZraP z0Wdl81/tgyeBfr1Sj8tAMvmUc1tqgtt5ERl2mM3HL1q1rKE4E1XIpakc6YvvDxpETgI PHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=pfXCDnSGYPCMSV9KjGFpz0bE/u8I9Ovc8VZm+qsFkfI=; b=x+6am0VlUiVBrXI7tBiDVEo+vR2fcEifZViuZd6cQtHmr5UKU4EUjUE2iWeuIWGLn7 bkeAFV/5Phi7IbJPB3sjEIYHRudzzYpD67e2DLdIhPzw5YqBz/qaJVgGJlCUFOELsCmv XIho2G7VV3uX4lGfU4/gSZaLr56VczQ3u8SMX/hLyQ17wkdzQWLPFqHfwJmWmYgyFDVz Gvjq55PKmn5JL4Q7W7A51+K86QWU0Ct27QR7z10gpS9rw5rwzajj5s1VOP2mIV6F1Hci oyt4C9xY6Ydr07gCMc/d6JXq9tmoQ6MCK+sqclZPaY/Xr1LsB1NoVnDHeHIDm2DQf1rA ePAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q6oE6tw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 196-20020a6218cd000000b005a867303079si9583641pfy.164.2023.02.28.07.26.56; Tue, 28 Feb 2023 07:27:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q6oE6tw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbjB1PZQ (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbjB1PYx (ORCPT ); Tue, 28 Feb 2023 10:24:53 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 949FF30E8C for ; Tue, 28 Feb 2023 07:24:47 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id k14so13675216lfj.7 for ; Tue, 28 Feb 2023 07:24:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597887; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pfXCDnSGYPCMSV9KjGFpz0bE/u8I9Ovc8VZm+qsFkfI=; b=Q6oE6tw9A5p6GgBxquD0kIGwuwm6O4I/lh0LBv3v+d24PbHvCqA1EpI4+VmTDZyh/w WySG95QOp5/siDHdL+d0YJGVBDR++d52SmB+gITzSpvCyPyZdEopn1Ku8h35PsUd9OFW RxlLUJsw+WoLePiODBj+L5NXJ/KoJcgbNpFqtXyfve+NhTj/3JChLMKF76dXCkp+9+0c srl1OyYSjsXAZ+9Q5bCGujYKhdZbFGEWa/k8EC+vT5po6urdYMualTO21dnjExEzLK1e NVMaKm55nqziA+Gs0Bur4EfcBnjODJ/Ezzd6gOPLmKyrPdq9k80iVyVdIvrw98VzrmB+ U8+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597887; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pfXCDnSGYPCMSV9KjGFpz0bE/u8I9Ovc8VZm+qsFkfI=; b=Zf6Iy9f8qD6tlvjHq8cag8DmFnsTFLWiyfX3Z9zwvIbbCyRYBmzZ6t3Qdx72Ip8eys jeLh7KIBwg8hX8EwwV6O4L985BikstqpuBjpJFPHFM9qfsOMiGmyQYWuZ0Xbi7jUM1+t CAq4xWeKP/nuU9jtoJ5Mt++uZelf7TzBjlKN5Ldufc+L9RnaXJ0GUh1hqXlddAwWprFg ysK5f0cl7fa15pAOfcZdEeIlZxacf2rMRm/yvcPWB7ATFj0mt/LouXpK1IjfwDS35P2f J7aZN75q3v+MJk4WTCCIxeKpGWgJxArpMTDpnRjP7oJ48p8MYXuXFLrPU8i4j7tB3Iex if5Q== X-Gm-Message-State: AO0yUKVBkIkEt4q+HGAJyCEGjmrfxRrhspUu+dudCU8uMYCQPS4UK9Xe tKivFIhLnHV3sNXWLbNnxPfUKQ== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089031338123472?= X-GMAIL-MSGID: =?utf-8?q?1759089031338123472?= 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: 62530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080350wrd; Tue, 28 Feb 2023 07:28:04 -0800 (PST) X-Google-Smtp-Source: AK7set9eu8EpDWd7B41Lesqy03h2kbha6rrSVK5yxDG9+x+Fpdn6IWeqIBHqFDjksECTY9ersdO6 X-Received: by 2002:a17:902:d504:b0:196:704e:2c9a with SMTP id b4-20020a170902d50400b00196704e2c9amr3482191plg.22.1677598084278; Tue, 28 Feb 2023 07:28:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598084; cv=none; d=google.com; s=arc-20160816; b=MzhVeU8lEYS0PStpM7yWlweH91MPjItlM4J4vzxF28wL4eZz2c1RcdPlW4Pi+7x1dk huQjJ3Ij4BJhxAKzs3Ro1O7NeLgnwJ1Bj8Y05YsHHtr1JOAfNDl3S36OQvXJ5kuEq4Z+ jMyLfmYc8NE/mv7a9IETXz9vrb/CKgy5hM/0S+5pu7TWaq/Cw8ZM6yScF0R94twPEbVr xzOcT0M+IdVog9rqFAYT5zCENohLOtATcto8mkXdBvzEwbbgMxc6A804b2ASHpVlFLSz g13MN3cqvYu5KMcV5QZ/uDPbiwOvBOWetfPGiEA4QMc8H19qBPyEg1XmSl+jkPcbpfO0 Z01w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=5zJn479IcitDv9y2x8/xGaUK4fklDoWt49Sew7oDQTk=; b=e61uiOMCvXdZtkXxJ20Knw8hlDn8HkPfLju0duSiHzXg2jtYQ9ZBqM1k7V6SG2a3Jl dcfUiYU53UDHiYtfQLdE8BgNy0gBiTV6yvhzYWDhLCKTYccHPrXrUjvfLxkZN/ZQpQqV humIdyLV48xC3ifLDSaestwSHjxSyrTSa1xmEBVaDk4XX5lk2D30za819Q//teCZ/QNd jHTD5jDMGMQJMbkKIZOfemBPa2MMnRTkwn7NBMb42hz7g4cp4W55UsohEgLymYlAh93E 9wd62jPOB0/FaFwHIEJfgBAi31JEBhkqPy/L2ljQEw3Rx22Q+DXLX8AmiVNhMb4CopWi fU0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=awJOG1x6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ku8-20020a170903288800b0019cec84f868si9701947plb.335.2023.02.28.07.27.50; Tue, 28 Feb 2023 07:28:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=awJOG1x6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbjB1PZW (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbjB1PYz (ORCPT ); Tue, 28 Feb 2023 10:24:55 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9426B30E8A for ; Tue, 28 Feb 2023 07:24:50 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id n2so13656592lfb.12 for ; Tue, 28 Feb 2023 07:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597889; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5zJn479IcitDv9y2x8/xGaUK4fklDoWt49Sew7oDQTk=; b=awJOG1x6vvDifU8IO+8pYduD09ixIs0ijf8kY0Lj9ZERnN0/d33XytUi3bfHwIAspP Zh1CexMr4O4vkLNRNuR7mtmxaFX1oNSdPuD/IZqLRY6LEXlMDL+U8BXO3xjXRGh8kZXP g/Fer7Y9BHi44jt04itYxiZcScRxOOtIqpUZhb204GwEm1MPU+rcXJ+oZBe7cUzRFrUX 5Nn+rNCUDMJFA2or8YIgp2Hetzz2aQLO8pMjEwavCMOtBVXhaB/Fr5x8hyzz/TsezJcz 2mdXUHy651+YdHU2l+1WLhxmA/JsODoR8m4t5KxASNTwedjcYQ/mZiUzJMmYPkTbNqTd jvxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597889; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5zJn479IcitDv9y2x8/xGaUK4fklDoWt49Sew7oDQTk=; b=3dF3Pc3LJihyZboRi+kojoQfdXwNpuicKtt4sZ3Q1QjLiOvACTk8+x/uCGV9h7BPAM aVbe8AFuk7aXlJpNUcW1g84tJtNSGsnyZ62RYTvbfvjKdzx0iBW35pEmsuL9CicaF1GP bRUE/2VXmaWkUlB7JkI1xQ2K9Cf4Aj9VwcWafaLSP4GOuDk4dL9rnybMj4ggEwcBIWHp qURCRcJ0t/n/rx3ZSd1+coU8JDhOLrVm7AWDJnHtxk69bWGBPze1YwP/qh6TTiFU3/Ob 5+La4rKo1kjcnV6zWf5i00Lz+vBWlDOCLzYjJbmiu7Vd60nO9zwBDhDOwaTMAFICT6sR 3hvA== X-Gm-Message-State: AO0yUKVDFx6q1BXKJQ6GJ9psnJbmdz+V6QMduSND11RQx2RuhXXah1sW hRzeWIIGnQgZKf+yev5qLHjoIg== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089088733204209?= X-GMAIL-MSGID: =?utf-8?q?1759089088733204209?= 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 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: 62521 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3079604wrd; Tue, 28 Feb 2023 07:26:44 -0800 (PST) X-Google-Smtp-Source: AK7set/RYeVwl0UdFMLDmz1B9IF4655eTR9WRLoKPYrcCdIFvowuaTZKrU33Cfei6Tfd6ebZy9y5 X-Received: by 2002:a17:902:ce8f:b0:19c:f698:8564 with SMTP id f15-20020a170902ce8f00b0019cf6988564mr3867778plg.17.1677598004155; Tue, 28 Feb 2023 07:26:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598004; cv=none; d=google.com; s=arc-20160816; b=s2J3ICK1CNTyy2blldjBFqak3iZ7Sp5AMgk6H+TLkmbIO1nb15SPvatfd6eIcK/GiS roDdUAPyzUsu9vHN16kDiO2J5O6v3aHBH2N43Hpam0FKOlwu77VPQ/U9vQwF4EtdTRRE Pxw0FfpaFIbFojcuwYIrcQGcFlN2SCN9vQsQVfiKy8gR+nFcPPxM1ImjnHePgFtSHn8E 5oLXJQVNTM7VYZKbWTzL/VOfV2C4YqjxUw0+uB0Qp5OB8D04MoNusCnZi75as3XVLKzl ANmf3x7TzzxcgZQljSy0prIfV+WJPf8b5Wc/VBTfvxytOmzGlajv7W6ytk6lW4bfan/8 gmdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=q2YOQCGUDR6LVZWl352w6X7jU8EvLQncBoIP/WOJkXQ=; b=JZ4l9DigOXumWzlk+lPmOskePGbbC9R1Vk2VMH6Ki0lVt7wmZ1zaWodxjfO7hgT1MD mNIUl9ZbGGvyAyIVv/jEmZzlO1sXDd15i3KsQB+ycT45BSgz8ABii1ouTJdxPMm/WAJp ozwLBDLBqJUTDhLj+sUEVeLMNdiKy6uQX7Y0oKj2iFUdg4Ba8QLic/Cz+F3j2ZZG96wa S5qNrgtzOgN44I93YM+d0tT9wEcRjUws3azHJ5pOsCE/OnzPgdnPJQvwdk9TiDNwWP/P tDvBHnyC6Gt2ye2EuWnqQ2yrZeiSlXcx4WlAblBS+23syY8b5y1Xb2JCU/fIbDSX/OQa DXvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DjaJv76Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jx12-20020a170903138c00b0019d1f42b007si4578522plb.8.2023.02.28.07.26.30; Tue, 28 Feb 2023 07:26:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DjaJv76Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229951AbjB1PZZ (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbjB1PYz (ORCPT ); Tue, 28 Feb 2023 10:24:55 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1613B30EA7 for ; Tue, 28 Feb 2023 07:24:51 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id f18so13728462lfa.3 for ; Tue, 28 Feb 2023 07:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597890; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=q2YOQCGUDR6LVZWl352w6X7jU8EvLQncBoIP/WOJkXQ=; b=DjaJv76Zk4rCmcRuGunlj0ep9NWS6zyfIYu7YtftiZRp9XSogaZWIrjwLSBkqKBrSY UwHRP4KC1Wuf8utc5VwOjbDOJXafiQoTunnMuCtvTfp1vuGGM6zIabUcVhJs+u+Vhh8e PxnsfrecdvR79S7DuFsFmBs6KTLFMBCTlh7bdm1FndrJVrOeloyLJmcl+Y8Njpx+ODJ+ fLerzZeHBUFc+TSzuFQCj2QYEha4IX772QEUCsUIAA4pJ8DgxdkJM+Ba+lKyHEViKsdy X/cRjUTCqTEh38M0HFqE/d0BMmKTSum3srfh5G9FnuwDxm7Yr2Kr6ODogfYyW4+epu65 72LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597890; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q2YOQCGUDR6LVZWl352w6X7jU8EvLQncBoIP/WOJkXQ=; b=OA+cMRHBfqJW9TAQY896P42qR4CcDhU+R3laJegxklm1UqO006FHeOZwsbPbhKTOh0 cd8HtqhGmCfbBKg1jHFEgDPWsLTjDv1oFkV7mD2oT3H7I9zgT2dHHT4uBDC33nrBWtZR Yqaq9Lz4j3aJmvO3p/Og/EstB+Aaav4CVnPnSlywiln00TH32M5ijMZIgsNTK/O0/+Ju qOILxF/1t4cKGWuDkWrH7UsZv6BIy0JOXnv3kKaxa/zN0Qx3v4XaAKrd8Xawe4j/kEZB XOhcNk6VkY4aRDxDFuGETIBpcrFGe4ElYu9BdwRhNlzs9OG2lQ+tVrNz1MDXoBNKzuKg 6mVw== X-Gm-Message-State: AO0yUKVQ93YZSfVqYnYnXFgEvcVIlY3gINTozue0eQgZ/cqktNcX4fra YNVjVWLzQGTOdDI4hYZCR6SRwA== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089004724796741?= X-GMAIL-MSGID: =?utf-8?q?1759089004724796741?= 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: 62531 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080665wrd; Tue, 28 Feb 2023 07:28:37 -0800 (PST) X-Google-Smtp-Source: AK7set85jQ6qGubKwJ0A/38kUIfdvhvl14MBLTbqolPHXLTQWhmKqC2bZ5xflZvq5YoDAXCSa3Ao X-Received: by 2002:a05:6a20:728a:b0:b8:5881:5c3b with SMTP id o10-20020a056a20728a00b000b858815c3bmr4456999pzk.58.1677598116908; Tue, 28 Feb 2023 07:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598116; cv=none; d=google.com; s=arc-20160816; b=RFZSc9i1WvKthGvIxUOToPYu88skIyNeRbR76miGpeq8Aqh6rB8DhPpXTInecIM+rj lzCCXu9s3luWeFCdZjmmE+P8mQesABinlVdQxJCS9q+Z4+sVUxpdybjZk6T0nJHOKL+j /2+8OzbA6NTSJp279OXwNW3+my9kmsTXhRVp+U4g2d0L+gpnkpoSNV5tytTSg0ByEoyn SImR2hdFOzduO3433aeorrfgT5wgZMCrIspSDawG3s2eNnJK9uPRN02krlFVR15jhruO lpxXTNWdyUh0jaKt7pzM/hLY6wAyZagJXFu4qmc0a+3cHfc1wU/D/bAH1MdwM3U8zdLj FnQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ZJKby1etsQJsllCrJh6jNuq7BGyySsQgLQcWxf9td0M=; b=LRLVKeueLg7YR4Lncd1pZ/bz2ELDkPQA88qP4X6dsKyHUW6rnIo0ZQ4UhwXCbekgo8 ELbPdTx/8nEx70x4ucyCotRNHVLUGcTbjCSItePKwZjOsGeQkg5AiKKhaLTWidgGU52f 1HzOLNvHACEsJ/xqNYtXiLNZaPTwcOV8Mj/8/4LPE91E6+nhD9VKcZ+GY5pQ9toEANV6 ylyvzrxRMByns8BvlGzoQHgPoCWEeD3lS6895bmrr7sRQlniHCN8faviYFG8Mtl8NbYD lFh27/WAUG+jSKdyCJuQxnwF6AATeL9xuQV//HvtmaCs0zyZ+dxvm91r6K+yVTEnhrsp 6QdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FNAAp+L1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b125-20020a62cf83000000b005ecf91666b8si8352883pfg.184.2023.02.28.07.28.23; Tue, 28 Feb 2023 07:28:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FNAAp+L1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230020AbjB1PZ3 (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbjB1PY7 (ORCPT ); Tue, 28 Feb 2023 10:24:59 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 828922CC6E for ; Tue, 28 Feb 2023 07:24:52 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id i28so972115lfv.0 for ; Tue, 28 Feb 2023 07:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597892; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZJKby1etsQJsllCrJh6jNuq7BGyySsQgLQcWxf9td0M=; b=FNAAp+L1mjP7wXirSyAnaA+f+qxBmWL+t6LCR1PQ77rO+N0YBedv9B9b834hLtkfOc zJxBpLFILWTMK0q3fviIYARGqxedttKeH2+Zd9Juw/Mgf9EwHmGMT2ryqEYdikBVUJF9 xf35aPKyROPrUdrbURlyimSj35XPGCGP86iZenLYVoGqdVAwpTeKN7lOR9PRzG1D/joJ jcjhfta8IUwLoG9kxX6U3vczWgfBsHNPSRHK8ZvV0mD+3a7XU3MFBs8mh+St6EbsmV3c srS5ipHLSL5QHJNWurzy+nblDFQ7cwKniM4Z/DP9R9h0U8/V8kbU38nj+HO8+d0aFoh3 1AXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597892; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZJKby1etsQJsllCrJh6jNuq7BGyySsQgLQcWxf9td0M=; b=caA87PNSUK/y3NrmEU8vak4tz0mZp1owzVUeidLNXEsmlh82jKL5fFstRKU7P5swbe hdhak2aTWrnEg2GM9GOkxPjkVRun8Z78c3KU01KUeDMWNbfkmA4SLVlQYl8KWHR4JWNn x+98tU/EeFpPP4Vh8fRwziY+/vU7QB0foA9lP4Vg+tHia1M+NJkShMkDODmVHO7qUoPZ Mi05A7m0iAaH6D3oBfZu33WM+x/xjyjqtC4qJsqUFx57VZMjRYkaudz7N2rGKKLTEdhI cGak2JLBh7TrzqpawXSFYjED1RPCDa7l3BGPjhLOdjRFGM9LihzhHJGsVRifzIZ7NRd8 8qXA== X-Gm-Message-State: AO0yUKXyYNtW0+aDCHvQWpWl2u/QQxpWWalOU9Gk8kTAouI8DXUye6/q oj53paA0JXowhLw+f0uYt0zbWQ== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089123280290776?= X-GMAIL-MSGID: =?utf-8?q?1759089123280290776?= 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: 62523 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080132wrd; Tue, 28 Feb 2023 07:27:43 -0800 (PST) X-Google-Smtp-Source: AK7set9dzDbbCEV+B59OwD765F+B92Zz/+ctiKgFlhNw7VCd8JqR9YAlKRzm0M83aKuXnMKgMqEn X-Received: by 2002:a05:6402:27cb:b0:4af:63a7:7482 with SMTP id c11-20020a05640227cb00b004af63a77482mr14719229ede.19.1677598063614; Tue, 28 Feb 2023 07:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598063; cv=none; d=google.com; s=arc-20160816; b=iKhXs5ao9usgr6oHzLOeYfO133TxozbiGeoxzKXdMlAnFhxVG37s0rvcHx3PnhwEza RZ2obOTh7HoNcIQMg1grJRS3SwNQEqg6UIqCJzlI27W18UGiqYTD69+7OsPouCdnm0Be 0zYQc+0V1uSnPpGNxkENZBYftROIPHRRo2kbZVQlIETojOf1Iv0R1CDCTzyG6ioX1XX/ wr7ugTznrhPAUx4vRj88CUV1dgq0ZWyLHvr06HLyVOwy0P1x/WPZ19EHaqIiKtb16rt8 KketjJph8FzT0K6+gph6jPfrz87194HS8Szh/2sEgMD3Lz/MlOEtS8DCqzfBkbRfsQk5 Tegw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=bZkaCJiZZhP7M4QpTnBKecqE3oGLYQNzII/qpkWF2DU=; b=F7v7cbgA8Wma/xguMWt5apzvo3EBGRL0GDUAJCBRK1V6rq+UnTG4/yFed9vA/duVkn IuTrlJ0cDvbn3QgPQ58/+9/zLuxfj8wfCCMj7NUwOJJBd536jOb0SknpA7fPRE9pn5Ac VmROYWDTrCje/Y99u+bmUbkaSQtsmvFZuoqfb5h0uy/8HrxO2n/CJhnufyAR//dhT/fS +8rSahA+Lbjr/ATVirWZD/Mx0+qgBu92j79MsJZMI05WeANLCDXhONy1QPH7tMjmbd1b I/i6J0mcibsW+cLyx7xbnUprD7RKgXPRPyn3RDG0zgpv/9kr+9ag9DS1/e4pCoklxMQO K9Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pSUhAczd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt10-20020a170906b78a00b008b17aec02fesi161773ejb.624.2023.02.28.07.27.21; Tue, 28 Feb 2023 07:27:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pSUhAczd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230060AbjB1PZp (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230051AbjB1PZW (ORCPT ); Tue, 28 Feb 2023 10:25:22 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EE8F2B29E for ; Tue, 28 Feb 2023 07:24:55 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id s20so13653990lfb.11 for ; Tue, 28 Feb 2023 07:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597893; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bZkaCJiZZhP7M4QpTnBKecqE3oGLYQNzII/qpkWF2DU=; b=pSUhAczdlcMpDN3XecezofrJ6Vn6cJgvRcxuLYVuzXR12HPdwJN2GFJlUze0lceQyG 7iV8TTth2D/JCmiICmPMWcTT1Weo9ZEqy3VuKpIqEMm+JM0lBaYsdLMHSprI3JJWb8Rj XF7Za336KhapXU7OE4KFKsGg9T6tw4dNmE3tfYE9QwqCYHatNb/4r1A/Il51TVRa5nYy 8OVVUIz/x7N2RhJf2mrCGI6xHaoUOycHECV1U6xVYrx9qLQVazwn5VXIJ41dWK3gXXYZ Q+lPuwU3S34HUCn8DRwDjQrhv4EJ9CWEVepvP7m5wvXOHfE0R2jmkEUE0OVEdR1VbiFn yLqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597893; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bZkaCJiZZhP7M4QpTnBKecqE3oGLYQNzII/qpkWF2DU=; b=Q0uMLPWDr7RBr1IpnoEJHR6/AW76Ug44DVfttv93Wu2D+P3G4fFmIuXkPLPjH27Z3I 2d3rg+QYH9//P0M5RmkPJSJYV0vobiNxzX7JOUD/f7lZ2lIWwKArN1TgOPvyae8uG3pc 6T4Tj8TXAmwlKoBvX1rIpy++WXj0ne2oJZB3dMclY7xHayvluNW2ui4RkbayHzRXp3hC ovSVmaJp7SCqIcdjr9HKDtV2ubuk3QcRNJN62YVzwEn/o8ePe1Om9UCQgPIKn1y54lEh r8xyJGiupIXluGZhkXBMTv4/R6IF9qS+64yGPR6eG2rke6ho1Ue/zDgSgBoVzO35I1fZ gdLQ== X-Gm-Message-State: AO0yUKU6HTzsFappu0dUCzjq+MUkZN97pvjGJlWOn2kyWMO0oiUltl7d SWRIG7kVsHMM0C1WxC94L7etugamXeuwrLPE X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089067006509507?= X-GMAIL-MSGID: =?utf-8?q?1759089067006509507?= 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 Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/firmware.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/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: 62528 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080192wrd; Tue, 28 Feb 2023 07:27:49 -0800 (PST) X-Google-Smtp-Source: AK7set8RRSMHyCPl6tNVTOwt+svKak+/2UZ4cBnlHrzLgv9ACZ1orHMnDgn0QeQ/Zylk2mzM5yuR X-Received: by 2002:a17:906:b309:b0:87b:d400:e1df with SMTP id n9-20020a170906b30900b0087bd400e1dfmr2840441ejz.72.1677598069330; Tue, 28 Feb 2023 07:27:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598069; cv=none; d=google.com; s=arc-20160816; b=K8WSpPIMfJbxgE/fq0h6U2g1XHsEbutdJUaXH7Re2qwdEZRIBkL8GI/IH3W1P6rSNv S20vCB2eYQHYfFMbJfUzUdOEcH7EpebwdxHleC9zxZ6FiGh3dl3uuXMC6hCGoopNCWcX 3Dv2mirHouzD4KV+amWIU/H4I1Q0NgsF4IvxoEJs513lXNruZY18xQy8xAO+aQjKAxfZ 4PnAPbfNshcZNzSC+qoL4Iif3T2DXCQgylQr0btZRldYpojPlRo9ZjBc1yrO2Re3Popz LONifGrRu30XI0z8co6kzdW54fsH8AUrpUnOM9FdANjkcfHbmwL3Q5cNbypcyn6cCwpX DT/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=mv+5dN06QajiFNtKq3cylP0qYElk+b0EFltGbtCWW5s=; b=W4xl1OYbXyZogz3emjoy2bdmRSeEGrnPus1P+ZgRCbx0QrQ7JWP1D43C5ye+/4QTK6 Hk2yfWuk656Klq8T6g8A74gC+d7sFCkFoFSfrm9jd3POjdSoxdgym5n8WSHJrORm4/pe Oq4Sfx7k/BiWTHoMGUZ2gyjL/AZGjZiufeRoMGCFku99Qsd1jK3IGM9tBUjXmA2uscag 7oa48YvBZe7+cjfA1Log8znMe7X4jskNdtnyN3KBZcT4PDmAjOAg8H5SQh1/jPQwK648 RncY6B39CxArhYp4cm8mOcsae1wklojIukllj3Of4JRAFNJfA2d7TWDD4sfBmJ/pjhcX Dv0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KLqV2kBP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r4-20020a17090638c400b008c0bf3018b4si11442025ejd.901.2023.02.28.07.27.27; Tue, 28 Feb 2023 07:27:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KLqV2kBP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbjB1PZs (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230064AbjB1PZY (ORCPT ); Tue, 28 Feb 2023 10:25:24 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 878D730E8D for ; Tue, 28 Feb 2023 07:24:56 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id f41so13646774lfv.13 for ; Tue, 28 Feb 2023 07:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597895; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=mv+5dN06QajiFNtKq3cylP0qYElk+b0EFltGbtCWW5s=; b=KLqV2kBPxpqQedLLP2jyVH3dv78B+IiH2UApRHAUkV6hehtDudrXUtxm8t7KBLwV/S JrT4Ua/HFFKaXd4XObOSCVdRFZTO1uRpw9yHezvZomea882YUXrYb6FytSllzRIVCGRH 2ieI6yRUz/4xVuD9yyQ65jQ1yTO40+KBj7mQsh0MMWEI8zWW7fPy1Ec+MbZ3HpGY1Jmu n67+NSUzlPoRvkyozoDJSPfA3mxTIdxDB2RCxT5y9NkIEhgP4CHI0NGRRzYe/wer8wgV Qv8xFXApmHJ1BUARK91jPZJnmnAkJa9OCOEiAOKZJUR8UWYK6Pax2/HQrzvkleBYiU1g KTQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597895; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mv+5dN06QajiFNtKq3cylP0qYElk+b0EFltGbtCWW5s=; b=BRpG6UUg6wvT0JsLWqzVXqKIL1E6SS3kT2W8UjjmxGukNVFHGrt7gxi0C4ifv67y1u k6kIkfmf7mbStwYengRnlCzpXkktZClp22bv9nUfttu7Wi1h1H6N53O1QpRZ7Xh1QIfv pTADGgSLEXuqw5sWdpH4BibwSV0o/gmV2O4FMVC18EL130wcykOObUF/zM5BffDDBi6I hmh7teG4dK2PwiqP+11EBIhXDWBJEri+S1Btu2WX1nc4+/wGPx9UncEAFPuotaDQGfM/ YpiiioS6d/Jm2bR1gP8B9Cl/gbhwW7s6dTtwoOwclZMrWUV3/cwWP1VqC1c6U+kgazfG nWBQ== X-Gm-Message-State: AO0yUKUJzJqa09etyB33JR6JOsrGQ5GOtcjxXLxt5nYuxBornymm8X3A 8vxrNrQBteP9kwqdbxKM0bLCUQ== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089073457450167?= X-GMAIL-MSGID: =?utf-8?q?1759089073457450167?= This is not a matter of the host SoC, but the VPU chip in Venus. Fix it. Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/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: 62535 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3081501wrd; Tue, 28 Feb 2023 07:30:08 -0800 (PST) X-Google-Smtp-Source: AK7set9FtKbawKrCFxkotlFtFXms1RhmUAy761pnwouYueISFSQab6fBmqx+3g4NRz85oo8dwou0 X-Received: by 2002:a17:90b:1d0e:b0:232:edb6:9710 with SMTP id on14-20020a17090b1d0e00b00232edb69710mr3518339pjb.17.1677598207953; Tue, 28 Feb 2023 07:30:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598207; cv=none; d=google.com; s=arc-20160816; b=Fyf/Uincw2Vlj2FaB+n2Rq5TzbEalvT9Rr3MioTyCWiupdjqNRYa+h0OOiviRUEjkR w/FJLyUwIH9I33hphvFo5+ovYxnFgYoh5JH+QyW+/4mCYrDCihzchRO3NoejC5CXBtpP JNDPRVOAWwjmXmd03iwSvA0qpJ5Ng4AE39I0KvdMjeAiwK0wDQ5KA6w7YME4AgDBK13d K/7DOV9SMGkKNcqH057KqElz7SDObjsk25C1xKXzlTOtZGAW7NmhlLW6uTHgzsO+oQmB 26AXjtOk0Y0mys/NzxjTuVCvOymk8UGEad+j9+6cIOrSNHxTjHu3dM/2UqsELAFAR1Br 9BFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=rGxFL4MVhFGQlNfkdvC0F8xmFUE9FZn8c53afBHcPpw=; b=eUyEa6gmtyDwceAGBkpAFzzoCUNkWEtaN/8yvR7bRqqEBYXIIWFi2nfpSkJ0NQ2zEX g+UrYLiCQ9VjTSalfJVBNhbJ1ESfNPjF80dPNf9JOnHMq1s7Btt6gV9RTyrrEaGfcrG4 0Ln1LodUBq32464Kd2YOj9yGcY9eLFRKmHa2BzM6hRRjJbf/M5HjjkBtBk+2Wii1wTMl huCQQDPmLl0F8Etm8lrt8aXuvlQFF1xPm+mHQryP0iHZsAp1tq7rL80wLd4kb9rBrQJZ mbRd8Sg7E9nvISGbwXhroKGdxdHPPuIEGiSQ6aVJyjvf93Qd5LmyYGzKmZtXmjMbHHLg wo2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sz1rSd05; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 3-20020a630b03000000b00502d8d715aasi10107241pgl.321.2023.02.28.07.29.54; Tue, 28 Feb 2023 07:30:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sz1rSd05; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbjB1P0A (ORCPT + 99 others); Tue, 28 Feb 2023 10:26:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbjB1PZg (ORCPT ); Tue, 28 Feb 2023 10:25:36 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A679311F4 for ; Tue, 28 Feb 2023 07:25:00 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id g17so13713552lfv.4 for ; Tue, 28 Feb 2023 07:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597896; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rGxFL4MVhFGQlNfkdvC0F8xmFUE9FZn8c53afBHcPpw=; b=Sz1rSd05Z20rHlYSzZ38KwCwlmpPalfs6vDSUJvu85qVs0S3SdHjRnZTdSvG2k0KW9 XJiuKbJRFxyntrgCrBpPkLDmlrR1GlLORpr0gDIr0DxN8R6vBjWHze6YtZ3DxKgj+L0A vwHZDgAb6jSHDCGNvUz4Mv+5VTcnkA57Jx11qRoHYV9ybOMr51AXn5EsAE7WuX1qkV/x eQDo7wNcXM8g0YWjjVqlJRWEj3gBvjrAot+pIcZl1Y8fCOYT8iuvNXOMZ+nJ5xmxi3a4 Hfg7gVf4BhT5e+Ggam3o4e7QhRmW3ag52g5DENCEIQ6fdJMuIHE2XKQq7HzanKzx1+yc THDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597896; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rGxFL4MVhFGQlNfkdvC0F8xmFUE9FZn8c53afBHcPpw=; b=YV9CqRrJNdb5uF3RO2OsJ4kWvQV6TiEpQJXUfgeWGlwcHl5gPnC9hRW+H1QFQ3aXyM BpyNtkVfRv0wtDDJbkbXLgGtuHeoeI8Oq0ilp4r385ddEnmLNTx07/J5TD44q8emP3U+ AlLAybF2V8MwHrbKMfXTpFvnmnRzqLUOcx3RJcfJoWI953uqSghK0w+QKOJ5BHWmEsix +N5YmgHNGZyYOan5q3Wh+xJpN+Bb4ew0tIBDAlnCDna2ubJk/lsFSAH4zCHUlBx5ppI4 mg8wy8L+dyhre3yC7RMjDrSkQUt+rqdTkykHr8Bpq8qyLjJzaCzGOj8Hu+BU3d2qdPky 7xCA== X-Gm-Message-State: AO0yUKXHe55Y7e0Y+Tkx8UpEEyYEB2rKbcDEq+zxiBLPng0NGyu971dW 1K/9bAxOMIGzo4Gm6Rk0kvi0cA== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089218231477671?= X-GMAIL-MSGID: =?utf-8?q?1759089218231477671?= This is not so much V6-dependent as it's IRIS(1|2|2_1). Fix it. Fixes: 6483a8cbea54 ("media: venus: vdec: set work route to fw") Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/vdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/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: 62525 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080152wrd; Tue, 28 Feb 2023 07:27:46 -0800 (PST) X-Google-Smtp-Source: AK7set/wMw3aygBnPIkxVLX1qXZATWGFXmwmBbQfLZQmqPINaFCjxwBhZ5kWF7VkgeGN0WT6aNTb X-Received: by 2002:a17:906:1954:b0:8b1:279c:82c7 with SMTP id b20-20020a170906195400b008b1279c82c7mr3120243eje.50.1677598065825; Tue, 28 Feb 2023 07:27:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598065; cv=none; d=google.com; s=arc-20160816; b=r6Q6vDVoRC38aaib2ElGNEBzpjbIG0dM1FnK9ghmPWqagF5A8Awd6l1JCvKC/9n8mO 9tDe8kgl9u8ymv6DiXTcLgs1CIXBJ01/xEB5ViXrTIDDoRGsFLGPvgvKPGlMnmDXtKip UjBgMO9pmOFYLv4K7Pdoj111p+MHsgj2qOyw7Jp9gljXdIUK2mxJsVPRoq/n5Mf/xsb4 hvIorUXTqfcuWxGPa7J6OaYj3YtBPtXGoBP+r/2F1Ho3AM49fvxVz7UNvbZ6PvORYtzR W2WsmKsGRZSBzFjIGTcmItUhRA1RwJNKRpHvDA0ovADMzyWZTeiEB7Su1/PKD0c5Izcj es7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=fJjwnbg62VoIV+g3wGZJB6SG8RdF3Rb2KodyCGNCoVc=; b=fwRGCuyujenhNFfbo6A9KIN4Ow8wbfB+ChCZBo3YsZM52oxk1Uxj1Ozhk2KhBMAULi G9Ckq59dATJMZyFTHfm4Va1OIJbHq+htJ2ixEYuwj3jSMsMPrAw7hpUeO0o5CoYG9X4W o+APTlFwS4uBYzprFgto7U42MdenxEj29e7l5/9/Zf+zA9LBJV+3kzihiKzScmZkyczs UWFipBcKbMoBiHGIHdc80LO2Uo589ckYR/nY9r62Fem54QJHeKccc5ZcpGPWJ5g0CCsP Qcxm9WRQu/IBTv0xrLwK41rk1UCQnhkPwA3Xyr+9PoNT8EyDC+6e+kKruqD1PldsjDcl pRGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cJfVw7oQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a170906045100b008b79a5e743esi11448515eja.253.2023.02.28.07.27.23; Tue, 28 Feb 2023 07:27:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cJfVw7oQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230134AbjB1PZv (ORCPT + 99 others); Tue, 28 Feb 2023 10:25:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbjB1PZZ (ORCPT ); Tue, 28 Feb 2023 10:25:25 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C1BC311EA for ; Tue, 28 Feb 2023 07:24:58 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id t11so13742264lfr.1 for ; Tue, 28 Feb 2023 07:24:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597898; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fJjwnbg62VoIV+g3wGZJB6SG8RdF3Rb2KodyCGNCoVc=; b=cJfVw7oQOlKU4uqeWqmtJ5mDnND5Gv9eSCxPp0BsF5PoDjIjVMRJC2MxwQZSXgymI+ dKLGvLOpWWq4rCY3ksf51uDjqPHyOYKZNMboWomL8t2gFZ0MvoEbesMBgzGD+NdkH+oI VQRyH6H7pU4aMb6H28lg6dlXhaRsDe67xkrJln6CAfm3PfR45iygkKA8oX6mAg595wva cLYBFWDgstzW3PAsHNuoIE86yox1/pB8lbGe7kyYsq3x1OM/6TJyAtBfy+yJpjtapSxZ aGEHL9VQu+EUnf37xz86UOrIfT8zpzS1TdbtytWkc25YUL7zsW52odFjqO9qZhFpd7dk dLRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597898; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fJjwnbg62VoIV+g3wGZJB6SG8RdF3Rb2KodyCGNCoVc=; b=BmskRjH7ygjNLcayKD7eP3cEV4bGY7iSPXqMTW5DPow7Db4H8zmtGTXNx3ltxMIlKN KjPbDIXfhqzWCTvCxpxbIp35kuuQp61xnpqHrwq7mlV6PJsSmmrF2dRL9oxJZE/FqHsa uakC2HBw3j7tPkTaEw6kcce5sE4MDCHS6lNYorCvwaibDWJpJPyphLRh/tVheLRsdIUe RcQJprYtr+D1BOEhJenVJwe2kjoby0wYHqeXwUlNTE7Xz730dItIQXwYTTmLT6bveT6B SiWAlyWuJLwXm6qpX7aQOCw8KqswIn6ggzKTyAgy5R0iB5Wbs6TDMvV3qJSnR46lwRh4 asZg== X-Gm-Message-State: AO0yUKWhN0Nq3MKYswsKxSn793zaWdiv9VueRAD43jOhk6g8SCa0x4jo zeJB1wBCJlsKr6LMc7kPveYagA== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089069448900132?= X-GMAIL-MSGID: =?utf-8?q?1759089069448900132?= 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: 62532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080739wrd; Tue, 28 Feb 2023 07:28:44 -0800 (PST) X-Google-Smtp-Source: AK7set+4zewbQz+qEPENUYSCqMCZYaoZWH79SAz2um6m54xeIW7xMlKlmHauFGqCTASKQwNaOEOY X-Received: by 2002:aa7:d804:0:b0:4ad:6064:76c5 with SMTP id v4-20020aa7d804000000b004ad606476c5mr3438679edq.11.1677598124552; Tue, 28 Feb 2023 07:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598124; cv=none; d=google.com; s=arc-20160816; b=V4yhE7LcCK07A1AESzFyFMC83JlFiG4sQgkp75FBF/uPACv2HxF46xk+Nb/a6iauso jPf9SfSNy67/DVYTBcNvBUsT+8lY/xqyAzd+Qc8SEctZxVcEnYEMqH2pJTjiOWi1fCYf 4RCH64vPN2gg/iSOERU3NY8azAvbLIShU3MwSzkeJ8/4lo+d8pr1zqXwLIFIT8CHLqOC OI0J1UH+IHXeluHHl9/5eAw9P0/xGzOOVc9HD3KZ6EuWUKzeoWpUVZtVpBfZ4QGb3fnn NXTJc2axL6M2m2P4sMnGwr5UX79rIQ2zwVsJ4M4Mtc8m26soN87uSMhaofLK30qQlWNS 4cbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=rAMzs8/D3GkG+CLqKGbHIOZMNVZdBT4zUxTTserKPM8=; b=LWCKXMYq4WRPxlpyR8VjNBMOStMNvb/N9GMyEPHqCmLYpT5F0T1KJ6fXcWL1ETAI9Z lfvg45rlKLkkHOxGfhP0Xm7UCwKMMlYtQHXE/cUWPUYPZkI3qxn1/KAnCfasPauLBx5p QKXXPIteOWPp5ad4BH3jtwrrQCF7SfRlLy6WtMNLst7zOCXQh2CHCInPooGmY0XP9OYU BNvRgej2WKh6XV3PJWbqGJPrPepYdVWLRn5sxBTtFTrUqbwvSPG8/yKkgKkF5x++yLME RjPz6ODu1MxU19HJc5ZX1cW15qpqFhtkSNjNzB7sz/EicAvCcNUFxsagE6XO39srN1sA +geA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fTgj4BQC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 4-20020a170906308400b008dd85c37895si11207735ejv.215.2023.02.28.07.28.22; Tue, 28 Feb 2023 07:28:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fTgj4BQC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbjB1P0D (ORCPT + 99 others); Tue, 28 Feb 2023 10:26:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbjB1PZj (ORCPT ); Tue, 28 Feb 2023 10:25:39 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6017D311DC for ; Tue, 28 Feb 2023 07:25:02 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id i9so13703546lfc.6 for ; Tue, 28 Feb 2023 07:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597899; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rAMzs8/D3GkG+CLqKGbHIOZMNVZdBT4zUxTTserKPM8=; b=fTgj4BQCye+QFJd+TGndcz2V9/HhFq0+naoyvEm/uDRLku4WyQtKvAtlJhPp4SupqG 03d2+CGa5rPvz/RZhx2iXmyHJNE01HNe5B3hc1OS8n21Wrge8iMKG77irEA6svfiWRwP Chye183mpWQXFhJ0EMNbdGh1P0q8LwNFlRHuEwLOFwc2I4GPMRDJO2fhkoIXkmK/YOA+ Ad1hKGU709/4exBqQukrrr+ZTW8uhr5Ys/rfSQQ1wovXl842tG1BdiHzdYVAbWLhOrNN 2sxY1jF67YahceJ4mXwxntNkWRwwZdD9zbKfYFDcrrWAd7odpz+vUf6+eASTY4Rwf76f CO+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597899; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rAMzs8/D3GkG+CLqKGbHIOZMNVZdBT4zUxTTserKPM8=; b=lv2qWRr/9HdiGnmuEHildSwuh+wFhLlBZvKQxb0x4AbSEm4PqQ2IIGxqwkReinzkdH N9k/xWdDIKoLZOIrHxgI9G4QZLo9lfzVo3TQVRqx3NiXnN1jJbuQWTrjVV80XEXgLepm fdJeuKb0SUzyLl4hlt7g9mk1Tp3o9GLo//reXYdzsZid290Arqwvrd/dz8m6l1VJ0IuJ vpybMffy9bnRCp59WxPDM7r8mg40tn8DeT1mWwJA1zVATqm/TVGnqgGKT6hxEZL5cd11 oxMOvoE1nEK9nQw3gtNBaSIQsiXQAOJooe/wVjd+nKRhQ/JP83kyGJ+dnhXj5Uc1gcgh HTMg== X-Gm-Message-State: AO0yUKWQYGrh9w3MwkJrXrGmqP/u4c7qAe4ZW2fzvjS267mbyWJh2KOC RFVfYEKmzo6LQyEhxMca3Gq0TA== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089130526275009?= X-GMAIL-MSGID: =?utf-8?q?1759089130526275009?= Currently we have macros to access these, but they don't provide a way to override the remapped fields. Replace the macros with actual get/set pairs to fix that. Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/helpers.c | 2 +- drivers/media/platform/qcom/venus/hfi_helper.h | 64 +++++++++++++++++++++----- drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +- drivers/media/platform/qcom/venus/vdec.c | 8 ++-- drivers/media/platform/qcom/venus/vdec_ctrls.c | 2 +- drivers/media/platform/qcom/venus/venc.c | 4 +- drivers/media/platform/qcom/venus/venc_ctrls.c | 2 +- 7 files changed, 63 insertions(+), 21 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/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: 62534 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080968wrd; Tue, 28 Feb 2023 07:29:06 -0800 (PST) X-Google-Smtp-Source: AK7set8s8U5+bsuLasYsp9upk1vzDSBLKoztCeJGGzFXhZ5EqlbHEGultvKyARniyitCtpafswcF X-Received: by 2002:a17:902:ecc7:b0:19c:9fa5:af00 with SMTP id a7-20020a170902ecc700b0019c9fa5af00mr2892989plh.2.1677598146272; Tue, 28 Feb 2023 07:29:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598146; cv=none; d=google.com; s=arc-20160816; b=yvcRl5Trz+pVdlgExkQi4ok+1IhF4JcIrhVpYe/q2AqZaa67A1EubQhfRMg2L82iau H1cadyDUSFv4O/iU/taEEOG1oBljsA8j8yv8+c8oxs5zGKyz0JkLlxiChszFdyKDRo7o UA8H0Th8GlO2X6nLJ9l7+BG3fcmegwJRAjDrrCG10nkmfHTW4EcVCLPcEtiq+JUsnXZp CwJR6MiL+2nwo8aVVToi0MGm8yv6REvJa9/XXJBITpogtvv92HMrTDe756OdU7mLzHPu jZhcoc1m7kvOMYim2b8A7MUi2cLfV/KMbBOjUOx81fyRRqWnb7dwmov3fvlvwW0zsMar GuUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=eihSZiwgZ6E2xYB6tBxQwPxo/1weB3lZJYhUgr716R0=; b=oHt2D9rJDWgUAVwny34i4lLyz9PBxCRCF6fpFBu61rsy6qL/kZ6yQOw5RTDNX+vDVm 6MV611o4S94r8LDCMhmVmPmTCs4hPt9hBgqc7LicBbFaUR7WCqbdNylMgkwwnAp77EMi lkFs8V9/C0HwRi/n9vL07/opYh7wdPoN9EejuA6lp+X/ejOCVuUZpo886pNqFqRzkY6R bfjp45fNqFzp29y16y2JjhTLfgK49T5JpCs2k723kBVlSqdPJDz6EArw2S3xi99rCYZM mkpcrGlZC42iA1lPtk/vd1AkCrK83ZFGViBuNjWcmSaOI3RkW6xO1pRlB6G6oN3GUhxI sxtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iZne8soT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020a17090302c600b0019c93a9a9d3si11102699plk.32.2023.02.28.07.28.53; Tue, 28 Feb 2023 07:29:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iZne8soT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbjB1P0J (ORCPT + 99 others); Tue, 28 Feb 2023 10:26:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbjB1PZk (ORCPT ); Tue, 28 Feb 2023 10:25:40 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEB8D311FC for ; Tue, 28 Feb 2023 07:25:04 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id f18so13729207lfa.3 for ; Tue, 28 Feb 2023 07:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597901; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eihSZiwgZ6E2xYB6tBxQwPxo/1weB3lZJYhUgr716R0=; b=iZne8soTXQSAFkA31CLy56qpAcfb3w8dOqu2GvAqQAOoh2F6nv0pUllNXziBTLDKgg TMJWrdGit7aMLmqSlNn1Clkm6H8z3LOnf6JLIqEAT6LSypohzhubatiC+vmydQhKVlOa M7Bk+eeLR/vV7u5DBjF4LtjLIcYgSN/59BFYNFkKWNcHVWfwYU6jLXCC5ABp2qoMgOpH obtcCBJiMFm+P9/FPkcr5leTZeCaw0RlKochX25oyqVv+jv0ORRulsgbPJxSJr3mmtF4 Fd/ZqqrSPfO+o1CiFIt54K3IE9DYZTlzTpws3QqdDjpTEJjL7s5Z8V3vQuX/XVfwDt6s FspQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597901; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eihSZiwgZ6E2xYB6tBxQwPxo/1weB3lZJYhUgr716R0=; b=qUCZYgbh1rv6X5DP7EhgNfyAATKfUzzgBDvLwN6hobZ2W4hx2MuE5lZSvBtcZ9WjgN df97Z5NQ1ItkP9/pLJ922qSSzymYgfAcyUE2pYoWvhxOe5BN2mxCM/vm6g8vVa47PiW1 8u1hO0w/HF8z0TB2MvA00jm93ofONLU9T0iqupMkXJRIBR6JNiFFTE8OqciAuJZG4aJH aO6HzmI9jGSFCDNWAVE1BCBDuhexHyiOVtzxbIrfAxfCKvBn04fPdgTJzlwSNJa45uI0 h1YGs1VCNrQ6V/lPcO97ZVyDtAS0ktt6n6A8XKH120rTZxXYoXAxR7lWNEGQdv0UwM/1 asMQ== X-Gm-Message-State: AO0yUKXmjKCCui/Fmg+O1zDfKbsxO70SVF4V8MXvrklW0qGqGmKKFxiB susWeEaHpQEDdBWBsbkoBKeSmg== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089153937229274?= X-GMAIL-MSGID: =?utf-8?q?1759089153937229274?= 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: 62533 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3080948wrd; Tue, 28 Feb 2023 07:29:05 -0800 (PST) X-Google-Smtp-Source: AK7set/cGvZP97vs7HVQdXngWjUtAUMwslDnX/8MYFWr8KOoCP28hVEV980IkovTbL3lCouwcMw5 X-Received: by 2002:a17:902:714a:b0:19c:fa51:621b with SMTP id u10-20020a170902714a00b0019cfa51621bmr2389447plm.67.1677598145197; Tue, 28 Feb 2023 07:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677598145; cv=none; d=google.com; s=arc-20160816; b=veNAam3229Or1Xs4WGodidSYmK2MY2s3VXB4h0rkGC2hewQp76YgmFeO6PoDmcp4T+ KkXbP+3Xesz9adT+cIYf72GwiE+jA8aPs7KGpUZK57GWBSUXq5tywc2MrQ5yiEnRhOvV QcTIuTcIS0W7besbEG5E8FalPqRJpJFCY2ncRNHVy3DIaN/WPPxtTnVd2f4fVPmqQ80p r34jQ6ZgvhO4HpccVkiCypLNsdvZWoxD09TRMQTeRHUTwbR89IRYa9xQnksfl89jb93S bcKV4g2mY6ehTj70ebohFxsdRCPBlbYS7zpiNu7WtLVeqAZfyQAAEnNMy+0MNCd3Ht4f +aXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=kE5qtocuEKQZmcQnu8pU7d1MvorKMTiIpTuHnp8IGa4=; b=e7Ct3bO7YowKA+Ciq3995L3ITHu7t+cqaeXOH1vZ9uEFfS7/uEsAcWzxtJ+3NtZqa/ +z7Bge+qg7j8jxwOZLSr3iit2Ma8ST59n6ZBigmZedTFo7kBxpKeXJIuD1KXNrpJ3CTe lraccEmS96tn6tra3AFmveGn6R0uj7P+ZmyhGVcfVG1UuAfxE7DaA0gxRP3TMmw2cxiE /NUkjc6kej73aw9FFibLbnSS2PmW0tRaXaYBrTqlUB7B0zcjjiIn1wFyuZSgkc1UVEFN 6pAtiSO2TYQaaFSB1oqzOxFbwRwV+Vwj1if6sVBcaW5Xeb/S5Mr0qmKRu0ZRhFbmKunV Eayw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RRNTWmHD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a63e60b000000b004ffc2ec1b51si3472311pgh.271.2023.02.28.07.28.51; Tue, 28 Feb 2023 07:29:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RRNTWmHD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbjB1P0G (ORCPT + 99 others); Tue, 28 Feb 2023 10:26:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbjB1PZk (ORCPT ); Tue, 28 Feb 2023 10:25:40 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BEAD311FF for ; Tue, 28 Feb 2023 07:25:07 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id g17so13713955lfv.4 for ; Tue, 28 Feb 2023 07:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677597902; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=kE5qtocuEKQZmcQnu8pU7d1MvorKMTiIpTuHnp8IGa4=; b=RRNTWmHDO9f9TjVnKvzAUhBW18p6cwnxJ10EVuM8khyXpQ+Kd172+fQVK1tC0e8YRl FUbODvvXN84ZskjHNFelg8FsL6gviqtAHE8Ng+l7i66+gziandxiRxnpyCYOeaUWxbzx 6qz0J/4FoTact7/3LDmzbaYv51GsUuMKTcXcMJErpQOOp14Zvw09p8lcPpGbPrO9M5RI 7kYsAkzKoD4BzzbrMoejgJnO7l0+rSzMMb4VwmKJgJqh8l+YZ/NAmdCYhWrb3qR8PpEr 1b2Z8nyqUlf6dqbn8ra8TyCJBePAvFGQB3dBqV3vOJO8fkIjWH89Zq8ByyExU2zljsLP dn/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677597902; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kE5qtocuEKQZmcQnu8pU7d1MvorKMTiIpTuHnp8IGa4=; b=ahqmZrL/j0/p9l9HGRIsPCpvneLD9qL39kr7U0Tzo923JtgI9KQxNYb/Eut9gzQM+q u4oulsfWlu6iXJogvf+R0tvpnEiYZOcUAl5aRNRmRdNlHT/59tm0tN+cm7LdCHlSr+AT ylHtrwie1In4ba9Y/6YNaWng+/eh4Ht0EqKcjwyXjA2+vlUwmWY0P5fvUMiBHq1GdG1N qEJOL4ElbjebbQGhVu2r5Cd6bmMWAFKOGuS1+Q//sTI4ucQ4+S4kd/csfxvcT/Kj3N9n zZ3T/p31wdrIwJq8NKyLlwuNCFS+cS0ZKnO3n/aBOCf8+8tHSXKnT9LgkCWsFEoDmAr2 Mwdw== X-Gm-Message-State: AO0yUKUqdQWdwTdJuzZkGT0ltLq44gwteGKFe/gsCTaAU3NZI7GTB1HS JdKDdHwQyPakoy2Eov4ss0R2iA== X-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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759089152600503528?= X-GMAIL-MSGID: =?utf-8?q?1759089152600503528?= 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) {