Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4487924ybx; Mon, 4 Nov 2019 14:15:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxWn79GD3vzdSMDLM2OEl/yVe3U2JxofjTFNfQhCYTRMIxhUsB6Ri/cgVSiaz0tYED2Kyq6 X-Received: by 2002:a17:906:6993:: with SMTP id i19mr26350688ejr.259.1572905706755; Mon, 04 Nov 2019 14:15:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572905706; cv=none; d=google.com; s=arc-20160816; b=pKgN/Z8BkwadoxoN5QY1LBRwWau2nqIB6P+JL3/t7RlwystsnYC7ktJrQxSUiNezzT ODDB3ZxuaOlWjQ2bo5ROpV3RE6J0Y1nf4aCQb+08oi0xDqGQk3lpFFODsYTyB7W6rwV7 DJxjCNgNyYPsfUkxWOTimb+K5C1sJIDphFvQdXMgSBWcPw1chS+jn2V6pmcKtRG6gfTw Cp8MtM4iXbbMxim9hIGLbZMw2cVHqFMk//qKtuR3o8Z7Pt/twT8oIecpuzvpnQ/P/OWB pRUjWEDl0TSC7DO3T4LNtal/pQ6++lUyjtFexfh4IXs8hwwxFlfIf6mv77aqz9gDyODX rkVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XRfdLnZjneEugLYkBQvfqrPPdfLDXGMjOaqyLikLVN0=; b=U8GqEMtmjnrv3t7n/6QMF/6gHTgZAInHBfy6J4vwKs7vC+W7YjA0b9MZjdvOQ8anLU 1TgWib2osckGHxyRZOG6HZiFw5IkW1243AWuOeJq5nIR6AHSxJkhYoFNNdZnzVKWuXPa 9AAPY3QsM/JojqA+uzR/OC2+XBjis5vA3LqBqFouPx+qV6Qi9WCr+pzCfJ00h/DlW+dk kpZkz2K5UoW8av0uLU8VEWc1ttOEBPBsd6zILmaD965iwIQSm0Yx55SR2aY43nytguTr FgSb8ljO6+D4VWywIsBlkFS+L+0gRoiwjG8gBcv5BefeIAffuPjPCE7uQrRCwNCO2PVd 7f4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e9DxKLOy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si3180954ejn.123.2019.11.04.14.14.42; Mon, 04 Nov 2019 14:15:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e9DxKLOy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390438AbfKDWLz (ORCPT + 99 others); Mon, 4 Nov 2019 17:11:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:45336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388028AbfKDWLx (ORCPT ); Mon, 4 Nov 2019 17:11:53 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7F240214D8; Mon, 4 Nov 2019 22:11:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905513; bh=SQws7LQUsN35hj9MY23G6kH0kbXpCXwrL5tfbVE5b7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e9DxKLOyfp8h/Niy2yNEsbqqAQjE5aG0tGBhW7u6jC4DN1Mnl+BqW7O3XOaNy8dih fujpVY64nEpTBw68K+Ue/6BCQt75rtsFmZC288zbW+W73EzdIOeUvYwHZZt3Yew/lH 2VjeNIqzwW/gO1D2NbTePiQrlHTsVTGohLHeKGWI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Tianci Yin , Alex Deucher Subject: [PATCH 5.3 137/163] drm/amdgpu/gmc10: properly set BANK_SELECT and FRAGMENT_SIZE Date: Mon, 4 Nov 2019 22:45:27 +0100 Message-Id: <20191104212150.273916176@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212140.046021995@linuxfoundation.org> References: <20191104212140.046021995@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Deucher commit 30ef5c7eaba0ddafc6c23eca65ebe52169dfcc60 upstream. These were not aligned for optimal performance for GPUVM. Acked-by: Christian König Reviewed-by: Tianci Yin Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c | 9 +++++++++ drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c | 9 +++++++++ 2 files changed, 18 insertions(+) --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c @@ -151,6 +151,15 @@ static void gfxhub_v2_0_init_cache_regs( WREG32_SOC15(GC, 0, mmGCVM_L2_CNTL2, tmp); tmp = mmGCVM_L2_CNTL3_DEFAULT; + if (adev->gmc.translate_further) { + tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL3, BANK_SELECT, 12); + tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL3, + L2_CACHE_BIGK_FRAGMENT_SIZE, 9); + } else { + tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL3, BANK_SELECT, 9); + tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL3, + L2_CACHE_BIGK_FRAGMENT_SIZE, 6); + } WREG32_SOC15(GC, 0, mmGCVM_L2_CNTL3, tmp); tmp = mmGCVM_L2_CNTL4_DEFAULT; --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c @@ -137,6 +137,15 @@ static void mmhub_v2_0_init_cache_regs(s WREG32_SOC15(MMHUB, 0, mmMMVM_L2_CNTL2, tmp); tmp = mmMMVM_L2_CNTL3_DEFAULT; + if (adev->gmc.translate_further) { + tmp = REG_SET_FIELD(tmp, MMVM_L2_CNTL3, BANK_SELECT, 12); + tmp = REG_SET_FIELD(tmp, MMVM_L2_CNTL3, + L2_CACHE_BIGK_FRAGMENT_SIZE, 9); + } else { + tmp = REG_SET_FIELD(tmp, MMVM_L2_CNTL3, BANK_SELECT, 9); + tmp = REG_SET_FIELD(tmp, MMVM_L2_CNTL3, + L2_CACHE_BIGK_FRAGMENT_SIZE, 6); + } WREG32_SOC15(MMHUB, 0, mmMMVM_L2_CNTL3, tmp); tmp = mmMMVM_L2_CNTL4_DEFAULT;