From nobody Wed Oct 8 19:15:36 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E8BC625D53E; Wed, 25 Jun 2025 13:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750857051; cv=none; b=VVljQxKJVcDLhPx+iZl4ZzDCintuOkFC3mMXp2zM0d4pHQVFZorRErftfK0LPPngk2XMb8ZsI6DUjhI4szP6tuyP8y6BlkY2qDVF+mv6/+VdrY/hoFX5UK7fYO8UuFpBh8DwEYvbfbpP/JJK5v5qfjnItht4/Mai07h6epJInHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750857051; c=relaxed/simple; bh=4+f7GA/otNyWhQwFzv3cN+bRXvAY+QsCJlqjXa4WCbQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZhekKv3EgPfgHpba2+sTxNZ+MIIKMTLcMp+KfKWuzLLVYfNAodkUb+PGSoow5FCoSH7qdTAkLo69rzQ6gHrmUzdvybZBnqih1T5bSPjORi+GrONZHVhikQS/Rj7GvOIRhYpdOqldyY3Li/2xmjIAqNyoYtlFXcdMAbGen4weeIo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Zggbwkhl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Zggbwkhl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DE60C4CEEA; Wed, 25 Jun 2025 13:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750857050; bh=4+f7GA/otNyWhQwFzv3cN+bRXvAY+QsCJlqjXa4WCbQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Zggbwkhl/imWx1II153ZRhSuyRKcNYTOUYKDyZ89WIP/rDVulNHf3oUs3OJ5IfI8g QPkRedXzK6JnoIzuGfJAs0DMeozBZdMpTLa/itFkX7TonHS39cR7pc8gypj/Z588Dy abgD8ubRSGGgQr6acWXJpfwxSx9TZhye2dNttKpBF2iQC1ARVP90/YtFpH1gmWz2OK ZpNwVnzaLU20uw6u7I7ZwKGHDSWI2rV7E9qBDsCMHSu63T2O+FqohnOTE3/rjCLs9o UdRvkkEgdN6IPQHD5lAUv0Bc6gAYj/8IxFUquAWVeyWnFDghkL2ZgCyhaQf3AbQPpa X0eobgrixNDJw== From: Konrad Dybcio Date: Wed, 25 Jun 2025 15:10:15 +0200 Subject: [PATCH v5 07/14] drm/msm/a6xx: Resolve the meaning of UBWC_MODE 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: <20250625-topic-ubwc_central-v5-7-e256d18219e2@oss.qualcomm.com> References: <20250625-topic-ubwc_central-v5-0-e256d18219e2@oss.qualcomm.com> In-Reply-To: <20250625-topic-ubwc_central-v5-0-e256d18219e2@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Jessica Zhang , Rob Clark , Akhil P Oommen Cc: Marijn Suijten , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1750857014; l=2107; i=konrad.dybcio@oss.qualcomm.com; s=20230215; h=from:subject:message-id; bh=gbQdqtBOeisek0R+EbShz3Z9yw3aoUL/2+EsNsZHbj0=; b=/+o6wlnyMk5hrp+/vadcqkO8sHq+NbuPMHdUmYnHhEk3cMwl55Puusn+FBrovmHN0hUq/JAdy njmm6QCaOECDslOrFNm77gsXgieQEjbtBSxI9zb3WcfiCKaJfPsI0pk X-Developer-Key: i=konrad.dybcio@oss.qualcomm.com; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= From: Konrad Dybcio This bit is set iff the UBWC version is 1.0. That notably does not include QCM2290's "no UBWC". This commit is intentionally cross-subsystem to ease review, as the patchset is intended to be merged together, with a maintainer consensus. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- include/linux/soc/qcom/ubwc.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gpu.c index 3d9c98e56d92ed43cf6e702fbd2b5cbd3293ac5a..3d345844337608086ffec1998b4= 7b315ada68a97 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -686,11 +686,11 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu) */ BUG_ON(adreno_gpu->ubwc_config.highest_bank_bit < 13); u32 hbb =3D adreno_gpu->ubwc_config.highest_bank_bit - 13; + bool ubwc_mode =3D qcom_ubwc_get_ubwc_mode(cfg); bool amsbc =3D cfg->ubwc_enc_version >=3D UBWC_3_0; u8 uavflagprd_inv =3D 0; u32 hbb_hi =3D hbb >> 2; u32 hbb_lo =3D hbb & 3; - u32 ubwc_mode =3D adreno_gpu->ubwc_config.ubwc_swizzle & 1; u32 level2_swizzling_dis =3D !(adreno_gpu->ubwc_config.ubwc_swizzle & 2); =20 if (adreno_is_a650_family(adreno_gpu) || adreno_is_a7xx(adreno_gpu)) diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h index b92fc402638bae85e4e9da2552be56ac9ea9b448..5dc41aafa0afe1fe7f66ae6f881= 5989663ced780 100644 --- a/include/linux/soc/qcom/ubwc.h +++ b/include/linux/soc/qcom/ubwc.h @@ -62,4 +62,14 @@ static inline const struct qcom_ubwc_cfg_data *qcom_ubwc= _config_get_data(void) } #endif =20 +static inline bool qcom_ubwc_get_ubwc_mode(const struct qcom_ubwc_cfg_data= *cfg) +{ + bool ret =3D cfg->ubwc_enc_version =3D=3D UBWC_1_0; + + if (ret && !(cfg->ubwc_swizzle & BIT(0))) + pr_err("UBWC config discrepancy - level 1 swizzling disabled on UBWC 1.0= \n"); + + return ret; +} + #endif /* __QCOM_UBWC_H__ */ --=20 2.50.0