Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1239165lqb; Thu, 18 Apr 2024 04:31:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoXa6Urc440ts14clCQAWg9nsMJY6GEvm6G4Rp1s1ItF00P7KUo7aqmIlGWgoFoSvsYuIFCWvRbfL6R3+NHZrsZpjzMMLtUIpk98cDOA== X-Google-Smtp-Source: AGHT+IHvdrJw2Q30XfkYBkJaaJCH7W7T3xsR2N8eO1xkkSx3JBMRE8bW2SuUXe/WGP2v4jhbWYWl X-Received: by 2002:a05:6a00:14c8:b0:6e6:ccec:fdc0 with SMTP id w8-20020a056a0014c800b006e6ccecfdc0mr2716514pfu.33.1713439910251; Thu, 18 Apr 2024 04:31:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713439909; cv=pass; d=google.com; s=arc-20160816; b=ASRUm65pfd1GqpK6BxmPANjTqEO5/Xrv2Ql2U5+ojeioQYLGI46EEb11MkdLhdKmeD YOSQUtgNFwUAvoroDQ64IVgkPOLwgJ0dxpyWzkMo2WroDmKsdGb8xQBmjlGM+xgAYRBR jjkF93Woo+pcOIKyNcm1S7WWxsNGl85UAyBznsDjFzumLlm/hqhspC1b2eBznz2UJhRE ViNXKn8xmdcwzrHOrI8Ar4B5tlqoKGd1wnkIOd/2IqNlLalkV4pHWDS1i0WqeRslhTRj 65xRBuMOo0Oc9U4wNJutq3A9zUoLebOE/dEZR6wgCTMPlNqy6JaSsFicUk6SOACqmbvV WHcg== 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=X8LbQ8g2eKHuVcN88bhcgCY+RDxNHv8wy3DmMUUp3G4=; fh=bKymIW48GFOaZm+jtfyPk8JjOkUQIxltT9SVSG6tgpc=; b=QmaqyC1ae6bGp0G5jqup/PMFrWgDzyUNWRcJSK3x8fmiTCi3AlHN+7DT2FK8ELPDtv 5qM/5RXhXTiDR5jV9MrzhKJIlnIeHZepFwvoZCSt85shNXkhn3AizyiEm8gsuN8qajDs Dj0H3hlIB97jWCrWLesHQy/mehPol540tsX/BVSje0FltiVERevTktE8i7GxLfMA1x+Q WzSXs+k7G/UhGtisivQ+UKrpjaTF212ZtGyzTlCsqX8D+h1pqDFqDEF4DVw9i4ozM13L bc5Fbk3BcpFirnjPBLUfOoPcK19XdjJvX+sBAeB1pLETeFQVt4yc44G2pmsm4/NoXH5X g2/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CX7AnHBj; 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-149969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p20-20020a63c154000000b005e4dce697c0si1252086pgi.655.2024.04.18.04.31.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 04:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149969-linux.lists.archive=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=CX7AnHBj; 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-149969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149969-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 141302840A0 for ; Thu, 18 Apr 2024 11:31:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A09615E7FE; Thu, 18 Apr 2024 11:31:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CX7AnHBj" Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 4E84F15AD99 for ; Thu, 18 Apr 2024 11:31:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713439901; cv=none; b=Z6Y2dNvPzfT1l1/Y6uVZfVLyCT59rzHwMRUHHvbcN7HcXjq/n4g6LT34uh7jgpKgKeaNLPNOFNDGhoZQzI7XaZN3UTCFli5zoksUXKj5UU3WIo9VfUMT2N5X6uorGf27a9/YUf3A614vyhVaI4gfbRSvbyqz9n3sb1DL7GiVV5E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713439901; c=relaxed/simple; bh=wMjzhmNcwcJa8Q8gnXG/YY/EB7MYL/bXGRm82Uqogzo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MAaEKkMiVzt1HoKZanLmSzb63ZdoZcxlZevqqyIkdYHODyxSW+QfAdn8v0W1SJgTILLW6TcHS5x9MGku0+Ea9QF31SBaxHLGUO2sMl+Hlw4lp9M+uVQPTgPdBwGcrG0i3FWX4O6Afd4X95PzkA+WW4NWQZYU9xF3TIWf8DWdXTw= 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=CX7AnHBj; arc=none smtp.client-ip=209.85.218.53 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-f53.google.com with SMTP id a640c23a62f3a-a51a7d4466bso80019466b.2 for ; Thu, 18 Apr 2024 04:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713439897; x=1714044697; 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=X8LbQ8g2eKHuVcN88bhcgCY+RDxNHv8wy3DmMUUp3G4=; b=CX7AnHBjvIh9Ab070lq+Zbl1Sx9c5x472NtUifjmgIU7rpfYyBOoAef1K816DosW9H /LS/EtafzRhEctZBSw3joqVgh0AZQsj2/P05kWPYssbMy0sd/9OdNM6yd2tRKYJ/VNu8 9DxLFONlpLRerUKk0vK/KdVc+vlTY6isQ3tn/e6pqVMZv+vTrS+kwuVFMpAusAOLJjst dO5XIOo8GHe/2h0TjumFgWQZP/kmaSDjSJgiIzcjKtqb3RIxEDhjNqXSCjNutmbUHPr3 jrH+pxi4zyJAiQkxyv4HDBOEHt0K+x3iKrbRuCkPAfSARWbdcuNYF0AggLZl10Y/4x87 BQAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713439897; x=1714044697; 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=X8LbQ8g2eKHuVcN88bhcgCY+RDxNHv8wy3DmMUUp3G4=; b=tUrTa0aQyR5QHwqJ1vVj4Ua4ziTqC5k5/LfZiuj5h72+nkjCDY8UKdsYJVEkIDWjkY LOcCoJEcIIHnSaQ7CZieM0M3SGQZ4dwxEHKTcGpySxlWD2x8yRIs5ikSf8MAGXTm5/Ca aP01En6iJF+AMUVD0tBT2A4D9nBbGXFrtK6FDt9ir5I9tmqxfeiMMi70/0npx+9C80wB JuHJ9J+iFqdu7nXsUI2O+9ymUbY6CJLXWhBIPcioBnXrPcLr9eV+7gBrTVKACfXMXjvC ySwNK83QedC48SnE+gwL8BIf9BNAdrt0xa06/osqE1ygHWioFA2MeOJkd8xDj9aq5GrO 5j8Q== X-Forwarded-Encrypted: i=1; AJvYcCV2Nbg9mIBj0puK+6ta2pBOF5KXUUknupza2QD6U8ub4w1EW8hE7JlLsi0E7p8gqss0zYQr4+xH+lWgATOF0mRNJ371QNt5AHRIdJmv X-Gm-Message-State: AOJu0YyswOJsDnwKE/7LU6puJ/9Ewg9urj35o4a4eF8T/Gurs1BDEyKM bEPFFWDYKytX/8GFStZq/dHEbRuk6hoadBi2Ucm0uOGT1O5nhujZz6DFMP7psVA= X-Received: by 2002:a17:906:1c10:b0:a47:20c3:7c51 with SMTP id k16-20020a1709061c1000b00a4720c37c51mr1422968ejg.71.1713439896601; Thu, 18 Apr 2024 04:31:36 -0700 (PDT) Received: from [192.168.45.55] (078088045141.garwolin.vectranet.pl. [78.88.45.141]) by smtp.gmail.com with ESMTPSA id dq16-20020a170907735000b00a524318c380sm768037ejc.80.2024.04.18.04.31.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Apr 2024 04:31:35 -0700 (PDT) Message-ID: <2b5f33ba-2108-464c-b4d2-eff2cc6e59cf@linaro.org> Date: Thu, 18 Apr 2024 13:31:33 +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> <7ynodjzjuxwwqkjgns5jtnkckw52qyldfpsqpjh7645swva4xk@7wucftyjyyy3> 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/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t5 Lkn2XgB+IW8ESflz6nDY3b5KQRF8Z6XLP0+IEdLOOARkOW7yEgorBgEEAZdVAQUBAQdAwmUx xrbSCx2ksDxz7rFFGX1KmTkdRtcgC6F3NfuNYkYDAQgHwsF2BBgBCAAgFiEEU24if9oCL2zd 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: <7ynodjzjuxwwqkjgns5jtnkckw52qyldfpsqpjh7645swva4xk@7wucftyjyyy3> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 18.04.2024 1:07 PM, Dmitry Baryshkov wrote: > On Thu, Apr 18, 2024 at 11:51:16AM +0200, Konrad Dybcio wrote: >> 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. > > It's fine, just add a comment please. Maybe we can rename PC_UNKNOWN to > PC_PRODUCTION? I don't think that's right. The SoC "product code" may actually mean something (again, not necessarily for Adreno specifically), and with Adreno in mind, it being only meaningful for engineering samples may change in the future. Konrad