From nobody Tue Apr 7 18:03:28 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 33F443CF67E for ; Thu, 12 Mar 2026 13:30:19 +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=1773322220; cv=none; b=T+HzKnw0uPl7EZaLf0zO7io+xjCqgY+OR+raWqErUSgL/onEXLCsrDxRCXJxmytv2A10kDmzZD5T/jzQsAKfkMufU2mTqWy6e8NK4sVnYbmYYDnHqQ+rLErt0xOQmAmEWUSGblSeu1ZUwCK3F4BXzx+139qiHi2jwI43TXTQkYs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773322220; c=relaxed/simple; bh=aZePfCHlihjZhkopGUN2RVAJWZ7XbjQf2cNHz8Ha1/A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GRsVuWpb5lyE+wCXe9m2OfncAJVUgavr9ZLcZus4Lp4su0p6uwjJKXm4oGuXEvC5iP3Y3dn7LDUzIn7BjbMPkyBZdHa/ATZivQM/9i/Dj8E0oeATKiNWTDR90FmUsv+ymd+9cqBt94T8/SIowMgOs/jTlg+sfuaZiDyBZC9vFVo= 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=Z1UfmdRG; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FpDxM30G; 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="Z1UfmdRG"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FpDxM30G" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62CA4lWJ1756251 for ; Thu, 12 Mar 2026 13:30:18 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= CHHWto9L3DJt77vFN3vZgjFHf3Lp2HIBccOsbhUwjkI=; b=Z1UfmdRGMMzqhXva WUVlTeJAXrF3kAkD8zQhGqymLE+LDJBwC2c4K5LmpCOzkF8z7ZMxmWyKJCqLZ4ON q4tQ7vNAHWhoasIdaDjtAFSIasYSuGh4EAKF2KYTJ9RYlVW5zkHoPwspwOcVB4+4 Iml6agVygHUUfpQn18LSboFlsFkJrq62pHIs0F78HzC7TFzyKjNo5RkVNZfOpqrH wxLld6VM2hrYCBlmLBEZnUUMvnq8ml36fWQ0Wex0VckX0ps9lwvDm1OGKtmDS6s4 Bny85nULhMFTkhUIKcDPGVLjkqqS5eqOwvG+jE0KaVNalz8zrzPpqgRIJGSVhnZ8 cb54Zw== 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 4cuh53j6wx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Mar 2026 13:30:17 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cd7c4ab845so451599385a.1 for ; Thu, 12 Mar 2026 06:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773322217; x=1773927017; 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=CHHWto9L3DJt77vFN3vZgjFHf3Lp2HIBccOsbhUwjkI=; b=FpDxM30G7P+WlDoNI+vJ6odVGAjc28LtVodrmRMQyqxa7nkcvx3CvEZvo5Q85WOHxo IBsPr5PkJM/yEg3U/G54TYKZqrwBE496AJekUhiT4G1mRTfhMJ1Iy0Lxfnj8PX82PtD7 rO9AvO9RHq/aeENbLOLwciNZactFEuMFGf+4duYDM8Ev6NGfePxbZ6n7eNZciuhF91mN Vr4W7RVIQYfGvMWB7CzXckk3Dh6Irx41gAvq5fnKs4Zo/+Uil6y7aXh+XsDf+7iY5VZf yF86MmIQ7QhgdP8o2nkSFlJ7NtYcs1hzfJZ6qqFPgZUnomspTzbk9HJ5UK3He8f9X/jl Z+cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773322217; x=1773927017; 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=CHHWto9L3DJt77vFN3vZgjFHf3Lp2HIBccOsbhUwjkI=; b=SzBHXZjOsgP8JlghHkVBRfB0SMjC6N06xpGCsT24cn51keUlH1wNJotWfBgxQqmTFa zKmmC7VbtVWJYM2La/tzNlBysgPrz6TwstKBFeNjFBXrx90fYXZOVvGpUiM2iymZoH64 2bdtLx++6EZNnL4RPEnV9sZ+PSo2AjIyMvowq8giSCpfFfkt5R7YNTbw3mIGmJdx+h5D rifGCbSeC2c99bZA96s5YHrCeS/8RW10DIlD2OjdpkPKzdme6M9ylbsmRuf6kI2bfZgW 7xLef59WNYckKf9xun4dWndbVSBh1xVDooisKGVuJ2d6La8Rqnj1zCvNtCCLCG5bOviF uXPQ== X-Forwarded-Encrypted: i=1; AJvYcCVOIVIQGE5ygsxmcKXATR0+Tn4FaireQYfsp24hALHMPwEc9KpbZGtcs9koKvV3etz8gks3o6LxkHS2nvU=@vger.kernel.org X-Gm-Message-State: AOJu0Yxx9T+mMKQ2tQfoWPVSRDkl9wht1hytf8jD4unMQQtvHmRZL5hN cEa5R/WhGAmiSF55uP6Ll6u8rjyoDvIShglT4Sszgx/K5nofuB2Xl/U8IQxUNFYKYTX99Vs5QXl irbFxpLLfAVH+uKmi500brEnGxOJluHU8MPaKIACaWK6Le8WFGprGI/lJnoq2kYYJZiA= X-Gm-Gg: ATEYQzx1F8GZGKFK2Ht/eXLkYeQWwUzONIie6okIDln6GG/egKEHO+CgZT4IFB+72rH F31LEib5QeVumXZEoLkKil7C4vTGc/6SxmMitBc7CIa9QQ1LrpDx8shlsrAQ9EW99UhE9AxJdPR E6vf6/URApTidEerL2ga9EWarhYTRK2ReTeXtb6BNHhq/aNyItf9jiRL232yCViPtC7TgU0W2TO U58G36auUj6SP/Sakg6/SC0lYfc+DfcnME7JiWaT0lFffYO/+FSSXOds2mMykW6DXmybQDbeJni sxo1xWW9AQnZ6Mmg4D8hcWXBciq2AnGBJMTzB9CQxXTGvkrQSpjwjDTjg4xjRJ73++HdGZ4z4bW moXdP96EDSZThp/HXUod5c5bDzdD4Yq7LQ88IGCEuZNFA6p6pEMWzH7RvT8xFD2B2u4Tg2iluAu 43vKiOwLBaeWzE7kPCytt2WV5jFCFkD8lmlIU= X-Received: by 2002:a05:620a:40d0:b0:8cd:8785:eff4 with SMTP id af79cd13be357-8cda1930373mr778952885a.15.1773322215685; Thu, 12 Mar 2026 06:30:15 -0700 (PDT) X-Received: by 2002:a05:620a:40d0:b0:8cd:8785:eff4 with SMTP id af79cd13be357-8cda1930373mr778943785a.15.1773322214962; Thu, 12 Mar 2026 06:30:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2026 06:30:13 -0700 (PDT) From: Dmitry Baryshkov Date: Thu, 12 Mar 2026 15:29:47 +0200 Subject: [PATCH v3 26/27] soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings 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-26-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, Konrad Dybcio X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4170; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=aZePfCHlihjZhkopGUN2RVAJWZ7XbjQf2cNHz8Ha1/A=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBpsr+4QsRN/zWuciV6Odv4RrrOuSOvS94vKiH4B itDI/Uu0EqJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCabK/uAAKCRCLPIo+Aiko 1VgRB/0W6lSJU7HgKg4riZddJ3HxFtJne7/DCfuauUegKe3lB2NlBQxcWy17xZMdkYFiBGeUVHD fXJVf8VKdPU2yzJJGs3eL3fUepzF+fxvvuCI23nYJCpXhUOj2SqWba9OvmAfFIimqqoA5FQZYbc 04s6Ph7rrcaHo3mKhawoSbbhdw9U5M4+3XzfdgMX8hXOH0ljaoO5na2i8s3vNek+ln9DuQdaf3X SRSWE1AD4Qvt1GCV7SroHBYT9mR86wxHAKG2ZYfPgbNifAga3wmYph9r2pQvmLKTvShntY0euk1 046NHQ9lmD6BC90Iwwa72lJEqZMvkgfUkQD8xJ5iGsrC0owG X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Authority-Analysis: v=2.4 cv=ZN/aWH7b c=1 sm=1 tr=0 ts=69b2bfe9 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=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=3htL6sknLGLhwEng4zIA:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEyMDEwNyBTYWx0ZWRfX6zz1amLowjpx hl2j52vzwnh/0bnoJ6DgA5Nnc5T5Xa1YcQcBm6J6dPPu3aG4KS6MKE12yUU1ouRVVb3T1mqMBJH n+gG5LwnBfxMS9JszIo28eKhYyfmu0MnywSKZe+SrY3cw/I7eTKQTnY1sDH8x1JKmLHHSiWNWSJ vQBPGMLlWPr8YBycF7UJFgX4LGeiBjOj+8DMSeLS7XQdF5DgNLpUn5xgwc+P60icwyDwO7H+Q/S xijztp1ogRYpPqew48ZM5Y+uOOxJsMVjDsDC7mJ22ar6LiVQxbiG9muKHEc1TADCOVFuv87tiso 2sCXMBh2p2I3UMOT03UgvxdeysyjBtX8Dj8Qvn/8ucykACNfDbFX7OPzQ+24VRvg1wvV/tbjSoz /4vPfIftCWUv8GUXAs5mVMESqCTxpH563s+Vd9qGtSgUN560ad6hS9I4OtdBMNVi0qCm13toq+2 MIGMCdIrXXq9es/wRZw== X-Proofpoint-GUID: -8RFsApO-cR63TzpBl1FKGUeEJWFprJh X-Proofpoint-ORIG-GUID: -8RFsApO-cR63TzpBl1FKGUeEJWFprJh 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 lowpriorityscore=0 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603120107 Sort out the remaining UBWC swizzle values, using flags to control whether level 2 and level 3 swizzling are enabled or not. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/soc/qcom/ubwc_config.c | 14 +++----------- include/linux/soc/qcom/ubwc.h | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c index 49edfabb5e18..ccee20913115 100644 --- a/drivers/soc/qcom/ubwc_config.c +++ b/drivers/soc/qcom/ubwc_config.c @@ -18,8 +18,6 @@ static const struct qcom_ubwc_cfg_data no_ubwc_data =3D { =20 static const struct qcom_ubwc_cfg_data kaanapali_data =3D { .ubwc_enc_version =3D UBWC_6_0, - .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | - UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit =3D 16, }; =20 @@ -40,7 +38,7 @@ static const struct qcom_ubwc_cfg_data qcm2290_data =3D { =20 static const struct qcom_ubwc_cfg_data sa8775p_data =3D { .ubwc_enc_version =3D UBWC_4_0, - .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL3, + .flags =3D UBWC_FLAG_DISABLE_SWIZZLE_LVL2, .highest_bank_bit =3D 13, }; =20 @@ -111,38 +109,32 @@ static const struct qcom_ubwc_cfg_data sm8150_data = =3D { =20 static const struct qcom_ubwc_cfg_data sm8250_data =3D { .ubwc_enc_version =3D UBWC_4_0, - .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | - UBWC_SWIZZLE_ENABLE_LVL3, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, }; =20 static const struct qcom_ubwc_cfg_data sm8350_data =3D { .ubwc_enc_version =3D UBWC_4_0, - .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | - UBWC_SWIZZLE_ENABLE_LVL3, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, }; =20 static const struct qcom_ubwc_cfg_data sm8550_data =3D { .ubwc_enc_version =3D UBWC_4_0, - .ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | - UBWC_SWIZZLE_ENABLE_LVL3, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, }; =20 static const struct qcom_ubwc_cfg_data sm8750_data =3D { .ubwc_enc_version =3D UBWC_5_0, - .ubwc_swizzle =3D 6, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, }; =20 static const struct qcom_ubwc_cfg_data glymur_data =3D { .ubwc_enc_version =3D UBWC_5_0, - .ubwc_swizzle =3D 0, + .flags =3D UBWC_FLAG_DISABLE_SWIZZLE_LVL2 | + UBWC_FLAG_DISABLE_SWIZZLE_LVL3, /* TODO: highest_bank_bit =3D 15 for LP_DDR4 */ .highest_bank_bit =3D 16, }; diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h index 7c9506741001..a7372d9c25fb 100644 --- a/include/linux/soc/qcom/ubwc.h +++ b/include/linux/soc/qcom/ubwc.h @@ -14,15 +14,6 @@ struct qcom_ubwc_cfg_data { u32 ubwc_enc_version; =20 - /** - * @ubwc_swizzle: Whether to enable level 1, 2 & 3 bank swizzling. - * - * UBWC 1.0 always enables all three levels. - * UBWC 2.0 removes level 1 bank swizzling, leaving levels 2 & 3. - * UBWC 4.0 adds the optional ability to disable levels 2 & 3. - */ - u32 ubwc_swizzle; - /** * @highest_bank_bit: Highest Bank Bit * @@ -30,6 +21,10 @@ struct qcom_ubwc_cfg_data { * DDR bank. This should ideally use DRAM type detection. */ int highest_bank_bit; + + unsigned int flags; +#define UBWC_FLAG_DISABLE_SWIZZLE_LVL2 BIT(0) +#define UBWC_FLAG_DISABLE_SWIZZLE_LVL3 BIT(1) }; =20 #define UBWC_1_0 0x10000000 @@ -98,11 +93,16 @@ static inline u32 qcom_ubwc_swizzle(const struct qcom_u= bwc_cfg_data *cfg) UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3; =20 - if (cfg->ubwc_enc_version < UBWC_4_0) - return UBWC_SWIZZLE_ENABLE_LVL2 | - UBWC_SWIZZLE_ENABLE_LVL3; + u32 ubwc_swizzle =3D UBWC_SWIZZLE_ENABLE_LVL2 | + UBWC_SWIZZLE_ENABLE_LVL3; + + if (cfg->flags & UBWC_FLAG_DISABLE_SWIZZLE_LVL2) + ubwc_swizzle &=3D ~UBWC_SWIZZLE_ENABLE_LVL2; + + if (cfg->flags & UBWC_FLAG_DISABLE_SWIZZLE_LVL3) + ubwc_swizzle &=3D ~UBWC_SWIZZLE_ENABLE_LVL3; =20 - return cfg->ubwc_swizzle; + return ubwc_swizzle; } =20 static inline u32 qcom_ubwc_version_tag(const struct qcom_ubwc_cfg_data *c= fg) --=20 2.47.3