From patchwork Fri Feb 9 21:09:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199094 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1133597dyd; Fri, 9 Feb 2024 13:12:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpaXHNXSrkGbsdASUG80H3aERcROX8ghs42qIrF51lmrOou+SqamITzKmptJ6qA6FOMONJ X-Received: by 2002:a19:2d04:0:b0:511:62fb:54f3 with SMTP id k4-20020a192d04000000b0051162fb54f3mr131560lfj.25.1707513165170; Fri, 09 Feb 2024 13:12:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513165; cv=pass; d=google.com; s=arc-20160816; b=SyuSluzKJt1SL6sZWDfkezm9PIj6RjT9bkDRZVxKoRVWQxnzAWqUA/56syZ0nZWRgG 6jJfxfp6UOJSK23occaRKoAw6Ct6agIyyiUPAgMynJh+VWq7gE16ddQDWTSyaXPBhF9S IzrmB1SbyHUfeRa3ySd4D7kS6s4+Q0lKNOfxToXTaelEztdDKYyf2bhFbea0UZd1/E35 KzAdn3pVZstuFjAIKOHqFQA6+DV/mi0TFjCNaX84HWNQPNnNl6PQotaMwEn3c2jYmJAV c5avVoldVCl0rLdafm8KpAJBRCz8Xex3RWkFv+GSoYDB1of5QC1Sm6Rr+r+ApMG92jrK 6d7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=YqgwRixA6ApDI8sPrNg91MKVrvVSPJRcKUUS08MgCmY=; fh=yrVC5mZzZP+TPnf/3m43L+wpUzbr7XeYL7hIc0+05B0=; b=JGV13Q86CP4UTx9JcoDjId14fCZIXaFKwimTr6VdKGut/xhPxhvYT9WNdUdCsVj0B/ ndTQ8rXzptT4GgVmN0LSrmO6bFb+2p5G52Z00A3F0k1Ei/RDhSVN2fHRm9GjKC7CeiIf CwrMVNwqgGkZeXdcs9Z9nXnbcU5epHjj8pFbn99uS4VNQDiOcKImAvwXqngd6BOX4oTj DYrms0WobGR+DuOeE0JF/gZHlehwEzSuP40fHWjf02iDozSH2dasCWaw0l+Tzi2ggfQU 8ICWYu4czE9VNx1Ap5q41I7rI69d2EY2mK4EVa3Bttt5evyOKP8/nuhjlJZTBm4OkO3D 6ggw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QGtjMtJ0; 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-59991-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59991-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCWEwyxososqBigzL61/+vpfU/XzLkaDeFJU1WInbPxeb/kfwnRBPMdsRnYMcA13zhymhs+Kvx0/c4pr5S6FGoqTWaKhLQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id qa37-20020a17090786a500b00a3bf3687843si1019170ejc.919.2024.02.09.13.12.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:12:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59991-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QGtjMtJ0; 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-59991-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59991-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 DD57E1F2117D for ; Fri, 9 Feb 2024 21:12:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52C7C39FE0; Fri, 9 Feb 2024 21:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QGtjMtJ0" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 52A8F2E63C for ; Fri, 9 Feb 2024 21:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512993; cv=none; b=SCULKsc0zh6Qmj74jYi37yztN893yFZ9LZ8NgfWOAiipfjH6uQ/p/oluAtddDj3xgZd0HUjwK1cnaher1Gw5+akcufDmHJL5rTkklJjHcSwNYFLn+58enqt2eQYlDGpys5IJ4135K4YJa9+7IQlT1jJRkGnutd7gHViepjN71KE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512993; c=relaxed/simple; bh=lb27xhI4gdBF4UHcwKFr8ScxLgxp1+CafppHA2L6fhU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q4MSu2JaNaMOFDlAPx3HKsGE5BewrVAVMuSBI2GOBdfdSBWVQ+jQKGurILfr/AyV5G9jPyKK6PnBZ+NMqvuX3jJm05KnQUssE/XmhDs8oRD+L7qakTpfdsxyqx2HZG8RFMAmQCCrmRRpHat+g4f84b+AmIKNH1V2gPf5wLUgAIs= 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=QGtjMtJ0; arc=none smtp.client-ip=209.85.167.42 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-lf1-f42.google.com with SMTP id 2adb3069b0e04-5116bf4dcf4so1706036e87.0 for ; Fri, 09 Feb 2024 13:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512989; x=1708117789; darn=vger.kernel.org; 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=YqgwRixA6ApDI8sPrNg91MKVrvVSPJRcKUUS08MgCmY=; b=QGtjMtJ0N3qkuPeXYlY1zXVgAtpVw/3TTvcuYClM0TT44kKkWufABtzkJR+pHgcyIp HTatj9O+aHcJfUIU2QgbNbFOwO4JSTAazNmV5Zs7v0CP/EyFPBjpC3sj3qSjJ4tv5616 kZ0NBKhNkgImDZTsbz9wE6TLpc/Mp6rlbazFgyaEFuHkqzP2W/SWEMvDZqobfTqIV3vK yZzGl3s8Ls1rAp8w8wvxieEb4I4USp1rmGbvLDSrQpNbf0kcbCPtdyXSlGeZGt75FkDc UkOugIAZolzL3YmR7TBZUz05ZylThbageeBG5MiMpUm6t8t2ydgNOIjZSvlmuWK4t5RZ 4EbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512989; x=1708117789; 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=YqgwRixA6ApDI8sPrNg91MKVrvVSPJRcKUUS08MgCmY=; b=THAcBk8cyL7QMMqHPtZc/HTknvuipFa7XZoGT8bHCyAU474oPPWTAS5mEH1NGjFl3J XuMn2liHUSrhZnh/29xsu/u23JFG9WT/bgP2OOHd56W3O3AcTVsvjGmZOfMhDmKfMn6z KrFyRDy+3hGX+tpRbs61dVrLbDE4sQ+yRmiFWo0g53Cbv+ShirIO4Ix3Mbisdlihs/jM pWwp8cJL1uAk6UXHD98MPBj/KkIjzi8Bx0I6bICwdFMbuKInClJ40ICdDLk9BKL0FT/Q hgu3RGDEmEulXpdn2pQI3vEhREzyfawfG0jHlY/4FGvKTHsBZ4iVZIi+AtzO23bXE2dx URHQ== X-Gm-Message-State: AOJu0YxrayKosOLrWvWXURZfa9gBNulQKee1Zr3qcm50E1K4vGCgvwxM 4mfJGIXjXHPHuRl+avVop1ZHkCns3udpqbmTCYF1Y+fcDfNX/7ODepzVU9tlNhI= X-Received: by 2002:a05:6512:1251:b0:510:c55:a3f5 with SMTP id fb17-20020a056512125100b005100c55a3f5mr168236lfb.23.1707512989482; Fri, 09 Feb 2024 13:09:49 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVJl+AqbHTvF3WV8vFVVntucZdXXlMJ4ZHb58tZF7FmHOj+rbFcNR6L01/SUIw8W0HtYlS7C8YqV1sr1qGzI+g86in6mo68AsjTEScsXBPRvnEJsUOaYfXNYSwT/H9mUR3PUDBezQumpTWbyiBd2ZUGLXzLQ8sIgv793E27kK5dhP+vNkKXtCasPgGZDfEbTWz7UIrQTFQmv3Y94TvNQtRB270pT0L/z66uersi1ac175Q3orb5WYdurbV57NQVyopgi5EtzSmtezdsKhHeJUfFUX4vI8cYjYOdJF4B5MR2WZy1ntAV/sLt68kCfnG8UAj5dsXmZ2vc+aapy/HOP2tg/lnTvkncMuKRCQsz29mVl9Up434qQO3jFC2prJi7T6gN2GVKuqlHGTBWv6ibfEKLnoqT7VshfFBWKAj0b6xA0x9IKv0IFm1QCdkaZKlM/4I1thxBZsgqgFRK5m8ir9tXIUFobZcMAvHWaaqSnoh9Nlqr0ow9i4EdT+KkUk0LSwNVjQ== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:49 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:45 +0100 Subject: [PATCH v2 01/20] media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-1-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=1871; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=lb27xhI4gdBF4UHcwKFr8ScxLgxp1+CafppHA2L6fhU=; b=+y8UnWj7pBxnLDQzTuFCX0qHqfFWaIW8ltcFXMCcilkClq26ATIQQ8zPa741OTNWGh2ip2q7E FIadbLDch+AANPvAZz2qy+xxWDyEljuOMqEfsjrjCuhKguAPfK83x5U X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457324328362595 X-GMAIL-MSGID: 1790457324328362595 Commit c22b1a29497c ("media: venus: core,pm: Vote for min clk freq during venus boot") intended to up the rate of the Venus core clock from the XO minimum to something more reasonable, based on the per- SoC frequency table. Unfortunately, it ended up calling set_rate with that same argument on all clocks in res->clks. Fix that using the OPP API. Fixes: c22b1a29497c ("media: venus: core,pm: Vote for min clk freq during venus boot") Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 502822059498..8bd0ce4ce69d 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -41,24 +41,23 @@ static int core_clks_get(struct venus_core *core) static int core_clks_enable(struct venus_core *core) { const struct venus_resources *res = core->res; - const struct freq_tbl *freq_tbl = core->res->freq_tbl; - unsigned int freq_tbl_size = core->res->freq_tbl_size; - unsigned long freq; + struct dev_pm_opp *opp; + unsigned long freq = 0; unsigned int i; int ret; - if (!freq_tbl) - return -EINVAL; + if (core->has_opp_table) { + opp = dev_pm_opp_find_freq_ceil(core->dev, &freq); + if (IS_ERR(opp)) + return PTR_ERR(opp); + dev_pm_opp_put(opp); - freq = freq_tbl[freq_tbl_size - 1].freq; + ret = dev_pm_opp_set_rate(core->dev, freq); + if (ret) + return ret; + } for (i = 0; i < res->clks_num; i++) { - if (IS_V6(core)) { - ret = clk_set_rate(core->clks[i], freq); - if (ret) - goto err; - } - ret = clk_prepare_enable(core->clks[i]); if (ret) goto err; From patchwork Fri Feb 9 21:09:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199093 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1133479dyd; Fri, 9 Feb 2024 13:12:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyzT06oGqYsELaot9vxnku75NVjy5jjbhBTINm/mIii4dVKsYsF/2n4sQ0Dcg83dwKSCUo X-Received: by 2002:ac8:7d06:0:b0:42c:455e:5863 with SMTP id g6-20020ac87d06000000b0042c455e5863mr691418qtb.7.1707513155107; Fri, 09 Feb 2024 13:12:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513155; cv=pass; d=google.com; s=arc-20160816; b=s0/Narg6+Sb7UvYcDzyD1LheIcHR6L3OUxuv/WSYTYMvX3wHn5CHjXygBh/aKrNgGZ nEmD0Mx6r9wFnzMGlEGQVcOzZ6enTLxG19gOMcF4RT79BxRJHgAMbhq68Ed5izYqdPu+ HzKVROr9VWMoAwcVCUAcAXR2FuFMoVrI7LURYhLHg8tuOmtSa9/wpMMufQqvhkHBdHvf AFQ1fTgYuFaspa34MJhXbOlKEsQUjrLIVtcv9IogwhMrLs0LeB6vmX2OpX7a/2C0H6Ol YM2EOp0UZEYu5B4y/Tvjmk72Ro0l7Kkn6BeV47NquLlva0qxUwLZpkmyPPC5RHFVBEse GWxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=clU3y8fBgJIxt4Cy2lqLbmum74KaZZM8VM+LPgiv+vQ=; fh=rGxo/Ijbh+5rhz1VLoTZScA1RUR5ZiAWRuZ/nj8/+pE=; b=kcqez7cfdQ/uRqnoZjEJRCZojpccpvACI+ekabe7T+dQocQ5cpRUI1Ua+N9AwTMrRo HpUlt13swCvh9tbTKsYXA8y8QwrcBmFNK+5m2QWEfVfHP6yuEbNdDglbowQHJvspzSW3 csIWEi2DOAp18R6zeo58ad1LevBZt5AteeCMNFWEiHa7ANu67uwTBl3fCxxc/nbGvORF 0YBGxxGq5PvnbBvL7PMkuE/piJSRTVlKKtxUY+i1WLzMCiU+jHy9LJOKb0PtKc/Tm7Un WctghNxdH6lCwQuBpEUIvv0+DIG1l64C3oW9ub9Nir5dv7zeHdUBWEtDstA+mxaF6F0Y XpRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UhiZz07Q; 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-59992-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59992-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCWB98sboa0LqbEy04jRKkgZ2YdhGuxXIwR9DwimFcn38UGBaPn3gbEYs/6rQUZxpJw7p0qd2TWfKyJUB4g8v+OGioOLXQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j10-20020ac85c4a000000b0042c503d320esi2908215qtj.90.2024.02.09.13.12.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:12:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59992-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UhiZz07Q; 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-59992-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59992-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DB9921C20F82 for ; Fri, 9 Feb 2024 21:12:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8105C3A1C8; Fri, 9 Feb 2024 21:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UhiZz07Q" Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 9C03538FAD for ; Fri, 9 Feb 2024 21:09:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512994; cv=none; b=GH+IOA7uZFQFjSMasaC/QMJcY3LBSkBhxSdkdXBVIrfIkJz24Z1Vwa8t67fDwkY1Ev2JTyMknNTx0Ppl7HHToxHFlLl3j23jJ03PD2MTEbosWTf6m88dozgorYnt6pmu9Mie7DJhli/RFBRz6nlSbkXI83e476ub4rpJiZ1UZmo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512994; c=relaxed/simple; bh=4x/me5yeOEh7Kc0NCGCe3k/ewNhk7l+PTAXEKLbJtdg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B6j5V/fCKsq0tcEHFt497r+L7F5Uc5I793Be5HNRPTv14H6p6Y1AV6RC7vQF7r1YqAJcmrqtI354s3grpq4ndEHf4fkiTDdErbNUEEINnDCQYk4xl7KWYRPAKWVeYJsGGZDG0FVvKOAgCgsbC6CrcJ3txbtK3TBUhM2N3+SWPN4= 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=UhiZz07Q; arc=none smtp.client-ip=209.85.218.47 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-f47.google.com with SMTP id a640c23a62f3a-a3be744df3fso133644766b.0 for ; Fri, 09 Feb 2024 13:09:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512991; x=1708117791; darn=vger.kernel.org; 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=clU3y8fBgJIxt4Cy2lqLbmum74KaZZM8VM+LPgiv+vQ=; b=UhiZz07Ql0p+y24zxQIMqRo1zLmhdji2ys76dPIywqHDgpw6lJqmS+a+FUs6wCWD1v lYT2jUE299B+5kq22myFDjdTRl4qOA5NuAu25q/g2XuHdL96MK8srvfoSxNzG6wET8cY rBbIpUn/H5jgnt5SJBzaRkLPQrP8XXh7BqBcQM7Peu8s1uNqfAvZmpA/0HajUYkqUNtn sWMyfQtcw5PHASYWWPBzfFpP3sQgWIX32b+ZO697KZksWWG3iSvCW0nQNi/fXCw8caav NWuj9l4thVUhh+jypKsQ/Bo0FPipzp+Nma14mbsUOki2HkHJ31lw2SYx4B5eNo6h8x2S 6dmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512991; x=1708117791; 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=clU3y8fBgJIxt4Cy2lqLbmum74KaZZM8VM+LPgiv+vQ=; b=H4j6hJ8JSUYCCqnlhuz+jcFOaVrYHEUtVv7ob0JoDeWmVJ6wush1hdnphgGXJPuVR5 T6CC1a7IdUchgWsH7nfHhrHJQ4U77W40ObCq5VW6ffDwlIshRTXCHLywa7v1ssDbIQ7v l1DRiMNdm9bgwFKLv61h1AE8vgQqoGjXA2CYsjadwP3KdFJJPi9HxeIuj2STT5YWYC6t EWWILt/384+q6XerRF4wEh3zAno7cgwKYKXMPcdOY3Naa4VzEpgRZ8r8WKgfZDxUjDCY 4+Rp1uOeZwbjrRmUDHxTRpfDZJEcDuW8HS1nPeDOZUAAZG29uZH/2zE5txw9LneyOSiK gMFg== X-Gm-Message-State: AOJu0Yyh4dGqcDCcoyssSgjbtvQFpApD2JTBw+F+yvZW6Z8Hd6uNePbE iFLy/bTKGLIio1uLsguvV7WvyqPQk2HQL0VoAOrQVwIwFIym3d1kA5MOUJFeT1avi1UfdNGpt5q 9 X-Received: by 2002:a17:906:5f86:b0:a36:f314:d8be with SMTP id a6-20020a1709065f8600b00a36f314d8bemr177645eju.38.1707512991022; Fri, 09 Feb 2024 13:09:51 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVfK1hN2/I2FkTD/QlN2R7RH8j8SoCMNxmB8yrXSniS2G+ww3u2pToMXvVJDjVf8MGI4vTsLSNenCDCP2h5/olEpuVssyMgf9/94iNVi1gO2pCiGDasz1AqSOexpvElGbRI1VbLzQVllPrtiwK9ghp4U+pKOez78H/avBzE5sx7wnQrDMCdwrtKQzG9Ps6cC4BnvtK9Qo9Y277DDvobKnf5HF0xypDNnH/AbFD1y2WbhfahxppvC8csVkmN0gb6WnlQi2bbPh6zHQJ0Hp0QknUaNRVWShWfWfkdvXkLRsCQfPXtJ4gBJKu7MGFRiXPPhh22U3dm7wmKuvITllIZaqtEdlQfkm7RQkpcxAmxZcqt0E/l+rDPHiSnMd3iYtsKkPg8ooFKs7vl4gVeaHUgNgETXitZq+HtrEQz5xGrxfT7zotIr0BcwzAQJbM00ffSCQWfOdtbqhN68yfbjI1XTT05TDcVsraIgCRos7sEg+DUYM8tqf36EC1x6x9CqlwtBBrPqg== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:50 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:46 +0100 Subject: [PATCH v2 02/20] media: venus: pm_helpers: Rename core_clks_get to venus_clks_get Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-2-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=1211; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=4x/me5yeOEh7Kc0NCGCe3k/ewNhk7l+PTAXEKLbJtdg=; b=AQAHlC80oGjh6PEJ42jPoSKbuJtBPAtDuFcaMaRA3r7rCnNIsr34E63ziRxXFsC+tD0h8A3HF KPIe1HYtMWkB4CySePVKqc5bctFpRgss76IcLM6BGkBSxFp9DgmD6vb X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457314597630716 X-GMAIL-MSGID: 1790457314597630716 "core" is used in multiple contexts when talking about Venus, rename the function to save on confusion. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 8bd0ce4ce69d..ac7c83404c6e 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -23,7 +23,7 @@ static bool legacy_binding; -static int core_clks_get(struct venus_core *core) +static int venus_clks_get(struct venus_core *core) { const struct venus_resources *res = core->res; struct device *dev = core->dev; @@ -294,7 +294,7 @@ static int core_get_v1(struct venus_core *core) { int ret; - ret = core_clks_get(core); + ret = venus_clks_get(core); if (ret) return ret; @@ -961,7 +961,7 @@ static int core_get_v4(struct venus_core *core) const struct venus_resources *res = core->res; int ret; - ret = core_clks_get(core); + ret = venus_clks_get(core); if (ret) return ret; From patchwork Fri Feb 9 21:09:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199095 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1133719dyd; Fri, 9 Feb 2024 13:12:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/QswhlbJuXYuQuvj4PyFp2hQ5iHhvOge1uHZCbpV7Z1GEvrD4pTuniL+w9mty3aV5MaUP X-Received: by 2002:a05:6402:394:b0:55f:a7d6:fd6a with SMTP id o20-20020a056402039400b0055fa7d6fd6amr81613edv.5.1707513177519; Fri, 09 Feb 2024 13:12:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513177; cv=pass; d=google.com; s=arc-20160816; b=Xjvc3qOA0G5/S9lLpbVi2Li6njiY36zHtmo7rKFbKyDX4MJLDAXS6PT1aGAOKMfkgX vyFRvUe+OjXFdLd1JdjIOmAhL4TT39j96PbXR+Rb+3fMDLEWWAUugogfLxYCHD0yGrMP FoOAXYEMlQ3WErU0V5syizW7yKxqpnQQZFVE+OFzz+txrmZs8ghOY2fWLvO30NE24bcX Ap84Xxsg9RBPe5GwaEHkXnmDo3W9mlyuz/+nC6+ZlTXJIJRM+SWiWx+5abYqiB8ZPXLe rxBhrX31K8PcVmQY5EgY2geZ3uXvUYOmq1dbG+5CQL4lzPb2b6DU9yU8lvHuM88DXibr hwKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=3P4+a9/cIAslmQuzQjL8EtOxDSeXqHOG2MyxLu4mmL8=; fh=HmJ9iZesmDwOspWeYpu91B1moo2cLi+Abb0eeo6QsKQ=; b=IJgmDvn/9qC2Bo9G2K+n7HIu9igRQxRhNOfhaxEe/a6wsQUHINPtbIUt9rdp8mC6hV 2MRV4umsicToVRTSZ+MgDNO/lRA1rlupfoCsp3V3OWKTQ/JS4OxD53muteOcLEyW5qA7 zob6mjO+SKoLhz5pgjp63mGcZx4StH+SuBy7eU4h136qivgjp9WfuhrluxbPksnQ8Wcw tHQ7YjcxaDwzwLHZ5YXiQ8h1y0pzwDqusJc3ySomzDKIQWj8I5vQP9G2cIKK1xnf2ho+ 6x7cG1xXBGtYz2T+tLJ/2aEZ2BPdQVbfuAmFY5SZ6Cq7vDV3LFV3QeoMoY6XYmcDRIz3 AmWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ei+0GVQw; 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-59993-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59993-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCVSu4GAjTcmDZYZlf6NbSb+xcVLYJ6zqmKVke9eYkZEX7t1BtMEMk3pPucWJosNa2B+sR6gCtYc0yEu+ZMT58d0BjqCYQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d8-20020aa7d688000000b00560de31cc38si123037edr.198.2024.02.09.13.12.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:12:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59993-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=Ei+0GVQw; 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-59993-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59993-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 A37E31F23473 for ; Fri, 9 Feb 2024 21:12:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C13C3A8C8; Fri, 9 Feb 2024 21:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ei+0GVQw" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 3290A39AC5 for ; Fri, 9 Feb 2024 21:09:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512995; cv=none; b=o0SKOR1soaol1ez0OvD6GOAih8QEqx6PRdbs6qiYlLZG+yMGLZdh0Z2F0e61RW+K0ZZDSyZThDT9CPiCiVF8rT6Z+J/1gEwcuIF5eQtc9EK06kfJxEZsOjAN6Y0G04ZVbRJFwgAxJXhHNhkUKvVbpJm1c0Keme800k8lm1G3uJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512995; c=relaxed/simple; bh=qRFNx2a0sPyBufJHjBf1XzrjeKK7bQ1fasBPqhqnRAw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=moqWNc2Y9b6Jy3AMOS26xFV1FMb8SPYWWA31hWo8BKzrzAA1o9hD8VNLpEeySPQxvF572xXHVXlJrxgC7YsWffhGhF658BjwDi8p1oRk3XgO0GXJbORiwQO/lQSNapVhB1ndFp0HEypex5GatLkiRvFYYMDJWDBa/vuCa4hjJbc= 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=Ei+0GVQw; arc=none smtp.client-ip=209.85.218.49 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-f49.google.com with SMTP id a640c23a62f3a-a2f22bfb4e6so189479966b.0 for ; Fri, 09 Feb 2024 13:09:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512992; x=1708117792; darn=vger.kernel.org; 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=3P4+a9/cIAslmQuzQjL8EtOxDSeXqHOG2MyxLu4mmL8=; b=Ei+0GVQwmIii0J3Qk8pJRGPYG2qfgMy89wRlSYTxhLkhLl49HFl7eZpuMZ0yaRCogV wBKUcBBfLjnAcn5w0AOz1zewn5RSw6z5NMnolQuflrqduig80bAAgIdYxSAovEhyYaGg q/OyKywLSn7rSg0gT53fG7F4vgTYkVvS96GX2CwVroq0W7vHCsxVzYLDwPXRQiQvHhfK G9Hy3y+2i5Ni0KdYmVcbW4IXIJOJTK56pJXpftJ0JFQ7T8qFDBAIx3jugl9MOAwEYYO/ fEAx7rsVtYAwkPLcNIhQ6Ki3pyLImRriRxagXwBEtJyz9hcQ0dLcDJjYO+gJ5NMwND+z brqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512992; x=1708117792; 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=3P4+a9/cIAslmQuzQjL8EtOxDSeXqHOG2MyxLu4mmL8=; b=hsVd/OAyk26THFzlpZw3ahs5YVWXUDi8TOT/PICQXec4cc+WT8d2SKAkMtyDOUr69F 8OjlNDUXSEaXq27S1eZlODPzONbm+XaVfkhRsd0AUo2bEp1njw2r9niKJnLflBOophJm Xws5bZZfginrSCI3djwuSFxL1xVRPiZObdVqYgHJiO6i0PI83sCQSMucZnZi4OMOiAjG GI3QY+b/oQzzwU5JHmT9SImdZ3fbN0OAwiEymNj/zc3jCxOInNCOq4V0MhkEFglG6kcg v2KAcmB0YRqgiOzjQo9XcBq/9naZX9yXKw7SXkMMB9B2n6AzcKONTInuhf/dv7sr4MqZ MXyw== X-Gm-Message-State: AOJu0Yx9/0I5bruQYGfGEOEvb3HNNGRIlUGuQvpNxC5Sgd9Af6D9TPuB N/8ew1yHZi6ACmTG248eTbPEdpeTBAIcAyphwPA/Gl7Bwl7pu5f1lEVlvnZuawo= X-Received: by 2002:a17:906:395a:b0:a37:bbe7:6002 with SMTP id g26-20020a170906395a00b00a37bbe76002mr155272eje.19.1707512992623; Fri, 09 Feb 2024 13:09:52 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUN/6DcLKLHb6GpaRqOLsbKnEuKbZHWazCmSiIi/eBFKEIPXF8GGxewPt3LMu1/QmPuqGL1TiJn3S2+2Pnwv7+2+GAtdhKke2ScKRCZbkP7p4idBo/NO4Gb8tp3qxNOUfJPqq80cSgdwuOPYRRcyOHUz2/F1UTVD8yl7mwo5W1COK3w+X6jkjIUnMYSrDtD8sHj3jq+0cuJhWUPfIuM+dxs1TRpP1uKEajqm8hnuzR9x6Gd9iWUZwX+DwnBO6Fd0CQ0cFfY8e5jCM7+jjG7bJGtFq/4h02aYKmsq8giDJK7C4RVOEkIOi0Wxc6HTMv5300m3hs5jLM+LSgXxsiiQcHCQkjOUSMTmr/cQPDtW7Xl1p88eif6jhjQSpbLIp+sDeFFYw7X9j7BMn9O+y24AKmQqbPx3xhASLrICP8/lh324hdJkoQP+t7DF256Qr1iJkQIWKCtYRaC8kIIkncAZh7d6Q2rzUEMtpVRd1ayA6/Ccf2blDlOvgEZIblLSuEdjp5vkA== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:52 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:47 +0100 Subject: [PATCH v2 03/20] media: venus: pm_helpers: Add kerneldoc to venus_clks_get() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-3-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=2105; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=qRFNx2a0sPyBufJHjBf1XzrjeKK7bQ1fasBPqhqnRAw=; b=8+L3XOpMWqZuFrz8AFmFy2qsmwKomGg/5nzZOYPH7CzOEOf+OTS6f8impKgr957vacUNlHiBq GN/FOhcaKgbAwFpT4jldS6XE7LvitjMa99xbc6Y0qCHGV6DWv5GxIHq X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457337198833718 X-GMAIL-MSGID: 1790457337198833718 To make it easier to understand the various clock requirements within this driver, add kerneldoc to venus_clk_get() explaining the fluff. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index ac7c83404c6e..ea0a7d4601e2 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -23,6 +23,34 @@ static bool legacy_binding; +/** + * venus_clks_get() - Get Venus clocks that are not bound to a vcodec + * @core: A pointer to the venus core resource + * + * The Venus block (depending on the generation) can be split into a couple + * of clock domains: one for "main logic" and one for each video core (0-2pcs). + * + * MSM8916 (and possibly other HFIv1 users) only feature the "main logic" + * domain, so this function is the only kind if clk_get necessary there. + * + * MSM8996 (and other HFIv3 users) feature two video cores, with core0 being + * statically proclaimed a decoder and core1 an encoder, with both having + * their own clock domains. + * + * SDM845 features two video cores, each one of which may or may not be + * subdivided into 2 enc/dec threads. + * + * Other SoCs either feature a single video core (with its own clock domain) + * or 1 video core and 1 CVP (Computer Vision Processor) core. In both cases + * we treat it the same (CVP only happens to live near-by Venus on the SoC). + * + * Due to unfortunate developments in the past, we have to support bindings + * (MSM8996, SDM660, SDM845) that require specifying the clocks and + * power-domains associated with a video core domain in a bogus subnode, + * which means that additional fluff is necessary.. + * + * Return: 0 on success, negative errno on failure. + */ static int venus_clks_get(struct venus_core *core) { const struct venus_resources *res = core->res; From patchwork Fri Feb 9 21:09:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1133874dyd; Fri, 9 Feb 2024 13:13:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IETxr4XfFHYJjzyvnT6nSOPyqf7uHOmpHuiahDaD9h2nwmZo/EGu8SP/J+rLEDnnr1z13sS X-Received: by 2002:a2e:87cf:0:b0:2d0:ce72:570a with SMTP id v15-20020a2e87cf000000b002d0ce72570amr107194ljj.18.1707513195223; Fri, 09 Feb 2024 13:13:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513195; cv=pass; d=google.com; s=arc-20160816; b=RPILBYQQbF1OKsBG3cMt2tGuSyWdOaFcNEHLKt/cW0e4YRfsKe5O/bb3xyu+y/+5+G KQRvKkMxGnKmCfSFxV3Uz+uzvGyMXrtGPCVMU07DhRgkQh3j5wfgKCnEBAk2lcOllzdg VbnsEk+8dEmu/wJIqwCFUAnCzi0z0c+m5m/zzBuhn4+IkYNLrX7fgS+g+DTUyrT3e9hu 7t56etH/vhRjGmBSXR1sv2VpHsLZpmwZs6jlhE16QS+HdM7vJZiDH+bTA39JDPyDh4kH lrLo87jwhztcJGSvC+VN6Od1y+Uj2BC0CIe5EXJ7wv/z0zpKGMx1UfozqItnkIUEMxbN 6LAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=zHqRSPmMg9wEwP3rMANc1kfU5BrHC67r5uXE7Pbrcfw=; fh=7ZsX4CdAqcsuVIvrwvZmXpxz0OMVaLrw43iFZ8m+NYQ=; b=VhTcFdO8kvirXgxd3Pc0z5xYGMvVpgfAYV4STMtLzs4mS/LL2RAB25ECo8SpB3nyr+ q0Odlb4WSfpsH9+mym7ktAIJ/mElzmCDeRcXjegE2vK5pBLCE6biFWZwc5p2z50YftmP AkDYe6ZFN9Mou6O3bDtsB2rpHbu/cd9aAHsdbbU/zf+UiK/mqkqvBsWR+09LKyer78C+ xvCanFEr+z9de0z15LzMBYUQ/aAcy3ofOpXpQj9rp6lkMFjyPCQQVZJSiMl38+gL8LrF w+1IXVpLnwDubeuAyvnqcCvcZn1OLrDHyXUDvea6X8OEFYFG8zjlHF9608Pz0ZfhrBFL EuKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M3eKtIPT; 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-59994-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59994-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCWevE8Ecy/tpSc0V177d9ADirV8Gft7ne4jhWVrZObN5tWXMIK7v3OMXIKenDmaGi0qaB3y23GT30jqAiBRuf4yWfBH0g== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i15-20020a056402054f00b0056012ce9cfcsi114323edx.560.2024.02.09.13.13.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:13:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59994-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=M3eKtIPT; 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-59994-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59994-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 B3AA31F219F3 for ; Fri, 9 Feb 2024 21:13:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A2483AC1B; Fri, 9 Feb 2024 21:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="M3eKtIPT" Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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 5B9AF39FE2 for ; Fri, 9 Feb 2024 21:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512998; cv=none; b=mthzKfbbzKW8lhPTzfU7R4M2s8fzV3wi9x0eu1EqrLxOVzJ37bY38OAp/K0MgNX+4fdPwN8IGcpj/BRjbl7vpwk2M8bvGB81rV7TWJ4s6jKKwRp0AKhsCmCtKV+Tb4E+MOAKaDHmLIHB2aQF0odqiIUwTySlwYtWjYSVfIMK6ps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512998; c=relaxed/simple; bh=y2JWZvHJdVFdS2JPzFc6K4lM3ffIwu7LSCAQM8cYwps=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p/ynHiJc+XCBpYduEt4jqoB1uKDScWl2tL4LEmAhFisUmdcMooJ2s9eomh/CtzX7caPTlmO/Fs8o2wtTHyjAG/w8HSoXWCldkPxlGHsNVFrjadhOlZ+yFe4zumN/V1X8RB4GyifGyR7gLdsOzXDrxlFXdt0lvbTdFj95CtO2Vak= 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=M3eKtIPT; arc=none smtp.client-ip=209.85.218.48 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-f48.google.com with SMTP id a640c23a62f3a-a3bf9012637so118484066b.1 for ; Fri, 09 Feb 2024 13:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512994; x=1708117794; darn=vger.kernel.org; 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=zHqRSPmMg9wEwP3rMANc1kfU5BrHC67r5uXE7Pbrcfw=; b=M3eKtIPTBqosWJIQ7Od1wDVHeQYwKLmZT9p4Tl5NbXWYf7A8cl8PTiCyhFhpyBI3tQ uG2cj863k3KrJ/C0NWw2hIUqMBBfkNXQ2VS20z2yyweKOVfQIBlaHlFh3XGxX0oZ8LnO oItikgINfFSyCQ1WRVO4jDb9AjnqzkwXrQf7MEtwpEIXg4SGqMvifcySKHTl5CX3hRcc QHkt8bAVokpk99n490U9UlDD3pzlpocTsd0ezvt63QhAMJGZPyx3Cgt8wXFaPQWZh7rj OxzjNJxu4+nbLNdh8gszjx/4pCfZcIw3Cmr7YUlRn+fAhU12c56L3C/alc+kjfOM8Dyb hcoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512994; x=1708117794; 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=zHqRSPmMg9wEwP3rMANc1kfU5BrHC67r5uXE7Pbrcfw=; b=QQKPJmfxcT7k3xaVVjhGTW7GcYSvj9+MT87yZbieBeKOt0InprXjvasvrVY6Z484EE wPStqZC0YeAy6lrQTMl3edkywmiWpEFdjMWgDvseY+yu/edJGNxFs4ju+MyJqtK+f9SA kShw+dq4J6KY6/mAEZw3i2Ck6G0tlz0o+ufhXOoHBrdCyBdLKo/W8aOcX+dPCIi3iHR6 Rzx7NDJehK7iBAMduGAULhWzc+dHzKJlP9pAkwrABL9aNMpYJ90o99i3xm+JgfrIpVGr hNlybvVJD+0HPFNVQMOFpOxTUnX63mbwM2e2VNIM85RcuyPQpMeGAeuVbe9jFD+wU4Ig 3m1Q== X-Gm-Message-State: AOJu0YwNDk0sfOML+Q8NYdnG16KUe24LXJbj2rM0384uIVW6Aex8rTCy m0s8i0eYG9yqIWcTRN/T57OApc3s6CQYnFWv33dGgn6PYzyF0TB2bc0/Tmi3LvE= X-Received: by 2002:a17:906:ece8:b0:a38:1673:682a with SMTP id qt8-20020a170906ece800b00a381673682amr190148ejb.32.1707512994747; Fri, 09 Feb 2024 13:09:54 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX7M3Z2lfJw6CYTLfI4lk7oZf4X/Tt8KydPPEjARXyuSj2RTAotoZMWc/4LontHspfsZvs2mavsE0O7vLe4AwgjKuGNQVD1gTmJVu/kQdu/BTIqerDe8c+vzuNfEhsv8pMxt9MMug51L2Gg7e/FAnvJmt/4XtcraJbsMt9xW0h9VBzs2n9mws+KI0ZlVdbAN6dKdGqa1Dob3dR4YoPWLILCLdo+ybAwJOLpb7b3ZslDfDnQ0H2NGbVv5srAnvbs+5cMj5gQCdloW1ToEHz2hiAs99Enc+EYRQz2Mrm6XHv3XZNZiNbMXVbp4VVd/I0UfBi3RY4gE1JVJtuD3843w7lsGqdtNxNdJUxgELZAu0lsIqehMMedmgZFsCsNbfW5L9xU3LQr4RJ3q8W7c19ZyXCAT/wi9UG2I6bRx52SdEHDvhk1n5cNCGiYBUdXcZUccz2Ml2gbfHrQMilutfat/p3IDzXnz9Lm2rUvdV2/2dz747SiXF4CBeO5iXKd7nVMaXvg0Q== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:54 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:48 +0100 Subject: [PATCH v2 04/20] media: venus: core: Set OPP clkname in a common code path Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-4-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=2649; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=y2JWZvHJdVFdS2JPzFc6K4lM3ffIwu7LSCAQM8cYwps=; b=AtvahE0Zp8lNnsXEZ/S0J1BDdGYP6MemKHscNYsYbYfY4wMxb5DnKSFgdvP2tzd3LvvAzgeJ3 4f47+3XEPlJA57krg+XF4NHdT1tiITEo7TCJLawQhpnW9hM8/4jvzL1 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457356426028923 X-GMAIL-MSGID: 1790457356426028923 Calling devm_pm_opp_set_clkname() is repeated for all HFI versions in pm_ops->core_power. Move it to the common codepath. This also lets us get rid of core_get_v1. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 5 +++++ drivers/media/platform/qcom/venus/pm_helpers.c | 23 ++--------------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index ce206b709754..5ab3c414ec0f 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -319,6 +320,10 @@ static int venus_probe(struct platform_device *pdev) if (!core->pm_ops) return -ENODEV; + ret = devm_pm_opp_set_clkname(dev, "core"); + if (ret) + return ret; + if (core->pm_ops->core_get) { ret = core->pm_ops->core_get(core); if (ret) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index ea0a7d4601e2..1ba65345a5e2 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -318,21 +318,6 @@ static int load_scale_v1(struct venus_inst *inst) return ret; } -static int core_get_v1(struct venus_core *core) -{ - int ret; - - ret = venus_clks_get(core); - if (ret) - return ret; - - ret = devm_pm_opp_set_clkname(core->dev, "core"); - if (ret) - return ret; - - return 0; -} - static void core_put_v1(struct venus_core *core) { } @@ -350,7 +335,7 @@ static int core_power_v1(struct venus_core *core, int on) } static const struct venus_pm_ops pm_ops_v1 = { - .core_get = core_get_v1, + .core_get = venus_clks_get, .core_put = core_put_v1, .core_power = core_power_v1, .load_scale = load_scale_v1, @@ -423,7 +408,7 @@ static int venc_power_v3(struct device *dev, int on) } static const struct venus_pm_ops pm_ops_v3 = { - .core_get = core_get_v1, + .core_get = venus_clks_get, .core_put = core_put_v1, .core_power = core_power_v1, .vdec_get = vdec_get_v3, @@ -1013,10 +998,6 @@ static int core_get_v4(struct venus_core *core) if (legacy_binding) return 0; - ret = devm_pm_opp_set_clkname(dev, "core"); - if (ret) - return ret; - ret = vcodec_domains_get(core); if (ret) return ret; From patchwork Fri Feb 9 21:09:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199097 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1133986dyd; Fri, 9 Feb 2024 13:13:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXvhbNUxsrz2WCaCxOCoe25mADxo73LZ07Ri6xHEjPV97Vrgj0f1g9vZiWhZ64jz6ZpqqUgm46cd82UHCIYDq8qDzAkxQ== X-Google-Smtp-Source: AGHT+IFCoxhA1F2y9QjosGiTEWQdF0hAXehiuR3okAPQWt1w0paFBF3bMYh4/ZFt+WNji8xzVCFa X-Received: by 2002:a2e:8796:0:b0:2d0:a347:1cd3 with SMTP id n22-20020a2e8796000000b002d0a3471cd3mr105500lji.28.1707513208337; Fri, 09 Feb 2024 13:13:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVvoiaqHzFbEcC1ezlsu3w+CXA8dBnhyuFxeJ/ejmIWWE5n0EO4yIs2PZgE7FuvCznb1rKysj1fKXIEGWamHKdix17afA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i15-20020a056402054f00b0056012ce9cfcsi114323edx.560.2024.02.09.13.13.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:13:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59995-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=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=rIOCa3FN; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-59995-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59995-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (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 B120F1F21D55 for ; Fri, 9 Feb 2024 21:13:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCEE620DE9; Fri, 9 Feb 2024 21:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rIOCa3FN" Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 F3F1A199D6 for ; Fri, 9 Feb 2024 21:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512999; cv=none; b=AIvAeUwSq5K8VGCok6HzJSaIo8bLnwxtD1PiOJagIBHtpfm15LIFbkHdwVHeWVoonWfnkk+YFXahMJqT8T7ARn2K2lAtRbrdfrHExnqFH8ChPLhKjRhLGmXMwu33B1UJoBvq3BdDyvHjNVYmtv3GFLqYBfuw3d/E4d/WqBMhFRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512999; c=relaxed/simple; bh=3dtrntbOogwjknLFZqca+wBqcS9QWbQOd9iEEJQfOvA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DfC5hHKabaHdGdaZ2OhUd035JQKKmlX0cjRSlT9UeRmxWmkUSP/usFRoOfDq9BoHVTu7w+fi+895nBB1mLWEIkk0qFNWRimUAasnK7yhJ2vEdnsYNaf+OLvqftR2fbYxSh4wY5j0z5BuzF+zCd2/lQXFLY2IhNksA05uGLJKNew= 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=rIOCa3FN; arc=none smtp.client-ip=209.85.208.47 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-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-56001b47285so1937217a12.1 for ; Fri, 09 Feb 2024 13:09:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512996; x=1708117796; darn=vger.kernel.org; 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=AK+SsOpDJXwjdmEkPZAy2mx09ivoS/IARlVKsNVFoYA=; b=rIOCa3FNdNrVbpHo30DQbDAzLFeRuRBrY9FZvar1nCu+M3ZF5OOO6axwxVia8pOczF CLILcUlZ8NsooyGQvWI7gtJoz4WQbNNsH1kAQTPxTbyVlEQ+EyI4eBTCE8633J+23/bi FbZQwXYk3trULXdzPS8OphdZCZT8aswpdCEBxt3BLeEm+Aa+uyz0EBJpTP+G56ehBPmy OzefBJiPFmLkD1V4nIEsvkZsw93O8gK1KncKR5nJCVni23Uz53E1s7c2xwPOhoqhZG1H Lmd4lZH6hNG/C10zl+D7RB7bcw30rNNxoumd50GRVhSsXL4fQx5ngAkjxwBWDUCHKBYr x1lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512996; x=1708117796; 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=AK+SsOpDJXwjdmEkPZAy2mx09ivoS/IARlVKsNVFoYA=; b=NlCa+bbJ3JUk7VbJBWAspDxSDMX+ki14MUlHkujJowdXhlXlEovyZHTbLuUiCeRbaK Q7yd8oiTgCuASc29vara/LBYyHL3dLDkjpKqwoXXhvaE8kGTfRf9RfBadm0gzh4Da7Ra BrjSoM0j1EdVUaBBWOPp+uOS7ej3bqh5lADu6K3NofOW7pfxGJm1itVbQ6T5gBhT6+dS +KKhmBfAP42iem5hOn5WhrZSry0A4BVFwF6g1q3BS+behJ8YBHgBpZJ3L1kjs6FGdgaK B9yTtUipTPDR1PJiNPDvjeRs2WAkCybP3GvW+1YS9W0A97+uqqBnabR3Ow1GImgYYbFv gdvg== X-Forwarded-Encrypted: i=1; AJvYcCVRuZrkNCX23sZx8vc7CJIrXW3lnblbUP+oG8uEFcrcIbVnq/x8N8RmIlIBPNij45a7bxgLtILUpdhTVdtydJ+/xhnurxxgVivbg0cD X-Gm-Message-State: AOJu0YyZOlZ7bZSZUFFGbHX+sGDEzUPwBJyNOEYJFvI7mkqb4xlrXNb6 sXFSu3CgIGLEGLpUDRaT2pBw2N3KFcQ+1Ww+Cd/mQbjmai7mRh0GVaUD3scaISc= X-Received: by 2002:a17:906:af94:b0:a38:1938:3d41 with SMTP id mj20-20020a170906af9400b00a3819383d41mr189889ejb.10.1707512996410; Fri, 09 Feb 2024 13:09:56 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV7yR6qZYcLxMBFDCwovXqEY+5tzDFTiFCuF97xuBkVj2p/H9HKYNngM33WBfc13n9vtJD7IfZtdZrhoiJQ42U3KGXh0WwxyQl0pYiAQW2AOggDtknGTPABl0wpdBu8CBxgyUGYRw9uK99xhZO6wVUH4UKRZM4z1BbJE3GPxC8CihdoLXfoUsoIb21+rjdCJjDj2p+YowtrWSjK0cX/mikxvSVIHA/jHOqwOeJ0/ld6iDCGG9PUOncIgEm6HricqdHhhonjlBVPpyzV79q/M9Xmo+q4hdkprUAopGoQNxwic1GySl9bUeyxVtSuVuGyjpkKZiChcjhAAfE+CrwZokvkabm+8CGp+Q6fEgmj4MSxgWpeacUL9ZFh1DpAPSVGHxoWEFkNmiswfeC+hs+AS87KPKyGrSYhYsWxNrpg0PdlE8crwdI2aWYt6/VXxpkn3+jTePc68hz/1zMgjaHlHECFv6JZEdTNJwHTsvlbPkHZXVjX3FtkjOdpc9oDLBMPybjI3Q== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.09.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:55 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:49 +0100 Subject: [PATCH v2 05/20] media: venus: pm_helpers: Kill dead code Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-5-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=1555; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3dtrntbOogwjknLFZqca+wBqcS9QWbQOd9iEEJQfOvA=; b=oh5FZnz1G42Z7kWhiKa1BU+f/0l6PypNRePBfJONaCzYzRLoGiiAaxtCapT8+vTs2EweuC6lZ PlUS6YMzmQLC4SkVj5CuP5XX713SshpGMNA9dXY4b2/tOQrSWSBrAzx X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457369656441637 X-GMAIL-MSGID: 1790457369656441637 A situation like: if (!foo) goto bar; for (i = 0; i < foo; i++) ...1... bar: ...2... is totally identical to: for (i = 0; i < 0; i++) // === if (0) ...1... ..2... Get rid of such boilerplate. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 1ba65345a5e2..7193075e8c04 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -878,14 +878,10 @@ static int vcodec_domains_get(struct venus_core *core) .pd_flags = PD_FLAG_NO_DEV_LINK, }; - if (!res->vcodec_pmdomains_num) - goto skip_pmdomains; - ret = dev_pm_domain_attach_list(dev, &vcodec_data, &core->pmdomains); if (ret < 0) return ret; -skip_pmdomains: if (!core->res->opp_pmdomain) return 0; @@ -928,9 +924,6 @@ static int core_resets_reset(struct venus_core *core) unsigned int i; int ret; - if (!res->resets_num) - return 0; - for (i = 0; i < res->resets_num; i++) { ret = reset_control_assert(core->resets[i]); if (ret) @@ -953,9 +946,6 @@ static int core_resets_get(struct venus_core *core) unsigned int i; int ret; - if (!res->resets_num) - return 0; - for (i = 0; i < res->resets_num; i++) { core->resets[i] = devm_reset_control_get_exclusive(dev, res->resets[i]); From patchwork Fri Feb 9 21:09:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199104 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1135143dyd; Fri, 9 Feb 2024 13:15:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGf+CQphfJFegLMBXnmvAM/7fy6zXss9m7r9DBGr/BOLb2qQihIY4oXc1AC1UveO8IHEojw X-Received: by 2002:a17:90b:90f:b0:296:8ac:ab65 with SMTP id bo15-20020a17090b090f00b0029608acab65mr219379pjb.12.1707513341721; Fri, 09 Feb 2024 13:15:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513341; cv=pass; d=google.com; s=arc-20160816; b=ZJ2aoY+t09nN5FktO/xe5xD9X3JhkCHTCCbrPHfWydQTayZ+RiJ4c2KlCGStx9nkqt CPw6IcEBjtNuw0pSHFabNPsZI3t0r0dQj1WasS9JD5y52ynJ6IE2B0rckpd+yfCHwCwY 9KC4DWz2hol3KyLi9IQVywEz+jP2E1MAUs7UkVFwK32BT1iID9NvyoNeg1MJOEVF+K/o 7hDN/Dacs4bn/0Dx8mfPWHTKvXfjXnw82x5E8hTPB7vCXND+8donCl0i+IauSVWZoyuH ZYLRfHmmb13uXKwulp10YdfcTZRzuTI13G+s2JiyrrdfZiubyrd3rwPwKCfLb0gTC15F 1vkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=k2YxXA2KQwmYTykbrsMuU28ijcqoH+ICj0PO4K3eu3g=; fh=LBFd4BUd6nyGw/K5XFSdBm2eOF+YBcX8m8fRakD0U0o=; b=WydUW7yDGk2myPKVVLZJVsy2wvPEE+aAkkxnS05IixigHkKEYi+35YR3y3Bo5A0JLt o4gXQ7u93sanyHeK6eRNmMBsmGhjy+KjfxLdoqY+MBjPs88JIgGUvpizqAPQOlDO90nC WA3DrKwsBgGztBVEPhAHUPhY3PS958qAjZ6uNpu0xRYMWvGAwJiCI2wsby5X/RcJE7jG mHmB4JVil5my2bBv3k6Nb0GPs6SzF/7jO9DCmUWDPApu2sAeYOlBf4Bn0MKyP1p2wJEL tNTG5y+GFlkCeBRHC5vWU195f7r/hJkoOYCiFK0E0ykdK6ltEWMMfSjjb17tycWMKghB Xp5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iNoQflyD; 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-59996-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59996-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCWVs9GNcD6hxReMiERX5OpYYgbQg0oKTSSoL460kCgR0WqafQoLmkLoi7aOrvpFB7o63Ju17fgITA41EruZR3tanyK2mg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id qn15-20020a17090b3d4f00b002966e2d87acsi2208616pjb.57.2024.02.09.13.15.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:15:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59996-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iNoQflyD; 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-59996-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59996-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EE5602824FB for ; Fri, 9 Feb 2024 21:13:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82E1E3D0BB; Fri, 9 Feb 2024 21:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iNoQflyD" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 0B6EF39ACB for ; Fri, 9 Feb 2024 21:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513001; cv=none; b=qCqr4j7gq+QWcVNseSMiI8LeI7Ha0J/M0a4soZHXcIp7jevt6nqBBd590ajeqi2hFASb93Wb+u3osUS5BISNsD926AZnOVTONFZBGHhnObaf/eUyIyZRYKwamKKSu9ystjXCggYp34+5MPoHzNcKkS12kQ+R9Z8T0KIwlW0YWDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513001; c=relaxed/simple; bh=emlasjHcZnzrIjnafSLSnzSeNd3kwBS4D1Wpb2NJwiU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JXG5KNFom/qIDdiT6auubnF0wFLq9CakRHXcRvDkcSNeDBjhI+H6w1zFPHjQitCak6DT7ftF4QuCMoc87gEGNgIN0FoB24t3+WrhOZwMOHGOuOBT9plnweXcVVrgeX2e7yuSqv4x6yWn0sZoXqBTX4ogtBGhYmzO/fd1fbg3r3Q= 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=iNoQflyD; arc=none smtp.client-ip=209.85.218.54 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-f54.google.com with SMTP id a640c23a62f3a-a2f79e79f0cso203948666b.2 for ; Fri, 09 Feb 2024 13:09:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512998; x=1708117798; darn=vger.kernel.org; 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=k2YxXA2KQwmYTykbrsMuU28ijcqoH+ICj0PO4K3eu3g=; b=iNoQflyDa9h+8hwiffRMHkHBj6JC98z0hs8qbYw+k3TZe2zAhzBzMoNq6bWrOC9B1W A7miC+LAT+jpaXJu9iscfQcPZ6QKUYFb0y3vNUXpx6EyNp/ElfFKnKsiRCWt+rLRcjPW SF+JLQuzx3FviG2TveKI05CqX+C+5RWScJvYpIZvp9Bvvbq/qsht3uthc85TRsPuZFaR J4gairJNc2urNhICduT9CughT8yF8iKvly/qOIvdXqJLngXxiv2LMWyDGJnQj+PDhkfh 5xsWyKmceaUtwIGk32HZElWONsByN+VdCZ7MmLZvpKWhAjeccQDgg2P9gil3Wq19pwuK KnNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512998; x=1708117798; 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=k2YxXA2KQwmYTykbrsMuU28ijcqoH+ICj0PO4K3eu3g=; b=ovtQPgs5U+JiVuhvqPyvn82leNAT/8vxR0vrz/Qq8er4VIoZrs6naI0Ur3oTafgzrF dnHto4aKN6JtIbI7lX+GuDTcnEOqUs2LpH7eXiSXHtLBvJ/FQMvvbI3U6cbwigKfCw8b WDLhay7xjoCPNa3hNxSW7h4tG2APyThDha77Y5pANXD/9hCP+nrQ0fgs2IxFsSDMoqnO T8JVZJPd9BVzif8AvI8O/MaNfkaslRQERTgDKR3bWi5VgLZOuPaqJhafmHAxEMjCMT/W a3LK6x0bwKmcmFepTXBlk1RPhS3MWin7penBuCiXcdwUHAObQQzMNXLoDfmKpz+UQaVg Qgjg== X-Gm-Message-State: AOJu0YyA0bwuQVQ5BF0DowICJ+P7z5gDR2ez6ut12opXUpZWidM21AJ1 FCiw8+/nMImY+C5HOxYJ4ntvx0Rn9WV1Ieh4SkLmbghF2I/tWfK9R9kwHEk14TI= X-Received: by 2002:a17:906:a92:b0:a37:f129:262f with SMTP id y18-20020a1709060a9200b00a37f129262fmr221597ejf.12.1707512998289; Fri, 09 Feb 2024 13:09:58 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUc8bLRgweiBVuk9eczSVYfpuNQRnuIh3vZjAIZUIJWRHTF5591PApKSgTs049Uhc/jfFXkI5reynt3T355snl3ywCzO9R6GuUzhr8cdA/UHQSluHSMVbSLVNCpQAmO8yEYqwrTLpyo18PgE8vBSmUYJPN0EKitZ7cetILptYZex+43rxpnQ+txWDgidr8kjTzy5DWjtQe87KAQsJGAVGSYfzhoL1F7fKlTxBwXTxe9uEfA9NmdVpKYTzbXuEjn8YDzGRw9YAryTq3wbMylQj9AuKtcsjCQ9O4cRvf7yDjj8ZUy0NC7GjlmLruofgpJ3eV7JqGDV5Au+APVQGNw2o0y9ORIEQYZZIU/j9QBF9SJw3B46MJ9pExMfZ5xVVkguDzpC0KJZTKsB4oBDAnIL+oKj4G7TSmHJ4NVtQqBBg9iMwdy/R745K0TMZYVfNlcvT/b1zr+aifH5JJDyapdG8bhpXWHGJ7atx4rfpk2y2wrEIVKwsgfSaaQ1tTWPhSdnmjH0A== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:57 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:50 +0100 Subject: [PATCH v2 06/20] media: venus: pm_helpers: Move reset acquisition to common code Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-6-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=2551; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=emlasjHcZnzrIjnafSLSnzSeNd3kwBS4D1Wpb2NJwiU=; b=pmdE2ES1G6/MKZfX3GzMyvavVDPlN+plxhvovU/PoEShg7rUaVAZQB3iuBi0KNpybJBJipvMf wdDfzCVsd/bCwFW/C/FUH3PtUuslzktUB0X3uTw3kGdcrfgsmmrSVwE X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457509835185399 X-GMAIL-MSGID: 1790457509835185399 There is no reason to keep reset_get code local to HFIv4/v6. Move it to the common part. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 9 ++++++++- drivers/media/platform/qcom/venus/pm_helpers.c | 23 ----------------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 5ab3c414ec0f..0652065cb113 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -286,7 +287,7 @@ static int venus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct venus_core *core; - int ret; + int i, ret; core = devm_kzalloc(dev, sizeof(*core), GFP_KERNEL); if (!core) @@ -324,6 +325,12 @@ static int venus_probe(struct platform_device *pdev) if (ret) return ret; + for (i = 0; i < core->res->resets_num; i++) { + core->resets[i] = devm_reset_control_get_exclusive(dev, core->res->resets[i]); + if (IS_ERR(core->resets[i])) + return PTR_ERR(core->resets[i]); + } + if (core->pm_ops->core_get) { ret = core->pm_ops->core_get(core); if (ret) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 7193075e8c04..6017a9236bff 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -939,25 +939,6 @@ static int core_resets_reset(struct venus_core *core) return ret; } -static int core_resets_get(struct venus_core *core) -{ - struct device *dev = core->dev; - const struct venus_resources *res = core->res; - unsigned int i; - int ret; - - for (i = 0; i < res->resets_num; i++) { - core->resets[i] = - devm_reset_control_get_exclusive(dev, res->resets[i]); - if (IS_ERR(core->resets[i])) { - ret = PTR_ERR(core->resets[i]); - return ret; - } - } - - return 0; -} - static int core_get_v4(struct venus_core *core) { struct device *dev = core->dev; @@ -981,10 +962,6 @@ static int core_get_v4(struct venus_core *core) if (ret) return ret; - ret = core_resets_get(core); - if (ret) - return ret; - if (legacy_binding) return 0; From patchwork Fri Feb 9 21:09:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199099 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1134371dyd; Fri, 9 Feb 2024 13:14:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEaGZZjnSaVGqnnwGknaw0wr+6X7VUIGjzmqkC/TLnehMKi1LDVcph8HZP8LRNOfMHK2JM0 X-Received: by 2002:ac8:5941:0:b0:42c:62a8:c97c with SMTP id 1-20020ac85941000000b0042c62a8c97cmr566852qtz.12.1707513251192; Fri, 09 Feb 2024 13:14:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513251; cv=pass; d=google.com; s=arc-20160816; b=vtO2f0UKJxUZI5TjFIM/1PXZcw9tAcXGmaIwBVrhuipgDcbZZNz/9FH+9eaBi0V43V syvU8vZpfZfMdRPYC8PWjce01CWrot0TNoN286KopOwp0TAYtZWmlANqIL0MpxbZhQ+K WqORnjHIctAPqeafUls2Xc7CFOxrwrebkQmuxlYAo5UrYGQLt5e+YajVHlIZGZLlu342 t4aoZz1N30S9KCvFTeS3kkkK7jEV7DO4WKaNFW7bz3+gd+n9vuUqmoi3I94nwhw3DTCD Fl7IGPtxV5e3hgk4/m5t0CP2Dk/DbZOD5JJTIlqaP/HJbhni2Nsw9gHIO/xmpAI6FNBu w+ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=xlIzPxVWq+bsAR6HPmAA/ifEN8Nb2TRGFiIMlA64yBs=; fh=yW78U2JdQCFbZJ6XfHbFd0wlw55gj9V9boF0v6J3ss8=; b=JBjvd0RRlQG5FN9SHDPCDqXUhlJIVUyFy33af/MutfiLmswKchN2nKqhA+ylw3j5PL rOpHiGdBgBMteVpFhjAOhyVGkzawueZnStA1Cy4u+P08Ky7Q+TUoYqrnQZ7vlayefkFc XXXwiOQHGlw5ieCiK8M/bQx90awC1dBQErBUzDp20Qi4vvjhGRUE01c8SF2h7RpDBq2N RbWFPhwTiHmXM1jjKyXKjHzwzGgGCBtNDw8JeFvrky7KFME2wSRaOVkuoWm8f6LZuXd1 SpxnPt+shrfSHtipI8t/zbhv5EjJ3YanzepmvxrFhjpj0EzCKXU50q6rslPEeHac1W++ oPuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SPrfwAj2; 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-59997-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59997-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCX3qXZDmTaZHY0/SJ/+2Je01Gs7VoAJRtsA8R36aKB4YEZXV/NzXWlKqzNezo+vjxSi/eXvlTtUNbplpmXO4z/AGBv/0w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h10-20020ac8584a000000b0042c260dff43si2797336qth.637.2024.02.09.13.14.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:14:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59997-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SPrfwAj2; 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-59997-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59997-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F26D81C20E0D for ; Fri, 9 Feb 2024 21:14:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 248823D384; Fri, 9 Feb 2024 21:10:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SPrfwAj2" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 A863F3AC25 for ; Fri, 9 Feb 2024 21:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513003; cv=none; b=H83gYxx6+o7CoLs66+krV6VL8udVJOPAzOy8fY9c9y/YWtq7JJdbt1bkyVIM8kYDCZG04LyrnXxrbnsk0+Y0cLMYAnf6+Ni3hQTJvR80BmH4Yl4KRjVgcmnaD8CiRDNzcWpFUw5Ug5IOwYKMy7Qej94TSZo3wfZ/SojmmJMGl14= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513003; c=relaxed/simple; bh=2igVAqX0VNw3fNZBRPW3xI6PegwRz7NA5+KLZ+WJ63U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oAK97rgBPLgmUCWnKGqKLV8I/hgf6p1h+cL87x5otDNKvqdaEzAiMECd4xzzU2OuCHBPctd2p9arPmWgattW1lHTJb4Y/wd8Akmcw9y0dyLiaD8Q6OPJ7++tnDqKmG1LlvdegZRIywrr70T9NBeCJLRhE/SsLQRwu6yjecPpcV0= 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=SPrfwAj2; arc=none smtp.client-ip=209.85.218.52 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-f52.google.com with SMTP id a640c23a62f3a-a3850ce741bso141375666b.3 for ; Fri, 09 Feb 2024 13:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513000; x=1708117800; darn=vger.kernel.org; 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=xlIzPxVWq+bsAR6HPmAA/ifEN8Nb2TRGFiIMlA64yBs=; b=SPrfwAj2kg3ZLBhxtTxDB4ydSQjdTpZr7xYCYlZ7W7eGiH7nX/WrDTLOm7Pp55ApmM hRAszqjZ+DaTkKnB+WHtM5JDMwgQCPcyBCHLFTPchA+USR1mzepx4YRRnT0Vu8FPkm6J q3AjnUGIwooRtGMguTOyDkRiYFr/d5b5e8hkbTX+bPrYpmxUMRr08uzByDiKvEq4bzpE nmgKdd/QFllDT+VOgecLy07ZZegkcO5NX/LG8FzBz6vEjVxJbqvwPxWtHNXvt5roBDJX AOkqWmgDSYjYuxjzqARCVDshFnO7DloORwT8GIX+Fd5yGrZZgCflOpR7gH1Od+ek+QRD uPbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513000; x=1708117800; 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=xlIzPxVWq+bsAR6HPmAA/ifEN8Nb2TRGFiIMlA64yBs=; b=d/ZBVyxcsAiAiPbETVojXzi9KbHpmYiFj7XI15qg/S/TmQtBVMxaBFC8j7YjCRpUij Ay/JCmEGTqVL2uQpPdDNAyJjOOw98jM1OTkdbVvcIRVlgy65uH2SZFHNztqM4hTW46XV YhYVAIdrBQEcp8HRAY3cVRB15cf7/mgOeYPPJJ/nysitx2I2GflIdM+kCnl+CSV6/KJb C7Ys92E7cMwYQ7J86patVX8LdnqznhGLUQVcLBo/F4rkSDApavFXBmJq4w3TS/v35Asz P9SBaLysoBze4Oe1YriaifOebj8+g0bAj5PTOcg5SUCj1J/DLBuV30WIX3pvX0sz2bq3 3KEw== X-Gm-Message-State: AOJu0YydhMT1TgYfqzP5C5h4HQTgZjMP7bW5F4vd3iHbd5plXBe0wRGT 0GHm4I1Ttd3MvurJEACpghiS8K44pGK9aTkcO8KDHFN9bccvsmSqJSHPgk2TsVY= X-Received: by 2002:a17:906:230b:b0:a3b:e115:7b69 with SMTP id l11-20020a170906230b00b00a3be1157b69mr167492eja.69.1707513000009; Fri, 09 Feb 2024 13:10:00 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU43QCiyrytYxFxTxdhazfamHHqeLm5xnTyGUEoGhxRhNdGtZYwyCobuEDrz13F0peEVzF9hXAC37nnUngLF/3nwOhpGIRgQPW20GasVlz2H0PwfQNIJkZICjK3xuyh8Z8zBEknC0Z/uebrWghTa8wX+IjY4iUf4PeyjWDc0ud7GEpQH5yGlMHDkzrZbql/QDdwW4bluhNc334cQIPU4Ldg/fvBA6oAsIRQIJjiUHaaQAQQuzlhR6p4Xl1z4LWhJiTTKrdYYzbcVy0OYx+V6M5Wwdy7EsmGdjxBTFKCRBktjJMFyMGjMOSvmkTKuqSmdFWsCRjMY4I7aYsrh/JlRkX1KYnlxxQzlvAa+Wb8Ou79RA1AkP5rKBuiAlEv7TzeLjIWTneR6xqG6Q9UU6mMIMxEII8m3nHcZ8fa4xjNvsR9snrx4algbLlIjTtO4UW/aG8c/oUZUDVbCVx6lilNme4N3NWFO3Gg5TArMwagfoh7qtHq6wJE7M3Duu0GUV9XAvipeA== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:59 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:51 +0100 Subject: [PATCH v2 07/20] media: venus: core: Constify all members of the resource struct Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-7-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=2706; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=2igVAqX0VNw3fNZBRPW3xI6PegwRz7NA5+KLZ+WJ63U=; b=Y7nFOgWoxzW+xfFgI0rML0+tWKvbFCA3TQs/Nwf2AzFXA+IkV7piuQt7VgOVY3+o7nrSsc7H/ +E8YHaQRkrxBYhXeRsLvZZmvyVFRd9yxBK3UHiT6QONOW5zXQCNkUo1 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457414622442281 X-GMAIL-MSGID: 1790457414622442281 Nothing inside the resource struct needs to be mutable. Sprinkle 'const' all over it. A lot of 'const'. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.h | 58 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 6a77de374454..6b1887f7d9cb 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -56,39 +56,39 @@ enum vpu_version { }; struct venus_resources { - u64 dma_mask; - const struct freq_tbl *freq_tbl; - unsigned int freq_tbl_size; - const struct bw_tbl *bw_tbl_enc; - unsigned int bw_tbl_enc_size; - const struct bw_tbl *bw_tbl_dec; - unsigned int bw_tbl_dec_size; - const struct reg_val *reg_tbl; - unsigned int reg_tbl_size; - const struct hfi_ubwc_config *ubwc_conf; + const u64 dma_mask; + const struct freq_tbl * const freq_tbl; + const unsigned int freq_tbl_size; + const struct bw_tbl * const bw_tbl_enc; + const unsigned int bw_tbl_enc_size; + const struct bw_tbl * const bw_tbl_dec; + const unsigned int bw_tbl_dec_size; + const struct reg_val * const reg_tbl; + const unsigned int reg_tbl_size; + const struct hfi_ubwc_config * const ubwc_conf; const char * const clks[VIDC_CLKS_NUM_MAX]; - unsigned int clks_num; + const unsigned int clks_num; const char * const vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX]; const char * const vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX]; - unsigned int vcodec_clks_num; - const char **vcodec_pmdomains; - unsigned int vcodec_pmdomains_num; - const char **opp_pmdomain; - unsigned int vcodec_num; + const unsigned int vcodec_clks_num; + const char * const *vcodec_pmdomains; + const unsigned int vcodec_pmdomains_num; + const char * const * const opp_pmdomain; + const unsigned int vcodec_num; 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; - u32 vmem_size; - u32 vmem_addr; - u32 cp_start; - u32 cp_size; - u32 cp_nonpixel_start; - u32 cp_nonpixel_size; - const char *fwname; + const unsigned int resets_num; + const enum hfi_version hfi_version; + const enum vpu_version vpu_version; + const u8 num_vpp_pipes; + const u32 max_load; + const unsigned int vmem_id; + const u32 vmem_size; + const u32 vmem_addr; + const u32 cp_start; + const u32 cp_size; + const u32 cp_nonpixel_start; + const u32 cp_nonpixel_size; + const char * const fwname; }; enum venus_fmt { From patchwork Fri Feb 9 21:09:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199100 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1134634dyd; Fri, 9 Feb 2024 13:14:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFG8zYsdHIWDB85R4MMgbaD7S/j7bYMQgz4T9xi4BFQ7JFGNvM1tZRCv0vWRE5QPhzDsf/F X-Received: by 2002:a0c:cd14:0:b0:68c:7f0e:abf9 with SMTP id b20-20020a0ccd14000000b0068c7f0eabf9mr316062qvm.42.1707513280834; Fri, 09 Feb 2024 13:14:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513280; cv=pass; d=google.com; s=arc-20160816; b=rMpoNuRiMYaAYk2IzoJWuMvN9htX1RgJQ5+TK1BxBKw85igCgn3TXIqUDS9fGCRTPT QpKr6Yp7UL9PY40rykLg/R9sW4CnhcGj0wLVxcDbrv8eqIopVw6RKVzhu5pYC8GGFbko pEdF6n6tqonwh0hC3xOSikud+nK5ysZku4Erp8EsemRblV6m4Kv7PXQ/uF/Y+P+bLALj /+batjW2JDJUnWvEf7Xl08K5a3YL2i0VMr48WbvZ2vMun3gbe44+B2U/Osj+wq2ghu0Y bLJdOMxsw6TmyypGV92u+FOIhjtoyMgcyGwwKChY6/mOoCM+fLCRF6539Q+KaJbYdpg2 z81g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=PjYVvA6/x62tiGnPrd+cF2sjnvoUPDtV+GlugrRAEGc=; fh=gEjMU22Sq7mxmCIL6IGh9toj8PwWgWRnZxY4NOaltQ0=; b=eJEruToEjsDp2tqlNsToht75cqy+P7OpT3L+W9rIUOPRDYCKBZpw/B/ZNelinmT3Dm IhsdRFlCbgC1amEeXVSo4nL/9Dmoq+pjK/dwhBWNjhE4v1h36OK6qBMmE+M7HASSeMWo QZM4aNJESUxCxJG/lhoX49QaLoR5wyYLz5Bpnilpg+qTGaXQf9w04dG7haNtUQ5BTZLT csdOUi57EEwLf0WVWSb2l1RBlIZLOuCvhiwy9Sf1XveIuZAePJI/i/ccmKeJRscFEC70 jdnRfTJ6E3Ei/9QrJp0hYlaWLCbd7Z/CV5QxWPTwspYWOKAMes7q+Zhc73Zm6U3BGpH1 Wqhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uw+dS9PN; 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-59998-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59998-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCVo4iMYpvUWK5wO361LuQdETCcNyKHEFUM/ZhLnLl7Ro2uFq0tlmfB8yQpLiYbIs0FGZ/LlL68LMF/VGd+wuzm7FPAZaw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ke11-20020a056214300b00b006817965d028si2799866qvb.301.2024.02.09.13.14.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:14:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59998-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uw+dS9PN; 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-59998-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59998-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 834D61C21601 for ; Fri, 9 Feb 2024 21:14:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01B7E3D565; Fri, 9 Feb 2024 21:10:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uw+dS9PN" Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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 676BB3B79C for ; Fri, 9 Feb 2024 21:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513005; cv=none; b=l+ha/ioWSdc8//XR7f100+dBNPUeRexVKr6S6TlqRh81s73Ui883Q12RW8mCBTXJ8vwQvgC/QuHQ8rprvEzA11bvLbBlAUhNAwS5u/zrN3IINCul1WGT8e+sGH0HEBVkNJeEJY2gLlEpUakqGuzWADe6qMi+LJD57MV2Iiu3e50= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513005; c=relaxed/simple; bh=BxP6mknLkkhwH235J5PftaK8VpshDs1dIkEqExrl9fw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mHO6hnStztDggEocBabjKegIzkuo6wBtdi53ro5f8xo26iBbqPgnyJrcbR3YeXYKZZ5oHOWRZkj6Q6TAZiIH770ElbcN2ZJI0iX+fzHjqgmcVHe9VOfrwDBeRJtw4ohG19dLhAHeBlLF533talLI3VxplA5DkB3637I/+nDsH6w= 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=uw+dS9PN; arc=none smtp.client-ip=209.85.218.48 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-f48.google.com with SMTP id a640c23a62f3a-a26f73732c5so186402166b.3 for ; Fri, 09 Feb 2024 13:10:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513001; x=1708117801; darn=vger.kernel.org; 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=PjYVvA6/x62tiGnPrd+cF2sjnvoUPDtV+GlugrRAEGc=; b=uw+dS9PNWVj9wRNNOG5bzLY9bPK0Dxx+luF2Tlipv6M2tcvnsodddiOWFFWRunxwjO QBE4twoGsGieLmcRHnZTqYUlH+M/yNrJS4UkzYLZVBgliM4bG0xqFPd5UJsKfkeT/VFx k8W+9dC3fvtrd6KAy6vkoNRTAMvaMaebjp+hSxCwXKflscZrIieBzckTReamPRTfA3dU jYAdSpbIu+USe0eWZAOc72myx2N2NTIqg8p9iLxVS8KmHzzMfzJu6dN63oAGauX1KffV k2GTeJbGoC6nYPPv0exjPXAYxKs9F/bXfBOcCNSx1/bBqApMuQZNxWIM9jzKdip8zpUl SBQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513001; x=1708117801; 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=PjYVvA6/x62tiGnPrd+cF2sjnvoUPDtV+GlugrRAEGc=; b=tRdEElMZ5HzAC11dVU5Ml3v3UQjpcUPUWM6kq3F074AqG+BdO5vJEyuWpYwvAJJAHc 58Mu3VV/Z+EaJGuEPvcmhxbM2jijbDR7RHzOiIbAbn7qQ3waG34AlNEEDUT5j22CtQum LO67Cdg1OrWgr2LRZjtJdk9Le3g/TToi/kt5kZtu8hLBFEgKzwbnFF1aKX5PVqb9GiC1 Eeg2kqv17daR7ie69HdC7wDkn3Rn845F2g2G1wN1tyHZCcRttWGKvwakCMjrXcTF0kxT s2T3iI0tN1slLQV+vLFMNIHVe+80dl9Jc69hjUQCSpVJP/qKPWoFaoo0ISZq+W0ITCvq l+7g== X-Gm-Message-State: AOJu0YzAYsXtVN46QokdVRwwfWXFTqGtpog+ifvpdo08cGcH9fGKHU4A yKi29FqwlHwXZkXg6pe+zQsXAvv8hDQpFDprHfBjevXV21aO9plZwJqybpfGkfAG2vQurJVlR4b X X-Received: by 2002:a17:906:378f:b0:a3c:45e:77fa with SMTP id n15-20020a170906378f00b00a3c045e77famr152223ejc.11.1707513001665; Fri, 09 Feb 2024 13:10:01 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW3lTlfXWRs2C2UOrTagbsQew+Gmppxm8P6uAd4UeQ6vHAxDZQD/PFiYRdIu2Pvs6xsyGE5XhMSd6knHTNovwY0LdPfMydvGzPXievOL5F1E2IQvlL9loDKEaLeYW7NrSVwe4Oeknob8QeNkmGM3g5JIz+EL9mePMrikTdpopi1CPpnk8TASPJ5u+AR9r+GjjXwmT6ByDcuMXBB/AC+OKONvRvt4YvyNeYooeZDfbfteb6yfGpZvsP/N5bQCk7XsJYBxdiC+/+CiIUtqgi10pLMIOn51grS8/GvSPGknoLbjmA8alkfDSaHcKsdoOuJ+tdBvCBsVTlnk2WCBpHQaJSEru4eqiwKLcnQQI2mYfXbLxTHi+LKg2mE0idtTP7ibp2WYKb837rpctER0MHPZ8OsYBP5b5/lfa5B7CKLa5q6VRwA3YEk9zUHqCkppAQvGP24GZHNQUf01P6VOQDKYpI4aQ2CmqHlkHLnf55SzD8ZhHDhfZNsf0McnPDiYlnfreCcrw== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:01 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:52 +0100 Subject: [PATCH v2 08/20] media: venus: core: Deduplicate OPP genpd names Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-8-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=2465; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=BxP6mknLkkhwH235J5PftaK8VpshDs1dIkEqExrl9fw=; b=2O78uSJw10ViDsWmi83rvPytRhzx7ZDuSMlLSa+Uj9Pn4gvDUJGncWd8/wYFas8VOoMyqHPLS ZIpmbvLgizuBUi3m3Ie3kg93LDgEy+p1MBVHqKMajDDshiuVa9awE25 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457446066082001 X-GMAIL-MSGID: 1790457446066082001 Instead of redefining the same literals over and over again, define them once and point the reference to that definition. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 0652065cb113..83ac68f1566f 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -538,6 +538,9 @@ static const struct dev_pm_ops venus_pm_ops = { SET_RUNTIME_PM_OPS(venus_runtime_suspend, venus_runtime_resume, NULL) }; +static const char * const pd_names_cx[] = { "cx", NULL }; +static const char * const pd_names_mx[] = { "mx", NULL }; + static const struct freq_tbl msm8916_freq_table[] = { { 352800, 228570000 }, /* 1920x1088 @ 30 + 1280x720 @ 30 */ { 244800, 160000000 }, /* 1920x1088 @ 30 */ @@ -721,7 +724,7 @@ static const struct venus_resources sdm845_res_v2 = { .vcodec_clks_num = 2, .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0", "vcodec1" }, .vcodec_pmdomains_num = 3, - .opp_pmdomain = (const char *[]) { "cx", NULL }, + .opp_pmdomain = pd_names_cx, .vcodec_num = 2, .max_load = 3110400, /* 4096x2160@90 */ .hfi_version = HFI_VERSION_4XX, @@ -770,7 +773,7 @@ static const struct venus_resources sc7180_res = { .vcodec_clks_num = 2, .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, .vcodec_pmdomains_num = 2, - .opp_pmdomain = (const char *[]) { "cx", NULL }, + .opp_pmdomain = pd_names_cx, .vcodec_num = 1, .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, @@ -827,7 +830,7 @@ static const struct venus_resources sm8250_res = { .vcodec_clks_num = 1, .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, .vcodec_pmdomains_num = 2, - .opp_pmdomain = (const char *[]) { "mx", NULL }, + .opp_pmdomain = pd_names_mx, .vcodec_num = 1, .max_load = 7833600, .hfi_version = HFI_VERSION_6XX, @@ -886,7 +889,7 @@ static const struct venus_resources sc7280_res = { .vcodec_clks_num = 2, .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, .vcodec_pmdomains_num = 2, - .opp_pmdomain = (const char *[]) { "cx", NULL }, + .opp_pmdomain = pd_names_cx, .vcodec_num = 1, .hfi_version = HFI_VERSION_6XX, .vpu_version = VPU_VERSION_IRIS2_1, From patchwork Fri Feb 9 21:09:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1134865dyd; Fri, 9 Feb 2024 13:15:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXSfvHCIIf18tOQ9Xdq9r3xYKk2STeqLqCGWodDWPbQmhtxIHJQz+yCfnyr1ws9+iyDoGeFI+FLKZNgOWDYq+qMCndDvA== X-Google-Smtp-Source: AGHT+IHnQ4a/lnZ0G8hpXTeLtty1gqJs9YY/6oMOwQMVHFJ8/ZHE3SpItSvU4IOaYH7bOMpHr9Zq X-Received: by 2002:ac2:4990:0:b0:511:558f:f39c with SMTP id f16-20020ac24990000000b00511558ff39cmr189283lfl.2.1707513306900; Fri, 09 Feb 2024 13:15:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513306; cv=pass; d=google.com; s=arc-20160816; b=nLA4fs2YztTeYfTvh/C086ZfMCcnC/TUQBN9OypzsDnVijgY4+R61GDIc6dRQauWhM bZGYplmicvC55yo14sJy0ZoRVa9/a3bb3BANmgsdRqcDGFKkZ6y9K+C/sPszrfI44vXN AAdN2JVKLkpnT7tAQoTcogE7t12MFE88MkP0dA5Xm/oYTa4PXu4C+RvCGVC1ST1oW8uI /VrnY6Lw2TqCMkMWV2zn10XBrli/LXli0DdLziOCZx4AfYBjm7OpX/EzA0R4GCFgJSlZ A57Lp9novBA2SMHTFWyAF8lJ3f74Cu/KKGCmBeFxKTowf8HmCnzJsMSfgDO0670TAcHT 4knA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=cBIdOxdSkaLnpY2Xy7kKGuuvDn1LsIy3fb0GF15YoEg=; fh=GCvwtG5mStfOTpbqjypASxNIazgUJfifQj0e9v0w2ME=; b=kbJi4TnBd9nXTJJfxBXc1H20wOn0Xkk2p4kSuFeZKkBxNcce7Hg6JDiswNUOZgHZlL SppTt+bvzWp9dNkmmsVIoWPdbQ6fMILDCfYx9MpeEKYTIwIKeiRnybobggVscMSKGvGZ 7C/HZZNu+7PtoxmNTaIZaGPmMxtDbz21vRwiqc4pm7jOUL+ZCRh+p5QbW9XHvWSg8Vtw Guu0xUhctA1RCMGqI+51BXN6sgkfF2TVi8I7+r/kddjE507ZVLKjYhWCbJGaHH1q8y6e oPXHte6a4WXaxtGygt9ldZSjOF40rchkraJUZeT/bPMGk9OFkPXOCj7hCX5QomUKfcLf S7sA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vkfta0ap; 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-59999-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59999-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCUD5irdhSO/QrxpUZIgq5Ex7L5d+T6jabCejIDuWUScPz7W+Iw5VHu8V1OpRRN8zwUNzoEEJK8jVyY05I9dt5PY6Salfg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i12-20020a17090671cc00b00a3bd842466asi1189533ejk.241.2024.02.09.13.15.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:15:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59999-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=Vkfta0ap; 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-59999-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59999-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 59DA51F21354 for ; Fri, 9 Feb 2024 21:15:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCF713D97D; Fri, 9 Feb 2024 21:10:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Vkfta0ap" 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 E6C7B3CF6E for ; Fri, 9 Feb 2024 21:10:04 +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=1707513006; cv=none; b=cW8vQLuOsVZ7HTHAThpqZNzmdDnafD+oh45RyNo1LfLWkh9Cd67uWLMCbd8hOkI2X73WZPkj03Acm1rzFBfSARKVLwlRIeiyPYI8xfMKDLWjNnEB9Eb5v1hzlOCDJ1mNzDYd+oEowlVgVLwejD5O16udb4tHuDhDSk6bCpu3Zfc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513006; c=relaxed/simple; bh=Nc8bwLF77VvKlbJugx5YChhzVAEJFQcCZ1haIFmgnXs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uFKWEOpaRWxyT2zLL6SRJzU3U5Fw5EQt3E9o81A062XWEEY1N44t3UMNQvzHIxNy7i1JbUHNwjEJuSUVCerLd8SQSUuY2+ae0mdq1XIp4mPXj5jYmr5HJ47xC+2EE4lWly9AhR4cqxmkUSP2F3ipK7Mxlben3qaLzmQidwX2Ba4= 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=Vkfta0ap; 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-a383016f428so154986366b.2 for ; Fri, 09 Feb 2024 13:10:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513003; x=1708117803; darn=vger.kernel.org; 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=cBIdOxdSkaLnpY2Xy7kKGuuvDn1LsIy3fb0GF15YoEg=; b=Vkfta0apVABq+LMrD5q3GGh8pkFOIBg6oShfJe0sspOgu6LDgYSb9FEQB/jAsZWqXH t8wZFMU/wUHtgjlLq8NkSmayeHZu1t11oSZT7kobhVEpnxOJmtfxX5IZBjcmI8Niv1MY YTesAQSLCQCddsR3IWya1H0wTH3earHz4VN5tN4m6apPka9KPPABHwV05zVkeLlOEt03 b0aXRGjxJDT1YQ1VIiBpc7z4Uf35+ytYnJsukbZlyrC96l1FTrOC9yggVNxC25y+imny /S3QK35VJJiUGErHNmX7eBoIq6Z4tegcAbYY+pV3yhN3uu/W2XV98iHq5O2Lg8XTW364 Y1aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513003; x=1708117803; 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=cBIdOxdSkaLnpY2Xy7kKGuuvDn1LsIy3fb0GF15YoEg=; b=P2o+dnMCPeqTZm0gZsxh8kTg0bHtF+TvVKjK6WgOncTLxGrzjmqys0GlnhhN/4dklv 7a06c0iqmIC3JYfT/MSaQt2vAJ3q3OfqE5i1O69cRwmR7W9aGTHgtW4JM/n5F/lDKAsE shod4QlySfNDDCfcTf0IFV3qi9WO0+aB7aVzLl7AcMHRhE8BNu9V77fsbE4AVK/YwSbg S/fxUT9o2FgocRKFqhNKjTscHRfcVv/5N4DM2oTUi7UnWcHEPy1PAZ6QNIUORoeQfViZ QAnL36KOSgOJvDl4rYWzqfT35KYwIexvJL+a1OXTniNii9gEkUj6z1DL/iFbNzTT90Fs 6u3Q== X-Forwarded-Encrypted: i=1; AJvYcCXltdzRDLR0M85JyguRNgoJielZ1Yu5ts6DWJeRbQaKktbC1ech5WatzZJ952EmCCwQMlhIGRPkLQ/ZT9L+vhF9QTO1kiqtwgi/3ihH X-Gm-Message-State: AOJu0Yw3O5j6q73k8psdqbnGSiQEba+ExGxz7JVfS6Nq9EI/M1wiIATA Gpef3wyqBvpwed9iPDrr4phmIkF0pZpLdOfmWsXhdYJDENuUAtF/lGLbYPpgunc= X-Received: by 2002:a17:906:2988:b0:a2e:ad24:da8 with SMTP id x8-20020a170906298800b00a2ead240da8mr196858eje.19.1707513003245; Fri, 09 Feb 2024 13:10:03 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVGxDG2/AuEOpnUYKbMxOy8gJOwVXXY8PKb/8q91Orcv8ZA37JyCZ8VHWHwyt9OuW3GPX18oh+D8dN/3w/r14hxtqtcvPBzAcQpBKVNx2w0j6qv+cpF5VWoj1arHgaSrkf3FpGhIyAhSLwOw9jHhTE/VAgYxtJlEGMxDMvyxbZ03Xnmw1N3KFGxe9346YBRop2lj25mooETIF2gGH3d5IPp2XwbbXETECgn9ZR1Slvq6LykEAU08qWGUlKgZjahAjYPriHuTeqg7sa2FzV+C8kNyApDaT1IjqG2EmxkTCGVkr+Ru4yEbpaOxgpmFFip79jHiHEBhJ+Tt31REZVvjgN9L6RSlQt+kKUuF0EnBygeEJWkAYMTf+g8fQ3dTaeTtwU+Zu4PdLg9FeKi7L7i6fmX1lzDw4W+iDukgBa8hkRMS2RaXOxXgb+LLWT4lJmEd8+vy2m8SfzUINuuoR6UdMfX51RG7mIGxKrxdD3z3isNdNuYiyjgsZkjLlz/BfqrrIxzaw== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:02 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:53 +0100 Subject: [PATCH v2 09/20] media: venus: core: Get rid of vcodec_num Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-9-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=3437; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Nc8bwLF77VvKlbJugx5YChhzVAEJFQcCZ1haIFmgnXs=; b=Nd+zrzm1xfFXbo15AgzTjIPqJpUpwEHOn9xZqBbwsZ/j8927xZCb+EQYt9O6uFq1THjP3Wuz3 Fh8rUawPtmPBXcezt5bFmEfM9N4XVETwds6JQbnCBIoHJz5ZPNGnz6L X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457473151979654 X-GMAIL-MSGID: 1790457473151979654 That field was only introduced to differentiate between the legacy and non-legacy SDM845 binding. Get rid of it. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 5 ----- drivers/media/platform/qcom/venus/core.h | 1 - drivers/media/platform/qcom/venus/pm_helpers.c | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 83ac68f1566f..1307aa9cf951 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -651,7 +651,6 @@ static const struct venus_resources sdm660_res = { .vcodec0_clks = { "vcodec0_core" }, .vcodec1_clks = { "vcodec0_core" }, .vcodec_clks_num = 1, - .vcodec_num = 1, .max_load = 1036800, .hfi_version = HFI_VERSION_3XX, .vmem_id = VIDC_RESOURCE_NONE, @@ -725,7 +724,6 @@ static const struct venus_resources sdm845_res_v2 = { .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0", "vcodec1" }, .vcodec_pmdomains_num = 3, .opp_pmdomain = pd_names_cx, - .vcodec_num = 2, .max_load = 3110400, /* 4096x2160@90 */ .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, @@ -774,7 +772,6 @@ static const struct venus_resources sc7180_res = { .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, .vcodec_pmdomains_num = 2, .opp_pmdomain = pd_names_cx, - .vcodec_num = 1, .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, .vmem_id = VIDC_RESOURCE_NONE, @@ -831,7 +828,6 @@ static const struct venus_resources sm8250_res = { .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, .vcodec_pmdomains_num = 2, .opp_pmdomain = pd_names_mx, - .vcodec_num = 1, .max_load = 7833600, .hfi_version = HFI_VERSION_6XX, .vpu_version = VPU_VERSION_IRIS2, @@ -890,7 +886,6 @@ static const struct venus_resources sc7280_res = { .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, .vcodec_pmdomains_num = 2, .opp_pmdomain = pd_names_cx, - .vcodec_num = 1, .hfi_version = HFI_VERSION_6XX, .vpu_version = VPU_VERSION_IRIS2_1, .num_vpp_pipes = 1, diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 6b1887f7d9cb..22f998637618 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -74,7 +74,6 @@ struct venus_resources { const char * const *vcodec_pmdomains; const unsigned int vcodec_pmdomains_num; const char * const * const opp_pmdomain; - const unsigned int vcodec_num; const char * const resets[VIDC_RESETS_NUM_MAX]; const unsigned int resets_num; const enum hfi_version hfi_version; diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 6017a9236bff..8412deb68ed1 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -622,7 +622,7 @@ min_loaded_core(struct venus_inst *inst, u32 *min_coreid, u32 *min_load, bool lo VIDC_CORE_ID_1 : VIDC_CORE_ID_2; *min_load = min(core1_load, core2_load); - if (cores_max < VIDC_CORE_ID_2 || core->res->vcodec_num < 2) { + if (cores_max < VIDC_CORE_ID_2 || legacy_binding) { *min_coreid = VIDC_CORE_ID_1; *min_load = core1_load; } From patchwork Fri Feb 9 21:09:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199102 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1135044dyd; Fri, 9 Feb 2024 13:15:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKCYIGBrJdby4I+bN0g3hHHKlNVpSmzJTjNAZAgKCFxOlFZBnvTW6f1nV8Rto/8MkBpFsa X-Received: by 2002:a17:906:fb08:b0:a38:a35b:69be with SMTP id lz8-20020a170906fb0800b00a38a35b69bemr188111ejb.14.1707513329633; Fri, 09 Feb 2024 13:15:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513329; cv=pass; d=google.com; s=arc-20160816; b=DFt3xb0pIDbleXl2OlFcQGxjWP+xo+B9/wmrnLYFnwmLhlsYSo3DBjD2lBCC28ER0p k6QLCnWWURQLVi+k+LWoRNmp9s/S6TPDFgHdZMYRypOPz7POHL5YRFfrz0reW0tFZX4m JjFlo8cuWzndqzYmJE/2iq3LInD6ghwUYBORpVHam17J8NkPo53zWXA/ZTzHFF6sRQBN fjocUGt4faCshU32DivoR4EwRuIPDKHvWJXmCIFUGderH8yvo0hcjDmH/EcFyWfXh+8g l0voEvbJXsNX2bg8O4m2QSBxv8fJoYApFsHXXLffxCBIByDCrC2l1d5yME5VDeCvB5ha evxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=CHHNIP6WO0gU8OMi/VaI5bJNCojpf+yHVI+2cBfLhcM=; fh=hNrd94OhaW3r5EM05FMG+I4azWiYmCTO2u09/QTDUe0=; b=PZztHl4m4QLNOjOSpWLpH+BT/DCS8tprYLqVpmzpimcGY2LSSxXxtVFvoT12drVJTX 2wa0Pzjt1H7UGAhUTWVLqAXYagHaWpsiWIUHkDKIfyklo2mQmAIEG2dKxagwOZ/YUoJk nBDHYa5XCpzepOvs6alffwTUMXDkZ0mxSos3a0hd9NMHAECC19aOHcFtxSuGtj+uKrlL 7PwEznDuNK38DZKlxR+deBLgUEjMG4S7bj3zqJ3SrtUrIa9WKDkHYCjtPke1EI66l+yR ZSVfdOj1frVoadx70RP+N5YfLmMmz6LQJ7ozFKhjjaKOaRekHvwUjSl0Vdduf702lwuP m5yg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XbQV9NqJ; 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-60001-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60001-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCVYhVVE6HiGukkEQVvUVAfRBuj7eintUjHjD/BgLaIdEySDxwIpUBulg7kHbd1Yh0UK/0I1qZrUpckOnnmcgHOqQzQP+Q== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l21-20020a1709060e1500b00a3c1a9e14absi173939eji.803.2024.02.09.13.15.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:15:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60001-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=XbQV9NqJ; 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-60001-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60001-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 198731F227EB for ; Fri, 9 Feb 2024 21:15:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B57F3D967; Fri, 9 Feb 2024 21:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XbQV9NqJ" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 338EC3D38F for ; Fri, 9 Feb 2024 21:10:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513009; cv=none; b=SwlsWwPF3ifBE+Rr/hfc5CKxUoExHKXyhws1tGpopKp5Ws+JmKrKUDNT0sS3Qr4AQ3pR6yD/cJ8xRPT5ugKAviENEYnUQo/gTNwe/+Bp50kyaDze3eslb36n7Vh0kltAluo3gfVdw2osP1vbr6KY2uds1jpT3La9RhmlTv3ifp8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513009; c=relaxed/simple; bh=jJfC467DwKCxWKXFg5drWkI8bmv02/WCRY1D3IsQV48=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NwD3kCpf9Kr/zkwn1N/FH03FEcmq/0Nu6xUhX1zIY6JBa9zEgvsCFZZVgZeeqOWcDm8wPJ90VJF913pl0SNWxhkmk5Rei8KukWV0QGIgz9hxsqc1BHXjcrvitpf9jmknxi/rHe1Q8h6rCNP/x6e0Jr6Sz4rj1h7P6erDiKF5ULM= 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=XbQV9NqJ; arc=none smtp.client-ip=209.85.218.43 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-f43.google.com with SMTP id a640c23a62f3a-a26f73732c5so186409266b.3 for ; Fri, 09 Feb 2024 13:10:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513005; x=1708117805; darn=vger.kernel.org; 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=CHHNIP6WO0gU8OMi/VaI5bJNCojpf+yHVI+2cBfLhcM=; b=XbQV9NqJu3uAOFwTnlytVqEfbGhLN8OhYtDSlU1QminDbK3eId3NRdU95EIn/bHfZd 8p/IjdlxdcpRaOXEYsXAb+mE8nXgxa8td7CBiLge3qrKaicoSRWA2UxGGaqpLD0wqVBk QT2bdJIOgqyYowwJuUEeialU6e1WjaKjg90bjq4KL+AHCv95/lgU4pNvmL+gXA3QuN5l u3rKFEdzo5tcg2Y9iXcPKst0ioGHSCkReQPUrcerjM+oUBnOH7TI8Xu0b/65VL2cxVfD p3r7bUgzrjmLxlk5cUQ+oJRUIrIUlOputhuIEBqqwU9acdrQCtwZjHuLnQkRkgW+Mb/e wu1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513005; x=1708117805; 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=CHHNIP6WO0gU8OMi/VaI5bJNCojpf+yHVI+2cBfLhcM=; b=kh8f/y+YhUh7Wea1wsrsNrDLXmc+UFBLEenn92UGWMvU5HBDcDuKSyIs3TyhqCJ6ad b1m07XgPE70n3NNnMbWMMGTCoL6/W2zRdQ6s7aALb0nnvc2cXO47NUSjtUWfE8OodkYQ uPgUINDp7MVlMP0slr1gSSb7H0vX6+dPEbCJItgl1Nax+SuVLGDou9pWhTJ4IrmUB1B6 Wf9SQAnBa/8lb+e4jDtRD3dqqJb6zwNvv52dz84z1w+G0QHqtx9q/gzYfCtkcZdAhcLR JcxJmGw6QR6ptFbcATDA0P6j4jpf3t/4iP5Kt39wuwjxLZeMEDyI62uGhwOQarr8DqCN EqxQ== X-Gm-Message-State: AOJu0Yw2kAFPm86WEZL43UjKX8Jko24hdo1B7JElNLl92sPhLwVg3qx+ otfXfGdYQOoHzCMIU/TCGDoN8XbtG0e/ucz4K/Z3bP3GxqdEda4Rg4IxTz2Y0uU= X-Received: by 2002:a17:906:f854:b0:a38:3282:baf0 with SMTP id ks20-20020a170906f85400b00a383282baf0mr149252ejb.75.1707513005496; Fri, 09 Feb 2024 13:10:05 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX3nxrvLuug7z8HIMwzF5pJaONxq4VyQ1uei7niONjZO8hCT9RxKe3HKb10yHWsDMd5tmy1PlwwFwH30BdlAGx3d9elZTlrO6AFtiKdzLVjCSKbXgKNeFeInYUQJsCCe18PzwZNxV2C0u0udn/YVNgp73w3VMAgTdlqgSOqObjbb9e/W2/L2/Q6s9mcdWRDa3m9L3EWHLadCAq+GQ5TJ4BW7RlqV5RGt/F7+0ig91FA69dNdbFpejt/5JWjsuHxlUO5hFECDQ2X1oNzDORFufFWH2pqBTiASyZWrjbWNtoHXboBoBZz7t5nDxfkVQ7OK2kTSAYs32M2gpF0lxTGbV1KQhaR9xPbdb+DblBajXCvpZbvnw7ZGtDxziCKzw5FFowVdKLEOx0JO6DxCrXFt0kWdZAhR2ZrfY90wz3aEc+3jMQKjHulJGqsYp+N213xk8pvxZ5mXI6hfyBp6kS8hmn4Vb6WIJm9ReAa+pPE+3m7xp6dWzmOTwAVxwOiYvi2uM2adg== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:04 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:54 +0100 Subject: [PATCH v2 10/20] media: venus: core: Drop cache properties in resource struct Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-10-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512985; l=5254; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jJfC467DwKCxWKXFg5drWkI8bmv02/WCRY1D3IsQV48=; b=UrjaBNsJnTP3co/PybDHFEc1BH/J0yF4VkvNl7d5QtYigamNSZHSR3tZosOJ3woABlRgxaYwg c3GZ4Kmx+YdCUW49F1WGK8iVLTkODXwXrAvG+Le8pQjSlrq9Njl2F+l X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457496636811555 X-GMAIL-MSGID: 1790457496636811555 Currently VMEM/OCMEM/LLCC is disabled on all platforms. Make it unconditional to save on space. These caches will not be enabled until the Venus driver can reference them as chunks of SRAM (they're modelled as separate devices) to avoid hardcoding magic addresses and rougely accessing the hardware, bypassing the normal accessors. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 24 ------------------------ drivers/media/platform/qcom/venus/core.h | 3 --- drivers/media/platform/qcom/venus/hfi_venus.c | 10 ++++------ 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 1307aa9cf951..43105e765c53 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -562,9 +562,6 @@ static const struct venus_resources msm8916_res = { .clks_num = 3, .max_load = 352800, /* 720p@30 + 1080p@30 */ .hfi_version = HFI_VERSION_1XX, - .vmem_id = VIDC_RESOURCE_NONE, - .vmem_size = 0, - .vmem_addr = 0, .dma_mask = 0xddc00000 - 1, .fwname = "qcom/venus-1.8/venus.mbn", }; @@ -595,9 +592,6 @@ static const struct venus_resources msm8996_res = { .vcodec_clks_num = 1, .max_load = 2563200, .hfi_version = HFI_VERSION_3XX, - .vmem_id = VIDC_RESOURCE_NONE, - .vmem_size = 0, - .vmem_addr = 0, .dma_mask = 0xddc00000 - 1, .fwname = "qcom/venus-4.2/venus.mbn", }; @@ -653,9 +647,6 @@ static const struct venus_resources sdm660_res = { .vcodec_clks_num = 1, .max_load = 1036800, .hfi_version = HFI_VERSION_3XX, - .vmem_id = VIDC_RESOURCE_NONE, - .vmem_size = 0, - .vmem_addr = 0, .cp_start = 0, .cp_size = 0x79000000, .cp_nonpixel_start = 0x1000000, @@ -702,9 +693,6 @@ static const struct venus_resources sdm845_res = { .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, .dma_mask = 0xe0000000 - 1, .fwname = "qcom/venus-5.2/venus.mbn", }; @@ -727,9 +715,6 @@ static const struct venus_resources sdm845_res_v2 = { .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, .dma_mask = 0xe0000000 - 1, .cp_start = 0, .cp_size = 0x70800000, @@ -774,9 +759,6 @@ static const struct venus_resources sc7180_res = { .opp_pmdomain = pd_names_cx, .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, - .vmem_id = VIDC_RESOURCE_NONE, - .vmem_size = 0, - .vmem_addr = 0, .dma_mask = 0xe0000000 - 1, .cp_start = 0, .cp_size = 0x70800000, @@ -832,9 +814,6 @@ static const struct venus_resources sm8250_res = { .hfi_version = HFI_VERSION_6XX, .vpu_version = VPU_VERSION_IRIS2, .num_vpp_pipes = 4, - .vmem_id = VIDC_RESOURCE_NONE, - .vmem_size = 0, - .vmem_addr = 0, .dma_mask = 0xe0000000 - 1, .fwname = "qcom/vpu-1.0/venus.mbn", }; @@ -889,9 +868,6 @@ static const struct venus_resources sc7280_res = { .hfi_version = HFI_VERSION_6XX, .vpu_version = VPU_VERSION_IRIS2_1, .num_vpp_pipes = 1, - .vmem_id = VIDC_RESOURCE_NONE, - .vmem_size = 0, - .vmem_addr = 0, .dma_mask = 0xe0000000 - 1, .cp_start = 0, .cp_size = 0x25800000, diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 22f998637618..b1d0687d294f 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -80,9 +80,6 @@ struct venus_resources { const enum vpu_version vpu_version; const u8 num_vpp_pipes; const u32 max_load; - const unsigned int vmem_id; - const u32 vmem_size; - const u32 vmem_addr; const u32 cp_start; const u32 cp_size; const u32 cp_nonpixel_start; diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index f9437b6412b9..42ff96f71235 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1067,17 +1067,14 @@ static void venus_process_msg_sys_error(struct venus_hfi_device *hdev, static irqreturn_t venus_isr_thread(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); - const struct venus_resources *res; void *pkt; u32 msg_ret; if (!hdev) return IRQ_NONE; - res = hdev->core->res; pkt = hdev->pkt_buf; - while (!venus_iface_msgq_read(hdev, pkt)) { msg_ret = hfi_process_msg_packet(core, pkt); switch (msg_ret) { @@ -1085,9 +1082,10 @@ static irqreturn_t venus_isr_thread(struct venus_core *core) venus_process_msg_sys_error(hdev, pkt); break; case HFI_MSG_SYS_INIT: - venus_hfi_core_set_resource(core, res->vmem_id, - res->vmem_size, - res->vmem_addr, + /* Disable OCMEM/VMEM unconditionally until support is added */ + venus_hfi_core_set_resource(core, VIDC_RESOURCE_NONE, + 0, + 0, hdev); break; case HFI_MSG_SYS_RELEASE_RESOURCE: From patchwork Fri Feb 9 21:09:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199103 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1135130dyd; Fri, 9 Feb 2024 13:15:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWgqzW/JyRXsZKu+pwCZl5FAsuZQ1eqvLcBVWxupAjJ9xyOq53mF+Cyb/HTld7ChaaL3XeDL9wosn7gMbP7O08lcJGiVg== X-Google-Smtp-Source: AGHT+IF1m3ZQ57TDcp9nGO1EiV1eluLmd/PGCaf0SwMcMgATfgIads+W+U1oH7SbMJLfcCGBxOwg X-Received: by 2002:a05:6402:360b:b0:561:f03:f41e with SMTP id el11-20020a056402360b00b005610f03f41emr2149859edb.0.1707513340256; Fri, 09 Feb 2024 13:15:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513340; cv=pass; d=google.com; s=arc-20160816; b=AYLzcxvZ++CkffjnlcryFwZ4mh4hlQorWD2miAWeWbPBiU3NbjFEbgv2/iavXMDmpP vpDR6lu4+sgXlmzpeO1ouJjL8d0IaYuNwvly3BnvWFfh/tWtY37SEtkPlptyGdtWJ9Jt UFYOmx62BqFaMc+hvwL6SFcgRXnm7e3Oy4Rb9kNkRQWKQuFEEd8Tnm47qNyBHZhrroT1 okoiZcyjtxjP5Q4QpVXDWlpCQSvKH3A2M1kwHiGPCcMfTRRNLbEcmAEoEiuNPBGgE7+5 SjAnyvDbVWFXoqbQcI0vPKBmkKD1Q3dThDL+QS6ds4BFASx5STOrNgE59uZfRh/op7ts XjRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=WkisGcwj7EZsB2uxQJKfFxLa5Zz/RB1HixKJSSlCEXg=; fh=TWkpnR9AGFs43YD0+myq2WvaOF15ozeGZ4Ep0pGQaNs=; b=ddNAA4RtI1JVO7I0MySBwYhX2jHLUuW8gHUAl+beKHIOgpDvSdRUtc4Ifu2c0+iI+x WYVCmJGyKugfDqy0EcPPD1wv8b9VL0ww01VmAxz8vDgdCSiZ0v07NEj/JS5zdfVJV3ec 4SOVU8k0ryZXsPOesuDT1G+oCAuUXFJkSxsXe69mGgZGSC1tbZZaahbDwjR8k9h9L7H1 lB3dPWhrrf7LPapaKKPwL3qrhBqnh2GHf88XofR00G19mj9u5EaOjMRtcd0xMUWcfEam PBvrzi80Dl0uAvPnmP0wr1Z7cbRPAjtfSpfKLvGPsO+9HEDScGM0Tu04dChSkjXFkIIB i2KQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dwUObXyk; 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-60002-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60002-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCUtqBu6/SnT+R5kvhZbWP8W4GAoi0bYkpAWu7S14dmrB0DqJnnK1ePEWnnvnkNV+/AntN9JQXaGPhYAcHF9VlGLPlTXZg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i15-20020a056402054f00b0056012ce9cfcsi114323edx.560.2024.02.09.13.15.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:15:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60002-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=dwUObXyk; 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-60002-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60002-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 B41D01F21F5E for ; Fri, 9 Feb 2024 21:15:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17CB53E498; Fri, 9 Feb 2024 21:10:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dwUObXyk" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 C89AA3D0CF for ; Fri, 9 Feb 2024 21:10:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513010; cv=none; b=hWLxbLTZ0YDis6sEaPnPwfzJ/1Sx3ExKgnkV1g1bz9ldXBTVPhscCrpDHM2ZjQ05GfEuUAW/h7FKHjkyK2fil6yP2nqwklzqHttSONvaRJypP9wnhYtg42HDK1um/JFDDnJz7HhC7xA07kSekmhUKaznlk71s0V4OJ7SFixxtpo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513010; c=relaxed/simple; bh=jT4cYVE3H7d20Q/uwPs8NimA9d74CuArTIfCuOqGfSo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MdtOY9NPh4FTpXwH/RRmzC+ONQra/As2Mn4m29I0zJ3echM9OwDvbAvRUp94fPqJIPENaFJR4zHWsqkVmekbSai+MXJd1sHdMWLPeHx9OY0+wU4aZKnmqu8CFQdbQK+Ht0eMsc7teCsCX6hJ7J5qkpw4m1F4xPghOktZFFUI0zA= 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=dwUObXyk; arc=none smtp.client-ip=209.85.218.42 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-f42.google.com with SMTP id a640c23a62f3a-a30e445602cso482881266b.0 for ; Fri, 09 Feb 2024 13:10:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513007; x=1708117807; darn=vger.kernel.org; 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=WkisGcwj7EZsB2uxQJKfFxLa5Zz/RB1HixKJSSlCEXg=; b=dwUObXykmmsUQFUV7bkwhGtWVRvqLux/q0/d8b6wzBxOieQk9paU81JtAnXTQRJo1P fAjqLlTX8YQaTzFzsc1kAB+Tnr2wB3qvR80qNQCPtFewHTpph6E8EuDkIjC3Pzj5y4h8 6xTHvaTjJwN1X+EhIThDPu411XsrCvGHZfvQpBphoHTFdv0qNdWHwHOWsLjBqMXmEMIb uj0gE82cN3TnrwEqK/8BXP0B6LMR3w8pK5JbrGIkMmRRUI8QKWUg2hKB7Unm3cyHnl1O 3eo9Gxw0eVjccEq2hCLYNrQlDxaMmc8NebRrLWywi8By68+as04orn5PRzd0ynzNGQEz 8+Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513007; x=1708117807; 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=WkisGcwj7EZsB2uxQJKfFxLa5Zz/RB1HixKJSSlCEXg=; b=Fzj7QGYO0JoQNfAoQTqFpGHnh0pPemPxaO/qpR1IiJXUjpHXriSYEPb5BdMghA8743 qvJDuamsR1/ZOmGYTXLjEZhMy90mJhczVKpiF7/8H1bw+0gBVo70GwGQG0n8h6tSQJH6 51KagOc8crll7BY550LWbsvhtuVEJ482Vm4DgYzFbTGr6gccRtwN7meZ5dbXBBOwG7tB d1+iSt9nc80yvxY66UJYNxrv0g4mlqnJ2KmuO8dNXQCmNQuYN+xBTpCDS6IgF6a2U8Bo sVm0Fy00NQm6eA+PjA3DKS1d6ztVm7O+y0uAeI7A4ZFz9DzBrKawe4L9v33gzmI8szWg P+Cg== X-Forwarded-Encrypted: i=1; AJvYcCU0eUwSYN2wEVIapGPEyuaWI53TaPUtY6UFED2AN+CJ3bDBgaaAli1Nkqxg1KygNGItHvv2dDtpdJnyXOvKI6e4f5lW6o/8dzznRVKD X-Gm-Message-State: AOJu0Yyg+Tt2elHWzu+kEqeAaWRJpPJXMTC7fMicvdQYI0LzRX+9GyKQ pdvNLCjB1CaQ4kc+rzjrFJDP5QfoJT/u67p35uEfjAvN9MhQ9bBfojOAsI/KBNs= X-Received: by 2002:a17:906:370e:b0:a38:4f6a:4e7e with SMTP id d14-20020a170906370e00b00a384f6a4e7emr261180ejc.32.1707513007230; Fri, 09 Feb 2024 13:10:07 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU8qP6K965v6pwV2jGGur2yfOhYX9UkKJcDNbPkJzFLgrzHOvxp4AoTJa1Sm2nuKXPyws3QTpEbCik7ElfeFzX8DpIFvy7t/WA9HOiswLIl/qkqtiKoYF2gcILrvpHx/xVIJXIHc2omny6cad7YDa4lU1pFwu2gLejfRKaDfgO2WrM+kXvBtffyKLFMn4+UhX9m7lMJifL7mV+epibggxhqbXS/ZUi7S5EsOPGARKkJ2h7ItEXSGz0nPY1p1ROdMLhh0AU1bkR64tlfzcxJCz4BRio0toD6xBbx7db3x7/+XssoI+Ob3FxoXBbJH9S+p+CY12XJIZbPiDrz2pdAdDTQFtnTqDVajRJv81Cu4HgjZt1JKa5MQxbXUsyFNnv3hcUdaeNHg3FyfptLlleBOmTRBRf4VxvKJyke7E78hrMQvNGKIu7iD26ymC/uBfecI7MCKBmC0KSUPwQl+otnxMLWCb7M3xoVnV8Jb1sZ9cFLoyjJcNJCqJDmmVlvRiNxtpQjRQ== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:06 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:55 +0100 Subject: [PATCH v2 11/20] media: venus: core: Use GENMASK for dma_mask Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-11-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=2706; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jT4cYVE3H7d20Q/uwPs8NimA9d74CuArTIfCuOqGfSo=; b=klquj+6pOLak7Axq6ddq02Jht/IyRARYQgLefOrwlb581p4+JvxIEmi6OHz6/y61S/0AJX91F bZPG5shtVjqAhAAVOPKTlhsk+dNJHgvmzrbytoDKJ43RPIJf1MukBPz X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457507972309570 X-GMAIL-MSGID: 1790457507972309570 The raw literals mean very little. Substitute it with more telling bitops macros. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 43105e765c53..06b78e98cebd 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -562,7 +562,7 @@ static const struct venus_resources msm8916_res = { .clks_num = 3, .max_load = 352800, /* 720p@30 + 1080p@30 */ .hfi_version = HFI_VERSION_1XX, - .dma_mask = 0xddc00000 - 1, + .dma_mask = (GENMASK(31, 30) | GENMASK(28, 26) | GENMASK(24, 22)) - 1, .fwname = "qcom/venus-1.8/venus.mbn", }; @@ -592,7 +592,7 @@ static const struct venus_resources msm8996_res = { .vcodec_clks_num = 1, .max_load = 2563200, .hfi_version = HFI_VERSION_3XX, - .dma_mask = 0xddc00000 - 1, + .dma_mask = (GENMASK(31, 30) | GENMASK(28, 26) | GENMASK(24, 22)) - 1, .fwname = "qcom/venus-4.2/venus.mbn", }; @@ -693,7 +693,7 @@ static const struct venus_resources sdm845_res = { .max_load = 3110400, /* 4096x2160@90 */ .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, - .dma_mask = 0xe0000000 - 1, + .dma_mask = GENMASK(31, 29) - 1, .fwname = "qcom/venus-5.2/venus.mbn", }; @@ -715,7 +715,7 @@ static const struct venus_resources sdm845_res_v2 = { .max_load = 3110400, /* 4096x2160@90 */ .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, - .dma_mask = 0xe0000000 - 1, + .dma_mask = GENMASK(31, 29) - 1, .cp_start = 0, .cp_size = 0x70800000, .cp_nonpixel_start = 0x1000000, @@ -759,7 +759,7 @@ static const struct venus_resources sc7180_res = { .opp_pmdomain = pd_names_cx, .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, - .dma_mask = 0xe0000000 - 1, + .dma_mask = GENMASK(31, 29) - 1, .cp_start = 0, .cp_size = 0x70800000, .cp_nonpixel_start = 0x1000000, @@ -814,7 +814,7 @@ static const struct venus_resources sm8250_res = { .hfi_version = HFI_VERSION_6XX, .vpu_version = VPU_VERSION_IRIS2, .num_vpp_pipes = 4, - .dma_mask = 0xe0000000 - 1, + .dma_mask = GENMASK(31, 29) - 1, .fwname = "qcom/vpu-1.0/venus.mbn", }; @@ -868,7 +868,7 @@ static const struct venus_resources sc7280_res = { .hfi_version = HFI_VERSION_6XX, .vpu_version = VPU_VERSION_IRIS2_1, .num_vpp_pipes = 1, - .dma_mask = 0xe0000000 - 1, + .dma_mask = GENMASK(31, 29) - 1, .cp_start = 0, .cp_size = 0x25800000, .cp_nonpixel_start = 0x1000000, From patchwork Fri Feb 9 21:09:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1135408dyd; Fri, 9 Feb 2024 13:16:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOyga/K772XVNGHA6gylbrmgm4NQEZ/WRUll9xAHiqUQ7VdyKnaXDcU1Cv0vcgZRREcZI3 X-Received: by 2002:a17:906:6808:b0:a37:2932:df1 with SMTP id k8-20020a170906680800b00a3729320df1mr177569ejr.29.1707513367690; Fri, 09 Feb 2024 13:16:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513367; cv=pass; d=google.com; s=arc-20160816; b=nLC0zv4tcwtc1IFjCpeTyw3s98nU0ORLLpkAM1K1hKfRI5T5sgiKxDqfWT8b0ApIFm Nd6rthE1TzfVLa3EfooNs2bY2Fz2euQ1TAk/ldQrcoi6OuX9a9EpcpqoQ10+UY87X+p7 LXv47ByHJf/RuDq7zNCJHpNa/lYV1Dlr3w+jHnUvw6L7JUMlyViMfXk7z6S+sHT9FoSq VRaLvHeXhfcPuOs/1x2GUA8obDhnpCcs8UchWiaO/+BCCdvXnkzDWsIx9AU7rXO8C7e/ mNrawVIUeAtQNRKT0b55qbPOWWheZu37yP5XI0+nnNIxaA/B5ifRJUS3JGB5p96+KfnE dBoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=P8GIqzjr5F0muhdfu+nSlnTYCrXU9jfYOiTVyQ6Sb9U=; fh=VaibGdte3GSr8XvutsOPCfszARzgMoGePwaig2vMBIg=; b=aIpRYvS07+eVcQygJbq4PjIAMoyBgSUOeBG1tDMERzD+R3qRsG27ysxqkd69n6jYmq ughjwtRywduXxs9B99KSljycNHb1dNbU9I9iL471Adah1f64ZpC2pEtvppvvzosu6tvA ooeJSOfGAVSWheU/jyriUaO2iHMIZ1tb3korHQtqYp0u/nRCzPDE6rSXf2k37UssrMb9 8f+sMU8KG1ncbDYcmxtOXFhQCvrs3fpVF7fk7uOoTBzq4bKepSz1zIT69zksmWdAqyfq q43luH+GEHZM1bxTAnpCdtnX6Vv6B2pOrRPUy7H2OpcjH2CX7bX8AKVPECB9AMrup4Ja q2Zg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qC+7pgNL; 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-60003-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60003-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCWGh3XmUDwu8dimqDddg9bHSepz7r5lI0zXShidhJMT2OLvFjtVa4cBCozzChz+kDqPmAChtVbPri0udaf7tj7H5gszxQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t23-20020a17090616d700b00a3bdd15edddsi1137438ejd.580.2024.02.09.13.16.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:16:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60003-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=qC+7pgNL; 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-60003-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60003-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 29C1C1F22313 for ; Fri, 9 Feb 2024 21:16:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 364E23FB1C; Fri, 9 Feb 2024 21:10:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qC+7pgNL" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 4734F3DB86 for ; Fri, 9 Feb 2024 21:10:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513013; cv=none; b=tNe1sixv07qKbOjGY4Rs173C8OK8MaKJUiIQZZVa6fN8X0Hwq8Pkdqi0Dlk5YrA3SOifnO6l1XEGCpBKNNE3xnW7xj8osYF5sGBhI3i4uZy1lqAuViCNJ6LOyF7egvba8QUateajRUpH1Lfxr28w+5OHIGMQlRTt1nZ2mEzTayk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513013; c=relaxed/simple; bh=/kFnbapgubNRtfX1KEblqNgRWZdEMPDSWK83uPCG7ls=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Sgv0yKvXQhLazbNegipbCzA7xVOa4y2A5aCJsGJG1M0wWOoHXpRlWG/f35HQ15/k5b+LGr7nxz85SkSRKUnCycw2D+n0yKeQ4/pJtybR2u8fTGW//GN0BcDzgquGl3UyLyt1tsgvUxfyuzMcM9B8S5iZaD9SXLPwGdmeZ702veQ= 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=qC+7pgNL; arc=none smtp.client-ip=209.85.167.42 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-lf1-f42.google.com with SMTP id 2adb3069b0e04-511616b73ddso2311985e87.0 for ; Fri, 09 Feb 2024 13:10:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513009; x=1708117809; darn=vger.kernel.org; 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=P8GIqzjr5F0muhdfu+nSlnTYCrXU9jfYOiTVyQ6Sb9U=; b=qC+7pgNL2hqTjlyL0taRYFtGe700EWUItg4BXiyX93XWpv1eemsCeLdlJrWgk1WA+y B+yXAwliaTjSYMldnkhxlAZWZjzDCIIE9zohzoAXL3ibCGXhlpjNtHdY/AujqE/g779l qZSifBUe5tFfLm9eIiNUqvfr5DrFzDbATFcFrvRGVc1abnBwdKzNVEqKTeX0NRfctXdu ds5jtJcw+jJ2Pc208J3tv7k4mrR8PrasoWlwQYbg600B3gWxXWr5Wgx2G1A5BeV2TYMZ KEdh3B6Gf3KssYdELpBDWlb0f8jH4kviPjRS0tEEEFhb9EaTl2E0vlWTF9sZZgh/heMN uGtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513009; x=1708117809; 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=P8GIqzjr5F0muhdfu+nSlnTYCrXU9jfYOiTVyQ6Sb9U=; b=U3qMYgM8x3UQC/k2fel+RsYS5SkJXsRMYnPcrkgrKiX/xKCsKEJkpskWofV6zBspVf nnB4Ujx/kwOaH6Z1zdR5f6CcbNR64SS1AH7gJ/Pc+dYkTT//cVi6Z8Zr1XhTl6thrsg8 FodSFx32fJfeFla2g0Qw0xxjyZMrzuMqd2stN2JvcR5XxZfR1mKHsXMdEsRXAM3CDHhF iHDXW+G/GoxPhsvXfuWUaU51QFONN9YoeB0yM8fyKXYzLxxR/JykURTCqdAUjSWqe/Xs usoTsuq0IFnsgW8yxQ6nGV/+it2Cb+U1DnCZ6lebJx41bUq1qjGRauZ335A9B0kmTULv kblA== X-Gm-Message-State: AOJu0YxDyDYgWN7QfNFGoYxOZFqQwzuoX9yzJyvmPhK7RqzX+NYDhtEr x7UVvzMYsefEY55e8j/nhv0JlXcflqUK8OWS6djPbCtIxWLQJw9aCJWIrg2WvJ8= X-Received: by 2002:a19:ee09:0:b0:511:494b:c483 with SMTP id g9-20020a19ee09000000b00511494bc483mr118496lfb.31.1707513009461; Fri, 09 Feb 2024 13:10:09 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVoFd23U02RRkhlYViO40gpOFYMCnq7G/cfZ0MZFVFnjHbrNv11wygCqcW+U/f8KFUpjBx8RaHsNERMwGIRWJp00rpzbtxi/MNYPSQ4wpHFIB3hbnIhJV24O7JbN6XT1T31RFaQoOfbb9R6/68uiw/yMqH+EzS2WlOygEGsAqUefY/p1v44PW/dffgdwVqQ3A6UxiQdBHJEmTzMoB0UtYruPdqOTc2UPWbL6vPL8LtalR2mukGZorQ9XUzi01PNhup3ZLlXhCu72g+hbZc33Fc9aDf7AaVjg9vEErr/gxJAPOudKqQuYm/fyItv2AD3F1E4pPWuLF0sXmf3hGEttM/6H5RuHQGr9QaYdDt2nvaUelta2QAhWDU91EiuRf3YNpz7NpEFKUW8nydd9BI73GVchzYddFVga0iRPlA/U8vbF8Zzea8FNvAzkiyyG6RFmNsJkf6BHzmafw9IQ+ts5GE+eSohjm6pWNqBjacWVBDzkarqcoIl215LF6Y1kpG+yabohg== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:08 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:56 +0100 Subject: [PATCH v2 12/20] media: venus: core: Remove cp_start Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-12-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=3274; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=/kFnbapgubNRtfX1KEblqNgRWZdEMPDSWK83uPCG7ls=; b=XjNO/TzZnniFSFa+959SHOc3p3ge3qqR+DGSwZyLfroBs3WCkm3oMoczUsS1gsC6BlPMDBGTZ xYIgwPIWAcrCFu2HvHqfMCDbLcyvH6GxscR+pstT5S2CYm526//SOmR X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457537277280752 X-GMAIL-MSGID: 1790457537277280752 It's hardcoded to be zero. Always. Ever since msm-3.10. Or maybe even before. Remove it! Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 4 ---- drivers/media/platform/qcom/venus/core.h | 1 - drivers/media/platform/qcom/venus/firmware.c | 3 +-- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 06b78e98cebd..65a9e815e6ba 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -647,7 +647,6 @@ static const struct venus_resources sdm660_res = { .vcodec_clks_num = 1, .max_load = 1036800, .hfi_version = HFI_VERSION_3XX, - .cp_start = 0, .cp_size = 0x79000000, .cp_nonpixel_start = 0x1000000, .cp_nonpixel_size = 0x28000000, @@ -716,7 +715,6 @@ static const struct venus_resources sdm845_res_v2 = { .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, .dma_mask = GENMASK(31, 29) - 1, - .cp_start = 0, .cp_size = 0x70800000, .cp_nonpixel_start = 0x1000000, .cp_nonpixel_size = 0x24800000, @@ -760,7 +758,6 @@ static const struct venus_resources sc7180_res = { .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, .dma_mask = GENMASK(31, 29) - 1, - .cp_start = 0, .cp_size = 0x70800000, .cp_nonpixel_start = 0x1000000, .cp_nonpixel_size = 0x24800000, @@ -869,7 +866,6 @@ static const struct venus_resources sc7280_res = { .vpu_version = VPU_VERSION_IRIS2_1, .num_vpp_pipes = 1, .dma_mask = GENMASK(31, 29) - 1, - .cp_start = 0, .cp_size = 0x25800000, .cp_nonpixel_start = 0x1000000, .cp_nonpixel_size = 0x24800000, diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index b1d0687d294f..9dacf533c7ad 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -80,7 +80,6 @@ struct venus_resources { const enum vpu_version vpu_version; const u8 num_vpp_pipes; const u32 max_load; - const u32 cp_start; const u32 cp_size; const u32 cp_nonpixel_start; const u32 cp_nonpixel_size; diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index fe7da2b30482..16e578780be7 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -245,7 +245,6 @@ int venus_boot(struct venus_core *core) 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. @@ -253,7 +252,7 @@ int venus_boot(struct venus_core *core) * 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, + ret = qcom_scm_mem_protect_video_var(0, res->cp_size, res->cp_nonpixel_start, res->cp_nonpixel_size); From patchwork Fri Feb 9 21:09:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199108 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1136108dyd; Fri, 9 Feb 2024 13:17:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUt+9eOXIShrXPZm6drnDOGYSp6u4nMRgPEcA0ZenUQwoWrkCXi/gx65MKCwdL38dGY7KYRBpmNoI5R3Hzt1Z2NCV5OCQ== X-Google-Smtp-Source: AGHT+IHQHjOWiwJ88FDbI1h+S5mQGcaziYWhCzkHT4R/dMDu49BVn2e6XyfazcWkaop3oVe7XXyW X-Received: by 2002:a92:602:0:b0:363:f8fa:6de9 with SMTP id x2-20020a920602000000b00363f8fa6de9mr104371ilg.14.1707513460965; Fri, 09 Feb 2024 13:17:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513460; cv=pass; d=google.com; s=arc-20160816; b=d2sLwwWW8MEwb3iVvRemX6p9xXqlNpfGDPDXePn6wOc/VPmDC0GuaZf1AAuxZs0M2t mIejJ0XY6w6wC87dv7E+/pT4N2odM/qwUxMPKtsFnNpPQ1mr4W1av2giPRLmLGSlb/or x+8BKb/EDIOjDF0Hp+92MOMy+QIIKBLO6TX2gnue5xlCwan6G+BFf1yHWdu5TB/oPtBN mRF5v7PSneks533TCAJnOHWfUUlE5j3clnzIbYfreRRkkoAaQSjpf3a94BkmSwy5gCXP FT4cLWszpAyFeej8v+Q0ct0LfQ8tQLltuuMtattRnDCXm9YMMQWsGS+WSFvTbp25HiFu nzvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=iccq4TLkD2INMIlTDHQm1CqNTexDcalE2BlNeCgcoHc=; fh=W5nFzWjAzv3AdxYa8+xtnOp67UED31QRZ8HeB/TqI0M=; b=hGnph5R93onfXHPK1hX+WrPHjPmSscii9E30VXR19c2OrHq06zxYWsyNl4bQHg4AKR ABhnti/2ABycZ01i7JAVf23bGx3jKMg12fPbraV5/U/ClOdB88Y0a+vgI6XlxJrMfh1j zYQSlDD0WnyF2N2hcfPlujEtcOruI9N1pT4TtT8KC9fa85T1yhKYIOPVELpHMKOfrEYq Zx7TG10jI2YNX8ViANZt4Zx0QRaoz87kHA7LcBiDsB7t/eAVqVNK09RujLXT7o8E8gkx v7b9elBYRjwOIVB/Ag2uCByUJyRyACdY4mGii5FUKE6cQvUEWPG2jAhu9dGjDDZVtxFQ TK1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=muEh7yp+; 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-60004-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60004-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCV15gPdrnMthumrZUNR/0blr0Yyg3AvF3Ccx1CFFWnxTV25V1B9SWelbUKVOkkmbeMeyOrT8EqaEEeJ2Bn4DpuRYtnoyw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m27-20020a63711b000000b005dbd2086a0dsi2340102pgc.331.2024.02.09.13.17.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:17:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60004-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=muEh7yp+; 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-60004-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60004-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D2F30287409 for ; Fri, 9 Feb 2024 21:16:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F09742054; Fri, 9 Feb 2024 21:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="muEh7yp+" Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 CF29B3E474 for ; Fri, 9 Feb 2024 21:10:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513014; cv=none; b=Yl9xAbqSuxnt+L7V+tcXg3lFgmGlN5rTmkJx/Dy7sVFN6U4dv2VByAlBtZwuchspSvblkcsQHPv4mP9MOr78Mf9aVimFeFSyoohdl64xum4n5HZPCk2snCg2Pp/f2MrzMdkl6g+pGIALQnDxV6kqEnq7i6NW50WOl1tQnS00Rnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513014; c=relaxed/simple; bh=cRJFudcjiVCid3coXRofqspzGAz6z91Bv4pWpCaIiXM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Tlqol2gwPwTa5Z//P7KjJOU2EVG0EBvIO8ZYQZf/dNekqYdG90/wqMtl57Gdoja5PPQWh6EMgQPyRfBxKvbB5/TruaTsQZYgQQQ5Pz21mjcW8UyXkIK7Hb1HgjJbxuKlBy7W1woucXD/ZY7DTWXBLRJjHshI4K32XTkCeThgfT0= 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=muEh7yp+; arc=none smtp.client-ip=209.85.218.46 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-f46.google.com with SMTP id a640c23a62f3a-a34c5ca2537so178678166b.0 for ; Fri, 09 Feb 2024 13:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513011; x=1708117811; darn=vger.kernel.org; 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=iccq4TLkD2INMIlTDHQm1CqNTexDcalE2BlNeCgcoHc=; b=muEh7yp+19Fs+uwZ4bkIp/VzhZNMezF68BS7wde47Bes3VKO5ZJShZuBjnx4z/GJ3I t8r5v39JqnujYb9EVwZyTDoGDeecL/UtlVcoQ/fIni6dx3BdhaYNsdTGKpbkxtQKubO9 pas8sVrP8hcleZmulTLf9f+4wRi/NIHLkGfETlD/vcuEDpD5gmkOCOTxd0amRxLkE4z2 oyZdetV0hWbXURKqWoDYRcRHmBsOV0fEpJvaYZHK1V5q+xdoGEvV/BKO7sWx0ci+setV d9pQDb2CiBCbjuPp86O7UkG1R7khZv4JB3nhhh0vwYtHoq7jDh1oKyCcTqjCqnX5cz0l Va1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513011; x=1708117811; 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=iccq4TLkD2INMIlTDHQm1CqNTexDcalE2BlNeCgcoHc=; b=fkpamt6iHiN9gw64wQf63bt3XdjXWT5IjXRNR06QDE/MRp/VLfRPGoUr0QHLCtmuRf eejwY6T2//qlwU/3xkqEIOKrFwaxu7CI7niiF1bs4FdKzbzCnhygOnThTOLVZAGKIoKh rjuTk8GQunwhsfGagT6AmeitOqHupqh+3alFG6h7Dojjo0JUBsCFyVduN+VDp4+1RIha bUlrJubMHhkN5pO0paq+COwXNeyFcrmpj6EJa6t9kop8/nVy+4ska2mwXPLKh9Favf3t xGXsJp4gJ2p2xmOCdYvlq9VQnDqsTUu9w0wLtKgF7twBZpePaEGA2EqL7+p/4h/uzBsL KjGA== X-Forwarded-Encrypted: i=1; AJvYcCUvGiMi703BVrmiMj9vBt1pGHumFT+bFxh6Xp12aBD8Dc3+GCVQE8M1nIVM0PXrTxZhpDeYp2btdbSVs1v94TLx2x5tJw4q5kTdumY1 X-Gm-Message-State: AOJu0YzDz9lXhW1zzDMzcFw8b/gcACDmitF5qX3/PT5MnOz7dxaRZIG1 pdUPeS60OgpTC11G8fgdWdVbpotDZLRv673fs3obBfKUETu/qG7DYG668iF/D9w= X-Received: by 2002:a17:906:f852:b0:a35:51b1:c757 with SMTP id ks18-20020a170906f85200b00a3551b1c757mr163298ejb.38.1707513011223; Fri, 09 Feb 2024 13:10:11 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXSMjZ577S4cYpw9sK3vDrzwI4sb0ibwgH3xKyPnCukwZ320+J3WCX8vKTo40BzOk56wHZMH1SiFTxHLcrt3Hkn0KB9hdlFBRYf0+5sBamiW7p6FijqIUNjnRwOyzTIbNhBOBzF1lXgYesYuCjRgh3Bhwhdl52a5P6GDX43jddN8dgq/iXA0BWMlrUBuwbp8bNWxdt26Kz9qVv+uhEOc3XYy5ywnVR9cqTdaLRNovUPhGnwfPbXwSjh3gPK9RebDoBSsRWWDnYE3+qtkx4+rKq0IwEVHiKb9WIGaWGsiWkGCk6I3z3GtMRpPLmrQPbjxGd+MUU1wOiIg1ICRaAW+azRrGfB0dvpn+4EX29dqXlzujAB+D3tMKNvLTsgp1qtDLZrxt5X1Dvg3Rt6AIX/PrbNhT8JTX7YbhjGrznkQy/oeVIM3smo8SAOafzARaEcdy+XsaPSBZQ0MeuSeK2AcH+9fEJRzqUnOx4JKgHQtw9wg9dKKo9nK2Xk3hvvL08kq34aYw== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:10 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:57 +0100 Subject: [PATCH v2 13/20] media: venus: pm_helpers: Commonize core_power Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-13-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=4717; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=cRJFudcjiVCid3coXRofqspzGAz6z91Bv4pWpCaIiXM=; b=Rc3oc6RfokYXBJk1f5VshwRPBBeVoH5ZYiZDI19mfIPuqHWUxAWGIJErO/N+kVzj5BpiRntlt hUdU68VY56RCM8bGHaW3bzgZxssatAJDZqV9XedjWazYriDhONQhN9g X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457634765888263 X-GMAIL-MSGID: 1790457634765888263 core_power_v4 called with num_resets = 0 and core->pmdomains[0] == NULL does exactly the same thing as core_power_v1. Unify them! Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 21 +++++++-------------- drivers/media/platform/qcom/venus/pm_helpers.c | 17 +---------------- drivers/media/platform/qcom/venus/pm_helpers.h | 2 +- 3 files changed, 9 insertions(+), 31 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 65a9e815e6ba..9bfd2a30084b 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -477,18 +477,15 @@ static void venus_core_shutdown(struct platform_device *pdev) static __maybe_unused int venus_runtime_suspend(struct device *dev) { struct venus_core *core = dev_get_drvdata(dev); - const struct venus_pm_ops *pm_ops = core->pm_ops; int ret; ret = hfi_core_suspend(core); if (ret) return ret; - if (pm_ops->core_power) { - ret = pm_ops->core_power(core, POWER_OFF); - if (ret) - return ret; - } + ret = venus_core_power(core, POWER_OFF); + if (ret) + return ret; ret = icc_set_bw(core->cpucfg_path, 0, 0); if (ret) @@ -503,8 +500,7 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev) err_video_path: icc_set_bw(core->cpucfg_path, kbps_to_icc(1000), 0); err_cpucfg_path: - if (pm_ops->core_power) - pm_ops->core_power(core, POWER_ON); + venus_core_power(core, POWER_ON); return ret; } @@ -512,7 +508,6 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev) static __maybe_unused int venus_runtime_resume(struct device *dev) { struct venus_core *core = dev_get_drvdata(dev); - const struct venus_pm_ops *pm_ops = core->pm_ops; int ret; ret = icc_set_bw(core->video_path, kbps_to_icc(20000), 0); @@ -523,11 +518,9 @@ static __maybe_unused int venus_runtime_resume(struct device *dev) if (ret) return ret; - if (pm_ops->core_power) { - ret = pm_ops->core_power(core, POWER_ON); - if (ret) - return ret; - } + ret = venus_core_power(core, POWER_ON); + if (ret) + return ret; return hfi_core_resume(core, false); } diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 8412deb68ed1..6f6de9ef1c6c 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -322,22 +322,9 @@ static void core_put_v1(struct venus_core *core) { } -static int core_power_v1(struct venus_core *core, int on) -{ - int ret = 0; - - if (on == POWER_ON) - ret = core_clks_enable(core); - else - core_clks_disable(core); - - return ret; -} - static const struct venus_pm_ops pm_ops_v1 = { .core_get = venus_clks_get, .core_put = core_put_v1, - .core_power = core_power_v1, .load_scale = load_scale_v1, }; @@ -410,7 +397,6 @@ static int venc_power_v3(struct device *dev, int on) static const struct venus_pm_ops pm_ops_v3 = { .core_get = venus_clks_get, .core_put = core_put_v1, - .core_power = core_power_v1, .vdec_get = vdec_get_v3, .vdec_power = vdec_power_v3, .venc_get = venc_get_v3, @@ -990,7 +976,7 @@ static void core_put_v4(struct venus_core *core) vcodec_domains_put(core); } -static int core_power_v4(struct venus_core *core, int on) +int venus_core_power(struct venus_core *core, int on) { struct device *dev = core->dev; struct device *pmctrl = core->pmdomains ? @@ -1138,7 +1124,6 @@ static int load_scale_v4(struct venus_inst *inst) static const struct venus_pm_ops pm_ops_v4 = { .core_get = core_get_v4, .core_put = core_put_v4, - .core_power = core_power_v4, .vdec_get = vdec_get_v4, .vdec_put = vdec_put_v4, .vdec_power = vdec_power_v4, diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h index a492c50c5543..77db940a265c 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.h +++ b/drivers/media/platform/qcom/venus/pm_helpers.h @@ -12,7 +12,6 @@ struct venus_core; struct venus_pm_ops { int (*core_get)(struct venus_core *core); void (*core_put)(struct venus_core *core); - int (*core_power)(struct venus_core *core, int on); int (*vdec_get)(struct device *dev); void (*vdec_put)(struct device *dev); @@ -28,6 +27,7 @@ struct venus_pm_ops { }; const struct venus_pm_ops *venus_pm_get(enum hfi_version version); +int venus_core_power(struct venus_core *core, int on); static inline int venus_pm_load_scale(struct venus_inst *inst) { From patchwork Fri Feb 9 21:09:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199106 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1135759dyd; Fri, 9 Feb 2024 13:16:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9NxuG4IrE5uHC7B5M/TQHHhVfTUkXKEkB1rW2x9lK7y5UYhvz/KqCnui+C1KXPN7ES4nX X-Received: by 2002:a17:906:80b:b0:a3c:771:a97a with SMTP id e11-20020a170906080b00b00a3c0771a97amr211077ejd.73.1707513406360; Fri, 09 Feb 2024 13:16:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513406; cv=pass; d=google.com; s=arc-20160816; b=iiKH56yVGh/eOB3TPUk54SiGITTo2eYLl8n9fO08jNFqh95JCDZjXxSbSfDG6+hqGc 0/EwD7gXlUTHdDCUb9Pl1J+KQ/yK8SvORwMY2nh+OIcSamWBkXSAJxHYUGQmWWkHxUvm uFBhip6X5bADQFp2ur2DJ27PvLFCJw4auG87kswa2lVnkg2Q5/KOVDWGu/egGFgbRK/f WVtaFGuiuNx6xiZC1NqofeP4hcYVs23xxNiaYjxc/p4TFjWu3VAHJCEz5EZsT47mNce0 ZJ0K2CvBQAHzHQ+pF7/o1z/Wgz5TYwHncOnyVV0t09VchJvkirx7dDfFpcSr/mIofFR0 Oy8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=uywZaJdRGJQ/k/o6qaBHiBl9Wlir0Y5jv/s44rCrnpY=; fh=T2BH1R1JWewNlu/sWpOT+xl1oa43Gn6zilnjYILMcvU=; b=b6Uhf4JJl+gBZpQIg+kB+hD/Ixly0IY+DeXC4vTbrGC/Nn5S8+lU7hQdTb39/PTVRw KilG5ACsQcSxhJ7o3GPUb9CERqeANSlSskY/zrdGOMLBdnNWazRmrC61siG6sq4c3c6h ZeHRrXAxvj/HaXOlMhfJrkTSPc3jH/Ac4YpCgOMX0KLmkakG4JOfdymT0/H5PL0W+wAr JoyVm9Nvoh6ieAHoBMXHFcqblG4FvOwTcgDtr/oKT6vGB3n1XIbI1VUCQOa8Pg5qwH1I h1p0+UDmrQ4F3DShvAtgnPGw5l/eYc00JdQYQnUXqEM4uzOt3smET7sfPG52WicWBxaH XXrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cn7qBBSD; 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-60005-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60005-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCVx1aoEsm2i0at/d56xfPfFjJq1M12dlqVXVDmvM4CXNYrS4KRkTKlna8UjFi8S5/FH9yz+duLXnXt/wuOTnexJYf/07Q== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g13-20020a1709063b0d00b00a3862f2b847si1194926ejf.70.2024.02.09.13.16.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:16:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60005-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cn7qBBSD; 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-60005-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60005-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 81F5E1F2286C for ; Fri, 9 Feb 2024 21:16:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7655C446DD; Fri, 9 Feb 2024 21:10:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cn7qBBSD" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 84F2A3EA69 for ; Fri, 9 Feb 2024 21:10:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513016; cv=none; b=HSWyoU6E+ySAsuhnLJNxAVMBvGWyq8es4gmeP8dYD8B27SGhhWXYUiWX/H2mIfGTwmzgdOAn3NXmLgpZYI21X4zR8ZaLlI3Dc5iB9a8tdfLQce0UW+T23gET6XWn57B4BO+kgCWo2bfnwtUCP2rxPtDu//yNnr6fqWAIg/aIqMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513016; c=relaxed/simple; bh=G5EO8gWb7PxJbJwYQwPoc5ia4Xy6TP/ueMeizK0hDu8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZFMPFiJHr0sDj4yg0DTOUFOZGHMgAmuwi6AsHI8YwQGWy1/lva/WisSKxrBT8q0D89EjDpZWZ7VyN4ypL9Hy8T3r18F4+A20Q5oDfgNRRI3mqbTctSwplbFuu5QI2a8C3cdP7KCOueTsRgTsVe7WGdCglYsVeVRn1Mp2HNzUluU= 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=cn7qBBSD; arc=none smtp.client-ip=209.85.218.49 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-f49.google.com with SMTP id a640c23a62f3a-a2f79e79f0cso203974666b.2 for ; Fri, 09 Feb 2024 13:10:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513013; x=1708117813; darn=vger.kernel.org; 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=uywZaJdRGJQ/k/o6qaBHiBl9Wlir0Y5jv/s44rCrnpY=; b=cn7qBBSDSfsoiXtBt9BWwA1MHvviYCjd7ttFYCdkt8EqMzsOnnxvWiLty0+WORYRHt 5wo/1w1Ak1U8/sKE+PM2skay4qByNneUvAkxzJRxH357U0NhqnP0zR+xAe/O6yRZ5dCO lvQIO8vN2W3D+E8qI9AGztM8poRk3eda9ATirAvQCW8REP53uCClT1Tx+pRoXvGe6nDf YQ+U3rw0iHDkvG16ND5XtEBKu6Dz6bKJ2Eopdkm/kp7oLGEoILNFhel7CKOWLynubsE9 YdNkFMA/dEwUYjKqJjZdzj+wYmcz2jeQwVL90qV/GKPbaLgPkB9eViS8L3X44aanmEyw wApA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513013; x=1708117813; 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=uywZaJdRGJQ/k/o6qaBHiBl9Wlir0Y5jv/s44rCrnpY=; b=QoEIJsVMCppoE4D/gMitWb76L8QnYow+tcfzzXhr2Oq257h8Rck1HQZ4AEFdsjkTrN o7Sswzp95MwHXEdM3taaoiSCSjumQ56IJIGHB6i78EY/E+haJI92RGJiWf1U4B/RuS0n X3CprwA2wTaRdDSXCKIBdAh63wiD7EA8LpHY7QBZCO29qqrMA0vdUqLzoSmUlZg4Q7cj kOvZE21Sc+bshfMKcJZFRwCL04uDhA/pbTJ+4lVOOyesMoFc/NFCkkqO8wE2di1WPZCj dFCEr8p5ieuPGWbW8Rnyf4DMSF9dLc/h7bvmrn/xYOwFpgMuSo78aJRoYEJGG+iCKopc 7Y+A== X-Gm-Message-State: AOJu0YwJfKNgXSYxrqA9qrErbEAk4SxNJzFMf5TX573PT4UhptkSPPCp BuZcyabbz/ESRxg4zZoDhV+5ftTvZ7j9DuYJD+AqafdPACvaspkUQ9oGIMx2Jyg= X-Received: by 2002:a17:906:b304:b0:a38:9923:46da with SMTP id n4-20020a170906b30400b00a38992346damr194119ejz.20.1707513012869; Fri, 09 Feb 2024 13:10:12 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVcC8MslwCJOOVb9rJmnm0MZ2MoASz2q+jc9yEqSbOh4sNAR7mXF/oM6qCXwZuNEgfrAzrCA/JicbhOvX1C66ls1jpoIuyNRSF7QEeRju+3XOXLOSBG2jD1/zSnkHCWgi4ToV3H6d3uGIPXqs9Zq3wXGD5AhYfF2HCQea3GG64pKi5ec3KSosDA+jYzyMlarDmd2zRYMlEonbueGPGPsj/+7YRGExvrpPj/uTcgTPUnmfgJpFPLP3MVsqt2VwfIrfF/64ZMu9xesnHssBU2o4M18PA7XkjknRnrkEKs8Zak5+kzMyT5FhES5bGPX9My2t+1j2DTimrZhQCaLPFaesi2/HORWOEolKoMf7eZSo8k/S9GwNWHYwBp0ZbSeXKXcaY+dMZw1MJ903mhhaMI8dml3+QP6cyK3r+IlMbKsr03LTsYE1h6O+NrIXGxJFDxXupIqNVNJcB5dTWa3MtYyG3nyZ7dxyheZtXa/WcmIiVyBVhJ9PdxLzzsMh2SBTHFz6YTvQ== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:12 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:58 +0100 Subject: [PATCH v2 14/20] media: venus: pm_helpers: Remove pm_ops->core_put Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-14-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=3935; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=G5EO8gWb7PxJbJwYQwPoc5ia4Xy6TP/ueMeizK0hDu8=; b=kGDBOVa3MohGI2QSLTtyRG8AUOytaLJKLMXSZvjFq6ciBdgCT8Zd4AytyxxpZbcf5J+ZHekv6 eYfdYC0lFD/AMfmcNDieZxM+aDTLnoV9bYCQR39NyFi8iuVNmaphXh1 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457577508981484 X-GMAIL-MSGID: 1790457577508981484 Without an OPP table and with vcodec_pmdomains_num (so, v1, v3 and sdm845_legacy targets), core_put_v4 is a NOP, jut like core_put_v1. Unify them! Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 8 +++----- drivers/media/platform/qcom/venus/pm_helpers.c | 17 +---------------- drivers/media/platform/qcom/venus/pm_helpers.h | 2 +- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 9bfd2a30084b..666adc5aac38 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -426,15 +426,14 @@ static int venus_probe(struct platform_device *pdev) err_core_deinit: hfi_core_deinit(core, false); err_core_put: - if (core->pm_ops->core_put) - core->pm_ops->core_put(core); + vcodec_domains_put(core); + return ret; } static void venus_remove(struct platform_device *pdev) { struct venus_core *core = platform_get_drvdata(pdev); - const struct venus_pm_ops *pm_ops = core->pm_ops; struct device *dev = core->dev; int ret; @@ -452,8 +451,7 @@ static void venus_remove(struct platform_device *pdev) pm_runtime_put_sync(dev); pm_runtime_disable(dev); - if (pm_ops->core_put) - pm_ops->core_put(core); + vcodec_domains_put(core); v4l2_device_unregister(&core->v4l2_dev); diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 6f6de9ef1c6c..32f9ccfa9d8a 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -318,13 +318,8 @@ static int load_scale_v1(struct venus_inst *inst) return ret; } -static void core_put_v1(struct venus_core *core) -{ -} - static const struct venus_pm_ops pm_ops_v1 = { .core_get = venus_clks_get, - .core_put = core_put_v1, .load_scale = load_scale_v1, }; @@ -396,7 +391,6 @@ static int venc_power_v3(struct device *dev, int on) static const struct venus_pm_ops pm_ops_v3 = { .core_get = venus_clks_get, - .core_put = core_put_v1, .vdec_get = vdec_get_v3, .vdec_power = vdec_power_v3, .venc_get = venc_get_v3, @@ -893,7 +887,7 @@ static int vcodec_domains_get(struct venus_core *core) return ret; } -static void vcodec_domains_put(struct venus_core *core) +void vcodec_domains_put(struct venus_core *core) { dev_pm_domain_detach_list(core->pmdomains); @@ -968,14 +962,6 @@ static int core_get_v4(struct venus_core *core) return 0; } -static void core_put_v4(struct venus_core *core) -{ - if (legacy_binding) - return; - - vcodec_domains_put(core); -} - int venus_core_power(struct venus_core *core, int on) { struct device *dev = core->dev; @@ -1123,7 +1109,6 @@ static int load_scale_v4(struct venus_inst *inst) static const struct venus_pm_ops pm_ops_v4 = { .core_get = core_get_v4, - .core_put = core_put_v4, .vdec_get = vdec_get_v4, .vdec_put = vdec_put_v4, .vdec_power = vdec_power_v4, diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h index 77db940a265c..3014b39aa6e3 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.h +++ b/drivers/media/platform/qcom/venus/pm_helpers.h @@ -11,7 +11,6 @@ struct venus_core; struct venus_pm_ops { int (*core_get)(struct venus_core *core); - void (*core_put)(struct venus_core *core); int (*vdec_get)(struct device *dev); void (*vdec_put)(struct device *dev); @@ -28,6 +27,7 @@ struct venus_pm_ops { const struct venus_pm_ops *venus_pm_get(enum hfi_version version); int venus_core_power(struct venus_core *core, int on); +void vcodec_domains_put(struct venus_core *core); static inline int venus_pm_load_scale(struct venus_inst *inst) { From patchwork Fri Feb 9 21:09:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199107 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1135807dyd; Fri, 9 Feb 2024 13:16:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHN9hKNR2w+U9jSZvaMdXIgTAlan9wUOEMnpiBGEfAETyEwfoMkiCIaVNomeleNRe2BxiaZ X-Received: by 2002:a05:620a:31a3:b0:785:35e0:5e75 with SMTP id bi35-20020a05620a31a300b0078535e05e75mr352893qkb.41.1707513414457; Fri, 09 Feb 2024 13:16:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513414; cv=pass; d=google.com; s=arc-20160816; b=U+nxGezVRgTPGNYY0JCIaDjYRZaiP0+6MfpQvzKwH6LMUKrN8szyeLDy7szG+YBTNB V3v9OT4lnEgncBvzEqKBtBM3vbCHM0Qb6ROi2Cxv8te8Rydnqhig0/ck3jQAJMft6kS3 hmiC1PP+1B29drZVYVq+7YqVcLGDye+CPuwzviv0LPYU+bWDBtiDlqwhyNBGnVKdoXj1 2jApVs5CFJt7MFjzU6aAhj8gqSMRgij7FmMP29s3Dl5vAySNQPJcdi/YXETc3YXa58s6 7wVYPAq60XupkcbM2fnguKAZ8txl0OKP1xaH2kbJxVQeml1QSzM55nlN1ZPZb0A0biRl JRaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=SA9Lb59KC+nISC8BTRPiv1Z4bw8dFbjLbRpUOcP2HoY=; fh=vT2GAwFSRj7WMk5ZbVRi43ohvhWYh+jO1IGnnHEsyVU=; b=NOmAUAQwNT6zRuBIA8onfk+MIQljnMsJ3E0wagfleNUIJISEfmgdVdqbjjQjClxXuR cyFhopX8mWcKClFPJCYr+QlgGokrjIS2+RANAp2IIVuhJNrSiBUtxdX7uFh24d2gaTc9 ijEIgBIZKAWxYLNhEp/CuVpMMTblc7YJPFcrD/o1WBeOqHQfhQrDNL0wWFbEMJU4Z4wq z9CF91HnulIG5QvhGXsdRYfPB0hPwfb8gUWTXg1Rfs83hQn8h8s0z0tGNhnoKeezbIHZ fT4PXd1A0eDRePzMeo9UfLPjOrJlOScsKyxDsZDAfVIGn6QLIacZERAaWLOv09rGOA8g U1dg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KefW0spb; 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-60006-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60006-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCXDCqgiY2KzO3IQvrR+0KbYSHq8HpSgRYjjjgygER127D56noXQOAKCUxzfL3yvhUOQUJxgpCPI6mmnCROY1cE7yuHzGQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i1-20020a05620a248100b00783d83c35b0si377481qkn.7.2024.02.09.13.16.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:16:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60006-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KefW0spb; 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-60006-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60006-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2E1331C20A44 for ; Fri, 9 Feb 2024 21:16:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5382D28E17; Fri, 9 Feb 2024 21:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KefW0spb" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 566C13E499 for ; Fri, 9 Feb 2024 21:10:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513018; cv=none; b=VVbFRHHyC86pE6RFDD6xD66+tAu0i78+28qh3hESmWUg+E4h/Qd5Y2qL3kVAZK1DU1gIr7+M/jnU3OJwLWvloZ/1VTfeRfkz6/JDPpIKZpTMpdbTyLNHJBFEKGHZ2OMtf7QiN07t9zP7tI7opvT9v0ucttxngArzC6rf8kVIv04= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513018; c=relaxed/simple; bh=SxDGgEUtWHupji3kWcgwRwlcQnOElKd5P7BQasbPYTE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gEXnCfPZGuUjdQjOEKPsxXqbPl8P8IwvASsXkNzMK7lBYH2OahzfI4URyhPW1SC6m6IkeEt6ns8Tu3riRNK7wKksgK1iVfpqNAvJTueB/Btz0ZGQm6xpbqvSoJ46pA8vvCbAeRQIyMMY9Ee6ZMtuYaD1Kk5k3ZRoknxUgpBCeLM= 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=KefW0spb; arc=none smtp.client-ip=209.85.208.44 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-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-560037b6975so1618935a12.2 for ; Fri, 09 Feb 2024 13:10:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513014; x=1708117814; darn=vger.kernel.org; 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=SA9Lb59KC+nISC8BTRPiv1Z4bw8dFbjLbRpUOcP2HoY=; b=KefW0spbhRtS7VxOPjB3UkOU5CxHOAjIGudtxwHXuAYkdhTR8gOstfZfNsGbfG7wbW 15hi8QrgAjZDQNKWQTRXQJnfA3JuUfAN/q7L+VzzvXAi2tW9BSWdRp8uuyVtgkyZQjv0 RQ1G98qHpv9efYPcMTHNit5EsHVwgiU4m8x9X+ui/P/0sJBruTfy/8FDC51yJyVSbLDP 6NUGVdiu30B8EZaJZnAfEiwO5F9/ihb+HjDhWLVof4FdGdmBSrkfoPsio1f1f3jdm+8q E+hXnQdjlhV4e8mYdFWkjJPJtwY75X2ox5j326NJcW/wx7nGE3nWyC9iwyofcFCibeHB 9wUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513014; x=1708117814; 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=SA9Lb59KC+nISC8BTRPiv1Z4bw8dFbjLbRpUOcP2HoY=; b=Ns4+cPE4CeC4S2hptEMx+GYNaTyoPfLOQJ9E+ujVrGv7ND+JYvLK7morvCp52Z12w+ AHyP96W7RrK++3NK2+KBEUf0lC39oew1LhEnvgLK5gmJyXEunJU+rcNmBnSZZT273jk2 QJ+ctb8yMtnY1Tu4U0DHZeVRsZ2wzuSG2IqxFJO6iq7YBpJY/eMfWThCO33XKwmlECuv UXiWzHDJPggXjyLqHp9osBuhpLgXHgmq4mrQvjI/t+P6EP8bKSz6vUFchEYBzfaNMVot yBYs8bi9HRib/f3D9l1HsvQHzokXsl7q5boeKonhObfCp9/Isy8cs/BQpZ91Bjd2ybU4 d3Sw== X-Gm-Message-State: AOJu0YzyLK5pLKGOB5JLCNgLR03gc/b1mmq0kyr/1W0S2Lgty5OFzhyf bgKCkYP9sQPOSSGqXXd/Ue8I8j5bKQPOMZ6J4HdVNbFmp5U9qTcJxOKyYKzr/Kw= X-Received: by 2002:a17:906:3552:b0:a3b:fe76:d666 with SMTP id s18-20020a170906355200b00a3bfe76d666mr225304eja.0.1707513014654; Fri, 09 Feb 2024 13:10:14 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU+m0k+l+lLW+83FALDzJXW1dXJI4jsvzqwreFZQ5MH667zVDGstHsy4UTD4EFsHT6dNShE9GcWOjcbij7kGMGJraEryqx+6dkdMAiT1jxCGrK/e8hAsph/JYu4X3WXYix4CiQLvFUyN+P/KelycXipHdG3FonRteFaevQ17ZoVOU2YLTQxKWW8Ts2IBAMzMk19ypMLoXN5iLfJHCBwD6I6R+CTXO2W1oil9DKrhzT8Rw6Ke46Gw584uJOYs4F5kEuqAGdF34w5eUGizX3VFOYngJ10UYzetDoaq9IrRGQsQRM5dVUkULxAZw3evOFVvVlHBmJA8eJj5Y1AsSYz+3JeT56bd45K4+gGFK0hxEv076PGAqukmTP0pyuNg19ehwP6MW4PLSM841Xd3SwAJFfdefnGxVlonOF1fVuZrEJ4NWx7LLYVi9jnfp9VMD8kRqWLTOWkXN1VR/X6EYO5IgNZT96JZmoZeTEJi8XyutDRv3vmyH9YbewVYmzGYF17TpmljQ== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:14 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:59 +0100 Subject: [PATCH v2 15/20] media: venus: core: Define a pointer to core->res Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-15-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=1808; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=SxDGgEUtWHupji3kWcgwRwlcQnOElKd5P7BQasbPYTE=; b=JlVCMhjWXh7JcvSS6od2SXkwsAUSLCX2191XVANLu17F3Xf11AmPRtaUq8Hx0hUpKs8M5UI07 owAZMrHdJIXAPWy19gsvnVrXxeJHsIThsUFMbF9qiw6KLapNOngONvH X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457585930251206 X-GMAIL-MSGID: 1790457585930251206 To make the code more concise, define a new variable 'res' pointing to the abundantly referenced core->res. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 666adc5aac38..70c3c9dc49c6 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -285,6 +285,7 @@ static irqreturn_t venus_isr_thread(int irq, void *dev_id) static int venus_probe(struct platform_device *pdev) { + const struct venus_resources *res; struct device *dev = &pdev->dev; struct venus_core *core; int i, ret; @@ -315,9 +316,11 @@ static int venus_probe(struct platform_device *pdev) if (!core->res) return -ENODEV; + res = core->res; + mutex_init(&core->pm_lock); - core->pm_ops = venus_pm_get(core->res->hfi_version); + core->pm_ops = venus_pm_get(res->hfi_version); if (!core->pm_ops) return -ENODEV; @@ -325,8 +328,8 @@ static int venus_probe(struct platform_device *pdev) if (ret) return ret; - for (i = 0; i < core->res->resets_num; i++) { - core->resets[i] = devm_reset_control_get_exclusive(dev, core->res->resets[i]); + for (i = 0; i < res->resets_num; i++) { + core->resets[i] = devm_reset_control_get_exclusive(dev, res->resets[i]); if (IS_ERR(core->resets[i])) return PTR_ERR(core->resets[i]); } @@ -337,7 +340,7 @@ static int venus_probe(struct platform_device *pdev) return ret; } - ret = dma_set_mask_and_coherent(dev, core->res->dma_mask); + ret = dma_set_mask_and_coherent(dev, res->dma_mask); if (ret) goto err_core_put; From patchwork Fri Feb 9 21:10:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1136537dyd; Fri, 9 Feb 2024 13:18:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1Mq+kl1S1clw4J/6d2ti7U7s/sy0tXUBB64RihUdIJ5siPI0uAfHZFLf7r8+INFxnpvGg X-Received: by 2002:a17:90b:4c48:b0:296:ee68:9dfd with SMTP id np8-20020a17090b4c4800b00296ee689dfdmr197486pjb.5.1707513518744; Fri, 09 Feb 2024 13:18:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513518; cv=pass; d=google.com; s=arc-20160816; b=thCBoObGNmuSktVNwohIxmTw/5z8jRp71S4NNkenB9EzvlFwIGorXQWBFKK8tl9rUj JuV727jAv2nkrrVLO0AMXXevEqwOZSKraN7rodtkVfdd0fEOI9tczqyGElKs9+O3qHgs 7ivZdDD/RE7FmQh2+Fy3nHMLOjaA7s1w7AsWFLAYVetVkESCWZuyyVedCct1C8WBAHXl WlXGzskJvv7FWWTD9qXE5NJogPpw+pg7CXm6OX5SViWPr/VrIoje2jQyFBrg+IKFXLBk 5DL/yyD4XoOJdBUfnud2zmq1sx+qzYIe9m/O/0X4N0kB2CmdfF4gdNzbx9DdJx3QFjqy WpjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=PhSad/Mk1NEzaN/RVlCN4R2NZvu025BgZXc2rgwW6iI=; fh=7/XB390cmmXBZj4Thl6+Vs1mSCnsmcr0xXfV9dbwg3E=; b=jNzm7sUBmFrlfTkCMyWMxex3iQsooy/B+uVIpFL+Pn7Kpt2FlyHNj2XdKX9LR9XSXl 0eW6SfX/RNnfD8UR5dkHAq8qWKJJIZoqqu+HnFk91jDJiXsfVWtxOJZ3cZqK1bolpLk2 LjeS8T5XVHlVLbeWgVVm8R2tmBM16Fv+r2KPpHCipxA19oVN5JBe683eg3txEJk6F/v7 tnujHhbGS86b5/4T4nydcJ1R2Arl2/8ZBSJ0KpgmxDm2ktIpSoelz0lFLM6NeDcmSQD9 ZPVwnY9m8o0vCzMlnQmi+m9fuSqGC7vCp2xXgwFYm3ApXRdB2yltbR0csIh/GYuNUhta QpWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HMfMa83P; 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-60007-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60007-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCWn3zuj0DlN1xR/PdUx+gXrraXwx+A9wBoa7vY1hjBjYlA1PjhsuzGbL++2oLL91nEOy23GkJM25ay3rsXOwgXtelqPZw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ls4-20020a17090b350400b00296eec3b8c3si2333384pjb.28.2024.02.09.13.18.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:18:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60007-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HMfMa83P; 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-60007-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60007-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CAD4B288197 for ; Fri, 9 Feb 2024 21:17:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 869B451011; Fri, 9 Feb 2024 21:10:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HMfMa83P" Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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 163DD3FB3F for ; Fri, 9 Feb 2024 21:10:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513020; cv=none; b=lbwEP4e+1yaDSSRQGAFzuMVKQL/J3sHn1QaknSO7QNZlqItQB4PBq0dO10Ky8XMCzHYl80swbhaBwhE54ItITfgPkX9S/SkI0VWEEoV++Fs9V18uGwlat/BuA7Sildy58HiW4+t0F07fIZw4kUPlai3MA2auZ4L4XUFsZxKktRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513020; c=relaxed/simple; bh=vLhLhf+CEVi6B2XJaAnvAcQ3XwKGsnZUrFlDvOw21nc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l2TS9Tv6BPXGv6NUnCih0aA2ToNaG3/pIFYYcv9MEJwcTyFM0Gp+DWlSvN5PTZFXS72/93+GoqOxjE7w1Q4Uq/P2Au1kIDf3UpeyKQPFrW3lfnGVLoXl4judV4wf6u/GJmJW6TcZy9lSg8ZzrxoW78ppht2Rz7T5mLi2mSxxBJk= 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=HMfMa83P; arc=none smtp.client-ip=209.85.218.48 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-f48.google.com with SMTP id a640c23a62f3a-a37721e42feso187696066b.2 for ; Fri, 09 Feb 2024 13:10:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513016; x=1708117816; darn=vger.kernel.org; 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=PhSad/Mk1NEzaN/RVlCN4R2NZvu025BgZXc2rgwW6iI=; b=HMfMa83PYqMx0BIGZvxtcPRa5ZcMdQrK4+51LE50p8GJeX+Xj7AkJpOlqGpw/O/eeX Wiq4K3cmE1x8jIVSdBaVKJGmohCCwm6v0LyQ2cuZUmurEw5wL0k9kLCWUH/FlhUIlL4a Oe0QJ1GC9DWYjhCaQqeVnFVuB5FVNMeMruElscBnitO6q0HKeiqe80p+wG1ire8PQO6F 3apRw/XohPR4HwOIM7PZ9apxUEFQ7j6XBLFtuVnNLhXFsc5UuNi5WhlxoQjroQLCNWn4 5ySsoI3q3u8KRGhEmexsYRIDwKfWGDP9JYJOh8yCaDRd4OrA5Y1BGYYpaw3PURn5odAA 59bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513016; x=1708117816; 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=PhSad/Mk1NEzaN/RVlCN4R2NZvu025BgZXc2rgwW6iI=; b=tG7C+5yW0RApAWgNB4FZtHC3Z3r8bCPgoRqKnRYRAMb25h7/w9HjzlKqW7W3IyuDur otTSo/xORO3BzD17+NH57Fd10lwJou5YJHvJRRKzg72a4qJm2S62HpPXt4xgHoX0VQdJ qt8Jm0pb0UT3JmFin/oadvlDmZkxwHFp2dRtGjORmhK7vSn08igJmM2RUCzz+TMgg33t kLYBCrKWLnMxbu79HXOUnz+SO+4D855LOpaOy+rEqZSrx/hzx75ITRSxuA7j3L0/0xku NBtflC9diTjsjSldWz7itwNuNBRZPQQWJi6FgLCQaGBfY/Pp26MfaUpKYb2Hd2n3cAVi aEDA== X-Gm-Message-State: AOJu0YzhymQOOi6qXfoRBTrc0LxKZw5HICqwsZuZj5CHguPJVt6fe8vV daXdbV8oGqYhc9NKnQ44249Wpn993fbWdCWcuka3hVQsCDsVOOoqGXyYqnDcD60= X-Received: by 2002:a17:906:d979:b0:a38:e745:fb88 with SMTP id rp25-20020a170906d97900b00a38e745fb88mr142952ejb.57.1707513016407; Fri, 09 Feb 2024 13:10:16 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUNGBejFq5PDzl1+CvKgzrv2X7Us6V5508hFb6FLlOZsW5LQdlbQdebLY9R1CIA29+ENWvT09bsJOaA6W7AZY9WlQZUsUI1KEcQ8r/w2SrumlFFAsM7UYgLLJSD3NoCmm9e9WELz4FCNij85g8Cg6wCPl0/O26bZ0jGNZakACZ+DdVVMDlnMOkFOl1c5gF3Zv9yPmISvu2Y/tUdA5VnagLJiRIRD3qWDadkBr/fvOHcDpqWe/gIZHN9RlL6LjCuhYtzFKRmpt74Dy3Upu7504C6f++WlxsitfdAYEL6eDP8V2VMFVbOi7VhJOih0dvhTd1TrNHEIaW2jC82Htkzia4sn2zxJK2gR6RXdaKKJDfEMtSsKuVR+Dsba8XUZECnTwNmLANouP0ztzrz5TPFcTtD5DM7i1lzuocIkr3BH3aK9eHq2GKwrw1yTKRkEwVMV0j09mURrSxdNOEE3PdDGVzLKW196ZPO/oEyQmVMZFtEe/JKYB0kXWOUjKGqnM5J/KSKrg== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:15 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:10:00 +0100 Subject: [PATCH v2 16/20] media: venus: pm_helpers: Simplify vcodec clock handling Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-16-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=13452; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=vLhLhf+CEVi6B2XJaAnvAcQ3XwKGsnZUrFlDvOw21nc=; b=yhMc+HUWGyogB5zChvw1fSFjZ32bTQVH+w4auxc+uJf6IdWacMSVM3VvwjxoaKTVSEd7ZaVfJ giBWMyzn9ndDfdFOMGLfjjUnU86vMCSyjWD0yhXVsF/aRloJaE4DQT3 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457695452281434 X-GMAIL-MSGID: 1790457695452281434 Currently the infrastructure is set up for vast expandability, but it's far too complex for what is just 0-2 clocks. Categorize the clocks and simplify their getting. One notable change is that vcodec clocks are switched to use devm_clk_get_optional, which will let us commonize the code further while leaving the burden of figuring out which SoCs need codec-specific clocks and which don't to the bindings checker. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 18 ---- drivers/media/platform/qcom/venus/core.h | 9 +- drivers/media/platform/qcom/venus/pm_helpers.c | 129 +++++++++++++------------ 3 files changed, 69 insertions(+), 87 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 70c3c9dc49c6..680674dd0d68 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -581,9 +581,6 @@ static const struct venus_resources msm8996_res = { .reg_tbl_size = ARRAY_SIZE(msm8996_reg_preset), .clks = {"core", "iface", "bus", "mbus" }, .clks_num = 4, - .vcodec0_clks = { "core" }, - .vcodec1_clks = { "core" }, - .vcodec_clks_num = 1, .max_load = 2563200, .hfi_version = HFI_VERSION_3XX, .dma_mask = (GENMASK(31, 30) | GENMASK(28, 26) | GENMASK(24, 22)) - 1, @@ -636,9 +633,6 @@ static const struct venus_resources sdm660_res = { .bw_tbl_dec_size = ARRAY_SIZE(sdm660_bw_table_dec), .clks = {"core", "iface", "bus", "bus_throttle" }, .clks_num = 4, - .vcodec0_clks = { "vcodec0_core" }, - .vcodec1_clks = { "vcodec0_core" }, - .vcodec_clks_num = 1, .max_load = 1036800, .hfi_version = HFI_VERSION_3XX, .cp_size = 0x79000000, @@ -680,9 +674,6 @@ static const struct venus_resources sdm845_res = { .bw_tbl_dec_size = ARRAY_SIZE(sdm845_bw_table_dec), .clks = {"core", "iface", "bus" }, .clks_num = 3, - .vcodec0_clks = { "core", "bus" }, - .vcodec1_clks = { "core", "bus" }, - .vcodec_clks_num = 2, .max_load = 3110400, /* 4096x2160@90 */ .hfi_version = HFI_VERSION_4XX, .vpu_version = VPU_VERSION_AR50, @@ -699,9 +690,6 @@ static const struct venus_resources sdm845_res_v2 = { .bw_tbl_dec_size = ARRAY_SIZE(sdm845_bw_table_dec), .clks = {"core", "iface", "bus" }, .clks_num = 3, - .vcodec0_clks = { "vcodec0_core", "vcodec0_bus" }, - .vcodec1_clks = { "vcodec1_core", "vcodec1_bus" }, - .vcodec_clks_num = 2, .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0", "vcodec1" }, .vcodec_pmdomains_num = 3, .opp_pmdomain = pd_names_cx, @@ -744,8 +732,6 @@ static const struct venus_resources sc7180_res = { .bw_tbl_dec_size = ARRAY_SIZE(sc7180_bw_table_dec), .clks = {"core", "iface", "bus" }, .clks_num = 3, - .vcodec0_clks = { "vcodec0_core", "vcodec0_bus" }, - .vcodec_clks_num = 2, .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, .vcodec_pmdomains_num = 2, .opp_pmdomain = pd_names_cx, @@ -796,8 +782,6 @@ static const struct venus_resources sm8250_res = { .clks_num = 2, .resets = { "bus", "core" }, .resets_num = 2, - .vcodec0_clks = { "vcodec0_core" }, - .vcodec_clks_num = 1, .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, .vcodec_pmdomains_num = 2, .opp_pmdomain = pd_names_mx, @@ -851,8 +835,6 @@ static const struct venus_resources sc7280_res = { .ubwc_conf = &sc7280_ubwc_config, .clks = {"core", "bus", "iface"}, .clks_num = 3, - .vcodec0_clks = {"vcodec_core", "vcodec_bus"}, - .vcodec_clks_num = 2, .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, .vcodec_pmdomains_num = 2, .opp_pmdomain = pd_names_cx, diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 9dacf533c7ad..6ecaa3e38cac 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -24,9 +24,10 @@ #define VDBGFW "VenusFW : " #define VIDC_CLKS_NUM_MAX 4 -#define VIDC_VCODEC_CLKS_NUM_MAX 2 #define VIDC_RESETS_NUM_MAX 2 +#define MAX_NUM_VCODECS 2 + extern int venus_fw_debug; struct freq_tbl { @@ -68,8 +69,6 @@ struct venus_resources { const struct hfi_ubwc_config * const ubwc_conf; const char * const clks[VIDC_CLKS_NUM_MAX]; const unsigned int clks_num; - const char * const vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX]; - const char * const vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX]; const unsigned int vcodec_clks_num; const char * const *vcodec_pmdomains; const unsigned int vcodec_pmdomains_num; @@ -176,8 +175,8 @@ struct venus_core { void __iomem *aon_base; int irq; struct clk *clks[VIDC_CLKS_NUM_MAX]; - struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX]; - struct clk *vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX]; + struct clk *vcodec_core_clks[MAX_NUM_VCODECS]; + struct clk *vcodec_bus_clks[MAX_NUM_VCODECS]; struct icc_path *video_path; struct icc_path *cpucfg_path; bool has_opp_table; diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 32f9ccfa9d8a..a292c788ffba 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -110,67 +110,74 @@ static void core_clks_disable(struct venus_core *core) static int core_clks_set_rate(struct venus_core *core, unsigned long freq) { - int ret; + int i, ret; ret = dev_pm_opp_set_rate(core->dev, freq); if (ret) return ret; - ret = clk_set_rate(core->vcodec0_clks[0], freq); - if (ret) - return ret; - - ret = clk_set_rate(core->vcodec1_clks[0], freq); - if (ret) - return ret; + for (i = 0; i < MAX_NUM_VCODECS; i++) { + ret = clk_set_rate(core->vcodec_core_clks[i], freq); + if (ret) + return ret; + } return 0; } -static int vcodec_clks_get(struct venus_core *core, struct device *dev, - struct clk **clks, const char * const *id) +static int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id) { - const struct venus_resources *res = core->res; - unsigned int i; + char buf[13] = { 0 }; /* vcodecX_core\0 */ - for (i = 0; i < res->vcodec_clks_num; i++) { - if (!id[i]) - continue; - clks[i] = devm_clk_get(dev, id[i]); - if (IS_ERR(clks[i])) - return PTR_ERR(clks[i]); + /* Best we can do is 2 cores */ + if (id > MAX_NUM_VCODECS - 1) { + dev_err(dev, "Got impossible vcodec id %u\n", id); + return -EINVAL; + }; + + snprintf(buf, sizeof(buf), "vcodec%u_core", id); + + /* First try the non-legacy name */ + core->vcodec_core_clks[id] = devm_clk_get_optional(dev, buf); + if (IS_ERR(core->vcodec_core_clks[id])) { + /* Try again, with the legacy name */ + core->vcodec_core_clks[id] = devm_clk_get_optional(dev, "core"); + if (IS_ERR(core->vcodec_core_clks[id])) + return PTR_ERR(core->vcodec_core_clks[id]); + } + + memset(buf, 0, sizeof(buf)); + snprintf(buf, sizeof(buf), "vcodec%u_bus", id); + + core->vcodec_bus_clks[id] = devm_clk_get_optional(dev, buf); + if (IS_ERR(core->vcodec_bus_clks[id])) { + core->vcodec_bus_clks[id] = devm_clk_get_optional(dev, "bus"); + if (IS_ERR(core->vcodec_bus_clks[id])) + return PTR_ERR(core->vcodec_bus_clks[id]); } return 0; } -static int vcodec_clks_enable(struct venus_core *core, struct clk **clks) +static int vcodec_clks_enable(struct venus_core *core, u8 id) { - const struct venus_resources *res = core->res; - unsigned int i; int ret; - for (i = 0; i < res->vcodec_clks_num; i++) { - ret = clk_prepare_enable(clks[i]); - if (ret) - goto err; - } + ret = clk_prepare_enable(core->vcodec_core_clks[id]); + if (ret) + return ret; - return 0; -err: - while (i--) - clk_disable_unprepare(clks[i]); + ret = clk_prepare_enable(core->vcodec_bus_clks[id]); + if (ret) + clk_disable_unprepare(core->vcodec_core_clks[id]); return ret; } -static void vcodec_clks_disable(struct venus_core *core, struct clk **clks) +static void vcodec_clks_disable(struct venus_core *core, u8 id) { - const struct venus_resources *res = core->res; - unsigned int i = res->vcodec_clks_num; - - while (i--) - clk_disable_unprepare(clks[i]); + clk_disable_unprepare(core->vcodec_bus_clks[id]); + clk_disable_unprepare(core->vcodec_core_clks[id]); } static u32 load_per_instance(struct venus_inst *inst) @@ -343,8 +350,7 @@ static int vdec_get_v3(struct device *dev) { struct venus_core *core = dev_get_drvdata(dev); - return vcodec_clks_get(core, dev, core->vcodec0_clks, - core->res->vcodec0_clks); + return vcodec_clks_get(core, dev, 0); } static int vdec_power_v3(struct device *dev, int on) @@ -355,9 +361,9 @@ static int vdec_power_v3(struct device *dev, int on) vcodec_control_v3(core, VIDC_SESSION_TYPE_DEC, true); if (on == POWER_ON) - ret = vcodec_clks_enable(core, core->vcodec0_clks); + ret = vcodec_clks_enable(core, 0); else - vcodec_clks_disable(core, core->vcodec0_clks); + vcodec_clks_disable(core, 0); vcodec_control_v3(core, VIDC_SESSION_TYPE_DEC, false); @@ -368,8 +374,7 @@ static int venc_get_v3(struct device *dev) { struct venus_core *core = dev_get_drvdata(dev); - return vcodec_clks_get(core, dev, core->vcodec1_clks, - core->res->vcodec1_clks); + return vcodec_clks_get(core, dev, 1); } static int venc_power_v3(struct device *dev, int on) @@ -380,9 +385,9 @@ static int venc_power_v3(struct device *dev, int on) vcodec_control_v3(core, VIDC_SESSION_TYPE_ENC, true); if (on == POWER_ON) - ret = vcodec_clks_enable(core, core->vcodec1_clks); + ret = vcodec_clks_enable(core, 1); else - vcodec_clks_disable(core, core->vcodec1_clks); + vcodec_clks_disable(core, 1); vcodec_control_v3(core, VIDC_SESSION_TYPE_ENC, false); @@ -441,7 +446,7 @@ static int poweroff_coreid(struct venus_core *core, unsigned int coreid_mask) if (ret) return ret; - vcodec_clks_disable(core, core->vcodec0_clks); + vcodec_clks_disable(core, 0); ret = vcodec_control_v4(core, VIDC_CORE_ID_1, false); if (ret) @@ -457,7 +462,7 @@ static int poweroff_coreid(struct venus_core *core, unsigned int coreid_mask) if (ret) return ret; - vcodec_clks_disable(core, core->vcodec1_clks); + vcodec_clks_disable(core, 1); ret = vcodec_control_v4(core, VIDC_CORE_ID_2, false); if (ret) @@ -484,7 +489,7 @@ static int poweron_coreid(struct venus_core *core, unsigned int coreid_mask) if (ret) return ret; - ret = vcodec_clks_enable(core, core->vcodec0_clks); + ret = vcodec_clks_enable(core, 0); if (ret) return ret; @@ -502,7 +507,7 @@ static int poweron_coreid(struct venus_core *core, unsigned int coreid_mask) if (ret) return ret; - ret = vcodec_clks_enable(core, core->vcodec1_clks); + ret = vcodec_clks_enable(core, 1); if (ret) return ret; @@ -763,20 +768,18 @@ static int vdec_get_v4(struct device *dev) if (!legacy_binding) return 0; - return vcodec_clks_get(core, dev, core->vcodec0_clks, - core->res->vcodec0_clks); + return vcodec_clks_get(core, dev, 0); } static void vdec_put_v4(struct device *dev) { struct venus_core *core = dev_get_drvdata(dev); - unsigned int i; if (!legacy_binding) return; - for (i = 0; i < core->res->vcodec_clks_num; i++) - core->vcodec0_clks[i] = NULL; + core->vcodec_core_clks[0] = NULL; + core->vcodec_bus_clks[0] = NULL; } static int vdec_power_v4(struct device *dev, int on) @@ -792,9 +795,9 @@ static int vdec_power_v4(struct device *dev, int on) return ret; if (on == POWER_ON) - ret = vcodec_clks_enable(core, core->vcodec0_clks); + ret = vcodec_clks_enable(core, 0); else - vcodec_clks_disable(core, core->vcodec0_clks); + vcodec_clks_disable(core, 0); vcodec_control_v4(core, VIDC_CORE_ID_1, false); @@ -808,20 +811,18 @@ static int venc_get_v4(struct device *dev) if (!legacy_binding) return 0; - return vcodec_clks_get(core, dev, core->vcodec1_clks, - core->res->vcodec1_clks); + return vcodec_clks_get(core, dev, 1); } static void venc_put_v4(struct device *dev) { struct venus_core *core = dev_get_drvdata(dev); - unsigned int i; if (!legacy_binding) return; - for (i = 0; i < core->res->vcodec_clks_num; i++) - core->vcodec1_clks[i] = NULL; + core->vcodec_core_clks[1] = NULL; + core->vcodec_bus_clks[1] = NULL; } static int venc_power_v4(struct device *dev, int on) @@ -837,9 +838,9 @@ static int venc_power_v4(struct device *dev, int on) return ret; if (on == POWER_ON) - ret = vcodec_clks_enable(core, core->vcodec1_clks); + ret = vcodec_clks_enable(core, 1); else - vcodec_clks_disable(core, core->vcodec1_clks); + vcodec_clks_disable(core, 1); vcodec_control_v4(core, VIDC_CORE_ID_2, false); @@ -934,11 +935,11 @@ static int core_get_v4(struct venus_core *core) dev_info(dev, "%s legacy binding\n", legacy_binding ? "" : "non"); - ret = vcodec_clks_get(core, dev, core->vcodec0_clks, res->vcodec0_clks); + ret = vcodec_clks_get(core, dev, 0); if (ret) return ret; - ret = vcodec_clks_get(core, dev, core->vcodec1_clks, res->vcodec1_clks); + ret = vcodec_clks_get(core, dev, 1); if (ret) return ret; From patchwork Fri Feb 9 21:10:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199109 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1136146dyd; Fri, 9 Feb 2024 13:17:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVd6925JIRaZgwGMmix7yUSjQxGlqIp078Pb4xfeGphHqVe3/8IrsD6en7uhDpqjcDqFpEsjl6szgfg9dRKjAm+7ij10A== X-Google-Smtp-Source: AGHT+IE6+Omh2s+3N8PIQRjLuqngRVlgxB9bx1viICwPwBQSoLxNvh4A9s5lPo2Zn8HRC8UGmeYC X-Received: by 2002:a05:6214:29e4:b0:68c:a9fb:9a35 with SMTP id jv4-20020a05621429e400b0068ca9fb9a35mr400440qvb.25.1707513465475; Fri, 09 Feb 2024 13:17:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513465; cv=pass; d=google.com; s=arc-20160816; b=H9F0byuev3hBEFyCgXTvKoq++I230YLBO0d3CDrndU8tUY++lCY11Nioj+/FkjK8B3 BVzKmPZmZJ4N11MNwPTE5FhgJXJw5UDIVwqIGzbp/d3ENwWCXaMU8Qm8kbncq4VrfaVw Lm8ADzTgCUz9CV1EECP4CrZj1epXo8ZzbKp8rA8ZOvU1odHQybFW2ykV18pYDoGKIw7m s6R/LQP4idOYjKHX1jEp93XM8JAL+wRw6kA4nGuaP9ycoTpjtSrUjIPCgdnW7KVjmjCG uDl95LUWthEWWNQlOydui26t2ulJdpYOQqfZFum+L1BXgkyDwq/F5gIAOHb3F2h7Mbh0 81Fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=AlA4ayOmstDeitRRZ2W2c5UllMpUVoGUwWdDkp9v1as=; fh=xAx8HaTYcp6x3qHvZlDqhPuu1BP8Vnn7cU+fi0eDFUk=; b=Ecm/BABL5Ec8J5U72mozxtALJClnIsOk04XY6JalB1F8mI1qgmGv7sHNrLu+CElJZK NB9lbiAC/pH/i+kJegNJhzcYjvqBXPpvRegSEY/NsC+g43xQUGxL736vkDYBYJotpMPR 5W2ReRPI63/GvnR0T2n7wakI9/BsPqP9kYLy5BOS5kdImB8mKm2jTWGqXg3Ahl92clNT 6YINoJoC28cpagVEUFxSRiJPwgbMyCzbV1m/NmqmgilVlWrFJmZLKJenk3ds9Zuk58Si a94CMzPngdKi2um0ABYuWyrJGeThkKEFqEvC1ap1dtuh8O9LoAzn1NVwRXayxI+9tpat Nf/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QikG+afM; 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-60008-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60008-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCXSFEwzk1v+Xjra2nWQ6e1bzKpNDDMHoG88JZXLx7hUkHNG3MlUyXwF6SWBdtOarizcQytqJi9OzUOrwKImyPsWVM9uBg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pr1-20020a056214140100b0068cd395cb6esi2046912qvb.14.2024.02.09.13.17.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:17:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60008-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QikG+afM; 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-60008-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60008-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 300AE1C224C9 for ; Fri, 9 Feb 2024 21:17:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57C3650A99; Fri, 9 Feb 2024 21:10:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QikG+afM" Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 CB11C44384 for ; Fri, 9 Feb 2024 21:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513022; cv=none; b=jKSp1EKw8wI2mxGb23qOoV0zuHaRTQHJI7a7gRZNrXLLJ/cOmJPJSxcRSsMW1vyR7a0AQNUO3OK/sWVGDYQXIR+bCDln8PrFv66140a1ztTRIBhSgjPyJrCAzKDbADJ0YCKBqZVEhPaunHk5Yhz9o5VU9HG7xBMR2OwhvmSIibk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513022; c=relaxed/simple; bh=MLv2EGPhgvWgejpl7fbRFyjPDkfZHFECDfabJtkG8Ts=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WptnesCsfuWYYtIVN9/b1f6J2TEbWAs51b2SjDkei9c48bsth1DWd+83rel3ctKTAbrJDx5bzw53qn2ESRN3E8WXeeDQwsYormyrbet6y2EXuFPZzRDqZEyg+MpzGjzJQXiYEX4IhZzGjqSg2r7K2C5vwFO/iCunja4XCqxh+v0= 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=QikG+afM; arc=none smtp.client-ip=209.85.208.175 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-lj1-f175.google.com with SMTP id 38308e7fff4ca-2d0d7985dfdso19087191fa.2 for ; Fri, 09 Feb 2024 13:10:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513018; x=1708117818; darn=vger.kernel.org; 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=AlA4ayOmstDeitRRZ2W2c5UllMpUVoGUwWdDkp9v1as=; b=QikG+afMnsM1kIM/Nzem4BffRaN2JoYMSspKt/5ZFkD4LBq8mEIg5ArRpYZCjyLS2m K4Nyr0q6AczPm6A3PYrol7Y9+el4d3dCsMdRYuEwyJI4mfmfbfie2dV/u0BxLGDd3Ev8 VhVcET9DcD4HCBR/d8122dlICEbLTRofa1vWifljz63CP7jo6xxnvzrA53rl8MdZHFmO IoErZn0/F9b8/XffsEeTyNoxh3iKlzKSfsky2FqqFMt49ZVDIUwnEp670e18JVDA/NGL iYzJm1ypLGQIfkVxWMmxynf0fQfUi16b/SOEgR74TdhS3vdpG3CiZtL8FHkTuYhhE/Sp n+NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513018; x=1708117818; 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=AlA4ayOmstDeitRRZ2W2c5UllMpUVoGUwWdDkp9v1as=; b=aI7aoXGKy34E0T0otFCnKoc1UPn7vYDECoiaLo1Xj/L6uegbkP/vI6nC2LmqFDrhmz hef8bn9WPKlkb9FXTZiPgOvpp1pUT/Q/gajKQkMrnufSBy3EkDgDG0K7XZANsYqEtXut wQoZKJJVKzdJ2WJp6JqhIbHDve8+InrQOhBsSzeS5D6PtXCpVYTAcrNPgThdh0qwAJgG 1Y0OjJFK8h3Y3BUUeORMjMb6FGLoUE76OnC56/LjGfa49xPKhvpmhkB8b7WilURmyxLK iddBuSEP+v6JbposPRmQlR9hCXGnGmtE6Ou23LajaeCLO9BZzSD2geMGAoCs5XPR5jX5 Z4fQ== X-Forwarded-Encrypted: i=1; AJvYcCXcbx6gg0brMTR594JTz8nlfPNrCMwIABUCDWv6SudpEPBKJo6SPpyxXJkBhd4AEZq9u9TBKmEI9hmRaraOzzXR8GviErKp8ie8LcY5 X-Gm-Message-State: AOJu0YxZc10uq3bcGH8yL/pA2K2eJbxxdQsb7/Tm3BerQpdleukbHwyg wRvVGF5TTeybHWREcXtzvGGzOkGf5zoviXy7S3wXimhSm4b7pqGM/MuBxwX+W5shDeF2a2fUnn5 P X-Received: by 2002:ac2:41ca:0:b0:511:1ed7:61b8 with SMTP id d10-20020ac241ca000000b005111ed761b8mr138919lfi.30.1707513017891; Fri, 09 Feb 2024 13:10:17 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV2vSXOWP0zPTdPzgr2OB7mO2zO/BBUb6MycDmMBo7iyCA2zGdMN08BEZkTi3oXHkq73Gyr6mJnMewJbhfCN0g3QgXHZE83t99O5gMpRiQ+ubauJZ069Kj4IH0j8fil17TwydvqiE7EyqiHHrOb/UA6FKnEiZJNKUHfSjovojWbyHOaHpYLii5mg5HTYW7nYf+rwGwyLwvqeDf1RQg7qpkrwja72n3pUtqIarC6ZjSKd4ffjkRFoiuj56ZKnjT/NP/f/8Z7Cz/WRodOnc1SJRsNEluaneAid6a1yoUhjvPYmgC+F+JBPRVdYbOgsHiruBK3bZQAhNDQYK785jNLXe5rGkMh/BRIzhzLhpTZGDUElUAvyrdhRYyVi3ScwZqKb7xeDiYH8VQyF09qpIx7yzzyWVUUyyS2pC1mZeifVQSKzHq/GzWUaMD5FLcw6vXU4ZCR86UO3Q19vs4Ql+yePMEtaF0N1jyReWzrh5HwS6usTMkP9XL6XtgESVKeiroCgPHkCQ== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:17 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:10:01 +0100 Subject: [PATCH v2 17/20] media: venus: pm_helpers: Commonize getting clocks and GenPDs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-17-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=3311; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=MLv2EGPhgvWgejpl7fbRFyjPDkfZHFECDfabJtkG8Ts=; b=nU5akJ8S6NPlZWhfphKzyqepTvPetn6PGSgT5P4fuPWJfhCa9tlFcNZQek5SuRx1S+ZmHp2PL 7G4hT8ZVxMODhmSzX/S3H5V0Bz6ZahTDetAMN4Kw5+Ry9JuFZHzA73m X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457639772747549 X-GMAIL-MSGID: 1790457639772747549 As has been the story with the past few commits, much of the resource acquisition logic is totally identical between different generations and there's no good reason to invent a new function for each one. Commonize core_get() and rename it to venus_get_resources() to be more meaningful. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 8 +++----- drivers/media/platform/qcom/venus/pm_helpers.c | 5 +---- drivers/media/platform/qcom/venus/pm_helpers.h | 3 +-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 680674dd0d68..873affe17537 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -334,11 +334,9 @@ static int venus_probe(struct platform_device *pdev) return PTR_ERR(core->resets[i]); } - if (core->pm_ops->core_get) { - ret = core->pm_ops->core_get(core); - if (ret) - return ret; - } + ret = venus_get_resources(core); + if (ret) + return ret; ret = dma_set_mask_and_coherent(dev, res->dma_mask); if (ret) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index a292c788ffba..1cbcffbc29af 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -326,7 +326,6 @@ static int load_scale_v1(struct venus_inst *inst) } static const struct venus_pm_ops pm_ops_v1 = { - .core_get = venus_clks_get, .load_scale = load_scale_v1, }; @@ -395,7 +394,6 @@ static int venc_power_v3(struct device *dev, int on) } static const struct venus_pm_ops pm_ops_v3 = { - .core_get = venus_clks_get, .vdec_get = vdec_get_v3, .vdec_power = vdec_power_v3, .venc_get = venc_get_v3, @@ -920,7 +918,7 @@ static int core_resets_reset(struct venus_core *core) return ret; } -static int core_get_v4(struct venus_core *core) +int venus_get_resources(struct venus_core *core) { struct device *dev = core->dev; const struct venus_resources *res = core->res; @@ -1109,7 +1107,6 @@ static int load_scale_v4(struct venus_inst *inst) } static const struct venus_pm_ops pm_ops_v4 = { - .core_get = core_get_v4, .vdec_get = vdec_get_v4, .vdec_put = vdec_put_v4, .vdec_power = vdec_power_v4, diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h index 3014b39aa6e3..7a55a55029f3 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.h +++ b/drivers/media/platform/qcom/venus/pm_helpers.h @@ -10,8 +10,6 @@ struct venus_core; #define POWER_OFF 0 struct venus_pm_ops { - int (*core_get)(struct venus_core *core); - int (*vdec_get)(struct device *dev); void (*vdec_put)(struct device *dev); int (*vdec_power)(struct device *dev, int on); @@ -28,6 +26,7 @@ struct venus_pm_ops { const struct venus_pm_ops *venus_pm_get(enum hfi_version version); int venus_core_power(struct venus_core *core, int on); void vcodec_domains_put(struct venus_core *core); +int venus_get_resources(struct venus_core *core); static inline int venus_pm_load_scale(struct venus_inst *inst) { From patchwork Fri Feb 9 21:10:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1144372dyd; Fri, 9 Feb 2024 13:37:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXy54zr7yGsnvSEyRQsCoqaUwas79Lk+8pKXuwURGBgAyx4AbHppNKhA/gv7Nvzz+wjmqaeaunS++M5YjgDGukwTGA9wQ== X-Google-Smtp-Source: AGHT+IHRa7I2B8F0/tcmsdNK8+GiUKVot2cIl/0VYDvfFrAQUa4N1LQKO9QVFQWYhi7ZvEvnFWAp X-Received: by 2002:a05:6a00:450f:b0:6e0:548c:97e5 with SMTP id cw15-20020a056a00450f00b006e0548c97e5mr621030pfb.2.1707514626153; Fri, 09 Feb 2024 13:37:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707514626; cv=pass; d=google.com; s=arc-20160816; b=UEtDnPAs0l8mfihstz71O5BjumzuXTzoJ867kxogOWV/gGQwyBSAJ0B5upG/IP59c/ GdYx/4U7bH4Xt0+3JEQA1Ar5Kw00OMydf9e2BRlJxOUfN6kr6wU55tYKryQJaeRhHHCY Ia7T4+X6RUc9NVS84t+DDJwATDy4se//2hZ6/4ObMC14GYsTRwUwXKzT2kbGmgAbZxr4 o0Et14P53SyIXx5dtrtJyhoALwa2JC4snSqOZ/HBSVhaTJryi5uKo/dMbS+QFB2rYaO8 QlkOctcw+Yk3tAi7evsQj2hjN+CMTxLwR9NZa3qxksQaza5NMk4PK0lsV8ZgOcBJsCKG hInQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=js2pEuzAV2nN8L7KReaasWsLTFytDhFcrYh7TQGAyMk=; fh=4U+6tpYfevBWZjcxyoAurZMuw+ofJLQSvM5N90oDHMU=; b=rZsV8pI2KwGSRb1MsNtQaZ1XO124glp1Lg3S6tYefJsjY0cbxrr5rZXlxlHE3TPXiJ CYms65KW1lYKlPxXyLKWXVfgtmnVDMxNTAIlrKY+ECbNM65m3CJQi5H8Hbh6FfmamyI1 UA9ATeh/ujcvW/mVT/HSF231fhMNnfkKakEuHTUb5Ej0B26UZGYdzi/kqcnBjBtFABEO 3WytBbmldMN5lsVXhVLx14qqK0mR9q6CaFYPZw/n760cnWJotMDIDrt34Rv40rdWKSlX 3u3UmOK3PZrT/5LnZAhIsdBC0xJ/3l0qYCIv2NqDabW9m7w1Ctc0GKKhFIg1tTOu4Boa r7ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zaLCgF10; 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-60009-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60009-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCUzw24KmWQM8xkmc5mJqdXtn9N1pVmsnH96WxQtsEvya1B8nwBOM9u6AupW38Vpf87zd6xSdHltAm3iltvdYC6M9qMs2A== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e14-20020aa7980e000000b006e04dc3a8f3si928869pfl.97.2024.02.09.13.37.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:37:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60009-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zaLCgF10; 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-60009-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60009-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BCB88B2B7E7 for ; Fri, 9 Feb 2024 21:18:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BD3C51C28; Fri, 9 Feb 2024 21:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zaLCgF10" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 764724D134 for ; Fri, 9 Feb 2024 21:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513023; cv=none; b=LOsi3WkkERL1ZHbGAB38FGa45eCf+Yzg96JqexlyuB7nsKC/UGmLkKjMbo+jPgXy+I1sop4sxgiY/NXIAf2j+34UQiqvNE2RpbD6JJNdrUuj+u/Bc872LDkQRvXMLFo7CRTyb117v6P7yqA6y1AaIgevq8gm44BdOtTvMribM+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513023; c=relaxed/simple; bh=j6RqB7qhdLQ/4O4liND2yJpb9uwEoUR3RICjb3kPkBU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ndDfOCWqcsqYZUTuMBZr3hJKGTc/UGj6kHyZMdBPXTWiJckm16hVmjIPaDgNeOfJML5OyBFvECmNc3YcGxRQwiwZbYm8FNJSiaPpxkHnkMpVOaAJC7fFiybcZPKpySBts//3YL9XPTCNc9oVRh7SaBrf9eHtLifXk2vsHb6mt4Y= 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=zaLCgF10; arc=none smtp.client-ip=209.85.218.51 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-f51.google.com with SMTP id a640c23a62f3a-a3864258438so248632966b.0 for ; Fri, 09 Feb 2024 13:10:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513020; x=1708117820; darn=vger.kernel.org; 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=js2pEuzAV2nN8L7KReaasWsLTFytDhFcrYh7TQGAyMk=; b=zaLCgF10SoUcJpVrjbPlsxr2BftQgi9Kl0FsRFzKFb9Qt0xgAeTi6XZ0A1Vm/FWrku f6b2RLKzeiPIppiySgWamvlNt2r+YTWIgMNpsO0RlbmIswK3e78hGwE/L64rdkYxb5wH 3LtnAvKzymyln1b0N183fqjsdaLfdOPI9RRrdW3sRIgxX9hF2zCng0TGREqz0HuqQD2O F0zfkLvf4Cr/rTu6G0BPgWwK2TiHwgoC9gkCT8h77eXm1BZ4TKOFfp91wNy5IiX49tEz WXyofReHQA+/7LX9YyCzZtzCfAoCUduwZtHM2xYNeSq2JIxuCNg2dvBjjFvqnp3izf90 kV0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513020; x=1708117820; 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=js2pEuzAV2nN8L7KReaasWsLTFytDhFcrYh7TQGAyMk=; b=B08vzMGHDmAIKNtPVifSzbGmaWZq/xO3OXQOln149GfgVotQ1gQicjBnLFF0jd3cxp Io6h0jWZIanlXVYRRydOF3gy+fNH5RDtgnTd8V8X7EOSyCoNNdOeNycYgrtJgZlu/afW 9woWsedCZbDQ2CbjHfGbaLp+gX6CHuZUgNYCy8Danmdc+ufTtFdgfPWFBNfNhhDyUK61 Ygo92IZjm3yrYEST0BXDRpgiZBQEJHYpTjbvXBxKuOtpBysSzIkPumXQ3jLII+ccrT/e dF/YImhixSbJ1fLUM6QtrA/zVJK1YuEWhc/M6gl15oBED99+xJHBR0X17++dFNEz6dZ9 QxOQ== X-Forwarded-Encrypted: i=1; AJvYcCUXvjtFXDv4W+sA8sDk99qPCMjgSQtM8iLMS5OBbWxu7lPuh0FTzh1vnmPlhclPV2aYhccbzpVmKbnY++RrcBgZSqZTmJxsYquCmxCS X-Gm-Message-State: AOJu0YxGBdm9Ev2no2yp04sAml8EsRzkBsJ08ZgpADmH7fTmnod363fp gQIdhvJcMUO2RNMtgkaZ/mo5dwpjSwJto6o8Csqtf/DwvbMBVB5LLoiX5lOpNII= X-Received: by 2002:a17:907:9872:b0:a3b:dde8:6a57 with SMTP id ko18-20020a170907987200b00a3bdde86a57mr258546ejc.23.1707513019779; Fri, 09 Feb 2024 13:10:19 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVPsj3/JL+m49YumWioOb6hwJ4PZyfKAxV5EBoHXLB5kuDoUHAT21d6q3TbKuDtpnSbNT5eti0yu8inmkuW8ZKWsGOB8MZnb0uZL4O6bOK42VPeszj8Nx5eLHUJApnynyPhSFx3aJG4J68M1X5JYcn+dXtmof8GcRQi+ChJXdlun1vgU4aYYnKuDlKD37dv9i4Y2Vftyt4A0iUX7A1jqGiSim/FhnEUO+udGIqK9Mjd/AXQ4jmpHvN+w56tUf1E2atIi75D/S2ck/2wk2B+tBTcLzYHANjLba98Gc/LhF6MMcHl25dPW0YZ8JEfgeYKXAm/mErnuwJE6zWDOY9XzWQEett5QI5qI2Wbizos8SeA3BWakMc1rdWozZKoUkK01Ue+y2zZkQzx4hhyMqBKBdxuCrqZvwyzw+aejGPstn0ukY4CN5GI/O/jSPo1FN0MjF60xxpaQzpKzn4sFOrFRxPRs5LbTapiszolVbeQPov7cy6+vRDV2+HPS/lnpOXCNuXLFg== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:19 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:10:02 +0100 Subject: [PATCH v2 18/20] media: venus: pm_helpers: Commonize vdec_get() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-18-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=4126; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=j6RqB7qhdLQ/4O4liND2yJpb9uwEoUR3RICjb3kPkBU=; b=9Y5pQbsbW/NkpOZZSBVKI4DPo8gIzWCYvTPJUpWCb0ma63WrBhZU1JhFW+k4Zm4FDhDj7S0kp Y0A4IGdL18fBYS2FcvBw1mtqr/tI+ssfAfheQykKMGtFBr2FBMYgYYh X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790458856629485633 X-GMAIL-MSGID: 1790458856629485633 This function can be very easily commonized between the supported gens. Do so! Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 22 ++-------------------- drivers/media/platform/qcom/venus/pm_helpers.h | 2 +- drivers/media/platform/qcom/venus/vdec.c | 9 +++++++-- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 1cbcffbc29af..cf0794acf5d0 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -125,7 +125,7 @@ static int core_clks_set_rate(struct venus_core *core, unsigned long freq) return 0; } -static int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id) +int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id) { char buf[13] = { 0 }; /* vcodecX_core\0 */ @@ -158,6 +158,7 @@ static int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id) return 0; } +EXPORT_SYMBOL_GPL(vcodec_clks_get); static int vcodec_clks_enable(struct venus_core *core, u8 id) { @@ -345,13 +346,6 @@ vcodec_control_v3(struct venus_core *core, u32 session_type, bool enable) writel(1, ctrl); } -static int vdec_get_v3(struct device *dev) -{ - struct venus_core *core = dev_get_drvdata(dev); - - return vcodec_clks_get(core, dev, 0); -} - static int vdec_power_v3(struct device *dev, int on) { struct venus_core *core = dev_get_drvdata(dev); @@ -394,7 +388,6 @@ static int venc_power_v3(struct device *dev, int on) } static const struct venus_pm_ops pm_ops_v3 = { - .vdec_get = vdec_get_v3, .vdec_power = vdec_power_v3, .venc_get = venc_get_v3, .venc_power = venc_power_v3, @@ -759,16 +752,6 @@ static int coreid_power_v4(struct venus_inst *inst, int on) return ret; } -static int vdec_get_v4(struct device *dev) -{ - struct venus_core *core = dev_get_drvdata(dev); - - if (!legacy_binding) - return 0; - - return vcodec_clks_get(core, dev, 0); -} - static void vdec_put_v4(struct device *dev) { struct venus_core *core = dev_get_drvdata(dev); @@ -1107,7 +1090,6 @@ static int load_scale_v4(struct venus_inst *inst) } static const struct venus_pm_ops pm_ops_v4 = { - .vdec_get = vdec_get_v4, .vdec_put = vdec_put_v4, .vdec_power = vdec_power_v4, .venc_get = venc_get_v4, diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h index 7a55a55029f3..4afc57dac865 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.h +++ b/drivers/media/platform/qcom/venus/pm_helpers.h @@ -10,7 +10,6 @@ struct venus_core; #define POWER_OFF 0 struct venus_pm_ops { - int (*vdec_get)(struct device *dev); void (*vdec_put)(struct device *dev); int (*vdec_power)(struct device *dev, int on); @@ -27,6 +26,7 @@ const struct venus_pm_ops *venus_pm_get(enum hfi_version version); int venus_core_power(struct venus_core *core, int on); void vcodec_domains_put(struct venus_core *core); int venus_get_resources(struct venus_core *core); +int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id); static inline int venus_pm_load_scale(struct venus_inst *inst) { diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 29130a9441e7..d127311100cd 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1788,8 +1788,13 @@ static int vdec_probe(struct platform_device *pdev) platform_set_drvdata(pdev, core); - if (core->pm_ops->vdec_get) { - ret = core->pm_ops->vdec_get(dev); + /* + * If the vcodec core clock is missing by now, it either doesn't exist + * (8916) or deprecated bindings with pre-assigned core functions and + * resources under the decoder node are in use. + */ + if (!core->vcodec_core_clks[0]) { + ret = vcodec_clks_get(core, dev, 0); if (ret) return ret; } From patchwork Fri Feb 9 21:10:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1136362dyd; Fri, 9 Feb 2024 13:18:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXsAbyVkQMiZaF3E2uu2CLQ2ZsvDZbEtS0+YIPtev7Twm/fOS9/JxbI5afrf5S5hiUciypqA+7G/xFDrrVW9NR8p11LVA== X-Google-Smtp-Source: AGHT+IFGzfgQtaHSXnhGuf4B+wFh7DMTci2xcNSN8+ss7y9ZYv0odUk/DaqhbofS4Ogi9QCUioo/ X-Received: by 2002:a05:620a:1a07:b0:785:becb:7b86 with SMTP id bk7-20020a05620a1a0700b00785becb7b86mr456331qkb.34.1707513496247; Fri, 09 Feb 2024 13:18:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513496; cv=pass; d=google.com; s=arc-20160816; b=bu02hSlMEPlgFnpjE818Rxc5FoTBkyayyEFKg4spnZ5sWpe6lVr0v6cyh2cNLo9E0X lKM1zrczxTvBFW8SXBRG7XEWlOL4TAhPVVjWzaEckdftoVM7cqcLK9j24tFemcNDpKg5 Mzce54RrmQCKwO+uD/gHf+qPa9wtjeY9EA1NlvPNKegIx8xCVJcVbzAUnlu3SdiFQhTc h1HTAaCjggcdmP3+0xu1NRcvjcTdZ1kNQWWzxngBkLpaRk30r40Q3XSYJ66Z7O/SdUmn mwleb2yN01I05OfafFMCKlofNKgpfEKvjSevWOIIksQZjnVCf5Fl7XfAC5SrAKhWjgBM AG4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=yFsyNvwxQilGz6zxZXhAEZJ3UdBMC1zpxUAmMEMQ0vg=; fh=HR8WcxsGOEf6h6dLnijsyh2gAcf1X2pu5kYR2rD7Taw=; b=u8NQGRFrWoZJ45TicGpckRt1hxfwI6Jn1zx7f3lDsOe9mASs1XtJxjsD5n5cpt1M5e EAp8fH3+2p/jRY4TvOMzYr9PMzqj9LMrOa0f2vzGc0CD6XBkYW0poRH6l6h+MUu3ThWN D8b8aD+kcpC2DxFIJirp2Ln8S9IMC4dCyKTNcdNyrG+qBBnbSPaJWTniOQcmz7fHlQCO Hf8Umj6WhzwIcZ6s+6Jh3FKt78ptmHj7MxxFoLyNKjoG/h7rMyNRUTa3ruQD+4zU+ckN rShUPEN22Md6qELDBJ6ZhFMy8ibmT/oH/43syCL/dTlNlmBK64z+aus7CHorGKK2naYg DNEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ySdP1GTe; 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-60010-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60010-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCUmK19OA3dFb2t+52/zhtqB6W1ugqBQbrVKdYGn7VY62lN18CWgGDVJ5re7z+oX+EdoMbgo73eyvKbop65a9/tpoNwasA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a19-20020a05620a067300b00785be4c255csi314504qkh.469.2024.02.09.13.18.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:18:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60010-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ySdP1GTe; 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-60010-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60010-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EF0711C2248E for ; Fri, 9 Feb 2024 21:18:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D474B4F8A8; Fri, 9 Feb 2024 21:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ySdP1GTe" Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 025F429405 for ; Fri, 9 Feb 2024 21:10:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513024; cv=none; b=Nn3tsFaNgCVTo+g/J68vJEWVPLd0gkkDNqd8FkxQpl6ELPzWb3UKTqF1xoceoBxHEp6c5hyE6lDhxsJOpFm5obNMAfA85zHgO6b33wCTTUlK7Nd1Kr+sx0HEayXXGaUxA978KwrdqqmfH8Jqu1Q+q8sKYxbW8nbDexad+UHXbsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513024; c=relaxed/simple; bh=xmr9gBLALZZ4tCzhH3tzwTSX0EVNrOb18RsCpry8TQQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UjlrAvyh1PB/HrtaOI59uD6AOXmWU5Axttup1E4a2XjWdNrZvgDBpgIEEAjFxAnLFh+rDb2lx77dJfipLCt54PLO72QIJIpKaEmE7ffcoiRFnWZ5AmWbCoRd3Kyf33bnik0KRnxQq9eJrbAncEErfxIh0DEBe7+evGdMqcd0cDg= 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=ySdP1GTe; arc=none smtp.client-ip=209.85.167.46 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-lf1-f46.google.com with SMTP id 2adb3069b0e04-5116930e92cso2148566e87.0 for ; Fri, 09 Feb 2024 13:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513021; x=1708117821; darn=vger.kernel.org; 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=yFsyNvwxQilGz6zxZXhAEZJ3UdBMC1zpxUAmMEMQ0vg=; b=ySdP1GTee9qIBb82i6hVQjoMA4TKieaiB6Hw5nhkFAIhPj4z8jkrF+V9h2GBWhBz/0 wRhZNFBKKOH73DDwvw/yc55FNuZyu9LGxlULyy9+lyTlovct0nmINdbD1DI4g7H5dnR6 LT8w5RO6n/gyM3WeDMIwdgrR+r0OQfqwx3hOkcHNcHk6kBXRDETjJCKskhXik/KsWxlK gZxsEPG38R+RLtXHwG9PMUplyJhuSvQsnwiEGtnLvnWld66P72DVUnmuOiq62/mz4E+W KtmeirEexc69Yj7EKdXBBgxYj+LtPc4lXOpfLrxPWZF0QwneZTc9seHYATy/KIMncgNs AwTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513021; x=1708117821; 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=yFsyNvwxQilGz6zxZXhAEZJ3UdBMC1zpxUAmMEMQ0vg=; b=gUlwiaO4mY4J+41Q/KmOlLF9zzKS4Pe8qhyo+cifFMSa9W0VuArMvLkqsJy//HmU4H uQJY10MLNVgVukY8PE/wsTVKtt5Fs8Vk2IMUxpmjDO45zxiEZiL5czqknMxDd8e13hqj tQIZK1GoRdQt9PfTqdC1icSp/bazfpgDivtGcbodXP7rVGZLHvXctD1gHo+h+0oEvdQs JwrFGYErjfrULoTjvlpWBHy/bAsdkrm8D4D8kv/RHCbmd5CyZnvboVS0jXSo+nOvoE8y 9x22JCGrKBiXfhbII0k0ptIReEEBRy/heBWaodqaIGxvOKuncAfCb08nmaDM/C7zKKq5 nNWw== X-Forwarded-Encrypted: i=1; AJvYcCUd36OgbLbaFdu4qokfG1kmKebECA05mce45IsvnaxdifuVMh2jHBcj8R4PpI0phnW8IZ8s158dsuIin8lFBHEwDVvsz+yesOCcCETy X-Gm-Message-State: AOJu0YwAvEcBRhoWcZUcD5XKueVOLb3pS6TI2oqp9NUi0xEYufhkXdCp EB36CkFpIzwV8tkZpS8vRlIjYkOvPCvqu/B7Dvnz+ysAa54sXjZNDTqwF+5YhS0= X-Received: by 2002:ac2:4243:0:b0:511:7fb5:91fc with SMTP id m3-20020ac24243000000b005117fb591fcmr138038lfl.20.1707513021249; Fri, 09 Feb 2024 13:10:21 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUKO/zPhvMnpN6+uHTF30b9UESaSFB4bZ4gS38403aT0q+1mrhv8dT13hiJGJWoj1ozvWqP4pac0v9QBYBiyN2VZ0n4LTUJkFTOK+oc/Oa66alZU2VKzH/ct2bYwPDI/1N75GoJn94MUxmoTE2ri5x3g/K9W3Nkhbz7ZunXYtfZf14tPZh0GJJL/mq7stwyzLXzdoocAoIMaTmqlK02PtQ5ao59lx9bwPjy4Zr3zJ2Nv78zvEH+g0sGWdqTOdsw/dECzh3ZAhBUvg8qIKbwXh8lhc7C1VedGZVSG46ZBIpzd8MpF/l8XXMsL9MFpK1G/ByDYSJC/e6jRJu6G3n+KP0Sdb7thPNhkjIJ9mPb5kStv2O5AUVshlG1cyp7TrJ1bO5tuWCPPjffKHNqfJuwQeELVJFlonuDsuu6wEHUz+cUS68mPrR46FGz1WjFWO89+8OHb+eQAzCf5G9ZClhHQjXmIti30OgIT0jqI4jDD3Cll7yTF7EOmlj50SmLr5H26XuBcg== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:20 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:10:03 +0100 Subject: [PATCH v2 19/20] media: venus: pm_helpers: Commonize venc_get() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-19-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=3254; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=xmr9gBLALZZ4tCzhH3tzwTSX0EVNrOb18RsCpry8TQQ=; b=MwE+XQyOfpxkRSYew5l9uPJPp+xTAWAOlE0VUdIFsDi45PwmWNoRZ5WsueqGgFCumjHspTGlP OgMpCyCOFhfCl8/Gst+Hkaf/jwhKbL/R957iYMzifXJpYt4qzrhYuDH X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457671979765305 X-GMAIL-MSGID: 1790457671979765305 This function can be very easily commonized between the supported gens. Do so! Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 19 ------------------- drivers/media/platform/qcom/venus/pm_helpers.h | 1 - drivers/media/platform/qcom/venus/venc.c | 9 +++++++-- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index cf0794acf5d0..9df8f2292c17 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -363,13 +363,6 @@ static int vdec_power_v3(struct device *dev, int on) return ret; } -static int venc_get_v3(struct device *dev) -{ - struct venus_core *core = dev_get_drvdata(dev); - - return vcodec_clks_get(core, dev, 1); -} - static int venc_power_v3(struct device *dev, int on) { struct venus_core *core = dev_get_drvdata(dev); @@ -389,7 +382,6 @@ static int venc_power_v3(struct device *dev, int on) static const struct venus_pm_ops pm_ops_v3 = { .vdec_power = vdec_power_v3, - .venc_get = venc_get_v3, .venc_power = venc_power_v3, .load_scale = load_scale_v1, }; @@ -785,16 +777,6 @@ static int vdec_power_v4(struct device *dev, int on) return ret; } -static int venc_get_v4(struct device *dev) -{ - struct venus_core *core = dev_get_drvdata(dev); - - if (!legacy_binding) - return 0; - - return vcodec_clks_get(core, dev, 1); -} - static void venc_put_v4(struct device *dev) { struct venus_core *core = dev_get_drvdata(dev); @@ -1092,7 +1074,6 @@ static int load_scale_v4(struct venus_inst *inst) static const struct venus_pm_ops pm_ops_v4 = { .vdec_put = vdec_put_v4, .vdec_power = vdec_power_v4, - .venc_get = venc_get_v4, .venc_put = venc_put_v4, .venc_power = venc_power_v4, .coreid_power = coreid_power_v4, diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h index 4afc57dac865..cbf54e6c6eab 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.h +++ b/drivers/media/platform/qcom/venus/pm_helpers.h @@ -13,7 +13,6 @@ struct venus_pm_ops { void (*vdec_put)(struct device *dev); int (*vdec_power)(struct device *dev, int on); - int (*venc_get)(struct device *dev); void (*venc_put)(struct device *dev); int (*venc_power)(struct device *dev, int on); diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 3ec2fb8d9fab..d17aeba74b49 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1557,8 +1557,13 @@ static int venc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, core); - if (core->pm_ops->venc_get) { - ret = core->pm_ops->venc_get(dev); + /* + * If the vcodec core clock is missing by now, it either doesn't exist + * (8916) or deprecated bindings with pre-assigned core functions and + * resources under the decoder node are in use. + */ + if (!core->vcodec_core_clks[1]) { + ret = vcodec_clks_get(core, dev, 1); if (ret) return ret; } From patchwork Fri Feb 9 21:10:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 199111 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1136472dyd; Fri, 9 Feb 2024 13:18:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLh0ygupvSo69cP4dcAFMqWJVO/FV3eDBVwkp87O1CpCBTAmSJ/5+3/DHLisUP3bJlYFHT X-Received: by 2002:a17:906:af15:b0:a38:786b:f371 with SMTP id lx21-20020a170906af1500b00a38786bf371mr230576ejb.36.1707513509623; Fri, 09 Feb 2024 13:18:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513509; cv=pass; d=google.com; s=arc-20160816; b=djgnuQVruqC+NU3sdV/zp1F1MJZA7PGB1NB4SJyRPXaJE6sSIE8lbPos6q/WYkNFrg gIaf7WSaGM9a3jnjm9T8BCo39yqbPxzBHyXwMK1krghmdwmyiDcFTjeJBxeAPLOv7/es 2O9qcs8rlNj3ep6mpxLjeDNjeR45OCQ/HvJQn2NNi+1wzZdRBaRLVmQjaaIzATkCsSy7 3VhsxOi6KEHj5XHhoVsGH2/c4YuU2Snnr3KNc6RpSu2RSoHby7gbr/fY6Cu9c7gTAI49 LJxQVkTuAP2ySsboYbZqcjzebYSskB9JU18zcDW87aKNfe17nrimw5uaMa7Q4xJtghk0 91AQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=VBuTuqSBCGp1wdV2drsgjw3VLfRlaM3TQsPOZG9m4W0=; fh=aYMtzz+UUUuojuhubG+VZDsMc0AZWj1enxMRvEWi4gc=; b=IVDaicoVdpPUqKMErdZC5A8qXZIZeStlNo3enzS37IzC9ZM4z2t1Osqh4rCVVTDCMn LSLpAgkcR/RhaeRipiOjp/FhT3LrRiNWeHf7deN9Yamvhywsf8OVwj4odkh0OFEZa4/m ETCZazZYd1wEWGDWLeuzVEjmFpd16lu2rx+Ev73raca7RCy/C+fC7RwKoNng8b22ZY2H 2SajN1NsyX3hqz/7AlxW2UcrbrqkyDK9mIGhdNG0i2/S8adfclUU18ks9ercZakxCFHr tNU4bCK8JBNoumXpDGgCL3TAyiztDhWew2CMJVAIFOagFKBXVTEzabe5znG0msUyZsf1 mLYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H4v71HX6; 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-60011-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60011-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCU3pS0GmWsUDgarsYwt6F7WgMwq8wJwQJD0rBQrehWHfhSVN+HpbBVmrvUuFDj89McSihlsEaWbGMA8Kkb1KjOSPbrSBQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f11-20020a17090624cb00b00a385535a02csi1202266ejb.8.2024.02.09.13.18.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:18:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60011-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=H4v71HX6; 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-60011-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60011-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 18C4D1F23710 for ; Fri, 9 Feb 2024 21:18:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 673AC3613A; Fri, 9 Feb 2024 21:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="H4v71HX6" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 EBE1A4F8A5 for ; Fri, 9 Feb 2024 21:10:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513027; cv=none; b=oo8z79izOgvqAmg7AcjtUYSyJ4DvSQiiHH0ctMYDbZYj8XNfiW9KmfcU5HwN1OC1xIUKRC71OfzBDq46tZP+u4iUVAleTORC9b84Yv23qLngfHN3f5V7M1EOnzMa1pfcN8KZWBRYAnudWXyQDd45hob6613cp4k5gQ8JYlZWuPw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513027; c=relaxed/simple; bh=Fz9/3nwY3iRMESW9ND892gH2ujeyGwLuBsrH62OMhc8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ktEW23ViQz2eC8f+5GVxRXtSH/e1T66jN8fGxODJkblPAEbNKT1VBUhEV0Kb9dTkSiO+gOu9GWF3KqRU7oaxN55GxhkRpP8+WPw5aPsxEMTtROtqRgLjqNvvnInLE2U2IH6BrTa5gJ8PfiflfccLr+HNcQKg2ZlF+6MMAoT3LOk= 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=H4v71HX6; arc=none smtp.client-ip=209.85.167.52 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-lf1-f52.google.com with SMTP id 2adb3069b0e04-5114fa38434so1573346e87.0 for ; Fri, 09 Feb 2024 13:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707513023; x=1708117823; darn=vger.kernel.org; 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=VBuTuqSBCGp1wdV2drsgjw3VLfRlaM3TQsPOZG9m4W0=; b=H4v71HX6mKe5gMPn+3B0kX/sDpU2QYy3U+BOFhg8E3nCKWFJo7GI1rXNMq5HiM2i7d TuWz1+ZSiSRbkKkfSGkbpnaruRWc8gTPTaczdVCigRJ6FdF3lsZkP55Q9xUIa6M8ml3G 4yicNypI7/+2yaL+CigGp0DP1XZV3IOoIrqxIwZ1tcZ+6PKutB3WiNvDVrtTV0hZTbBX lS2OjFEDXVdBjYbmvuGVDrvrIZYcPD+1Ag82mOCenYR309KDLEKIdzDTT4B3BjQVJnyE Ik8Ck0JYm1NJhzH28GC+yYXc0Ocho8WnI9lOXI7q/dOL8C+ckwSEUgiOvTrgbEdAewgD seNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707513023; x=1708117823; 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=VBuTuqSBCGp1wdV2drsgjw3VLfRlaM3TQsPOZG9m4W0=; b=ZGp4+YIWU9vJLGhk6vIEdW8ft5opoNunFVctWXhLB7d3pWdfC1XwyIs/O2ygXL26TK 3c3Kr91MucPPBMM/04MiLydW5EyLhYVEVJCGJ2XHccfHA5zi/603/uM0tENcWq9x7H/M BJYXL9ltJAwJ2Dx3PNp1cWSRcwXVzrkEmuzV8VxqgkFauxdNVlTzuwhSVaRxYcxxy5ci v0Jx9BmPLS9po9+EdrF3eOVwZb92n7tS5SIPLWgd2Eod+By2WEzLrI+tmNnSc3jt+72b 91OdEY5v2SBGt04T9Lk5MgLTTu2JOasFAjQm7AewGkuv8n1p/YitxmO0wdhoKF/6pIhA 0A/A== X-Gm-Message-State: AOJu0YxJmtFfZcuX7GpSp1yVrMeDJtCvDcbC6ZJzUz7E6zruqW3mbvzh CtSjZvs2xlF7NKpMwYy2/DXdb3Rdqmp2DsSxbUW70bhsiWuK5L65qIFj5iRoioY= X-Received: by 2002:ac2:42cb:0:b0:511:429e:43d4 with SMTP id n11-20020ac242cb000000b00511429e43d4mr153429lfl.11.1707513023199; Fri, 09 Feb 2024 13:10:23 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXaCO1qT04kwtps/bfEISjBC58UTjh+OzcG6dJ/58GzZqaZ4sJXT0ZCCFTSZO4GEUOoVbaCB2hkW2i+iA8G+/jiWkr6FmSe3dUxfhzl5X7XuewdWZPHq72K/dUggw9LviQbCuhILgmFoZlf/UWuAXfeE8ZB1ICSPB1DQSPE02/PsVIwmiaF0c1w2tPagVpJczZXASAWiid9Frgy5PphXUxjz0qpSZoQwm9wQXfZGyM9BwoxrbBl/rmiqovVVxw7WHtftYgYAbJm/e3I6EpSjMC8oayLxmZXCRkaryoFx2b3Un+gZZXJMd20001HWk5q76RHVB+tFrq76AlanSx2mQzoGdpyAaRD7ilmuQudlWtiep6I/mAlpnfka0U3c7oBrpsAeMD0+BLP3M/4g/KSly61ErLdj1mvdBooNXwsbIB3RW87YIbynNB6VOfB+tQJGnw0XpgpXzipH0uEuLzNSVN4HN/qo368y4TUlqYT4ULzxKZ2J8AkWThmxWTgPyZcSTmnbQ== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id vo5-20020a170907a80500b00a3be3b27d0bsm1056517ejc.49.2024.02.09.13.10.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:10:22 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:10:04 +0100 Subject: [PATCH v2 20/20] media: venus: pm_helpers: Use reset_bulk API Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-20-3dac84b88c4b@linaro.org> References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> 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=1707512986; l=3454; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Fz9/3nwY3iRMESW9ND892gH2ujeyGwLuBsrH62OMhc8=; b=Fd7i7FaWiwaHVHHLebF/wCA/vcsVdLEcCtmGGg18YNUn3FNRyH6lEVGWeoBqDEYk1gfz8xMJZ MaSw0hu4S5pCKtrocK1nPDg6flxKKaGSCbv2ywxGWlw/Sy04vZUlTz2 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790457686123373934 X-GMAIL-MSGID: 1790457686123373934 All of the resets are toggled together. Use the bulk api to save on some code complexity. The delay between resets is now correctly determined by the reset framework. Signed-off-by: Konrad Dybcio Reviewed-by: Philipp Zabel --- drivers/media/platform/qcom/venus/core.c | 15 ++++++++++----- drivers/media/platform/qcom/venus/core.h | 4 ++-- drivers/media/platform/qcom/venus/pm_helpers.c | 15 +++------------ 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 873affe17537..ff5601a5ce77 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -328,11 +328,16 @@ static int venus_probe(struct platform_device *pdev) if (ret) return ret; - for (i = 0; i < res->resets_num; i++) { - core->resets[i] = devm_reset_control_get_exclusive(dev, res->resets[i]); - if (IS_ERR(core->resets[i])) - return PTR_ERR(core->resets[i]); - } + core->resets = devm_kcalloc(dev, res->resets_num, sizeof(*core->resets), GFP_KERNEL); + if (res->resets_num && !core->resets) + return -ENOMEM; + + for (i = 0; i < res->resets_num; i++) + core->resets[i].id = res->resets[i]; + + ret = devm_reset_control_bulk_get_exclusive(dev, res->resets_num, core->resets); + if (ret) + return dev_err_probe(dev, ret, "Failed to get resets\n"); ret = venus_get_resources(core); if (ret) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 6ecaa3e38cac..2376b9cbdf2c 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -130,7 +130,7 @@ struct venus_format { * @pmdomains: a pointer to a list of pmdomains * @opp_dl_venus: an device-link for device OPP * @opp_pmdomain: an OPP power-domain - * @resets: an array of reset signals + * @resets: a reset_control_bulk_data array of hardware reset signals * @vdev_dec: a reference to video device structure for decoder instances * @vdev_enc: a reference to video device structure for encoder instances * @v4l2_dev: a holder for v4l2 device structure @@ -183,7 +183,7 @@ struct venus_core { struct dev_pm_domain_list *pmdomains; struct device_link *opp_dl_venus; struct device *opp_pmdomain; - struct reset_control *resets[VIDC_RESETS_NUM_MAX]; + struct reset_control_bulk_data *resets; struct video_device *vdev_dec; struct video_device *vdev_enc; struct v4l2_device v4l2_dev; diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 9df8f2292c17..170fb131cb1e 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -865,21 +865,12 @@ void vcodec_domains_put(struct venus_core *core) static int core_resets_reset(struct venus_core *core) { const struct venus_resources *res = core->res; - unsigned int i; int ret; - for (i = 0; i < res->resets_num; i++) { - ret = reset_control_assert(core->resets[i]); - if (ret) - goto err; - - usleep_range(150, 250); - ret = reset_control_deassert(core->resets[i]); - if (ret) - goto err; - } + ret = reset_control_bulk_reset(res->resets_num, core->resets); + if (ret) + dev_err(core->dev, "Failed to toggle resets: %d\n", ret); -err: return ret; }