From patchwork Fri Feb 9 21:09:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 20179 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1132314dyd; Fri, 9 Feb 2024 13:10:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpGbZARDlFe0pQMg+1m57tmqc4ZWBuPcwkUA3K6slex3EPOqDcG/rhTTfJqOx2r140ZC+R X-Received: by 2002:a17:906:e8e:b0:a3b:d25d:ebb7 with SMTP id p14-20020a1709060e8e00b00a3bd25debb7mr158562ejf.74.1707513020148; Fri, 09 Feb 2024 13:10:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513020; cv=pass; d=google.com; s=arc-20160816; b=ObKitfFRDbj46blCNKCot+30qsEASYnaVr9ERF0iaTAqbaikruR9jNGe/8DSK/58dn jtPmCvKAaFJYbvSMZikFZOqJUTr0ow/pzkN+3neR9I8gtPu5W94nZL4JiUP81dW7YJ7V MdGYXyKZ/Bk7tlOpRqX2tdOEBjd1nSuJDkS9nHGcfo0b1dLL7DJ0zTUCNBe6K0PbxQVB Fjn+T1xPHcHBYYXg2eB1Myi3ZEMDsqflrRHWHb68b3sBZWPJ9o2Mpg2wXLqMD3wNQym5 sNDbCOsqdTvStUUWZ7zw+PM4ODJv0RlfyTXjgbwv+BnfuBEcEzNMNd4DDiQ62i/vKy5e C07Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=lLSVoQCZITmHHkE2ANSeJMkPS5k1b3W1O27n/YVH+Ps=; fh=mtzRyRr8kymsDIa7fD8Xn3nknqPq7CdAWd6p2GmUH8I=; b=aASqG8eFyrIfYCKRH/LlWZKqCnyNqSO6/FYVtF9eNe8fgkd0dgA+rAyoGZKReDOt0P A67pjNQUDeIxIN+IH7j6IUQ+pUaNNLkMoRBAgUuiVwzzo1JjmD7V6IPvkTQRwSrrR2aS 7BVPpleCDyT2QGdaouA1siVJm0tc47hgTTlyEt+yK24JGWP33sehU12Xi4KTell8sKP6 yYAU/ZNaUEFpa32XrGcTlA32hz6RaecWp4eCfJPz2rmL5KB4l+TMc2bJclp2V4+7nGZs u/c9pTCxQ8+bx4y4Sp5x8Tu7w8y5X8Bxc+oYXRbU+Lavo41qyfWSRSgomFe7UPxySClj pfIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BJyS6+Cr; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-59984-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59984-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCXy+6Ri6eTSC9gcXxtw8GY9oSNTNi7Dvu/tqrqLsPUKw0KeKonIIlCFfLQVz5uQdD2MFiXQu1KQPjwKi1ctXWThAjg/ww== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gl6-20020a170906e0c600b00a3c125062e9si328534ejb.1044.2024.02.09.13.10.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59984-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BJyS6+Cr; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-59984-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59984-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8EA041F2308A for ; Fri, 9 Feb 2024 21:10:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3818B28DDE; Fri, 9 Feb 2024 21:09:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BJyS6+Cr" Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE1E96AB7 for ; Fri, 9 Feb 2024 21:09:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512977; cv=none; b=ldjbVUTbXQ+JkM3LRO1RYUcCVXEgofSIpGytcNf8oQ3AtR7L01m4S3D8BqJC3+gut238WPkHc5Z3+qhF+8x65ibRJ6ASaWe7vli+yHVOFaGCJYS4UpXU5ceIYe/Vf5yd2OdJ/opLznmnWyKY9cnDwOj1jXuU016CqCBIMufP6fI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512977; c=relaxed/simple; bh=TgTIkiOxuNQ1a1CE04BAe5d7kMkxUJYrxgLOnh2qf5U=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=IAytrwf900nm45lI+d3CTTP5wVD9Aze5SRlqLdm25n0rEeN6WBgsdWDqsJ+/aWQZrLW3c9T3Gkp6u6IzNzIqT2Hpr7VnGJ/u6n4bbpmNkw23T5QOHvCaShtyusBg10iCTxGZNLFGOnaNW3L6R4IGAA8kVkWNbBpPQJG0Vw14P1A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BJyS6+Cr; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a3a77f27524so172728766b.1 for ; Fri, 09 Feb 2024 13:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512973; x=1708117773; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=lLSVoQCZITmHHkE2ANSeJMkPS5k1b3W1O27n/YVH+Ps=; b=BJyS6+CrIfkpTesRMFJOgQjD0skfxp3LAOxEgPWH+CM6twI6usf9/tsheyo0+qMia7 IQsjZiRACIegQc8pQGUS9+1LpAay4REZVDMKmVEXp1KjcuIRZ8bdJBgvOowM59heTkJH jP3a+kNejkSWq3sYb3m4Y3oWIhBar6Gs8KRPAddAxsRvaC/IXlh7aJreIHuYbz74gJIJ WlLumRtyozAqID3ApiJTdocG0gHwUMZvQ6YB3uwwaYV6o+75fcPPqoqu7af+6qQPyVsr 0tDwb5LbEx6ySNBWY2wdnvwxsYJ/NpaIj3ADbQaX/RQy2jjDWrSAyAuN7MmTq3gJxxiP ScKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512973; x=1708117773; 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=lLSVoQCZITmHHkE2ANSeJMkPS5k1b3W1O27n/YVH+Ps=; b=FGzjhNs1ddFYN8/vN0s+5Aq2RiWwF67lPbmoRLXcscbXyuGrNk3q3hO3Vw1Xk6HBVw RB7T/KyDMV/SnbdPyS+58IBcX3LPMGtfMGpJJVeseHepPsxjR8njqrsmvrBjBJJXy4Xf oKBCYDSD/QBLzII0eGIP10OOWSnXu8vxsw5246lz1DXmJ2O96QZCaqWH8/bmCx835Amu PJ6pt1J93NJferE+b2MUDTZGjGzt6ePD8U7J8t02FSGBTYGKOkF1I/NpVc9tByHyv61U XKdaK6eaIabETDmazwVVogf8x4ZzCXufrRcyvp/QvG1fNmq3u9LQeYzQMBT0z0RYUirl YmCQ== X-Gm-Message-State: AOJu0YyKUxqfWhKuUFnQW8Dn4fkJD+kr/aN4mHAqrD4V/uitXHbXhpoj NJTUQEOic/MJ2dy0Ob21xUMQmt+L8EUoJ3QyK7uqVCKBiquqF8Rk6VnMmOOS7V0= X-Received: by 2002:a17:906:46d8:b0:a38:2e6b:ca1d with SMTP id k24-20020a17090646d800b00a382e6bca1dmr172850ejs.63.1707512972964; Fri, 09 Feb 2024 13:09:32 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVempmfIxnzT3BObkA5rvK5QUErU0GODdQ4aIsDLpD3eoFRTAzIPUbITXtDAyGcFkYly0VZZ4sgkoiUo/XYWxh3JFR2TPpNpI9bs274YINMhRZDXniMzT/u+I4G+TdWbpwud+ef59OJL3xs1A7e/50hUO3Ot44wLOB/BG9o2Dx6loLd2tE8BMCrkbHA35hnY2DL1SCTv+bsTODjKbhNqQJVEgZ5hWmcazOgHRY1hqT5ke4383NrJ/57qZygWQSP5VmiJRHZ/g2addrGz2P0yqyGH3FjjthsQ7p82taF4dmpJWdyhdmcedF5UE7W7+T84LanQ/zEylgmB2lkzNO/RKQ+Qrp7f2Rx/pKeooWnzsHnlUvmezcXe3Jt++VHp5xqt++lztHcaGgVze5W+IqTu5QSGVenIAaNiZlQH3d9F8u6r/j72Z9LQNYf71jaB26a65C0thL5FViWDwhGE9i0I9wvOgcmnqAxU9CVppjDEzJVdNYv8IpeE7+c8nA1AyQK8g2y4w== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id cw3-20020a170907160300b00a381ca0e589sm1108516ejd.22.2024.02.09.13.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:32 -0800 (PST) From: Konrad Dybcio Subject: [PATCH v2 00/20] Venus cleanups Date: Fri, 09 Feb 2024 22:09:21 +0100 Message-Id: <20230911-topic-mars-v2-0-fa090d7f1b91@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAIGUxmUC/22Nyw6CMBBFf4XM2pq2GB6u+A/DogMDTIItmSLRE P7dytrlOcm9Z4dIwhThnu0gtHHk4BPYSwbd5PxIivvEYLXNdW2MWsPCnXo6iYoKjWhtUd+MgTR AF0mhON9NaeJf85zkIjTw+yw82sQTxzXI5wxu5mf/fm9GaeXKPq9wqErssZnZOwnXICO0x3F8A QJrgOS6AAAA To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Philipp Zabel Cc: Marijn Suijten , Stanimir Varbanov , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707512970; l=3004; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=TgTIkiOxuNQ1a1CE04BAe5d7kMkxUJYrxgLOnh2qf5U=; b=ari/TotuVkFsJHDotXqORag6wWUCNmUi3ZO38ARf7edmDaaPN0FKYzBYrdD++u6ctYsjC7Qhn GfVA2WpnaP9DnRMyVMYWAS5yKhlOLX3PKDtJygb1hApaVs73jLBQh91 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457172819979986 X-GMAIL-MSGID: 1790457172819979986 With the driver supporting multiple generations of hardware, some mold has definitely grown over the code.. This series attempts to amend this situation a bit by commonizing some code paths and fixing some bugs while at it. Only tested on SM8250. Definitely needs testing on: - SDM845 with old bindings - SDM845 with new bindings or 7180 - MSM8916 - MSM8996 Signed-off-by: Konrad Dybcio --- Changes in v2: - Fix "set but unused" warning in "Drop cache properties in resource struct" - Fix modular build with "Commonize vdec_get()" - Rebase - Test again on 8250, since nobody else tested other platforms since the last submission (or at least hasn't reported that), I'm assuming nobody cares - Needs to be tested atop [1] and similar, it's in latest -next already - Link to v1: https://lore.kernel.org/r/20230911-topic-mars-v1-0-a7d38bf87bdb@linaro.org [1] https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?h=for-next&id=d2cd22c9c384aa50c0b4530e842bd078427e6279 --- Konrad Dybcio (20): media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable media: venus: pm_helpers: Rename core_clks_get to venus_clks_get media: venus: pm_helpers: Add kerneldoc to venus_clks_get() media: venus: core: Set OPP clkname in a common code path media: venus: pm_helpers: Kill dead code media: venus: pm_helpers: Move reset acquisition to common code media: venus: core: Constify all members of the resource struct media: venus: core: Deduplicate OPP genpd names media: venus: core: Get rid of vcodec_num media: venus: core: Drop cache properties in resource struct media: venus: core: Use GENMASK for dma_mask media: venus: core: Remove cp_start media: venus: pm_helpers: Commonize core_power media: venus: pm_helpers: Remove pm_ops->core_put media: venus: core: Define a pointer to core->res media: venus: pm_helpers: Simplify vcodec clock handling media: venus: pm_helpers: Commonize getting clocks and GenPDs media: venus: pm_helpers: Commonize vdec_get() media: venus: pm_helpers: Commonize venc_get() media: venus: pm_helpers: Use reset_bulk API drivers/media/platform/qcom/venus/core.c | 139 ++++------- drivers/media/platform/qcom/venus/core.h | 66 +++-- drivers/media/platform/qcom/venus/firmware.c | 3 +- drivers/media/platform/qcom/venus/hfi_venus.c | 10 +- drivers/media/platform/qcom/venus/pm_helpers.c | 323 +++++++++---------------- drivers/media/platform/qcom/venus/pm_helpers.h | 10 +- drivers/media/platform/qcom/venus/vdec.c | 9 +- drivers/media/platform/qcom/venus/venc.c | 9 +- 8 files changed, 213 insertions(+), 356 deletions(-) --- base-commit: 445a555e0623387fa9b94e68e61681717e70200a change-id: 20230911-topic-mars-e60bb2269411 Best regards,