soc/qcom/ubwc: rework UBWC configuration database
Subsystems (5)
cover soc/qcom/ubwc: rework UBWC configuration database
Currently we store several settings in the configuration database. Some of them are incorrect or not completely matching the expected configuration settings. Others are directly derivable from the UBWC version. Rework how we handle the values in the database, trimming it down to the UBWC version, HBB and several flags.
Note: I don't have a good merge strategy for the sieres, it depends on other SoC/UBWC patches [1], which are probably going to be merged through linux-media. Any suggestions are appreciated.
Maybe the best option would be to:
- merge SoC patches from that series and this series to the Bjorn's tree
- create an immutable tag to be used by linux-media and drm/msm
- Merge relevant drm/msm and linux-media patches to corresponding trees after merging the immutable tag
- Merge the rest of SoC patches in the next cycle after drm/msm and media changes are in
WDYT?
[1] https://lore.kernel.org/r/[email protected]
---
Dmitry Baryshkov (23):
drm/msm/mdss: correct UBWC programming sequences
soc: qcom: ubwc: define UBWC 3.1
soc: qcom: ubwc: define helper for MDSS and Adreno drivers drm/msm/adreno: use qcom_ubwc_version_tag() helper drm/msm/adreno: use new helper to set min_acc length drm/msm/mdss: use new helper to set min_acc length drm/msm/adreno: use new helper to set macrotile_mode drm/msm/mdss: use new helper to set macrotile_mode drm/msm/mdss: use new helper to set UBWC bank spreading drm/msm/adreno: use new helper to set ubwc_swizzle drm/msm/dpu: use new helper to set ubwc_swizzle drm/msm/mdss: use new helper to set ubwc_swizzle drm/msm/dpu: drop ubwc_dec_version
drm/msm/adreno: adapt for UBWC 3.1 support drm/msm/mdss: adapt for UBWC 3.1 support
drm/msm/dpu: adapt for UBWC 3.1 support
soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets
soc: qcom: ubwc: drop ubwc_dec_version
soc: qcom: ubwc: drop ubwc_bank_spread
soc: qcom: ubwc: drop macrotile_mode from the database
soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0
soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings
soc: qcom: ubwc: deduplicate UBWC configuration data
Konrad Dybcio (1):
drm/msm/adreno: Trust the SSoT UBWC config
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 11 +- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 91 +-------- drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 13 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 5 - drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 10 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 3 +- drivers/gpu/drm/msm/msm_mdss.c | 122 ++++-------- drivers/soc/qcom/ubwc_config.c | 281 +++++++--------------------- include/linux/soc/qcom/ubwc.h | 95 ++++++---- 10 files changed, 196 insertions(+), 439 deletions(-)
---
base-commit: 3f9cd19e764b782706dbaacc69e502099cb014ba
change-id: 20260211-ubwc-rework-e6ce1d8eb520
prerequisite-change-id: 20260110-iris-ubwc-06f64cbb31ae:v4
prerequisite-patch-id: 258496117b2e498200190910a37776be2ced6382
prerequisite-patch-id: 50f58e5d9c6cd2b520d17a7e7b2e657faa7d0847
prerequisite-patch-id: af2ff44a7b919da2ee06cc40893fbcd3f65d32f7
prerequisite-patch-id: f3a2b9ef97be3fa250ea0a6467b2d5a782315aa5
prerequisite-patch-id: 6bdd2119448e84aacbdc6a54d999d47fc69dac81
prerequisite-patch-id: 38cc9502c93c71324f1a11a1fd438374fc41ca84
prerequisite-patch-id: 059d1f35274246575ca4fa9b4ee33cd4801479d1
prerequisite-patch-id: 1cf4ea774a145cdba617eb8be5c1f7afe5817772
prerequisite-patch-id: 46375dcd0da4629e6031336351b9cf688691d7c5
prerequisite-change-id: 20260228-fix-glymur-ubwc-f673d5ca0581:v2
prerequisite-patch-id: 7982b5ad797f83303a7fc6c932c0c6973114e2a4
prerequisite-patch-id: 5bc7dddd09fcdb4f534f8468ab3ad51781667066
Best regards,
Signature · 2 lines
With best wishes Dmitry
PATCH 1/24 drm/msm/mdss: correct UBWC programming sequences
The UBWC registers in the MDSS region are not dependent on the UBWC version (it is an invalid assumption we inherited from the vendor SDE driver). Instead they are dependent only on the MDSS core revision.
Rework UBWC programming to follow MDSS revision and to use required (aka encoder) UBWC version instead of the ubwc_dec_version.
--- drivers/gpu/drm/msm/msm_mdss.c | 120 ++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 75 deletions(-)
drivers/gpu/drm/msm/msm_mdss.c +45 -75
@@ -166,27 +166,27 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss)return 0 ; } -static void msm_mdss_setup_ubwc_dec_20 (struct msm_mdss *msm_mdss) +static void msm_mdss_setup_ubwc_v4 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; -u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) | +u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle &0x1 ) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 ); -if (data->ubwc_bank_spread) - value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ; -if (data->ubwc_enc_version ==UBWC_1_0 ) value |=MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN (1 );writel_relaxed (value, msm_mdss->mmio +REG_MDSS_UBWC_STATIC ); } -static void msm_mdss_setup_ubwc_dec_30 (struct msm_mdss *msm_mdss) +static void msm_mdss_setup_ubwc_v5 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; -u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle &0x1 ) | +u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 ); +if (data->ubwc_bank_spread) + value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ; +if (data->macrotile_mode) value |=MDSS_UBWC_STATIC_MACROTILE_MODE ;
@@ -199,11 +199,12 @@ static void msm_mdss_setup_ubwc_dec_30(struct msm_mdss *msm_mdss)writel_relaxed (value, msm_mdss->mmio +REG_MDSS_UBWC_STATIC ); } -static void msm_mdss_setup_ubwc_dec_40 (struct msm_mdss *msm_mdss) +static void msm_mdss_setup_ubwc_v6 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data;u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 ); +u32 ver, prediction_mode;if (data->ubwc_bank_spread) value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ;
@@ -211,45 +212,42 @@ static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss)if (data->macrotile_mode) value |=MDSS_UBWC_STATIC_MACROTILE_MODE ; -writel_relaxed (value, msm_mdss->mmio +REG_MDSS_UBWC_STATIC ); - -if (data->ubwc_enc_version ==UBWC_3_0 ) { -writel_relaxed (1 , msm_mdss->mmio +REG_MDSS_UBWC_CTRL_2 ); -writel_relaxed (0 , msm_mdss->mmio +REG_MDSS_UBWC_PREDICTION_MODE ); - }else { -if (data->ubwc_dec_version ==UBWC_4_3 ) -writel_relaxed (3 , msm_mdss->mmio +REG_MDSS_UBWC_CTRL_2 ); -else -writel_relaxed (2 , msm_mdss->mmio +REG_MDSS_UBWC_CTRL_2 ); -writel_relaxed (1 , msm_mdss->mmio +REG_MDSS_UBWC_PREDICTION_MODE ); - } -} - -static void msm_mdss_setup_ubwc_dec_50 (struct msm_mdss *msm_mdss) -{ -const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; -u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) | -MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 ); - -if (data->ubwc_bank_spread) - value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ; - -if (data->macrotile_mode) - value |=MDSS_UBWC_STATIC_MACROTILE_MODE ; +if (data->ubwc_enc_version ==UBWC_1_0 ) + value |=MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN (1 );writel_relaxed (value, msm_mdss->mmio +REG_MDSS_UBWC_STATIC ); -if (data->ubwc_dec_version ==UBWC_6_0 ) -writel_relaxed (5 , msm_mdss->mmio +REG_MDSS_UBWC_CTRL_2 ); +if (data->ubwc_enc_version <UBWC_4_0 ) + prediction_mode =0 ;else -writel_relaxed (4 , msm_mdss->mmio +REG_MDSS_UBWC_CTRL_2 ); - -writel_relaxed (1 , msm_mdss->mmio +REG_MDSS_UBWC_PREDICTION_MODE ); + prediction_mode =1 ; + +if (data->ubwc_enc_version >=UBWC_6_0 ) + ver =5 ; +else if (data->ubwc_enc_version >=UBWC_5_0 ) + ver =4 ; +else if (data->ubwc_enc_version >=UBWC_4_3 ) + ver =3 ; +else if (data->ubwc_enc_version >=UBWC_4_0 ) + ver =2 ; +else if (data->ubwc_enc_version >=UBWC_3_0 ) + ver =1 ; +else /* UBWC 1.0 and 2.0 */ + ver =0 ; + +writel_relaxed (ver, msm_mdss->mmio +REG_MDSS_UBWC_CTRL_2 ); +writel_relaxed (prediction_mode, msm_mdss->mmio +REG_MDSS_UBWC_PREDICTION_MODE ); } +#define MDSS_HW_VER (major, minor, step) \ + ((((major) & 0xf) << 28) | \ + (((minor) & 0xfff) << 16) | \ + ((step) & 0xffff)) +static int msm_mdss_enable (struct msm_mdss *msm_mdss) {int ret, i; +u32 hw_rev;/* * Several components have AXI clocks that can only be turned on if
@@ -275,43 +273,15 @@ static int msm_mdss_enable(struct msm_mdss *msm_mdss)if (msm_mdss->is_mdp5 || !msm_mdss->mdss_data)return 0 ; -/* -* ubwc config is part of the "mdss" region which is not accessible -* from the rest of the driver. hardcode known configurations here -* -* Decoder version can be read from the UBWC_DEC_HW_VERSION reg, -* UBWC_n and the rest of params comes from hw data. -*/ -switch (msm_mdss->mdss_data->ubwc_dec_version) { -case 0 :/* no UBWC */ -case UBWC_1_0 : -/* do nothing */ -break ; -case UBWC_2_0 : -msm_mdss_setup_ubwc_dec_20 (msm_mdss); -break ; -case UBWC_3_0 : -msm_mdss_setup_ubwc_dec_30 (msm_mdss); -break ; -case UBWC_4_0 : -case UBWC_4_3 : -msm_mdss_setup_ubwc_dec_40 (msm_mdss); -break ; -case UBWC_5_0 : -msm_mdss_setup_ubwc_dec_50 (msm_mdss); -break ; -case UBWC_6_0 : -msm_mdss_setup_ubwc_dec_50 (msm_mdss); -break ; -default : -dev_err (msm_mdss->dev,"Unsupported UBWC decoder version %x\n" , - msm_mdss->mdss_data->ubwc_dec_version); -dev_err (msm_mdss->dev,"HW_REV: 0x%x\n" , -readl_relaxed (msm_mdss->mmio +REG_MDSS_HW_VERSION )); -dev_err (msm_mdss->dev,"UBWC_DEC_HW_VERSION: 0x%x\n" , -readl_relaxed (msm_mdss->mmio +REG_MDSS_UBWC_DEC_HW_VERSION )); -break ; - } + hw_rev =readl_relaxed (msm_mdss->mmio +REG_MDSS_HW_VERSION ); + +if (hw_rev >=MDSS_HW_VER (6 ,0 ,0 )) +msm_mdss_setup_ubwc_v6 (msm_mdss); +else if (hw_rev >=MDSS_HW_VER (5 ,0 ,0 )) +msm_mdss_setup_ubwc_v5 (msm_mdss); +else if (hw_rev >=MDSS_HW_VER (4 ,0 ,0 )) +msm_mdss_setup_ubwc_v4 (msm_mdss); +/* else UBWC 1.0 or none, no params to program */ return ret; }
Signature · 1 line
2.47.3
Re: [PATCH 01/24] drm/msm/mdss: correct UBWC programming sequences
Quoted 18 lines · Dmitry Baryshkov
The UBWC registers in the MDSS region are not dependent on the UBWC version (it is an invalid assumption we inherited from the vendor SDE driver). Instead they are dependent only on the MDSS core revision.
Rework UBWC programming to follow MDSS revision and to use required (aka encoder) UBWC version instead of the
ubwc_dec_version.Fixes d68db6069a8e ("drm/msm/mdss: convert UBWC setup to use match data")Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/msm/msm_mdss.c | 120 ++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 75 deletions(-)drivers/gpu/drm/msm/msm_mdss.c +0
-0
drivers/gpu/drm/msm/msm_mdss.c static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss) · line 172
Quoted 9 lines
drivers/gpu/drm/msm/msm_mdss.c +2
-2@@ -166,27 +166,27 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss)return 0 ; } -static void msm_mdss_setup_ubwc_dec_20 (struct msm_mdss *msm_mdss) +static void msm_mdss_setup_ubwc_v4 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; - u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle) | + u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle & 0x1) |
The field takes bit0/1/2 for *enabling* level 1/2/3 swizzling - is this intended?
[...]
drivers/gpu/drm/msm/msm_mdss.c static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss) · line 188
Quoted 9 lines
drivers/gpu/drm/msm/msm_mdss.c +4
-1+static void msm_mdss_setup_ubwc_v5 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; -u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle &0x1 ) | +u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 ); +if (data->ubwc_bank_spread) + value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ;
8250 is ubwcv4 (in our catalog anyway) and definitely has a bit for this
Konrad
Re: [PATCH 01/24] drm/msm/mdss: correct UBWC programming sequences
Quoted 22 lines · Konrad Dybcio
Quoted 21 lines · Dmitry Baryshkov
The UBWC registers in the MDSS region are not dependent on the UBWC version (it is an invalid assumption we inherited from the vendor SDE driver). Instead they are dependent only on the MDSS core revision.
Rework UBWC programming to follow MDSS revision and to use required (aka encoder) UBWC version instead of the
ubwc_dec_version.Fixes d68db6069a8e ("drm/msm/mdss: convert UBWC setup to use match data")Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/msm/msm_mdss.c | 120 ++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 75 deletions(-)drivers/gpu/drm/msm/msm_mdss.c +0
-0@@ -166,27 +166,27 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss)return 0 ; }
Quoted 9 lines
drivers/gpu/drm/msm/msm_mdss.c static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss) · line 172
Quoted 6 lines
drivers/gpu/drm/msm/msm_mdss.c +2
-2-static void msm_mdss_setup_ubwc_dec_20 (struct msm_mdss *msm_mdss) +static void msm_mdss_setup_ubwc_v4 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; - u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle) | + u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle & 0x1) |The field takes bit0/1/2 for *enabling* level 1/2/3 swizzling - is this intended?
Not on MDSS v4. I need to rename the functions for better understanding.
Quoted 10 lines
[...]
Quoted 7 lines
drivers/gpu/drm/msm/msm_mdss.c +2
-1+static void msm_mdss_setup_ubwc_v5 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; -u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle &0x1 ) | +u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 );
Quoted 5 lines
drivers/gpu/drm/msm/msm_mdss.c static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss) · line 188
Quoted 2 lines
drivers/gpu/drm/msm/msm_mdss.c +2
-0+if (data->ubwc_bank_spread) + value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ;8250 is ubwcv4 (in our catalog anyway) and definitely has a bit for this
8250 has MDSS 6.0
Quoted 2 lines
Konrad
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 01/24] drm/msm/mdss: correct UBWC programming sequences
In reply to Dmitry BaryshkovQuoted 10 lines · Dmitry Baryshkov
The UBWC registers in the MDSS region are not dependent on the UBWC version (it is an invalid assumption we inherited from the vendor SDE driver). Instead they are dependent only on the MDSS core revision.
Rework UBWC programming to follow MDSS revision and to use required (aka encoder) UBWC version instead of the
ubwc_dec_version.Fixes d68db6069a8e ("drm/msm/mdss: convert UBWC setup to use match data")Signed-off-by Dmitry Baryshkov <[email protected]>---
[...]
drivers/gpu/drm/msm/msm_mdss.c static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss) · line 236
Quoted 12 lines
drivers/gpu/drm/msm/msm_mdss.c +12
-0+if (data->ubwc_enc_version >=UBWC_6_0 ) + ver =5 ; +else if (data->ubwc_enc_version >=UBWC_5_0 ) + ver =4 ; +else if (data->ubwc_enc_version >=UBWC_4_3 ) + ver =3 ; +else if (data->ubwc_enc_version >=UBWC_4_0 ) + ver =2 ; +else if (data->ubwc_enc_version >=UBWC_3_0 ) + ver =1 ; +else /* UBWC 1.0 and 2.0 */ + ver =0 ;
You forgot(?) to use qcom_ubwc_version_tag() later
Konrad
Re: [PATCH 01/24] drm/msm/mdss: correct UBWC programming sequences
Quoted 14 lines · Konrad Dybcio
Quoted 10 lines · Dmitry Baryshkov
The UBWC registers in the MDSS region are not dependent on the UBWC version (it is an invalid assumption we inherited from the vendor SDE driver). Instead they are dependent only on the MDSS core revision.
Rework UBWC programming to follow MDSS revision and to use required (aka encoder) UBWC version instead of the
ubwc_dec_version.Fixes d68db6069a8e ("drm/msm/mdss: convert UBWC setup to use match data")Signed-off-by Dmitry Baryshkov <[email protected]>---
[...]
Quoted 14 lines
drivers/gpu/drm/msm/msm_mdss.c static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss) · line 236
Quoted 12 lines
drivers/gpu/drm/msm/msm_mdss.c +12
-0+if (data->ubwc_enc_version >=UBWC_6_0 ) + ver =5 ; +else if (data->ubwc_enc_version >=UBWC_5_0 ) + ver =4 ; +else if (data->ubwc_enc_version >=UBWC_4_3 ) + ver =3 ; +else if (data->ubwc_enc_version >=UBWC_4_0 ) + ver =2 ; +else if (data->ubwc_enc_version >=UBWC_3_0 ) + ver =1 ; +else /* UBWC 1.0 and 2.0 */ + ver =0 ;You forgot(?) to use
qcom_ubwc_version_tag()later
Let me check if the patch got dropped during rebase.
Quoted 2 lines
Konrad
Signature · 2 lines
With best wishes Dmitry
PATCH 2/24 soc: qcom: ubwc: define UBWC 3.1
In reply to Dmitry BaryshkovFollow the comment for the macrotile_mode and introduce separate revision for UBWC 3.0 + 8-channel macrotiling mode. It is not used by the database (since the drivers are not yet changed to handle it yet).
--- include/linux/soc/qcom/ubwc.h | 1 + 1 file changed, 1 insertion(+)
include/linux/soc/qcom/ubwc.h +1 -0
@@ -50,6 +50,7 @@ struct qcom_ubwc_cfg_data {#define UBWC_1_0 0x10000000#define UBWC_2_0 0x20000000#define UBWC_3_0 0x30000000 +#define UBWC_3_1 0x30010000/* UBWC 3.0 + Macrotile mode */ #define UBWC_4_0 0x40000000#define UBWC_4_3 0x40030000#define UBWC_5_0 0x50000000
Signature · 1 line
2.47.3
Re: [PATCH 02/24] soc: qcom: ubwc: define UBWC 3.1
Quoted 6 lines · Dmitry Baryshkov
Follow the comment for the
macrotile_modeand introduce separate revision for UBWC 3.0 + 8-channel macrotiling mode. It is not used by the database (since the drivers are not yet changed to handle it yet).Signed-off-by Dmitry Baryshkov <[email protected]>---
Konrad
PATCH 3/24 soc: qcom: ubwc: define helper for MDSS and Adreno drivers
In reply to Dmitry BaryshkovDefine special helper returning version setting for MDSS and A8xx drivers.
--- include/linux/soc/qcom/ubwc.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
include/linux/soc/qcom/ubwc.h +16 -0
@@ -100,4 +100,20 @@ static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg) return cfg->ubwc_swizzle; } +static inline u32 qcom_ubwc_version_tag (const struct qcom_ubwc_cfg_data *cfg) +{ +if (cfg->ubwc_enc_version >=UBWC_6_0 ) +return 5 ; +if (cfg->ubwc_enc_version >=UBWC_5_0 ) +return 4 ; +if (cfg->ubwc_enc_version >=UBWC_4_3 ) +return 3 ; +if (cfg->ubwc_enc_version >=UBWC_4_0 ) +return 2 ; +if (cfg->ubwc_enc_version >=UBWC_3_0 ) +return 1 ; + +return 0 ; +} +#endif /* __QCOM_UBWC_H__ */
Signature · 1 line
2.47.3
Re: [PATCH 03/24] soc: qcom: ubwc: define helper for MDSS and Adreno drivers
Quoted 5 lines · Dmitry Baryshkov
Define special helper returning version setting for MDSS and A8xx drivers.
Signed-off-by Dmitry Baryshkov <[email protected]>---
Konrad
PATCH 4/24 drm/msm/adreno: Trust the SSoT UBWC config
In reply to Dmitry BaryshkovFrom: Konrad Dybcio <[email protected]>
Now that the highest_bank_bit value is retrieved from the running system and the global config has been part of the tree for a couple of releases, there is no reason to keep any hardcoded values inside the GPU driver.
Get rid of them.
--- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 11 ++--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 82 ++------------------------------- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 5 -- 3 files changed, 6 insertions(+), 92 deletions(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +3 -8
@@ -1727,7 +1727,6 @@ static struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)struct msm_drm_private *priv = dev->dev_private;struct platform_device *pdev = priv->gpu_pdev;struct adreno_platform_config *config = pdev->dev.platform_data; -const struct qcom_ubwc_cfg_data *common_cfg;struct a5xx_gpu *a5xx_gpu =NULL ;struct adreno_gpu *adreno_gpu;struct msm_gpu *gpu;
@@ -1765,13 +1764,9 @@ static struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)a5xx_preempt_init (gpu);/* Inherit the common config and make some necessary fixups */ - common_cfg =qcom_ubwc_config_get_data (); -if (IS_ERR (common_cfg)) -return ERR_CAST (common_cfg); - -/* Copy the data into the internal struct to drop the const qualifier (temporarily) */ - adreno_gpu->_ubwc_config = *common_cfg; - adreno_gpu->ubwc_config = &adreno_gpu->_ubwc_config; + adreno_gpu->ubwc_config =qcom_ubwc_config_get_data (); +if (IS_ERR (adreno_gpu->ubwc_config)) +return ERR_CAST (adreno_gpu->ubwc_config); adreno_gpu->uche_trap_base =0x0001ffffffff0000ull ;
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +3 -79
95 lines not on this page · raw message
drivers/gpu/drm/msm/adreno/adreno_gpu.h +0 -5
@@ -237,12 +237,7 @@ struct adreno_gpu {/* firmware: */ const struct firmware *fw[ADRENO_FW_MAX ]; -/* -* The migration to the central UBWC config db is still in flight - keep -* a copy containing some local fixups until that's done. -*/ const struct qcom_ubwc_cfg_data *ubwc_config; -struct qcom_ubwc_cfg_data _ubwc_config;/* * Register offsets are different between some GPUs.
Signature · 1 line
2.47.3
PATCH 5/24 drm/msm/adreno: use qcom_ubwc_version_tag() helper
In reply to Dmitry BaryshkovUse new helper defined to program UBWC version to the hardware.
--- drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 8 +++----- drivers/gpu/drm/msm/msm_mdss.c | 16 +--------------- 2 files changed, 4 insertions(+), 20 deletions(-)
drivers/gpu/drm/msm/adreno/a8xx_gpu.c +3 -5
@@ -272,35 +272,33 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)bool rgb565_predicator = false, amsbc = false;bool ubwc_mode =qcom_ubwc_get_ubwc_mode (cfg);u32 ubwc_version = cfg->ubwc_enc_version; -u32 hbb, hbb_hi, hbb_lo, mode =1 ; +u32 hbb, hbb_hi, hbb_lo, mode;u8 uavflagprd_inv =2 ;switch (ubwc_version) {case UBWC_6_0 : yuvnotcomptofc = true; - mode =5 ;break ;case UBWC_5_0 : amsbc = true; rgb565_predicator = true; - mode =4 ;break ;case UBWC_4_0 : amsbc = true; rgb565_predicator = true; fp16compoptdis = true; rgba8888_lossless = true; - mode =2 ;break ;case UBWC_3_0 : amsbc = true; - mode =1 ;break ;default :dev_err (&gpu->pdev->dev,"Unknown UBWC version: 0x%x\n" , ubwc_version);break ; } + mode =qcom_ubwc_version_tag (cfg); +/* * We subtract 13 from the highest bank bit (13 is the minimum value * allowed by hw) and write the lowest two bits of the remaining value
drivers/gpu/drm/msm/msm_mdss.c +1 -15
@@ -204,7 +204,7 @@ static void msm_mdss_setup_ubwc_v6(struct msm_mdss *msm_mdss)const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data;u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 ); -u32 ver, prediction_mode; +u32 prediction_mode;if (data->ubwc_bank_spread) value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ;
@@ -222,20 +222,6 @@ static void msm_mdss_setup_ubwc_v6(struct msm_mdss *msm_mdss)else prediction_mode =1 ; -if (data->ubwc_enc_version >=UBWC_6_0 ) - ver =5 ; -else if (data->ubwc_enc_version >=UBWC_5_0 ) - ver =4 ; -else if (data->ubwc_enc_version >=UBWC_4_3 ) - ver =3 ; -else if (data->ubwc_enc_version >=UBWC_4_0 ) - ver =2 ; -else if (data->ubwc_enc_version >=UBWC_3_0 ) - ver =1 ; -else /* UBWC 1.0 and 2.0 */ - ver =0 ; - -writel_relaxed (ver, msm_mdss->mmio +REG_MDSS_UBWC_CTRL_2 );writel_relaxed (prediction_mode, msm_mdss->mmio +REG_MDSS_UBWC_PREDICTION_MODE ); }
Signature · 1 line
2.47.3
PATCH 6/24 drm/msm/adreno: use new helper to set min_acc length
In reply to Dmitry BaryshkovUse freshly defined helper instead of hardcoding the checks in the driver.
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +2 -3
@@ -744,7 +744,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)u32 level2_swizzling_dis = !(cfg->ubwc_swizzle &UBWC_SWIZZLE_ENABLE_LVL2 );bool ubwc_mode =qcom_ubwc_get_ubwc_mode (cfg);bool amsbc = cfg->ubwc_enc_version >=UBWC_3_0 ; -bool min_acc_len_64b = false; +bool min_acc_len_64b;u8 uavflagprd_inv =0 ;u32 hbb_hi = hbb >>2 ;u32 hbb_lo = hbb &3 ;
@@ -752,8 +752,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)if (adreno_is_a650_family (adreno_gpu) ||adreno_is_a7xx (adreno_gpu)) uavflagprd_inv =2 ; -if (adreno_is_a610 (adreno_gpu) ||adreno_is_a702 (adreno_gpu)) - min_acc_len_64b = true; + min_acc_len_64b =qcom_ubwc_min_acc_length_64b (cfg); gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, level2_swizzling_dis << 12 |
Signature · 1 line
2.47.3
PATCH 7/24 drm/msm/mdss: use new helper to set min_acc length
In reply to Dmitry BaryshkovUse freshly defined helper instead of hardcoding the checks in the driver.
--- drivers/gpu/drm/msm/msm_mdss.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/msm_mdss.c +2 -4
@@ -172,8 +172,7 @@ static void msm_mdss_setup_ubwc_v4(struct msm_mdss *msm_mdss)u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle &0x1 ) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 ); -if (data->ubwc_enc_version ==UBWC_1_0 ) - value |=MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN (1 ); + value |=MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN (qcom_ubwc_min_acc_length_64b (data));writel_relaxed (value, msm_mdss->mmio +REG_MDSS_UBWC_STATIC ); }
@@ -193,8 +192,7 @@ static void msm_mdss_setup_ubwc_v5(struct msm_mdss *msm_mdss)if (data->ubwc_enc_version ==UBWC_3_0 ) value |=MDSS_UBWC_STATIC_UBWC_AMSBC ; -if (data->ubwc_enc_version ==UBWC_1_0 ) - value |=MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN (1 ); + value |=MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN (qcom_ubwc_min_acc_length_64b (data));writel_relaxed (value, msm_mdss->mmio +REG_MDSS_UBWC_STATIC ); }
Signature · 1 line
2.47.3
PATCH 8/24 drm/msm/adreno: use new helper to set macrotile_mode
In reply to Dmitry BaryshkovUse freshly defined helper instead of using the raw value from the database.
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -1
@@ -787,7 +787,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu) min_acc_len_64b << 23 | hbb_lo << 21);gpu_write (gpu,REG_A6XX_RBBM_NC_MODE_CNTL , - cfg->macrotile_mode); +qcom_ubwc_macrotile_mode (cfg)); }static void a7xx_patch_pwrup_reglist (struct msm_gpu *gpu)
drivers/gpu/drm/msm/adreno/adreno_gpu.c +1 -1
@@ -435,7 +435,7 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx, *value = adreno_gpu->ubwc_config->ubwc_swizzle;return 0 ;case MSM_PARAM_MACROTILE_MODE : - *value = adreno_gpu->ubwc_config->macrotile_mode; + *value =qcom_ubwc_macrotile_mode (adreno_gpu->ubwc_config);return 0 ;case MSM_PARAM_UCHE_TRAP_BASE : *value = adreno_gpu->uche_trap_base;
Signature · 1 line
2.47.3
PATCH 9/24 drm/msm/mdss: use new helper to set macrotile_mode
In reply to Dmitry BaryshkovUse freshly defined helper instead of using the raw value from the database.
--- drivers/gpu/drm/msm/msm_mdss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_mdss.c +2 -2
@@ -186,7 +186,7 @@ static void msm_mdss_setup_ubwc_v5(struct msm_mdss *msm_mdss)if (data->ubwc_bank_spread) value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ; -if (data->macrotile_mode) +if (qcom_ubwc_macrotile_mode (data)) value |=MDSS_UBWC_STATIC_MACROTILE_MODE ;if (data->ubwc_enc_version ==UBWC_3_0 )
@@ -207,7 +207,7 @@ static void msm_mdss_setup_ubwc_v6(struct msm_mdss *msm_mdss)if (data->ubwc_bank_spread) value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ; -if (data->macrotile_mode) +if (qcom_ubwc_macrotile_mode (data)) value |=MDSS_UBWC_STATIC_MACROTILE_MODE ;if (data->ubwc_enc_version ==UBWC_1_0 )
Signature · 1 line
2.47.3
PATCH 10/24 drm/msm/mdss: use new helper to set UBWC bank spreading
In reply to Dmitry BaryshkovUse freshly defined helper instead of hardcoding the checks in the driver.
--- drivers/gpu/drm/msm/msm_mdss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_mdss.c +2 -2
@@ -183,7 +183,7 @@ static void msm_mdss_setup_ubwc_v5(struct msm_mdss *msm_mdss)u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 ); -if (data->ubwc_bank_spread) +if (qcom_ubwc_bank_spread (data)) value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ;if (qcom_ubwc_macrotile_mode (data))
@@ -204,7 +204,7 @@ static void msm_mdss_setup_ubwc_v6(struct msm_mdss *msm_mdss)MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 );u32 prediction_mode; -if (data->ubwc_bank_spread) +if (qcom_ubwc_bank_spread (data)) value |=MDSS_UBWC_STATIC_UBWC_BANK_SPREAD ;if (qcom_ubwc_macrotile_mode (data))
Signature · 1 line
2.47.3
PATCH 11/24 drm/msm/adreno: use new helper to set ubwc_swizzle
In reply to Dmitry BaryshkovUse freshly defined helper instead of using the raw value from the database.
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 4 ++-- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -1
@@ -741,7 +741,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)BUG_ON (cfg->highest_bank_bit <13 );u32 hbb = cfg->highest_bank_bit -13 ;bool rgb565_predicator = cfg->ubwc_enc_version >=UBWC_4_0 ; -u32 level2_swizzling_dis = !(cfg->ubwc_swizzle &UBWC_SWIZZLE_ENABLE_LVL2 ); +u32 level2_swizzling_dis = !(qcom_ubwc_swizzle (cfg) &UBWC_SWIZZLE_ENABLE_LVL2 );bool ubwc_mode =qcom_ubwc_get_ubwc_mode (cfg);bool amsbc = cfg->ubwc_enc_version >=UBWC_3_0 ;bool min_acc_len_64b;
drivers/gpu/drm/msm/adreno/a8xx_gpu.c +2 -2
@@ -265,8 +265,8 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu) {struct adreno_gpu *adreno_gpu =to_adreno_gpu (gpu);const struct qcom_ubwc_cfg_data *cfg = adreno_gpu->ubwc_config; -u32 level2_swizzling_dis = !(cfg->ubwc_swizzle &UBWC_SWIZZLE_ENABLE_LVL2 ); -u32 level3_swizzling_dis = !(cfg->ubwc_swizzle &UBWC_SWIZZLE_ENABLE_LVL3 ); +u32 level2_swizzling_dis = !(qcom_ubwc_swizzle (cfg) &UBWC_SWIZZLE_ENABLE_LVL2 ); +u32 level3_swizzling_dis = !(qcom_ubwc_swizzle (cfg) &UBWC_SWIZZLE_ENABLE_LVL3 );bool rgba8888_lossless = false, fp16compoptdis = false;bool yuvnotcomptofc = false, min_acc_len_64b = false;bool rgb565_predicator = false, amsbc = false;
drivers/gpu/drm/msm/adreno/adreno_gpu.c +1 -1
@@ -432,7 +432,7 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx, *value = adreno_gpu->has_ray_tracing;return 0 ;case MSM_PARAM_UBWC_SWIZZLE : - *value = adreno_gpu->ubwc_config->ubwc_swizzle; + *value =qcom_ubwc_swizzle (adreno_gpu->ubwc_config);return 0 ;case MSM_PARAM_MACROTILE_MODE : *value =qcom_ubwc_macrotile_mode (adreno_gpu->ubwc_config);
Signature · 1 line
2.47.3
PATCH 12/24 drm/msm/dpu: use new helper to set ubwc_swizzle
In reply to Dmitry BaryshkovUse freshly defined helper instead of using the raw value from the database.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +4 -3
@@ -318,13 +318,14 @@ void dpu_hw_setup_format_impl(struct dpu_sw_pipe *pipe, const struct msm_formatif (ctx->ubwc->ubwc_enc_version ==UBWC_1_0 ) { fast_clear = fmt->alpha_enable ?BIT (31 ) :0 ; - ctrl_val = fast_clear | (ctx->ubwc->ubwc_swizzle &0x1 ) | + ctrl_val = fast_clear | + (qcom_ubwc_swizzle (ctx->ubwc) &UBWC_SWIZZLE_ENABLE_LVL1 ) |BIT (8 ) | (hbb <<4 ); }else if (ctx->ubwc->ubwc_enc_version ==UBWC_2_0 ) { fast_clear = fmt->alpha_enable ?BIT (31 ) :0 ; - ctrl_val = fast_clear | ctx->ubwc->ubwc_swizzle | (hbb <<4 ); + ctrl_val = fast_clear |qcom_ubwc_swizzle (ctx->ubwc) | (hbb <<4 ); }else if (ctx->ubwc->ubwc_enc_version ==UBWC_3_0 ) { - ctrl_val =BIT (30 ) | (ctx->ubwc->ubwc_swizzle) | (hbb <<4 ); + ctrl_val =BIT (30 ) |qcom_ubwc_swizzle (ctx->ubwc) | (hbb <<4 ); }else if (ctx->ubwc->ubwc_enc_version ==UBWC_4_0 ) { ctrl_val =MSM_FORMAT_IS_YUV (fmt) ?0 :BIT (30 ); }else if (ctx->ubwc->ubwc_enc_version <=UBWC_6_0 ) {
Signature · 1 line
2.47.3
PATCH 13/24 drm/msm/mdss: use new helper to set ubwc_swizzle
In reply to Dmitry BaryshkovUse freshly defined helper instead of using the raw value from the database.
--- drivers/gpu/drm/msm/msm_mdss.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/msm/msm_mdss.c +4 -3
@@ -169,7 +169,8 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss)static void msm_mdss_setup_ubwc_v4 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; -u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle &0x1 ) | +u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (qcom_ubwc_swizzle (data) & +UBWC_SWIZZLE_ENABLE_LVL1 ) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 ); value |=MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN (qcom_ubwc_min_acc_length_64b (data));
@@ -180,7 +181,7 @@ static void msm_mdss_setup_ubwc_v4(struct msm_mdss *msm_mdss)static void msm_mdss_setup_ubwc_v5 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; -u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) | +u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (qcom_ubwc_swizzle (data)) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 );if (qcom_ubwc_bank_spread (data))
@@ -200,7 +201,7 @@ static void msm_mdss_setup_ubwc_v5(struct msm_mdss *msm_mdss)static void msm_mdss_setup_ubwc_v6 (struct msm_mdss *msm_mdss) {const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data; -u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (data->ubwc_swizzle) | +u32 value =MDSS_UBWC_STATIC_UBWC_SWIZZLE (qcom_ubwc_swizzle (data)) |MDSS_UBWC_STATIC_HIGHEST_BANK_BIT (data->highest_bank_bit -13 );u32 prediction_mode;
Signature · 1 line
2.47.3
PATCH 14/24 drm/msm/dpu: drop ubwc_dec_version
In reply to Dmitry BaryshkovStop using ubwc_dec_version (the version of the UBWC block in the display subsystem) for detecting the enablement of the UBWC. Use only ubwc_enc_version, the version of the UBWC which we are setting up for.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +1 -2
@@ -1718,8 +1718,7 @@ static bool dpu_plane_format_mod_supported(struct drm_plane *plane, uint32_t format, uint64_t modifier) {struct dpu_kms *dpu_kms =_dpu_plane_get_kms (plane); -bool has_no_ubwc = (dpu_kms->mdss->ubwc_enc_version ==0 ) && - (dpu_kms->mdss->ubwc_dec_version ==0 ); +bool has_no_ubwc = (dpu_kms->mdss->ubwc_enc_version ==0 );if (modifier ==DRM_FORMAT_MOD_LINEAR )return true;
Signature · 1 line
2.47.3
PATCH 15/24 drm/msm/adreno: adapt for UBWC 3.1 support
In reply to Dmitry BaryshkovExtend the driver to handle UBWC 3.1 (in the same way as we handle UBWC 3.0).
--- drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/adreno/a8xx_gpu.c +1 -0
@@ -289,6 +289,7 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu) fp16compoptdis = true; rgba8888_lossless = true;break ; +case UBWC_3_1 :case UBWC_3_0 : amsbc = true;break ;
Signature · 1 line
2.47.3
PATCH 16/24 drm/msm/mdss: adapt for UBWC 3.1 support
In reply to Dmitry BaryshkovExtend the driver to handle UBWC 3.1 (in the same way as we handle UBWC 3.0).
--- drivers/gpu/drm/msm/msm_mdss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/msm_mdss.c +2 -1
@@ -190,7 +190,8 @@ static void msm_mdss_setup_ubwc_v5(struct msm_mdss *msm_mdss)if (qcom_ubwc_macrotile_mode (data)) value |=MDSS_UBWC_STATIC_MACROTILE_MODE ; -if (data->ubwc_enc_version ==UBWC_3_0 ) +if (data->ubwc_enc_version ==UBWC_3_0 || + data->ubwc_enc_version ==UBWC_3_1 ) value |=MDSS_UBWC_STATIC_UBWC_AMSBC ; value |=MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN (qcom_ubwc_min_acc_length_64b (data));
Signature · 1 line
2.47.3
PATCH 17/24 drm/msm/dpu: adapt for UBWC 3.1 support
In reply to Dmitry BaryshkovExtend the driver to handle UBWC 3.1 (in the same way as we handle UBWC 3.0).
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +2 -1
@@ -324,7 +324,8 @@ void dpu_hw_setup_format_impl(struct dpu_sw_pipe *pipe, const struct msm_format }else if (ctx->ubwc->ubwc_enc_version ==UBWC_2_0 ) { fast_clear = fmt->alpha_enable ?BIT (31 ) :0 ; ctrl_val = fast_clear |qcom_ubwc_swizzle (ctx->ubwc) | (hbb <<4 ); - }else if (ctx->ubwc->ubwc_enc_version ==UBWC_3_0 ) { + }else if (ctx->ubwc->ubwc_enc_version ==UBWC_3_0 || + ctx->ubwc->ubwc_enc_version ==UBWC_3_1 ) { ctrl_val =BIT (30 ) |qcom_ubwc_swizzle (ctx->ubwc) | (hbb <<4 ); }else if (ctx->ubwc->ubwc_enc_version ==UBWC_4_0 ) { ctrl_val =MSM_FORMAT_IS_YUV (fmt) ?0 :BIT (30 );
Signature · 1 line
2.47.3
PATCH 18/24 soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets
In reply to Dmitry BaryshkovAccording to the documentation, the MAL should be set for all UBWC 1.0 targets, no matter what is the version of the UBWC decoders are present on the device. The helper comes from DPU / GPU world, where there was no separate bit to control MAL before UBWC 2.0. As the helper is now being used by other drivers too, correct the helper to return the correct MAL value (Iris doesn't support UBWC 1.0 devices for now, so there is no changes of the behaviour).
--- include/linux/soc/qcom/ubwc.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
include/linux/soc/qcom/ubwc.h +1 -3
@@ -80,9 +80,7 @@ static inline bool qcom_ubwc_get_ubwc_mode(const struct qcom_ubwc_cfg_data *cfg)*/ static inline bool qcom_ubwc_min_acc_length_64b (const struct qcom_ubwc_cfg_data *cfg) { -return cfg->ubwc_enc_version ==UBWC_1_0 && - (cfg->ubwc_dec_version ==UBWC_2_0 || - cfg->ubwc_dec_version ==UBWC_3_0 ); +return cfg->ubwc_enc_version ==UBWC_1_0 ; }static inline bool qcom_ubwc_macrotile_mode (const struct qcom_ubwc_cfg_data *cfg)
Signature · 1 line
2.47.3
PATCH 19/24 soc: qcom: ubwc: drop ubwc_dec_version
In reply to Dmitry BaryshkovThe ubwc_dec_version field has been inherited from the MDSS driver and it is equal to the version of the UBWC decoder in the display block only. Other IP Cores can have different UBWC decoders and so the version would vary between blocks.
As the value is no longer used as is not relevant to other UBWC database consumers, drop it from the UBWC database.
--- drivers/soc/qcom/ubwc_config.c | 22 ---------------------- include/linux/soc/qcom/ubwc.h | 2 -- 2 files changed, 24 deletions(-)
drivers/soc/qcom/ubwc_config.c +0 -22
@@ -18,7 +18,6 @@ static const struct qcom_ubwc_cfg_data no_ubwc_data = {static const struct qcom_ubwc_cfg_data kaanapali_data = { .ubwc_enc_version =UBWC_6_0 , - .ubwc_dec_version =UBWC_6_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true,
@@ -28,7 +27,6 @@ static const struct qcom_ubwc_cfg_data kaanapali_data = {static const struct qcom_ubwc_cfg_data msm8937_data = { .ubwc_enc_version =UBWC_1_0 , - .ubwc_dec_version =UBWC_1_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL1 |UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 ,
@@ -37,7 +35,6 @@ static const struct qcom_ubwc_cfg_data msm8937_data = {static const struct qcom_ubwc_cfg_data msm8998_data = { .ubwc_enc_version =UBWC_1_0 , - .ubwc_dec_version =UBWC_1_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL1 |UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 ,
@@ -51,7 +48,6 @@ static const struct qcom_ubwc_cfg_data qcm2290_data = {static const struct qcom_ubwc_cfg_data sa8775p_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_dec_version =UBWC_4_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true, .highest_bank_bit =13 ,
@@ -60,7 +56,6 @@ static const struct qcom_ubwc_cfg_data sa8775p_data = {static const struct qcom_ubwc_cfg_data sar2130p_data = { .ubwc_enc_version =UBWC_3_0 ,/* 4.0.2 in hw */ - .ubwc_dec_version =UBWC_4_3 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true,
@@ -70,7 +65,6 @@ static const struct qcom_ubwc_cfg_data sar2130p_data = {static const struct qcom_ubwc_cfg_data sc7180_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_dec_version =UBWC_2_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true,
@@ -79,7 +73,6 @@ static const struct qcom_ubwc_cfg_data sc7180_data = {static const struct qcom_ubwc_cfg_data sc7280_data = { .ubwc_enc_version =UBWC_3_0 , - .ubwc_dec_version =UBWC_4_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true,
@@ -89,7 +82,6 @@ static const struct qcom_ubwc_cfg_data sc7280_data = {static const struct qcom_ubwc_cfg_data sc8180x_data = { .ubwc_enc_version =UBWC_3_0 , - .ubwc_dec_version =UBWC_3_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =16 ,
@@ -98,7 +90,6 @@ static const struct qcom_ubwc_cfg_data sc8180x_data = {static const struct qcom_ubwc_cfg_data sc8280xp_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_dec_version =UBWC_4_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true,
@@ -108,7 +99,6 @@ static const struct qcom_ubwc_cfg_data sc8280xp_data = {static const struct qcom_ubwc_cfg_data sdm670_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_dec_version =UBWC_2_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 ,
@@ -116,7 +106,6 @@ static const struct qcom_ubwc_cfg_data sdm670_data = {static const struct qcom_ubwc_cfg_data sdm845_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_dec_version =UBWC_2_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =15 ,
@@ -124,7 +113,6 @@ static const struct qcom_ubwc_cfg_data sdm845_data = {static const struct qcom_ubwc_cfg_data sm6115_data = { .ubwc_enc_version =UBWC_1_0 , - .ubwc_dec_version =UBWC_2_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL1 |UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 ,
@@ -134,7 +122,6 @@ static const struct qcom_ubwc_cfg_data sm6115_data = {static const struct qcom_ubwc_cfg_data sm6125_data = { .ubwc_enc_version =UBWC_1_0 , - .ubwc_dec_version =UBWC_3_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL1 |UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 ,
@@ -143,7 +130,6 @@ static const struct qcom_ubwc_cfg_data sm6125_data = {static const struct qcom_ubwc_cfg_data sm6150_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_dec_version =UBWC_2_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 ,
@@ -151,7 +137,6 @@ static const struct qcom_ubwc_cfg_data sm6150_data = {static const struct qcom_ubwc_cfg_data sm6350_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_dec_version =UBWC_2_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true,
@@ -160,7 +145,6 @@ static const struct qcom_ubwc_cfg_data sm6350_data = {static const struct qcom_ubwc_cfg_data sm7150_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_dec_version =UBWC_2_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 ,
@@ -168,7 +152,6 @@ static const struct qcom_ubwc_cfg_data sm7150_data = {static const struct qcom_ubwc_cfg_data sm8150_data = { .ubwc_enc_version =UBWC_3_0 , - .ubwc_dec_version =UBWC_3_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =15 ,
@@ -176,7 +159,6 @@ static const struct qcom_ubwc_cfg_data sm8150_data = {static const struct qcom_ubwc_cfg_data sm8250_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_dec_version =UBWC_4_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true,
@@ -187,7 +169,6 @@ static const struct qcom_ubwc_cfg_data sm8250_data = {static const struct qcom_ubwc_cfg_data sm8350_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_dec_version =UBWC_4_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true,
@@ -198,7 +179,6 @@ static const struct qcom_ubwc_cfg_data sm8350_data = {static const struct qcom_ubwc_cfg_data sm8550_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_dec_version =UBWC_4_3 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .ubwc_bank_spread = true,
@@ -209,7 +189,6 @@ static const struct qcom_ubwc_cfg_data sm8550_data = {static const struct qcom_ubwc_cfg_data sm8750_data = { .ubwc_enc_version =UBWC_5_0 , - .ubwc_dec_version =UBWC_5_0 , .ubwc_swizzle =6 , .ubwc_bank_spread = true,/* TODO: highest_bank_bit = 15 for LP_DDR4 */
@@ -219,7 +198,6 @@ static const struct qcom_ubwc_cfg_data sm8750_data = {static const struct qcom_ubwc_cfg_data glymur_data = { .ubwc_enc_version =UBWC_5_0 , - .ubwc_dec_version =UBWC_5_0 , .ubwc_swizzle =0 , .ubwc_bank_spread = true,/* TODO: highest_bank_bit = 15 for LP_DDR4 */
include/linux/soc/qcom/ubwc.h +0 -2
@@ -13,8 +13,6 @@struct qcom_ubwc_cfg_data {u32 ubwc_enc_version; -/* Can be read from MDSS_BASE + 0x58 */ -u32 ubwc_dec_version;/** * @ubwc_swizzle: Whether to enable level 1, 2 & 3 bank swizzling.
Signature · 1 line
2.47.3
Re: [PATCH 19/24] soc: qcom: ubwc: drop ubwc_dec_version
Quoted 10 lines · Dmitry Baryshkov
The
ubwc_dec_versionfield has been inherited from the MDSS driver and it is equal to the version of the UBWC decoder in the display block only. Other IP Cores can have different UBWC decoders and so the version would vary between blocks.As the value is no longer used as is not relevant to other UBWC database consumers, drop it from the UBWC database.
Signed-off-by Dmitry Baryshkov <[email protected]>---
will we need a more complete list here (i.e. block-denominated) in the future?
Konrad
Re: [PATCH 19/24] soc: qcom: ubwc: drop ubwc_dec_version
Quoted 9 lines · Konrad Dybcio
Quoted 8 lines · Dmitry Baryshkov
The
ubwc_dec_versionfield has been inherited from the MDSS driver and it is equal to the version of the UBWC decoder in the display block only. Other IP Cores can have different UBWC decoders and so the version would vary between blocks.As the value is no longer used as is not relevant to other UBWC database consumers, drop it from the UBWC database.
Quoted 7 lines
Quoted 2 lines
Signed-off-by Dmitry Baryshkov <[email protected]>---
Reviewed-by Konrad Dybcio <[email protected]>will we need a more complete list here (i.e. block-denominated) in the future?
I hope not, let's use a single UBWC data for all the devices on the platform.
Quoted 2 lines
Konrad
Signature · 2 lines
With best wishes Dmitry
PATCH 20/24 soc: qcom: ubwc: drop ubwc_bank_spread
In reply to Dmitry BaryshkovAccording to the documentation, UBWC bank spreading should be enabled for all targets. It's just not all targets have separate bit to control it. Drop the bit from the database and make the helper always return true. If we need to change it later, the helper can be adjusted according to the programming guides.
--- drivers/soc/qcom/ubwc_config.c | 13 ------------- include/linux/soc/qcom/ubwc.h | 3 +-- 2 files changed, 1 insertion(+), 15 deletions(-)
drivers/soc/qcom/ubwc_config.c +0 -13
@@ -20,7 +20,6 @@ static const struct qcom_ubwc_cfg_data kaanapali_data = { .ubwc_enc_version = UBWC_6_0, .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true, .highest_bank_bit = 16, .macrotile_mode = true, };
@@ -49,7 +48,6 @@ static const struct qcom_ubwc_cfg_data qcm2290_data = {static const struct qcom_ubwc_cfg_data sa8775p_data = { .ubwc_enc_version =UBWC_4_0 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL3 , - .ubwc_bank_spread = true, .highest_bank_bit =13 , .macrotile_mode = true, };
@@ -58,7 +56,6 @@ static const struct qcom_ubwc_cfg_data sar2130p_data = { .ubwc_enc_version = UBWC_3_0, /* 4.0.2 in hw */ .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true, .highest_bank_bit = 13, .macrotile_mode = true, };
@@ -67,7 +64,6 @@ static const struct qcom_ubwc_cfg_data sc7180_data = { .ubwc_enc_version = UBWC_2_0, .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true, .highest_bank_bit = 14, };
@@ -75,7 +71,6 @@ static const struct qcom_ubwc_cfg_data sc7280_data = { .ubwc_enc_version = UBWC_3_0, .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true, .highest_bank_bit = 14, .macrotile_mode = true, };
@@ -92,7 +87,6 @@ static const struct qcom_ubwc_cfg_data sc8280xp_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true, .highest_bank_bit = 16, .macrotile_mode = true, };
@@ -116,7 +110,6 @@ static const struct qcom_ubwc_cfg_data sm6115_data = { .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 | UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true, .highest_bank_bit = 14, };
@@ -139,7 +132,6 @@ static const struct qcom_ubwc_cfg_data sm6350_data = { .ubwc_enc_version = UBWC_2_0, .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true, .highest_bank_bit = 14, };
@@ -161,7 +153,6 @@ static const struct qcom_ubwc_cfg_data sm8250_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit = 16, .macrotile_mode = true,
@@ -171,7 +162,6 @@ static const struct qcom_ubwc_cfg_data sm8350_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit = 16, .macrotile_mode = true,
@@ -181,7 +171,6 @@ static const struct qcom_ubwc_cfg_data sm8550_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, - .ubwc_bank_spread = true,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit = 16, .macrotile_mode = true,
@@ -190,7 +179,6 @@ static const struct qcom_ubwc_cfg_data sm8550_data = {static const struct qcom_ubwc_cfg_data sm8750_data = { .ubwc_enc_version =UBWC_5_0 , .ubwc_swizzle =6 , - .ubwc_bank_spread = true,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit =16 , .macrotile_mode = true,
@@ -199,7 +187,6 @@ static const struct qcom_ubwc_cfg_data sm8750_data = {static const struct qcom_ubwc_cfg_data glymur_data = { .ubwc_enc_version =UBWC_5_0 , .ubwc_swizzle =0 , - .ubwc_bank_spread = true,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit =16 , .macrotile_mode = true,
include/linux/soc/qcom/ubwc.h +1 -2
@@ -33,7 +33,6 @@ struct qcom_ubwc_cfg_data {* DDR bank. This should ideally use DRAM type detection. */ int highest_bank_bit; -bool ubwc_bank_spread;/** * @macrotile_mode: Macrotile Mode
@@ -88,7 +87,7 @@ static inline bool qcom_ubwc_macrotile_mode(const struct qcom_ubwc_cfg_data *cfgstatic inline bool qcom_ubwc_bank_spread (const struct qcom_ubwc_cfg_data *cfg) { -return cfg->ubwc_bank_spread; +return true; }static inline u32 qcom_ubwc_swizzle (const struct qcom_ubwc_cfg_data *cfg)
Signature · 1 line
2.47.3
Re: [PATCH 20/24] soc: qcom: ubwc: drop ubwc_bank_spread
Quoted 8 lines · Dmitry Baryshkov
According to the documentation, UBWC bank spreading should be enabled for all targets. It's just not all targets have separate bit to control it. Drop the bit from the database and make the helper always return true. If we need to change it later, the helper can be adjusted according to the programming guides.
Signed-off-by Dmitry Baryshkov <[email protected]>---
Konrad
PATCH 21/24 soc: qcom: ubwc: drop macrotile_mode from the database
In reply to Dmitry BaryshkovAll 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).
--- drivers/soc/qcom/ubwc_config.c | 15 ++------------- include/linux/soc/qcom/ubwc.h | 18 ++++++++---------- 2 files changed, 10 insertions(+), 23 deletions(-)
drivers/soc/qcom/ubwc_config.c +2 -13
@@ -21,7 +21,6 @@ static const struct qcom_ubwc_cfg_data kaanapali_data = { .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit = 16, - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data msm8937_data = {
@@ -49,15 +48,13 @@ static const struct qcom_ubwc_cfg_data sa8775p_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit = 13, - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data sar2130p_data = { - .ubwc_enc_version =UBWC_3_0 ,/* 4.0.2 in hw */ + .ubwc_enc_version =UBWC_3_1 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =13 , - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data sc7180_data = {
@@ -68,11 +65,10 @@ static const struct qcom_ubwc_cfg_data sc7180_data = { };static const struct qcom_ubwc_cfg_data sc7280_data = { - .ubwc_enc_version =UBWC_3_0 , + .ubwc_enc_version =UBWC_3_1 , .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data sc8180x_data = {
@@ -80,7 +76,6 @@ static const struct qcom_ubwc_cfg_data sc8180x_data = { .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit = 16, - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data sc8280xp_data = {
@@ -88,7 +83,6 @@ static const struct qcom_ubwc_cfg_data sc8280xp_data = { .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3, .highest_bank_bit = 16, - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data sdm670_data = {
@@ -155,7 +149,6 @@ static const struct qcom_ubwc_cfg_data sm8250_data = { UBWC_SWIZZLE_ENABLE_LVL3,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit = 16, - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data sm8350_data = {
@@ -164,7 +157,6 @@ static const struct qcom_ubwc_cfg_data sm8350_data = { UBWC_SWIZZLE_ENABLE_LVL3,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit = 16, - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data sm8550_data = {
@@ -173,7 +165,6 @@ static const struct qcom_ubwc_cfg_data sm8550_data = { UBWC_SWIZZLE_ENABLE_LVL3,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit = 16, - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data sm8750_data = {
@@ -181,7 +172,6 @@ static const struct qcom_ubwc_cfg_data sm8750_data = { .ubwc_swizzle = 6, /* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit = 16, - .macrotile_mode = true, };static const struct qcom_ubwc_cfg_data glymur_data = {
@@ -189,7 +179,6 @@ static const struct qcom_ubwc_cfg_data glymur_data = { .ubwc_swizzle = 0, /* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit = 16, - .macrotile_mode = true, };static const struct of_device_id qcom_ubwc_configs[]__maybe_unused = {
include/linux/soc/qcom/ubwc.h +8 -10
@@ -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; };#define UBWC_1_0 0x10000000
@@ -80,9 +71,16 @@ static inline bool qcom_ubwc_min_acc_length_64b(const struct qcom_ubwc_cfg_datareturn cfg->ubwc_enc_version ==UBWC_1_0 ; } +/* +* @qcom_ubwc_macrotile_mode: whether to use 4-channel or 8-channel macrotiling +* +* 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_data *cfg) { -return cfg->macrotile_mode; +return cfg->ubwc_enc_version >=UBWC_3_1 ; }static inline bool qcom_ubwc_bank_spread (const struct qcom_ubwc_cfg_data *cfg)
Signature · 1 line
2.47.3
PATCH 22/24 soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0
In reply to Dmitry BaryshkovUBWC devices before 4.0 use standard UBWC swizzle levels. As all the drivers now use the qcom_ubwc_swizzle() helper, move those values to the helper, leaving UBWC 4.0+ intact for now.
--- drivers/soc/qcom/ubwc_config.c | 34 ---------------------------------- include/linux/soc/qcom/ubwc.h | 33 ++++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 43 deletions(-)
drivers/soc/qcom/ubwc_config.c +0 -34
@@ -25,17 +25,11 @@ static const struct qcom_ubwc_cfg_data kaanapali_data = {static const struct qcom_ubwc_cfg_data msm8937_data = { .ubwc_enc_version =UBWC_1_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL1 | -UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , };static const struct qcom_ubwc_cfg_data msm8998_data = { .ubwc_enc_version =UBWC_1_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL1 | -UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =15 , };
@@ -52,94 +46,66 @@ static const struct qcom_ubwc_cfg_data sa8775p_data = {static const struct qcom_ubwc_cfg_data sar2130p_data = { .ubwc_enc_version =UBWC_3_1 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =13 , };static const struct qcom_ubwc_cfg_data sc7180_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , };static const struct qcom_ubwc_cfg_data sc7280_data = { .ubwc_enc_version =UBWC_3_1 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , };static const struct qcom_ubwc_cfg_data sc8180x_data = { .ubwc_enc_version =UBWC_3_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =16 , };static const struct qcom_ubwc_cfg_data sc8280xp_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =16 , };static const struct qcom_ubwc_cfg_data sdm670_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , };static const struct qcom_ubwc_cfg_data sdm845_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =15 , };static const struct qcom_ubwc_cfg_data sm6115_data = { .ubwc_enc_version =UBWC_1_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL1 | -UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , };static const struct qcom_ubwc_cfg_data sm6125_data = { .ubwc_enc_version =UBWC_1_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL1 | -UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , };static const struct qcom_ubwc_cfg_data sm6150_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , };static const struct qcom_ubwc_cfg_data sm6350_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , };static const struct qcom_ubwc_cfg_data sm7150_data = { .ubwc_enc_version =UBWC_2_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =14 , };static const struct qcom_ubwc_cfg_data sm8150_data = { .ubwc_enc_version =UBWC_3_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =15 , };
include/linux/soc/qcom/ubwc.h +24 -9
@@ -22,9 +22,6 @@ struct qcom_ubwc_cfg_data {* UBWC 4.0 adds the optional ability to disable levels 2 & 3. */ u32 ubwc_swizzle; -#define UBWC_SWIZZLE_ENABLE_LVL1 BIT(0) -#define UBWC_SWIZZLE_ENABLE_LVL2 BIT(1) -#define UBWC_SWIZZLE_ENABLE_LVL3 BIT(2)/** * @highest_bank_bit: Highest Bank Bit
@@ -55,12 +52,7 @@ static inline 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 &UBWC_SWIZZLE_ENABLE_LVL1 )) -pr_err ("UBWC config discrepancy - level 1 swizzling disabled on UBWC 1.0\n" ); - -return ret; +return cfg->ubwc_enc_version ==UBWC_1_0 ; }/*
@@ -88,8 +80,31 @@ static inline bool qcom_ubwc_bank_spread(const struct qcom_ubwc_cfg_data *cfg)return true; } +#define UBWC_SWIZZLE_ENABLE_LVL1 BIT(0) +#define UBWC_SWIZZLE_ENABLE_LVL2 BIT(1) +#define UBWC_SWIZZLE_ENABLE_LVL3 BIT(2) + +/** +* @qcom_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. +*/ static inline u32 qcom_ubwc_swizzle (const struct qcom_ubwc_cfg_data *cfg) { +if (cfg->ubwc_enc_version ==0 ) +return 0 ; + +if (cfg->ubwc_enc_version ==UBWC_1_0 ) +return UBWC_SWIZZLE_ENABLE_LVL1 | +UBWC_SWIZZLE_ENABLE_LVL2 | +UBWC_SWIZZLE_ENABLE_LVL3 ; + +if (cfg->ubwc_enc_version <UBWC_4_0 ) +return UBWC_SWIZZLE_ENABLE_LVL2 | +UBWC_SWIZZLE_ENABLE_LVL3 ; +return cfg->ubwc_swizzle; }
Signature · 1 line
2.47.3
Re: [PATCH 22/24] soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0
Quoted 6 lines · Dmitry Baryshkov
UBWC devices before 4.0 use standard UBWC swizzle levels. As all the drivers now use the
qcom_ubwc_swizzle()helper, move those values to the helper, leaving UBWC 4.0+ intact for now.Signed-off-by Dmitry Baryshkov <[email protected]>---
Konrad
PATCH 23/24 soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings
In reply to Dmitry BaryshkovSort out the remaining UBWC swizzle values, using flags to control whether level 2 and level 3 swizzling are enabled or not.
--- drivers/soc/qcom/ubwc_config.c | 14 +++----------- include/linux/soc/qcom/ubwc.h | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 24 deletions(-)
drivers/soc/qcom/ubwc_config.c +3 -11
@@ -18,8 +18,6 @@ static const struct qcom_ubwc_cfg_data no_ubwc_data = {static const struct qcom_ubwc_cfg_data kaanapali_data = { .ubwc_enc_version =UBWC_6_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 , .highest_bank_bit =16 , };
@@ -40,7 +38,7 @@ static const struct qcom_ubwc_cfg_data qcm2290_data = {static const struct qcom_ubwc_cfg_data sa8775p_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL3 , + .flags =UBWC_FLAG_DISABLE_SWIZZLE_LVL2 , .highest_bank_bit =13 , };
@@ -111,38 +109,32 @@ static const struct qcom_ubwc_cfg_data sm8150_data = {static const struct qcom_ubwc_cfg_data sm8250_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 ,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit =16 , };static const struct qcom_ubwc_cfg_data sm8350_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 ,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit =16 , };static const struct qcom_ubwc_cfg_data sm8550_data = { .ubwc_enc_version =UBWC_4_0 , - .ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 ,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit =16 , };static const struct qcom_ubwc_cfg_data sm8750_data = { .ubwc_enc_version =UBWC_5_0 , - .ubwc_swizzle =6 ,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit =16 , };static const struct qcom_ubwc_cfg_data glymur_data = { .ubwc_enc_version =UBWC_5_0 , - .ubwc_swizzle =0 , + .flags =UBWC_FLAG_DISABLE_SWIZZLE_LVL2 | +UBWC_FLAG_DISABLE_SWIZZLE_LVL3 ,/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit =16 , };
include/linux/soc/qcom/ubwc.h +13 -13
@@ -14,15 +14,6 @@struct qcom_ubwc_cfg_data {u32 ubwc_enc_version; -/** -* @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) };#define UBWC_1_0 0x10000000
@@ -101,11 +96,16 @@ static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg)UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 ; -if (cfg->ubwc_enc_version <UBWC_4_0 ) -return UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 ; +u32 ubwc_swizzle =UBWC_SWIZZLE_ENABLE_LVL2 | +UBWC_SWIZZLE_ENABLE_LVL3 ; + +if (cfg->flags &UBWC_FLAG_DISABLE_SWIZZLE_LVL2 ) + ubwc_swizzle &= ~UBWC_SWIZZLE_ENABLE_LVL2 ; + +if (cfg->flags &UBWC_FLAG_DISABLE_SWIZZLE_LVL3 ) + ubwc_swizzle &= ~UBWC_SWIZZLE_ENABLE_LVL3 ; -return cfg->ubwc_swizzle; +return ubwc_swizzle; }static inline u32 qcom_ubwc_version_tag (const struct qcom_ubwc_cfg_data *cfg)
Signature · 1 line
2.47.3
Re: [PATCH 23/24] soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings
Quoted 5 lines · Dmitry Baryshkov
Sort out the remaining UBWC swizzle values, using flags to control whether level 2 and level 3 swizzling are enabled or not.
Signed-off-by Dmitry Baryshkov <[email protected]>---
[...]
Quoted 8 lines
include/linux/soc/qcom/ubwc.h +1
-3@@ -101,11 +96,16 @@ static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg)UBWC_SWIZZLE_ENABLE_LVL2 |UBWC_SWIZZLE_ENABLE_LVL3 ; -if (cfg->ubwc_enc_version <UBWC_4_0 ) -return UBWC_SWIZZLE_ENABLE_LVL2 | -UBWC_SWIZZLE_ENABLE_LVL3 ; + u32 ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
include/linux/soc/qcom/ubwc.h static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg) · line 108
Quoted 10 lines
include/linux/soc/qcom/ubwc.h +8
-1+UBWC_SWIZZLE_ENABLE_LVL3 ; + +if (cfg->flags &UBWC_FLAG_DISABLE_SWIZZLE_LVL2 ) + ubwc_swizzle &= ~UBWC_SWIZZLE_ENABLE_LVL2 ; + +if (cfg->flags &UBWC_FLAG_DISABLE_SWIZZLE_LVL3 ) + ubwc_swizzle &= ~UBWC_SWIZZLE_ENABLE_LVL3 ; -return cfg->ubwc_swizzle; +return ubwc_swizzle;
This is a little messy, but so is the valid configuration matrix..
Konrad
PATCH 24/24 soc: qcom: ubwc: deduplicate UBWC configuration data
In reply to Dmitry BaryshkovAfter removing all extra entries from the UBWC database it is easy to define generic entries, common for all machine classes.
--- drivers/soc/qcom/ubwc_config.c | 189 +++++++++++++++-------------------------- 1 file changed, 70 insertions(+), 119 deletions(-)
drivers/soc/qcom/ubwc_config.c +70 -119
@@ -16,119 +16,70 @@ static const struct qcom_ubwc_cfg_data no_ubwc_data = {/* no UBWC, no HBB */ }; -static const struct qcom_ubwc_cfg_data kaanapali_data = { - .ubwc_enc_version =UBWC_6_0 , - .highest_bank_bit =16 , +static const struct qcom_ubwc_cfg_data ubwc_0_0_hbb15 = { +/* no UBWC */ + .highest_bank_bit =15 , }; -static const struct qcom_ubwc_cfg_data msm8937_data = { +static const struct qcom_ubwc_cfg_data ubwc_1_0_hbb14 = { .ubwc_enc_version =UBWC_1_0 , .highest_bank_bit =14 , }; -static const struct qcom_ubwc_cfg_data msm8998_data = { +static const struct qcom_ubwc_cfg_data ubwc_1_0_hbb15 = { .ubwc_enc_version =UBWC_1_0 , .highest_bank_bit =15 , }; -static const struct qcom_ubwc_cfg_data qcm2290_data = { -/* no UBWC */ - .highest_bank_bit =15 , -}; - -static const struct qcom_ubwc_cfg_data sa8775p_data = { - .ubwc_enc_version =UBWC_4_0 , - .flags =UBWC_FLAG_DISABLE_SWIZZLE_LVL2 , - .highest_bank_bit =13 , -}; - -static const struct qcom_ubwc_cfg_data sar2130p_data = { - .ubwc_enc_version =UBWC_3_1 , - .highest_bank_bit =13 , -}; - -static const struct qcom_ubwc_cfg_data sc7180_data = { +static const struct qcom_ubwc_cfg_data ubwc_2_0_hbb14 = { .ubwc_enc_version =UBWC_2_0 , .highest_bank_bit =14 , }; -static const struct qcom_ubwc_cfg_data sc7280_data = { - .ubwc_enc_version =UBWC_3_1 , - .highest_bank_bit =14 , -}; - -static const struct qcom_ubwc_cfg_data sc8180x_data = { - .ubwc_enc_version =UBWC_3_0 , - .highest_bank_bit =16 , -}; - -static const struct qcom_ubwc_cfg_data sc8280xp_data = { - .ubwc_enc_version =UBWC_4_0 , - .highest_bank_bit =16 , -}; - -static const struct qcom_ubwc_cfg_data sdm670_data = { - .ubwc_enc_version =UBWC_2_0 , - .highest_bank_bit =14 , -}; - -static const struct qcom_ubwc_cfg_data sdm845_data = { +static const struct qcom_ubwc_cfg_data ubwc_2_0_hbb15 = { .ubwc_enc_version =UBWC_2_0 , .highest_bank_bit =15 , }; -static const struct qcom_ubwc_cfg_data sm6115_data = { - .ubwc_enc_version =UBWC_1_0 , - .highest_bank_bit =14 , -}; - -static const struct qcom_ubwc_cfg_data sm6125_data = { - .ubwc_enc_version =UBWC_1_0 , - .highest_bank_bit =14 , +static const struct qcom_ubwc_cfg_data ubwc_3_0_hbb15 = { + .ubwc_enc_version =UBWC_3_0 , + .highest_bank_bit =15 , }; -static const struct qcom_ubwc_cfg_data sm6150_data = { - .ubwc_enc_version =UBWC_2_0 , - .highest_bank_bit =14 , +static const struct qcom_ubwc_cfg_data ubwc_3_0_hbb16 = { + .ubwc_enc_version =UBWC_3_0 , + .highest_bank_bit =16 , }; -static const struct qcom_ubwc_cfg_data sm6350_data = { - .ubwc_enc_version =UBWC_2_0 , - .highest_bank_bit =14 , +static const struct qcom_ubwc_cfg_data ubwc_3_1_hbb13 = { + .ubwc_enc_version =UBWC_3_1 , + .highest_bank_bit =13 , }; -static const struct qcom_ubwc_cfg_data sm7150_data = { - .ubwc_enc_version =UBWC_2_0 , +static const struct qcom_ubwc_cfg_data ubwc_3_1_hbb14 = { + .ubwc_enc_version =UBWC_3_1 , .highest_bank_bit =14 , }; -static const struct qcom_ubwc_cfg_data sm8150_data = { - .ubwc_enc_version =UBWC_3_0 , - .highest_bank_bit =15 , -}; - -static const struct qcom_ubwc_cfg_data sm8250_data = { +static const struct qcom_ubwc_cfg_data ubwc_4_0_hbb16 = { .ubwc_enc_version =UBWC_4_0 , -/* TODO: highest_bank_bit = 15 for LP_DDR4 */ .highest_bank_bit =16 , }; -static const struct qcom_ubwc_cfg_data sm8350_data = { - .ubwc_enc_version =UBWC_4_0 , -/* TODO: highest_bank_bit = 15 for LP_DDR4 */ +static const struct qcom_ubwc_cfg_data ubwc_5_0_hbb16 = { + .ubwc_enc_version =UBWC_5_0 , .highest_bank_bit =16 , }; -static const struct qcom_ubwc_cfg_data sm8550_data = { - .ubwc_enc_version =UBWC_4_0 , -/* TODO: highest_bank_bit = 15 for LP_DDR4 */ +static const struct qcom_ubwc_cfg_data ubwc_6_0_hbb16 = { + .ubwc_enc_version =UBWC_6_0 , .highest_bank_bit =16 , }; -static const struct qcom_ubwc_cfg_data sm8750_data = { - .ubwc_enc_version =UBWC_5_0 , -/* TODO: highest_bank_bit = 15 for LP_DDR4 */ - .highest_bank_bit =16 , +static const struct qcom_ubwc_cfg_data sa8775p_data = { + .ubwc_enc_version =UBWC_4_0 , + .flags =UBWC_FLAG_DISABLE_SWIZZLE_LVL2 , + .highest_bank_bit =13 , };static const struct qcom_ubwc_cfg_data glymur_data = {
@@ -143,59 +94,59 @@ static const struct of_device_id qcom_ubwc_configs[] __maybe_unused = { { .compatible = "qcom,apq8016", .data = &no_ubwc_data }, { .compatible = "qcom,apq8026", .data = &no_ubwc_data }, { .compatible = "qcom,apq8074", .data = &no_ubwc_data }, - { .compatible = "qcom,apq8096", .data = &msm8998_data }, - { .compatible = "qcom,kaanapali", .data = &kaanapali_data, }, + { .compatible = "qcom,apq8096", .data = &ubwc_1_0_hbb15 }, + { .compatible = "qcom,kaanapali", .data = &ubwc_6_0_hbb16 }, { .compatible = "qcom,glymur", .data = &glymur_data}, { .compatible = "qcom,msm8226", .data = &no_ubwc_data }, { .compatible = "qcom,msm8916", .data = &no_ubwc_data }, { .compatible = "qcom,msm8917", .data = &no_ubwc_data }, - { .compatible = "qcom,msm8937", .data = &msm8937_data }, + { .compatible = "qcom,msm8937", .data = &ubwc_1_0_hbb14 }, { .compatible = "qcom,msm8929", .data = &no_ubwc_data }, { .compatible = "qcom,msm8939", .data = &no_ubwc_data }, - { .compatible = "qcom,msm8953", .data = &msm8937_data }, + { .compatible = "qcom,msm8953", .data = &ubwc_1_0_hbb14 }, { .compatible = "qcom,msm8956", .data = &no_ubwc_data }, { .compatible = "qcom,msm8974", .data = &no_ubwc_data }, { .compatible = "qcom,msm8976", .data = &no_ubwc_data }, - { .compatible = "qcom,msm8996", .data = &msm8998_data }, - { .compatible = "qcom,msm8998", .data = &msm8998_data }, - { .compatible = "qcom,qcm2290", .data = &qcm2290_data, }, - { .compatible = "qcom,qcm6490", .data = &sc7280_data, }, - { .compatible = "qcom,qcs8300", .data = &sc8280xp_data, }, - { .compatible = "qcom,sa8155p", .data = &sm8150_data, }, - { .compatible = "qcom,sa8540p", .data = &sc8280xp_data, }, + { .compatible = "qcom,msm8996", .data = &ubwc_1_0_hbb15 }, + { .compatible = "qcom,msm8998", .data = &ubwc_1_0_hbb15 }, + { .compatible = "qcom,qcm2290", .data = &ubwc_0_0_hbb15, }, + { .compatible = "qcom,qcm6490", .data = &ubwc_3_1_hbb14, }, + { .compatible = "qcom,qcs8300", .data = &ubwc_4_0_hbb16, }, + { .compatible = "qcom,sa8155p", .data = &ubwc_3_0_hbb15, }, + { .compatible = "qcom,sa8540p", .data = &ubwc_4_0_hbb16, }, { .compatible = "qcom,sa8775p", .data = &sa8775p_data, }, - { .compatible = "qcom,sar2130p", .data = &sar2130p_data }, - { .compatible = "qcom,sc7180", .data = &sc7180_data }, - { .compatible = "qcom,sc7280", .data = &sc7280_data, }, - { .compatible = "qcom,sc8180x", .data = &sc8180x_data, }, - { .compatible = "qcom,sc8280xp", .data = &sc8280xp_data, }, - { .compatible = "qcom,sda660", .data = &msm8937_data }, - { .compatible = "qcom,sdm450", .data = &msm8937_data }, - { .compatible = "qcom,sdm630", .data = &msm8937_data }, - { .compatible = "qcom,sdm632", .data = &msm8937_data }, - { .compatible = "qcom,sdm636", .data = &msm8937_data }, - { .compatible = "qcom,sdm660", .data = &msm8937_data }, - { .compatible = "qcom,sdm670", .data = &sdm670_data, }, - { .compatible = "qcom,sdm845", .data = &sdm845_data, }, - { .compatible = "qcom,sm4250", .data = &sm6115_data, }, - { .compatible = "qcom,sm6115", .data = &sm6115_data, }, - { .compatible = "qcom,sm6125", .data = &sm6125_data, }, - { .compatible = "qcom,sm6150", .data = &sm6150_data, }, - { .compatible = "qcom,sm6350", .data = &sm6350_data, }, - { .compatible = "qcom,sm6375", .data = &sm6350_data, }, - { .compatible = "qcom,sm7125", .data = &sc7180_data }, - { .compatible = "qcom,sm7150", .data = &sm7150_data, }, - { .compatible = "qcom,sm7225", .data = &sm6350_data, }, - { .compatible = "qcom,sm7325", .data = &sc7280_data, }, - { .compatible = "qcom,sm8150", .data = &sm8150_data, }, - { .compatible = "qcom,sm8250", .data = &sm8250_data, }, - { .compatible = "qcom,sm8350", .data = &sm8350_data, }, - { .compatible = "qcom,sm8450", .data = &sm8350_data, }, - { .compatible = "qcom,sm8550", .data = &sm8550_data, }, - { .compatible = "qcom,sm8650", .data = &sm8550_data, }, - { .compatible = "qcom,sm8750", .data = &sm8750_data, }, - { .compatible = "qcom,x1e80100", .data = &sm8550_data, }, - { .compatible = "qcom,x1p42100", .data = &sm8550_data, }, + { .compatible = "qcom,sar2130p", .data = &ubwc_3_1_hbb13 }, + { .compatible = "qcom,sc7180", .data = &ubwc_2_0_hbb14, }, + { .compatible = "qcom,sc7280", .data = &ubwc_3_1_hbb14, }, + { .compatible = "qcom,sc8180x", .data = &ubwc_3_0_hbb16, }, + { .compatible = "qcom,sc8280xp", .data = &ubwc_4_0_hbb16, }, + { .compatible = "qcom,sda660", .data = &ubwc_1_0_hbb14 }, + { .compatible = "qcom,sdm450", .data = &ubwc_1_0_hbb14 }, + { .compatible = "qcom,sdm630", .data = &ubwc_1_0_hbb14 }, + { .compatible = "qcom,sdm632", .data = &ubwc_1_0_hbb14 }, + { .compatible = "qcom,sdm636", .data = &ubwc_1_0_hbb14 }, + { .compatible = "qcom,sdm660", .data = &ubwc_1_0_hbb14 }, + { .compatible = "qcom,sdm670", .data = &ubwc_2_0_hbb14, }, + { .compatible = "qcom,sdm845", .data = &ubwc_2_0_hbb15, }, + { .compatible = "qcom,sm4250", .data = &ubwc_1_0_hbb14, }, + { .compatible = "qcom,sm6115", .data = &ubwc_1_0_hbb14, }, + { .compatible = "qcom,sm6125", .data = &ubwc_1_0_hbb14, }, + { .compatible = "qcom,sm6150", .data = &ubwc_2_0_hbb14, }, + { .compatible = "qcom,sm6350", .data = &ubwc_2_0_hbb14, }, + { .compatible = "qcom,sm6375", .data = &ubwc_2_0_hbb14, }, + { .compatible = "qcom,sm7125", .data = &ubwc_2_0_hbb14, }, + { .compatible = "qcom,sm7150", .data = &ubwc_2_0_hbb14, }, + { .compatible = "qcom,sm7225", .data = &ubwc_2_0_hbb14, }, + { .compatible = "qcom,sm7325", .data = &ubwc_3_1_hbb14, }, + { .compatible = "qcom,sm8150", .data = &ubwc_3_0_hbb15, }, + { .compatible = "qcom,sm8250", .data = &ubwc_4_0_hbb16, }, + { .compatible = "qcom,sm8350", .data = &ubwc_4_0_hbb16, }, + { .compatible = "qcom,sm8450", .data = &ubwc_4_0_hbb16, }, + { .compatible = "qcom,sm8550", .data = &ubwc_4_0_hbb16, }, + { .compatible = "qcom,sm8650", .data = &ubwc_4_0_hbb16, }, + { .compatible = "qcom,sm8750", .data = &ubwc_5_0_hbb16, }, + { .compatible = "qcom,x1e80100", .data = &ubwc_4_0_hbb16, }, + { .compatible = "qcom,x1p42100", .data = &ubwc_4_0_hbb16, }, { } };
Signature · 1 line
2.47.3
Re: [PATCH 24/24] soc: qcom: ubwc: deduplicate UBWC configuration data
Quoted 5 lines · Dmitry Baryshkov
After removing all extra entries from the UBWC database it is easy to define generic entries, common for all machine classes.
Signed-off-by Dmitry Baryshkov <[email protected]>---
I ran through this manually and I think everything matches
Konrad