From nobody Tue Apr 7 18:02:51 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 CD9393C9436 for ; Thu, 12 Mar 2026 13:30:15 +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=1773322217; cv=none; b=VdW3qx+MCArQGdEeiD7I1xWKj4sSX1X6SOj862+os71zlkLXzHM7qfw+/vWLxJzJmn17ZU/OWOokU+VN62yvtVTwrDMkkDdI5ssGbCGADNNlIDzMHknt5vG8t7pdB1cqT9USoEeEbMLN9q00zmNocDZq5cG8c9JvAstXVLe1z7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773322217; c=relaxed/simple; bh=9xPFzWVLRFmfgeNqqZ9JTpL0iWalU/IUqVUpgLOYYOo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LVwJ4CrCkTqadOoMsoy0NrWxaztTXRgIqCokOVLpG1/sSnhQU465EVBLMBkW31n9WMOhP8/MeHNcfrQnjvsfTsUke+IaQ32lbOcr74pooMYBeqG+XaOohqfguKqqCZ9Qlox3H5VRTjFRhuN7gALF6qhvk4wKEgOUQFw/gnJ1B7g= 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=bGd+qWBb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OjTzLbc7; 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="bGd+qWBb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OjTzLbc7" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62C7e1Sa509773 for ; Thu, 12 Mar 2026 13:30:15 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= C/klMbCQgdLdWjO1751+IWBTzeQwDqi/QBK/fyMDd48=; b=bGd+qWBb3YxFjke3 zeDscYS/bkv6qFoDuRRvqFQ1QRKBABn8lmo2ULCw/os+bx7U/ZpllG8RXwU6EUum ZYvzB0dOKXUKDNZPoqU7nAGHdyfuYBMVmuJ3euSCgaJpa/SfNOLGDuP3JbIoMBsE 8Ad38gpignF/yg1imUF5+/dZvP7c/RdCVVxtE7/ztGBeVgOjibHt7MzsfIAgMtBF 7/OtwUxMQVQzVourN2Mlcog1gJUKNGWB+7lEDXV08MGriRfe6OTyNlBENbwc5w+N 0a5St7KGDau8xz0QKm1V5ml7Xd97SrFfUfhIFr8uYCvNZ+jhrJ6Vn78IEjT+Zium xhjOfQ== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cus9w0vfc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Mar 2026 13:30:14 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8cd81c571a5so631594185a.0 for ; Thu, 12 Mar 2026 06:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773322214; x=1773927014; 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=C/klMbCQgdLdWjO1751+IWBTzeQwDqi/QBK/fyMDd48=; b=OjTzLbc70JYSQCZ8GHvf+IevOaN7Lx2cUnYVymGHfUT8tvq7PTYfyG6frCY9v3xS93 WgyRNIk7S35/kzGmYoIYsNoD+CGQg2Xh+Ww/27Vf7LYVG6CFQje6v3xFybGeOf/3kC/G gGZxhAingfFEBQVPuI5ahzfd1SaD8wmYVVgKr/qB/gZZYHJcy7aBvi9MWpQEwAx8fljt g0Cp6cMR2rry8Jpzj311v0YoOOhpWKZN38SobQwIQ9UyVZiBNXjlrMLKcZxKEiHp7WJT 1+2PxH3a5W3MVZa2VwsABMmB9AxoYNx9PqiLtUZyy3wbtu5xPvzdw6vqueSAVKfB+2fe Cw6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773322214; x=1773927014; 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=C/klMbCQgdLdWjO1751+IWBTzeQwDqi/QBK/fyMDd48=; b=dm2EOLuZ9ptG1pJVtYzq1VjWkRxwzeE/Rz81TymfE27EUc95wctBhoTvN0Z1PWjOE8 spodY67EVbvCSUhoG3dwVlcRSiTKuzTCDKHtzruyHGJ4V2J+SbKAxjUdNuA6eAC98Xk7 g7+lYly9X+WRxPWr6LDsKT9EgfhhlZWvqVWesVaf5Vazj6Am8GxIalv6AAiDMy7K1Kuy 41f+pjlbd7XBCw3NBEZL7QeI6bzIGwndeiSJsa6hy0etDHbTGtR3zMJYDbNYfFycmpiN yW6/Lj80lu2gca736EKhgaAAsDGRrepaCXehk2A0nYZF0H+MIY5wNx2KN9E3pw744bXI Ko4w== X-Forwarded-Encrypted: i=1; AJvYcCVg6xx8qtTk9+lFj82EP5jN0mvsHTNKduzNUFFMh+l3aRR8nHbYwFVuDh3hl/3kKevQhWEVZrU/a4v2VsM=@vger.kernel.org X-Gm-Message-State: AOJu0YwXADD5yct/5P1spklbfsGHjfc2Tnth553j8MyIRHUsEnjmXNZ+ vZK1Cqy9gQGcbSjk7BH9nEOOlKYq+pSgmaNWJ2iJdmNfO0kTVgfa4HWz4jyMoYysny1QiHEcLIu lP1959Uz5irOa0KxJIo4FaKY4Rmx2LilLEbOV0GAU64f2iqow1wFDJeZjlP9dLl3YBZ4= X-Gm-Gg: ATEYQzz81wsO2Pf05RysppDDcVEEcUQ0yVR2pCdT/nkCctyM5aoYp8zdPTjTNagZmvY YZlWfaCtSzHd8zAlz9IB2HnXluZOfMvoCnBp8vKgYZ6NNSvPTDuhYnMbDo/IfWzokMEBRjwmP8n rG/52XtpN2/IawZY5vYHff1oGGxexKv24sSihprR6tz7TfyVUg/W994piMaJoGGer5kpkiqKx0u zL+At42r5jjdqZJ0ZuxAwlF0JbC2O9tWfURHWuPG0vXCLTf7tKxuZq5gP6ooG9OHFZ0WGh33EeR a4nJyfk3KA4Lmnm2TAYEB0zz2oBW76v4J2UfAlVQlp0BS9py7jOWbM+gl2wcrvH2qk+GXqzgMdU AIKvFd/9i4T/topZFqYYYQriXfeZVWAe3zd7UVBxN+hD/vMKI3LhwDc7JI83iK7Qx4NLeSlQxb8 BuYk0QNF+ffhJO0gtyuZWadbMlSmmresGWo9I= X-Received: by 2002:a05:620a:2904:b0:8c7:1b3f:5eab with SMTP id af79cd13be357-8cda1a573a8mr745271385a.60.1773322212430; Thu, 12 Mar 2026 06:30:12 -0700 (PDT) X-Received: by 2002:a05:620a:2904:b0:8c7:1b3f:5eab with SMTP id af79cd13be357-8cda1a573a8mr745259885a.60.1773322211745; Thu, 12 Mar 2026 06:30:11 -0700 (PDT) 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 38308e7fff4ca-38a67d617e1sm8646671fa.9.2026.03.12.06.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2026 06:30:10 -0700 (PDT) From: Dmitry Baryshkov Date: Thu, 12 Mar 2026 15:29:45 +0200 Subject: [PATCH v3 24/27] soc: qcom: ubwc: drop macrotile_mode from the database 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: <20260312-ubwc-rework-v3-24-b7e8f800176a@oss.qualcomm.com> References: <20260312-ubwc-rework-v3-0-b7e8f800176a@oss.qualcomm.com> In-Reply-To: <20260312-ubwc-rework-v3-0-b7e8f800176a@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5167; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=9xPFzWVLRFmfgeNqqZ9JTpL0iWalU/IUqVUpgLOYYOo=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBpsr+4LUsSvH4sjenVhn7VrVZtIYrQuV2Gh0+9B FVI8HvG9M2JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCabK/uAAKCRCLPIo+Aiko 1RTxB/4i3hdCnEqI/ozB7uVVvC3euL7Lvvknpr2NZT+xxG6t+0Z4yxnDeFwBB8kqNY5rkTDQPAW p+lZshJAduE7VfDn05bJfRszX70+JAbB9Mj9L64/N0U7HW9C969jJPHqScg6P8GW2fPKCYEuk8g sBU2Gff72dQMVAcDpfgJ8CBA2XywwA/nsuWwZJk8leJZA5ZOP2MbSNoWNNbbBtkcHWEh//FWr/C uM/gWuz1DiQ279m+ABpt0+j4paFfIqtAZSS0/XqH1FFFuXAo9MZ+M+eHqOayMyvyYW4fzsajBcO 8sAJoZ3pBLRdCUXqGzpBUnqWHyP/hR2kAXkuUyo+tJZqYLjy X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Proofpoint-GUID: UmoR9wIqF_IJDkZmrWgBCeotcKm_LOTC X-Authority-Analysis: v=2.4 cv=IIIPywvG c=1 sm=1 tr=0 ts=69b2bfe6 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=lOjMx_-Oxa8n0LcNG1gA:9 a=QEXdDO2ut3YA:10 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEyMDEwNyBTYWx0ZWRfXxibFDh4A/3g3 O4AmuQ2GDJRt7i7S3cDV0uJhskajcmfaolj9hw5ti+yfFlz1XxvsxfAghFxIguZT4WoQz75QyOG UX1Q92SVEMLz4NJ7SH9wpGykpTiufsP7JHIhOhasjYMOmp1ppgAI8A5m+/dJeqmdZsFATQ5NS2Q XDxdhKQmhxlLxFWalRGxx7DiMAXzif7jmhWzLoDRWM+ic6frKYvNYX9Jpljz8gr/b4ckqvnQcMI tndfhuZygD7y5piG2Pr827OTjz1HQ7wzJpzfm7jWnZ4i67S8hBmKsN6LFBxhOqLUQkvDJZtmB6L qD8eorVFK8jrMtdwhaClZ9/lrEl9SCTBQYz+DbrJbnlNdH1pki8z17Rdv71TJwF58d71lDlmH+w Webx67XIYZWHtZ7W0SRzAVN58hJghCgM4DqZtVcuZ2p9OKxQg+A/Qiq7X5Y0wev/HNT3YhxzXzz E/yjXsY0h9l3ZSl6eRQ== X-Proofpoint-ORIG-GUID: UmoR9wIqF_IJDkZmrWgBCeotcKm_LOTC 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-12_01,2026-03-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 impostorscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603120107 All the users have been migrated to using qcom_ubwc_macrotile_mode() instead of reading the raw value from the config structure. Drop the field from struct qcom_ubwc_cfg_data and replace it with the calculated value. Split single UBWC_3_0 into UBWC_3_0 (no macrotile mode) and UBWC_3_1 (with macrotile mode). Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio --- drivers/soc/qcom/ubwc_config.c | 15 ++------------- include/linux/soc/qcom/ubwc.h | 18 ++++++++---------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c index 070bf97e134e..51de36f5f40b 100644 --- a/drivers/soc/qcom/ubwc_config.c +++ b/drivers/soc/qcom/ubwc_config.c @@ -21,7 +21,6 @@ static const struct qcom_ubwc_cfg_data kaanapali_data =3D= { .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit =3D 16, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data msm8937_data =3D { @@ -49,15 +48,13 @@ static const struct qcom_ubwc_cfg_data sa8775p_data =3D= { .ubwc_enc_version =3D UBWC_4_0, .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit =3D 13, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data sar2130p_data =3D { - .ubwc_enc_version =3D UBWC_3_0, /* 4.0.2 in hw */ + .ubwc_enc_version =3D UBWC_3_1, .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit =3D 13, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data sc7180_data =3D { @@ -68,11 +65,10 @@ static const struct qcom_ubwc_cfg_data sc7180_data =3D { }; =20 static const struct qcom_ubwc_cfg_data sc7280_data =3D { - .ubwc_enc_version =3D UBWC_3_0, + .ubwc_enc_version =3D UBWC_3_1, .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit =3D 14, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data sc8180x_data =3D { @@ -80,7 +76,6 @@ static const struct qcom_ubwc_cfg_data sc8180x_data =3D { .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit =3D 16, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data sc8280xp_data =3D { @@ -88,7 +83,6 @@ static const struct qcom_ubwc_cfg_data sc8280xp_data =3D { .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit =3D 16, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data sdm670_data =3D { @@ -155,7 +149,6 @@ static const struct qcom_ubwc_cfg_data sm8250_data =3D { UBWC_SWIZZLE_ENABLE_LVL3, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data sm8350_data =3D { @@ -164,7 +157,6 @@ static const struct qcom_ubwc_cfg_data sm8350_data =3D { UBWC_SWIZZLE_ENABLE_LVL3, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data sm8550_data =3D { @@ -173,7 +165,6 @@ static const struct qcom_ubwc_cfg_data sm8550_data =3D { UBWC_SWIZZLE_ENABLE_LVL3, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data sm8750_data =3D { @@ -181,7 +172,6 @@ static const struct qcom_ubwc_cfg_data sm8750_data =3D { .ubwc_swizzle =3D 6, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, - .macrotile_mode =3D true, }; =20 static const struct qcom_ubwc_cfg_data glymur_data =3D { @@ -189,7 +179,6 @@ static const struct qcom_ubwc_cfg_data glymur_data =3D { .ubwc_swizzle =3D 0, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, - .macrotile_mode =3D true, }; =20 static const struct of_device_id qcom_ubwc_configs[] __maybe_unused =3D { diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h index 254721f5ea3c..fee778360ac2 100644 --- a/include/linux/soc/qcom/ubwc.h +++ b/include/linux/soc/qcom/ubwc.h @@ -33,15 +33,6 @@ struct qcom_ubwc_cfg_data { * DDR bank. This should ideally use DRAM type detection. */ int highest_bank_bit; - - /** - * @macrotile_mode: Macrotile Mode - * - * Whether to use 4-channel macrotiling mode or the newer - * 8-channel macrotiling mode introduced in UBWC 3.1. 0 is - * 4-channel and 1 is 8-channel. - */ - bool macrotile_mode; }; =20 #define UBWC_1_0 0x10000000 @@ -77,9 +68,16 @@ static inline bool qcom_ubwc_min_acc_length_64b(const st= ruct qcom_ubwc_cfg_data return cfg->ubwc_enc_version =3D=3D UBWC_1_0; } =20 +/* + * @qcom_ubwc_macrotile_mode: whether to use 4-channel or 8-channel macrot= iling + * + * The 8-channel macrotiling mode was introduced in UBWC 3.1. + * + * Returns: false for the 4-channel and true for 8-channel. + */ static inline bool qcom_ubwc_macrotile_mode(const struct qcom_ubwc_cfg_dat= a *cfg) { - return cfg->macrotile_mode; + return cfg->ubwc_enc_version >=3D UBWC_3_1; } =20 static inline bool qcom_ubwc_bank_spread(const struct qcom_ubwc_cfg_data *= cfg) --=20 2.47.3