From patchwork Tue May 30 12:30:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100813 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2144050vqr; Tue, 30 May 2023 05:32:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6s6XKi8omqm8fG26yKde2I24lc145tLqPSKc8hgqcJxVpjygtRgprut0CFhy3LD+1tirbW X-Received: by 2002:a17:902:8f8c:b0:1b0:53dc:1f66 with SMTP id z12-20020a1709028f8c00b001b053dc1f66mr2001741plo.28.1685449956909; Tue, 30 May 2023 05:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685449956; cv=none; d=google.com; s=arc-20160816; b=L+rJdbDI4kGT3N00qOu/FfAerygG7ncoNQcoRBimmpRgviyIArfty3UZbkhglWAIpc kk89cKEZJpwp0eaGv5wxEtTePikz8t1lSCL40dDjeXG6yUPQCryC/6SLWUyAZcQeCPzf Ml/FJaPSu8FBdYu0zQu3806zIAKRkOrGTxSCkH4OB+MVb5DXbnOdUs5a8qAJGfBGpIK+ G53vYLoNn4Aie7UQU3NZLqHyGsDSF87x7fH0+eMLI/zfNJONxohpmZdhBuN/sBxxo5Jy 5PT4TzTmSD4QjMaK767t406kEhQxmLDsitnKst1AFwCmQvswQRnrQYX6efKFUvXHAaOf hSOA== 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=F1axqNPjGLjogy6xSCaHfcBTXr5wHaN2QoDEVW2I44o=; b=CLzAdcwZ8shfUpsNjv+7bMWL8lZXDf7E+Ek7QXHrzUP2D+EIg1k5jp/7eWujmZYwue DhXttUcgr38SDr3QTEl51FwQsCw1082i6RrJWJ8w0K9QBnQQEeeSDFzhHLjiWj3+LbMG nqQ7c+99u5MYcZNqdCKWNywny/IaL2n4OXqX+WUGR2BycTS9jWJKOES5Wy2eAavRASqa atZ+3NxLpo94+EG/o/nO/BHW/NHaKQslJ9FjuahTNMRye/EXMDGvaR0RiUATp2XCYkiR nl5DiUWmdJoizmeiIIbm+AD3HP2/f6/Gdz9gEDIv0Qxjn0ti93GcFhHSQedSi2PtadfB 6WcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nzb6gIvl; 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 r3-20020a1709028bc300b001a92f0f46fbsi3998556plo.436.2023.05.30.05.32.24; Tue, 30 May 2023 05:32:36 -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=nzb6gIvl; 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 S231317AbjE3Mbb (ORCPT + 99 others); Tue, 30 May 2023 08:31:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231520AbjE3MbY (ORCPT ); Tue, 30 May 2023 08:31:24 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 716BB18B for ; Tue, 30 May 2023 05:30:57 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f4b80bf93aso4813191e87.0 for ; Tue, 30 May 2023 05:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449840; x=1688041840; 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=F1axqNPjGLjogy6xSCaHfcBTXr5wHaN2QoDEVW2I44o=; b=nzb6gIvlQ4aKJ8Q3cB0kI7/hz8JZao8iRtKTTama0cj97b32ntEv9i+7wgaSKmTz1v gDYNNUz6HLfBSylcqBvsWwc3XRGt5k08YT/FNjJkQW8q6xUzZpdXsyTUH/i4RYvPukDE TDZ7/GekaQm7VIeuoF0aiJ29BDXgdCJKFyae1A2lvlj25WEWXU4P4PytjJIayM3MqFNZ ttZ66kkvI6u7kYOlm/jWn96IwBCJTueLsI1FnuPGf5ERxMjTiwgU6UFi8chZ1KLdvisa 6aZN1S/X+PRT02U2cA1yHFYbbTPp45v7xY2WY2nmNPy6KzAFegv5P/jiUlbSsAkgq9FD 4Bjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449840; x=1688041840; 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=F1axqNPjGLjogy6xSCaHfcBTXr5wHaN2QoDEVW2I44o=; b=TLAA2b22dL0AAzaDW904GYYOLF2zkOunPu8piJ1OK0cz39vZSCk1KgeIYATqQKSauM R4gaRJuZ8DjveXxsBzIk3vVROGipASOB/ia9Yyym4Iahs4Hde64rN3+KUippnqXDkikd Ht54hSY41nhfseLKvUX3CnOJBpTnVTRLIfgh7FUVgzHyijT1vksVyS0ruhhboEIxpw8A vE+X+9Ns9jLFj/3TpF3jVh4B6oxD7bM3tR795KtFSAWwWGj0RHZbF+VDI8j3QZk3Pg3Q 6BcRDNcSeQqUQvdeMovRxjnlcmleDFJQ9CLUk2FWsOSVYBmnAG76IyAktXSec7D+p8Td XmIg== X-Gm-Message-State: AC+VfDzDyvZsvtq0GiNW8T6FkKpJltvDxMachcQJu9iaabIki+vH3WTQ Ln+sB5u9X9LpmUeF7oWnDMvDeA== X-Received: by 2002:a2e:8ed4:0:b0:299:a7be:5775 with SMTP id e20-20020a2e8ed4000000b00299a7be5775mr668729ljl.35.1685449840144; Tue, 30 May 2023 05:30:40 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:39 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:35 +0200 Subject: [PATCH v4 01/17] media: venus: hfi_venus: Only consider sys_idle_indicator on V1 MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-1-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=2458; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=hvIZqkG858oUVv/9/D5T6FwxTNGe5nTsI4JSBUSHEXc=; b=gfFwBEKZNcaX0ECRSIpun8YMTAzBblotZ3BrrfkwhTF+DA138t16RryJYsEWkJB9+E/daHJMt SKZSXL/fEwJB4y/FR3FJyyUPy1hwBfaX8GqJaK35num6vah4gXomdFX 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?1767322374007129107?= X-GMAIL-MSGID: =?utf-8?q?1767322374007129107?= 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 Reviewed-by: Vikash Garodia --- 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 f0b46389e8d5..918a283bd890 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; @@ -927,17 +926,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 Tue May 30 12:30:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2151382vqr; Tue, 30 May 2023 05:44:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49Qw3Uz/pDuZZJpbk3ENuqOEBJyZCOzpjsu0XOlkSpPBDgjuifKJytyhke5okarxLo5LBd X-Received: by 2002:a05:6a00:2d18:b0:64f:3fc8:5d19 with SMTP id fa24-20020a056a002d1800b0064f3fc85d19mr2501640pfb.32.1685450685541; Tue, 30 May 2023 05:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450685; cv=none; d=google.com; s=arc-20160816; b=Pb2OByCuQxwBRLj5fJK18wk98liIuKPSk4AGPXzXvRd9KEHZo3E3aEumTsKSmu4Wlt VMs4TRL5lWyJJxe05DfOBUEX5czWnnGcRL+gVcrAmU2ZDny8rEo+kNYEEJepwd/Ij7kg l+XimmT9IH1YUf8+jbWXWCUO94gTY1At2OiGPF/lPHt/pJOk/exQli0kfygzohXc06Wn D5NngCuIU+klD/6Quulu1yAP8bC1OADVM1P+kRmrMod5adf6olHEe9eoKn65saMrT6aQ CHXmBZ7rRko/ep6tD2a1n9CVgJB05xRvoB5U8Pr5/bpPRsKq88zmqBCef3eLodRaOQnM Pa4A== 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=sbfKhEi6AP8oogWxHIUjADOArHuCuwJja0KhM7U85+Y=; b=PFik5klUa19T0Gzau49zhr90yBDe9Tcitu+8ylBSHKrF5Ru2iNNInXZVVnF4kyYav9 8fYnvBJdfqQ3uLv1JNocn/y9ccMyLAE2OQTJOltrdIbgKp2ZEYmEBya+AbFmyewcPLAK xeMKsnCgqd0jKQuhsf+EOc6DIV+ZzB7u0BfzIVq8btD0fumt0O3PcDNvcnlr5mrsgZm2 EDfkU9z4PCCKaefvZEPIpEK30dc+NUNHNdz4cidqJn/rf4QGeLvzDvdCEUIqQ7Rknd08 VOKsnXWsYxD+JaSZqD+sffJW8r4R8AJ+T+o7D6cesLchxjv7DE2+VBz1LGWNxUuUnR1z q8vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vRUpZqjH; 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 q12-20020aa7960c000000b0064f50d19c4dsi1626955pfg.80.2023.05.30.05.44.31; Tue, 30 May 2023 05:44:45 -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=vRUpZqjH; 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 S231736AbjE3Mbg (ORCPT + 99 others); Tue, 30 May 2023 08:31:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231543AbjE3MbZ (ORCPT ); Tue, 30 May 2023 08:31:25 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEE9A193 for ; Tue, 30 May 2023 05:30:58 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2af2f4e719eso47173191fa.2 for ; Tue, 30 May 2023 05:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449842; x=1688041842; 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=sbfKhEi6AP8oogWxHIUjADOArHuCuwJja0KhM7U85+Y=; b=vRUpZqjHX8gIg96+0FXtOpJ2hZUbOQ3/nAAEOW3FU2s1Q6TOPRx8r50flnJZYZrNX2 JVGKmM3YdFqHYHziwTHBrMk44DKqeWdhgsrPm4zPqVZaGl1FCX3icDyphQhKTUtIOjBv Rlk9TLhcEPzHkmVbtpPWzQvhDwvysNQHDWY8LqHkDBwX6lWA08/73Sl0mDuWhdxYouxR Gza9y3rf9IzmJObxzJ1FxbKTHvekPhgJ17SnZ2lkk+6RB1f410MbbO+hAyy2PoprH9Dd s/RiKpT2CLs4gKVr7fX0eKyz/ofuzJ+hLzQdFh43Z1Eiz48/gTkWZdpZNVWYwrXzHjMw Rczw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449842; x=1688041842; 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=sbfKhEi6AP8oogWxHIUjADOArHuCuwJja0KhM7U85+Y=; b=Cathd13KvkqChDyeMBJ7eS/bO7oeKXozYKxS/pHJjPORYi2j/lo2MINs8H5wQ+RAJ1 ctztPaZ9PMT4FZ69uiiCWhdiAnLER95r5rsnbUNNL0o0s3lyR78QTWAvHgcniuUgoKDz h8464u8uV0cq9sj4B//nb7teUrepC+TuJL2ekMRqZigUDWtc5gt/WAF0lS2yvT929dR2 IqJncdsiNHGl9+RKbGi2OyO8+xPsodP7ZR+2U+Tq19BOHJFDfvzTFSC6xejpEN6KO45R KttpobHMHBHI3xGwMwX160Wr88lIZopz7iFQCE0qY+pQO5hRC9xnfLkbNOJ0iSbpZyzc GWeQ== X-Gm-Message-State: AC+VfDzn+A7QM8/K+ao4lRD8m8nfQdOji5lPHWSEfaEd7i1CfFKWDC0C Ul+WGtNazhWOtBT3/3GK4GzVmQ== X-Received: by 2002:a2e:2e16:0:b0:2af:22a0:81fd with SMTP id u22-20020a2e2e16000000b002af22a081fdmr689378lju.11.1685449841843; Tue, 30 May 2023 05:30:41 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:41 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:36 +0200 Subject: [PATCH v4 02/17] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-2-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1518; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6Tn8t8czcTnx35lpk52WIN8IiuX0IKqs1GzlBMeyKQk=; b=YkKhxl3/ihamy1BEEQDPatQ+JPwks7Lxn+y7kclMML3j/mWQMghtFGtL7R0Jo7xbdfhZcO5oh rBHg1+d4v0KCCYNwh4lBl8mllhLQJSFw+dUDchB/5jOADrNxIwG7Yzj 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?1767323138075141783?= X-GMAIL-MSGID: =?utf-8?q?1767323138075141783?= The startup procedure shouldn't be started with interrupts masked, as that may entail silent failures. Kick off initialization only after the interrupts are unmasked. Cc: stable@vger.kernel.org # v4.12+ Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 918a283bd890..5506a0d196ef 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 Tue May 30 12:30:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100828 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2152967vqr; Tue, 30 May 2023 05:47:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ixXTylMMWVJIokLLDrLl/lMfMb0MudDBlHhUIb/v84RnbOz+NLxZfO725p/FJI1IqPX2l X-Received: by 2002:a05:6a20:258d:b0:10b:e54f:1c00 with SMTP id k13-20020a056a20258d00b0010be54f1c00mr2796080pzd.57.1685450839924; Tue, 30 May 2023 05:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450839; cv=none; d=google.com; s=arc-20160816; b=qG54tpcVvHoIiCoanVrYyKgIO9A+FBliUKdj24LrOfx09BKur5ZJMc/bLoDhlt02tM akKwRT5W2opjxitkXMS+y9lsAMw/d9kDrKXtjcDERLvAIrftzjyZNWBWy82Fe2c//oUa /+nZQYBAKnf4M/n5lke6sN6Yms/u5gZBpm0CV56l7qUAMTgytgmyIe2CYYqY4dv7xibn LYRe6W3XsExeEwdIL4icQJl2asqeFsiHHetdGJYJD5oMjDAsmBrK2bGhlrPvsx82LZiM JuUcBn1bqUUlIHGV1F6oJCkXZ4zmpJbrzXkrcyueqtX5pYcKWm87JU7cNU0LUdlJkrgY gIRw== 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=s0orgZ9VaZSXEKcYTGkUfYKaUqJC4FA3Wr38X+NX2Cs=; b=w+Oqk0lasqNrHr7S5T9L8z94ff44Kw/smHJFtv4+u2sfww47AKHeCTfh/iZxYKy3o2 hX0aWfh0hAd2qj/vWMIoPPBassOoqXBjzC+kgyMcnp3XjT1Yw58a9dgKj7AnDFVoQbQz +Cy3koV4zgUkDq6KDvLjmH64PT69BOxa8egEOwUZU7XhQKsC7S7XHcRe1xL3u9KeuT3J yMsEzoN0DiuBDGE8hxcyxN/EzvYEGXk0o3ri2oQYgE++YXoBLf6nxXkJumD/5XkSEX8d vCLG22feiC+BxIjJHuuirEq7yLndzmZqS0wHEVG/Sqib6A1dDHEmb12hLtoyRNn+vGF/ mrIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AHOELlFV; 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 l189-20020a633ec6000000b0053f228ce43bsi10894077pga.569.2023.05.30.05.47.05; Tue, 30 May 2023 05:47:19 -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=AHOELlFV; 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 S231806AbjE3Mbm (ORCPT + 99 others); Tue, 30 May 2023 08:31:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjE3MbZ (ORCPT ); Tue, 30 May 2023 08:31:25 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8803C19B for ; Tue, 30 May 2023 05:31:01 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2af1c884b08so53753971fa.1 for ; Tue, 30 May 2023 05:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449843; x=1688041843; 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=s0orgZ9VaZSXEKcYTGkUfYKaUqJC4FA3Wr38X+NX2Cs=; b=AHOELlFVnO1Holu06NLsIHbrTMEL1w8W+AUPz5+nw73lW50Utv4V75QyHMOKD/sSKP +Y1txM0AzF3gJzOWfXTXuEdfEQlM56vv25wABKQcdbFZCmPf8Bb+fuBWJTXH+XvJGGGH CAATTnW8dKPPNLCEDqSftnmqrontzfp/LsyMct6aToqByCB+nCtxxc95/TmTu+Vj5XjH 49bE+om8uzmeAIS5b0dbyO0HodGkCg3nw0cAGuO5D+SRB02utJA99OBpp+rxpQPD0R7w dXWwCNp4ZK+Frd0Auq311tsWLXRkpkoq687q0iaLHqrC+dEhRYcLFqSEsT//vxdpSs0N uVOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449843; x=1688041843; 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=s0orgZ9VaZSXEKcYTGkUfYKaUqJC4FA3Wr38X+NX2Cs=; b=gqHT5bO0Wr0Fb1iWrBLGrtYqp/I3jWFBGbiMk0djllnfZsRxJoFrlwScs/9/j7F5Ax O2tCbRucwfjRA8PJSxrkK/fg2Lh3clWndVc/OLakNuPG9h/0fUTffQPnASoJfMkVNAvZ Y5BH20XMTkh0ituenfkSvVrvY0g8nqQSLuc4x73cA1Czgg2SFqIa5enr/Rv0cAHvT6tK y59TwLeTG07+JvOKIfhx2+EHRHmY20SkaRzkUFVyzDiUiWpK6N8t5Xui1tab69Kws8q2 jpQq7lbS6YpmJE0RSCsSGE6no1Ua/Yze36Aacf2saYVvnn5StMABsTl3D4HiUGVgEift 6mrQ== X-Gm-Message-State: AC+VfDwgDo/GWRETsl4w+lu5u/rp7n9IUsrSNLBbgYGZxNBWtXMVdyQ4 mLhjPcrKA4iMrZSO15E/kEzUsg== X-Received: by 2002:a2e:b626:0:b0:2ad:9edd:4e2 with SMTP id s6-20020a2eb626000000b002ad9edd04e2mr4094386ljn.20.1685449843259; Tue, 30 May 2023 05:30:43 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:42 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:37 +0200 Subject: [PATCH v4 03/17] media: venus: Introduce VPU version distinction MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-3-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=2053; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=a99fLFp1dm6W8vgH/KZB1/Be/9Fqdmq9iT5sHLbqduQ=; b=ZvS+29xPEpjcnTQognpm1gsvkygKOy1e0BEzruqFSraEGtaUtPzdLH7ez8NrL5h0w1PUJJZkc zsoYTh+LFCNDxrfjFc4o3ccV0gLVufhoncJxwkJuZNQ1ueCiN/HNs2q 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?1767323299622068614?= X-GMAIL-MSGID: =?utf-8?q?1767323299622068614?= The Video Processing Unit hardware version is the differentiator, based on which the video driver should decide which code paths to take. Up until now, we've relied on HFI versions instead, 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. Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 250342d27a6f..4f8ad9659907 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; @@ -503,6 +512,12 @@ struct venus_inst { #define IS_V4(core) ((core)->res->hfi_version == HFI_VERSION_4XX) #define IS_V6(core) ((core)->res->hfi_version == HFI_VERSION_6XX) +#define IS_AR50(core) ((core)->res->vpu_version == VPU_VERSION_AR50) +#define IS_AR50_LITE(core) ((core)->res->vpu_version == VPU_VERSION_AR50_LITE) +#define IS_IRIS1(core) ((core)->res->vpu_version == VPU_VERSION_IRIS1) +#define IS_IRIS2(core) ((core)->res->vpu_version == VPU_VERSION_IRIS2) +#define IS_IRIS2_1(core) ((core)->res->vpu_version == VPU_VERSION_IRIS2_1) + #define ctrl_to_inst(ctrl) \ container_of((ctrl)->handler, struct venus_inst, ctrl_handler) From patchwork Tue May 30 12:30:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100833 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2153358vqr; Tue, 30 May 2023 05:48:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ43+HWfp83rENaysc/Uka+Ep/xU0E5NxUmL86gnvLxPQU50d6Z3nXx4XkPdDbUML2mF3ICO X-Received: by 2002:a05:6a20:e486:b0:10b:cdb1:3563 with SMTP id ni6-20020a056a20e48600b0010bcdb13563mr2155668pzb.46.1685450881642; Tue, 30 May 2023 05:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450881; cv=none; d=google.com; s=arc-20160816; b=R4M6qZc8W54Drpqq3hRYyohSTkkcbkWpICeHxUq+Q/YyvcbWLHYWzm+mktRH4pPIZI ZnPPQf0p18JVTIrcD4u76opbA/cged2vLhiOwld/usq8w14Z9a7iM4XuiIo3U6EVM1aP zMo99ffbaHcbtwZBZUR2uleEsnemP2Qa4yQi/qylg4jPdiCtm00pb4EWHbuH+ISry8ay UZB7jbWfg2ea/gFJeg4nmqxyjQdjGwmj0h5UBnSkY/JP0PZNVNRnfKScA8xShmG/xlzz PmnPekQkAOVXLuyOeV0FtfflJRN+fDl89LqJSL5OrDdbzW3HG3VWfpZHnuFJO1g4vpiU kEaA== 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=umRAJMqKc5zF6FOAntGSMEcHnMlgnfWakGEzWkoJKuw=; b=hANu3djQY+Fpwsht+b8hc3W4DFEhcKhcWvGZvECVl1BF1oTakgPyhK5D6c4JL45P02 ESYR2YZlWJtd4NSzc/tqxY/anw+j0D0lJx2ChrBARFz4DIx1JedliglfGiWMMoSyfAxJ 0UBehJyKn+QvvHk+nmyUva3Yx7SwqPIHNv0mD54ezVSoSHJY9U8dkj4J9M8WLixyQ2CR P7V4qumAiYuohSRAe/w2cjS0XXIuAPGxYMHasV5qE/bpljGHiXKRdoxMKNqaVb1h1WPx xeOGSphgvpsTtmqwLZfKkwq/1f6517HYZf90FKDdLqTmvlXd4aY2mJO803XVG5QUhged wFiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jnsR9g/c"; 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 i192-20020a636dc9000000b0052c66d4c255si11482505pgc.576.2023.05.30.05.47.47; Tue, 30 May 2023 05:48:01 -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="jnsR9g/c"; 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 S231439AbjE3Mbt (ORCPT + 99 others); Tue, 30 May 2023 08:31:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjE3Mb1 (ORCPT ); Tue, 30 May 2023 08:31:27 -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 9BA1E19D for ; Tue, 30 May 2023 05:31:02 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2af30d10d8fso45109011fa.0 for ; Tue, 30 May 2023 05:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449844; x=1688041844; 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=umRAJMqKc5zF6FOAntGSMEcHnMlgnfWakGEzWkoJKuw=; b=jnsR9g/cD1+a55KbA0DPQEh1v8dBMUVwa/pGnmLJ+EVsv+7FrPJBwGBzq1awiJBwV4 5506xFpPIY5ajiUdPzQl+0g4iUuqY/im9vQ8uqpTGe17pRNVeP5rmg18J98QvNACxbs7 C27pNj3OghpqkdAoSBYLbylG/VO2qVD1EO2MH4RRlB2cuhU6Qbpt45+VkfJAul4wR2ar gT7I6v4GbsTEY0HQBvl8IerIJ6/Ccw8He7THDGAgTjH5KrsoI04ux/TeQ1UWkrBcO/bX Xaw3qxmXZ6fcCRbbVx3U8LYB9iUabRIHuipMCx7eQS+s1ZGctoT6p9MZwWtSwbelnpJA /P0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449844; x=1688041844; 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=umRAJMqKc5zF6FOAntGSMEcHnMlgnfWakGEzWkoJKuw=; b=WapNsN+ARgoToh/4+MmgQxfeikuRAM82Xn4JKpxEcbYWYftIgqHWnr53ViDsvFWhGV FmOs/V7HiLFtxCCYpV3Hd0WU6eAmEjy+OX5VOKAxJrEq0h3U2lFvWwrRxh9gyY81txk5 WDsDF4Y/DHDTVHgb9IK8Y9mfAwaxfCrZ9KaSxahwu6FsgiurxmUfVT9+ePCaR0/W8xSH vOV0DUFDl1N2nS9qYGVtTgYS/NjR1LAbTnoH/JVWXbsN+/HXoIUTh/2qo+LfPwZ/P1wB DkqMHCoRKn4PyySrK22RpT/zwJWgTRvjeWfG+cS9soibuPLcxDj38w+qPkBUqZfY6o8P dBcQ== X-Gm-Message-State: AC+VfDxacOW4pIBIXctl10e0q52dZ0Gvm+sRktCjkhSXJqBqtSGvppds G2SrCNFwukpih/0/y1cG/+faog== X-Received: by 2002:a2e:b349:0:b0:2ad:dab5:fe8e with SMTP id q9-20020a2eb349000000b002addab5fe8emr696053lja.47.1685449844609; Tue, 30 May 2023 05:30:44 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:44 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:38 +0200 Subject: [PATCH v4 04/17] media: venus: Add vpu_version to most SoCs MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-4-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=2055; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=nc30HaKHpy9R0tdyW3Z01908RNfbGE4dIZSAtIHTLSQ=; b=FARdtRF1h/o8OTBryIzEh0kRUC7FIYB57opTKh9EHQjhSK1TwYa+NH420fna6UIVIQm8bPO2F hFfOaXBuRe1CHneEMbIbbAIPfWlInwcEMeQCizXxlpl4NMRJEgpiNmb 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?1767323343651108919?= X-GMAIL-MSGID: =?utf-8?q?1767323343651108919?= 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 Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 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 Tue May 30 12:30:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2149272vqr; Tue, 30 May 2023 05:41:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7r2GtOwSO6svAHIQJEjy9TfY8k385QPwcyMoJYbrJu3ETAOigLSMoqQgQRHO0s73R0Dids X-Received: by 2002:a17:902:ecc5:b0:1b0:58dc:db59 with SMTP id a5-20020a170902ecc500b001b058dcdb59mr2864176plh.23.1685450469508; Tue, 30 May 2023 05:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450469; cv=none; d=google.com; s=arc-20160816; b=oRQS0d1JhAddYBELuocVlxuLsdukIbjSZGAgJQ+8OSJabk0gtvHasoEKHI0WJhQDTr 4k5WDjjMKuf+oAJ9Ruy34xCal6xkB3j3nGMZQznDgf5Riq/mayNVm/WGz1bQkoteUJkO y1yr1x5h8L+U4Ojs+lN5EIgfhWgG7Qy0A2JJAdjKme0icS8gdIeKQjo26R8NbijS3M0o 6hFHFJZrDjRZRGptwm9gfRk+rYzULhbCt4CoMPKv0VzEAecELlBnVugwuvpJoadR+hxR EcdHtjdEcjJ3q8OFvyiloyoSL5+A6yjm80ltwabe5L6KhH5dZ2oXYKlG4tJ/W+B1Sk5R 0Uhg== 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=5gG/GQ4bkNLXJnem7GziPpF9ACnuRetCT8nUsDWFQHk=; b=YaSDlPz7+3jlEti5lY1ZqXOYWcjvmnWb/PcnzbY7ZFrRZFd4Z9XblmCrI/gyZpO2Hk BtNXUG/wRii9ETkg2Ya9/nzQShG4v5NiOTd8DP23GDgi4S0RPkxeCro3NYn8TknZ3dwD 8SQsEIuvc54ZJUH5SINMoCCvuQlU9jiQsKUwGOqBNAn1Zq2OS8K5KrSn2eFh3GbShFLh CUUNd7GQh8RmQxUy49ETIzET4Mn7z/0gzsOOLWhEVB8oxDw9VfCbtI7fdvsOJlR90uWN UpQMzu1gIjrBiaD5xkgqBATtU0yrcVU8UOZhfiBQWtiFAbBGgoYzf13I8MU5tM6SmHay d/Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FPcrWx+S; 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 k18-20020a170902c41200b001ab259969e7si5733450plk.31.2023.05.30.05.40.57; Tue, 30 May 2023 05:41:09 -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=FPcrWx+S; 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 S231896AbjE3Mby (ORCPT + 99 others); Tue, 30 May 2023 08:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231648AbjE3Mb3 (ORCPT ); Tue, 30 May 2023 08:31:29 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E8971B3 for ; Tue, 30 May 2023 05:31:06 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2af1ae3a21fso46758061fa.0 for ; Tue, 30 May 2023 05:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449846; x=1688041846; 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=5gG/GQ4bkNLXJnem7GziPpF9ACnuRetCT8nUsDWFQHk=; b=FPcrWx+S0QqRRp9vjxeUGVcIokY4/Nke+Ff+Q0JzM8PKBO4+rvXhn1bgO7zpzFOTNP 6BMA/Vey0ohHZ8ULcjp+Qc0nvj/j4EgCpMhld9J2LXcxMeccAmPQzHJSdpTFxWuhcFMb VAsjQA+LYAOsKhdpXM9W3TCxM+ZGRe/+424JuDbGMQpx3yjx4zcaVITqg8gXFN/14UY2 BHHIIHUDMbKMnqNdMRzeUY6rbZbmMTbqpg2v0zIauOVF4kUL8oBiOFuIn/EP6kwDR3af HP9P2GnOSLsIcLYJA/LojzJ4hQDut4jD93IsVYebz0b+1Rs7Z+2DBjEqg13q7bu0uRiQ Tr6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449846; x=1688041846; 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=5gG/GQ4bkNLXJnem7GziPpF9ACnuRetCT8nUsDWFQHk=; b=VlRqXN5tXE/aQoqjvpYTF3juilCSkyEED1omc/QBkaYJQaBoRCyvZcedN0qNCXqqC0 seJhWbiO8id703HhU3CcwcIfcZR5q5WOAa+/WGr/mqCueNa8rmTrQNkXQGtFzJGc4nzs eTVqD7U4GX4V1VIR+jaz6jjQTSYhL0Azdvae4fhsEdQ7irq2iUjrqh1RDWjvDi5PkAbu WVpKEVws+fahFcXnKv/amN6wpdj8NZucXFoxkSfCsp77/j5+wWsPfUZosKV4C3JWihTw jVsIx8GEg7sUERC1RjntfNGIfKaFogXc/6VlrJBSWriRwdmm8CvHpWjqVCbiqkQd0koF AZrQ== X-Gm-Message-State: AC+VfDzojDSR7LZ6/X8RcJox5C3WwqsdNYxKtXlgk0xgqOBr6b3xiopk DoEZ37BJ+Q9Xn/IUk7Irzl1i/g== X-Received: by 2002:a2e:97ca:0:b0:2ae:da46:7f62 with SMTP id m10-20020a2e97ca000000b002aeda467f62mr782022ljj.29.1685449846149; Tue, 30 May 2023 05:30:46 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:45 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:39 +0200 Subject: [PATCH v4 05/17] media: venus: firmware: Leave a clue about obtaining CP VARs MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-5-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1589; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=v9h9rG/TP42x17XwYSGnOJ0sfKKqjUawup8lEKzjmAc=; b=J7JzvBaATX4OCVY/zIqqe/aOUY/Ubry8yNokzE+j+EO1Y/vbLIyY1ZtEZo9hQK9FF0fPaY9FB uVJ+94MKZQZAw9fX+nNMzg4Ke59YMQPbMOfbWN/jOFeIbOUw5BDoF6w 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?1767322911560381480?= X-GMAIL-MSGID: =?utf-8?q?1767322911560381480?= The qcom_scm_mem_protect_video_var accepts two sets of pairs as arguments. They describe the virtual address ranges of the CP (Content Protection) and CP_NONPIXEL regions. It is however not immediately obvious how to obtain these values. Leave a comment explaining how one can translate the vendor device tree properties for use with the mainline driver. Reviewed-by: Dikshita Agarwal Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/firmware.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index cfb11c551167..572b649c56f3 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -241,6 +241,16 @@ 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, address and not size! + * This works, as the non-secure context bank is placed + * contiguously right after the Content Protection region. + * + * cp_nonpixel_start = venus_sec_non_pixel/virtual-addr-pool[0] + * cp_nonpixel_size = venus_sec_non_pixel/virtual-addr-pool[1] + */ ret = qcom_scm_mem_protect_video_var(res->cp_start, res->cp_size, res->cp_nonpixel_start, From patchwork Tue May 30 12:30:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100816 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2148627vqr; Tue, 30 May 2023 05:40:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6QKK6AH2jcbtR6IWGlHdiCxRLx2TUYoUhTncj7OtPsKx5MSaF/6wOZhge7pNvexwIY4ptX X-Received: by 2002:a05:6a20:6f03:b0:103:d538:5ea6 with SMTP id gt3-20020a056a206f0300b00103d5385ea6mr2234350pzb.48.1685450407547; Tue, 30 May 2023 05:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450407; cv=none; d=google.com; s=arc-20160816; b=jqozMjjPDn8Ax/banCWqoHI7WTRvLUnyXNMMxMZKFban+uipuYOSgsfHv2M56aBk1C t1OqHRc85ZDs8I/izZU5uoXpPkMWfhsM5OvFEBpJEmTlg1QMYsPxf11lZymDuEAJ3Ynw POjxK9R2JBqmw8B1gVWV/l+YWFAhwUuQmXnwDJyNV/YAiBMmkvtMVblh9i6JSyk+mqPl dYkmBB7+I6QujRoIAlbDLNmofFtQ/HRuSYlJQMrLhPbm6ve3yA2RVn3RI33PBvY+8RNM Kwi9IR1a/0Eh/W2IjoDtsZ+5xly+owBf2mYghyXbixzft2pAhdJ/guplxkPsgCeGFS8E 4VbA== 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=7X2YmPxQFhKCq03fcQ2JuiF4fVCtctwggowl35Zs1sw=; b=ykcUCmKA/K8bs1FCEaJ6XGJGi/AktLk4LUbM3iup2ztYEmV4dtDY2QbcC2A7oklmMx R9CJ1UUwKD1o6DGywlVRUXyNkhd7gEhrItUFb2Wrw7Lh9EnLnGeWcZ0g4Me1ZrF6BzvE xcYIEzQog7Drb9VBSIFuXO5t0KFBu2pz0TbO8xXb6aasVH7uf5Bh9NgQ82ruhCmyEE6r /NLyJ4+LhBHN4/F+4ZW0R1/Dz2xvrq81eXvrEiyPcLdeFz19jzswEtIZq/QzDl/kaZoa KtJZdn/I/bl+KzYP/wi0L5vKqJ8xn2/xEdNaaziUxkheMcy/siFsltXhKhxtJTzRIeEV l47g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ca7h0aks; 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 s27-20020a63ff5b000000b0052cc0b8d59dsi10849497pgk.798.2023.05.30.05.39.29; Tue, 30 May 2023 05:40: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=ca7h0aks; 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 S231721AbjE3Mb7 (ORCPT + 99 others); Tue, 30 May 2023 08:31:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231547AbjE3Mbb (ORCPT ); Tue, 30 May 2023 08:31:31 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1481B7 for ; Tue, 30 May 2023 05:31:08 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f3b9c88af8so5026720e87.2 for ; Tue, 30 May 2023 05:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449847; x=1688041847; 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=7X2YmPxQFhKCq03fcQ2JuiF4fVCtctwggowl35Zs1sw=; b=ca7h0aksE6lqaLTt5whA5LVMO73Bk/YrNfB1jvw8kSNKoz1jpQdCuxhJYXLsrm7MeI xUYIzUzUzmx+3YFLRFLgeufLPCXdFc5VtrVsoJ8hiPV7BJq1Bopei/WX3i6GfJH/ABrv nrjuFMK7hjo4gi/z5deVlB+B0KtkUzKXmhreAYc/sCpv8W6gnyFh9GNXMtoZ+At61SU5 aW3oYNclpB9gr+YFXsctJ1O5dOGiPXC1vHiCJ54KSxbSVzLvGm7TaZnkyrQo++52Zw+s F4mIRjw0uzpI4UibVzoq75I5tURDnwucGlu2Ezr0T36ZrXzEqnqj/wxxs7kJXko5rqnF 1dow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449847; x=1688041847; 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=7X2YmPxQFhKCq03fcQ2JuiF4fVCtctwggowl35Zs1sw=; b=ly9NDrR9iVdpZDllIJGY9hIMxk2bLZ+YpBE3aW0SVcpI8TkdydsvGSxbidvklxittQ +4LCUPggdYJXfMdTokPhtlZhZ0ZzR6BeN68wl9Y6XG+HXpiuSbpdnDwHWTY53lvCVSHC o3TDE6Yc0Xm9nAXHHqWFKfbE2e72hJCSyqOvoM5BNCUDVVpe1ZHxVo6QEZD0CvMZUAzz cf2zf5sdV4z2c+iOqLvQwhWh4yw6yQMByGpXlwb+2Lzx/k1Dah72hxLhNgLfLRF3mP90 vAJeYfg/7oI4ouq6W5X0dPLvs7H5W6UcdZbgMMxYAPzvf0nylQKw++bleLrFUIkB7m1l Hfng== X-Gm-Message-State: AC+VfDztNFlaeCEYzXxEmPRwivmU7lUElW3/LxbdIW6gLt95ftRw4Bi/ 1AzlfphzsA/1KOBg4loSgMVQEw== X-Received: by 2002:a2e:b349:0:b0:2ad:dab5:fe8e with SMTP id q9-20020a2eb349000000b002addab5fe8emr696149lja.47.1685449847537; Tue, 30 May 2023 05:30:47 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:47 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:40 +0200 Subject: [PATCH v4 06/17] media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-6-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1704; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=GIwAiWH9yip6A08qldobhtvjYZiRCRgkhQUH81kLo/0=; b=s4cSpf3PKrrmU9HsxpFz4ai3ElIyaSW/PvhbmUBdDBGfPGPk4wENmhxardXBtfi7UUOAfLG/E XAqhvTs6Pr0DBJz2jDcl7ivTQCp+eqfrQNCjVACGxBjeLc3F+289R// 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?1767322846782253528?= X-GMAIL-MSGID: =?utf-8?q?1767322846782253528?= The current assumption of IS_V6 is overgeneralized. Adjust the logic to take the VPU hardware version into account. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia Reviewed-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/hfi_venus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 5506a0d196ef..9e36ef9076a0 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_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,7 +480,7 @@ static int venus_boot_core(struct venus_hfi_device *hdev) if (count >= max_tries) ret = -ETIMEDOUT; - if (IS_V6(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { writel(0x1, cpu_cs_base + CPU_CS_H2XSOFTINTEN_V6); writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); } From patchwork Tue May 30 12:30:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100815 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2148638vqr; Tue, 30 May 2023 05:40:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6EMw9faYY/TYOnkspWuffbFveZVqGjjWo30EG7S2+JVARwf2kTje2k4sTQl3fnHu5dJChO X-Received: by 2002:a17:90a:ab08:b0:256:5243:6b9b with SMTP id m8-20020a17090aab0800b0025652436b9bmr2361620pjq.14.1685450408304; Tue, 30 May 2023 05:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450408; cv=none; d=google.com; s=arc-20160816; b=nACmwJqtnNO0UO8hFwdjl5VqQZn9PCODcbr5mQ4msl/SiIl6WG9letLhJedrXRcNuN BBOzZxne0/h6Kcddyp8kK20BroZA8fvKDmd45k9g8xl7SZZqrSVM1gYratdiuuCXopE4 l6jXv34MSYe8hplRBdY4J8/0ed5u/psPW6rWWEGTamKQRi4zHIq44rmvl2SLoF5uvhEG nMaNnqvCbN8jZWSzL1VG3limzsxdmZZoTMwitdOCDzkCMkvqQKHydeC9hz9+fBQGz6Ql D7YjUqXEWX49TR6MbjW/jQmw9iAXvagECE9201gs5YAJFtJFY6av8r3YCKT+Xj1JfAE5 /UWg== 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=eyFXYw29tyYHnh7jUZGsXGdVkCfkSlUBmlV0J/bqh7E=; b=PXAabRdPGA045e/KLUIq7ayG0VpmbN6cbnGjokRddHfwsk1UKvQfMuokMxpeRrTVSN 2wV2FzplifwQp6dwbfYydnR31ahZvjMc2Ggei3V+jCBNFFqHp2/iExhcoUavijWVDgKw CdVwVs1esAoXJKIOwIISZ3mQQdR4n3BzVnuzWaxKMfgAcICDUOaPimVUVkbV5v2QNdeM Crh7Z8Cao3D/4bb+j8OdoxVRai4PF5ZS/r+WUEEbEMGcrLG0DGI1bC7a7uDpR5480Vzs EWmdEpFr+a5sU4bnvKNiVGCsA5wFzpuJNdZ4KLVK3aRRCJ7qM6OxpJwj5x83We11gAuH wV1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l29c14kS; 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 r25-20020a638f59000000b0053490e8df4dsi8115178pgn.104.2023.05.30.05.39.40; Tue, 30 May 2023 05:40: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=l29c14kS; 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 S231953AbjE3McD (ORCPT + 99 others); Tue, 30 May 2023 08:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231710AbjE3Mbd (ORCPT ); Tue, 30 May 2023 08:31:33 -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 277CA10A for ; Tue, 30 May 2023 05:31:12 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f3b4ed6fdeso4616556e87.3 for ; Tue, 30 May 2023 05:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449849; x=1688041849; 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=eyFXYw29tyYHnh7jUZGsXGdVkCfkSlUBmlV0J/bqh7E=; b=l29c14kS+E/k9kDpvUSsaoSoMSoOGaa7uEtNOCc+pvtVMZilXyTwYxL5NTdY6zWZGD a3++h1FVa8I4pmXyD5vJ/F70mJDQod7U1OafHsF3nDYxXUDEyQ4fTGUVhcsmc4VDti+p kHi14Enek42nmcHLBjqtIB//pkcSBxOq6mxj+Z9z+xi+UxpPucYbZ7NndkqKhkuCvWUr 60u1xBd81TW/eaugYEDzz7Hb1lIWXCgaoSGzufyP0B9Bkol8NRq6hGzaWNCuHIo5u3p4 ct1QRaR6STzNw/IU2XwUghEQ/FWOI0rxrS1GGqNSGwpwLXnpcdTc8tkDenE5kk1KsMKx xZxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449849; x=1688041849; 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=eyFXYw29tyYHnh7jUZGsXGdVkCfkSlUBmlV0J/bqh7E=; b=MC3UkYspxTlIa7RmDhVCa9Y3Ca/Md2Cs8VOIuGi8oAeCBHTnXqV0cZK0wfyjX8g1iJ dj8+yZncElIf6lqNkJ2UzWqL42oJ5NAD0YJb0AOr0P09uAKjD74PIayG0kcz7QhckR2e /tecrTArRx5OZaWBX+wRCglpmfju4RPzpKmZe4HVDUeiEoXO59AaOu4n8A5NBNmyrrXp a6yABaaBZRiD+CLt2yxGxJ0Y6l4zTBLLI10THHwhaaet1YxLr2Ejh5+MwSyKL+h4f3Wr HbQhb/vTm0il6Jvy+nDX8upINxM+OBRzwprtOC7s6cn/xclhwaiJi31bcMQrifd/OQRD rdfg== X-Gm-Message-State: AC+VfDzk7gApOMxEXaTwPGLex/2jYxGq5nuk+cq0fXsn/WDRqnAZWNcA 6JbDei5q5R2FTncwPtwvl5iYHQ== X-Received: by 2002:a2e:740e:0:b0:2ae:df5a:9637 with SMTP id p14-20020a2e740e000000b002aedf5a9637mr674229ljc.21.1685449848871; Tue, 30 May 2023 05:30:48 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:48 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:41 +0200 Subject: [PATCH v4 07/17] media: venus: core: Assign registers based on VPU version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-7-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=911; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jLkMwNqqG57kt4LLfCZOGle80CsutpLNKoM94v0Cd64=; b=ZadOsG66UgcLTo3X0cHb8UNZN5x0jCBfFaACQBzQpgsBcyGqvCeZtjHcxSxETIaI+Lhv5p3CH vQu9zy0kwbxBgxO1KQD0iLji/JjndvQ/N3nj87i+3d3AMHD4I1T6NlN 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?1767322847228200238?= X-GMAIL-MSGID: =?utf-8?q?1767322847228200238?= The current assumption of IS_V6 is overgeneralized. Adjust the logic to take the VPU hardware version into account. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- drivers/media/platform/qcom/venus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 01671dd23888..69c77b2137cc 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -246,7 +246,7 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type) static void venus_assign_register_offsets(struct venus_core *core) { - if (IS_V6(core)) { + if (IS_IRIS2(core) || IS_IRIS2_1(core)) { core->vbif_base = core->base + VBIF_BASE; core->cpu_base = core->base + CPU_BASE_V6; core->cpu_cs_base = core->base + CPU_CS_BASE_V6; From patchwork Tue May 30 12:30:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100837 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2154498vqr; Tue, 30 May 2023 05:50:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7cCUrbx/nYvxmj04vVb805txrEVNxRaQH7OKYDm8dpxzYD3bYWMlE4dpN5mgyO0c54IFUz X-Received: by 2002:a05:6a20:3ca2:b0:105:4206:7062 with SMTP id b34-20020a056a203ca200b0010542067062mr2625690pzj.42.1685451002620; Tue, 30 May 2023 05:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685451002; cv=none; d=google.com; s=arc-20160816; b=hOdxnKn9agD42YAJVdSdgxcKs/BKyEarT/+hjmx5mYZFmPAZLMwvi0V1QmjPjI4uQA zORZ9bcPDso9Zh0Y0FxaNHss/tlJA+Pk6j3Uo3TYrtmMqtISBh32m2t7TxXPEcm5qziX QP3CSHdsTrZhVFK4o4q0daSI9kCw+L5F436LmwnJM6lq6qLeFvDTTTBgX9TjNY73eMeN WStBFAO/XdIfZez2t0mN+aWcGeLF5Vyd8Oe+3HwDZ0fOvlWcqxbn3l/GUg5WvAFcs2XK QfNUV9JoR8W8jWvVhxS9oDyZ1gBF0stdZko3EY/FuawoesEoLrGA3I90uTfBaonLN9pL DTTg== 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=txi3v40xeq1skICXUdS8mQdkH8Gx8cp0BEFL2/OQ3wI=; b=x9xfVkL0kCQqnjjPNwxaRhi/s6NxiUTJH5w+IHZX53dFdBblYO1Gz7q0obDmm5us/b kgtlmEw4cmsgb73+5EBwGZU9T3IP4eYjUPPjyU/Qf5ItUxMFDvlDlKeQ41axagIujU9J ysXizQlkB4DbSRmmKy/nFQ+pQViRqCjA+1fA3EGJcfi7Vuv9N2dbCNNlII3NoJnwHCiD 4dOUlcmXaW4uj+/CNvcGSCccUnbTTVY/suJVmGi/rG4o+omOHIppeECtCzEWUYYhWwVx faI/lSK7nM/RhCDTEghbsQPlu1UuDz4kMaRmmXGR2l8/W6weAo03iWBGFGK6Ou3oWkFQ G7cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a4GmkCT4; 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 y24-20020a637d18000000b0053f24deef0dsi2091628pgc.312.2023.05.30.05.49.48; Tue, 30 May 2023 05:50:02 -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=a4GmkCT4; 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 S230145AbjE3McH (ORCPT + 99 others); Tue, 30 May 2023 08:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231734AbjE3Mbg (ORCPT ); Tue, 30 May 2023 08:31:36 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C1FBE42 for ; Tue, 30 May 2023 05:31:16 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2af30a12e84so46128741fa.0 for ; Tue, 30 May 2023 05:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449850; x=1688041850; 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=txi3v40xeq1skICXUdS8mQdkH8Gx8cp0BEFL2/OQ3wI=; b=a4GmkCT4FYKvoO1zaqw+4yWcxhEgBiClLH8HcvBwpREQ5avFR9IIYRArPe7tZhG5gE Ub25UHyTPR9LXH4cEDutwUYkwZBVSdy0f/e8w9uArEE2fVfYWOeLlQRD+JI1wSh3PXYt F9VYjSjKypFzWMNwbIZn7zZhkDSFCJfTGyRpd1Jd0KzF1QHYXBShmW4myLELyn9zVi2e b5bktQubb4FMN8SJ+oKpJ0trNhjxlpFf26CMBUg9vHf3owTyd9bd02+8OiX1InGkwS2Z uxE8UZEO5cRrIn5IeP3sdinQi4q4QzWDvhn6pOrCO72CFNsQcd7gp27nvF9wU2sIOtq+ 6a4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449850; x=1688041850; 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=txi3v40xeq1skICXUdS8mQdkH8Gx8cp0BEFL2/OQ3wI=; b=GEnLTFShfUt4Vgz4Iu7gN2qxAvkJkyYoAvDdASCxR8WY0vkNvp83RhRz8T8Pa/d+Dl kJ4ClF4b1LxsCqDUNOhpcYahr+49dmAS1Y9BC6TlUyUba80N+Wwhz+Bg1WdlhhzG+2ST DucehszmzDzqrXgmYXu7y+RAPOy5w51eus9iW5Jrti5KMNvMMp51XnXOVHGsb+82s8te WjVosf+hZ95eqJ62dHJb61p5nnR/vgjtwkhCpHIhaePVPS1GZfBbJo/SiJgYKfTLFph/ lmWd8hIvJTa2gGpETaDLYhJmHZH7D9yLNlmuLgDIKsTvp3l/6r3SBvordk/K6q0owAru w19Q== X-Gm-Message-State: AC+VfDwAHCY3gjmdysfF+gCk/9YmvSqp/l8Tcgos2UrrvZDugVf3OF2o lWTHxFTCOGuc4xDg+vtfPds+tg== X-Received: by 2002:a2e:9884:0:b0:2ad:81ca:a52f with SMTP id b4-20020a2e9884000000b002ad81caa52fmr727410ljj.47.1685449850275; Tue, 30 May 2023 05:30:50 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:50 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:42 +0200 Subject: [PATCH v4 08/17] media: venus: hfi_venus: Sanitize venus_halt_axi() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-8-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1056; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=CwRrKkc56gP78vWbwj31mgvh7BvEJbPxU0vhFKBwos8=; b=1VSC8LRy2Yd6gP8VcoQDaPeCC2ljSd5bhpTsKRED/3emZGSDqHWLGNiYO0Q17KO7iqKjeNsj/ 7CTpQpJKX3mDK80Z4kDPVuxdJt0M9+EP412kVhMcl+BwaI4W89RjpMe 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?1767323470600625376?= X-GMAIL-MSGID: =?utf-8?q?1767323470600625376?= Only IRIS2(_1) should enter the until-now-IS_V6() path and IRIS2_1 can be used instead of openly checking the number of VPP pipes. Use VPU version comparison in both of these cases instead. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 9e36ef9076a0..60252d05781e 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -548,10 +548,10 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) u32 mask_val; int ret; - if (IS_V6(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6); - if (hdev->core->res->num_vpp_pipes == 1) + if (IS_IRIS2_1(hdev->core)) goto skip_aon_mvp_noc; writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); From patchwork Tue May 30 12:30:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100819 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2149971vqr; Tue, 30 May 2023 05:42:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69+dQUU40p/nJocy6os+l5xLOx3Zc3YSBtdCH4bnznWzp8uUthY/rF4VKT0yfwasO5r2XZ X-Received: by 2002:a17:90a:b298:b0:256:2ee5:aebc with SMTP id c24-20020a17090ab29800b002562ee5aebcmr2286305pjr.18.1685450541020; Tue, 30 May 2023 05:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450541; cv=none; d=google.com; s=arc-20160816; b=rTF7nU9b+zwRkHCX8YpAbkLY0adiZZ9HwyBFznjAmb8InD1aAkQiKLSJAwLjOfXBn6 0W7GAvaOenTfrRU+qU7jApEZLMBIPLg4Vbc9aiqVMrC+BywUPkutMV/zx+kQ6jkCMDKA SVQZ4D/i6yDZp3zi3AVZV53BpwUzXSF7GPRRPtg3y/tH+j8kLEYzu3sD33QpH4XMjC2A gSSEmmr89a7DV3JRc7QfaF+r1/tDnFqO8AODI3sgfpo0uDXlU2h/U7gGrr4Bo3QWjjlc 1EoKp5j7cUNZzSe5FEWW8eMhBXvCEw7R9qx+8Q1Wo2WoHAny8ddsaTe38vM6pomlrqIe 6bcg== 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=GHPVGbjJBA0Db5NX5/99pqJA6zhMyUu0sO+jgoxH74w=; b=bWNZ5iVeuSqiZ75O4Lb+8CHhhZPNhQk5P85nL+KOpdYQ+j8rvBEiFpPdwUV/NkwlQw pPXkMomnj8Wg/XIWHgN/r8pBHd4YKJulcZoy4viO+0rHccQAgcVxfMAlea4r5mFxJd98 0DXQMJ4Fnz4lZMBo7KuWNvMPxVGWc3EcOOt8OgxzcBSVmGJkD4As5Z8I3NUDnNUwnJj5 +A63vbWozFMAlec9yTqmvA9z6DK5eKm4D0+aw+/q4GQK6fAwar6bGCEAVZg769VHxmBt zewYcsU7bRn+icpmYACJCEHC+UFgFiGQ1/S2dbZZ5L8ljnLhWZlon/UCHxEsoWdB8IEK /U2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TfJC3WPb; 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 x9-20020a17090a970900b0025620801ed4si4828286pjo.1.2023.05.30.05.42.06; Tue, 30 May 2023 05:42: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=TfJC3WPb; 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 S231986AbjE3McK (ORCPT + 99 others); Tue, 30 May 2023 08:32:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbjE3Mbi (ORCPT ); Tue, 30 May 2023 08:31:38 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C661CE4E for ; Tue, 30 May 2023 05:31:18 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2af2e908163so47238781fa.2 for ; Tue, 30 May 2023 05:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449852; x=1688041852; 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=GHPVGbjJBA0Db5NX5/99pqJA6zhMyUu0sO+jgoxH74w=; b=TfJC3WPbzJ918/gievnznE/ZwcFlBinuavTQ4Po9BfAFOFkKLC6BMvsSMn2bgGAf4F ylbrPfgLRETekQXK3xs5uodxliYY50p5WViq/IErrz2My0QjIfqx2ujNBDWJ3t+waCWs siDh6kOP+1rgfM78KlGJ8yYUHKFaJD1hv5zuNPP30mJGW1gaTMw7UQW68g+E3NeydrYI oBzfAgxjTTudADMPd49sewz211f0wgdqLFZ+XFILN7x+gSRANDeAGft5AKprRqdh/NBb MhhMs8tIQ6PJ2VwWfqkO+cvYFvlsoyysuL6Mxkvn8vl81GoLn/xLheK+4D36WG7SX+Zg GxWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449852; x=1688041852; 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=GHPVGbjJBA0Db5NX5/99pqJA6zhMyUu0sO+jgoxH74w=; b=Xmd3ICdBkUrykoKAOqMIojM3Aw8+5Dfqn7hxeFqmybUjbZ7vLyOG7O0HcYIG6haEh0 AJ8DIJTD6QT2r9ZZLwX+Shc+E24e552sF696V4rJpmmfEd8dfcoXxEg4CdWgJfhISFhH SQBFelcGkiicj9H3U2qcyIMGcnRhdQgqMpOX41t/u6/cE47LOyk257Wry2OzeGKp2RKJ LvNWD6OGY5m69WzAuPR5yZnIO/xfwyod3rEjFd7wlH3asieS2XDDm4CVPB0C9xgL5BHh TtEP45Z7l94+tRF0tOgMwy7xSqW4lNP5B7/OUSDRBaJ7ugFreDMpr8UWmQmRFU+vlL4T vwfQ== X-Gm-Message-State: AC+VfDzxISYG8YTkw7a36DleS2RyuJGyrTJ9cOIBKD+J/l32IQxwfhWT /d8DMX4uYPXOmR09qQlIYu6NeA== X-Received: by 2002:a2e:a212:0:b0:2ad:bb53:8b9a with SMTP id h18-20020a2ea212000000b002adbb538b9amr772535ljm.20.1685449851577; Tue, 30 May 2023 05:30:51 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:51 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:43 +0200 Subject: [PATCH v4 09/17] media: venus: hfi_venus: Sanitize venus_isr() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-9-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1296; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=F378bEBVQejn0ekkF/wJCvXE1cklNHMQZFzTNKZSqSE=; b=6cCLhcsld50rl+TGqoJgykbJLGOa1JqrHParUU3GM6CVGBKnKZF2l4Ix69R/uXef9M+pWNqdG lqI0ZcNJQVoAEA0S4rrrPx/3kk9oYpevUwfT+md++1QrzwrA/dVIYAv 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?1767322986448620288?= X-GMAIL-MSGID: =?utf-8?q?1767322986448620288?= Replace the general IS_V6 checks with more specific VPU version checks. Reviewed-by: Dikshita Agarwal Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 60252d05781e..5e4b97b0a4ae 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1109,7 +1109,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) @@ -1121,7 +1121,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_IRIS2(core) || IS_IRIS2_1(core))) writel(status, wrapper_base + WRAPPER_INTR_CLEAR); return IRQ_WAKE_THREAD; From patchwork Tue May 30 12:30:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2153188vqr; Tue, 30 May 2023 05:47:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4fNt9flRsgpibNu41he6ehVFR6HdnWNvifazslF8Zl6JndByjN4VGhCyVBblOxynp1pC0n X-Received: by 2002:a05:6a20:1602:b0:100:ba96:e5e7 with SMTP id l2-20020a056a20160200b00100ba96e5e7mr2453246pzj.18.1685450861058; Tue, 30 May 2023 05:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450861; cv=none; d=google.com; s=arc-20160816; b=qI9SjY0ag5DkfBGL8aSA/0XAjronF7Kn4zHQCQT3ddn35r7o8uU83obTiBwbWa7OUS 3QwZcMuE28XjGPYfjBoOio80gmhColMNkSFoWbcOWBncha73o8quEDyta76XWq/xrokF lRLDO9/b/TdJFdyDlJ50sO/U/X/mTwV8OvSleT9T+sq0o+d2WMfIoe3FrFvoRYth7H6p T3ONp7DFlN/UXcYH48SO57JE2TvUffwlg/zXwbqQ+fePzstKLa1aDxXr8OdIcYh7Rruw GbHDVGC6DmZXHcxPhm4qTmpYn/fqvEiputeBhKeaZl289GPb01UWBpe2A7vQdYi4u94s zfxg== 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=AuNT9Cruhplaf5M27x4h0WElwFVfgK7TB9z7U29d9j0=; b=HNW0JNldnLJ2qCiFqSATUDRqJ8JtufTDJsZweo+x0Tnvf1WTDXUQduWplNon/p3VOU ArDSn3LEBxFg+ynJKnQ22ZVyEi1OUT1ev3p41CAfOAFVkuDD1WAFkppo5gcDELSGtBCV CK/HRODMtbdipwI335guUeG3zDtSwwCWv5nHQM3DxzbZdYsiYpUBjE+fLo7lwY/R5yuV A4JxJy88SGrwO+Evch5Va5Icv79afdu/oRB4ZCgnIrb31pwWMHR7jbc3S364lrcCcA9K gK/JKWgbXFg9IX9VdpL59TxBikZQLtle/n6G2bTCiw1wHVHKsFEi9AXal4UGxFt3Z0DU FQLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZSD/s6U/"; 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 u63-20020a638542000000b0051b70b1f1f5si549838pgd.608.2023.05.30.05.47.27; Tue, 30 May 2023 05:47:41 -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="ZSD/s6U/"; 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 S230289AbjE3McU (ORCPT + 99 others); Tue, 30 May 2023 08:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231822AbjE3Mbo (ORCPT ); Tue, 30 May 2023 08:31:44 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A7C11C for ; Tue, 30 May 2023 05:31:26 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f3a611b3ddso6782860e87.0 for ; Tue, 30 May 2023 05:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449853; x=1688041853; 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=AuNT9Cruhplaf5M27x4h0WElwFVfgK7TB9z7U29d9j0=; b=ZSD/s6U/hvVdc5LUHI9NZ7bNxid4H+oOgpkQ+CQsqoYdvS5cHRSsdsqOGcZDPWZc2U 5bDU86pAFGD28wDDe3ivik9ncECfrBVhGl0/jUBJLoI7FYIBKVZzBRjuH2QJVwGc0Aqe qU2a4SfRWbVO48pRWDqj6ZVnyXWefwOEksKRR+/1Iseh45s79x5k/gpqHdY2IESnJ7j7 SGJN1vAWlLnBL+lYQ+q5FOfLm1ij1XV3BH4CZqGyxPOxo76UKbaUti1QUuVWXbDRgPUU uU8Dw8PLPgeIXGnmgzac2UZ7y4W1RVAj7g/62xpN2s5dp0NNzScwF656OAZ2OFv0auaG ua2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449853; x=1688041853; 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=AuNT9Cruhplaf5M27x4h0WElwFVfgK7TB9z7U29d9j0=; b=Q593zYH1bcso9BOQ00FdLm2CBKhBEWrktCXeLOoLC55UiR6eE+5B+CwPWR0YII96Qp zT+ELdvkICigthq8gxCaQo3aOYW5VHETLLEozARmO8OfPTmJU5QQFHhw32rx1dCLveOg GIPT/FTI/VGmgt512LzTMDq1L3swYIOz+J7DveHT37lrIen5w2CuIBxCDX9M1RtP5Ws9 rXGVn8FH3lJ3FHi1s6QRg24Cl/Exs4DzgpKVsltJrSwF+aWgbF4Kj07iOwsMC7MR1kiL KHBvCoovSgd695KB5HAAYRdPcfvxqtN7/hZEOaHo4ace2V+kwXpzg5EtAWhJtKA1Po9z 5MCg== X-Gm-Message-State: AC+VfDwjmf46lyHUeqH4uZXmnDpXeLJNAykilMs//zVbzN3XdWX6N+Pq xQSltPSlvsWkPDJkqsfZGsFXdA== X-Received: by 2002:a05:651c:32c:b0:2af:2965:8f78 with SMTP id b12-20020a05651c032c00b002af29658f78mr3477894ljp.12.1685449853629; Tue, 30 May 2023 05:30:53 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:53 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:44 +0200 Subject: [PATCH v4 10/17] media: venus: hfi_venus: Sanitize venus_cpu_and_video_core_idle() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-10-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=915; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=rs7GlV5yuEvpX7uzQTE/PpuhYQ091SJv7fj57bpy7Ik=; b=5vCoXTz9cnFhoxI98HGqjp6z1qPYbBiZjNhWqTzvtukFvbllkKQ8MaUBoafM4wRPQKdBoCR+i W5DZnz3kWcoDVaQiJgHysPReShHQxloTA7GwTU7cHFnyBNtzaHTjLBa 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?1767323321818057048?= X-GMAIL-MSGID: =?utf-8?q?1767323321818057048?= Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 5e4b97b0a4ae..b5d7aab03bca 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1516,7 +1516,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_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); From patchwork Tue May 30 12:30:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100821 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2150233vqr; Tue, 30 May 2023 05:42:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JmeX2n/9ahNnLaPfm7P0/AmSXAYIuCziAMN8sgkoYryfgkahSINZqyI3qFES5nVp3ptqi X-Received: by 2002:a05:6a00:13a7:b0:644:ad29:fd5a with SMTP id t39-20020a056a0013a700b00644ad29fd5amr2895158pfg.21.1685450567054; Tue, 30 May 2023 05:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450567; cv=none; d=google.com; s=arc-20160816; b=TD/sZaOS30j+psvDrKmMae4oHUOW1SKp96Q77dgOYFolERNXLlZJghklZBNCrYHXnd vVislYv8JBmiVwp+IEjwDSsBkyAzJpQOwALHnLYvZL26qf6dZI5g9mVJ+JmF55V2VxNQ Rbuau/WxwuPVj/oEpwGcdzg+VEgwULrVu053EStokEs8bpHR9Dg8jzKTQ2NdGa+Mv1yM M24dNnGiTLIeB9lfXlrk0GfrW9WV+RMJCe1Y86eeRB+7v7eZrEl5zbJ7mkNS7xNbLFgz VIwvyrZRMYd1uCbB7ybQhXfO4Slez2lFwAo6J2w18+KgxgV6bSZAHVkV5aXLgon/ByGq OHTA== 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=sFh246SoG2jAhae1NbkulRcn/T0bmO2nXKY2ZVK5ddw=; b=Viub1RnRU9hah6xcSUvQRAuXdi7v9DWL3Zg+UqwAdCuqj/k/0s3NK987pXszB98g2E 0gq3MgHOyzf2+08ODwBiPUaeAN+H/ZhoRiGnurHnwH3DusvJuz8B2XsN8p0zLy+9FWDB ttp7HfAYF0fDGQ8u0e00c7tlgCqXY/ih4s1Vo7V4FMxcKXCrhpwS4ZLGJXBsTP4L8lyE zQtGeDyghdS4oG5KnOhXvTRIp7FHN3xxxZDVaJrW56cRFpI5UcPcaTy4JV+r+eFonFhr vpsRnrwgLOeeMsWGtfnGFs4K30rBO0XT1hyHIhPutSixI2q+P6pBLpowMyx0EtTp+G3w tgcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kzsdELY8; 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 m67-20020a633f46000000b005303a7ca051si10995061pga.284.2023.05.30.05.42.33; Tue, 30 May 2023 05:42: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=kzsdELY8; 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 S231993AbjE3Mcc (ORCPT + 99 others); Tue, 30 May 2023 08:32:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231920AbjE3Mb6 (ORCPT ); Tue, 30 May 2023 08:31:58 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22C7C19B for ; Tue, 30 May 2023 05:31:37 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4effb818c37so4739194e87.3 for ; Tue, 30 May 2023 05:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449855; x=1688041855; 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=sFh246SoG2jAhae1NbkulRcn/T0bmO2nXKY2ZVK5ddw=; b=kzsdELY83WMHUr3TgkmSvPNGp5L7NnLmYAy70Y9nga0RiFlkzkUvLCvQkDD1VLFwGT jX8Gk/l9fDOkKAuG98Kk27xM3S0QrgxI+cYP4Hl63IEhoKLrbrCMPrnhHsWEW2pwKfnF m2tW12N+fqxGkCnUWSQ1qBQdopPew7WBCvWpf3Z5GYic05Y864iIBSzBct05tBlaQ8uD uTMEb9LjpxdVmjHQEeFrCbmBSqrR52plkHAaqDaXN9UqOf8ETaFl9o7UVA2GWF3j5w2T g0tJWvXM4eRU4slDIHLOpdJ/wrzzUseWg51dddjydoisxqEF9ju0+ZErkdQLMB3YUXrU Eeqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449855; x=1688041855; 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=sFh246SoG2jAhae1NbkulRcn/T0bmO2nXKY2ZVK5ddw=; b=aJ6YkIlKQSVDzsxL4lDqaAhUkGiL38Hh3s8o6djcjaMsSH8JnF1Kmn7j9gKgB/j8ZO uPuTlysRHfNFcEvDgWKqOAzlBLg+pwif6eW8jDQL4U2XtRTJ2Fm6xTklvzdbpONUkTh5 ODSSzMKfXbQmrgVGyHfFE7gX7zS/L3AnD8ovVi5ivA1+CofO+Z4wkoC383A+t0Dx4LHy KGs/ueBPvx2L/fz2QoJ7Gljw6sOXiUKWGSJ/nBfthVeQIEXIhWGHuLYleDOhI/1jeN/e 6kATY4ExrxrtqzW9YRzcFof/pOTgQ26ZboxBZVQ3Ljw9+bz347gIgyqZHeFucSASgCF9 JGww== X-Gm-Message-State: AC+VfDwDtACsSgZoBDHezwex4nLMOGKes4wi9eXuQDr+jHFGK9PYX/04 PDt7asyCgZkqQk+C0LACGAF/ng== X-Received: by 2002:a2e:3a04:0:b0:2b0:790e:95ab with SMTP id h4-20020a2e3a04000000b002b0790e95abmr679359lja.31.1685449855058; Tue, 30 May 2023 05:30:55 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:54 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:45 +0200 Subject: [PATCH v4 11/17] media: venus: hfi_venus: Sanitize venus_cpu_idle_and_pc_ready() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-11-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=913; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=dir0ijhcjSzkrYz9ZlGYapAdRHdLVbJO06zeci6np7c=; b=wmAExUeiOkcUBkOn2uQmzgB+NkMlejP+e/YYR69HkfqIy+ssD9bcow7EML253GozmhgB2BqGf f8sqybGMqZHC61+jX+8T9TL0s7i5+cweIwY77aIPQjuGHbOHaNtEMAr 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?1767323013560005803?= X-GMAIL-MSGID: =?utf-8?q?1767323013560005803?= Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 b5d7aab03bca..82854553f99e 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1536,7 +1536,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_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); From patchwork Tue May 30 12:30:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100831 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2153243vqr; Tue, 30 May 2023 05:47:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7aXfVAvBT636l56KRK/uVKjCMCnIADa7YXfAXdc5Ao5ukDTNEIHQ7pAutcVIy1F/k/Mrnp X-Received: by 2002:a05:6a00:15cd:b0:64f:bcc6:9096 with SMTP id o13-20020a056a0015cd00b0064fbcc69096mr2529781pfu.1.1685450868360; Tue, 30 May 2023 05:47:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450868; cv=none; d=google.com; s=arc-20160816; b=zl6icw9oiZORg9cxPnzJ6xeWTpzdHuu1nLrI2Bupu/0YuQq/pR8pCGaPn0NMMzqcVU 0H3B9Y2ldXB6DxzjYn4wMZgbf8XwIQsjSr7gCmRycLBf+nyAD1VrEIV1Yp8ENz9hgrGj T7U3wDVbuHor95OGt5MtgtXq+xSxldjvxvMeqWiEMG7vnuVUx8gW6soKzIIXlMGHinWG fyOtTMhqi9IMWYNb8925TVJ3lnt4RsPC/HqLeWf+mu0Sdx9wgPeRdRQUMEF4pLVyuxkl C2L9XkBg4OSRuUeQKn1pc8WgMD531pLt1Nj2hdkVSFFGsCAV4JIK+Ui9tDTgw4XT9h3n JStA== 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=SyYkzqdDCC9q3w7GHxMV/UafzmkX5Zjo7MaFjCP76O0=; b=T6b0DrQE900jCEZLAkMYy1L3XpKuAHMGJ4sKdWbGqJhuxQfvuQmEb/6ZqxefvUxZmO 1Y3g59TXmpjdPFrFnDJMp2eWMc2bqiu5/T9wm/ARWVtPT9EbLHg9A3ZerrXqAm7OieE3 sRa32YvdpvMW5471/1HbgxPpYL0ePxHHNzM4uuFlogM/7nrkTpPwMKases+M7QbKPvyF uS/GFtoHNgCcUy4SDILi18hEycjIfJgyb9XiD7mUa3vKXi1DI+58FWKY3KT7muptzVNP jzsFj3mMFppxvzkBUB+9hT04DDWjdCs4gAxHN9ArRJzfW3whyhheUdtqMeYAEctLr54t 0euA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ODHH2/xi"; 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 k22-20020aa79736000000b0064d6a4089e1si1671418pfg.182.2023.05.30.05.47.32; Tue, 30 May 2023 05:47:48 -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="ODHH2/xi"; 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 S231996AbjE3Mcl (ORCPT + 99 others); Tue, 30 May 2023 08:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231481AbjE3McO (ORCPT ); Tue, 30 May 2023 08:32:14 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1835DE61 for ; Tue, 30 May 2023 05:31:41 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f3a9ad31dbso5037695e87.0 for ; Tue, 30 May 2023 05:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449856; x=1688041856; 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=SyYkzqdDCC9q3w7GHxMV/UafzmkX5Zjo7MaFjCP76O0=; b=ODHH2/xiyrQVGlpxEkAyEQnT7M9/CCiIvDY7IH8HlfObOxLHSzOrz7rMm9tBJa+aHK osZbEmrwGlnpFnyonLf4jMuRA/D/CZ5M/asyNGSHtKLFqyBrrMuhcBrs8G6Jz7gx6KvA AoFJ7TBnr7IPH35Xu9xNOlvsXH6vEmAF+1A0PGZBi73HS7CbhQ+9VQGqE9V1J7b3rv5j dVwBI1U3261i2jOJGnh53jPbGUEn/wO+5tQWdxIxUu2a8d52+uFAiPNjIwe42HZINnaa lPmTdqiUFRAAja98C90flRDXM8CnKnlGMGVW69bIRWdazZKW33UFwywHaWYj4idoPYMJ Kgfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449856; x=1688041856; 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=SyYkzqdDCC9q3w7GHxMV/UafzmkX5Zjo7MaFjCP76O0=; b=by+Ud1srzTCljRHYAqCg2MpAHR5kv+s7iqZMqxRQYQTLZUlPgAniNXmRsU1ob8u0o+ QGbBRn2pRMNkA/ElXGpCNl0u7uTFc5rOvn61PIaHMjHHedny9JwPppByD76ayyOHBdaV cFx+WL3HbpNdq3E533zYFFT5AqTZBSye5JXFSa7Q2dugxbRQGvW+vZ1kamijqERttfEv JfDgalSapoBigznGZz8NYTJUga7Q2hwg9en8QuKfvolXwBlh4GU+tL4VHovmfJEmvRen gaFeOvbkXiu+cOzDs/Ybw4I9NHITZXTE94vjOP3Thzp/p9MvfVe+NcnLzC2IDLhQ1G4S rS4w== X-Gm-Message-State: AC+VfDwdNgB1oDNBDt6PI9GJEo+BanF/aFvuUphS/PCdoazL+utmnBg6 bvc8kOl6alUx7kKgQkmkfjL+1A== X-Received: by 2002:a2e:8792:0:b0:2ad:87b3:7d62 with SMTP id n18-20020a2e8792000000b002ad87b37d62mr623302lji.46.1685449856399; Tue, 30 May 2023 05:30:56 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:56 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:46 +0200 Subject: [PATCH v4 12/17] media: venus: firmware: Sanitize per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-12-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1814; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6YgBcnk5wJmY0h2UMmOrskDVPO7haGfbf8N3hZu0IXY=; b=nl3wP2X7tsd1Tm4R4+AGHUVOu2PspKZpQYRq5zaAqrZB1Dyr/OGl0Ou1UGxDWP/yzbWOGvsZK VpC3CTm6zapDgzGxt1BQzPtHT6RhUj1pET2XntH+Dqv6b2r17VWyJQs 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?1767323329796097534?= X-GMAIL-MSGID: =?utf-8?q?1767323329796097534?= Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia Reviewed-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/firmware.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 572b649c56f3..ef07eea38d93 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -29,7 +29,7 @@ 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)) + if (IS_IRIS2_1(core)) wrapper_base = core->wrapper_tz_base; else wrapper_base = core->wrapper_base; @@ -41,7 +41,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 (IS_IRIS2_1(core)) { /* Bring XTSS out of reset */ writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET); } else { @@ -67,7 +67,7 @@ int venus_set_hw_state(struct venus_core *core, bool resume) if (resume) { venus_reset_cpu(core); } else { - if (IS_V6(core)) + if (IS_IRIS2_1(core)) writel(WRAPPER_XTSS_SW_RESET_BIT, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); else @@ -179,7 +179,7 @@ static int venus_shutdown_no_tz(struct venus_core *core) void __iomem *wrapper_base = core->wrapper_base; void __iomem *wrapper_tz_base = core->wrapper_tz_base; - if (IS_V6(core)) { + if (IS_IRIS2_1(core)) { /* Assert the reset to XTSS */ reg = readl(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); reg |= WRAPPER_XTSS_SW_RESET_BIT; From patchwork Tue May 30 12:30:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100814 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2145269vqr; Tue, 30 May 2023 05:34:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Dsjb31HPU+hNecTrD4DqU7Z5KKaU9xjjhhc4O4TR6jEOK5Ne0sjtukvgi9nHy/yS43XwA X-Received: by 2002:a17:90a:43e2:b0:253:6b3a:ab1e with SMTP id r89-20020a17090a43e200b002536b3aab1emr11948525pjg.6.1685450074116; Tue, 30 May 2023 05:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450074; cv=none; d=google.com; s=arc-20160816; b=ZOr1wB/rUN+pz+vabO3e7w45tMaOFa5FvunkANBWJv+Kjyr9nEclc9rjhmzF/6S3bc Acb0G3FHAS33mWnhkiqG2dECPKQnaVLxv27PU0HJSyaGbulmA200XsUwsg4bRE04KZ9B TpJ1K2TgG9Ba8JV3u6yleh7iKsku3h0HdXu6XaPuXpHY29j4yuFsXfQENMLes3feyBDJ kV3/l/kjh8EKpRNyfRRDVIfXekUodeNOli4G5dAAef4lUsb03Yz1PlA+qhNWZ+nSc4Tw 2dcjnLBgiGpgQomzRN0pbAs/ea8q2VZaoi8hi478RXa1lzzdRYSoIIxT7pKXD1za/chB IOYw== 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=NCbmXotl4JHp6511qJyB6cem0LHm1+AqjQQ+gB6Kt5k=; b=GG5DIiS6uWk2DZ+DbSIIZY+wXavS4zjTN0F0tH36KEj+hP7L5thAdUXwBgFu3OtfZC tj3lWCkDnQjSIvp4oCcu/1P7Zeyd/QyBMJjCz1YPQSZ2g4ykNYpSgQM0agto2WZuGoQK dbM2lBKQ2RHdWXS70G3ZkXkcZebEKnHvU4RuyIcbOLRkA/5B4J8OhLwkZoH27UQPBThq aSOXmJ8mbTjVi2t5DAx6o9wqAhoaUamsAnqBKEmbln14MkYtTOaYbGgGht2vXoU+WxEF zRdAFl2ji6sO2pKhdTBFb7/5i8ebjUf8EFQy/bhQ/rFz7Y8S93RKqBeB0NBTlLAcyJ/P 3NmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SCYl3pwq; 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 i123-20020a639d81000000b0053eee173732si5787216pgd.161.2023.05.30.05.34.18; Tue, 30 May 2023 05:34:34 -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=SCYl3pwq; 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 S232009AbjE3Mcr (ORCPT + 99 others); Tue, 30 May 2023 08:32:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231422AbjE3McW (ORCPT ); Tue, 30 May 2023 08:32:22 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 257EFE7D for ; Tue, 30 May 2023 05:31:46 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2af20198f20so45020901fa.0 for ; Tue, 30 May 2023 05:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449858; x=1688041858; 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=NCbmXotl4JHp6511qJyB6cem0LHm1+AqjQQ+gB6Kt5k=; b=SCYl3pwqYVglWX8Xi1vf6uiEsmGVPsuG8y5duX0ElHDXSNbjgyK40To93hnzuzqt1h QlrbquLEwsBRqv/zM2IcLd4ouCkstm6p5oTwH+sEwVxK1c1vFQF8CRBVAgNGeiY7yyo9 YUKh1eAcS8qF618AYUauKFWz1se69Hro5WClNfF3f+e71/AZPsS/KyJDo2zeG6QRawBp TGmyj6dNJYnm4WwFxz7EDT7wb8zafEoP3tjKaq0Yz1hUKQ23Gq30j6V4KOtbOQgY+Xeb ocZno5DSYZ7jF+A2UNh2kwcdgSY6eLCbwsiTVlnOGc+wKuvsf1mAsNRTrzDd3dwmqtiM +0fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449858; x=1688041858; 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=NCbmXotl4JHp6511qJyB6cem0LHm1+AqjQQ+gB6Kt5k=; b=bypuN2B1fetTHngv3W4sAdGAqx3fQODUzaEIUCauHh6O7u3P6//pb2ThXlP03ds3S/ UwgIZebpFxEfCQyEmM1R1IJcud3WWWHbatzdcM9ZVVdaYNkXNK3Ee2/qDI+MKMrW9fqq kIv25OsUaG2Bq/wbaEi1D5GsHcjuVVgCnVUOrYbttWVHE+3+265CO+/rR1IgMh++4wSR nrTw6dDXmqhfEwBOGvmyQGUdYFLG+XvWAwVkWvf6llL/MOa8a9v0SN/WBuoW9kWJ5CE4 d/wvWx6OYjTN3rtrXLqlWSbzrMCHaAtheyt1ZZusryBXVtPM6GYP4PpghGscWiKjEwOo qy3A== X-Gm-Message-State: AC+VfDzwuETAXYyR3JRNMqYD8iojX6YYS7aDf0NO6TsNP8aPTLD1Ra03 nl7FpykZob91aSNPSCKdaBgrLQ== X-Received: by 2002:a2e:98c7:0:b0:2af:23fe:98ef with SMTP id s7-20020a2e98c7000000b002af23fe98efmr657276ljj.50.1685449857841; Tue, 30 May 2023 05:30:57 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:57 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:47 +0200 Subject: [PATCH v4 13/17] media: venus: hfi_platform: Check vpu_version instead of device compatible MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-13-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1007; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=EUWf2T+I6vhFizSQGtxC124WvawcGCVn6gQZEf/m3uU=; b=yQW+ZmcZHz0nTsrcuohrVTl7N3UqRQ2dZPoS6Vn/18F3I0gbau/J1nJ4vwL7mmALeRZAAbw8X mBO38SlEvptC2xIm1JDuMfvGDzU4kZDGulCD008OT+2p3bGD79hL4L8 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?1767322496396714496?= X-GMAIL-MSGID: =?utf-8?q?1767322496396714496?= This is not a matter of the host SoC, but the VPU chip in Venus. Fix it. Reviewed-by: Bryan O'Donoghue Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/media/platform/qcom/venus/hfi_platform.c index f07f554bc5fe..d163d5b0e6b7 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform.c +++ b/drivers/media/platform/qcom/venus/hfi_platform.c @@ -80,7 +80,7 @@ hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codec if (plat->codecs) plat->codecs(enc_codecs, dec_codecs, count); - if (of_device_is_compatible(core->dev->of_node, "qcom,sc7280-venus")) { + if (IS_IRIS2_1(core)) { *enc_codecs &= ~HFI_VIDEO_CODEC_VP8; *dec_codecs &= ~HFI_VIDEO_CODEC_VP8; } From patchwork Tue May 30 12:30:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2149602vqr; Tue, 30 May 2023 05:41:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Ni85NWwu2IxzF1W2qCm07nZnq/2Zl1lovm6POVuTWLyginjRBDCnrkhNglqpqYdtEIcE+ X-Received: by 2002:a05:6a00:240b:b0:650:154:8bd with SMTP id z11-20020a056a00240b00b00650015408bdmr1322263pfh.17.1685450504154; Tue, 30 May 2023 05:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450504; cv=none; d=google.com; s=arc-20160816; b=kxdrUEMX1P5baV83F5h7t4Ozg8RVIujk78q+kmm4ANsFO3pxOJ1xpjPIMlhjIHlmzp YZjrkDiHHI097vhRY6VbfkYjA/NEdGb/lKAt48OB/um9/KRpwRLxEDY+CeV3hs+p9Y93 FoUO2u93L+xaOEvyGV/nhk0j91yGoNghoulzjuj3wXIuSFm7ESrVwYw2sC2EmxL+su44 z5pcQhIifGvqJbNoijpWa/HDvpwy0r7wSMXq3gOgXzHNtA8f2yuOA0ry2QANIe+cBOw7 LviZFvnA/wwjfJ1bc8V/eaFd245cRE/s2ruIINn8HLyFjNs36Ep9GhTRzo3jDqbENwJz MK2Q== 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=YRnWjbY4eUpy9oiw3Jwu9xibfYWN+hzyctbtgGIUQYc=; b=R1tcTtGeZQnvgPENwaid/JHWhhfvuHXF9h3sGEkD7FxT6CmSzJBIrCViKZYnBmOiRF QtR0L5nL0Sx1ILvZsBF1EIMlGC/OD6MXf39W/9PKFmQSHRpw3cgNuXyzi8T1+gWnF1Ap gU0sFH2kpeEpDgoKDjrXTFdU5Ny8Gm3rwkMi6QDZc22ur1dBqajIj9trQcMYBwpiwc8p ijs3zE3oxiA75PrW7ourQ4dVlZ9hGPSAufwcD4E67sPi8YWWFC7Ka9wrMCJ74clqOmNG I4GOfY/NNkhlzCUBZmlCLma5Obnz7E/N4Cgm0R6TpMReen7GdnMclaqUeZau4gOni+Sl kTLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=km8NCG0k; 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 h191-20020a6383c8000000b0053fb69cc365si1032046pge.238.2023.05.30.05.41.30; Tue, 30 May 2023 05:41:44 -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=km8NCG0k; 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 S232071AbjE3Mcu (ORCPT + 99 others); Tue, 30 May 2023 08:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231443AbjE3Mc2 (ORCPT ); Tue, 30 May 2023 08:32:28 -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 48B1F10CB for ; Tue, 30 May 2023 05:31:49 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f505aace48so1902442e87.0 for ; Tue, 30 May 2023 05:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449859; x=1688041859; 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=YRnWjbY4eUpy9oiw3Jwu9xibfYWN+hzyctbtgGIUQYc=; b=km8NCG0kZRfT8qnXV6rt816QmQM6EzBrPUyMg/8X0Qr20WzDkXOjCU7Y91USgTWtLb GgFdDM1fjtSmww+I6XUIooQ/CsrRU7mjNBccf2n9qQKkc49EOczsxb1H/wfWNMloap1b TkBf6jtSH8/j/HZ9tVDKwBbKw9n96BZC9rN4H76OsenTbkN/fTFSIsggrq/P236jUWwq xO2mV5FfHag9y0Ro8kJepCgpa3E0a/IJFn4bzC/dWo1L7gyMomsqh+GNyPpJzr5Dn8n8 qU5nRabs7Xg6DvMFZBHSkSE/NFS4h3qQy58qvCpdQlxnQ+k6t2DazBNLMcCExK6FeZ7j kRjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449859; x=1688041859; 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=YRnWjbY4eUpy9oiw3Jwu9xibfYWN+hzyctbtgGIUQYc=; b=dDdwzJ71Q3X97Jj5yajr8fx/N6Z2Cx5VpcX9+bBcfzN4ZkfEIqzbn4VphbnwMWUUy3 lEW4/hzyNwHgS14F+66lM8Zg/YcDIS3xqhR5a2uIZCFtFflpHkdS+AUKuPLUI2dzg5wa a31zR+1xYIC9FMRMnktXWpr2Tv0uynSMv1SdBMxLkOqQsNVDwUmhQ8BpJqeVRYRKStRB lJ1jKprl9TazR2FHpAOYu/AMiQe8C/VLQyIIN/7wM7lGzzxNp2ARzVRgZhPPM35/fOVy 0sFEC+JjsjjYmXiMMFyNkZZMu0bUIbUhM29AciciCpPeu5cyPsK0yzLlEKIC8NPpO5ay Apug== X-Gm-Message-State: AC+VfDxVUE28tqpQ3nUh/TTtR/LMYNYY400WG2redcUdJPVq51Jleemm sfgZSEs1KIQMrrFpow5wUXOQ1yTC07+LJHTKrqA= X-Received: by 2002:a2e:b1d3:0:b0:2ad:9751:8d79 with SMTP id e19-20020a2eb1d3000000b002ad97518d79mr695211lja.31.1685449859370; Tue, 30 May 2023 05:30:59 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:59 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:48 +0200 Subject: [PATCH v4 14/17] media: venus: vdec: Sanitize vdec_set_work_route() per-VPU-version MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-14-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=867; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=VGY5gPiqtp3BTJb/zA96U45nnyM1YeyDLDunCuTDVFE=; b=QkUtZtfy1Bmq8vawWj2OnYkiTfqBytb97u4bsYds4a47S03RWHQbiGtpEXfmwIrEFCOjZpjN6 SIhJpleXbiKAayuh71xUgC5V6dMI7JDvUCOsO7rCTthDQChW+drW2bq 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?1767322947411662782?= X-GMAIL-MSGID: =?utf-8?q?1767322947411662782?= Replace the general IS_V6 checks with more specific VPU version checks. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio Reviewed-by: Vikash Garodia --- 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 12a2e99508f5..063a8b0d357b 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -727,7 +727,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_IRIS2(inst->core) || IS_IRIS2_1(inst->core))) return 0; wr.video_work_route = inst->core->res->num_vpp_pipes; From patchwork Tue May 30 12:30:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100838 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2155051vqr; Tue, 30 May 2023 05:51:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7AGXUvlsrM2xg5MximpOfuYpQtfHBIdS16CBmhaMmzALtB57yLTmeQ1nHNKsgebnHCw6rR X-Received: by 2002:a05:6a20:748d:b0:104:d7e6:a8f2 with SMTP id p13-20020a056a20748d00b00104d7e6a8f2mr2839190pzd.3.1685451068235; Tue, 30 May 2023 05:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685451068; cv=none; d=google.com; s=arc-20160816; b=NVmWi2rLCnVoxCvVnM0XZrStGsMXxoxRPGv449VeRwJojgegWWatCKEuQLmAujwvp9 5xFjw5pyibUn5T0njHzQ/wvFvRe2S876Rc0fUDNJqGTcRNLjJCgdRBruM3fECuPIu/8D aifJPhCcOie+5u25vtS8nvtEee6dKGAR3Sbyf3eg8jU2LDPuUn40xXmjXRxPZvRnwzTI bPb5+B8Uemouty3FuEGUF1ZWVWVbAUVnf15n7qFN11kCA3i4jPXGXLHYWpXbcBD1JJSI ow6vjD2qyHkDoKTvWoOpOBrXRQ+FmSimRDfGnK0i3K8TkLbrUXGUWGM/s6K58aTbo1Df LI3A== 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=fysaOYiCjviYo83FWRPC+oME16aSTNADlHkhbO2qk9Y=; b=b/Oau/VL3baE2G8ABHlbX87UDNbdABgyXUiTOf7IEDjYnOoENJxBgeZVxEBqcOVzkX HObJrHK/fSj5d7TfBMSHz9VFs5r3CTdybwRkfPBC+2Z/iykh6ToPSOkQgB9Q4dL/TMqr REzrrFPfTemjXIADC+5UvT9A5qQMeJe1Fukwfyj1SIhSldzn0fUcUSSj64Y/oCf8al64 decOpYQtYI647BfuZ8oiRMDr/766N+MPTj5m/DQBeOwv4g3iMzlbxIplBZhBgMSvW8ip fW5dOmyzn/mvpB7c2QmlhgjqmwxSYAHSs24Y6yjdskpBtg8UzKmpxux+NO4haSF+EEOa lJyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TMi1Z8Rv; 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 z24-20020a637e18000000b005347d6bd7eesi11379456pgc.141.2023.05.30.05.50.53; Tue, 30 May 2023 05:51: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=TMi1Z8Rv; 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 S232019AbjE3MdD (ORCPT + 99 others); Tue, 30 May 2023 08:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232022AbjE3Mcc (ORCPT ); Tue, 30 May 2023 08:32:32 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6597D1BF for ; Tue, 30 May 2023 05:31:57 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2af98eb6ef0so47169231fa.3 for ; Tue, 30 May 2023 05:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449861; x=1688041861; 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=fysaOYiCjviYo83FWRPC+oME16aSTNADlHkhbO2qk9Y=; b=TMi1Z8RvFyyvaVXE2GBU76CzOngLAQnbnL1weWU21JeGcVhlw2N+g6FXtyXhYC1Kxg k4mp5REQNtrvMkDxbJI/EHklFm2SHxIPhiiZxjt5gkaYCBar3Mz1aV/8oSapunVT61KD 7gT0W3K9+OPVM3nAsZG+gBjeQBfRP0rijsF9RLe68PET7d1ZBuImHjhIKfqXqqZZAP3Q iiZVLAAminVAYskLLVKWkh4ZLDTysLcmV2uLYoAAcZ0HC3JXWjzkXOoFKbakaqUUFIDt Y2bt0cyNQ4GzluW3lXdDrOMGIvreh9g8l9D+1BEIRmxNej5BFNocKrNYmXTYSDA/hMAm ZNbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449861; x=1688041861; 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=fysaOYiCjviYo83FWRPC+oME16aSTNADlHkhbO2qk9Y=; b=UJf7VjQEpDk242BrKOZ51HgFyKa+s+02LgsmICdMFZEnMZRdK3NMYqjn3a3k/xNspy oblEvIFvht/WxHLd58WjGBbZN5EgI0UvgEuvO6ligEHbZe0ZTqFflKX29PIKWtusWvW5 9KmCli+IAwkTCYTPEKnc4nZ6c7OGALbmySU6foaqPIPODF/plLjsk+3Weuy4oqVmuTbF BaHXJYoLd3IefuipxK+a3euhtaCXjIeG0ggEMWgWks+Z9EEK/+A+8NqePcSBJp6pEOue SvgQpHJZ0a3wt+2qeWo1DdEqVs+fCKTtpOkYmRzZbJcu4ZexM0JP53hh4xrNJs9PhRJn yOpQ== X-Gm-Message-State: AC+VfDxoZi6WVla5B05/fsKhri8K261E/lZxl1dIynkcDImh80PgDff2 dSxdrMBb0LFehjfNhwXyUAilXA== X-Received: by 2002:a2e:8895:0:b0:2af:2494:49ae with SMTP id k21-20020a2e8895000000b002af249449aemr710197lji.44.1685449861206; Tue, 30 May 2023 05:31:01 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:31:00 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:49 +0200 Subject: [PATCH v4 15/17] media: venus: Introduce accessors for remapped hfi_buffer_reqs members MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-15-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=7633; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=aA0naIs45zu3yNzQJ0HG4OVDJcjMhRj/HvlsjYQeb50=; b=/inUE1GgKPnZpyWe2gXCYBfHan/3lP2J8Zy/ajrDuYfv3sVd4GrBebFlxjZ3xefS1fkOVN6mL NNrlgzleL7vAGk/HNAD0BOzfGmE8A1x12waiLuYruLiAv4eOofkdITA 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?1767323539179878005?= X-GMAIL-MSGID: =?utf-8?q?1767323539179878005?= 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 Reviewed-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/helpers.c | 2 +- drivers/media/platform/qcom/venus/hfi_helper.h | 61 ++++++++++++++++++++++---- 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(+), 18 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 1822e85ab6bf..b70bd3dac4df 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 0abbc50c5864..e4c05d62cfc7 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1170,14 +1170,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 ? 0 : (bufreq)->hold_count) -#define HFI_BUFREQ_COUNT_MIN(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX ? (bufreq)->hold_count : (bufreq)->count_min) -#define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver) \ - ((ver) == HFI_VERSION_4XX ? (bufreq)->count_min : 0) - struct hfi_buffer_requirements { u32 type; u32 size; @@ -1189,6 +1181,59 @@ struct hfi_buffer_requirements { u32 alignment; }; +/* On HFI 4XX, some of the struct members have been swapped. */ +static inline u32 hfi_bufreq_get_hold_count(struct hfi_buffer_requirements *req, + u32 ver) +{ + if (ver == HFI_VERSION_4XX) + 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) + 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) + 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) + 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) + 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) + 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 3d5dadfa1900..7cab685a2ec8 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 063a8b0d357b..2a1e038f92cf 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -899,13 +899,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; } @@ -1019,14 +1019,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 b60772cc2cdc..d2e2d3108752 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1207,7 +1207,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); @@ -1215,7 +1215,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; if (inst->num_input_bufs < bufreq.count_actual || - inst->num_input_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) + inst->num_input_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; return 0; diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index 7468e43800a9..d9d2a293f3ef 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -358,7 +358,7 @@ static int venc_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT: ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (!ret) - ctrl->val = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + ctrl->val = hfi_bufreq_get_count_min(&bufreq, ver); break; default: return -EINVAL; From patchwork Tue May 30 12:30:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2154129vqr; Tue, 30 May 2023 05:49:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4g84zzwyXq+n1i2hLd6sHYB/bWpz2uUFkxD/NblFxuat9pgIOk7nIXkiMsi+bo43pBNfra X-Received: by 2002:a05:6a00:1799:b0:64f:74d9:eb4a with SMTP id s25-20020a056a00179900b0064f74d9eb4amr2648782pfg.8.1685450959217; Tue, 30 May 2023 05:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450959; cv=none; d=google.com; s=arc-20160816; b=HevlvCZH9tw903ZyQ9Snfrdktjx4BoqSoiT2G6mKHia/cXE/ZUZk/HURsS66mEwPo8 KRdodeIy6g3PW8xogIlJOl3QC03FUZidb+mEHm0KedcK+kQ54Xtf0X6VDqn5dXsB2AG/ aBQo+hxqf93mPed2Q1p0cEbCh8f/uVSVPkgHkQ9b/j45XiLjktbNT8GzjzaSL29tJlj9 7aQknkAkAGnSanAu7O2gyyIB1t4EVwYEpPWxF28GlGUZBVGQ2lJK058yLiXeqZNFdNkG kT0t6YzQGFlynoYvlRU/Hbz0VFJ30nrZc6LynQ6vHAWDh35dDEgxyts8esLAg3A3We77 KEmg== 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=PlH+JrndcdKZN+GkTBs2kJnCffmk2uG9dhn2HilsGHU=; b=sNxGQ74QgtFDCycm1HoPgkqyC11yKnq5j2wk3y4vEQNcuTaq4ozPuTWJShnRpgCufF vVc+iIlzKPXVX8SwdzIILheonrv76zS2dF2sq5oxM6ux8+xJuHM3aWu4YAliTk1bQHfz 0TkmPU+Ke7NZDIst7wKoO/zWmkScBcMEHivujiVUW/aPjG2QT0lVMWfekSRM9GM+U87s Dr+xdZ/gRrJm5vA/TkJkvei8oPRbIAFLqlhOlLe8f44bnD6uGuPz418nl/hEvC7g0gF3 XexBt7xcF3gANvLtKqt7MXMsZsVExAJkgFMAb3zPa9kgPojJezKqr6k9sUl9I8h/mE0m 5iiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xc1RfU2U; 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 z26-20020aa7959a000000b0064d5b6864d1si1653763pfj.232.2023.05.30.05.49.05; Tue, 30 May 2023 05:49:19 -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=xc1RfU2U; 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 S231983AbjE3MdH (ORCPT + 99 others); Tue, 30 May 2023 08:33:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbjE3Mci (ORCPT ); Tue, 30 May 2023 08:32:38 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41903E42 for ; Tue, 30 May 2023 05:32:02 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2af2b74d258so46679621fa.3 for ; Tue, 30 May 2023 05:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449862; x=1688041862; 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=PlH+JrndcdKZN+GkTBs2kJnCffmk2uG9dhn2HilsGHU=; b=xc1RfU2UFkZhCxmLheuF2JOyZ2L94UpslMeBtsSQQzLQWtDjZpugYnmOnwo+NREg/4 3wXosgSxMp25oNEFxShqrgZYElxg7L+vDC3rW5Hsvz75UPk03caLhzA9xXYj2EZpjQJm AxLQtYAkQZehv72X2rApeI+YQgGobPTFDqL5ql7cHelL4Nz4ve4AczQ5OgoLAsrx8bht Gmg9yJDAftoWLG1i/6uopi6NTJ5agXpx9RPDT/xqV0Urr5k+uf/1GIc87Q4OFN4yR8xv 257jeHSMuo/pyvhlzik6CCYBdl28l69hzljT1v5XHHxIg55rEqjBHxMT8An4SvII3H6u 3byA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449862; x=1688041862; 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=PlH+JrndcdKZN+GkTBs2kJnCffmk2uG9dhn2HilsGHU=; b=ReEf19KHy0NwHPTAkFAD+v3HKErOmjucYlHxI6nhuaHmNZNoXCY67ftQjv8q+nqlQo PvO/yVu0pAwaw4y5MleQ2j2Ypa+Oc6cdCocAVI1V4Tx7laP2EO+9AHubzTu+ObhAqhv6 IR/B+BnHmcPMBaZqHWttVIZ12R4idWY4Y30C9Hnr54dfB7Sxb074oXGI8NzAnRXWpoEC witeArBBHKUH5ezQ0C2n19lDOopzTS610vyT+NF3JXOhdvGqp+UliFkr4oRf74IFdM4y j+Vn4uHn8ZLyi10DoGZrGHsny8Be8M+ntHTnNGJuyaQNvoFOuoy2OgO0IYEkbxV7x8dU eqmg== X-Gm-Message-State: AC+VfDw2RrZizlzqrlYFyFZFcap1Cf+GLlmTrJuCG4lfMGA2Gvzdl+Dc JT2TJalddeIRwCnEu2fO6Yx0sA== X-Received: by 2002:a2e:2c06:0:b0:2aa:3cee:c174 with SMTP id s6-20020a2e2c06000000b002aa3ceec174mr850031ljs.13.1685449862632; Tue, 30 May 2023 05:31:02 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:31:02 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:50 +0200 Subject: [PATCH v4 16/17] media: venus: Use newly-introduced hfi_buffer_requirements accessors MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-16-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=4427; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3p066I2lbVJExmECv9lPxRruVYg9txAn+/VwsZP5cd8=; b=dpAdiAsFt2CgjQ2eCjzVBnLTj8EtENen/rrPzlUeooH5+q4l55ldzCiLUoYTOCoxWLbDWxIRm jPZxigrlsu1CGienpW1mUszCwz4/mt1cL0la8aRM7y/jExYxAucQr9E 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?1767323424791748183?= X-GMAIL-MSGID: =?utf-8?q?1767323424791748183?= 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 Reviewed-by: Dikshita Agarwal --- 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 b70bd3dac4df..8295542e1a7c 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -668,6 +668,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; @@ -675,12 +676,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 e97ff8cf6d64..f5a655973c08 100644 --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c @@ -1215,24 +1215,24 @@ 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_hold_count(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, out_width, out_height); @@ -1269,7 +1269,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: @@ -1289,21 +1289,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_hold_count(bufreq, version, 1); bufreq->contiguous = 1; bufreq->alignment = 256; if (buftype == HFI_BUFFER_INPUT) { - bufreq->count_min = MIN_INPUT_BUFFERS; + hfi_bufreq_set_count_min(bufreq, version, MIN_INPUT_BUFFERS); bufreq->size = venus_helper_get_framesz_raw(params->hfi_color_fmt, width, height); } else if (buftype == HFI_BUFFER_OUTPUT || buftype == HFI_BUFFER_OUTPUT2) { - bufreq->count_min = - output_buffer_count(VIDC_SESSION_TYPE_ENC, codec); + count_min = output_buffer_count(VIDC_SESSION_TYPE_ENC, codec); + hfi_bufreq_set_count_min(bufreq, version, count_min); bufreq->size = calculate_enc_output_frame_size(width, height, rc_type); } else if (buftype == HFI_BUFFER_INTERNAL_SCRATCH(version)) { From patchwork Tue May 30 12:30:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100820 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2150012vqr; Tue, 30 May 2023 05:42:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xhD4jv+cugyqUQmNCyvs1ulf6SopvriPTvVl/JnQd8YjvebIEnD+o7595m83kM17yUsFj X-Received: by 2002:a05:6a21:6d9a:b0:10f:176d:6b01 with SMTP id wl26-20020a056a216d9a00b0010f176d6b01mr2628022pzb.19.1685450545017; Tue, 30 May 2023 05:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450545; cv=none; d=google.com; s=arc-20160816; b=HlUP3isxGeZso0yoatTsuOjlUvdbOdbEwgVQ0tycrhJS1aXKS0CjyIr1NgrGIpka/k Z5k1IxOVbYoiDWM3882eNvaGf0kyYL4s+S303o5C7tfd0XpUPNCwzvVnQMO+WVMEiYYw oyDosf6ypiHGuAHYQdTJKaAFgqMqwGaS6QdFV52EGrI4kwSuS4EaCO6APKZt1brIiNvv Ox44gwpgmr2mpx72f03vtdveoNzBTKPf/ZewVdI3aQRzToXJTOiE3N9i8euJy/7l6xW8 fg82/aUNapIblJGgLBX1G+nRsKvrgQaPRXll5qdA/3FXsk3rPPHQRVnakAUYCMUffXy4 jasQ== 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=473x+lqpzUfA2jtVVPxgqLYhChW/9qnAzMi0phiVfDU=; b=CuhJlpNxAGRQYr4Q5HTWRIqVj2xLvBmCmQuWlLNhNr2aTg/BZAT+bjHTqdU0Ucbkzn IAlTlodQIXiVuYsAWakUTxwnPdKPhpn5A3yDhpac+7DmwTF9RzJqe/A3X/imVJ3Yrgaj AasdrvkdGpX5emFMk5jNUSo9umEs5JwaFxUJ4ScDwgPeAJpyJiSAr/VSVgBtkTBQNXK+ MSAGY7CqPoak+2kp3jG4sI1/CqJMk/bma7feQzJ+8R8IZlPrGDn5BmHJzrENzw+fEiw0 1GNTDvQnrNwYCA+iSxgXTHk7tX42Ke4mk9EL1IhbNZMXpLXsYBGzNmuFuHcleWWqIfw5 9xaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SbDg3Cb8; 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 j64-20020a638b43000000b0053474ec7245si31385pge.683.2023.05.30.05.42.11; Tue, 30 May 2023 05:42:24 -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=SbDg3Cb8; 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 S231232AbjE3MdP (ORCPT + 99 others); Tue, 30 May 2023 08:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232001AbjE3Mcm (ORCPT ); Tue, 30 May 2023 08:32:42 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8028A10E7 for ; Tue, 30 May 2023 05:32:08 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2af2c7f2883so45882031fa.3 for ; Tue, 30 May 2023 05:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449864; x=1688041864; 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=473x+lqpzUfA2jtVVPxgqLYhChW/9qnAzMi0phiVfDU=; b=SbDg3Cb800/J9YKHr/9xr/So94j1gdK2pCQq2DpZwtW0XYNJzdyj3g+EeFYCuKOswg V5g0jjllzu2HJqYY0SRrnpBMVkKsess1Ix85hkjezHpB4EXgk5CuWhzYuDk5A9ovS+HQ INCMunxkw/qkfq3euvf7XnrI3JgXorAG6UYdxl0p3pPqYl+io5+JoB24t0JJLX0W6wou AEFX7VHeDctfIiLhMkzRYEmR4KlD9p4TAYpz8fKAQyiY6OvGqbNOS8djWboPNLJaukdA mj1DcJVsvifEBc2p7JppBBDnL+xWOXUgmd9wqs1TwzdG+xo8+2IGcQzS+Hrckkmzl5t+ XWag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449864; x=1688041864; 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=473x+lqpzUfA2jtVVPxgqLYhChW/9qnAzMi0phiVfDU=; b=ZjqG9VpXkXW7wan5xTnTD4OutddxJQ6i58boimH5zh3L3wd8FUi+vx1Hq814VYdwZS DKhMsCmL+iCvqPzL627/D9y8e7BWjFAIWec6dunNxB19LvZN+edaSabgvGY/5gif4s4z 0XSUU3mt+OkadEbGvaqKShK71u/eaHLujIIteclW7Wwpwj0WXeeKdYYRsTfo1NRZcqYk zavhiYujBxAPX7JELfY4hEkDY53GbepDL5z+w0SQMmxBUBMksKQ5cUJZENFkTbz4n0jh W+F5HTdB4ibLuLhe0kzRXHF8lhKy2+WUS4SJRfoM1N5vfs/1q2SOr5j1CODTU61rrFnW RIQQ== X-Gm-Message-State: AC+VfDyZM+HpC5BeeXq0D2iQzWFPWmoJgMqZF7VzDFnIS1/A63yw75nM jCDjXd+k4NKdZadoYfYgwGweBA== X-Received: by 2002:a2e:93d5:0:b0:2ac:5905:eff9 with SMTP id p21-20020a2e93d5000000b002ac5905eff9mr690143ljh.6.1685449863993; Tue, 30 May 2023 05:31:03 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:31:03 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:51 +0200 Subject: [PATCH v4 17/17] media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2 MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v4-17-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@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=1685449837; l=1033; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=oNIm1Wj0FhsO3S/n6eYL1/VajszUoAmbnQl8ZF5tL0I=; b=EE9MNWA8F4kINCga1/UXPCIhBDawDBerb3GjKdXmHwemGRPPenW+uzKGjJDlutvnjbhxRuBrL n2qOIG5TDzJBQ2xwNRHxcaDBE2ggs1hhafCeMzDCs4pTESJoU7Dx3gQ 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?1767322990391732039?= X-GMAIL-MSGID: =?utf-8?q?1767322990391732039?= 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 Reviewed-by: Vikash Garodia --- 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 82854553f99e..19fc6575a489 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) {