From patchwork Tue May 20 11:07:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 891352 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 67E232701C8; Tue, 20 May 2025 11:07: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=1747739271; cv=none; b=sH5zBUeOPghSqvKzacA4IcR9jk/G+DCqqKUBzhMguBc/EzgZBxLTd38NpjDlicBHDbwhnptNSgOWh5cu+tKGpWtB302Z0mU6epOoKzt/Trejz7kh+yKB5wLTI9ibv0p+6wJ5zy35T/kNVDyKBjtEfMGut9w5BcdSYhjkySoY86g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747739271; c=relaxed/simple; bh=9E2qhR1XaU3B9sjO9pEDTpnqS+zWbcGow6sqQsSeS1Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GQNV3UqvICfx0un5VwKBe2ruMy1/Yo/QEjopBTwYcqHWv6L7GwNShSTgKnY+VTTocKxh2ZQJUYNnxPw25O7sT502aO1rKAo0BRCFMvTwC7ZyUsbZZ4Xg9PG3JqOPLVI0Ak0329vEKKLR/QsazC1ntWkBIEqpr/ENwj3EzTjgOXA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rIyOyvAS; 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="rIyOyvAS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3EECC4CEF1; Tue, 20 May 2025 11:07:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747739270; bh=9E2qhR1XaU3B9sjO9pEDTpnqS+zWbcGow6sqQsSeS1Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rIyOyvAS+6Ygf1rHnGexlesngyts/GS1KtBdCFlfvOXlsiWaWdmQ1BFiFb1VJHubm QPyWnoQig39shqyg5kZ0FIgjxXe7kHhdj3InQKsNHQTx9WWc63bKcCar0xo1zxBBHQ aICVv8dTvL3eEYHfKjqN6aL6VxnD6qRMkIFDJAtuKXy7widBJiKBBfqc+cpeBXtVeD J4AYKH0XVyMq1q6s8/LffZpZW2RrGVJi8krxNjBEeuQHTtfbjnNPWdw8uih9H3bW4O 1IPy6vCGhbrBsWpgXPzxVA9JIEXSAhTERZuv9kNjStVbmEjb3CisqYqlmtu7HC/2jx 1nQI7TUH+CHQw== From: Konrad Dybcio Date: Tue, 20 May 2025 13:07:12 +0200 Subject: [PATCH RFT v4 07/14] drm/msm/a6xx: Resolve the meaning of UBWC_MODE Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250520-topic-ubwc_central-v4-7-2a461d32234a@oss.qualcomm.com> References: <20250520-topic-ubwc_central-v4-0-2a461d32234a@oss.qualcomm.com> In-Reply-To: <20250520-topic-ubwc_central-v4-0-2a461d32234a@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Akhil P Oommen , Sean Paul , David Airlie , Simona Vetter 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=1747739235; l=2107; i=konrad.dybcio@oss.qualcomm.com; s=20230215; h=from:subject:message-id; bh=WkH2SlmLcTrbMzzovYIdalcdD3bgOciNzfnRMkMKcOQ=; b=chOh+BQDrbE20xh5knam9+Hcg0ktabJdn9z51zEGoNifSXSQv58/xzXCFTQJtRhYdW3EMRejp 0DkaHB4wIqWAVgL1S6rhhSnpbxkryHE8N5FFXYULkYt+/f92MySuqu0 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/adreno/a6xx_gpu.c index 00a928fee07290951b69263dd1d902ce85400fc0..154346591365f3f89d467674952abb2f067e7ce3 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -668,11 +668,11 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu) */ BUG_ON(adreno_gpu->ubwc_config.highest_bank_bit < 13); u32 hbb = adreno_gpu->ubwc_config.highest_bank_bit - 13; + bool ubwc_mode = qcom_ubwc_get_ubwc_mode(cfg); bool amsbc = cfg->ubwc_enc_version >= UBWC_3_0; u8 uavflagprd_inv = 0; u32 hbb_hi = hbb >> 2; u32 hbb_lo = hbb & 3; - u32 ubwc_mode = adreno_gpu->ubwc_config.ubwc_swizzle & 1; u32 level2_swizzling_dis = !(adreno_gpu->ubwc_config.ubwc_swizzle & 2); 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 d0ef22fb04c5b5549a86f450a687d9ff477c871f..7f87a0981fe19eea3373ee2cc79cd11c84ddbc8c 100644 --- a/include/linux/soc/qcom/ubwc.h +++ b/include/linux/soc/qcom/ubwc.h @@ -61,4 +61,14 @@ static inline const struct qcom_ubwc_cfg_data *qcom_ubwc_config_get_data(void) } #endif +static inline bool qcom_ubwc_get_ubwc_mode(const struct qcom_ubwc_cfg_data *cfg) +{ + bool ret = cfg->ubwc_enc_version == 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__ */