Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp448924pxb; Thu, 9 Sep 2021 04:51:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL939lQLXZSv5oIyTRnO/nNy89WbUh4LWNt2QLsBfSGuGbdkZ23oHztvf9Ge35ohqJZNux X-Received: by 2002:a05:6602:2cc5:: with SMTP id j5mr2281832iow.156.1631188269825; Thu, 09 Sep 2021 04:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188269; cv=none; d=google.com; s=arc-20160816; b=LaNSKoMtHtsHy/vlslh6KWlfLw9EJlZbJ7RYAFeUSHvldqDcN56YcOkgiMxLBV6JOW KOobcI2KQC52gquijOAewbyKbrSy7V5frNxbeP62h7dJE6+TCtZLxzwIqHC5uzUxWYaQ tZ0unqQZmMnZWoIq/kqqvSTrMx34Ul6qXLIGaOtgY2hpmcnLmxTqckNtwNSi12xqjnf9 7VNSMTX64bW2M4SSaiq4/s+Yl5i3lP+7dIj50vjsTjhXZzL/Jx9SEqGfP1nJuS0K4Ibf xVvaTNMLrXsSlzskvFnFhB8IuuR/9/bmHlR6oinhVDRDcegOstMqx3ApXVSoxkFziJbV xZ1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ualbP+LabIjPv5fZ3fxJMwJEx/vm5K7OiKLPe0y5/pk=; b=qwQ9SmPYEYvSLJzO/VsuDeVT58vinLWgtKJhHJp/Hyks82vjUPRtRsz2gpJwnpCzd5 7VptuUIpzpN5JuEbRm2ZlE6SqcxUOZ1TpHtiMOGaJu+JNzgIbrfeLRY9im+uY8Qnk1kM iCXYPOWQjYV1lKKHbZftILQw55xmya0RR+Rpe69VUlcDmXEmXtnPXkhTLDn+JMjC4+Jg 5S0okF1Hm+7qSTeZ/nXUZRe80yfgeSlz3h7X5M77s2k0ntvgOYxuZ5DdVfPBdTeOysf4 D1bRNTuBhFCqSf6JSR/+OFnFNblE86cxUXz8oy/SyWzu0//afpSl4XiNmBonUv8f1QFx KoHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nCCV6U8x; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si1712528ilu.98.2021.09.09.04.50.46; Thu, 09 Sep 2021 04:51:09 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=nCCV6U8x; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236431AbhIILuk (ORCPT + 99 others); Thu, 9 Sep 2021 07:50:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:46772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241329AbhIILq5 (ORCPT ); Thu, 9 Sep 2021 07:46:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A48A361245; Thu, 9 Sep 2021 11:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187788; bh=N+oKi7eeVnuYEUVTGN5wXiWpy68Vo34sA0FAwHUYF8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nCCV6U8x3s3v1ch5xWkNyDRwLzdVak9idScxJcLrwf0XMnfLpduLdle5aBIxgyfFg 6EiYbz8cK1pRx7g7dxStRjnh1leuxY1/JXzgw9pqeJwS73p6s4hZjUfiiLJKkmKQRJ 8h8+ffxGP6ALXG73hitW3RfKahNDWSW1Gy/Lg6wA5L+01S2MOd3w0Yob7WcqgmACbW ZGkHbM38njwOcpfTERed3sn9T0cGPAL3kC1fKlDKQbQPqoeuBZYRIakZ5aNvyuo2V5 DBNneQJU+N9bgfGPJoyPgqCzspnorvqLSGiWeTmke2iJfg5F+hbvmtup8V4TOtrlGL WnXGCnqm3wShA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Akhil P Oommen , Rob Clark , Sasha Levin , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.14 095/252] drm/msm/a6xx: Fix llcc configuration for a660 gpu Date: Thu, 9 Sep 2021 07:38:29 -0400 Message-Id: <20210909114106.141462-95-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Akhil P Oommen [ Upstream commit a6f24383f6c0a8d64d1f6afa10733ae4e8f236e0 ] Add the missing scache_cntl0 register programing which is required for a660 gpu. Signed-off-by: Akhil P Oommen Link: https://lore.kernel.org/r/20210730011945.v4.1.I110b87677ef16d97397fb7c81c07a16e1f5d211e@changeid Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 46 ++++++++++++++++----------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 9c5e4618aa0a..183b9f9c1b31 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1383,13 +1383,13 @@ static void a6xx_llc_activate(struct a6xx_gpu *a6xx_gpu) { struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; struct msm_gpu *gpu = &adreno_gpu->base; - u32 cntl1_regval = 0; + u32 gpu_scid, cntl1_regval = 0; if (IS_ERR(a6xx_gpu->llc_mmio)) return; if (!llcc_slice_activate(a6xx_gpu->llc_slice)) { - u32 gpu_scid = llcc_get_slice_id(a6xx_gpu->llc_slice); + gpu_scid = llcc_get_slice_id(a6xx_gpu->llc_slice); gpu_scid &= 0x1f; cntl1_regval = (gpu_scid << 0) | (gpu_scid << 5) | (gpu_scid << 10) | @@ -1409,26 +1409,34 @@ static void a6xx_llc_activate(struct a6xx_gpu *a6xx_gpu) } } - if (cntl1_regval) { + if (!cntl1_regval) + return; + + /* + * Program the slice IDs for the various GPU blocks and GPU MMU + * pagetables + */ + if (!a6xx_gpu->have_mmu500) { + a6xx_llc_write(a6xx_gpu, + REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_1, cntl1_regval); + /* - * Program the slice IDs for the various GPU blocks and GPU MMU - * pagetables + * Program cacheability overrides to not allocate cache + * lines on a write miss */ - if (a6xx_gpu->have_mmu500) - gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL1, GENMASK(24, 0), - cntl1_regval); - else { - a6xx_llc_write(a6xx_gpu, - REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_1, cntl1_regval); - - /* - * Program cacheability overrides to not allocate cache - * lines on a write miss - */ - a6xx_llc_rmw(a6xx_gpu, - REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_0, 0xF, 0x03); - } + a6xx_llc_rmw(a6xx_gpu, + REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_0, 0xF, 0x03); + return; } + + gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL1, GENMASK(24, 0), cntl1_regval); + + /* On A660, the SCID programming for UCHE traffic is done in + * A6XX_GBIF_SCACHE_CNTL0[14:10] + */ + if (adreno_is_a660(adreno_gpu)) + gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL0, (0x1f << 10) | + (1 << 8), (gpu_scid << 10) | (1 << 8)); } static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) -- 2.30.2