From nobody Thu Apr 9 17:58:38 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DCB14014BC for ; Fri, 6 Mar 2026 16:47:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772815650; cv=none; b=NZiVjAgjECuvtpPCAU7dyI4JsGRip/c/rD0/foxYg3nDo7QHPbzjVswIbcvDlRGmcLYLeSo/KDCwXQevEwTRMlYRwie9W0GcSJMGfIL330Xbv9t0x1a2v0XNYxWqoLVEIqcFTqXlOTlktYTzdzKYVTAbqEPBdOzz+anXtlQMqOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772815650; c=relaxed/simple; bh=gndBRl4Z4xRh4kFQivFGZ2SUW+Ocdg1Tl9bo+8948vQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ljzRjeT1e7cDmMw2KYk+N3cYHkaY9bsZZR7v40659Wv7PHHTiYTAgKbIFLut0KNWaquTzKMWYUOR/l5njmPRyif4sCEwQ9YLbSFopvvSBeJMHSBXX1/O4yEV8Z+2VPV8bx/c6jG/4FaNGYLMaDih723RIICs1c6m90Lo2CEvTJY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=AR/QBSVF; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=escnOiou; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="AR/QBSVF"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="escnOiou" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 626Fr9DO550304 for ; Fri, 6 Mar 2026 16:47:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= wdo2GXNLuey4il0IRDIYFRsck7+hcgeJ1IZK0URwteg=; b=AR/QBSVFwClPDB+4 l/HAexU3pYvX4cVToD+jpZAcP8E3/Mg+NmRwxxY2Nvr0GKlDs0R4ufepixHJ3JRN G6sYsWtKj5nWTKySjqFexMw9N4EzMl8d9Dp5PQi+g/a4H9YGNYUa8bazgaOwLuWU 5zWVjhOP6+xkt7mZmT19rcniO7drEKsFHUtwGrhXu3Ro/tyBPhAGlKt0MJe3iGlS NGlHw/oC7La/5Bgor/E0v8BYQc3CCZUGOXA0gU3U9P6iJocKbfPD/UkLexFAUK7V MBrlnFlaC2vHHeSglMFYLJ6NS+JWHcCZGQonpQnKWvS4LLKmFVys/SOT6giszHT0 0/JoLA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cqruka66q-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 06 Mar 2026 16:47:22 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cb4d191ef1so1258634585a.0 for ; Fri, 06 Mar 2026 08:47:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772815641; x=1773420441; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wdo2GXNLuey4il0IRDIYFRsck7+hcgeJ1IZK0URwteg=; b=escnOiouLrU4TkG7p0qDXPjwkrqzAHzHl1KG4sZKxALzBhXAv5n1juONaf61/NPvF+ Xrn1ucBUEHIpD4nCdyhJA9xI4MIDtWkuOt2inNr0HoH3YJt5haYMj5LzNSjl+CGI79Bq BG98QmlCpbU6jP9hTVFKYKnhYKJiRxKM6mQGbVSxk2alULxWRR+NPuMDi8klxqp/umx6 mrIYKtUs507P6r4hDxkw4uRKPEkr1ecYYQrpA7k5sqgeox/ey6Ck6baJLWx0yC/My022 kC6kdhAEk0f27JLpBVmu3eITI6cBjitC0R6wUCRYv3MjN5m5DnNu47UKBN5qIode0vqO XrLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772815641; x=1773420441; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=wdo2GXNLuey4il0IRDIYFRsck7+hcgeJ1IZK0URwteg=; b=QPQHcHG+L9jhemzT9Lrs1cwrLL4xe8oD+6aMin9Liw9PXjc9MHj30Ix52Op3lRIiB6 CqjZCRzYYC2RA0JUf2zmQcfCEAHUSnN55sQdxeVClDAXColn0jRHcYClVhW7Y1R+Ndez Y67gsXbUVjuc3fx/vHoHqBPPoLZ3cUM9cfeBlK+FYIyWo2zNcNvjg2SZEeqsHmujSgBG wt5I3nR/tmHuk88SJVmuWi53NeEvZOLWQxcqteIJFPKSQzYLzzj5SOhRsRhFJCI5MWWU 7T25OoATZFQ77HMH9+XCOhF/IID3kqo3MRq50OAHEzxgi8Pj49aCHrRfwb7oXkrT1Fpb dAgQ== X-Forwarded-Encrypted: i=1; AJvYcCVjTg344c1IQgpDBUASwGQMGqT0mDs5RJg18amZEnSDXk47DOZeBbBVl7sTATEDRqH9fEiGgfQfvqHoo3U=@vger.kernel.org X-Gm-Message-State: AOJu0YwxS4cpIJJMlLIdgLLeKI1KMLl7Xwi29b5t0poZKfa3G6gCydsJ mXwqR12V3OGXrChUhVXJo5wPXk9U0eIhrqL/aOmjFLLHDMqxz2LHydvaF0U2qPs35eaRwQw+cic mSOB2ql+VKzWpCGHXUK0mtolxlvIdA2JyNqN0bBFU5j0Aqmibk86Gc2zmf5rZc0OmWPWUHOgJ2D A= X-Gm-Gg: ATEYQzx6LvzUTzIN/HkJiSk334e5DtNq9Tlmc66HRsfGRUcKgtm8cATHYyj2bFKIUBg rZu55FyiDlf1O3ISGoJbq8tdCoCaAWrjvGbk7uPmpHdvWHERMHsenzxUt95d6bjULBE4QBcJ9PL arwJG5i+5Su/w1+dvH4P9UYp4jE2YR8NjRPXa/Q1mBYrXD+/IeYXW2dPwkJk36LFyP9xXzfI7BH wJ02FwZITFNKZNZAYVYqhAcXd1lxth5JSHoD3xC+9u02nfxyI7D5s+uFqlmpQppw1Ibu/q/FDKJ Ija9Rjp5UgyUlxFA63R0+DwXTw/8h68Vv7UJ93b9kWYcOUntGwUxUi6nDI0NbCIQehzAarb6JwP el3NwCFW4IHUcK9CDS0iO/pU28fzhoIrpBJtDGkUzNCoNOuvjFPU7oM6jpLAxXb1z/Xwf4R71Zz O4dhTi38Yb7DOzeAirqCR/h2kPlSEDWLiV+2s= X-Received: by 2002:a05:620a:254b:b0:80e:3af7:7a0c with SMTP id af79cd13be357-8cd6d427f57mr320733985a.43.1772815641159; Fri, 06 Mar 2026 08:47:21 -0800 (PST) X-Received: by 2002:a05:620a:254b:b0:80e:3af7:7a0c with SMTP id af79cd13be357-8cd6d427f57mr320729785a.43.1772815640568; Fri, 06 Mar 2026 08:47:20 -0800 (PST) Received: from umbar.lan (2001-14ba-a073-af00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a073:af00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a13eaebd0asm213804e87.51.2026.03.06.08.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2026 08:47:19 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 06 Mar 2026 18:47:10 +0200 Subject: [PATCH 04/24] drm/msm/adreno: Trust the SSoT UBWC config 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260306-ubwc-rework-v1-4-9cfdff12f2bb@oss.qualcomm.com> References: <20260306-ubwc-rework-v1-0-9cfdff12f2bb@oss.qualcomm.com> In-Reply-To: <20260306-ubwc-rework-v1-0-9cfdff12f2bb@oss.qualcomm.com> To: Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Konrad Dybcio , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5880; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=E5AQkqpaNuM1RXBAxJ/mn1wbVur7sOZpcfQb1l6t7DE=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBpqwUNcrd3Clb2VbkETRm3VJ329lWcfofTbuf+R 8sNyI+pXsOJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCaasFDQAKCRCLPIo+Aiko 1epOCACPBE/Ez45bG59m+rxF+b7Y+dB+iiT1mwMky3RRe9bKHf+QAjNjEQgUpYb19T/GX2Q5v6W /E2LxY41xBx9FsTo8wfrPEEWJAYO6k9oNY7Te5BQStmhWBjARC5LiiBx4je2u5tV2R8WDYvymeZ 0idyRf3YdUvqHz//58i1PeeLLruv24bwZa2b9wzC4vEWNHtPVEdMkS+zxhHtNLHgd9lsASJG4O2 MvpWYQoUXvCwkZJtGpEhSNJqUupfGc/QVhXhFbhP7nWRfGQKvzo2YpZ1vCVEuHC17Yqr8NzJaqN SQ5llqmoB7a5fTZYVldyzMRYgW3nqKnAiCRCzRmQ2IyyrBL/ X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA2MDE1OSBTYWx0ZWRfX58EmfK4LTzqi 3sToOqFKMC2aRytZPwuSwz+1M8SS31rG8APSUAbdyT9eFZAS7yYYc0hETJc3WqCQnEkyWp+JIoj IL0SknG3vHFLYS6IIVCykEI+n9YSFdUiSNfqnWy7XdnJBHyOfzRUMWqDHPyuvphvqKD3tE1OCXu BLjn4wIuaYBRe0GqMi9YV+LF0cuY5myPg1zKb071sxud2BfBU+nVqrsCLLN5nPdERvql5GWXJF+ j0RB1xmbGl+bv4rG6mhq2xaF71CZ5L97IYnqzMFWGnLkmYQnEjAfyFqdp+iCdn4kBJ594UIigAO 1hBOF2uu5hGoE3FG1CliqbsW8lYg00VaszSQcgZ5zssG3DvlrURna9Vtwc3EAy4/vDkkxlrfNZS i3Ow2dTDifFqj1mG7n73E4JAEspEEUNHuCqlLSiMu0h2U/tH7irVbTwWSpq7WqPjpr3hi33UmK5 QiIj84MFayUBqZderAA== X-Proofpoint-ORIG-GUID: ObMYDUv9SRuMyC68YND5xOScwP6kpqQQ X-Authority-Analysis: v=2.4 cv=DvZbOW/+ c=1 sm=1 tr=0 ts=69ab051a cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=IhcC-CrlSmvFA89tYH4A:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-GUID: ObMYDUv9SRuMyC68YND5xOScwP6kpqQQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-06_05,2026-03-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 clxscore=1015 phishscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603060159 From: Konrad Dybcio Now that the highest_bank_bit value is retrieved from the running system and the global config has been part of the tree for a couple of releases, there is no reason to keep any hardcoded values inside the GPU driver. Get rid of them. Signed-off-by: Konrad Dybcio Reviewed-by: Rob Clark Reviewed-by: Dmitry Baryshkov Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 11 ++--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 82 ++---------------------------= ---- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 5 -- 3 files changed, 6 insertions(+), 92 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/ad= reno/a5xx_gpu.c index ef9fd6171af7..513557741677 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -1727,7 +1727,6 @@ static struct msm_gpu *a5xx_gpu_init(struct drm_devic= e *dev) struct msm_drm_private *priv =3D dev->dev_private; struct platform_device *pdev =3D priv->gpu_pdev; struct adreno_platform_config *config =3D pdev->dev.platform_data; - const struct qcom_ubwc_cfg_data *common_cfg; struct a5xx_gpu *a5xx_gpu =3D NULL; struct adreno_gpu *adreno_gpu; struct msm_gpu *gpu; @@ -1765,13 +1764,9 @@ static struct msm_gpu *a5xx_gpu_init(struct drm_devi= ce *dev) a5xx_preempt_init(gpu); =20 /* Inherit the common config and make some necessary fixups */ - common_cfg =3D qcom_ubwc_config_get_data(); - if (IS_ERR(common_cfg)) - return ERR_CAST(common_cfg); - - /* Copy the data into the internal struct to drop the const qualifier (te= mporarily) */ - adreno_gpu->_ubwc_config =3D *common_cfg; - adreno_gpu->ubwc_config =3D &adreno_gpu->_ubwc_config; + adreno_gpu->ubwc_config =3D qcom_ubwc_config_get_data(); + if (IS_ERR(adreno_gpu->ubwc_config)) + return ERR_CAST(adreno_gpu->ubwc_config); =20 adreno_gpu->uche_trap_base =3D 0x0001ffffffff0000ull; =20 diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gpu.c index d6dfe6337bc3..6eca7888013b 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -729,82 +729,6 @@ static void a6xx_set_cp_protect(struct msm_gpu *gpu) gpu_write(gpu, REG_A6XX_CP_PROTECT(protect->count_max - 1), protect->regs= [i]); } =20 -static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu) -{ - const struct qcom_ubwc_cfg_data *common_cfg; - struct qcom_ubwc_cfg_data *cfg =3D &gpu->_ubwc_config; - - /* Inherit the common config and make some necessary fixups */ - common_cfg =3D qcom_ubwc_config_get_data(); - if (IS_ERR(common_cfg)) - return PTR_ERR(common_cfg); - - /* Copy the data into the internal struct to drop the const qualifier (te= mporarily) */ - *cfg =3D *common_cfg; - - /* Use common config as is for A8x */ - if (!adreno_is_a8xx(gpu)) { - cfg->ubwc_swizzle =3D 0x6; - cfg->highest_bank_bit =3D 15; - } - - if (adreno_is_a610(gpu)) { - cfg->highest_bank_bit =3D 13; - cfg->ubwc_swizzle =3D 0x7; - } - - if (adreno_is_a612(gpu)) - cfg->highest_bank_bit =3D 14; - - if (adreno_is_a618(gpu)) - cfg->highest_bank_bit =3D 14; - - if (adreno_is_a619(gpu)) - /* TODO: Should be 14 but causes corruption at e.g. 1920x1200 on DP */ - cfg->highest_bank_bit =3D 13; - - if (adreno_is_a619_holi(gpu)) - cfg->highest_bank_bit =3D 13; - - if (adreno_is_a621(gpu)) - cfg->highest_bank_bit =3D 13; - - if (adreno_is_a623(gpu)) - cfg->highest_bank_bit =3D 16; - - if (adreno_is_a650(gpu) || - adreno_is_a660(gpu) || - adreno_is_a690(gpu) || - adreno_is_a730(gpu) || - adreno_is_a740_family(gpu)) { - /* TODO: get ddr type from bootloader and use 15 for LPDDR4 */ - cfg->highest_bank_bit =3D 16; - } - - if (adreno_is_a663(gpu)) { - cfg->highest_bank_bit =3D 13; - cfg->ubwc_swizzle =3D 0x4; - } - - if (adreno_is_7c3(gpu)) - cfg->highest_bank_bit =3D 14; - - if (adreno_is_a702(gpu)) - cfg->highest_bank_bit =3D 14; - - if (cfg->highest_bank_bit !=3D common_cfg->highest_bank_bit) - DRM_WARN_ONCE("Inconclusive highest_bank_bit value: %u (GPU) vs %u (UBWC= _CFG)\n", - cfg->highest_bank_bit, common_cfg->highest_bank_bit); - - if (cfg->ubwc_swizzle !=3D common_cfg->ubwc_swizzle) - DRM_WARN_ONCE("Inconclusive ubwc_swizzle value: %u (GPU) vs %u (UBWC_CFG= )\n", - cfg->ubwc_swizzle, common_cfg->ubwc_swizzle); - - gpu->ubwc_config =3D &gpu->_ubwc_config; - - return 0; -} - static void a6xx_set_ubwc_config(struct msm_gpu *gpu) { struct adreno_gpu *adreno_gpu =3D to_adreno_gpu(gpu); @@ -2721,10 +2645,10 @@ static struct msm_gpu *a6xx_gpu_init(struct drm_dev= ice *dev) msm_mmu_set_fault_handler(to_msm_vm(gpu->vm)->mmu, gpu, adreno_gpu->funcs->mmu_fault_handler); =20 - ret =3D a6xx_calc_ubwc_config(adreno_gpu); - if (ret) { + adreno_gpu->ubwc_config =3D qcom_ubwc_config_get_data(); + if (IS_ERR(adreno_gpu->ubwc_config)) { a6xx_destroy(&(a6xx_gpu->base.base)); - return ERR_PTR(ret); + return ERR_CAST(adreno_gpu->ubwc_config); } =20 /* Set up the preemption specific bits and pieces for each ringbuffer */ diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/= adreno/adreno_gpu.h index 1d0145f8b3ec..da9a6da7c108 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -237,12 +237,7 @@ struct adreno_gpu { /* firmware: */ const struct firmware *fw[ADRENO_FW_MAX]; =20 - /* - * The migration to the central UBWC config db is still in flight - keep - * a copy containing some local fixups until that's done. - */ const struct qcom_ubwc_cfg_data *ubwc_config; - struct qcom_ubwc_cfg_data _ubwc_config; =20 /* * Register offsets are different between some GPUs. --=20 2.47.3