Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp211284lqe; Fri, 5 Apr 2024 19:56:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGlgteIQeQJKBfpsr9nIVteduVQfV46bT3+cc+aIa6C/3eCjjHBEqZ5kEs4VRz0Ggsyb/w4JPtkH3QN2xtM0AR1q62szM1pVi0JPwwIQ== X-Google-Smtp-Source: AGHT+IH4rjonlasjR3W93A3WSmryklEOpdU2XoC6WSxekqE+yMW5naWe9t5qu31OntB61G8eOaRb X-Received: by 2002:a05:6a20:9287:b0:1a7:243f:8d4e with SMTP id q7-20020a056a20928700b001a7243f8d4emr2874030pzg.41.1712372210584; Fri, 05 Apr 2024 19:56:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712372210; cv=pass; d=google.com; s=arc-20160816; b=PyizLTZyMBmFwXz1Hj4nkLiNq7V/lARQOvsVoRyGZloIJl8/dSMfyjQwBw9JYN7Vfk TFc2c99yPuAFmpyngw3YsFO4mAfKnrDzC7NCV8i5RN+P8x/mEUTqHIiibFsIOfHiEGOk qQZ3GTtfvji0FjX7gPwS0ZMOfuQzOiDQgkj7vt3m/CyUwEox3mPhIU2wlC10Ise+xKeK F2vLEdVGb5aMlLh6Ackh1frsC6He4TGZi2II8Co9atl77jrhnbooGG3KCjRF9SYJK7sO WDgqX1to4/wLJ+lfv544td9b6rUH2uRl6YWwkVyPL8LU/5OPlrldYIPHGbnRay1tLwX6 5U1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XkuhIBlU9RYiWnHnizddy2d21zdQrAfJBlCZtmWWd30=; fh=k+xPnV4ZV4NMIu0U8mxt+XSVKkEuB9D+S50o2A3T5/g=; b=xwBff78VP9etmd9tmS1fvNwDdqFBgEefdBywf6m1ahZOiLeTyFv/tr25wJ3z9+Po3f AmaYJCcyN83kaPnhwR6fyT9RVA83sv/SWFJ9/j39+mk24QvjGWWho5d+6oU09AatcYYv sKZ5+L/lZOHog30WfFJ6lIeN7YYz0nodUi8iByT67NDb9qVIa/zvsL2jf8L5/kB0EfFl BbG3G4AW6aTtX4q38gU14vKPo6dRk6w5gdYsU+9fdLKsm4WUzlJXeuQD+nsiLCXNrE2u 6zMuaqHlVaRDcXcptMdJXwuzKSK+6c9hEcPeP/rXphZ7zzORBGAoG/GPRczD2catfMYC 68Ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kd0FoFQ6; 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-133777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133777-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 y13-20020a056a00180d00b006eaa98c88b5si2471859pfa.64.2024.04.05.19.56.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 19:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133777-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=Kd0FoFQ6; 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-133777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133777-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 43A0B283927 for ; Sat, 6 Apr 2024 02:56:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF1FE15EA6; Sat, 6 Apr 2024 02:56:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Kd0FoFQ6" Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.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 AB4AE107B3 for ; Sat, 6 Apr 2024 02:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712372202; cv=none; b=i59baPX60JzPD/yzJD2Sz2iWCIXe9HmPCJU+Y847Yh3tyPZgjMC7bUpFc8AevkqrpIR4MNuVulLd7fM2spoe9FnHTBRpPmBPT5Hf+ySeVFuJHpVNbXCyKpLIGppHJYcf6ZxA7m6YeIV9gJOFjxTPM6ZH3Lt642qVsjmykm9sn+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712372202; c=relaxed/simple; bh=/4vGjLhy5asNRBnYWaJSshGgBORPxL+tYufLDjKhMpc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TGMVk6Sb3M4FxTQb6NS8iS/lLalqfgb8IbptZYF35krAHUFl1xCePiBj2oVrF8S6vrldroHuFaKUm0k7ePD/cl3aPwluzK9cWy4BKB1fYoSUR2XtfO2P4mBwFAXzCstCJfoEbTvku7oig1x+7IswW4iXd/zEf2QAn3kZtjubwPw= 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=Kd0FoFQ6; arc=none smtp.client-ip=209.85.167.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-lf1-f44.google.com with SMTP id 2adb3069b0e04-516d0161e13so2837020e87.3 for ; Fri, 05 Apr 2024 19:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712372198; x=1712976998; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XkuhIBlU9RYiWnHnizddy2d21zdQrAfJBlCZtmWWd30=; b=Kd0FoFQ6mOIaMoRgpofg4btZMFC7cLHOJtRa9xF7Y/SCgZKx2bZN2HuA5lW317ArAQ QdGey3EupJbBBjGUQ3WIyFqV02HPtYcNvk593DrR1pWTu9D39gJ/stV1AyB57ZHpgvv+ wWg/ZLAtvUsOw+a6G5fZ1pFnZo3oC6PR1MnFfVgQo6FAMNqJg4iAELSjAHouaFKf/oFn bdK8zrfPf7dYwD/kwSD4SAX4JTJZNoayTGUFVNnbzSyCGV9hooZ+YE+OVd/bDCi7sqzP n8H/m+ui2v0X3Vrd4TVo9jerl9dyOLu64Cwn+5Zg7huU0f1wUT+rwTwQm7LsLsJzZB7M B33A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712372198; x=1712976998; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XkuhIBlU9RYiWnHnizddy2d21zdQrAfJBlCZtmWWd30=; b=HGLvudgDQUkLV5BuOExBmTPsKXrWDzQO3hwQAzXUR8FPvSk3cmsxQZJCaoPw/1MYe5 2pExDa6o1lul/jTgPmVYfevWGuob/rZwVeqXh/2mF0z6+x4Lx4lBheRhlqW1bq5o6Hg7 /bOZkyWTa6I3vrGYlMkeXp68kcRHWKe+QVC4Xgmxz5UiHneMqfiKryPCQjrlS+yiO2Hl u5i7NpdZbExd40mqhbIDG8WtqriWStxKwPsTknSWgHA4+2mP21NGWphKlC6dsKWfshPA IIm49tDuHBk5ieeT22zZ2PodsXolmf2XF166rlYu94JJ9yIGAubE+YqThWcD6CXF5hpd ANIQ== X-Forwarded-Encrypted: i=1; AJvYcCU9o4FbBcq7keAFpGMpk2Bxa9Y3BZY6X9A1a9NWrZyj77HZLSGvlp9bVEcAdt4zyIG1A14LK7fSur2frxC+2x3RhJADnwAYC5SgAr03 X-Gm-Message-State: AOJu0YylNU3H2uAS3s9idfW/cQ9i8HyUP1acYHDB6qJsIPv3Nct5KJJ3 7PjUsoCyjssjtGSk6NDiaiuo1/C5/kDTJPfwLzKOoG5uFx+Dco9CBAuIl0TPqjY= X-Received: by 2002:a05:6512:3d09:b0:513:c6ec:fa6c with SMTP id d9-20020a0565123d0900b00513c6ecfa6cmr3037333lfv.48.1712372197844; Fri, 05 Apr 2024 19:56:37 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzyjmhyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a00e:a300::227]) by smtp.gmail.com with ESMTPSA id be37-20020a056512252500b00515af4b4878sm356263lfb.183.2024.04.05.19.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 19:56:37 -0700 (PDT) Date: Sat, 6 Apr 2024 05:56:35 +0300 From: Dmitry Baryshkov To: Konrad Dybcio 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 Subject: Re: [PATCH 3/6] drm/msm/adreno: Allow specifying default speedbin value Message-ID: References: <20240405-topic-smem_speedbin-v1-0-ce2b864251b1@linaro.org> <20240405-topic-smem_speedbin-v1-3-ce2b864251b1@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240405-topic-smem_speedbin-v1-3-ce2b864251b1@linaro.org> On Fri, Apr 05, 2024 at 10:41:31AM +0200, Konrad Dybcio wrote: > From: Neil Armstrong > > Usually, speedbin 0 is the "super SKU", a.k.a the one which can clock > the highest. Falling back to it when things go wrong is largely > suboptimal, as more often than not, the top frequencies are not > supposed to work on other bins. Isn't it better to just return an error here instead of trying to guess which speedbin to use? If that's not the case, I think the commit should be expanded with actually setting default_speedbin for the existing GPUs. > > Let the developer specify the intended "lowest common denominator" bin > in struct adreno_info. If not specified, partial struct initialization > will ensure it's set to zero, retaining previous behavior. > > Signed-off-by: Neil Armstrong > [Konrad: clean up, add commit message] > Signed-off-by: Konrad Dybcio > --- > drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- > drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > index 0674aca0f8a3..4cbdfabbcee5 100644 > --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > @@ -2915,7 +2915,7 @@ static int a6xx_set_supported_hw(struct device *dev, const struct adreno_info *i > DRM_DEV_ERROR(dev, > "missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n", > speedbin); > - supp_hw = BIT(0); /* Default */ > + supp_hw = BIT(info->default_speedbin); /* Default */ > } > > ret = devm_pm_opp_set_supported_hw(dev, &supp_hw, 1); > diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h > index 77526892eb8c..460b399be37b 100644 > --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h > +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h > @@ -110,6 +110,7 @@ struct adreno_info { > * {SHRT_MAX, 0} sentinal. > */ > struct adreno_speedbin *speedbins; > + unsigned int default_speedbin; > }; > > #define ADRENO_CHIP_IDS(tbl...) (uint32_t[]) { tbl, 0 } > > -- > 2.40.1 > -- With best wishes Dmitry