From patchwork Wed May 17 21:14:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 683004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED1FCC7EE22 for ; Wed, 17 May 2023 21:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229487AbjEQVO3 (ORCPT ); Wed, 17 May 2023 17:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbjEQVO3 (ORCPT ); Wed, 17 May 2023 17:14:29 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F33B65B9 for ; Wed, 17 May 2023 14:14:27 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2af0eb50b4aso8192431fa.2 for ; Wed, 17 May 2023 14:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358066; x=1686950066; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=JPQ+rxAnNr1pVtpS1IHn9dDua1A7Qd2hNKqGcwb9dQQ=; b=Z3vy5qB7/QBsm8S6SBwDmzDEXHj21xPdDWha1wlxG8U3MfOJ7EX2C+Khs2PMRdyDEw n0ukKwfA5rI59IHpYodR1KRBzlT9C2sPMWAcAYwzm/9vAtrbbU3bi+FRgw78S8abuJcf D47wm/px/hDkG3kQewdCHRYGmVBkujmaLKU6UyeFUM7DiHUXGHdA4FeyTg1sg1yuDBoQ euhQZ/3aCQjELcHCyKxu7Ng8LkfIR+jJEXe1uWpK42HMG+ypJrW+8rEUefYZE/PNS5dP I9um0KxIkR09tlG8g7A3j5QZNSrddsiN0n0WCRRQ2Q9Zg6M/7/6cBUtL+Ob72pjFII0Z R5kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358066; x=1686950066; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JPQ+rxAnNr1pVtpS1IHn9dDua1A7Qd2hNKqGcwb9dQQ=; b=kHRWHVgEddMmorum7Z9I1Wl0hLwmChMY6qcdhhsqIh11CagVloBuPqx6/ENzkEvWz8 b3sUUihQorAcPbByt8tTtaFIkkOhmg5Gs1qdUODAUeuBD4y68kpVafM57P5psR699oby /iI7sJafkvIptvSESEo8lANTSs+LB/iXxJ2XVMWPkFpfSYAWZ87NP9Wsofm12O6Pz/MY 9EqtKd2SgSmxrbdE33udTY8oNHkrpk2+Hp1YARiUAspt8p2/nU2W2bIeh0OfThRN6lnR WcKAbE3DBM+t7BZyKBxkuuHniWyu+/fWQqbwIcA/iZj55JykNvrlL9apd10/QH1geoLo 69ng== X-Gm-Message-State: AC+VfDzjb0BzCyVvsDqSujNrL1N8u+FSQARMAksuJTITEhI08hdzb4LB nqQYW3XfN7I3fCY4ZovIJcJLKg== X-Google-Smtp-Source: ACHHUZ6IYfWNpgIpg23wGVmgZXdHrH4316gOOx8Pep2fndWYlETsGZ7IA07vnz2nQtI4iIKz7rVwhg== X-Received: by 2002:a2e:9819:0:b0:2aa:41a1:cd70 with SMTP id a25-20020a2e9819000000b002aa41a1cd70mr9867131ljj.3.1684358065749; Wed, 17 May 2023 14:14:25 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:25 -0700 (PDT) From: Konrad Dybcio Subject: [PATCH v3 00/17] Venus QoL / maintainability fixes Date: Wed, 17 May 2023 23:14:13 +0200 Message-Id: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAKVDZWQC/32NywqDMBBFf0WybkpMfCRd9T9KFzFO64AkkmhoE f+9o7tC6fJcOOeuLEFESOxSrCxCxoTBE6hTwdxg/RM49sRMCqmElJrPYULHM/gl8VaAVZ1rm0Z rRkZnE/AuWu8GcvwyjjROER74Oi5ud+IB0xzi+3jM5b7+jueSC15rJ53WSldgriN6G8M5xCfbQ 1n+kSXJvan7sjKVce23vG3bB31ruw35AAAA 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=1684358064; l=4446; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=DXJG1cPYd9kdnwIW4oXv+iZufWBsr/dePoRiztA9KTM=; b=Xsmq1HD5usln3psyNw8k+1wHdlqT8jW7G/dRsvSMfsVt1ckofgbHcphDKv/GpEjhFZmgKqgLI k2ehP30MiVzAbn0CqOwLG9ke6x5RgMSdwLT13I32ALJOamXy30zQOR5 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org v2 -> v3: - Rephrase "Write to VIDC_CTRL_INIT after unmasking interrupts" commit msg - Drop "Remap bufreq fields on HFI6XX" - Rephrase "Introduce VPU version distinction" commit msg - Better explain "Leave a clue for homegrown porters" - Drop incorrect fixes tags/rephrase version check alternations - Drop AR50L/IRIS1 from if-conditions, they'll be introduced separately - pick up tags - rebase on next-20230517 (no effective changes) v2: https://lore.kernel.org/r/20230228-topic-venus-v2-0-d95d14949c79@linaro.org v1 -> v2: - Move "Write to VIDC_CTRL_INIT after unmasking interrupts" up and add a Fixes tag & Cc stable - Reword the comment in "Correct IS_V6() checks" - Move up "media: venus: Remap bufreq fields on HFI6XX", add Fixes and Cc stable - Use better English in "Use newly-introduced hfi_buffer_requirements accessors" commit message - Mention "Restrict writing SCIACMDARG3 to Venus V1/V2" doesn't seem to regress SM8250 in the commit message - Pick up tags (note: I capitalized the R in Dikshita's 'reviewed-by' and removed one occurrence of random '**' to make sure review tools like b4 don't go crazy) - Handle AR50_LITE in "Assign registers based on VPU version" - Drop /* VPUn */ comments, they're invalid as explained by Vikash - Take a different approach to the sys_idle problem in patch 1 v1: https://lore.kernel.org/r/20230228-topic-venus-v1-0-58c2c88384e9@linaro.org Currently upstream assumes all (well, almost all - see 7280 or CrOS specific checks) Venus implementations using the same version of the Hardware Firmware Interface can be treated the same way. This is however not the case. This series tries to introduce the groundwork to start differentiating them based on the VPU (Video Processing Unit) hardware type, fixes a couple of issues that were an effect of that generalized assumption and lays the foundation for supporting 8150 (IRIS1) and SM6115/QCM2290 (AR50 Lite), which will hopefully come soon. Tested on 8250, but pretty please test it on your boards too! Signed-off-by: Konrad Dybcio --- Konrad Dybcio (17): media: venus: hfi_venus: Only consider sys_idle_indicator on V1 media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts media: venus: Introduce VPU version distinction media: venus: Add vpu_version to most SoCs media: venus: firmware: Leave a clue about obtaining CP VARs media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version media: venus: core: Assign registers based on VPU version media: venus: hfi_venus: Sanitize venus_halt_axi() per-VPU-version media: venus: hfi_venus: Sanitize venus_isr() per-VPU-version media: venus: hfi_venus: Sanitize venus_cpu_and_video_core_idle() per-VPU-version media: venus: hfi_venus: Sanitize venus_cpu_idle_and_pc_ready() per-VPU-version media: venus: firmware: Correct IS_V6() checks media: venus: hfi_platform: Check vpu_version instead of device compatible media: venus: vdec: Sanitize vdec_set_work_route() per-VPU-version media: venus: Introduce accessors for remapped hfi_buffer_reqs members media: venus: Use newly-introduced hfi_buffer_requirements accessors media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2 drivers/media/platform/qcom/venus/core.c | 7 ++- drivers/media/platform/qcom/venus/core.h | 15 ++++++ drivers/media/platform/qcom/venus/firmware.c | 22 ++++++-- drivers/media/platform/qcom/venus/helpers.c | 7 +-- drivers/media/platform/qcom/venus/hfi_helper.h | 61 +++++++++++++++++++--- drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +- .../media/platform/qcom/venus/hfi_plat_bufs_v6.c | 22 ++++---- drivers/media/platform/qcom/venus/hfi_platform.c | 2 +- drivers/media/platform/qcom/venus/hfi_venus.c | 45 ++++++++-------- drivers/media/platform/qcom/venus/vdec.c | 10 ++-- 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 +- 13 files changed, 139 insertions(+), 62 deletions(-) --- base-commit: 065efa589871e93b6610c70c1e9de274ef1f1ba2 change-id: 20230228-topic-venus-70ea3bc76688 Best regards,