All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Dybcio <konradybcio@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>,
	 Konrad Dybcio <konradybcio@kernel.org>,
	Rob Clark <robdclark@gmail.com>,
	 Abhinav Kumar <quic_abhinavk@quicinc.com>,
	 Dmitry Baryshkov <lumag@kernel.org>,
	 Akhil P Oommen <quic_akhilpo@quicinc.com>,
	Sean Paul <sean@poorly.run>,  David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>
Cc: Marijn Suijten <marijn.suijten@somainline.org>,
	 linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	 dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org,
	 Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: [PATCH RFT v3 07/14] drm/msm/a6xx: Resolve the meaning of UBWC_MODE
Date: Sat, 17 May 2025 19:32:41 +0200	[thread overview]
Message-ID: <20250517-topic-ubwc_central-v3-7-3c8465565f86@oss.qualcomm.com> (raw)
In-Reply-To: <20250517-topic-ubwc_central-v3-0-3c8465565f86@oss.qualcomm.com>

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

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.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
 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 4309787f7b6c8df3bbc37c3abd1a3f900398c1e7..7227bcdbd8d88834beb7427ca0929964d2ae937d 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -54,4 +54,14 @@ struct qcom_ubwc_cfg_data {
 
 const struct qcom_ubwc_cfg_data *qcom_ubwc_config_get_data(void);
 
+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__ */

-- 
2.49.0


  parent reply	other threads:[~2025-05-17 17:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-17 17:32 [RFT PATCH v3 00/14] Add a single source of truth for UBWC configuration data Konrad Dybcio
2025-05-17 17:32 ` [PATCH RFT v3 01/14] soc: qcom: Add UBWC config provider Konrad Dybcio
2025-05-18  8:08   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 02/14] drm/msm: Offset MDSS HBB value by 13 Konrad Dybcio
2025-05-18  8:08   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 03/14] drm/msm: Use the central UBWC config database Konrad Dybcio
2025-05-18  9:19   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 04/14] drm/msm/a6xx: Get a handle to the common UBWC config Konrad Dybcio
2025-05-18  4:52   ` kernel test robot
2025-05-18  9:24   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 05/14] drm/msm/a6xx: Resolve the meaning of AMSBC Konrad Dybcio
2025-05-18  9:24   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 06/14] drm/msm/a6xx: Simplify uavflagprd_inv detection Konrad Dybcio
2025-05-18  9:24   ` Dmitry Baryshkov
2025-05-17 17:32 ` Konrad Dybcio [this message]
2025-05-18  9:47   ` [PATCH RFT v3 07/14] drm/msm/a6xx: Resolve the meaning of UBWC_MODE Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 08/14] drm/msm/a6xx: Replace '2' with BIT(1) in level2_swizzling_dis calc Konrad Dybcio
2025-05-18  9:48   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 09/14] drm/msm/a6xx: Resolve the meaning of rgb565_predicator Konrad Dybcio
2025-05-18  9:49   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 10/14] drm/msm/a6xx: Simplify min_acc_len calculation Konrad Dybcio
2025-05-18  9:57   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 11/14] soc: qcom: ubwc: Fix SM6125's ubwc_swizzle value Konrad Dybcio
2025-05-18  9:58   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 12/14] soc: qcom: ubwc: Add #defines for UBWC swizzle bits Konrad Dybcio
2025-05-18  9:58   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 13/14] soc: qcom: ubwc: Fill in UBWC swizzle cfg for platforms that lack one Konrad Dybcio
2025-05-18  9:59   ` Dmitry Baryshkov
2025-05-17 17:32 ` [PATCH RFT v3 14/14] drm/msm/adreno: Switch to the common UBWC config struct Konrad Dybcio
2025-05-18 10:17   ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250517-topic-ubwc_central-v3-7-3c8465565f86@oss.qualcomm.com \
    --to=konradybcio@kernel.org \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_akhilpo@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.