From patchwork Thu May 4 08:00:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp132747vqo; Thu, 4 May 2023 01:03:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5bIu2Pt97zqejpB0vb/x2SCCjNfupyzmAQ/xrH2fRQEYAfztnNb7EMawvj57RGRu/HxhjO X-Received: by 2002:a05:6a20:7484:b0:f8:a493:5290 with SMTP id p4-20020a056a20748400b000f8a4935290mr1694572pzd.20.1683187387992; Thu, 04 May 2023 01:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187387; cv=none; d=google.com; s=arc-20160816; b=FDcxYFvbTHcrUajKNfu0aXZj8FJi5532q64dyho3+WYkMgKyoDA6oYNlIyYUp9DORw THp75W+cCoegz9rilinCkzTajFkXnimFO/ZHtDJexqx+s6CBNcHVrEM5ObwxkDloEo+v 5Hsy9tQDUpaR8sJyRWBoNIXczTtBANhzmeaFBXGFMD0syfSHb6j1uYoPV5x7NNNu88Jn ptXekjnsDXqhhdkVkN5IIxxr4Qx0GRgyAV53fWWL6PHGhpBhzPzDXFdfOMSrHx2UTOp1 ttXhpn4uLAoxt88AE6LW+Tf01v5Z6wjnWGZtkrDB3LlHgxWSVZD1niaLKU/gifcscKLD 4Vwg== 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=708w9bx/Wu04zRxH+k1/smuWapQNc4JobQVr0bsQL/8=; b=IE9pQYZP8P8IJE/PzdeEwIIhY69b7RHZPuzDf6MoV4LByd0fC9r7PlVdr4U+8ZX9vO FB3r6OH9Q2iXIfoL4GPo2eArZOpJf0xRTbLQ1OT7AUtj6opVosqLJwQH6dG2l0HJc1Cc vj8eE4qiKVbeIH1/NTS+OMO1h3hx5IF0F1d98AUvVCKf12T7ZvfEnSLfSnn8MVLO7LI6 zUjh+0bzyVZTEmcM7LsUnzmfwiXi4GFSYE4cwoGcnE9Ry97Cb9DLOTx5jMknTbwJrK/7 Cq9pTRKaqxmh0CbNwV7PXNc5LOSfudyvOfnEUGHiHDYiciMcvuJlTpAk3hCeQv7ruLjW QJCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OGR0tw0c; 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 x24-20020a63db58000000b00527d158ec6asi3027243pgi.36.2023.05.04.01.02.51; Thu, 04 May 2023 01:03:07 -0700 (PDT) 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=OGR0tw0c; 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 S229965AbjEDIBf (ORCPT + 99 others); Thu, 4 May 2023 04:01:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjEDIBa (ORCPT ); Thu, 4 May 2023 04:01:30 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34BE819B7 for ; Thu, 4 May 2023 01:01:29 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f13ef4ad91so178888e87.3 for ; Thu, 04 May 2023 01:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187287; x=1685779287; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=708w9bx/Wu04zRxH+k1/smuWapQNc4JobQVr0bsQL/8=; b=OGR0tw0cEPJ5IWTGefJN3lh+ujc/nM4fchGGHuc04tW3JNrfrS77NsIXQGeFOKG1hF EUKXnKwxtzC+3qFTqNPiW00PTDig9FhjZTlFqJASN+jpCbXv1W0itvU9M82lEqtFd6DL jNJf8YtAvUIxDbC5csuTCl8CxNFmlDhSeGOmxvWhrkPv0JLJoL74Oci2/sHwDj+9ScCj tZgKEKBD0MffKm3wmMhMlt/wFo5oJZ86vXX4sso4WBrJgS4AeA+fi0IAKyxbm2xMsb48 2dEeN9g/QZzsdNjrEc6aO+R2guU5aCvcYIAOJ93h8cQdLIrUyqyTxwJBaEd/qhzZqUwL Kjwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187287; x=1685779287; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=708w9bx/Wu04zRxH+k1/smuWapQNc4JobQVr0bsQL/8=; b=B4U3MD5ukOLikxaMIg7wNaLQuFBiXRIuEWBhaibZa3ZRlukii71uTwjiyte74T0dl5 BaiwG2cbCdJ8K79YKJJ0FqwwlmKTVcltpwhYESVrotFvQrP8t7Ida8sA7qSbvkJFltHZ 7qaqrbteqzPqSxECGFv8Yy6XjBVn8fxzd6KNaNIIMn+Ld5OA0tgusr07YbPqZZGoEnYd P0PBELkUvQKU8BxfC1iT90Tz93NV9hqpR5XSsPIdbMiUht3bsksPXtrOse4yc+4wxtJn /BGYHOY16c/vdQXmsOf60VcEqovQ2//UTP4ttO598b2bjMS54GFVOt8LCabVBnMTPFbI B68A== X-Gm-Message-State: AC+VfDzomfTHrpbRVIhk9cH1F5xs2m255uesn6zuQEN9M01lYMw1cxtw oFbq593eE5uPmQ5slMZrpWPqVQ== X-Received: by 2002:ac2:42ca:0:b0:4ec:8853:136 with SMTP id n10-20020ac242ca000000b004ec88530136mr1300300lfl.12.1683187287469; Thu, 04 May 2023 01:01:27 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:27 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:00:57 +0200 Subject: [PATCH v2 01/18] media: venus: hfi_venus: Only consider sys_idle_indicator on V1 MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-1-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=2458; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=LQtQ1yE07Bg59BEEMI3NIlj9dkGtgWhznhuEDogV/mw=; b=Kws3buj9gak4YkC02btsKAwvOm9JWfGiV7pvaPoDuS0Xql4ESb80+IRE7Gica1xethqYxktGt ixyW96vm1WpDAjk47aOSfERSfhh6F+OY4cCW+lyjeIxcYcv5o7x853N X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764949898805648223?= X-GMAIL-MSGID: =?utf-8?q?1764949898805648223?= As per information from Qualcomm [1], this property is not really supported beyond msm8916 (HFI V1) and some newer HFI versions really dislike receiving it, going as far as crashing the device. Only consider toggling it (via the module option) on HFIV1. While at it, get rid of the global static variable (which defaulted to zero) which was never explicitly assigned to for V1. Note: [1] is a reply to the actual message in question, as lore did not properly receive some of the emails.. [1] https://lore.kernel.org/lkml/955cd520-3881-0c22-d818-13fe9a47e124@linaro.org/ Fixes: 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations") Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 2ad40b3945b0..bff435abd59b 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -131,7 +131,6 @@ struct venus_hfi_device { static bool venus_pkt_debug; int venus_fw_debug = HFI_DEBUG_MSG_ERROR | HFI_DEBUG_MSG_FATAL; -static bool venus_sys_idle_indicator; static bool venus_fw_low_power_mode = true; static int venus_hw_rsp_timeout = 1000; static bool venus_fw_coverage; @@ -947,17 +946,12 @@ static int venus_sys_set_default_properties(struct venus_hfi_device *hdev) if (ret) dev_warn(dev, "setting fw debug msg ON failed (%d)\n", ret); - /* - * Idle indicator is disabled by default on some 4xx firmware versions, - * enable it explicitly in order to make suspend functional by checking - * WFI (wait-for-interrupt) bit. - */ - if (IS_V4(hdev->core) || IS_V6(hdev->core)) - venus_sys_idle_indicator = true; - - ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator); - if (ret) - dev_warn(dev, "setting idle response ON failed (%d)\n", ret); + /* HFI_PROPERTY_SYS_IDLE_INDICATOR is not supported beyond 8916 (HFI V1) */ + if (IS_V1(hdev->core)) { + ret = venus_sys_set_idle_message(hdev, false); + if (ret) + dev_warn(dev, "setting idle response ON failed (%d)\n", ret); + } ret = venus_sys_set_power_control(hdev, venus_fw_low_power_mode); if (ret) From patchwork Thu May 4 08:00:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89968 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138130vqo; Thu, 4 May 2023 01:14:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71ZwfpTJJvF6EX70dY8/t9Rd51nZ63FkCk6l5PKR5cIu/sRy5BwL3ydsJyexL0Sxg6oDyu X-Received: by 2002:a05:6a00:23d0:b0:63d:67e5:9731 with SMTP id g16-20020a056a0023d000b0063d67e59731mr1619008pfc.2.1683188050863; Thu, 04 May 2023 01:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188050; cv=none; d=google.com; s=arc-20160816; b=qsM9grU8e+L+aDRg7opI/pO72dsXLs0q2sN6AMQqgM+n81YTg3HF96Pn0KsmqjSOeB rnk6o8ZYgx0puwLFrtO57BVtKFVXkPknatoavWfy01012FcIhCO+pkKhSw8+4v8Qg4Ex m59jYOaZ5595Y/7jRBVtM0NWbRYUC0L+vAyce/ESGBCuyZGBmoqnpm1vNx0gbsVfOMV7 TiYriKJWz80EXXT57BbgS1DwKXKwS21a0Yo51da3f/+TB3ulAE8oVBWvLvdK/IPYlBNk yYI9/cLykhcE83NK9R8aNiiklw0zqMNRpRhIAOjUTIpZ+RUbbP08OfyLGv/UA7hTjhrv qCmw== 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=wx5dYQRwBkTI+vIENabmZFidu+UG6bsoT2w/E9azkMk=; b=xWuIKeg+G51viRFTwgI5VIu5kabRWiZolKWrYfMhBgsMJKfiWVfc4iOvMF6j82MRgd lU3vRIpwXv2UB1JQ0hxv3zLrJPzjhFLQyPf7dRdwbGjSTXtUWTkPyevfQaVydLwnJk+n njZkjHBqs8vJp2SN1diKnSm69ifvtcOKoAJSaNzq52xEsNp1RQo8u+IIl1gP4xQVk8wx LLUf9fKzNtABONswdf6My/jTcEZ3eNpj06Jxp3oLLhli6IR3eiACD/T1e48blhJpnGQM cqDHa9ybQgDZueJBcweDAdxnzEOVo8aZBo1Yr97Wq/YNOYA56jDFhcBFAiPy1piwXC/e 6uvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ms5+Av3j; 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 v10-20020aa799ca000000b0063b8e23415esi35650630pfi.92.2023.05.04.01.13.56; Thu, 04 May 2023 01:14:10 -0700 (PDT) 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=Ms5+Av3j; 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 S229944AbjEDIBp (ORCPT + 99 others); Thu, 4 May 2023 04:01:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjEDIBd (ORCPT ); Thu, 4 May 2023 04:01:33 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC5A09D for ; Thu, 4 May 2023 01:01:30 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4ecb137af7eso176216e87.2 for ; Thu, 04 May 2023 01:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187289; x=1685779289; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wx5dYQRwBkTI+vIENabmZFidu+UG6bsoT2w/E9azkMk=; b=Ms5+Av3job8E1NirdFNKWCSJStO92kIfaxqw+VlDjqCaZhN/Efha3zMGCWN79gHpm6 AYoNhZnRWQ9mpboNWew9+7ajEw1d4K/Xe6khT7s1u3m7cb81rm8QRb1qyBClKM4Bwdvk XF1fy4+eiM9SKrtyWY7+hv1TyqVZhuSlHj7dsbVOcvP62ynjzhKFPx48lhLRjMvjiArs PM3nsodeZfLfyymZbj+LVVubsodwoxVLtg/5F2SC9T4T7WA2AP7NdrmgNRgFB+1Sc2zG p1GH22purCn1XKxIjU8l01PR8N/5xVG6bmsVO8uLsN0D/11cQ/5JBPi4rUk2bQePDbFp v9ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187289; x=1685779289; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wx5dYQRwBkTI+vIENabmZFidu+UG6bsoT2w/E9azkMk=; b=A6BCRKcK3FDITnwAMy7xWjM5DFpVswvH3JxY8GQ6mNGdo9F6S671vqWivbOg6+rTpy q1R8ynEB2eXX+I5PCDgdjOynyPGjcPt+NPXOlAKs7JeLlHhH7mwNE3n8QhIFxqlqVajz YCxT9jLPFRud3NEGiPcG0zcGrgzIP9VTFTFtitz9DaaSV2Ld/UIQ6LCSRtNol4VIINpt jPviFMg5j/ymrAWoDPbblDTEZwC/nqureYy4ihXR3Uvxh+hZvTECv3fG+zUpicx8BaYe NdrJ04JLkHhNHNsPiojZV07/dx9soGCMEI9ToP4q5aWaxjwewMPo8QZB+6qjOL4Jr4oC RkeQ== X-Gm-Message-State: AC+VfDwEQq5NhKdvY3f8hZvzz5U6K/N/fjukMuPjLPt/HHatL+O/DTh4 irbRBSFQ1g0bJeilvryNtfkvvQ== X-Received: by 2002:ac2:5237:0:b0:4ef:d573:c8a7 with SMTP id i23-20020ac25237000000b004efd573c8a7mr1613614lfl.32.1683187289004; Thu, 04 May 2023 01:01:29 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:28 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:00:58 +0200 Subject: [PATCH v2 02/18] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-2-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1480; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=0Uv5fE0exjmqzKoKkMe6XjqGKp8vRm4Af+NoaiadWoA=; b=p8XdYya25TcMY0FfaMTCVG6sx7I3fHtL6U+tbVXguByuFj0SbJNHB2/NIZMhEKfLrj5xnCFBx cYuHLgF7x4LD9tjzFro39MJA/tVrZd6hjnrRRYtXA4l4c3Km44/4ybo X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950593690859068?= X-GMAIL-MSGID: =?utf-8?q?1764950593690859068?= The downstream driver signals the hardware to be enabled only after the interrupts are unmasked, which... makes sense. Follow suit. Cc: stable@vger.kernel.org # v4.12+ Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index bff435abd59b..8fc8f46dc390 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *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_V6(hdev->core)) { mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | @@ -464,6 +463,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 Thu May 4 08:00:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp133038vqo; Thu, 4 May 2023 01:03:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6l/ru1xL2eG1Z/gEcI75KtLEycB4g/sgXL4OG7gY1dHiI0C0/dG4Fu07/2iQDC3i9KyUT0 X-Received: by 2002:a17:90a:602:b0:24d:d377:d1 with SMTP id j2-20020a17090a060200b0024dd37700d1mr1333949pjj.45.1683187419987; Thu, 04 May 2023 01:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187419; cv=none; d=google.com; s=arc-20160816; b=EUmRgp4nXBBVYpAPja3SnsC4wXZf+S36omddj+RcdEdyo+Fz0uwiX6/K+5NWBXEWGi tfddf/I4EVw7+5sCYdUHP3ekwTe3RGJTjGjt3NEvH3gzVUeY49CjJEik45zM7Fd7ai/T Uds+lvxrFUh0Bxl4ykz1dirgrgpImB9iZHbwYGaLQz9nXsoPxxWOC0w1oxWMpR/b4k6q fisbh+rh+e+iqoDEhbas23phQQIV22s+Tesu1DICB4znUbmGzndrEyGyg1NgMgipwCHI M4fbG8nGB0wSgvgwW6TAVfgwXWAnJU1ICSLZnHYJoYaGawLVXoCcqkbBYWHA5ElPnysq V0mw== 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=C1wrHdE9iKrmB/WxNypIy4J2UJNGNaaQcU0qAUemPII=; b=qRVEF2TbONpaZMa3rGOGAFFmXHZgFMA8o23LK3tACTu2cw5dOjtqxKNTrhokSOwD2V 8TMfj0mi995sTB02+tol2+kopRlK30ca6/Uvde2N094Mamx5nMPQ6jadiGL9nfluBDin 5tmRMsK0LvNn0VIfezDDyBjVB/jtMvsXCbE8RSbdCxuicLqNwDUDA4TYcx3+QfywAOdB xz/eQB0pzRHm1HFQdsYO2oHllFfuzgc5wTST+XLMT4bs9DbMnMsPfwHQTMWGyIwf8OJs SgMgSnYncyGpZ8csxemgtGwMTQ9zL9yfo2JurUXy4j8dwjfOBFv3sYtEJaiTSup/79E5 LvWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WDHW2yNA; 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 l66-20020a633e45000000b005250c24fa2esi2904239pga.428.2023.05.04.01.03.25; Thu, 04 May 2023 01:03:39 -0700 (PDT) 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=WDHW2yNA; 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 S230036AbjEDIBt (ORCPT + 99 others); Thu, 4 May 2023 04:01:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbjEDIBe (ORCPT ); Thu, 4 May 2023 04:01:34 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E9D53C19 for ; Thu, 4 May 2023 01:01:32 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ac78bb48eeso2064061fa.1 for ; Thu, 04 May 2023 01:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187290; x=1685779290; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=C1wrHdE9iKrmB/WxNypIy4J2UJNGNaaQcU0qAUemPII=; b=WDHW2yNAhW01kMfJX7yGsyy6Gm+EE6cCAyf/9TIZh/Xbpz6NeleG58b44v9i/qahSH EAs8+5YKk3uDuzqKIaNKUciaZ7kbWStZMrVSsK3t1IMJ86+PZGfrqNfJ8Ha/uP2O6CoE 3kVdb/6t4Mhaq0ippPDLk+I7PXd5NfJ6AzHy5jvkgSk5gC0+3zsOY44DlPi0W0BjGf7B gsCAoWrwF+kqT5H2mroGxqsnJ4Y+HI1WYWBCJD6c34ATI3Drqx4KscXdGSqn+iO0MK3b TEnwILA4FXpR5Dr5pyNomkfuYmBShqEbSjsmqUbjiFATvdZE/VGg51cWp1R/HAKIKyrw 8z7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187290; x=1685779290; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C1wrHdE9iKrmB/WxNypIy4J2UJNGNaaQcU0qAUemPII=; b=kfA9LZigX+ljTHOOvRQP/LYONxuwRgIWdPMkeJHNrMoXxTMb2uswF01W2mxbBqeLLw tkNMElEZI/qGe3R2ClXENzin2k62J/vQX4or9gYsfFfCvHR0oZMyCc6ANUT2+e+G3I5Z 4dr9vyrKOp5usj8HjYQ5nRi+2mCsKv/z2jKlwig9rRiVKec9U26MjPLpboQ9O/UBTTyo a/L3xJI5RI9Lsec1DWh1GXzgl3h73D7eyaoS0VqlXMl1S5EZrSOAkH2knHoVFu5B9aV9 k7db8XwlDCccTxn0PEUDUXEYT/vfOpZuVyDk6CYA/8dEx9+N2fO4mzg8jzjYCMtq9vzp qwog== X-Gm-Message-State: AC+VfDzUVWt0S9dmhuNx5bTAWDcGLf6eprOhdve25fTh7KISq7Hbbiv/ XHVuuppa2jeDkkL0x96k6cM3ow== X-Received: by 2002:a05:651c:201:b0:2a8:e4d3:11e2 with SMTP id y1-20020a05651c020100b002a8e4d311e2mr711499ljn.39.1683187290499; Thu, 04 May 2023 01:01:30 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:30 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:00:59 +0200 Subject: [PATCH v2 03/18] media: venus: Remap bufreq fields on HFI6XX MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-3-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1455; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Y7O3kXJUMALOc0Q0JhoHuikwOvvLDtLGeWfKw337F/E=; b=jCZB3nnLtzrwBc/9nUK3HW69Wl7+UodaZZct6VGWvDO/jIlFm2QK2OjGO7+uIAfMRHFqyHcBt DsDW6iF+tIQDZ5vspOGLVJfq/1AzMQT9Pm7VLtQPpb7Nd3CdmnqIeSo X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764949932206345079?= X-GMAIL-MSGID: =?utf-8?q?1764949932206345079?= Similarly to HFI4XX, the fields are remapped on 6XX as well. Fix it. Cc: stable@vger.kernel.org # v5.12+ Fixes: 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations") 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 105792a68060..e0c8f15644df 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1170,11 +1170,14 @@ struct hfi_buffer_display_hold_count_actual { /* 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 Thu May 4 08:01:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89971 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138323vqo; Thu, 4 May 2023 01:14:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72PWx55f+ohYpvM0xce4QGUfBmo0JEDQBDzpzPDKpw+co54TJupuNJ/5DXvX5P/336jd3g X-Received: by 2002:a17:902:d2c2:b0:1ab:581:839e with SMTP id n2-20020a170902d2c200b001ab0581839emr3423514plc.65.1683188078609; Thu, 04 May 2023 01:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188078; cv=none; d=google.com; s=arc-20160816; b=SmR/rwOWxqeYs4HAGp0GumPAQO/ICqGC3h7774AZbMniCt2r8BC76gkEOhkuBP4rni j6yvGeTjzCRmlNPyIOlAUd+Hc/ZEjsD+QN3JNBjkXe+EWvSRrcy3EEnGSK3OY1xfLvGq yVq0KescZkuZ/V9cdHTm7+aHsh3RYYQIiD9IJ4nEvpMaUeYhwtMp5W3xUHDrUucYlxVZ SjNAMdquGUuVM8J86Flr7PExKfJaQtTqd/55vg/Pz9Y3qQRl4Cx/q2klV8gbbxbOgV5D lvxAmIMFB3dWZv0ruqoMXJEWaMUKDrCtbw49x+qf7LmKzKOjQm/Ybhc7/+Ajb0S1fiGO jplA== 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=yzxlUp4GevQo4zepiewLcHPe74bB2xBOAHPwd2eLqVk=; b=mWNo0nAjU1/t3CFskXTy9BLAfYU8zymZ+P204kkyYX39kukRk1r0XjQCqWeMgAEWjg 1r4UI/dpo2t0gFXR2OOF5ri0Ymog1LKR9LFuJdhB87LxbcdcY3vZqtPW+9grDAy3zQlx hwq8xh4c+k0H2AWj565nFD3w8jwkWdOvUPxhhiv1nCmWVxdLT3TDdnjvURM2cGHeXWIK 1BEEnLUvCzMkhjj00fb1JbzuxmCgbOFyauZWnBJumGONLnqb+YvCEnLlGzohbGu8XS5r VYuWNYQ729nxaAMFnjNXWk/sQL0XJzqP7SGIZPEMznXoEcjsUQLiLCSYrfzXezKktlCB riOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WSR6igft; 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 s14-20020a170902ea0e00b001a2104d7075si37958183plg.72.2023.05.04.01.14.23; Thu, 04 May 2023 01:14:38 -0700 (PDT) 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=WSR6igft; 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 S230144AbjEDIB6 (ORCPT + 99 others); Thu, 4 May 2023 04:01:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbjEDIBi (ORCPT ); Thu, 4 May 2023 04:01:38 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9AD740C2 for ; Thu, 4 May 2023 01:01:33 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2a8b082d6feso1982521fa.2 for ; Thu, 04 May 2023 01:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187292; x=1685779292; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yzxlUp4GevQo4zepiewLcHPe74bB2xBOAHPwd2eLqVk=; b=WSR6igftGzl/n19F+ivPAwwjgS3NkuZOc0nOXB79LVGDUnvoLSnGzoAFvyL+GiK8yT bHUjsRKYbkyos6N1khLh2385eoKbTQkXz8sIVOAdjc64AnUyaAagPBZvnjhlZXRdhO5o us8bEIlvvFJTYHPq3XUOAv0FbFsggaElghw4O/AjLagT3Ns6e4ciGm9NSp091ombSTnt Pn8BXrVi1dG4BQylgQw7RedOcSQuZhiMDaMR17pT1TuDC2evWcdbMel4nnULgG8vjhqR Vxk2WCkN8L++KB8RqldXIg3Tf4PWmiYu+NvmwYQI52TH7PEkWuQz3ziONVoLnYWx1Xsj +6ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187292; x=1685779292; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yzxlUp4GevQo4zepiewLcHPe74bB2xBOAHPwd2eLqVk=; b=SHSsn3r+UvXIqaVKYFr2ohKB2WIzDoTZnh8IdAdhCFM4X/28dPxYyGPzWWz/uNFfe0 O/809EwuhyfuLRh0+ZbkI75LRfhqO+HO1FKb8em/XHKFdfpHEGhDcd8G/B7wOBpGsAx1 jtOPKS01zeF+1xZtkrVbMByI9exWJyFj7oMFbVwQ6L2JtCmrcPKYg4PNCVfrN+49ClkX F3RShOgOE/v4k+QjBXCDmF4RG1SaY9p0hM7M2AN+a0nKkT7yMVVD+qQG8LS59BZy2h9I IOTqw215rJ4mUbXJlITqyk+a1ZTky8F2NVgC1j2+QxhptIj8AXj/XPROaV7Sre7jM70a Begw== X-Gm-Message-State: AC+VfDz2qtUeFg+Vxmvflt16BjKvhJboAea7xaBaJCx1ExfNfhEEhjg/ aWDUVC4dX7t2lsLHYyi3bDlMgQ== X-Received: by 2002:ac2:5237:0:b0:4ef:d573:c8a7 with SMTP id i23-20020ac25237000000b004efd573c8a7mr1613683lfl.32.1683187291973; Thu, 04 May 2023 01:01:31 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:31 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:00 +0200 Subject: [PATCH v2 04/18] media: venus: Introduce VPU version distinction MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-4-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1983; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=HzABoJBacsfN8IA/HbPbvHnBAN4Alo5yV3JV9j0U0iY=; b=To1WkTJnLXLSw48ogxPQ3YmXryfFfCKO+6KFtrPSzA1dHUlfBUkToGVGYWYr3k2ukttZB02Xr uGbPA5Ykh1iDKVnYx3VRe/HTccaQkmQUyQhwXfQV32XRNScUzchS/kB X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950622645269016?= X-GMAIL-MSGID: =?utf-8?q?1764950622645269016?= The Video Processing Unit hardware version is the differentiator, based on which we should decide which code paths to take in hw init. Up until now, we've relied on HFI versions, but that was just a happy accident between recent SoCs. Add a field in the res struct and add correlated definitions that will be used to account for the aforementioned differences. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 4f81669986ba..62c310b7dee6 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -48,6 +48,14 @@ struct bw_tbl { u32 peak_10bit; }; +enum vpu_version { + VPU_VERSION_AR50, + VPU_VERSION_AR50_LITE, + VPU_VERSION_IRIS1, + VPU_VERSION_IRIS2, + VPU_VERSION_IRIS2_1, +}; + struct venus_resources { u64 dma_mask; const struct freq_tbl *freq_tbl; @@ -71,6 +79,7 @@ struct venus_resources { const char * const resets[VIDC_RESETS_NUM_MAX]; unsigned int resets_num; enum hfi_version hfi_version; + enum vpu_version vpu_version; u8 num_vpp_pipes; u32 max_load; unsigned int vmem_id; @@ -481,6 +490,12 @@ struct venus_inst { #define IS_V4(core) ((core)->res->hfi_version == 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 Thu May 4 08:01:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89953 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp132849vqo; Thu, 4 May 2023 01:03:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5k8Gw1ZU25m1y4W8nlA3Bas4YZ/7hina2qLP/RSj5hueB6XLaz0AZCRsGH9+w+3EHGTrnA X-Received: by 2002:a17:90b:154b:b0:24e:1ef0:8c40 with SMTP id ig11-20020a17090b154b00b0024e1ef08c40mr1180470pjb.35.1683187400166; Thu, 04 May 2023 01:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187400; cv=none; d=google.com; s=arc-20160816; b=y77PV3XP5YQPm/fmjwf9eh/qhYhATwWUqguL+992CK8xSmXXwv6jbUGPcSFAybWSHi 7Rb9Or52bkQlLcU90JcoN1RrTD37Yb5JUQ5fmoD+vLtFU7rHcHdbhcgeLYLo7x2xLHs5 wo0wJycTMA/7Ad5Vqe8ulokOsER3cAakGkxCV+eeyOC8MdgP5v05gqPrNPxWmShoBugk ADgFOF+w9D4FIavFGJiSe6yj/8rVBqms1la+UZnf/TCpq+MD04aUoBE6T+3PTGxs52cp lDzARffhvLwPi8bVGrn+k9E5pulmrH1tq5V92x7YZq+1Q6b1lvkjdlrMr0cJTRCh17Tc fofw== 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=BDmBIF6Y44gX79pnQMyT5DRSZ/9AxwD6dwqNk+EZPk8=; b=fw5cAxYC8HpJgRxs5PT/WPGzK+ELesUNtMOnDNM9IwNkx9NJWei/gxYQlce5mHHbGx 8HW7g7h6ahqERQlAFqyNhA1cP9BbWjOWX3P/QiMSqpERPCLfEyXLPzB/clE35Aa4rY7s MuNoBwuME9E3Jf64EoTtnPAnTloisRJGyBOhxIgsTEZDSrX13gJN8iKoz792/59GyTLN 9tFPtOVivLZOMcu0ObB5opfJlqi960+QKuLaaWD2SV+2b3ZNfcsHAQJK0sOO2GYrwdhh IPx0cYmFUhTtf5t878kxXYZ5YLQTGKzKQOnuyD0FrWDSTbQU1Bt+31IxDY6jEh8KTMj/ ucXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MHbqK33J; 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 c5-20020a170903234500b001a511254836si36947407plh.89.2023.05.04.01.03.04; Thu, 04 May 2023 01:03:20 -0700 (PDT) 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=MHbqK33J; 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 S230123AbjEDIBy (ORCPT + 99 others); Thu, 4 May 2023 04:01:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjEDIBi (ORCPT ); Thu, 4 May 2023 04:01:38 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AB4D40CA for ; Thu, 4 May 2023 01:01:34 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ac80fe9facso1096691fa.3 for ; Thu, 04 May 2023 01:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187293; x=1685779293; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=BDmBIF6Y44gX79pnQMyT5DRSZ/9AxwD6dwqNk+EZPk8=; b=MHbqK33JgS0axtQcdvgU9TcYSWkAhYQCWUCF/YZDTSgIqlPNHwNHP2i1PbcGRFDedG jTxV7Kdbuu82B9anxCuDCw9Ft/B2liBnx73kIFdoG72sVUnuoEcDhmYJCo91us2cmJF3 6rQzYhlym1+rOK5YQoUff7mqpWzBbqmWwjOptc1uGUj1kpJ2jpZNxkvsGHNspAj4rQYZ pCypFUQEln6itSexDK1cyQ2BjWg9i+CbZdRoM3dYH2KI3+qBfminxpFZM0VnllumYj0m lIvpq9Gzp4IzznTmNlU0HYfJWtMRYM7sKDnvQtjcQcOdmgnpXFHlY6RD12vL80qEjyWS Y1wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187293; x=1685779293; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BDmBIF6Y44gX79pnQMyT5DRSZ/9AxwD6dwqNk+EZPk8=; b=UJusLeHfCIauTNBmHIeQm33iDiu4VxI/iHdFtvrTs9ASGhs/KqPPIqLwvhKAMwDplu EE1pOGnnoxC3wAn7603+q7W5NLA+bbsfVlM76simEyy5xSP0PdpGhz2VtP2bAx9ssnGk ExWJc98VCFh4cWC9ZFns/8POvcWSXvKJNMhOAilhgT5jh20mvaZOGze6DT8jfYSd69js HS3yhGmKBeiDATFX7ZKdUfsuHSjRM1DvBhoyIKHP/aFSJEj6AoToQbmOtXRxndnuh81g VtBaaikVf6ugUAR5y6zrWBY+gDH1Du+AhEC+Lk8HfjwLIyDVSJK/oyKnMWNSJakl3XTr hAcg== X-Gm-Message-State: AC+VfDzmipO+uniaN3L6RpCZG7oQi8m/0xb31SPqRLZk2TGmQSwxr3Om JCvpAip8kYId1rBQC69UqHZMqA== X-Received: by 2002:ac2:4943:0:b0:4f0:1149:c875 with SMTP id o3-20020ac24943000000b004f01149c875mr1538841lfi.31.1683187293566; Thu, 04 May 2023 01:01:33 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:33 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:01 +0200 Subject: [PATCH v2 05/18] media: venus: Add vpu_version to most SoCs MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-5-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1998; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=s9xCNGDsq440Iu3/b5ZyYc59czGdU6SE4WtTXaMHwdU=; b=AQ1D0N86iXcaboS6CgN7GlpWPksHa7YyngiCZKPd6Wmzjnx8oNjO1ikfZCU+quDMrdSyjRZZv P7OIfelt13eC2W9ifDF7jg+ZKaeQ1mDSxe2hGijjafDJtLQ4a9JeZLh X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764949910978019801?= X-GMAIL-MSGID: =?utf-8?q?1764949910978019801?= Add vpu_version where I was able to retrieve the information to allow for more precise hardware-specific code path matching. Reviewed-by: Dikshita Agarwal Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 2ae867cb4c48..01671dd23888 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -684,6 +684,7 @@ static const struct venus_resources sdm845_res = { .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, @@ -709,6 +710,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, @@ -756,6 +758,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, @@ -809,6 +812,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, @@ -866,6 +870,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 Thu May 4 08:01:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89972 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138342vqo; Thu, 4 May 2023 01:14:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6RPPLe0oDEhHk0Y4EVGrWHHu5XpBTjkvzdHKXqtK9ClYxjmhGFxhyRYnVqJbIgohcvBOg5 X-Received: by 2002:a05:6a00:10d4:b0:63b:5c82:e21a with SMTP id d20-20020a056a0010d400b0063b5c82e21amr1525644pfu.1.1683188079900; Thu, 04 May 2023 01:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188079; cv=none; d=google.com; s=arc-20160816; b=H7cSm8NtHU5gyq4+MlBIdcqoSPC3FKUmCzhB1l78dPAqw7KUAhBePa67ulTOIp35H/ EPcMn3etCr/tRJKXj4Woanq+AnTVuNtGEsLIIvzJozJ8oCFzLDI+k+IUQgkt/AzqxdRI wmK8dyh4/pqX5SFiibm6ArMfbCUHye6p380vmCIDBFIvOEOZCXGQQ+4Xh7tiN+TUvntS +jfnkoNboBU49TMMW5N0PJkVD8H8rlFObXBOQ3WGx1tcj7comLZVZw4ptHWlYVpJLGm+ VRffaJIOohfPOZzmxH3CUKNgtPh8WtsdFK5l7c3Hjv2fbO782CCDd3dAR3YC6pZjawGe IuDQ== 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=pHuJqh6clnMhDFgSRdYKRfsY4OFox3kTZVS9qASymWE=; b=E/OqJMeT7iTIu6XcH0CGerbBTeOnmAY0tUFbiNTLq8DNo+K0Zhvlk+MbW3+byAtZKr Qhw9d6Ib5pvT8qE5r/Ne5sN4L0adYO7JPBJyHx4wCImPwAtfrw8Y9Y2ButIbpK+CAWZA +8wozzSx+Vq3xjCFGsaalY7uCdDkomCUYIozs/cGiDdD62GIYGXpo4usTwf9TzPemteK S0KkxVCpY6u8h+bNiVfcpsgdUr+CRE6ZALq0ZApNNvcfEwCykdHeviehd2FYu2n0pE3G Yl3Klg2nbfSEWjg0ajg9Gc5Wgar/B90qA43hWEEuJvzk9mSpDRrxAVb1jrGpR8sR31RN ULuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zUipfNWa; 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 g14-20020a62520e000000b00640f213b6fesi21809586pfb.240.2023.05.04.01.14.25; Thu, 04 May 2023 01:14:39 -0700 (PDT) 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=zUipfNWa; 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 S230158AbjEDICB (ORCPT + 99 others); Thu, 4 May 2023 04:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbjEDIBk (ORCPT ); Thu, 4 May 2023 04:01:40 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1C863ABF for ; Thu, 4 May 2023 01:01:36 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4eff50911bfso178773e87.2 for ; Thu, 04 May 2023 01:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187295; x=1685779295; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pHuJqh6clnMhDFgSRdYKRfsY4OFox3kTZVS9qASymWE=; b=zUipfNWaazL6ADynZcrfI01DUbRNogvA6LUhNvy2poxcQQzU2Jpsb0ktYJC/nSpVFf DkqZSLSzujw/tun5InCQmu35+nV9qnAWVgoGQlOzqQqBMgpw//jzw2E/3xRqDvQ0W91y KaEuNlbZYNYmCO+QChSO4QTI36SicJPWc33Z01H57/lVqzQNH90zBipn4cfencFclMqz KkhcRtp4zyHBFgl3MlqCvU5dvDQ9C8rrbPMR7aHzZaUvUhg48RwhHcK5CcYfG3UdvHuY FNyXAMDHDisRWW2jQifShPgdk61CGuq17aL9bRnNk1V5QX8nlnvsBPlzJ+gJtH80ixOz wPwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187295; x=1685779295; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pHuJqh6clnMhDFgSRdYKRfsY4OFox3kTZVS9qASymWE=; b=Np79NfvvFN9O/0PWzeCpwRfSg49xNAhlBWANbs/mQn5U2ue24A8kuLi3k2d2mHkWIF 412MgPV0o36VtSENA8heuh8Wo+lQaLgmGGKZHe+itWxLgvcluTruifri/L8YauwPRWKP CZdNo3b18MSd+U7XgI8kG7jqXuFR3hINkA5eZGzs1rOp7n2EIq4qC8bDJueel2g6Qs9b M2dBQuGwYGOKcJSawByeiGTIhLEPxzDw9oJWvd/QTfECkUW/nsuz7Oh0feQjMInSG3t4 c95imSaikHeGl8ocye2uVDg5zdrDPZcA9MhUCEcAuqf9Rztpm3tGG0pC9cO0KBly43hY MBsg== X-Gm-Message-State: AC+VfDzoR6UMkL8eYjl+G1m7OcdBnjV4m7WADj27HrjymGwJcvVHV35N SJDUY67gkLY28fmJ92zO0RuzkA== X-Received: by 2002:a19:7503:0:b0:4f0:4b:538f with SMTP id y3-20020a197503000000b004f0004b538fmr1601126lfe.29.1683187295132; Thu, 04 May 2023 01:01:35 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:34 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:02 +0200 Subject: [PATCH v2 06/18] media: venus: firmware: Leave a clue for homegrown porters MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-6-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1135; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=EgjRQOY12/YgIbWH62eZ5y8nBX3H3pJik8G0F4SYRFY=; b=nQEw2k9F74MAxmf470Mil8wFjXEeWKtb4BAhs5r6xj+O8SHhrmSmWKpItUFOnSd0pmnBcqWBf EfAAgrecd0rDMOpthvvcK/aABUI8hm23nzqEXoXqbALT36JM+Qmn8SL X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950623974192766?= X-GMAIL-MSGID: =?utf-8?q?1764950623974192766?= Leave a clue about where the seemingly magic values come from, as it is not obvious and requires some digging downstream.. Reviewed-by: Dikshita Agarwal Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 cfb11c551167..a4cd919e1dbe 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -241,6 +241,13 @@ int venus_boot(struct venus_core *core) return ret; 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 Thu May 4 08:01:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89955 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp132955vqo; Thu, 4 May 2023 01:03:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48DJIceVnwSyyLdkpGnSwU4lEgIk/xeat0m/HKALeDLdXS0ZFuBxRGzbYna7D+nMmDB9nj X-Received: by 2002:a05:6a00:1807:b0:63d:641f:5048 with SMTP id y7-20020a056a00180700b0063d641f5048mr1933367pfa.16.1683187411440; Thu, 04 May 2023 01:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187411; cv=none; d=google.com; s=arc-20160816; b=WzRBN/VdQRNTgDA2sui9Jzw4gKgJrR9HM7+pmlkvpqBTXVcTnUp82wtApegzFer4Mf oUD03bShp62IA7A23A1Y4sdRdKAbM1fkMxTBEl3ivyshwqvizRNrUVcD2xS2yl3Kh64g JM5fxRAnoDZkmuMlH4+brHKO+pXooK1acSb3z5XorXf13ftLdrEuvlXgqWlfvYzaznue To4b++r/GnpDC8OmU/pGoh2cu20uEr3G6XYYDi/cbdh3QSTnUiLWzF22364uCwXiyrSf UmQDBm0pXaZFjuGeVGwT6rcvQbrPZIhNwtiTtItGnIIcYZIRtCCnAfFn7oGv71n64XSY SsFQ== 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=PaAO6KbucUD7sHLqAUICCg61yVdFTkFkYPZOacYDIUA=; b=qBSIijZjRP8II9NJnvLFCBxpR3uVukHrg/oYYVWCGln1JADdA9JivhswObmUHlXd3W 2NH9UAtR1RGPR5e9OOp4Bj76Gt2ceqYQfMI87PL+6oi9GfgfPSZS0RghPlpu7YAqMmax Y/S0U4ErHKHFDtXwtA4QKNYi7WhGhcxBydDjVqs+wCah0L0GlSIUB9X3ugQwJS/qXGCH fp1pA/9ffRVoWVBo/b68NC+3Vvf0qO1UQEONRgR0o2pqFiwMAn4njPnoCf+jX0jDWoLo gQ6QsbDquz4lnFTF7HK28GuazbSskcqM3Ky01nj1cgpNX1HOrQIn1s+ElpiwfQpKjpX1 PRQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YWeqp4eI; 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 v24-20020a63f218000000b0051b313bdebesi31695334pgh.1.2023.05.04.01.03.16; Thu, 04 May 2023 01:03:31 -0700 (PDT) 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=YWeqp4eI; 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 S230092AbjEDICT (ORCPT + 99 others); Thu, 4 May 2023 04:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbjEDIBl (ORCPT ); Thu, 4 May 2023 04:01:41 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5A4240D9 for ; Thu, 4 May 2023 01:01:37 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f1394cb0d1so175008e87.3 for ; Thu, 04 May 2023 01:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187297; x=1685779297; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PaAO6KbucUD7sHLqAUICCg61yVdFTkFkYPZOacYDIUA=; b=YWeqp4eIilP1QTmr9LlCR+XFh3h3RwZBNg5GrOa6+n2wSitL7fNb6un47ABP5pOMNP l9bc4Z0eg4If7ffQ5viyJTDrmfU7j/SwxH9hCwRZMJdjZZnqGRoHZKEkI4Tj4pziN3AU CWl4mQJUHJxDUqT9plBZ5V5NFMrSlo5vTq/0Z8R2EnqtO3lBGk/atYmsAT8mzn9rpwOR z75CgJlCX0pql/9uw4X5BxWgptsA3axkYUCtHO9yZDFXJhgbqA00OyntjWrBcP7wKxuH QM13MJy8Er0UV4o0IbFy4Sw3A8yK0kJwBo00tH1eNEfAqzG1j6+8WkI6MQXvN8/6cTbM kkMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187297; x=1685779297; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PaAO6KbucUD7sHLqAUICCg61yVdFTkFkYPZOacYDIUA=; b=i58F0Iz3eu6I5xNqBdR46t/HMugyg4co/4qQHH6tU4zN+wT0vu+0QNWSNLYRkkzzvP VyGepy7NIznlVldepFwmZP23Jm1ppbyY8+fvgYPCs+YeePaYJvnyX9VmW1G+lRoiCosP Tos/cuKFs39fKThzRDp2QbbrelIP/BSSw1cs1JiqZmZ02hHLtD2//K3rqm07hbw2PTvx FfH0Roy88Ap7ptjLqh+XBC7GzET0f73EJJ3v/ZBnE1bCpfQm1mcjkOXZpbEOfozYZEAp Uw+YLQHyfwstP1XAyrPXbZgYMhYJOW2bPLN89jK0cq8Z9KhUHH6gEs0pya2ujAR3UhQT B7Ig== X-Gm-Message-State: AC+VfDzL1/V2PHt8M/FVoahE0WLHO2lYy1UWKK/9WI0/aD3rx2o4wtc2 c0Z9tc9nTGQwi19AKIDXHtMo+g== X-Received: by 2002:ac2:5551:0:b0:4ec:85f6:5bf4 with SMTP id l17-20020ac25551000000b004ec85f65bf4mr1560630lfk.67.1683187297204; Thu, 04 May 2023 01:01:37 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:36 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:03 +0200 Subject: [PATCH v2 07/18] media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-7-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1840; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jgU7eoLOdocZ2/cCE0wfh1hS/YMFv/9bQw2DJ7khniY=; b=rkj9z6gxfeKGh/ipIT6gpC8Zndl9khftLdh9zsxLYTn3gIX2EfNqR3vjS9w7D4yFoUzHe/ewq vWfYg/7gh4uB37EtSzzr325y6WxIgn4XLTvdbNyRTrgJ/txsIqG8841 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764949923030001011?= X-GMAIL-MSGID: =?utf-8?q?1764949923030001011?= 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 8fc8f46dc390..9b840440a115 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -447,19 +447,20 @@ static int venus_boot_core(struct venus_hfi_device *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; - 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); @@ -479,10 +480,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 Thu May 4 08:01:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89956 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp132959vqo; Thu, 4 May 2023 01:03:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4U+zgKaWLO65iPk6nf5OGAz4nwXVqrmlRVwj9e0pndgyuTiyvrWrou6f8DuGL+6+kYfkSu X-Received: by 2002:a05:6a20:7d8a:b0:ef:d09f:714c with SMTP id v10-20020a056a207d8a00b000efd09f714cmr1567787pzj.53.1683187412098; Thu, 04 May 2023 01:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187412; cv=none; d=google.com; s=arc-20160816; b=FGiArUi/5u7IdO+ZJqpHQnJ7PdMvMPsUMfHu1PaRH1H8LTEorkAX+b6QJm/iDgZ7Hh 6s6RztFJBVHtk+iga8bndTDzHtwSd0ogotn0VtpUs+MpX3fpAMYiPCz512HpEWd0Rj5p GFHiDxOVVb4izK4X3W+FMGjqfdzOO7jXZnTQPy9LB0EG6uKcsy/0Hj5Z4cz11z51OrIv yhAm4a/kXpGpCRMLidLceq5ZQDUk67BIlC20YLrhXnQhmg2aC9lSWQ2/yA1O7G4D+7SG hDvGzRueW5BPwZy/3NM08SNLKBB/UPoYIPObhWbuKIMNvxa6B/E+Z9w1MpwWrKiEy3aS iStA== 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=tGZfzDtDtbp7luOgtk5iRa02ZQGrQVsSDa0gZJuVtLo=; b=smhMVGzL5UWGo0ptgp/6+j3+S4/ka3cuTyLvt4+q+TgAJmit0jK9ipu3iuSEDPzTiW cumEgo85pubCRvuNZc4RejYighANXyIpi0ElO9aG1v6RWKWi9T1iBDTmf8THiBBIcJlO t+HZ3Am5U5STvbkBFBykCaQrmQSRROc71yO6qaiJd/iC64LXKgG5wN9xlsGy+oAbUQQv P+esXQk4uC5fI/bl5mz3wLGmqPM2qbHjToKPWAZon6HCbT/mgnEWKuyM+GaSYsRNlCaq XK9OExhl6HF0rkrGyf8iEOMzZa/L8HrxLuGczKAuA02n84l0473pqCfQxc+8H1PjR+u8 RHjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w3BJtmBX; 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 bk13-20020a056a02028d00b004a4eae7c943si896172pgb.535.2023.05.04.01.03.17; Thu, 04 May 2023 01:03:32 -0700 (PDT) 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=w3BJtmBX; 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 S230189AbjEDICW (ORCPT + 99 others); Thu, 4 May 2023 04:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbjEDIBu (ORCPT ); Thu, 4 May 2023 04:01:50 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBAE840E4 for ; Thu, 4 May 2023 01:01:40 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f00d41df22so8585511e87.1 for ; Thu, 04 May 2023 01:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187299; x=1685779299; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=tGZfzDtDtbp7luOgtk5iRa02ZQGrQVsSDa0gZJuVtLo=; b=w3BJtmBXcJXJRwjtG4nutFaMmClGQ4CYwe0KrY7MKGyHrO0K94hQvAEEMr6d1UtzOM /pvVqwMW+xZKloMnDFFFp8USqSH1UTzKwS0LRXKeQDJvAklxiHDFjsgKGngrCc+TfpUa cXCayqpjXo7RwJ4Bh+h3XqzklV7gvVoEHUv5IDyLfYzTXUa4ZST3t1QjjUN3ZzlVmdKq H+Ow9hEBZFbsdJtFiqui1t9QFksbbufSlnYd1Slqy5h2f0vkViO5/4FcOt7rom/toOMq tSbklD81Wb39+TBVQs6hF/7qy7fGyjC+pGbB3X0fI6IthV57ejmjkG0zf97dFO5frJUd C9WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187299; x=1685779299; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tGZfzDtDtbp7luOgtk5iRa02ZQGrQVsSDa0gZJuVtLo=; b=deqAYcQEXOFD/lHBtYfXL6qB8oLzc30MVDbKbrhAO5gBmC2DCI7rrduLrigDPtfRpv pdz0F89wO73f/nJB5MyO7DmTqQXba2x8vA9RKFta3SWXC5ACE44D5iV2ArEZe1Okgt86 3N535Xihlt32IIbvT9pifNf3r68klBxeK5gzVqpYayi6KZVRn2oxt9tI44Oed9w6K//c I9gP88mEmc0n88UjnpnPzjUAB/t3riKF2wBU3m+NVx8e6T57oDxMtCH9kLssuydmdp9b 5Mq2NG2tRqpb9KV2bkz3IRgVQyJlzE1XmtHipGonz4gnb9nF2oZNNJWeU5dyi8OpNAKf 27JA== X-Gm-Message-State: AC+VfDwvbaNq05WCjVrJHMLQ38VlObd4kS60zKH7ZfrhYE66CTMxLSU8 3L5hnxtcWeJk6lcQb9QCBK6bIA== X-Received: by 2002:ac2:5690:0:b0:4f1:4074:b4fd with SMTP id 16-20020ac25690000000b004f14074b4fdmr491615lfr.29.1683187298830; Thu, 04 May 2023 01:01:38 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:38 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:04 +0200 Subject: [PATCH v2 08/18] media: venus: core: Assign registers based on VPU version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-8-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1460; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=m2Osp2Xf2pUATOq+7urWFmKXQd2Ed5bGWf9T651mWII=; b=1Tkmqz2YbLpV0808lxCYKvHKCyO6BlreCh4HSpHw5yOUcSKTUVoZOggBR2sMnjj3Pjnsrc9zG 2L32SF9lguJD1MZ7utfeL6JvH66cU0YdtMYj8QTo09aWzIA0og6EwmZ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764949923770262303?= X-GMAIL-MSGID: =?utf-8?q?1764949923770262303?= IRIS2(_1) has a different register map compared to other HFI6XX- using VPUs. AR50L uses the same offsets, but doesn't feature vbif_base and aon_base. Take care of it. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 01671dd23888..51cead91571d 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -246,14 +246,14 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type) static void venus_assign_register_offsets(struct venus_core *core) { - if (IS_V6(core)) { - core->vbif_base = core->base + VBIF_BASE; + if (IS_AR50_LITE(core) || IS_IRIS2(core) || IS_IRIS2_1(core)) { + core->vbif_base = IS_AR50_LITE(core) ? NULL : core->base + VBIF_BASE; core->cpu_base = core->base + CPU_BASE_V6; core->cpu_cs_base = core->base + CPU_CS_BASE_V6; core->cpu_ic_base = core->base + CPU_IC_BASE_V6; core->wrapper_base = core->base + WRAPPER_BASE_V6; core->wrapper_tz_base = core->base + WRAPPER_TZ_BASE_V6; - core->aon_base = core->base + AON_BASE_V6; + core->aon_base = IS_AR50_LITE(core) ? NULL : core->base + AON_BASE_V6; } else { core->vbif_base = core->base + VBIF_BASE; core->cpu_base = core->base + CPU_BASE; From patchwork Thu May 4 08:01:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89970 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138263vqo; Thu, 4 May 2023 01:14:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4e4Xb1oVVWWavswoHZlTXvxHQp7Id60L/Mz35fXPSpxvMFLp1xo7NzrIaLGjgZ1xbnBoe4 X-Received: by 2002:a17:903:1245:b0:1aa:ffed:652c with SMTP id u5-20020a170903124500b001aaffed652cmr3358899plh.64.1683188069819; Thu, 04 May 2023 01:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188069; cv=none; d=google.com; s=arc-20160816; b=FFR2em4JAGGFCdomrdvsRQ3RqPdGn32+bDgcyK3I/LASCW0lO3/m+Vq11gDKxoJtis MOEEmehkpVrrxhHYRRaqdpIOfwpq4gIdaUbH70TO4B3EVoq0HNfhaTGv38M96Cc6pRhb Q4UP8cDXQYphDWYVx2zVkt+eEyD+O74v7BmQeTdnjLhbdUnFWPZgWgMTXKWuevn1mXxs BD0RZK3gZz3C4N//sQ/UR7mY3hwnuQgqQGML6peIpqU8APuFDCZh+3piZnpUWECoBHb8 fh6LiQemyNZ6/M8E5dnF0rUQj6sTaKJBDzVXgUzpFfugytfPY/UiCZpnmTN4a7PqxeAn q3LA== 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=wLWIf5AJktVcUGdZu7o/1TfCD4Dmn96OdaFzmDBQ/Dg=; b=wMx5LsuP/cPFnSipIDfm2qFSEsI5mBfHoLRofBGrvh/BhfUiKfDCZ957iOUVZDdbvG qRlpoDzkyYntWrGyI0Awnsdl5cqknetpQmK9NSDmNrzxRsLWwX/jRQuUkLhg0kUmXNnP cbpeL27k2TD9M59vMadf48N/H6z1SHUKTWvQqvV71ybz6KEEQNueS7Oo99OXAcNY6N2C OVl3zsVgqr81ISJ7D5Xi1D57NnLag6/5yswKjR02wwHA+GSXDJb/vOL7ry8o5nUFdKFd vp4WbIiHRch5Pse9n8orZKzgXjzNcNUUoT5qu5A6KLtCVWVGprB8X9qWFI03T42Ng3sm GGOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Df4dlbvM; 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 f12-20020a170902ce8c00b001a97262fe53si29447364plg.552.2023.05.04.01.14.14; Thu, 04 May 2023 01:14:29 -0700 (PDT) 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=Df4dlbvM; 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 S229772AbjEDICb (ORCPT + 99 others); Thu, 4 May 2023 04:02:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbjEDIBx (ORCPT ); Thu, 4 May 2023 04:01:53 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F22AC4207 for ; Thu, 4 May 2023 01:01:42 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4ec9c7c6986so183380e87.0 for ; Thu, 04 May 2023 01:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187300; x=1685779300; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wLWIf5AJktVcUGdZu7o/1TfCD4Dmn96OdaFzmDBQ/Dg=; b=Df4dlbvM8+/gwDtSxIjKjpEqaBK/y7rpL+azsxYVWnzuOrMjoh0Y1FMB8YH+n/oFvH b0Gy78TbyzYk2LC1Z8WPG0uilaC8GTcumgrVDL9BtoPF6NDun47JEvQ96OXWs21FtMQ8 ckWrvgncWcAV2VOcPK7NosS6acZ5nCFSHLB1JjKPcV0QCxDlIc+8h422QmDeTwRj7MJz 9TuCK3lfNkA2hepVj0oLa1ILq5+h2S2GPSaOMq9zUJa4bBI53bc62W71twV/ycGhMyS/ eKIvB+K/D0KGBGG6dw4nubBlG+YwI1IubyQt0vd+184diUsJ+cVuNssLy/oMD+bG2P1L aZ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187300; x=1685779300; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wLWIf5AJktVcUGdZu7o/1TfCD4Dmn96OdaFzmDBQ/Dg=; b=foBcHoWYWaH5/iNo5MrgONGhQKVDirqqOxWtj0hybNepa0r/c23S9UA/8sIFosZYXl UKtkBaGZWiNd8snnDC20Iq99EhA9qafqYHi+79gaJ2c4y6p6WvFS8mjO4hsXtbY6Pyg/ GDDPX8KQ/yyoZxSiFK90gXnMiod3QY3pwhl/qj9f0YrY8bpXGYZ4J0np4kOoZg5RmoLJ f1gncuYLJOpEfdJfFiw3b9Rib29USIy4ITirD6Ccb+7K1YPrhE6ijyXXxDMcIf6Wt+jp lmQIpXY6utk4SrfgGKG7oownrqBr2s6ZPNQuC0K21wuCKviPh9e10A8Vg+fTGQ3wjKTX P6Ig== X-Gm-Message-State: AC+VfDwsbQOaVGMIPbJhxiGDu+1f6jp/PPGqkFHzdiBgOpFawXOeBcUa d+qj2CP9xZbpy8NxLcJkEzNpIQ== X-Received: by 2002:a19:7417:0:b0:4eb:c12:df1c with SMTP id v23-20020a197417000000b004eb0c12df1cmr1520892lfe.65.1683187300652; Thu, 04 May 2023 01:01:40 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:40 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:05 +0200 Subject: [PATCH v2 09/18] media: venus: hfi_venus: Fix version checks in venus_halt_axi() MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-9-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1179; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=2TN022IG90w1W+WW41ndXOwXiJsz29XNAp4fcB4/bxA=; b=zAqIh0c4vPxL8UYZPaH/GKZD5YzmAXx5SKQ26zh3K3OdP7Z2VReAs2NFUcC353sxLq2vDyDf4 DBb7zZZF9ckCQR+c5lfDna5ojcjDKQUtW+IoUz0Ax6PXQC2riY0nT3F X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950613123900890?= X-GMAIL-MSGID: =?utf-8?q?1764950613123900890?= 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 9b840440a115..ca56b1a8eb71 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -549,10 +549,10 @@ static int venus_halt_axi(struct venus_hfi_device *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 Thu May 4 08:01:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89967 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138114vqo; Thu, 4 May 2023 01:14:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6MAoupPzCF06iHgeJ1i8+ar8Gunou+kA3DAFnh6aYuwUNJuumZSDk1FNXvUiy8Llg0RdKm X-Received: by 2002:a05:6a20:1448:b0:f3:256:24d3 with SMTP id a8-20020a056a20144800b000f3025624d3mr1890042pzi.11.1683188048839; Thu, 04 May 2023 01:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188048; cv=none; d=google.com; s=arc-20160816; b=rSruPCrl3pS27Ys5A1jcnopfzJrfLnku4TGuVzkJPqI1U/r0wELYtj3s7BFEzcMNoE TdlUtN8XsmiWM3Hr1PMLLwfBDL3CSuQeaIRsqlw49UaIWGJh5GnTsmpgfWSmoyPZSTfQ tzRaXU6KO003Y+LEI8wo52yCndq8Nw6Z8d9gTVXyXfrDZk1p1YXGNxoZTQxrxeoVamk7 9+9gziZOef3JkP9RoNDBzxFy9HbetR8wnXto7DE9oNzwPAwRDbY6qQjYGipSzn+2KJSx Zc0kA2fiP1r9heq5cdYmSdK67wlw5lBG2MXnotxjkwo6sJheKlnNCHZLnnJde11R6DkI QTTg== 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=vPLFybUnSCLJz0oCMRR9jsL5keYJ4n9HhX1ELcMGsYM=; b=RWq8rIgoTXcq+fJOtBp5yyYCeuFGH+G+rmGhXZ4G4pcbbM+Lh0eDNElw2o2OlHy8J0 njP1ij79xSrjC29V6pLbcZ6n1i2HQkmy+K1cqgsqeF3WJbQIaBImxcuXHdmBv8K/vMLg Pt9m3TWekEfcCos+wFluSHe8hJaOq9IMpts1jllz4LuD62sSKDkS6ITK1w+WSf8nQuz4 lK6yQLZKDTqc9Q4KSwPO0+4nTdICzuaOu6uo+6QHKk8i8U0f6IFgOrD4oplNTHqsleDy IDKlxuiW13sW6IVNYorOHFYMSHg3sM0GTs/bBZG7W8zT2Ext7fYUtxwgX7ZglVwVojVh H8iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rm6vE69Z; 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 c3-20020a655a83000000b0051460989406si33400335pgt.605.2023.05.04.01.13.54; Thu, 04 May 2023 01:14:08 -0700 (PDT) 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=Rm6vE69Z; 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 S230192AbjEDIC0 (ORCPT + 99 others); Thu, 4 May 2023 04:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbjEDIBw (ORCPT ); Thu, 4 May 2023 04:01:52 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0D574204 for ; Thu, 4 May 2023 01:01:42 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f1394cb0d1so175190e87.3 for ; Thu, 04 May 2023 01:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187302; x=1685779302; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vPLFybUnSCLJz0oCMRR9jsL5keYJ4n9HhX1ELcMGsYM=; b=Rm6vE69ZkFmGqXM10Qu7Ec++Ds4AHAx4PppyIKKpic8AdFYrX368gLcW9X1gubcFvB IFxP9d5hM/UCRNYFS4TgtMLgzYXfm4QANLnwhgpeLqJzVoAJFyuitM37B8p/i9i7mKrX Ik+Qnm8Lnqecmdtr9wNViTilkVjwDekSBIvhBRtum7hQLSgbWpkBD+Obnsuf6ZMHY6UY pRz1uR8UtpIlGYpYrVTJ9GfGLtPD+LWMdq4U6xMW+MuI9eULIVKExe90DmRe4oiNXoi0 B08Zhv2yOUe9hhjlZ0cCj7mUt+KF1z+VREumVuiDz3ptdbsnddlpyk4JiHbpkqoBUBR6 RZSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187302; x=1685779302; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vPLFybUnSCLJz0oCMRR9jsL5keYJ4n9HhX1ELcMGsYM=; b=iemWIgfjUfaNizG6jaiQVGEN3ROCwzHetnT6xqM+fgccaeQ6NQKpBfieSIcykO+AGu YrMSVcjaWRckou36CXOVXCctL06uUbBG9PCrXGj7BGHG9I0XsnjqR8N5pvahKRmV4tkR IPCBTVZSKGKMMdCBdRyo6Y/FPm4ftyV/7w9vMUIVhTfu3zfWSgDmLq+zvPTQz/tgc/aw 0naKJY9S13h7wR0tFkZcOXUUim6OnII0BbswqvMkZl8ma1SwtYrbZYbO4JyuBGKg4kYC /IYXps3dfH+CS5jDsR1jKHRjarlWu6wuOB8ancfqVqe4oXgbrfu9AQVhFR/FPIMXb4Hd 1cXQ== X-Gm-Message-State: AC+VfDyACAqYY7gQLMyeYzGKK7ewPxn17Z/AFwIGan81/uof1kcqajJJ iZad8cmPOrN7UR+l15H/U8diGA== X-Received: by 2002:ac2:5921:0:b0:4e8:c81b:1a11 with SMTP id v1-20020ac25921000000b004e8c81b1a11mr1655084lfi.49.1683187302126; Thu, 04 May 2023 01:01:42 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:41 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:06 +0200 Subject: [PATCH v2 10/18] media: venus: hfi_venus: Fix version checks in venus_isr() MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-10-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1475; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ibQkhpaLOkmp/Wq5qNMd5hbG2R/lmbg93apEMw7+R/s=; b=jehrky/1ouQ53cSiRDAu4XyUT8R4vJlTkCW4cUtU5rc8nk3rsH37v8m5njowOHaF1lBOpjZfi bXJ7lPH/JDiB3MdQrsQkyVwlfBSY0E2l/3cpXWZ7nrPrmDhI7A6Dq1E X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950591125883512?= X-GMAIL-MSGID: =?utf-8?q?1764950591125883512?= IS_V6 was used there IS_IRIS2(_1) should have been and the !IS_V6 condition was only correct by luck and for now. Replace them both with VPU version checks. Fixes: 24fcc0522d87 ("media: venus: hfi: Add 6xx interrupt support") Reviewed-by: Dikshita Agarwal Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index ca56b1a8eb71..6d5906fab800 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1130,7 +1130,7 @@ static irqreturn_t venus_isr(struct venus_core *core) wrapper_base = 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) @@ -1142,7 +1142,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 Thu May 4 08:01:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89977 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138558vqo; Thu, 4 May 2023 01:15:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ616oHurDECHalFwvACBGnhGoP8CdUDn47Y/zrHXpsYbBQvtMlQB1IPrUmfBMcZE/fyojfT X-Received: by 2002:a17:902:e5c9:b0:1aa:fe23:a7f8 with SMTP id u9-20020a170902e5c900b001aafe23a7f8mr2998011plf.59.1683188106765; Thu, 04 May 2023 01:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188106; cv=none; d=google.com; s=arc-20160816; b=OrVCiMDiKFdOEVpMbMrA/uXBDj0yUexZhipIFETtX7KtgCeSaQSqOSRX22Um4eSqYl wtaVfMhMxoo1RyVriYChFoZMj0CN6AsxKKY98F57TltBbQoYTHT1+yVOb7TY2moVHjld O3GnvcFErIwg5eeFZD58lkqpZXeODYpr/dw6cmIQKRmcx++yVNzxmkhBcOP3bfbS/YAb zD4xy3FbLmKsfcGVf+4cJjp1x1FGYetgwcXjiCBO0lKaCfJgB9BdY6xLGsllgeaRrdvT 6BvF+xCwHcqezC0cg5OP1npeYVfhL8XhZclWEFWCrSrnC2tYOm0z30zweDO0I0yVWuiX Yw8A== 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=RLzwYe07Ua0iWuXYI18glxIVscBHmMu8Vsc9c8pgxmk=; b=NfB/z40WLvono0v/sP8RLgkkvLt/2janRGeuRZ1j3LxXARAiqq17bGEnKn1JTcfWEM LWaGKgtx2E2BYMAwIA2sVW3/rrA3WWz1WB684sa7mvHqo9CIP6apoZ0Qxg1rtzC0rM+z Bbwvo5193Kxh6RiK7sdFI2CAZ/GyBH93mRdJvPbBzrQ+0MRMQN01cQzR7fckyfPgRVGU e2We++3e9xBP3OdtW01rTENz9C0dVdJ2mIJt0jJFVcSYRWMChhqYkLPwL6DGXNMFHoE9 BqZKVhmk13/X7QimLYSgvsvghmkT5IxI4TFA2c6KQ7qFXDgU3MUmZ4VAklKvp+wsAsbR 12Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a6jNEwls; 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 u8-20020a170902714800b00192d6fb649dsi32896717plm.242.2023.05.04.01.14.52; Thu, 04 May 2023 01:15:06 -0700 (PDT) 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=a6jNEwls; 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 S229891AbjEDICd (ORCPT + 99 others); Thu, 4 May 2023 04:02:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbjEDIBx (ORCPT ); Thu, 4 May 2023 04:01:53 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 440DF422B for ; Thu, 4 May 2023 01:01:45 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f13bfe257aso169784e87.3 for ; Thu, 04 May 2023 01:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187303; x=1685779303; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RLzwYe07Ua0iWuXYI18glxIVscBHmMu8Vsc9c8pgxmk=; b=a6jNEwlsHRKGsAhlDZXWwcU+vptB3800vh4s8+quTBtjpEizpiW6LijeyHj+bV7d25 2NUgE9AQUHf0rQ1Mn/oCX3APH7N4kKb1kW49gWBZDbb0pTIswXtl28DctQEiFgcTxAfT YQ5oN8SRWB8eRvT7QZQwKDYkOAk7l+CSqIPZATGxnfvbQVUrJOuokCrabmNHP1hPpjH/ 5G/AoqylBXbWyK0PT4v5iiYk78GA7to3cIdyUXb/Zyy8vq/iBVPQRDyVygZl6CYYm+TF VvKRwz5BvhVazI7aUNws2d9IsutyYyZ+iwnM+MUhrAdch6d6gezmeOPL6owlqzV63udD fomg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187303; x=1685779303; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RLzwYe07Ua0iWuXYI18glxIVscBHmMu8Vsc9c8pgxmk=; b=U3zS7EfVm0b7BTnb/0IFdZNWbMha+fn9OOTCmsQgr0OyXy/spbw01TaLMaHZ3m8KMJ SjjddX1a7EZuGj8mylAbSWFOadoe8gvJrdAeFXq2UqQvucCCAnpNbZgDW2KQvrygHT8q TATcn+vRR1H9BLvkSBgWdnc8pAc0OsB+Och+moV0EjY/PHga3YhcoKEEAs2E30XhnJkH XvMVzk50y7t8zrnzfbmFsE+6IMOrMX41aOZM8ZBAm9ShoVekXNdnh30Di7pc26n+nkGt m4HegRp/YiEWO1WDhHoSicvNRtYZd2jaPaoYk8H43LVn16BNFoB5TI5SwNMkZTIbMzJt 9Hwg== X-Gm-Message-State: AC+VfDy/T5xr1AvtViI+7fp5Te6QFADuoktlqtDtKiLpR/1wzXLAYtER UqTOvZLOlJ1faAGQg8XQlZRIFg== X-Received: by 2002:a05:6512:11c7:b0:4d8:5238:ae97 with SMTP id h7-20020a05651211c700b004d85238ae97mr1344193lfr.36.1683187303588; Thu, 04 May 2023 01:01:43 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:43 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:07 +0200 Subject: [PATCH v2 11/18] media: venus: hfi_venus: Fix version check in venus_cpu_and_video_core_idle() MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-11-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1023; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1ifUdAT3ZHQBYgMADooIxCbatMIomtIxcid/wNFwLLU=; b=GbYkuKWaOiyIrl6/vhQgecr6tiCf5clf43NBvZwwmmoRPkt9ZJo3TBMGYRtoc+9FePflPoK4O gE5O2mywGyWDN5NflxKQVTVTSqskT0iw0eoy5PUHGSM+Jlk5WXOWAU/ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950652033887327?= X-GMAIL-MSGID: =?utf-8?q?1764950652033887327?= 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 6d5906fab800..82aa7deeafa1 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1537,7 +1537,7 @@ static bool venus_cpu_and_video_core_idle(struct 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 Thu May 4 08:01:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89963 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp136855vqo; Thu, 4 May 2023 01:11:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xl2GQQAuTUHFC7qnrLO2/q0G56w88E14upFGdQblIo3ra6u36CAuRXwKhhAuBb+GIYwDR X-Received: by 2002:a05:6a00:21d4:b0:63b:62d1:d868 with SMTP id t20-20020a056a0021d400b0063b62d1d868mr1492683pfj.8.1683187875645; Thu, 04 May 2023 01:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187875; cv=none; d=google.com; s=arc-20160816; b=Ouk1qBxmsQH+EwXTvli0W1aUDVDfio/L0UtvERKYto1ypkA+z+tqbnbeCFYpq9r1ef G8qzQ7a6FOh+gO/TFQ0Th7xb+Y3mkXWV2HQA6WBrI/Z+BRpCycoydce2wA8ftkvKEq5q c7cYh0xgQt+gG+LIGrScjh50zG2cuxgGdlFV/TAB0VmejQ7vpU6eo1uQ2zPhk5AUk0cZ /JRxTBdlI7Efgd2UnLH201iGj7VfvTqT9eumlbjOBrwZ3WvozOnInNmRoQEMYEHioWmN 0YQeI1ZcJz+6Yv1BiiXVm1tUVJNcT/se3s9oAzpJQ/3kSUEcBb3qvBZJk1wrrR5gz04p C4sw== 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=XaTET6I6Chlike4b1aelQ66mWsgrpXX+pZVYbCKm7nw=; b=tOS7jAkkDV90ZDpUSf1OcwRn80JiUbgXH+EQH6N76IMP570BpAThmwFoRwLNAAiddp 1i1N3Ow03aBmnV2x6PMvpnTrC/NyLE0+ORx5k0fuKhkQoQ2wY9p1q01LluV8lzUmADk3 ueQGPOpwTm97zIwwSc0wjLYVgdOtLz6HOT0u50DLBN+NFULoG9cNg1dChsRqiHZUCtJ1 eX9BP8Xq9qbNPNYPo0sHorv7PwgWzPXFntrinNpwoRMeJCukDh9xpzksjtwBvGykGWAe WfSkQmBYwxj0KvaQ6Jo60UP7XbQgw9yaP+2jilJxiPv2y0Nm2c4nsjfCMWmiW7+1OVuO JqkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YUgFU5sM; 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 s7-20020aa78bc7000000b0063d425bd4c7si34616786pfd.158.2023.05.04.01.11.00; Thu, 04 May 2023 01:11:15 -0700 (PDT) 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=YUgFU5sM; 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 S230237AbjEDICp (ORCPT + 99 others); Thu, 4 May 2023 04:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbjEDIB4 (ORCPT ); Thu, 4 May 2023 04:01:56 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E14194493 for ; Thu, 4 May 2023 01:01:46 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2a8baeac4d1so2020101fa.1 for ; Thu, 04 May 2023 01:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187305; x=1685779305; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XaTET6I6Chlike4b1aelQ66mWsgrpXX+pZVYbCKm7nw=; b=YUgFU5sMXvCPA0Ws9/d+bhPa1YbJkUH0i8oeUrxAlICS2e6hha231etQK99tXZ7C6y 1wQOufMin6XZWyJ4SmIeqXz9CEYqi/B4oBNrX+t4D4rK7zHSBDa/TAc2mAX2PkcRt6CG NBYBvYL0c8dJOHT+WW2qdYP+HopoexNr/801YMuOqESa+r6YIAwaeq/NWn0e3MgGIhbT vpYKjwoZmg8JaSZ2zREkFT3vhsMRRRuK82ApY+RTZh+uWxVpvMP38HaqY9u39eLEDfnx mxSKkxpzn7y7HCtV0Ea+HHayugaTyi1mmr4ARrv3PMKlsDD2NMlUTDqyJwvNVqbmhOGM Ne3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187305; x=1685779305; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XaTET6I6Chlike4b1aelQ66mWsgrpXX+pZVYbCKm7nw=; b=fKUorotmsatiEDVe3Sq+9OYEonHAqPJ0xEo53VMyCa9eTzgwp1Pk7ACPcM5mvor/2Z 1MPEy1557KsaC+I2lFCvvHgUogks+ZPCjoBv/4daDtEMQBbgPiAQLY5s4pPb9BJd1mle /87Wgu19x4NHxDn5TNKzCMIM1/Ta8oHwi4tYb1Muh6xdIAcfyB+glD1ZYvGJf6W3L/uQ P6+kIRzAJYYdTKQLW/okGcY9Tu+SIG55fRIaO7akKTrGlBZVQyA4vbuBBkG0DuiEwBxZ DeCiRbaN6Qek1eD2Ig9KUvwxIM80UkHy+Zl2JLysXyW1X9YunmfyeSicPHIXTrTYxcwh Thog== X-Gm-Message-State: AC+VfDyYjsq76L2GtRp8+YVqDMMW9DgvD2MskR2DYPhuq2hWPt5m5a/W Gb3I4oiaFNromK58d7eloYUqLw== X-Received: by 2002:a05:651c:1204:b0:295:b0cd:517 with SMTP id i4-20020a05651c120400b00295b0cd0517mr681510lja.35.1683187305068; Thu, 04 May 2023 01:01:45 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:44 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:08 +0200 Subject: [PATCH v2 12/18] media: venus: hfi_venus: Fix version check in venus_cpu_idle_and_pc_ready() MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-12-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1021; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=8zfWzMcpL3GpjtgMJa9NGDyn8/IKM9ZLPIj9iHUztqo=; b=oFPFCaIJsqshA/+ulg13SPuJfH68My4z6Enu3TNb8ypHKqyJhbkqVR7VRJa7c+3w1rySeeTQn TYp4Kfb69uWC8eOaxksAA9M9XnAzNY+Mewc+9UayiCSweTSuwLlyJ2R X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950409605788003?= X-GMAIL-MSGID: =?utf-8?q?1764950409605788003?= 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 82aa7deeafa1..d6df99a921bb 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1557,7 +1557,7 @@ static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev) void __iomem *cpu_cs_base = 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 Thu May 4 08:01:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89979 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138879vqo; Thu, 4 May 2023 01:15:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7RNwOrIrIZym2yjAGriurr5Dv4CLv/IoWE5mS+wPRMCydvHa0pjWwpBG038a/ujZjtirVQ X-Received: by 2002:a05:6a20:748b:b0:f5:6cb8:105 with SMTP id p11-20020a056a20748b00b000f56cb80105mr1627359pzd.45.1683188147315; Thu, 04 May 2023 01:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188147; cv=none; d=google.com; s=arc-20160816; b=jQXlTT2byyGv802h8oUyyS1lLpgFgkrQwyueDBFnbxQk+xfZ++WUxHdMXhtCSf2NSy CPqZp0m/i81ZNwx/w7Oj7VWKUwgBWW/CKbYMe2ZiE/gQ3hShl1MUzzwGJpKM0hE6FUVU HPXWg/W2G/HuWCGLBi3olRJG6pxTOF+BYBxaA5F5oW7D4g/9+YuQLBKAhdOP1mSobA0U DyDy4xavEfyeWJ9boCsOOyt0QNS1EjrccbX40GzjivxvY926flsvO/qqOmvVp7jAkFLG dP+O8tfkY7LRR2FFCEq0kl0sA1we40+EasrnAtNzZE+Ed1a4I4aWtXC4wf8thYn5TYfm 861g== 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=IWMwiYoEjocS38Czi4DBdZu7qtny70oMkcbZd0u1Q7A=; b=D5se+BlThyoRoeFv/J+o8udG/+O0emCEpR07Lur86t2/pWOZC/r5vxvLOEhb+mFfHR PRJ0zHrf+I8eoSn6XvELxDrDRTbXo6+DfQ+Zycg4XqMw12tT1JFHtEr6f9NTXeFFbuK3 p3iZGgtpDd+kFUmVA/a//qFhSFVEY/VPpTANdIjAqrXZslA0WM/F4/+iA9mqqic5nhsM QrVPBugWOTKIDQJClVkg//6PWs3xCtqua/I/FHhbUSkmzM44Fslp68an9tbJsKGRzv6b zKd3wpYuTIve2jhRyhQQv7SoLaATtarc+lLnaCoJCkG+4NH9wT02IaMBOyPaFPfa05RD bUUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ulrq4+bR; 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 85-20020a630758000000b0052132a8e4e3si35589601pgh.510.2023.05.04.01.15.31; Thu, 04 May 2023 01:15:47 -0700 (PDT) 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=Ulrq4+bR; 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 S229988AbjEDICs (ORCPT + 99 others); Thu, 4 May 2023 04:02:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbjEDIB6 (ORCPT ); Thu, 4 May 2023 04:01:58 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A2D4219 for ; Thu, 4 May 2023 01:01:48 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4efec123b28so181110e87.1 for ; Thu, 04 May 2023 01:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187306; x=1685779306; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IWMwiYoEjocS38Czi4DBdZu7qtny70oMkcbZd0u1Q7A=; b=Ulrq4+bRHU42xZ5xWNyBgbPoQtU9Jr7O1eLonanrs0bAeTTcaT3ZcduwdqxBU6pCmh r+GZPzQxqLVLgV+tlA05Yq7g1t72HeYB3zlVJXVMsZmEXDtMYgQPON0bDXUg+fgitHYH n0m6pwMQ1ULiMGXiHFM+OHWS3xAGPO52sIwDuk+wKseXt3pCkQ3bYxSIc3/BNN1F6TWV pWLz+RdzKs6bUbvt/L4j7zyIxmfLnQudDIvQXkJgxXHcUTurPqUYNCcRsT1zsuDzrYyJ EZsPB6jCfruYWV1TAQ//OJUk8trbQyOkSUSPY2IAwM9duRY9GsFP6i+9wq+qfjJ9lvU8 UZ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187306; x=1685779306; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IWMwiYoEjocS38Czi4DBdZu7qtny70oMkcbZd0u1Q7A=; b=ktCTzDOfR0yYf6XnXycvauYlLaCeknciC3nrUmTZ1qtwNIwkQvMsaYoc9Cdytz50Dv +/LX32C6QO07Bld/mpKszMfy+W2Tjt8dz0NdBxtbpHIDd62eBm/iLfaTI5yFWBBVpr// uWpUd2sd1UNuJajkusX4E+7B/+9GforAZLG/vOQU0wV2rZ/dBKCP0DJhIh5lb91LXWii AOspehR4EbONjRdzWQSQQHRGnn9rJvarWus9eJlPqpHEToM+B9h4OhMHYmfUjKT5T5ct Sdhm58amKR1hKFgtdTt+eouSmFd4DRwa9YSm41ZVjrJD0KgcKOUQcGCAbYPYEmnPy7MH X1Gg== X-Gm-Message-State: AC+VfDzKccY28VjVAcoKzitidBib3bfMtok3adxIM2UBOrdH2/5Ky7Fu 9o61cZAHKmU9dLxnz682fGQwVwdnEzTRusiLmHo= X-Received: by 2002:ac2:4186:0:b0:4ea:5902:5af1 with SMTP id z6-20020ac24186000000b004ea59025af1mr1903379lfh.52.1683187306627; Thu, 04 May 2023 01:01:46 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:46 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:09 +0200 Subject: [PATCH v2 13/18] media: venus: firmware: Correct IS_V6() checks MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-13-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=2319; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6xrIXn1LM019O5ggn7yfRmQJ+yV2jlf4XGTfINFwf1M=; b=V0SoVnzgNLdbrnRmf+7uzFU8FSG3h5A82T8szAjDOwZtTkDZWL3SnCOsHqqpe1pdqvxw/VOI4 IGFUOTtJi1gA0jJqzHp/CBmCB0ydAo07vLNgIrHCPexJtNyVXZcspRA X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950694900816789?= X-GMAIL-MSGID: =?utf-8?q?1764950694900816789?= 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") Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/firmware.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index a4cd919e1dbe..be59f2017155 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -29,7 +29,11 @@ static void venus_reset_cpu(struct venus_core *core) u32 fw_size = core->fw.mapped_mem_size; void __iomem *wrapper_base; - if (IS_V6(core)) + /* + * When there's no Qualcomm TZ (like on Chromebooks), the OS is + * responsible for bringing up the hardware instead. + */ + if (!core->use_tz) wrapper_base = core->wrapper_tz_base; else wrapper_base = core->wrapper_base; @@ -41,7 +45,7 @@ static void venus_reset_cpu(struct venus_core *core) writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR); writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR); - if (IS_V6(core)) { + if (!core->use_tz) { /* Bring XTSS out of reset */ writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET); } else { @@ -67,7 +71,7 @@ int venus_set_hw_state(struct venus_core *core, bool 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 +183,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 Thu May 4 08:01:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89961 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp136711vqo; Thu, 4 May 2023 01:10:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70jaIKOmkUv3/UnWQ5n1t5rSSOvhpPD6UInWG4fgnP2S21OENbbsaEbD5jtFZ0uVX7PHUy X-Received: by 2002:a17:90a:ca08:b0:247:4fe5:f09c with SMTP id x8-20020a17090aca0800b002474fe5f09cmr1310395pjt.15.1683187857674; Thu, 04 May 2023 01:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187857; cv=none; d=google.com; s=arc-20160816; b=BdxL38O2jpTz4i7jQQQfy7fTLydeDEwXrzQNUkthxGAT6hFHLnk3ETyqAcIRJALVwX qscpYm3XDZFSnZv9KsoZITE3umK/FYqgNnZI6nDLFtWmF1K3bfkFQmWtR1mZ7mTByOHI /ozq1Ob9rHK5M5BYTtt2Xe9Jeb/MacLsvC7lLGuhUAooWZETQxzsrkux156yddPnkaMZ Lnd9NFS7wf0aQFBkmUCliKPfClNBMfdql9R71GlvEsgoxpvgW54q4l98HdTEcqEjt9Hw nPJQViaPHfmIeI2fgOnf2UAUKDKUufRXIQQ12Qej1Yv4FENkS4ggevS+DzDSUTzE/TYO IJqA== 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=HycEk6C3Un7NkbfcbNqLuTVGgeLRsCvnGR39vR7pD+U=; b=wn1L4ukdXrUill/VBy+W7+C+4ABG+NIqB4fk+0Jgc2YJEsqwvRozNF99/FB2q06POG AVoQNFk64CvweJ/Exzd+INzdB5HgLT3/8fphkGE4aP0oVmzGMvgyJ6bjLzwxnAgGvMX6 OP3Q21+PMkTHDXSKSR8GORMi7scslLxCuer0KtE8xLyXHToyF/WY6SPpnxcKizbkjyBD 29LvuJkKTl3W5albceg77wuj1SRB6vdwxFc03JTv/GF/eHQKoQj+WzeMU//MgvZRqsDJ WNOLX6m+8LHTYlo1rCuq4e0EwWqCdwbynprVNRmutsv8cbrFhTNfQu7lrUz3TqScn2TP 7WvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sQEI3Es2; 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 lx13-20020a17090b4b0d00b0023d02932015si3768342pjb.40.2023.05.04.01.10.44; Thu, 04 May 2023 01:10:57 -0700 (PDT) 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=sQEI3Es2; 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 S230169AbjEDICv (ORCPT + 99 others); Thu, 4 May 2023 04:02:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230159AbjEDICB (ORCPT ); Thu, 4 May 2023 04:02:01 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF8FEFB for ; Thu, 4 May 2023 01:01:49 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4edc114c716so178252e87.1 for ; Thu, 04 May 2023 01:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187308; x=1685779308; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=HycEk6C3Un7NkbfcbNqLuTVGgeLRsCvnGR39vR7pD+U=; b=sQEI3Es2dtjywxv6v+eHUS96veU6RZ6X33s0Ynnsgxa43h5DEMZ4IuRdQk02wKvclJ tvz947L9i7vESyoayarPuL90QVOho8EIIX0KR1Xvy8ARhS+Qzx28L2+KObA6Fawy00Nq xJDygpr/5PoQJpTcSc0HTAWYQAuCPkigHq++QB/lYABi9PYOHXQEdn48/BOBW4XS83kg 3908FyClnfRNaEjQj2E1E49skzg6hdV9ubgsAb9Mu0/F18zJCQB2P11Gt/QtfwR62dTu tm9fCnSIRH9sOHG2nLtHBWlL8nv9dvMbuvLfOJdb1+5aQZ/FUUNKPCjGGf7LY6iKTN3d xTZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187308; x=1685779308; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HycEk6C3Un7NkbfcbNqLuTVGgeLRsCvnGR39vR7pD+U=; b=VYf4PscL8/DXGkzDZGvW4Bs785Wbcrtm8dPODSlqzuOKvv8iq7CFv/epW2fBMGJTNS rSedaBuVmLWX3kPKzSZQ5Bv1jBG60rQuZuTId5gUGLTtgNB3OTvEk83/kUxIgRlhNtLe S895rrWse6iV6JWdXNI99+dFfawbiXBISdXsbPdh5lvbgruvurB8xeH7YWDSJjphvte8 1RIrk9H3+VwcSH2rHpZxOfNvLB207Y8lrX0Gb4QhdhJxspxe3+Uzgv+BH903o89i4mYv tjUiovCG9jeVhVk91WrSsM9cJY6OSiNsqdwXlVFSLycSym36q+XJQ5DmTtmyUMVpp1n6 wUHQ== X-Gm-Message-State: AC+VfDxJWKLNIBrm0MmHdyqAGRMBehJNlMzcznmjwfxhUnQgBoOdnzGD UhkpRQqz8eVEJv3cEHhF+T6X9w== X-Received: by 2002:a19:5519:0:b0:4b5:9b8f:cc82 with SMTP id n25-20020a195519000000b004b59b8fcc82mr1643764lfe.0.1683187308135; Thu, 04 May 2023 01:01:48 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:47 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:10 +0200 Subject: [PATCH v2 14/18] media: venus: hfi_platform: Check vpu_version instead of device compatible MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-14-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=950; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=q/vSdQIzdh7d45tOHVzWO20BSTczLeC5udvlzu3X2PM=; b=2XRbyAXvi8yZVch7RQ9IDxIiFk8izKf5ejhV1HJZ+scF3YCqriEQ0bIj3aMQMnb2R0lu7C+KX FNkVJTKF+NlB3iPKzkwdgzEYx/lreDn1whr4WieHhDnVI39tiNpO/nd X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950390955361535?= X-GMAIL-MSGID: =?utf-8?q?1764950390955361535?= This is not a matter of the host SoC, but the VPU chip in Venus. Fix it. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 Thu May 4 08:01:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89958 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp133573vqo; Thu, 4 May 2023 01:04:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40/T53CQA9RWTh/FCH84aLlkmjqCWPQJT/0MYU3cPHAFHKi/IGUuziMmKUvJa/JIfNpFdw X-Received: by 2002:a05:6a20:d2c4:b0:f2:bb3f:3b3e with SMTP id ir4-20020a056a20d2c400b000f2bb3f3b3emr1537196pzb.38.1683187465908; Thu, 04 May 2023 01:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187465; cv=none; d=google.com; s=arc-20160816; b=a9BSgI7IYUnCqCf4lyqdMqHQcUO+/hyrqWK2IBMkSrlOvds9NeqF2kYEEDW2H3bjEt DRwCi9tNIqXxhcuwl2tmmnHYw+rfZXIi19fvS8Fmrd18V9D/LlD61WSh5vixNWgFwys0 jVFGBeaDnAlm29KQrMmNb9tyVfgY8SzRSu2y4O3/9HvCqOaqj12oWOISp1jZ3EYn/pv9 QD37QT/RAqKaWhRkbZ/R+y6paPxa5MkrCcJhmgApUjGqOtAoehfbf8DjbK/J97WYEmkE n4hfkwGGH+laFI1E6DJExxy4gyhhrSttVb9ksueh/y2+ASD36lVIEixeI+yqfbjHZMG1 zw/Q== 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=Gmh3QMl0vM3P+SsAKhPqtUWQqJrL9cfiujmVg23UbYw=; b=v97K7snp/xk0Kwu7csqBRoX3nAGP6y1MTI2PGULFXydlv2EKy4/iy2LNYyVMEONufU 20AknC8e8oW+L0SZfl38TaOS3pTXHx3ijitFV89Y2DfjZi/ZTnpdxHQNilivW1fK9pLN Qmi4p2T7zsqZd39D2L6Nyj54i0m2jLmMxqBAusA3ax4OHeyZC9kDWTKgrQLexw2lm+GB oaUg7SFANicROvXeGXfTzW2Zyu7t1ZU6gToZ8GWzFtXwYxE/GwEQWu62mlRcMDFK3nwW LWAE4FKw+SrcJ2xc4NTDWSteeeJQb0njWNpqRRjOgyJeXrFI5Drc/Yry2WGC0gf3SgaX BVoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tXlmsu80; 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 c2-20020a63ea02000000b0052c65049113si2958389pgi.322.2023.05.04.01.04.10; Thu, 04 May 2023 01:04:25 -0700 (PDT) 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=tXlmsu80; 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 S230266AbjEDIC6 (ORCPT + 99 others); Thu, 4 May 2023 04:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbjEDICF (ORCPT ); Thu, 4 May 2023 04:02:05 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0091540C9 for ; Thu, 4 May 2023 01:01:51 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f13a72ff53so185555e87.0 for ; Thu, 04 May 2023 01:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187309; x=1685779309; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Gmh3QMl0vM3P+SsAKhPqtUWQqJrL9cfiujmVg23UbYw=; b=tXlmsu808ieo/MGeji0bU10a8QIdPqAsymprNBulh1El7cx84cOhNh+M/wUBcO8KnT tgJi8KDmLNuq5m49YoWoaW7TzrFb1XrmdLXYkIys4YBQWz45rI1KpdTambR8kZpjcWeh f0LuZ3ieNhWDp9tBPMBHHNFoqwg6nSKbAqEFa9dp2Z4cfKUwCxGYfwn33hkPrWEzBub8 TrkuzuBBsPS/+jm66s0VRJwa0G9zcZbhuzCbMzOgD+OcQviMFUOZdASoofLt4wrs9lty 6zRMU6frGxt7cx/a4d6ISe/FZJDy4dhDE30a95yX35gM3wwN9lsRP54Y1Ry2rkTnrVnK /v3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187309; x=1685779309; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gmh3QMl0vM3P+SsAKhPqtUWQqJrL9cfiujmVg23UbYw=; b=Gg5yKI0gOdYPNQ4C3yaWTIpnOJ64DFxTE1+G9ho2DHNJsoWcLf/7cCAH1qY1lkqFpT /m4w/WNAkU7Kz+mR6a0UG5NCD7MUtny5WyJsW031BrcF70tbtDD5v7AW/sU95+xkaFod V54EznHeRGhoj9xGA3WMJg+WI0v8P3Paja77WCIOcU8F1yjrrEkiOzpYQB7FyYpQnNz8 4KiOp+fEO9K9blTpIaT+lXavuElI3jxM7H7c+pgaA94wFm/C8ZwZs5lpPK7p0PAjOz+l 6r14s2QljpoVr0ND3ZWOQChhdMH7VtZi/QFPd9zj4nfOSKGNKGb7qLODpRZB6QDZ+s4q QQFw== X-Gm-Message-State: AC+VfDycbuTYzgP8w1ckZ2N8y8HuhyPIgYxyDMA38U7aBxZctVoT0Gvh esM2f4guayYFmGjIL/7wRwplsA== X-Received: by 2002:ac2:599c:0:b0:4ef:f630:5c1e with SMTP id w28-20020ac2599c000000b004eff6305c1emr1417050lfn.51.1683187309645; Thu, 04 May 2023 01:01:49 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:49 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:11 +0200 Subject: [PATCH v2 15/18] media: venus: vdec: Fix version check in vdec_set_work_route() MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-15-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=949; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=V/UGltlLWzlzUZNyrcqVl2X6sG5k2nSoHaxfv6KAids=; b=WtOwVMLsPygfuOE/M19QhQt6sE2ZYkfB4FjsG/HcddOYKMC+fTHbC05xXxHT4EpQlkl7qsff0 mjhayIDddOHAfsOiuUNXMgf4oIyAFjkAM36KmNnSsRI+iWP23l3jHIc X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764949980149999817?= X-GMAIL-MSGID: =?utf-8?q?1764949980149999817?= This is not so much V6-dependent as it's IRIS(1|2|2_1). Fix it. Fixes: 6483a8cbea54 ("media: venus: vdec: set work route to fw") Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio --- 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 51a53bf82bd3..33e3f7208b1a 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -701,7 +701,7 @@ static int vdec_set_work_route(struct venus_inst *inst) u32 ptype = 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 Thu May 4 08:01:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89959 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp133734vqo; Thu, 4 May 2023 01:04:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Z0AND2GOxwiClk6snTXQILo8AxFV4dAzzAVUsAGAc/hRQdzh25EOXKwKdMudoRb9zi4Yd X-Received: by 2002:a17:90a:fe81:b0:24e:5fe6:76e8 with SMTP id co1-20020a17090afe8100b0024e5fe676e8mr1391356pjb.15.1683187483394; Thu, 04 May 2023 01:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187483; cv=none; d=google.com; s=arc-20160816; b=IJ8oFEJebK7dCBHvvnWECMY6OtnMLHsvD/Ln7byxpde7D4ENbrNMNnU9jdihHH5lWZ 6nxZfjwqljs2h3MWo1bq6y4hMMLOGdQazkn4zg4jVbjUfnQ0K2EBn2bxKMneBb0J8nba A2f/7VRamjZHf9DlfxXYvQjLl/VD1sBWBqGg6AI3tsK9g11h5WP7hgSsOiwZAJ+ZsOP8 ot+7xNWcVuqnU2DOUODJM58CGcU3hOKc5PrI8ya2gS7o5CU5jdgw4QiGPTTaIuBxCEHg 4q9KypoWg5Rm/DOwmtBLqK0ZzIiwK6KYq2EDAuuZHnDLYYWKfd5hIMEZJU2GDn5yPeXh YNNA== 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=Z6QWtJjp2q6c2N1q1GDC5npabf74EYiHpQvEEQaOQAA=; b=GrmYj8VsFy8rPeGZoRHvAk1HyAQSAAlCzXTgHaS5bIHj1yluOtlLhyZ4eYJkMDby8S Jex+Zv87CCz3X22QZAtdIah1MFPmP7Skq2gwoQXRf0wdVZVGlinp2/S9fAXS20Z61Po2 619Q/zbQ8YXRHCd7MrS4nqA9ICTKLkZHFzTfj1T13ERpzIaVdJxPbbMMWZAykHtIL2/r JyhLZxmH7KtjfupkqxhdEhRy35QoTOuRI6C50RSNu+gj0uHS+vJTjcBr0wsyePLC3qU9 JgG+FgyouPZuyjt5Yr0/NtxTpoR7yr1wPqQ+Bpj5wStI+GnOZaJYwaahljaqO7lvUrjY pTMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TSL586Et; 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 l66-20020a633e45000000b005250c24fa2esi2904239pga.428.2023.05.04.01.04.28; Thu, 04 May 2023 01:04:43 -0700 (PDT) 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=TSL586Et; 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 S230104AbjEDIDF (ORCPT + 99 others); Thu, 4 May 2023 04:03:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbjEDIC2 (ORCPT ); Thu, 4 May 2023 04:02:28 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3610A4217 for ; Thu, 4 May 2023 01:01:53 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f139de8cefso7575054e87.0 for ; Thu, 04 May 2023 01:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187311; x=1685779311; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Z6QWtJjp2q6c2N1q1GDC5npabf74EYiHpQvEEQaOQAA=; b=TSL586EtVmIibnbaXNKWqcoukdk8iBfoZ2PL2zgZt+FYAuWhx7qVRx6wDiFReJufDh 10JomKzFdoV4BbXaE/jYD1xuLPPx8TuSg4pxFarqFV+yGSiD0fEBj8PMd98pf01E8HMt NNaBAV7pYt0imjwR5catlUn6fnPXUi8zhsJpYIEn8YtfcuhMI6R8y3tnIvrsdd8snlpK TN+xOH/I0xqw6+iJATFMuVAGBTrGP3drQWTEwgBeYMxARubwdmnnzoQhR8qGVXKmb+1S zqcvXi6vRMaNEV9tcep+1wH7kFrFOZ/DTw7l78Gy+Yh60P+d2Evrl1PWz2xsdOAYmE6I ArvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187311; x=1685779311; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z6QWtJjp2q6c2N1q1GDC5npabf74EYiHpQvEEQaOQAA=; b=NUxFYSfQ7JGaxOkEaJl2FNeYQya0BXtZmy2cTjguwNNFMB9uk+VL7Amq3E1Bz9CaIK Hzb/NrRUwskcush4LLL3saN2B2eRLIa9sVc8hkHpXUxAjRfDDs32LoW8Pt8PAtc7Cie5 LdB4rTEZPsiD4e8X78QR6AwzxSIq3L8eFa7W3bolNzZ2waErd6eZ3509E4dFnduWbijV /g9CdxZMYU+Jt9Ma/AVNiQ6ZbArjAWpGw6n5f2KgcClfkif5Vgjt3/yyUjalkRdCmW1L h1gcrkMNLEC076PyrlWw4hKqZllLdV7oXTqxiVoAle4i9hNd/5qZIT/QKLVlE3Xk72Ne WOCQ== X-Gm-Message-State: AC+VfDyDw4a08OpOaK9pbUqTzNEFUy4M+pKQ4uEMm9tQ03cEgqyOYt8s h+P6KxkAJeNkov0scbB32coxNg== X-Received: by 2002:a05:6512:31c8:b0:4ec:83fd:1599 with SMTP id j8-20020a05651231c800b004ec83fd1599mr1392472lfe.33.1683187311279; Thu, 04 May 2023 01:01:51 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:50 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:12 +0200 Subject: [PATCH v2 16/18] media: venus: Introduce accessors for remapped hfi_buffer_reqs members MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-16-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=7882; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=JFgOhkeOt67nc44HF+GqE6foLvDaV58jvlZqT/rckfI=; b=v8Yq5IZVIa4LQuuTAiStlhuqUHgjSLjAoEfAzxe64ZzOehkZdzRdbRfoBe18cD6IwhO+Lz3BZ UeYXne8c4vSCDhDlQBxACqwfEfEdRPCZ0q5wFVKUziocn9ndKFiR5NX X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764949998737144239?= X-GMAIL-MSGID: =?utf-8?q?1764949998737144239?= Currently we have macros to access these, but they don't provide a way to override the remapped fields. Replace the macros with actual get/set pairs to fix that. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio --- 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 a2ceab7f9ddb..1ce2624abc12 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -189,7 +189,7 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst) if (ret) return ret; - 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 e0c8f15644df..1e06227ad240 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1168,17 +1168,6 @@ struct hfi_buffer_display_hold_count_actual { u32 hold_count; }; -/* 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; @@ -1190,6 +1179,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 33e3f7208b1a..2f0a95860c94 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -870,13 +870,13 @@ static int vdec_num_buffers(struct venus_inst *inst, unsigned int *in_num, if (ret) return ret; - *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; } @@ -990,14 +990,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 4666f42feea3..42cbb1619463 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1202,7 +1202,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; 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); @@ -1210,7 +1210,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 Thu May 4 08:01:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89960 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp133860vqo; Thu, 4 May 2023 01:04:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40YpFOTsgAEcW2oENkBr/lO+lUUWvAXr+vgCkjmyHZOhNLMfhDriHqfHvoSPA8gIvrS6tH X-Received: by 2002:a05:6a21:3813:b0:f1:c63a:f7fa with SMTP id yi19-20020a056a21381300b000f1c63af7famr1306047pzb.15.1683187497213; Thu, 04 May 2023 01:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683187497; cv=none; d=google.com; s=arc-20160816; b=nXX2zYt4I7+pIMVSuWH6MmvRit9mMBWSPu4a/rL4hTK2c7ahstipod+KjwL19C2kUe 1AZwcnTyijZg/UmyUp70HZF3ADYDg1JWbBDY1GFwclFMKnFAirG67YtYTWcrbEVe14hP i6rDsAURLObiLgdny638IfmKrOQ3/iAJOfQCarwpK0P+3/U2kk7z5NEtNhY87E1FjZ4o FTNWv8Lxi2OnkVpq+nE7pdJ7kIrAmLw7dvbimIdxAzME0H9JkZKNeOI33h9AgZVpAGUE XYUNeVrv3Ws5pFZfLWzlRRcK9eAxJHXsjpWxB8eWk4LPVw/zMsp8TnvP9t5Mr0w64vtn +3ig== 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=7/ezoAVw2YsuX0T7djrVDfZq5CgG+6MzZDD2YwmF/kg=; b=LgOq75VZbGmv0fgsyqDAdz+/OwPrZT9OCSBL7ha/ttD3lflQHEeSFbMsWDtnZ2e8IA ndOfPWHe+HtQPKumZgkUDmghYDnt/A5+NzqntuLkEGrIWo/PjJPI4p8kjz9OPp4SHdgY qey8X+TKh9nlD85/j6IgAcC1PIX6jLxKFEjlWhYY2R18SwesIWYi+DBmXRLNB8oEIHYG 2GL+Goy7LKm7qFAijlPCDIZgTx6Wqv14wCg0qBR2FTZtqtq15oipgZazmMQK1PmGZLiL 73Mx5tOBMVeIsKtu3HE0C7V8jCvNOcRto7ULTMku+HSxG79p3qs1zuqXJU8mFzBaPoG7 54rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kLenHnDC; 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 s74-20020a63774d000000b0052c65959486si2874030pgc.506.2023.05.04.01.04.43; Thu, 04 May 2023 01:04:57 -0700 (PDT) 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=kLenHnDC; 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 S230294AbjEDIDI (ORCPT + 99 others); Thu, 4 May 2023 04:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbjEDIC3 (ORCPT ); Thu, 4 May 2023 04:02:29 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 842F1421B for ; Thu, 4 May 2023 01:01:54 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ac7f53ae44so2015361fa.2 for ; Thu, 04 May 2023 01:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187313; x=1685779313; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7/ezoAVw2YsuX0T7djrVDfZq5CgG+6MzZDD2YwmF/kg=; b=kLenHnDCd0uBsKrSo1WGh78cZTh9Ra3zVmHLL4gndv8ZleajftHuLyHS3D5fezkMOr WSMdKVvRSRukQniAoZj5cvlK1hmjJmwXsyAqZpccM38y9Ko8BEvOW/5buqQ0oAQ2LjxM SnsjZW9r66m51bB0WBrMDS2jDAmUc0kCgZF4WSA9G68QKVr/3bj9j1TK8g4/U2G6G/qZ EZPlPR56wdKsTspC1CaGZ9SZlpWCJcBahFv+edw1hr8IBmgpjEWOLEUr5b0l/G5Hh0O4 CC5DRGXbfNjfJwRkSiT+ShE2u1LxiLSzx0EpkQVupLKMXBXc6yleYaq5TvdSC6cSRvhc Xckw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187313; x=1685779313; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7/ezoAVw2YsuX0T7djrVDfZq5CgG+6MzZDD2YwmF/kg=; b=kY+ME3ZkaKGN6ORq6S4Fq3yZqSBtfocJw3gryNQPdQ19pj3e2lE+zWYXXK1cmhjnQ2 ic8Z/w1c1fd9CZOtIBHC49ddEVcDxSCtNKVB4gep8X4sPA2wSahqp7MLCyR4OLWb8F6J nWMNH/+Tt3gyOwszNxNwJ7dOR6Wh6HgsrX4Sl09KXa+wi4+z0tynOhkYAOiO0cDnrL7N b5ZBDYHbywdRl2HIRjABjruzAn4rlWATC2/m0HB9RCqIN7p/lk4hlfDT6plMicVc14x4 g5BcvTmMrkpUtNJEPPlYOlTzFNldtFLRbtB9RJuvR9rQizrrFo3ssYNLHuN+iiBWIT9i smaQ== X-Gm-Message-State: AC+VfDwTj4XsZbt2Cdm3Gc5EqCK2suuJTPPRIu8kCLD5tFrT94pdbnAY 1vdjOuYLxA4ruYXQqHUi5/XDZA== X-Received: by 2002:ac2:5976:0:b0:4d8:6540:a731 with SMTP id h22-20020ac25976000000b004d86540a731mr1454565lfp.47.1683187312943; Thu, 04 May 2023 01:01:52 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:52 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:13 +0200 Subject: [PATCH v2 17/18] media: venus: Use newly-introduced hfi_buffer_requirements accessors MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-17-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=4434; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3DU/aHZTwApMpAzleBOxmDEmeu3wMrZY4AjWxSwH9y0=; b=9IA8yX1+nsMn6XchQoCxp1wd6G+ibq7ZxKdRzqfGpLjOauwbHOGMVdZCFeUChEHEN7xfLqT+s fwK2smrptb9BbTMppDZxwJGyF5mMRqzK8YhnFfv9x2mzqZuijYKnGRg X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950012941795092?= X-GMAIL-MSGID: =?utf-8?q?1764950012941795092?= Now that we have a way which is independent of the HFI version to set the correct fields in hfi_buffer_requirements, use it! Signed-off-by: Konrad Dybcio --- 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 1ce2624abc12..0268129ab9ac 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -667,6 +667,7 @@ int venus_helper_get_bufreq(struct venus_inst *inst, 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 a9be31ec6927..5eb4032bc551 100644 --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c @@ -1214,25 +1214,25 @@ static int bufreq_dec(struct hfi_plat_buffers_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 Thu May 4 08:01:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89974 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138380vqo; Thu, 4 May 2023 01:14:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41l+Qkqdu6z9Rc/WZ/oTVoD0ZhadHnxqpGcV3IJ08dGW3VALfM/BfFOwIZ7Qzcomwjcww7 X-Received: by 2002:a17:90a:c217:b0:24e:1b19:867f with SMTP id e23-20020a17090ac21700b0024e1b19867fmr1348309pjt.37.1683188083698; Thu, 04 May 2023 01:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188083; cv=none; d=google.com; s=arc-20160816; b=LDRE5R5TrdOZgabmLiVlxvMnqL4iyktBfnFpFq/NJAgQZ8bDxO6UevJMAKKiiRmKFD 51RLQ5QpDMhCrufmFaFm3HhVoh1qNy+4mbZ+fSvOjs2VYlr+1vzDRaPK1HBSv/UqW8o4 omYsBCbvPF7shkOl4YHwL5BUpeSdVz+g/n2YmjkDgvp1XRIUVTcA3pF7x8HXiPI32E7h wzFYEK4YS3FfxRH/fpnHQkTv05cdJiP4nnUu7oli2J2ZX/QHowPblpDKELXDkCzXHGPq ZJJmRG+UruYeTzKX9SSxHnXJNSZC91gj/0I/7M8t33aOURgVEIiFtzsVtP5PxghQBGEC jlzQ== 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=U/UccTAcuhBCUZ5FF6aUwvykUnIdd379ssRafTBI8b8=; b=iFlrUhcuO3iaDNFjSnZiJhHQIBIntZLmWxQ5HjSbKoCfc0zgr5eWb9dGybzvmH+RDU QaVfCpLmyz7RvkPdcYhVcnfMTivMc6lWS7lZHEaQoWTEdfRTeGSpWruhOgVkuUzz7Vry rruie89Eyk8Mc90p7lyvxSwQj4BqFuyxSBobIz5i1aBdXORaoxd/NJXZwv9vtijQek2M S1IiG/DPxKfDYrqgdFQ95TWe2R9e8yn493MqoANkstkccOBo7QLSMEBgrerNknHvcpA3 Y4UHNunRfpmNvd+B0B4GtG/XFh5OmAVgZnU0UB1NomkNVVAzT2P2QoXK5QgCaCcd0goR ipeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k2wfBVJ9; 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 p4-20020a17090a428400b00247c0ee86d6si3265213pjg.28.2023.05.04.01.14.28; Thu, 04 May 2023 01:14:43 -0700 (PDT) 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=k2wfBVJ9; 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 S230215AbjEDIDM (ORCPT + 99 others); Thu, 4 May 2023 04:03:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbjEDICb (ORCPT ); Thu, 4 May 2023 04:02:31 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB2444A6 for ; Thu, 4 May 2023 01:01:56 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ac770a99e2so1985801fa.3 for ; Thu, 04 May 2023 01:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187314; x=1685779314; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=U/UccTAcuhBCUZ5FF6aUwvykUnIdd379ssRafTBI8b8=; b=k2wfBVJ9WXNUj0tgbgW8gkMU+/1meB/9vIXZndgxm10dezJlhYaNqAPsHBh9q1qZXh Kuzy0NH+RKCmcAn0b/jTlJi0hdiXCA3gFuqeN9yHD5AccDS8ZPHDOGwV0/CpD6CpSVeb k7iUiSekl9SQqyFw58h/RnWjkyaeBgx9MPRTqAjdLjYST/x9x4IJv/EMWxMHjF5vOBjK WnhfME2HEuhEMZEKe3g26jLri7ePZ7f3r05v2O3ejxVPa/+HQ1GN44m8ljadhbrCAa0C sSMWTn65rUyY8YDNDnJvpVAyibwd/Z6wyf5b7wy+e4Tz53+i8b1Pc0ZV4+XGst10qHFg hVuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187314; x=1685779314; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U/UccTAcuhBCUZ5FF6aUwvykUnIdd379ssRafTBI8b8=; b=OBnI04KTGEM/XCVOdhMb6++jF7vy5/ICngmqOrxzIIgkkyrULPpjN0Uo8JJsSQEmy1 6Nq7yEl5NIO2yBfvjfD54ZVXKaPmTgg3e6yBp+dWKFNV8vCOMc67XaCIYmqWhjBRbVkk 8LpM4w/LPepi2Ef1XaA1A1XJayMvpVXzwJ7v++W96+Dvz4bq6WXmAd/h9xwCc3uCbahZ zXF7eJuat9VGVHBbn44+zkQOvkd6yM4iRHi8SruOLumMc6xlXoatmR7SHaw1OJjp5JET IX5+farPzNOz8aciZqKkJzOCEAf1MWPenPoKJYBZ73XPYesxcn11gsY4PPQsLfCYjBiT 2Tvg== X-Gm-Message-State: AC+VfDx4Idwycn9HGv/L8Ara8zfT/bMpHHh7MGIA1t+7pc30XMEh2Y4P pGJBoPb1HTaFOcHOP8aS8b/yQw== X-Received: by 2002:a19:ac08:0:b0:4ef:e990:8a53 with SMTP id g8-20020a19ac08000000b004efe9908a53mr1563858lfc.18.1683187314397; Thu, 04 May 2023 01:01:54 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:54 -0700 (PDT) From: Konrad Dybcio Date: Thu, 04 May 2023 10:01:14 +0200 Subject: [PATCH v2 18/18] media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2 MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v2-18-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1033; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Heez1R9g/upp/lte+28AqBemWtRoQ6abP6tBXj2nEJo=; b=dlplnoZoob7e3VzE6E58BXJl+xaZE0aZvFCtEc6T9JXS3KuWqNZRqSdT20GugI1L0NPZI0gc8 ikoGUOm0MXWB6U7pfzKbOSW8+HPXRQE4CGqJwARcFQfYAN/c1rUZA2G X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764950627863958670?= X-GMAIL-MSGID: =?utf-8?q?1764950627863958670?= This write was last present on msm-3.10, which means before HFI3XX platforms were introduced. Guard it with an appropriate if condition. Does not seem to have any adverse effects on at least SM8250. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_venus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index d6df99a921bb..6405771568d1 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -462,7 +462,8 @@ static int venus_boot_core(struct venus_hfi_device *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) {