Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1190621lqb; Thu, 18 Apr 2024 02:51:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbGGkALMRrsSeKqWBBMZzIk9mHgmYJMXT4QZW8o3pHtwFSoxDChpIMVcPPmsQHT9saXTjGj4xb9iJTYTNM9KGd65pf3WT/6z7gCGkllg== X-Google-Smtp-Source: AGHT+IGottcB21xRvoGiSystNNtbmlgCBq4TUD7z6WcNzUctUCiguha9sKVWt6d2rMi6uICf0tgm X-Received: by 2002:a17:906:3a87:b0:a54:d3aa:64f with SMTP id y7-20020a1709063a8700b00a54d3aa064fmr1171285ejd.62.1713433898842; Thu, 18 Apr 2024 02:51:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713433898; cv=pass; d=google.com; s=arc-20160816; b=A9ywWEvXqY0sc0Z/hszByScDU+aNagbJkb1yHz3OlNWqQ59QDxsnbjD0Sw2CC56Ogp r5w14AP7G/vDyqR29nUsv8YBT2eFP92rY5KBzaukm4lPrruhHBu4Jp7EVWMVCjSQVnIn UmsGwTHyuh9Q4PR/Eft0vVfCUnsucVZ+OpU1Ph1od/30QF2JDEu7UsqeNRMCfudMG5hl 9HKR/fUto3U9bGHmqbTt7f3l0ZSQsFbQL0ZTO9rSSJ/2eawTn1zyBEVNbhiEQgLmfdSj Rs9ebB2eyvT3QXNp1Ft50TkmlYaaevk2rfs7J9vtQSkHhfQOZ7aua2L7nCDa60TnI9y5 uzuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=OGBY5n0lkuic0XzOyZry0BISQT6Vj4C0SqZCz5uX33M=; fh=FU/xmaKBe7VL+M1nFXma7Tx/Ir5Y7vKkqw2zKzgfa6w=; b=GMGXYVBqiAJFvj8I/L284j1nLJYk9x79OpkUmpU0aVjwpRmC1AEsgqmjIwpwxWGilo 6nRNVD6w9iIAdycMXszYXOQFDf2xGVNblh1F1+BVMdO1qZwAwmXOW4pr6rPnudO84twx Y5Y58AJEYGKarQm3Z7pU/YNHTQwY940xCX+jojWVS7foOSff28k1J0svvCvrn6kTOZP3 vi9DBq1387fi7P+OsnNP854PXXDjyp6/GgFN/Hp1ynWQJJF7YiN54bk4S18o9d8YTq9q aTfFwTE1UhKdgTYet3KhIz0FiHVlXZTq9iyq3OtymfOo3nVxZkxvWIYoy4YRH7PpG9MY t1kA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jtd1XF+U; 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-149844-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149844-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s13-20020a170906354d00b00a5546707454si674313eja.557.2024.04.18.02.51.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 02:51:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149844-linux.lists.archive=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=Jtd1XF+U; 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-149844-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149844-linux.lists.archive=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 5F1C61F23072 for ; Thu, 18 Apr 2024 09:51:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD82C15B54D; Thu, 18 Apr 2024 09:51:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Jtd1XF+U" Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.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 8A07715AD86 for ; Thu, 18 Apr 2024 09:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713433883; cv=none; b=lb+P+3eKUDKvSgO/5lt5RqREkn5ahGTxejPBGZeISoDpcDGr+e7ZlU4xDhwc2keMFkAFsU9roqCtUTqTNBdHf1XtSCysE12vbDLtQn+ogam+IILLJIae5vkQEhV9EDSslC1Mz707P6kY3liELoenh1hrGEYjyn/qJpVpm673cAY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713433883; c=relaxed/simple; bh=CmkAx09d7unD9qOUxiMbRZMA780DM6Gi/Z/Ysdz0BIY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UKCEnpRA0plvfHNsGX8H42HJGUBWgk8AzQbtHLDbShLmK0hOKtInbmC8EgYleo9VUwALSzi9zMe7Nvp5EfuBNhQDx7U1Odi7j8xUckDvfs5ApBp7wPjTDOwwT76F1EtikDTbQn9LlR8zqF13i1ax5l86hfW8qV/bXXfZqBdcRjk= 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=Jtd1XF+U; arc=none smtp.client-ip=209.85.208.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-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-56e477db7fbso1049226a12.3 for ; Thu, 18 Apr 2024 02:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713433880; x=1714038680; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=OGBY5n0lkuic0XzOyZry0BISQT6Vj4C0SqZCz5uX33M=; b=Jtd1XF+UC11q92Vf1ok4gytCI42vyCt93cIX689IBUYr5XtTkIIrJyUD9njzGDdU8r eYBQgJRPx92dhB9V7Jv0SDIoJEyzrHIU0UG1vI2JnYTj4zIr2jpSeNooNYVaUAqD5u3F rR3fFrrlLk1EwAnBf0IILrgUYMrH8FFeWCxYCrr06h4zqB6g0kRTrBd+/o5KlD41U+Mr qzQC7JTPkozO1F6yXGCOoCiQRQMcZY31zB5l0UlPmdS3aN0H4RqnRkPOKiEDdAd3dZD1 YEKyVGhuc2Php1YNE6VjS9cwDJKKGXKdUu3TaUibHSrENU57Op/2uL85MAp9T78AjdmK bNAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713433880; x=1714038680; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OGBY5n0lkuic0XzOyZry0BISQT6Vj4C0SqZCz5uX33M=; b=wSC+cnICE/qYK0GLBvdKvGlsn2m4my9VIDhbEkyOj9CNeJXEJjsAwKHXq18tIX84sn SygIzQf40JwI/nGvGdHy/mQLyYqP5Zncz6+ijxXCqUmj79qCaCJ+Tc13Hj4vugel0w3i T68nLhMWEjPLso/THmvm+K7ZbbE/RcuZCu8sNX36ksMfnzk8ePsV2OF5uaGPKt9Rp7AY LaW51kXgfxGOcwVompVGHjwHnjK/oCGuWHjEN2YjN9Okn8voBMyspx35WG3aDYH5hQZV nggSycIjta+GIsslljA1dIhD50OHtuZNDTXYKITunbrqG1dkfz4E9z0CxOZazLLp708z Toug== X-Forwarded-Encrypted: i=1; AJvYcCUvqxufgchD+EnjKrGmfl59JuFHwOFVES75NIPd9x9fxIpsgo/SfU13pAW+/VyfP2/3Uqc+RA9ZUedRwmSHtjLvJOAqaJduWbth69kO X-Gm-Message-State: AOJu0YyQCdc4sSSLX7+WjAak/wrNLDjbR+MOkzh0/0a6JuxV2INvOMiu dSLJa0dOV1zlZCwcb9D8v33In30qUWFA8etZPJHRKMxihrnJOhYzOqPiM2H5JgOh8FarIhWMSd2 h X-Received: by 2002:a17:906:4151:b0:a52:c873:a66 with SMTP id l17-20020a170906415100b00a52c8730a66mr1316386ejk.34.1713433879768; Thu, 18 Apr 2024 02:51:19 -0700 (PDT) Received: from [192.168.45.55] (078088045141.garwolin.vectranet.pl. [78.88.45.141]) by smtp.gmail.com with ESMTPSA id f5-20020a1709067f8500b00a5559f0f9dcsm669994ejr.79.2024.04.18.02.51.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Apr 2024 02:51:18 -0700 (PDT) Message-ID: Date: Thu, 18 Apr 2024 11:51:16 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/7] drm/msm/adreno: Implement SMEM-based speed bin To: Dmitry Baryshkov Cc: Bjorn Andersson , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong References: <20240404-topic-smem_speedbin-v2-0-c84f820b7e5b@linaro.org> <20240404-topic-smem_speedbin-v2-3-c84f820b7e5b@linaro.org> Content-Language: en-US From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+RvadOVi6CoUDqALsmfS3MUG5Pj2Ne9+0jRg4hEnB92AyF9rW2G3qisFcwPgvatt7 TXD5E38mLyOPOUyXNj9XpDbt1hNwKQfiidmPh5e7VNAWRnW1iCMMoKqzM1Anzq7e5Afyeifz zRcQPLaqrPjnKqZGL2BKQSZDh6NkI5ZLRhhHQf61fkWcUpTp1oDC6jWVfT7hwRVIQLrrNj9G MpPzrlN4YuAqKeIer1FMt8cq64ifgTzxHzXsMcUdclzq2LTk2RXaPl6Jg/IXWqUClJHbamSk t1bfif3SnmhA6TiNvEpDKPiT3IDs42THU6ygslrBxyROQPWLI9IL1y8S6RtEh8H+NZQWZNzm UQ3imZirlPjxZtvz1BtnnBWS06e7x/UEAguj7VHCuymVgpl2Za17d1jj81Y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EEU24if9oCL2zd AAQVR4cBcg5dfFgFAmQ5bvICGwwACgkQR4cBcg5dfFju1Q//Xta1ShwL0MLSC1KL1lXGXeRM 8arzfyiB5wJ9tb9U/nZvhhdfilEDLe0jKJY0RJErbdRHsalwQCrtq/1ewQpMpsRxXzAjgfRN jc4tgxRWmI+aVTzSRpywNahzZBT695hMz81cVZJoZzaV0KaMTlSnBkrviPz1nIGHYCHJxF9r cIu0GSIyUjZ/7xslxdvjpLth16H27JCWDzDqIQMtg61063gNyEyWgt1qRSaK14JIH/DoYRfn jfFQSC8bffFjat7BQGFz4ZpRavkMUFuDirn5Tf28oc5ebe2cIHp4/kajTx/7JOxWZ80U70mA cBgEeYSrYYnX+UJsSxpzLc/0sT1eRJDEhI4XIQM4ClIzpsCIN5HnVF76UQXh3a9zpwh3dk8i bhN/URmCOTH+LHNJYN/MxY8wuukq877DWB7k86pBs5IDLAXmW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 18.04.2024 1:43 AM, Dmitry Baryshkov wrote: > On Wed, Apr 17, 2024 at 10:02:55PM +0200, Konrad Dybcio wrote: >> On recent (SM8550+) Snapdragon platforms, the GPU speed bin data is >> abstracted through SMEM, instead of being directly available in a fuse. >> >> Add support for SMEM-based speed binning, which includes getting >> "feature code" and "product code" from said source and parsing them >> to form something that lets us match OPPs against. >> >> Due to the product code being ignored in the context of Adreno on >> production parts (as of SM8650), hardcode it to SOCINFO_PC_UNKNOWN. >> >> Signed-off-by: Konrad Dybcio >> --- [...] >> --- a/drivers/gpu/drm/msm/adreno/adreno_device.c >> +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c >> @@ -6,6 +6,8 @@ >> * Copyright (c) 2014,2017 The Linux Foundation. All rights reserved. >> */ >> >> +#include >> + > > Stray leftover? Looks like [...] >> + >> +#ifdef CONFIG_QCOM_SMEM > > Please extract to a separate function and put the function under ifdef > (providing a stub otherwise). Having #ifndefs inside funciton body is > frowned upon. Hm, this looked quite sparse and straightforward, but I can do that. [...] >> +/* As of SM8650, PCODE on production SoCs is meaningless wrt the GPU bin */ >> +#define ADRENO_SKU_ID_FCODE GENMASK(15, 0) >> +#define ADRENO_SKU_ID(fcode) (SOCINFO_PC_UNKNOWN << 16 | fcode) > > If we got rid of PCode matching, is there a need to actually use > SOCINFO_PC_UNKNOWN here? Or just 0 would be fine? The IDs need to stay constant for mesa I used the define here to: a) define the SKU_ID structure so that it's clear what it's comprised of b) make it easy to add back Pcode in case it becomes useful with future SoCs c) avoid mistakes - PC_UNKNOWN happens to be zero, but that's a lucky coincidence We don't *match* based on PCODE, but still need to construct the ID properly Another option would be to pass the real pcode and add some sort of "pcode_invalid" property that if found would ignore this part of the SKU_ID in mesa, but that sounds overly and unnecessarily complex. Konrad Konrad