Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3374230pxb; Mon, 17 Jan 2022 18:58:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0Mh5i4pP7Q42YV2EsCgz429xBrcX95PvZoXO/hfe3ecp53RJw5KuQm2Z4xXBC66G/VQTw X-Received: by 2002:a63:6b46:: with SMTP id g67mr21359199pgc.482.1642474701160; Mon, 17 Jan 2022 18:58:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642474701; cv=none; d=google.com; s=arc-20160816; b=C9U8BdjipeaPSudC1/dtTjL+E+02K4HHg6e1k6g5x21f+3Lb8V0OYSkCyQmPmzuZVc G/758jNtu84OABeshzC2vM5AeQ/2VaupndBVYE3qNE5RJ+6Sgk9eKF6nkNbRE8B3NqFD BRbB4LneqK7IWR9yVLXwycgnX4E6YqrvPgozLeMBaArbFZoHiiYNnBjZffZFbLBLwzyb 7T2YvrV3iOHtm5/Lv16jJE/91DhcBElSDTJk+37Qav6p6ePL0yY1NW4AQXczDzy0lBvh Mtb67SihwXWBFFoz3JTP3GWsJrxX4A3C9querfsawCX0jICNoFMznbxj81o4dsbtGlu7 429Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Llyi63UWOQi3BXtk58lidq6ltne401ehGOiS/+yI99c=; b=EGmgscf8h5YrluNuzCEyMm6aYv/+kCnGMCDh5nu0F/XMAc49D9XK5KUuJ08bXqzUiM 2z6VL3JpowiG4N9+E+Wema141skIN/GzBxPUL+LuQF3PRMOe4cx2/Z9AbN4SUoaR2HMk kNu7fhj6VXK9DzDgDf4oJCB7pxWkvMxscOFMuueoyDySS3z+XDNENfx14BCfLrRYBlhQ 5GAd6C6h1w5lHm+OIhCjkNs2guePdijzZ+jl4UmwYVTc6IFHdneqqXjVGfmoeLDZ720o e+3fCjqvL25Oq0tLG9IWk0X57VWE8m6IDmuWUX9IC9Pjo+l6Xb4n1N7GKTX97uhGhJbQ Qoeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=E0SkFJ1e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si14993578plp.350.2022.01.17.18.58.06; Mon, 17 Jan 2022 18:58:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=E0SkFJ1e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242413AbiAQSwN (ORCPT + 99 others); Mon, 17 Jan 2022 13:52:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230519AbiAQSwN (ORCPT ); Mon, 17 Jan 2022 13:52:13 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8857AC061574; Mon, 17 Jan 2022 10:52:12 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id p18so22534551wmg.4; Mon, 17 Jan 2022 10:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Llyi63UWOQi3BXtk58lidq6ltne401ehGOiS/+yI99c=; b=E0SkFJ1eNBMo/BXshOmkTPChBIgiyyVlVk0gPGk8QVDDy8UyhCmsqtCHoZoCQaVEQx Yb58PaMtXHJVBJCjqhGQOYYVRLNm1yJkccLfJeS4ZcrGOGajs/K0w1TYlVLI/AmKZhRB fe6dC6vlN7i6TZBjk4XACc/fnUn5h4x7xC/oHEpyn0/nMwqXNHZzCKXzH+y93UyMAnX5 eQviF1wxkhT72AKqxmeYxLzTL/pcImh7vlU/GhZfJSxitgRa/HCQtG2It+18vtBtWppx /H8OM87IZVViaQZgl4IwD4XbF02ov9rDIT9Vpwr+N7lASCCowUWCpV9Cp0ToXyuz+fqH R3mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Llyi63UWOQi3BXtk58lidq6ltne401ehGOiS/+yI99c=; b=J0vibS4sszwLle6Brrh6kTyBL0Tfkg+S+lkRrMT0JswJ2BxVaJFLh+AltjobaeV6c3 A6eVbA1xSfZcHT/l4NBAvOsJT1Rp9Kl0nTwntPwgBVtLqP6k5WdzU8kmUBaUZ0hmo+Ie d80mUjgnP6IeVLJeuu2y1YJsT/ZJZBwjo6o4buUlQjMuXLyciRso+VscVnc+xB4hkNHr H4gKqvQau95LS5rhgUd0YaXqfPimDr5eZHBGHpiwyuwUpL1AMH76Bl+0DoFeimXOAIKN qLAw6vzidQknG3i4QYDr+2fR75yqyh99+OVTQMtW9tnJ/F7l5IB8DNX2LTwQaNrP6yxt fFfA== X-Gm-Message-State: AOAM532Xr9XtLsR8FHRaEDeueUtf0VuVhQJm0wkP6Wz6VDpzBn0rmQhN nHwvctGJtysmJN114DzwMkbtXfno88JjHLQD0DY= X-Received: by 2002:a7b:ce08:: with SMTP id m8mr22116860wmc.127.1642445530931; Mon, 17 Jan 2022 10:52:10 -0800 (PST) MIME-Version: 1.0 References: <20220112030115.1.Ibac66e1e0e565313bc28f192e6c94cb508f205eb@changeid> <20220112030115.3.I86c32730e08cba9e5c83f02ec17885124d45fa56@changeid> In-Reply-To: From: Rob Clark Date: Mon, 17 Jan 2022 10:52:07 -0800 Message-ID: Subject: Re: [PATCH 3/4] drm/msm/adreno: Expose speedbin to userspace To: Akhil P Oommen Cc: Dmitry Baryshkov , freedreno , dri-devel , linux-arm-msm , OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS , Abhinav Kumar , =?UTF-8?Q?Christian_K=C3=B6nig?= , Daniel Vetter , David Airlie , Jonathan Marek , Jordan Crouse , Sai Prakash Ranjan , Sean Paul , Stephen Boyd , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 17, 2022 at 6:38 AM Akhil P Oommen wrote: > > On 1/13/2022 12:43 PM, Dmitry Baryshkov wrote: > > On Thu, 13 Jan 2022 at 00:19, Rob Clark wrote: > >> On Tue, Jan 11, 2022 at 1:31 PM Akhil P Oommen wrote: > >>> Expose speedbin through MSM_PARAM_CHIP_ID parameter to help userspace > >>> identify the sku. > >>> > >>> Signed-off-by: Akhil P Oommen > >>> --- > >>> > >>> drivers/gpu/drm/msm/adreno/adreno_gpu.c | 9 +++++---- > >>> 1 file changed, 5 insertions(+), 4 deletions(-) > >>> > >>> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c > >>> index f33cfa4..e970e6a 100644 > >>> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c > >>> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c > >>> @@ -242,10 +242,11 @@ int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value) > >>> *value = !adreno_is_a650_family(adreno_gpu) ? 0x100000 : 0; > >>> return 0; > >>> case MSM_PARAM_CHIP_ID: > >>> - *value = adreno_gpu->rev.patchid | > >>> - (adreno_gpu->rev.minor << 8) | > >>> - (adreno_gpu->rev.major << 16) | > >>> - (adreno_gpu->rev.core << 24); > >>> + *value = (uint64_t) adreno_gpu->rev.patchid | > >>> + (uint64_t) (adreno_gpu->rev.minor << 8) | > >>> + (uint64_t) (adreno_gpu->rev.major << 16) | > >>> + (uint64_t) (adreno_gpu->rev.core << 24) | > >>> + (((uint64_t) adreno_gpu->rev.sku) << 32); > >> How about this instead, so we are only changing the behavior for > >> new/unreleased devices: > > I thought this property was only used for new devices whereas the > existing devices rely on REVN. > > -Akhil. > > >> > >> *value = adreno_gpu->rev.patchid | > >> (adreno_gpu->rev.minor << 8) | > >> (adreno_gpu->rev.major << 16) | > >> (adreno_gpu->rev.core << 24); > >> if (!adreno_gpu->info->revn) > >> *value |= (((uint64_t) adreno_gpu->rev.sku) << 32); > >> > >> (sorry about the butchered indentation.. somehow gmail has become > >> antagonistic about pasting code) > > I assume that you would like to keep userspace compat for older chips. > > thus the if. > > Maybe we should introduce MSM_PARAM_CHIP_ID_SKU instead (and gradually > > make userspace switch to it)? > > Existing userspace tools do query CHIP_ID, but match based on GPU_ID (falling back to CHIP_ID only if GPU_ID==0).. still, out of an abundance of caution, we should probably not change the behavior for existing GPUs. But so far the only thing with GPU_ID==0 does not exist in the wild yet, so I think we can get away without having to introduce a new param if we only set the upper bits of CHIP_ID when GPU_ID==0. BR, -R