Re: [Freedreno] [PATCH v3 05/12] dt-bindings: display/msm: Add SM6375 MDSS

2023-05-05 Thread Rob Herring


On Fri, 05 May 2023 23:40:31 +0200, Konrad Dybcio wrote:
> Document the SM6375 MDSS.
> 
> Signed-off-by: Konrad Dybcio 
> ---
>  .../bindings/display/msm/qcom,sm6375-mdss.yaml | 216 
> +
>  1 file changed, 216 insertions(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/msm/qcom,sm6375-mdss.example.dtb:
 dsi@5e94000: compatible: 'oneOf' conditional failed, one must be fixed:
'qcom,sm6375-dsi-ctrl' is not one of ['qcom,apq8064-dsi-ctrl', 
'qcom,msm8916-dsi-ctrl', 'qcom,msm8953-dsi-ctrl', 'qcom,msm8974-dsi-ctrl', 
'qcom,msm8996-dsi-ctrl', 'qcom,msm8998-dsi-ctrl', 'qcom,qcm2290-dsi-ctrl', 
'qcom,sc7180-dsi-ctrl', 'qcom,sc7280-dsi-ctrl', 'qcom,sdm660-dsi-ctrl', 
'qcom,sdm845-dsi-ctrl', 'qcom,sm8150-dsi-ctrl', 'qcom,sm8250-dsi-ctrl', 
'qcom,sm8350-dsi-ctrl', 'qcom,sm8450-dsi-ctrl', 'qcom,sm8550-dsi-ctrl']
'qcom,sm6375-dsi-ctrl' is not one of ['dsi-ctrl-6g-qcm2290']
From schema: 
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/msm/qcom,sm6375-mdss.example.dtb:
 dsi@5e94000: Unevaluated properties are not allowed ('compatible' was 
unexpected)
From schema: 
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml

doc reference errors (make refcheckdocs):

See 
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230411-topic-straitlagoon_mdss-v3-5-9837d6b35...@linaro.org

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.



Re: [Freedreno] [PATCH v3 04/12] dt-bindings: display/msm: Add SM6350 MDSS

2023-05-05 Thread Rob Herring


On Fri, 05 May 2023 23:40:30 +0200, Konrad Dybcio wrote:
> Document the SM6350 MDSS.
> 
> Signed-off-by: Konrad Dybcio 
> ---
>  .../bindings/display/msm/qcom,sm6350-mdss.yaml | 214 
> +
>  1 file changed, 214 insertions(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/msm/qcom,sm6350-mdss.example.dtb:
 dsi@ae94000: compatible: 'oneOf' conditional failed, one must be fixed:
'qcom,sm6350-dsi-ctrl' is not one of ['qcom,apq8064-dsi-ctrl', 
'qcom,msm8916-dsi-ctrl', 'qcom,msm8953-dsi-ctrl', 'qcom,msm8974-dsi-ctrl', 
'qcom,msm8996-dsi-ctrl', 'qcom,msm8998-dsi-ctrl', 'qcom,qcm2290-dsi-ctrl', 
'qcom,sc7180-dsi-ctrl', 'qcom,sc7280-dsi-ctrl', 'qcom,sdm660-dsi-ctrl', 
'qcom,sdm845-dsi-ctrl', 'qcom,sm8150-dsi-ctrl', 'qcom,sm8250-dsi-ctrl', 
'qcom,sm8350-dsi-ctrl', 'qcom,sm8450-dsi-ctrl', 'qcom,sm8550-dsi-ctrl']
'qcom,sm6350-dsi-ctrl' is not one of ['dsi-ctrl-6g-qcm2290']
From schema: 
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/msm/qcom,sm6350-mdss.example.dtb:
 dsi@ae94000: Unevaluated properties are not allowed ('compatible' was 
unexpected)
From schema: 
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml

doc reference errors (make refcheckdocs):

See 
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230411-topic-straitlagoon_mdss-v3-4-9837d6b35...@linaro.org

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.



Re: [Freedreno] [PATCH v2 1/4] drm/msm/dsi: Adjust pclk rate for compression

2023-05-05 Thread Jessica Zhang




On 5/5/2023 2:23 PM, Jessica Zhang wrote:

Adjust the pclk rate to divide hdisplay by the compression ratio when DSC
is enabled.

Changes in v2:
- Adjusted pclk_rate math to divide only the hdisplay value by
   compression ratio

Signed-off-by: Jessica Zhang 
---
  drivers/gpu/drm/msm/dsi/dsi_host.c | 17 +
  1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 43a5ec33eee8..0e5778e8091f 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -561,7 +561,8 @@ void dsi_link_clk_disable_v2(struct msm_dsi_host *msm_host)
clk_disable_unprepare(msm_host->byte_clk);
  }
  
-static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode, bool is_bonded_dsi)

+static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode,
+   struct drm_dsc_config *dsc, bool is_bonded_dsi)
  {
unsigned long pclk_rate;
  
@@ -576,6 +577,14 @@ static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode, bool

if (is_bonded_dsi)
pclk_rate /= 2;
  
+	/* If DSC is enabled, divide hdisplay by compression ratio */

+   if (dsc) {
+   int new_hdisplay = DIV_ROUND_UP(mode->hdisplay * 
msm_dsc_get_bpp_int(dsc),
+   dsc->bits_per_component * 3);
+   int fps = DIV_ROUND_UP(pclk_rate, mode->htotal * mode->vtotal);


Should've used drm_mode_vrefresh() here... Will spin a v3 with that 
change (along with any additional comments)



+   pclk_rate = (new_hdisplay + (mode->htotal - mode->hdisplay)) * 
mode->vtotal * fps;
+   }
+
return pclk_rate;
  }
  
@@ -585,7 +594,7 @@ unsigned long dsi_byte_clk_get_rate(struct mipi_dsi_host *host, bool is_bonded_d

struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
u8 lanes = msm_host->lanes;
u32 bpp = dsi_get_bpp(msm_host->format);
-   unsigned long pclk_rate = dsi_get_pclk_rate(mode, is_bonded_dsi);
+   unsigned long pclk_rate = dsi_get_pclk_rate(mode, msm_host->dsc, 
is_bonded_dsi);
u64 pclk_bpp = (u64)pclk_rate * bpp;
  
  	if (lanes == 0) {

@@ -604,7 +613,7 @@ unsigned long dsi_byte_clk_get_rate(struct mipi_dsi_host 
*host, bool is_bonded_d
  
  static void dsi_calc_pclk(struct msm_dsi_host *msm_host, bool is_bonded_dsi)

  {
-   msm_host->pixel_clk_rate = dsi_get_pclk_rate(msm_host->mode, 
is_bonded_dsi);
+   msm_host->pixel_clk_rate = dsi_get_pclk_rate(msm_host->mode, 
msm_host->dsc, is_bonded_dsi);
msm_host->byte_clk_rate = dsi_byte_clk_get_rate(&msm_host->base, 
is_bonded_dsi,
msm_host->mode);
  
@@ -634,7 +643,7 @@ int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
  
  	dsi_calc_pclk(msm_host, is_bonded_dsi);
  
-	pclk_bpp = (u64)dsi_get_pclk_rate(msm_host->mode, is_bonded_dsi) * bpp;

+   pclk_bpp = (u64)dsi_get_pclk_rate(msm_host->mode, msm_host->dsc, 
is_bonded_dsi) * bpp;
do_div(pclk_bpp, 8);
msm_host->src_clk_rate = pclk_bpp;
  


--
2.40.1



[Freedreno] [PATCH v3 11/12] iommu/arm-smmu-qcom: Add SM6375 DPU compatible

2023-05-05 Thread Konrad Dybcio
Add the SM6375 DPU compatible to clients compatible list, as it also
needs the workarounds.

Acked-by: Dmitry Baryshkov 
Signed-off-by: Konrad Dybcio 
---
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c 
b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
index f945ae3d9d06..d7d5d1dbee17 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
@@ -253,6 +253,7 @@ static const struct of_device_id 
qcom_smmu_client_of_match[] __maybe_unused = {
{ .compatible = "qcom,sc8280xp-mdss" },
{ .compatible = "qcom,sdm845-mdss" },
{ .compatible = "qcom,sdm845-mss-pil" },
+   { .compatible = "qcom,sm6375-mdss" },
{ .compatible = "qcom,sm8150-mdss" },
{ .compatible = "qcom,sm8250-mdss" },
{ }

-- 
2.40.1



[Freedreno] [PATCH v3 12/12] iommu/arm-smmu-qcom: Add SM6350 DPU compatible

2023-05-05 Thread Konrad Dybcio
From: Konrad Dybcio 

Add the SM6350 DPU compatible to clients compatible list, as it also
needs the workarounds.

Signed-off-by: Konrad Dybcio 
Acked-by: Dmitry Baryshkov 
Signed-off-by: Konrad Dybcio 
---
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c 
b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
index d7d5d1dbee17..e64c737724c4 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
@@ -253,6 +253,7 @@ static const struct of_device_id 
qcom_smmu_client_of_match[] __maybe_unused = {
{ .compatible = "qcom,sc8280xp-mdss" },
{ .compatible = "qcom,sdm845-mdss" },
{ .compatible = "qcom,sdm845-mss-pil" },
+   { .compatible = "qcom,sm6350-mdss" },
{ .compatible = "qcom,sm6375-mdss" },
{ .compatible = "qcom,sm8150-mdss" },
{ .compatible = "qcom,sm8250-mdss" },

-- 
2.40.1



[Freedreno] [PATCH v3 09/12] drm/msm: mdss: Add SM6375 support

2023-05-05 Thread Konrad Dybcio
Add support for MDSS on SM6375.

Reviewed-by: Dmitry Baryshkov 
Reviewed-by: Marijn Suijten 
Signed-off-by: Konrad Dybcio 
---
 drivers/gpu/drm/msm/msm_mdss.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index 4e3a5f0c303c..05648c910c68 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -580,6 +580,7 @@ static const struct of_device_id mdss_dt_match[] = {
{ .compatible = "qcom,sc8280xp-mdss", .data = &sc8280xp_data },
{ .compatible = "qcom,sm6115-mdss", .data = &sm6115_data },
{ .compatible = "qcom,sm6350-mdss", .data = &sm6350_data },
+   { .compatible = "qcom,sm6375-mdss", .data = &sm6350_data },
{ .compatible = "qcom,sm8150-mdss", .data = &sm8150_data },
{ .compatible = "qcom,sm8250-mdss", .data = &sm8250_data },
{ .compatible = "qcom,sm8350-mdss", .data = &sm8250_data },

-- 
2.40.1



[Freedreno] [PATCH v3 10/12] iommu/arm-smmu-qcom: Sort the compatible list alphabetically

2023-05-05 Thread Konrad Dybcio
It got broken at some point, fix it up.

Signed-off-by: Konrad Dybcio 
---
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c 
b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
index ae09c627bc84..f945ae3d9d06 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
@@ -251,10 +251,10 @@ static const struct of_device_id 
qcom_smmu_client_of_match[] __maybe_unused = {
{ .compatible = "qcom,sc7280-mss-pil" },
{ .compatible = "qcom,sc8180x-mdss" },
{ .compatible = "qcom,sc8280xp-mdss" },
-   { .compatible = "qcom,sm8150-mdss" },
-   { .compatible = "qcom,sm8250-mdss" },
{ .compatible = "qcom,sdm845-mdss" },
{ .compatible = "qcom,sdm845-mss-pil" },
+   { .compatible = "qcom,sm8150-mdss" },
+   { .compatible = "qcom,sm8250-mdss" },
{ }
 };
 

-- 
2.40.1



[Freedreno] [PATCH v3 07/12] drm/msm: mdss: Add SM6350 support

2023-05-05 Thread Konrad Dybcio
Add support for MDSS on SM6350.

Reviewed-by: Dmitry Baryshkov 
Reviewed-by: Marijn Suijten 
Signed-off-by: Konrad Dybcio 
---
 drivers/gpu/drm/msm/msm_mdss.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index e8c93731aaa1..4e3a5f0c303c 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -538,6 +538,14 @@ static const struct msm_mdss_data sdm845_data = {
.highest_bank_bit = 2,
 };
 
+static const struct msm_mdss_data sm6350_data = {
+   .ubwc_version = UBWC_2_0,
+   .ubwc_dec_version = UBWC_2_0,
+   .ubwc_swizzle = 6,
+   .ubwc_static = 0x1e,
+   .highest_bank_bit = 1,
+};
+
 static const struct msm_mdss_data sm8150_data = {
.ubwc_version = UBWC_3_0,
.ubwc_dec_version = UBWC_3_0,
@@ -571,6 +579,7 @@ static const struct of_device_id mdss_dt_match[] = {
{ .compatible = "qcom,sc8180x-mdss", .data = &sc8180x_data },
{ .compatible = "qcom,sc8280xp-mdss", .data = &sc8280xp_data },
{ .compatible = "qcom,sm6115-mdss", .data = &sm6115_data },
+   { .compatible = "qcom,sm6350-mdss", .data = &sm6350_data },
{ .compatible = "qcom,sm8150-mdss", .data = &sm8150_data },
{ .compatible = "qcom,sm8250-mdss", .data = &sm8250_data },
{ .compatible = "qcom,sm8350-mdss", .data = &sm8250_data },

-- 
2.40.1



[Freedreno] [PATCH v3 08/12] drm/msm/dpu: Add SM6375 support

2023-05-05 Thread Konrad Dybcio
Add basic SM6375 support to the DPU1 driver to enable display output.

Signed-off-by: Konrad Dybcio 
---
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_9_sm6375.h | 152 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |   1 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |   1 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c|   1 +
 4 files changed, 155 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_9_sm6375.h 
b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_9_sm6375.h
new file mode 100644
index ..c7f303b0557e
--- /dev/null
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_9_sm6375.h
@@ -0,0 +1,152 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023, Linaro Limited
+ */
+
+#ifndef _DPU_6_9_SM6375_H
+#define _DPU_6_9_SM6375_H
+
+static const struct dpu_caps sm6375_dpu_caps = {
+   .max_mixer_width = DEFAULT_DPU_LINE_WIDTH,
+   .max_mixer_blendstages = 0x4,
+   .qseed_type = DPU_SSPP_SCALER_QSEED4,
+   .has_dim_layer = true,
+   .has_idle_pc = true,
+   .max_linewidth = 2160,
+   .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
+};
+
+static const struct dpu_ubwc_cfg sm6375_ubwc_cfg = {
+   .ubwc_version = DPU_HW_UBWC_VER_20,
+   .ubwc_swizzle = 6,
+   .highest_bank_bit = 1,
+};
+
+static const struct dpu_mdp_cfg sm6375_mdp[] = {
+   {
+   .name = "top_0", .id = MDP_TOP,
+   .base = 0x0, .len = 0x494,
+   .features = 0,
+   .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
+   .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
+   },
+};
+
+static const struct dpu_ctl_cfg sm6375_ctl[] = {
+   {
+   .name = "ctl_0", .id = CTL_0,
+   .base = 0x1000, .len = 0x1dc,
+   .features = BIT(DPU_CTL_ACTIVE_CFG),
+   .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9),
+   },
+};
+
+static const struct dpu_sspp_cfg sm6375_sspp[] = {
+   SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK,
+   sm6115_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0),
+   SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK,
+   sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0),
+};
+
+static const struct dpu_lm_cfg sm6375_lm[] = {
+   LM_BLK("lm_0", LM_0, 0x44000, MIXER_QCM2290_MASK,
+   &qcm2290_lm_sblk, PINGPONG_0, 0, DSPP_0),
+};
+
+static const struct dpu_dspp_cfg sm6375_dspp[] = {
+   DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
+   &sm8150_dspp_sblk),
+};
+
+static const struct dpu_pingpong_cfg sm6375_pp[] = {
+   PP_BLK("pingpong_0", PINGPONG_0, 0x7, PINGPONG_SM8150_MASK, 0, 
sdm845_pp_sblk,
+   DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
+   -1),
+};
+
+static const struct dpu_intf_cfg sm6375_intf[] = {
+   INTF_BLK("intf_0", INTF_0, 0x0, 0x2c0, INTF_NONE, 0, 0, 0, 0, 0),
+   INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, 0, 24, 
INTF_SC7280_MASK,
+   DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
+   DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
+   DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)),
+};
+
+static const struct dpu_vbif_cfg sm6375_vbif[] = {
+   {
+   .name = "vbif_0", .id = VBIF_RT,
+   .base = 0, .len = 0x2008,
+   .features = BIT(DPU_VBIF_QOS_REMAP),
+   .xin_halt_timeout = 0x4000,
+   .qos_rp_remap_size = 0x40,
+   .qos_rt_tbl = {
+   .npriority_lvl = ARRAY_SIZE(sdm845_rt_pri_lvl),
+   .priority_lvl = sdm845_rt_pri_lvl,
+   },
+   .qos_nrt_tbl = {
+   .npriority_lvl = ARRAY_SIZE(sdm845_nrt_pri_lvl),
+   .priority_lvl = sdm845_nrt_pri_lvl,
+   },
+   .memtype_count = 14,
+   .memtype = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
+   },
+};
+
+static const struct dpu_perf_cfg sm6375_perf_data = {
+   .max_bw_low = 520,
+   .max_bw_high = 620,
+   .min_core_ib = 250,
+   .min_llcc_ib = 0, /* No LLCC on this SoC */
+   .min_dram_ib = 160,
+   .min_prefill_lines = 24,
+   /* TODO: confirm danger_lut_tbl */
+   .danger_lut_tbl = {0x, 0x, 0x0, 0x0, 0x},
+   .qos_lut_tbl = {
+   {.nentry = ARRAY_SIZE(sm6350_qos_linear_macrotile),
+   .entries = sm6350_qos_linear_macrotile
+   },
+   {.nentry = ARRAY_SIZE(sm6350_qos_linear_macrotile),
+   .entries = sm6350_qos_linear_macrotile
+   },
+   {.nentry = ARRAY_SIZE(sc7180_qos_nrt),
+   .entries = sc7180_qos_nrt
+   },
+   },
+   .cdp_cfg = {
+   {.rd_enable = 1, .wr_enable = 1},
+   {.rd_enable = 1, .wr_enable = 0}
+   },
+   .clk_inefficiency_factor =

[Freedreno] [PATCH v3 06/12] drm/msm/dpu: Add SM6350 support

2023-05-05 Thread Konrad Dybcio
Add SM6350 support to the DPU1 driver to enable display output.

It's worth noting that one entry dpu_qos_lut_entry was trimmed off:

{.fl = 0, .lut = 0x0011223344556677 },

due to the fact that newer SoCs dropped the .fl (fill level)-based
logic and don't provide real values, resulting in all entries but
the last one being unused.

Signed-off-by: Konrad Dybcio 
Reviewed-by: Marijn Suijten 
Signed-off-by: Konrad Dybcio 
---
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_4_sm6350.h | 187 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |   5 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |   3 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c|   1 +
 4 files changed, 196 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_4_sm6350.h 
b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_4_sm6350.h
new file mode 100644
index ..e8bfbd468e0a
--- /dev/null
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_4_sm6350.h
@@ -0,0 +1,187 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023, Linaro Limited
+ */
+
+#ifndef _DPU_6_4_SM6350_H
+#define _DPU_6_4_SM6350_H
+
+static const struct dpu_caps sm6350_dpu_caps = {
+   .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
+   .max_mixer_blendstages = 0x7,
+   .qseed_type = DPU_SSPP_SCALER_QSEED4,
+   .has_src_split = true,
+   .has_dim_layer = true,
+   .has_idle_pc = true,
+   .max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
+   .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
+};
+
+static const struct dpu_ubwc_cfg sm6350_ubwc_cfg = {
+   .ubwc_version = DPU_HW_UBWC_VER_20,
+   .ubwc_swizzle = 6,
+   .highest_bank_bit = 1,
+};
+
+static const struct dpu_mdp_cfg sm6350_mdp[] = {
+   {
+   .name = "top_0", .id = MDP_TOP,
+   .base = 0x0, .len = 0x494,
+   .features = 0,
+   .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
+   .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
+   .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
+   .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
+   .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
+   },
+};
+
+static const struct dpu_ctl_cfg sm6350_ctl[] = {
+   {
+   .name = "ctl_0", .id = CTL_0,
+   .base = 0x1000, .len = 0x1dc,
+   .features = BIT(DPU_CTL_ACTIVE_CFG),
+   .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9),
+   },
+   {
+   .name = "ctl_1", .id = CTL_1,
+   .base = 0x1200, .len = 0x1dc,
+   .features = BIT(DPU_CTL_ACTIVE_CFG),
+   .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10),
+   },
+   {
+   .name = "ctl_2", .id = CTL_2,
+   .base = 0x1400, .len = 0x1dc,
+   .features = BIT(DPU_CTL_ACTIVE_CFG),
+   .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11),
+   },
+   {
+   .name = "ctl_3", .id = CTL_3,
+   .base = 0x1600, .len = 0x1dc,
+   .features = BIT(DPU_CTL_ACTIVE_CFG),
+   .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12),
+   },
+};
+
+static const struct dpu_sspp_cfg sm6350_sspp[] = {
+   SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK,
+   sc7180_vig_sblk_0, 0,  SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0),
+   SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK,
+   sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0),
+   SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1f8, DMA_CURSOR_SDM845_MASK,
+   sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1),
+   SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1f8, DMA_CURSOR_SDM845_MASK,
+   sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA2),
+};
+
+static const struct dpu_lm_cfg sm6350_lm[] = {
+   LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK,
+   &sc7180_lm_sblk, PINGPONG_0, LM_1, DSPP_0),
+   LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK,
+   &sc7180_lm_sblk, PINGPONG_1, LM_0, 0),
+};
+
+static const struct dpu_dspp_cfg sm6350_dspp[] = {
+   DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
+   &sm8150_dspp_sblk),
+};
+
+static struct dpu_pingpong_cfg sm6350_pp[] = {
+   PP_BLK("pingpong_0", PINGPONG_0, 0x7, PINGPONG_SM8150_MASK, 0, 
sdm845_pp_sblk,
+   DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
+   -1),
+   PP_BLK("pingpong_1", PINGPONG_1, 0x70800, PINGPONG_SM8150_MASK, 0, 
sdm845_pp_sblk,
+   DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
+   -1),
+};
+
+static const struct dpu_intf_cfg sm6350_intf[] = {
+   INTF_BLK("intf_0", INTF_0, 0x6a000, 0x2c0, INTF_DP, 0, 35, 
INTF_SC7180_MASK,
+   DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
+   DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25)),

[Freedreno] [PATCH v3 04/12] dt-bindings: display/msm: Add SM6350 MDSS

2023-05-05 Thread Konrad Dybcio
Document the SM6350 MDSS.

Signed-off-by: Konrad Dybcio 
---
 .../bindings/display/msm/qcom,sm6350-mdss.yaml | 214 +
 1 file changed, 214 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/msm/qcom,sm6350-mdss.yaml 
b/Documentation/devicetree/bindings/display/msm/qcom,sm6350-mdss.yaml
new file mode 100644
index ..6674040d2172
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/msm/qcom,sm6350-mdss.yaml
@@ -0,0 +1,214 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/qcom,sm6350-mdss.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SM6350 Display MDSS
+
+maintainers:
+  - Krishna Manikandan 
+
+description:
+  SM6350 MSM Mobile Display Subsystem (MDSS), which encapsulates sub-blocks
+  like DPU display controller, DSI and DP interfaces etc.
+
+$ref: /schemas/display/msm/mdss-common.yaml#
+
+properties:
+  compatible:
+items:
+  - const: qcom,sm6350-mdss
+
+  clocks:
+items:
+  - description: Display AHB clock from gcc
+  - description: Display AXI clock from gcc
+  - description: Display core clock
+
+  clock-names:
+items:
+  - const: iface
+  - const: bus
+  - const: core
+
+  iommus:
+maxItems: 1
+
+  interconnects:
+maxItems: 2
+
+  interconnect-names:
+maxItems: 2
+
+patternProperties:
+  "^display-controller@[0-9a-f]+$":
+type: object
+properties:
+  compatible:
+const: qcom,sm6350-dpu
+
+  "^dsi@[0-9a-f]+$":
+type: object
+properties:
+  compatible:
+items:
+  - const: qcom,sm6350-dsi-ctrl
+  - const: qcom,mdss-dsi-ctrl
+
+  "^phy@[0-9a-f]+$":
+type: object
+properties:
+  compatible:
+const: qcom,dsi-phy-10nm
+
+unevaluatedProperties: false
+
+examples:
+  - |
+#include 
+#include 
+#include 
+#include 
+#include 
+
+display-subsystem@ae0 {
+compatible = "qcom,sm6350-mdss";
+reg = <0x0ae0 0x1000>;
+reg-names = "mdss";
+
+power-domains = <&dispcc MDSS_GDSC>;
+
+clocks = <&gcc GCC_DISP_AHB_CLK>,
+ <&gcc GCC_DISP_AXI_CLK>,
+ <&dispcc DISP_CC_MDSS_MDP_CLK>;
+clock-names = "iface", "bus", "core";
+
+interrupts = ;
+interrupt-controller;
+#interrupt-cells = <1>;
+
+iommus = <&apps_smmu 0x800 0x2>;
+#address-cells = <1>;
+#size-cells = <1>;
+ranges;
+
+display-controller@ae01000 {
+compatible = "qcom,sm6350-dpu";
+reg = <0x0ae01000 0x8f000>,
+  <0x0aeb 0x2008>;
+reg-names = "mdp", "vbif";
+
+clocks = <&gcc GCC_DISP_AXI_CLK>,
+  <&dispcc DISP_CC_MDSS_AHB_CLK>,
+  <&dispcc DISP_CC_MDSS_ROT_CLK>,
+  <&dispcc DISP_CC_MDSS_MDP_LUT_CLK>,
+  <&dispcc DISP_CC_MDSS_MDP_CLK>,
+  <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
+clock-names = "bus", "iface", "rot", "lut", "core",
+"vsync";
+
+assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>,
+  <&dispcc DISP_CC_MDSS_VSYNC_CLK>,
+  <&dispcc DISP_CC_MDSS_ROT_CLK>,
+  <&dispcc DISP_CC_MDSS_AHB_CLK>;
+assigned-clock-rates = <3>,
+   <1920>,
+   <1920>,
+   <1920>;
+
+interrupt-parent = <&mdss>;
+interrupts = <0>;
+operating-points-v2 = <&mdp_opp_table>;
+power-domains = <&rpmhpd SM6350_CX>;
+
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+port@0 {
+reg = <0>;
+dpu_intf1_out: endpoint {
+remote-endpoint = <&dsi0_in>;
+};
+};
+
+port@1 {
+reg = <1>;
+dpu_intf2_out: endpoint {
+remote-endpoint = <&dsi1_in>;
+};
+};
+};
+};
+
+dsi@ae94000 {
+compatible = "qcom,sm6350-dsi-ctrl", "qcom,mdss-dsi-ctrl";
+reg = <0x0ae94000 0x400>;
+reg-names = "dsi_ctrl";
+
+interrupt-parent = <&mdss>;
+interrupts = <4>;
+
+clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK>,
+ <&dispcc DISP_CC_MDSS_BYTE0_INTF_CLK>,
+ <&dispcc DISP_CC_MDSS_PCLK0_CLK>,
+ <&dispcc DISP_CC_MDSS_ESC0_CLK>,
+ <&dispcc DISP_CC_MDSS_AHB_CLK>,
+ <&gcc GCC_DISP_AXI_CLK>;
+clock-names = "byte",
+  "byte_intf",
+  "pixel",
+

[Freedreno] [PATCH v3 05/12] dt-bindings: display/msm: Add SM6375 MDSS

2023-05-05 Thread Konrad Dybcio
Document the SM6375 MDSS.

Signed-off-by: Konrad Dybcio 
---
 .../bindings/display/msm/qcom,sm6375-mdss.yaml | 216 +
 1 file changed, 216 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/msm/qcom,sm6375-mdss.yaml 
b/Documentation/devicetree/bindings/display/msm/qcom,sm6375-mdss.yaml
new file mode 100644
index ..fb56971ea2a1
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/msm/qcom,sm6375-mdss.yaml
@@ -0,0 +1,216 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/qcom,sm6375-mdss.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SM6375 Display MDSS
+
+maintainers:
+  - Konrad Dybcio 
+
+description:
+  SM6375 MSM Mobile Display Subsystem (MDSS), which encapsulates sub-blocks
+  like DPU display controller, DSI and DP interfaces etc.
+
+$ref: /schemas/display/msm/mdss-common.yaml#
+
+properties:
+  compatible:
+items:
+  - const: qcom,sm6375-mdss
+
+  clocks:
+items:
+  - description: Display AHB clock from gcc
+  - description: Display AHB clock
+  - description: Display core clock
+
+  clock-names:
+items:
+  - const: iface
+  - const: ahb
+  - const: core
+
+  iommus:
+maxItems: 1
+
+  interconnects:
+maxItems: 2
+
+  interconnect-names:
+maxItems: 2
+
+patternProperties:
+  "^display-controller@[0-9a-f]+$":
+type: object
+properties:
+  compatible:
+const: qcom,sm6375-dpu
+
+  "^dsi@[0-9a-f]+$":
+type: object
+properties:
+  compatible:
+items:
+  - const: qcom,sm6375-dsi-ctrl
+  - const: qcom,mdss-dsi-ctrl
+
+  "^phy@[0-9a-f]+$":
+type: object
+properties:
+  compatible:
+const: qcom,sm6375-dsi-phy-7nm
+
+unevaluatedProperties: false
+
+examples:
+  - |
+#include 
+#include 
+#include 
+#include 
+#include 
+
+display-subsystem@5e0 {
+compatible = "qcom,sm6375-mdss";
+reg = <0x05e0 0x1000>;
+reg-names = "mdss";
+
+power-domains = <&dispcc MDSS_GDSC>;
+
+clocks = <&gcc GCC_DISP_AHB_CLK>,
+ <&dispcc DISP_CC_MDSS_AHB_CLK>,
+ <&dispcc DISP_CC_MDSS_MDP_CLK>;
+clock-names = "iface", "ahb", "core";
+
+interrupts = ;
+interrupt-controller;
+#interrupt-cells = <1>;
+
+iommus = <&apps_smmu 0x820 0x2>;
+#address-cells = <1>;
+#size-cells = <1>;
+ranges;
+
+display-controller@5e01000 {
+compatible = "qcom,sm6375-dpu";
+reg = <0x05e01000 0x8e030>,
+  <0x05eb 0x2008>;
+reg-names = "mdp", "vbif";
+
+clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+ <&gcc GCC_DISP_HF_AXI_CLK>,
+ <&dispcc DISP_CC_MDSS_MDP_CLK>,
+ <&dispcc DISP_CC_MDSS_MDP_LUT_CLK>,
+ <&dispcc DISP_CC_MDSS_ROT_CLK>,
+ <&dispcc DISP_CC_MDSS_VSYNC_CLK>,
+ <&gcc GCC_DISP_THROTTLE_CORE_CLK>;
+clock-names = "iface",
+  "bus",
+  "core",
+  "lut",
+  "rot",
+  "vsync",
+  "throttle";
+
+assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
+assigned-clock-rates = <1920>;
+
+operating-points-v2 = <&mdp_opp_table>;
+power-domains = <&rpmpd SM6375_VDDCX>;
+
+interrupt-parent = <&mdss>;
+interrupts = <0>;
+
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+port@0 {
+reg = <0>;
+dpu_intf1_out: endpoint {
+remote-endpoint = <&dsi0_in>;
+};
+};
+
+port@1 {
+reg = <1>;
+dpu_intf2_out: endpoint {
+remote-endpoint = <&dsi1_in>;
+};
+};
+};
+};
+
+dsi@5e94000 {
+compatible = "qcom,sm6375-dsi-ctrl", "qcom,mdss-dsi-ctrl";
+reg = <0x05e94000 0x400>;
+reg-names = "dsi_ctrl";
+
+interrupt-parent = <&mdss>;
+interrupts = <4>;
+
+clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK>,
+ <&dispcc DISP_CC_MDSS_BYTE0_INTF_CLK>,
+ <&dispcc DISP_CC_MDSS_PCLK0_CLK>,
+ <&dispcc DISP_CC_MDSS_ESC0_CLK>,
+ <&dispcc DISP_CC_MDSS_AHB_CLK>,
+ <&gcc GCC_DISP_HF_AXI_CLK>;
+clock-names = "byte",
+  "byte_intf",
+  "pixel",
+  "core",
+  "iface",
+ 

[Freedreno] [PATCH v3 03/12] dt-bindings: display/msm: sc7180-dpu: Describe SM6350 and SM6375

2023-05-05 Thread Konrad Dybcio
SC7180, SM6350 and SM6375 use a rather similar hw setup for DPU, with
the main exception being that the last one requires an additional
throttle clock.

It is not well understood yet, but failing to toggle it on makes the
display hardware stall and not output any frames.

Document SM6350 and SM6375 DPU.

Signed-off-by: Konrad Dybcio 
---
 .../bindings/display/msm/qcom,sc7180-dpu.yaml  | 23 +-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/msm/qcom,sc7180-dpu.yaml 
b/Documentation/devicetree/bindings/display/msm/qcom,sc7180-dpu.yaml
index 1fb8321d9ee8..630b11480496 100644
--- a/Documentation/devicetree/bindings/display/msm/qcom,sc7180-dpu.yaml
+++ b/Documentation/devicetree/bindings/display/msm/qcom,sc7180-dpu.yaml
@@ -13,7 +13,10 @@ $ref: /schemas/display/msm/dpu-common.yaml#
 
 properties:
   compatible:
-const: qcom,sc7180-dpu
+enum:
+  - qcom,sc7180-dpu
+  - qcom,sm6350-dpu
+  - qcom,sm6375-dpu
 
   reg:
 items:
@@ -26,6 +29,7 @@ properties:
   - const: vbif
 
   clocks:
+minItems: 6
 items:
   - description: Display hf axi clock
   - description: Display ahb clock
@@ -33,8 +37,10 @@ properties:
   - description: Display lut clock
   - description: Display core clock
   - description: Display vsync clock
+  - description: Display core throttle clock
 
   clock-names:
+minItems: 6
 items:
   - const: bus
   - const: iface
@@ -42,6 +48,7 @@ properties:
   - const: lut
   - const: core
   - const: vsync
+  - const: throttle
 
 required:
   - compatible
@@ -52,6 +59,20 @@ required:
 
 unevaluatedProperties: false
 
+allOf:
+  - if:
+  properties:
+compatible:
+  const: qcom,sm6375-dpu
+
+then:
+  properties:
+clocks:
+  minItems: 7
+
+clock-names:
+  minItems: 7
+
 examples:
   - |
 #include 

-- 
2.40.1



[Freedreno] [PATCH v3 00/12] SM63(50|75) DPU support

2023-05-05 Thread Konrad Dybcio
v2 -> v3:
- Don't duplicate qcm2290_lm_sblk
- Use DEFAULT_DPU_LINE_WIDTH defines
- Fix up sspp clk assignments for sm6350
- Add 6350-6375-common QoS data straight to the common file
  instead of moving it around after adding it
- Fix up iommu compatible order before adding new entries
- Reuse sm6350 msm_mdss_data for sm6375
- INTF_SC7180_MASK -> INTF_SC7280_MASK (enable HCTL) on 6375
- use double tabs in catalog headers
- remove one unused entry in 6350 dpu_qos_lut_entry
- add missing tear IRQs, drop INTF0 irq on 6375
- don't overduplicate DPU bindings, reuse 7180
- Pick up tags
- Rebase on INTF_TE v4 and next-20230504

Depends on:
- 
https://lore.kernel.org/linux-arm-msm/20230411-dpu-intf-te-v4-0-27ce1a5ab...@somainline.org/

v2: 
https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v2-0-5def73f50...@linaro.org

v1 -> v2:
- Rebase on the DPU catalog rework and INTF_TE
- Fix QSEED(3L/4) discrepancies
- Fixed DMA/cursor discrepancies for 6350
- No deduplication, that's gonna be handled in catalogrework 2:
  "the return of the catalogrework"
- Split MDSS & DPU binding additions
- Drop "Allow variable SSPP/INTF_BLK size", that got in w/ the rework
- Split MDSS and DPU additions
- Pick up Rob's acks

Depends on (and based on): 
https://lore.kernel.org/linux-arm-msm/20230411-dpu-intf-te-v2-0-ef76c877e...@somainline.org/T/#t

v1: 
https://lore.kernel.org/linux-arm-msm/20230211122656.1479141-1-konrad.dyb...@linaro.org/

Signed-off-by: Konrad Dybcio 
---
Konrad Dybcio (12):
  dt-bindings: display/msm: dsi-controller-main: Add SM6350
  dt-bindings: display/msm: dsi-controller-main: Add SM6375
  dt-bindings: display/msm: sc7180-dpu: Describe SM6350 and SM6375
  dt-bindings: display/msm: Add SM6350 MDSS
  dt-bindings: display/msm: Add SM6375 MDSS
  drm/msm/dpu: Add SM6350 support
  drm/msm: mdss: Add SM6350 support
  drm/msm/dpu: Add SM6375 support
  drm/msm: mdss: Add SM6375 support
  iommu/arm-smmu-qcom: Sort the compatible list alphabetically
  iommu/arm-smmu-qcom: Add SM6375 DPU compatible
  iommu/arm-smmu-qcom: Add SM6350 DPU compatible

 .../bindings/display/msm/dsi-controller-main.yaml  |   4 +
 .../bindings/display/msm/qcom,sc7180-dpu.yaml  |  23 ++-
 .../bindings/display/msm/qcom,sm6350-mdss.yaml | 214 
 .../bindings/display/msm/qcom,sm6375-mdss.yaml | 216 +
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_4_sm6350.h | 187 ++
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_9_sm6375.h | 152 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |   6 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |   4 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c|   2 +
 drivers/gpu/drm/msm/msm_mdss.c |  10 +
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c |   6 +-
 11 files changed, 821 insertions(+), 3 deletions(-)
---
base-commit: 0d71ecbdb3913e04dcf7f4de0929970cfb4376cb
change-id: 20230411-topic-straitlagoon_mdss-8f34cacd5e26

Best regards,
-- 
Konrad Dybcio 



[Freedreno] [PATCH v3 02/12] dt-bindings: display/msm: dsi-controller-main: Add SM6375

2023-05-05 Thread Konrad Dybcio
Add the DSI host found on SM6375.

Acked-by: Rob Herring 
Signed-off-by: Konrad Dybcio 
---
 Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml 
b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
index 6f367a1fabf8..f7dc05a65420 100644
--- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
@@ -27,6 +27,7 @@ properties:
   - qcom,sdm845-dsi-ctrl
   - qcom,sm6115-dsi-ctrl
   - qcom,sm6350-dsi-ctrl
+  - qcom,sm6375-dsi-ctrl
   - qcom,sm8150-dsi-ctrl
   - qcom,sm8250-dsi-ctrl
   - qcom,sm8350-dsi-ctrl
@@ -354,6 +355,7 @@ allOf:
 enum:
   - qcom,sdm845-dsi-ctrl
   - qcom,sm6115-dsi-ctrl
+  - qcom,sm6375-dsi-ctrl
 then:
   properties:
 clocks:

-- 
2.40.1



[Freedreno] [PATCH v3 01/12] dt-bindings: display/msm: dsi-controller-main: Add SM6350

2023-05-05 Thread Konrad Dybcio
Add the DSI host found on SM6350.

Acked-by: Rob Herring 
Signed-off-by: Konrad Dybcio 
---
 Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml 
b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
index e6c1ebfe8a32..6f367a1fabf8 100644
--- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
@@ -26,6 +26,7 @@ properties:
   - qcom,sdm660-dsi-ctrl
   - qcom,sdm845-dsi-ctrl
   - qcom,sm6115-dsi-ctrl
+  - qcom,sm6350-dsi-ctrl
   - qcom,sm8150-dsi-ctrl
   - qcom,sm8250-dsi-ctrl
   - qcom,sm8350-dsi-ctrl
@@ -285,6 +286,7 @@ allOf:
   contains:
 enum:
   - qcom,msm8998-dsi-ctrl
+  - qcom,sm6350-dsi-ctrl
 then:
   properties:
 clocks:

-- 
2.40.1



[Freedreno] [PATCH v2 4/4] drm/msm/dpu: Set DATA_COMPRESS for command mode

2023-05-05 Thread Jessica Zhang
Add a DPU INTF op to set DATA_COMPRESS register for command mode panels if
the DPU_INTF_DATA_COMPRESS feature flag is set. This flag needs to be
enabled in order for DSC v1.2 to work.

Note: These changes are for command mode only. Video mode changes will
be posted along with the DSC v1.2 support for DP.

Changes in v2:
- Fixed whitespace issue in macro definition
- Read INTF_CONFIG2 before writing to DATA_COMPRESS bit
- Only set dpu_hw_intf_ops.data_compress if DATA_COMPRESS feature is set
- Removed `inline` from dpu_hw_intf_enable_compression declaration

Signed-off-by: Jessica Zhang 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c |  3 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c  | 11 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h  |  2 ++
 3 files changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
index d8ed85a238af..1a4c20f02312 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
@@ -68,6 +68,9 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg(
phys_enc->hw_intf,
true,
phys_enc->hw_pp->idx);
+
+   if (phys_enc->hw_intf->ops.enable_compression)
+   phys_enc->hw_intf->ops.enable_compression(phys_enc->hw_intf);
 }
 
 static void dpu_encoder_phys_cmd_pp_tx_done_irq(void *arg, int irq_idx)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
index 6485500eedb8..322c55a5042c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
@@ -91,6 +91,14 @@
 
 #define INTF_CFG2_DATABUS_WIDENBIT(0)
 #define INTF_CFG2_DATA_HCTL_EN BIT(4)
+#define INTF_CFG2_DCE_DATA_COMPRESS BIT(12)
+
+static void dpu_hw_intf_enable_compression(struct dpu_hw_intf *ctx)
+{
+   u32 intf_cfg2 = DPU_REG_READ(&ctx->hw, INTF_CONFIG2);
+
+   DPU_REG_WRITE(&ctx->hw, INTF_CONFIG2, intf_cfg2 | 
INTF_CFG2_DCE_DATA_COMPRESS);
+}
 
 static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx,
const struct intf_timing_params *p,
@@ -542,6 +550,9 @@ static void _setup_intf_ops(struct dpu_hw_intf_ops *ops,
ops->vsync_sel = dpu_hw_intf_vsync_sel;
ops->disable_autorefresh = dpu_hw_intf_disable_autorefresh;
}
+
+   if (cap & BIT(DPU_INTF_DATA_COMPRESS))
+   ops->enable_compression = dpu_hw_intf_enable_compression;
 }
 
 struct dpu_hw_intf *dpu_hw_intf_init(const struct dpu_intf_cfg *cfg,
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h
index 73b0885918f8..a8def68a5ec2 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h
@@ -70,6 +70,7 @@ struct intf_status {
  * @get_autorefresh:Retrieve autorefresh config from hardware
  *  Return: 0 on success, -ETIMEDOUT on timeout
  * @vsync_sel:  Select vsync signal for tear-effect 
configuration
+ * @enable_compression: Enable data compression
  */
 struct dpu_hw_intf_ops {
void (*setup_timing_gen)(struct dpu_hw_intf *intf,
@@ -107,6 +108,7 @@ struct dpu_hw_intf_ops {
 * Disable autorefresh if enabled
 */
void (*disable_autorefresh)(struct dpu_hw_intf *intf, uint32_t 
encoder_id, u16 vdisplay);
+   void (*enable_compression)(struct dpu_hw_intf *intf);
 };
 
 struct dpu_hw_intf {

-- 
2.40.1



[Freedreno] [PATCH v2 0/4] Add DSC v1.2 Support for DSI

2023-05-05 Thread Jessica Zhang
This is a series of changes for DSI to enable command mode support
for DSC v1.2.

This includes:

1) Adjusting pclk_rate to account for compression
2) Fixing the word count calculation for DSC
3) Setting the DATA_COMPRESS bit when DSC is enabled

With these changes (and the dependency below), DSC v1.2 should work over
DSI in command mode.

Note: Changes that add DSC v1.2 support for video mode will be posted
with the DP support changes.

Depends-on: "add DSC 1.2 dpu supports" [1] and "Introduce MSM-specific
DSC helpers" [2]

[1] https://patchwork.freedesktop.org/series/116789/
[2] https://patchwork.freedesktop.org/series/115833/

Signed-off-by: Jessica Zhang 
---
Changes in v2:
- Changed pclk math to only divide hdisplay by compression ratio
- Reworded word count TODO comment
- Make DATA_COMPRESS an INTF flag
- Read INTF_CFG2 before setting DATA_COMRPESS register
- Reworded commit messages and cover letter for clarity
- Link to v1: 
https://lore.kernel.org/r/20230405-add-dsc-support-v1-0-6bc6f03ae...@quicinc.com

---
Jessica Zhang (4):
  drm/msm/dsi: Adjust pclk rate for compression
  drm/msm/dsi: Fix compressed word count calculation
  drm/msm/dpu: Add DPU_INTF_DATA_COMPRESS feature flag
  drm/msm/dpu: Set DATA_COMPRESS for command mode

 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c   |  3 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |  2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |  2 ++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c| 11 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h|  2 ++
 drivers/gpu/drm/msm/dsi/dsi_host.c | 26 +-
 6 files changed, 40 insertions(+), 6 deletions(-)
---
base-commit: 70e08302e024bfac485b12972099237f7f39d829
change-id: 20230405-add-dsc-support-fe130ba49841

Best regards,
-- 
Jessica Zhang 



[Freedreno] [PATCH v2 3/4] drm/msm/dpu: Add DPU_INTF_DATA_COMPRESS feature flag

2023-05-05 Thread Jessica Zhang
Add DATA_COMPRESS feature flag to DPU INTF block.

In DPU 7.x and later, DSC/DCE enablement registers have been moved from
PINGPONG to INTF.

As core_rev (and related macros) was removed from the dpu_kms struct, the
most straightforward way to indicate the presence of this register would be
to have a feature flag.

Changes in v2:
- Changed has_data_compress dpu_cap to a DATA_COMPRESS INTF feature flag

Signed-off-by: Jessica Zhang 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
index 7944481d0a33..c74051906d05 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
@@ -104,7 +104,7 @@
 #define INTF_SC7180_MASK \
(BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) | 
BIT(DPU_INTF_STATUS_SUPPORTED))
 
-#define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN)
+#define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN) | 
BIT(DPU_INTF_DATA_COMPRESS)
 
 #define WB_SM8250_MASK (BIT(DPU_WB_LINE_MODE) | \
 BIT(DPU_WB_UBWC) | \
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
index 4eda2cc847ef..01c65f940f2a 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
@@ -185,6 +185,7 @@ enum {
  * @DPU_DATA_HCTL_ENAllows data to be transferred at different 
rate
  *  than video timing
  * @DPU_INTF_STATUS_SUPPORTED   INTF block has INTF_STATUS register
+ * @DPU_INTF_DATA_COMPRESS  INTF block has DATA_COMPRESS register
  * @DPU_INTF_MAX
  */
 enum {
@@ -192,6 +193,7 @@ enum {
DPU_INTF_TE,
DPU_DATA_HCTL_EN,
DPU_INTF_STATUS_SUPPORTED,
+   DPU_INTF_DATA_COMPRESS,
DPU_INTF_MAX
 };
 

-- 
2.40.1



[Freedreno] [PATCH v2 2/4] drm/msm/dsi: Fix compressed word count calculation

2023-05-05 Thread Jessica Zhang
Currently, word count is calculated using slice_count. This is incorrect
as downstream uses slice per packet, which is different from
slice_count.

Slice count represents the number of soft slices per interface, and its
value will not always match that of slice per packet. For example, it is
possible to have cases where there are multiple soft slices per interface
but the panel specifies only one slice per packet.

Thus, use the default value of one slice per packet and remove slice_count
from the word count calculation.

Changes in v2:
- "drm_panel" -> "mipi_dsi_device" in TODO comment

Fixes: bc6b6ff8135c ("drm/msm/dsi: Use DSC slice(s) packet size to compute word 
count")
Signed-off-by: Jessica Zhang 
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 0e5778e8091f..f6fb32e2223c 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -999,7 +999,14 @@ static void dsi_timing_setup(struct msm_dsi_host 
*msm_host, bool is_bonded_dsi)
if (!msm_host->dsc)
wc = hdisplay * dsi_get_bpp(msm_host->format) / 8 + 1;
else
-   wc = msm_host->dsc->slice_chunk_size * 
msm_host->dsc->slice_count + 1;
+   /*
+* When DSC is enabled, WC = slice_chunk_size * 
slice_per_packet + 1.
+* Currently, the driver only supports default value of 
slice_per_packet = 1
+*
+* TODO: Expand mipi_dsi_device struct to hold 
slice_per_packet info
+*   and adjust DSC math to account for 
slice_per_packet.
+*/
+   wc = msm_host->dsc->slice_chunk_size + 1;
 
dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL,
DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) |

-- 
2.40.1



[Freedreno] [PATCH v2 1/4] drm/msm/dsi: Adjust pclk rate for compression

2023-05-05 Thread Jessica Zhang
Adjust the pclk rate to divide hdisplay by the compression ratio when DSC
is enabled.

Changes in v2:
- Adjusted pclk_rate math to divide only the hdisplay value by
  compression ratio

Signed-off-by: Jessica Zhang 
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 43a5ec33eee8..0e5778e8091f 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -561,7 +561,8 @@ void dsi_link_clk_disable_v2(struct msm_dsi_host *msm_host)
clk_disable_unprepare(msm_host->byte_clk);
 }
 
-static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode, 
bool is_bonded_dsi)
+static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode,
+   struct drm_dsc_config *dsc, bool is_bonded_dsi)
 {
unsigned long pclk_rate;
 
@@ -576,6 +577,14 @@ static unsigned long dsi_get_pclk_rate(const struct 
drm_display_mode *mode, bool
if (is_bonded_dsi)
pclk_rate /= 2;
 
+   /* If DSC is enabled, divide hdisplay by compression ratio */
+   if (dsc) {
+   int new_hdisplay = DIV_ROUND_UP(mode->hdisplay * 
msm_dsc_get_bpp_int(dsc),
+   dsc->bits_per_component * 3);
+   int fps = DIV_ROUND_UP(pclk_rate, mode->htotal * mode->vtotal);
+   pclk_rate = (new_hdisplay + (mode->htotal - mode->hdisplay)) * 
mode->vtotal * fps;
+   }
+
return pclk_rate;
 }
 
@@ -585,7 +594,7 @@ unsigned long dsi_byte_clk_get_rate(struct mipi_dsi_host 
*host, bool is_bonded_d
struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
u8 lanes = msm_host->lanes;
u32 bpp = dsi_get_bpp(msm_host->format);
-   unsigned long pclk_rate = dsi_get_pclk_rate(mode, is_bonded_dsi);
+   unsigned long pclk_rate = dsi_get_pclk_rate(mode, msm_host->dsc, 
is_bonded_dsi);
u64 pclk_bpp = (u64)pclk_rate * bpp;
 
if (lanes == 0) {
@@ -604,7 +613,7 @@ unsigned long dsi_byte_clk_get_rate(struct mipi_dsi_host 
*host, bool is_bonded_d
 
 static void dsi_calc_pclk(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
 {
-   msm_host->pixel_clk_rate = dsi_get_pclk_rate(msm_host->mode, 
is_bonded_dsi);
+   msm_host->pixel_clk_rate = dsi_get_pclk_rate(msm_host->mode, 
msm_host->dsc, is_bonded_dsi);
msm_host->byte_clk_rate = dsi_byte_clk_get_rate(&msm_host->base, 
is_bonded_dsi,
msm_host->mode);
 
@@ -634,7 +643,7 @@ int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, 
bool is_bonded_dsi)
 
dsi_calc_pclk(msm_host, is_bonded_dsi);
 
-   pclk_bpp = (u64)dsi_get_pclk_rate(msm_host->mode, is_bonded_dsi) * bpp;
+   pclk_bpp = (u64)dsi_get_pclk_rate(msm_host->mode, msm_host->dsc, 
is_bonded_dsi) * bpp;
do_div(pclk_bpp, 8);
msm_host->src_clk_rate = pclk_bpp;
 

-- 
2.40.1



Re: [Freedreno] [PATCH v2 1/9] drm/msm/dpu: fix SSPP register definitions

2023-05-05 Thread Dmitry Baryshkov
On Fri, 5 May 2023 at 20:24, Jeykumar Sankaran
 wrote:
>
>
>
> On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:
> > Reorder SSPP register definitions to sort them in the ascending order.
> > Move register bitfields after the register definitions.
> >
> > Signed-off-by: Dmitry Baryshkov 
> > ---
> >   drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 66 +++--
> >   1 file changed, 34 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c 
> > b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
> > index 6b68ec5c7a5a..1bf717290dab 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
> > @@ -26,45 +26,18 @@
> >   #define SSPP_SRC_FORMAT0x30
> >   #define SSPP_SRC_UNPACK_PATTERN0x34
> >   #define SSPP_SRC_OP_MODE   0x38
> > -
> > -/* SSPP_MULTIRECT*/
> > -#define SSPP_SRC_SIZE_REC1 0x16C
> > -#define SSPP_SRC_XY_REC1   0x168
> > -#define SSPP_OUT_SIZE_REC1 0x160
> > -#define SSPP_OUT_XY_REC1   0x164
> > -#define SSPP_SRC_FORMAT_REC1   0x174
> > -#define SSPP_SRC_UNPACK_PATTERN_REC1   0x178
> > -#define SSPP_SRC_OP_MODE_REC1  0x17C
> > -#define SSPP_MULTIRECT_OPMODE  0x170
> > -#define SSPP_SRC_CONSTANT_COLOR_REC1   0x180
> > -#define SSPP_EXCL_REC_SIZE_REC10x184
> > -#define SSPP_EXCL_REC_XY_REC1  0x188
> > -
> > -#define MDSS_MDP_OP_DEINTERLACEBIT(22)
> > -#define MDSS_MDP_OP_DEINTERLACE_ODDBIT(23)
> > -#define MDSS_MDP_OP_IGC_ROM_1  BIT(18)
> > -#define MDSS_MDP_OP_IGC_ROM_0  BIT(17)
> > -#define MDSS_MDP_OP_IGC_EN BIT(16)
> > -#define MDSS_MDP_OP_FLIP_UDBIT(14)
> > -#define MDSS_MDP_OP_FLIP_LRBIT(13)
> > -#define MDSS_MDP_OP_BWC_EN BIT(0)
> > -#define MDSS_MDP_OP_PE_OVERRIDEBIT(31)
> > -#define MDSS_MDP_OP_BWC_LOSSLESS   (0 << 1)
> > -#define MDSS_MDP_OP_BWC_Q_HIGH (1 << 1)
> > -#define MDSS_MDP_OP_BWC_Q_MED  (2 << 1)
> > -
> >   #define SSPP_SRC_CONSTANT_COLOR0x3c
> >   #define SSPP_EXCL_REC_CTL  0x40
> >   #define SSPP_UBWC_STATIC_CTRL  0x44
> > -#define SSPP_FETCH_CONFIG  0x048
> > +#define SSPP_FETCH_CONFIG  0x48
> >   #define SSPP_DANGER_LUT0x60
> >   #define SSPP_SAFE_LUT  0x64
> >   #define SSPP_CREQ_LUT  0x68
> >   #define SSPP_QOS_CTRL  0x6C
> > -#define SSPP_DECIMATION_CONFIG 0xB4
> >   #define SSPP_SRC_ADDR_SW_STATUS0x70
> >   #define SSPP_CREQ_LUT_00x74
> >   #define SSPP_CREQ_LUT_10x78
> > +#define SSPP_DECIMATION_CONFIG 0xB4
> >   #define SSPP_SW_PIX_EXT_C0_LR  0x100
> >   #define SSPP_SW_PIX_EXT_C0_TB  0x104
> >   #define SSPP_SW_PIX_EXT_C0_REQ_PIXELS  0x108
> > @@ -81,11 +54,33 @@
> >   #define SSPP_TRAFFIC_SHAPER_PREFILL0x150
> >   #define SSPP_TRAFFIC_SHAPER_REC1_PREFILL   0x154
> >   #define SSPP_TRAFFIC_SHAPER_REC1   0x158
> > +#define SSPP_OUT_SIZE_REC1 0x160
> > +#define SSPP_OUT_XY_REC1   0x164
> > +#define SSPP_SRC_XY_REC1   0x168
> > +#define SSPP_SRC_SIZE_REC1 0x16C
> > +#define SSPP_MULTIRECT_OPMODE  0x170
> > +#define SSPP_SRC_FORMAT_REC1   0x174
> > +#define SSPP_SRC_UNPACK_PATTERN_REC1   0x178
> > +#define SSPP_SRC_OP_MODE_REC1  0x17C
> > +#define SSPP_SRC_CONSTANT_COLOR_REC1   0x180
> > +#define SSPP_EXCL_REC_SIZE_REC10x184
> > +#define SSPP_EXCL_REC_XY_REC1  0x188
> >   #define SSPP_EXCL_REC_SIZE 0x1B4
> >   #define SSPP_EXCL_REC_XY   0x1B8
> > -#define SSPP_VIG_OP_MODE   0x0
> > -#define SSPP_VIG_CSC_10_OP_MODE0x0
> > -#define SSPP_TRAFFIC_SHAPER_BPC_MAX0xFF
> > +
> > +/* SSPP_SRC_OP_MODE & OP_MODE_REC1 */
> > +#define MDSS_MDP_OP_DEINTERLACEBIT(22)
> > +#define MDSS_MDP_OP_DEINTERLACE_ODDBIT(23)
> > +#define MDSS_MDP_OP_IGC_ROM_1  BIT(18)
> > +#define MDSS_MDP_OP_IGC_ROM_0  BIT(17)
> > +#define MDSS_MDP_OP_IGC_EN BIT(16)
> > +#define MDSS_MDP_OP_FLIP_UDBIT(14)
> > +#define MDSS_MDP_OP_FLIP_LRBIT(13)
> > +#define MDSS_MDP_OP_BWC_EN BIT(0)
> > +#define MDSS_MDP_OP_PE_OVERRIDEBIT(31)
> > +#define MDSS_MDP_OP_BWC_LOSSLESS   (0 << 1)
> > +#define MDSS_MDP_OP_BWC_Q_HIGH (1 << 1)
> > +#define MDSS_MDP_OP_BWC_Q_MED  (2 << 1)
> >
> >   /* SSPP_QOS_CTRL */
> >   #define SSPP_QOS_CTRL_VBLANK_ENBIT(16)
> > @@ -96,6 +91,7 @@
> >   #de

Re: [Freedreno] [PATCH 1/4] drm/msm/dsi: Adjust pclk rate for compression

2023-05-05 Thread Jessica Zhang




On 5/4/2023 2:17 PM, Marijn Suijten wrote:

On 2023-05-04 22:33:17, Marijn Suijten wrote:

Title suggestion: use the wording "reduce pclk rate" :)

(Eventually "when DSC is enabled", instead of "for compression")

On 2023-05-02 18:19:12, Jessica Zhang wrote:

Divide the pclk rate by the compression ratio when DSC is enabled

Signed-off-by: Jessica Zhang 


Thank you so much for sending this.   The compression ratio was applied
to hdisplay


In hindsight, on the note of hdisplay, dsi_timing_setup() actually only
divides the visual portion - that is hdisplay out of htotal - without
affecting the back and front porch.

Since this clock inside the mode is based on the full htotal * vtotal *
..., should we compensate for that and only divide the visual portion of
the clock signal by 3?  Otherwise we might not have enough clockticks to
perform the front and back porch (even though CMD mode doesn't really
have porches, I have yet to properly understand that part of the
signal).


Hi Marijn,

That's a fair point. Will change the pclk math accordingly.

Thanks,

Jessica Zhang



- Marijn


, but not the clocks yet, and with this patch I get a massive
reduction in clock speeds on the Xperia XZ3, without regressions nor
affecting performance/fps:

   gcc_sys_noc_cpuss_ahb_clk   1101920  
0 0  5 Y
   gcc_cpuss_ahb_clk   1101920  
0 0  5 Y
 bi_tcxo   6601920  
0 0  5 Y
dsi0vco_clk110  
[-1873793994-]{+1249195898+}  0 0  5 Y
   dsi0_pll_out_div_clk110   
[-1873793994-]{+624597949+}  0 0  5 Y
  dsi0_pll_post_out_div_clk   000   
[-468448498-]{+156149487+}  0 0  5 Y
  dsi0_pll_bit_clk 220   
[-1873793994-]{+624597949+}  0 0  5 Y
 dsi0_pclk_mux 110   
[-1873793994-]{+624597949+}  0 0  5 Y
dsi0_phy_pll_out_dsiclk   110   
[-312298999-]{+104099659+}  0 0  5 Y
   disp_cc_mdss_pclk0_clk_src   110   
[-312298999-]{+104099659+}  0 0  5 Y
  disp_cc_mdss_pclk0_clk   110   
[-312298999-]{+104099659+}  0 0  5 Y
 dsi0_pll_by_2_bit_clk   000   
[-936896997-]{+312298974+}  0 0  5 Y
 dsi0_phy_pll_out_byteclk   110
[-234224249-]{+78074743+}  0 0  5 Y
disp_cc_mdss_byte0_clk_src   220
[-234224249-]{+78074743+}  0 0  5 Y
   disp_cc_mdss_byte0_div_clk_src   110 
   [-117112125-]{+39037372+}  0 0  5 Y
  disp_cc_mdss_byte0_intf_clk   110 
   [-117112125-]{+39037372+}  0 0  5 Y
   disp_cc_mdss_byte0_clk   110
[-234224249-]{+78074743+}  0 0  5 Y
gpu_cc_pll1000   50097  
0 0  5 N
disp_cc_mdss_dp_pixel_clk_src   0001920 
 0 0  5 N
   disp_cc_mdss_dp_pixel_clk   0001920  
0 0  5 N

Reviewed-by: Marijn Suijten 


---
  drivers/gpu/drm/msm/dsi/dsi_host.c | 14 ++
  1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 43a5ec33eee8..35c69dbe5f6f 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -561,7 +561,8 @@ void dsi_link_clk_disable_v2(struct msm_dsi_host *msm_host)
clk_disable_unprepare(msm_host->byte_clk);
  }
  
-static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode, bool is_bonded_dsi)

+static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode,


It is a bit unfortunate that this function is called so often with the
same parameters, doing the same calculation over and over.


+   struct drm_dsc_config *dsc, bool is_bonded_dsi)
  {
unsigned long pclk_rate;
  
@@ -576,6 +577,11 @@ static unsigned long dsi_get_pclk_rate(const struct drm_display_mode *mode, bool

if (is_bonded_dsi)
pclk_rate /= 2;
  
+	/* If DSC is enabled, divide pclk by compression ratio */

+   if (dsc)
+   pclk_rate = DIV_ROUND_UP(pclk_rate,
+

Re: [Freedreno] [PATCH v2 1/9] drm/msm/dpu: fix SSPP register definitions

2023-05-05 Thread Jeykumar Sankaran




On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:

Reorder SSPP register definitions to sort them in the ascending order.
Move register bitfields after the register definitions.

Signed-off-by: Dmitry Baryshkov 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 66 +++--
  1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
index 6b68ec5c7a5a..1bf717290dab 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
@@ -26,45 +26,18 @@
  #define SSPP_SRC_FORMAT0x30
  #define SSPP_SRC_UNPACK_PATTERN0x34
  #define SSPP_SRC_OP_MODE   0x38
-
-/* SSPP_MULTIRECT*/
-#define SSPP_SRC_SIZE_REC1 0x16C
-#define SSPP_SRC_XY_REC1   0x168
-#define SSPP_OUT_SIZE_REC1 0x160
-#define SSPP_OUT_XY_REC1   0x164
-#define SSPP_SRC_FORMAT_REC1   0x174
-#define SSPP_SRC_UNPACK_PATTERN_REC1   0x178
-#define SSPP_SRC_OP_MODE_REC1  0x17C
-#define SSPP_MULTIRECT_OPMODE  0x170
-#define SSPP_SRC_CONSTANT_COLOR_REC1   0x180
-#define SSPP_EXCL_REC_SIZE_REC10x184
-#define SSPP_EXCL_REC_XY_REC1  0x188
-
-#define MDSS_MDP_OP_DEINTERLACEBIT(22)
-#define MDSS_MDP_OP_DEINTERLACE_ODDBIT(23)
-#define MDSS_MDP_OP_IGC_ROM_1  BIT(18)
-#define MDSS_MDP_OP_IGC_ROM_0  BIT(17)
-#define MDSS_MDP_OP_IGC_EN BIT(16)
-#define MDSS_MDP_OP_FLIP_UDBIT(14)
-#define MDSS_MDP_OP_FLIP_LRBIT(13)
-#define MDSS_MDP_OP_BWC_EN BIT(0)
-#define MDSS_MDP_OP_PE_OVERRIDEBIT(31)
-#define MDSS_MDP_OP_BWC_LOSSLESS   (0 << 1)
-#define MDSS_MDP_OP_BWC_Q_HIGH (1 << 1)
-#define MDSS_MDP_OP_BWC_Q_MED  (2 << 1)
-
  #define SSPP_SRC_CONSTANT_COLOR0x3c
  #define SSPP_EXCL_REC_CTL  0x40
  #define SSPP_UBWC_STATIC_CTRL  0x44
-#define SSPP_FETCH_CONFIG  0x048
+#define SSPP_FETCH_CONFIG  0x48
  #define SSPP_DANGER_LUT0x60
  #define SSPP_SAFE_LUT  0x64
  #define SSPP_CREQ_LUT  0x68
  #define SSPP_QOS_CTRL  0x6C
-#define SSPP_DECIMATION_CONFIG 0xB4
  #define SSPP_SRC_ADDR_SW_STATUS0x70
  #define SSPP_CREQ_LUT_00x74
  #define SSPP_CREQ_LUT_10x78
+#define SSPP_DECIMATION_CONFIG 0xB4
  #define SSPP_SW_PIX_EXT_C0_LR  0x100
  #define SSPP_SW_PIX_EXT_C0_TB  0x104
  #define SSPP_SW_PIX_EXT_C0_REQ_PIXELS  0x108
@@ -81,11 +54,33 @@
  #define SSPP_TRAFFIC_SHAPER_PREFILL0x150
  #define SSPP_TRAFFIC_SHAPER_REC1_PREFILL   0x154
  #define SSPP_TRAFFIC_SHAPER_REC1   0x158
+#define SSPP_OUT_SIZE_REC1 0x160
+#define SSPP_OUT_XY_REC1   0x164
+#define SSPP_SRC_XY_REC1   0x168
+#define SSPP_SRC_SIZE_REC1 0x16C
+#define SSPP_MULTIRECT_OPMODE  0x170
+#define SSPP_SRC_FORMAT_REC1   0x174
+#define SSPP_SRC_UNPACK_PATTERN_REC1   0x178
+#define SSPP_SRC_OP_MODE_REC1  0x17C
+#define SSPP_SRC_CONSTANT_COLOR_REC1   0x180
+#define SSPP_EXCL_REC_SIZE_REC10x184
+#define SSPP_EXCL_REC_XY_REC1  0x188
  #define SSPP_EXCL_REC_SIZE 0x1B4
  #define SSPP_EXCL_REC_XY   0x1B8
-#define SSPP_VIG_OP_MODE   0x0
-#define SSPP_VIG_CSC_10_OP_MODE0x0
-#define SSPP_TRAFFIC_SHAPER_BPC_MAX0xFF
+
+/* SSPP_SRC_OP_MODE & OP_MODE_REC1 */
+#define MDSS_MDP_OP_DEINTERLACEBIT(22)
+#define MDSS_MDP_OP_DEINTERLACE_ODDBIT(23)
+#define MDSS_MDP_OP_IGC_ROM_1  BIT(18)
+#define MDSS_MDP_OP_IGC_ROM_0  BIT(17)
+#define MDSS_MDP_OP_IGC_EN BIT(16)
+#define MDSS_MDP_OP_FLIP_UDBIT(14)
+#define MDSS_MDP_OP_FLIP_LRBIT(13)
+#define MDSS_MDP_OP_BWC_EN BIT(0)
+#define MDSS_MDP_OP_PE_OVERRIDEBIT(31)
+#define MDSS_MDP_OP_BWC_LOSSLESS   (0 << 1)
+#define MDSS_MDP_OP_BWC_Q_HIGH (1 << 1)
+#define MDSS_MDP_OP_BWC_Q_MED  (2 << 1)
  
  /* SSPP_QOS_CTRL */

  #define SSPP_QOS_CTRL_VBLANK_ENBIT(16)
@@ -96,6 +91,7 @@
  #define SSPP_QOS_CTRL_CREQ_VBLANK_OFF  20
  
  /* DPU_SSPP_SCALER_QSEED2 */

+#define SSPP_VIG_OP_MODE   0x0
  #define SCALE_CONFIG   0x04
  #define COMP0_3_PHASE_STEP_X   0x10
  #define COMP0_3_PHASE_STEP_Y   0x14
@@ -107,6 +103,12 @@
  #define COMP1_2_INIT_PHASE_Y   0x2C
  #define VIG_0_QSEED2_SHARP 0x30
  
+/* DPU_SSPP_CSC_10BIT space */

+#define SSPP_VIG_C

Re: [Freedreno] [PATCH v2 9/9] drm/msm/dpu: use common helper for WB and SSPP QoS setup

2023-05-05 Thread Jeykumar Sankaran




On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:

Rework SSPP and WB code to use common helper for programming QoS
settings.

Signed-off-by: Dmitry Baryshkov 
---
  .../drm/msm/disp/dpu1/dpu_encoder_phys_wb.c   |  4 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c   | 31 ++-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h   | 19 +
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c   | 31 +++
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h   | 21 +
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c | 29 +--
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h | 16 +---
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 85 +++
  8 files changed, 100 insertions(+), 136 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
index e7b65f6f53d6..023a9c4ad1db 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
@@ -102,7 +102,7 @@ static void dpu_encoder_phys_wb_set_qos_remap(
  static void dpu_encoder_phys_wb_set_qos(struct dpu_encoder_phys *phys_enc)
  {
struct dpu_hw_wb *hw_wb;
-   struct dpu_hw_wb_qos_cfg qos_cfg;
+   struct dpu_hw_qos_cfg qos_cfg;
const struct dpu_mdss_cfg *catalog;
const struct dpu_qos_lut_tbl *qos_lut_tb;
  
@@ -115,7 +115,7 @@ static void dpu_encoder_phys_wb_set_qos(struct dpu_encoder_phys *phys_enc)
  
  	hw_wb = phys_enc->hw_wb;
  
-	memset(&qos_cfg, 0, sizeof(struct dpu_hw_wb_qos_cfg));

+   memset(&qos_cfg, 0, sizeof(struct dpu_hw_qos_cfg));
qos_cfg.danger_safe_en = true;
qos_cfg.danger_lut =
catalog->perf->danger_lut_tbl[DPU_QOS_LUT_USAGE_NRT];
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
index 2533c4629021..c35e9faf2460 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
@@ -541,30 +541,15 @@ static void dpu_hw_sspp_setup_solidfill(struct 
dpu_sw_pipe *pipe, u32 color)
color);
  }
  
-static void dpu_hw_sspp_setup_danger_safe_lut(struct dpu_hw_sspp *ctx,

-   u32 danger_lut,
-   u32 safe_lut)
+static void dpu_hw_sspp_setup_qos_lut(struct dpu_hw_sspp *ctx,
+ struct dpu_hw_qos_cfg *cfg)
  {
-   if (!ctx)
-   return;
-
-   DPU_REG_WRITE(&ctx->hw, SSPP_DANGER_LUT, danger_lut);
-   DPU_REG_WRITE(&ctx->hw, SSPP_SAFE_LUT, safe_lut);
-}
-
-static void dpu_hw_sspp_setup_creq_lut(struct dpu_hw_sspp *ctx,
-   u64 creq_lut)
-{
-   if (!ctx)
+   if (!ctx || !cfg)
return;
  
-	if (ctx->cap && test_bit(DPU_SSPP_QOS_8LVL, &ctx->cap->features)) {

-   DPU_REG_WRITE(&ctx->hw, SSPP_CREQ_LUT_0, creq_lut);
-   DPU_REG_WRITE(&ctx->hw, SSPP_CREQ_LUT_1,
-   creq_lut >> 32);
-   } else {
-   DPU_REG_WRITE(&ctx->hw, SSPP_CREQ_LUT, creq_lut);
-   }
+   _dpu_hw_setup_qos_lut(&ctx->hw, SSPP_DANGER_LUT,
+ test_bit(DPU_SSPP_QOS_8LVL, &ctx->cap->features),
+ cfg);
  }
  
  static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_sspp *ctx,

@@ -606,9 +591,7 @@ static void _setup_layer_ops(struct dpu_hw_sspp *c,
c->ops.setup_pe = dpu_hw_sspp_setup_pe_config;
  
  	if (test_bit(DPU_SSPP_QOS, &features)) {

-   c->ops.setup_danger_safe_lut =
-   dpu_hw_sspp_setup_danger_safe_lut;
-   c->ops.setup_creq_lut = dpu_hw_sspp_setup_creq_lut;
+   c->ops.setup_qos_lut = dpu_hw_sspp_setup_qos_lut;
c->ops.setup_qos_ctrl = dpu_hw_sspp_setup_qos_ctrl;
}
  
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h

index 4278c421b6ac..085f34bc6b88 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
@@ -254,25 +254,14 @@ struct dpu_hw_sspp_ops {
void (*setup_sharpening)(struct dpu_hw_sspp *ctx,
struct dpu_hw_sharp_cfg *cfg);
  
-	/**

-* setup_danger_safe_lut - setup danger safe LUTs
-* @ctx: Pointer to pipe context
-* @danger_lut: LUT for generate danger level based on fill level
-* @safe_lut: LUT for generate safe level based on fill level
-*
-*/
-   void (*setup_danger_safe_lut)(struct dpu_hw_sspp *ctx,
-   u32 danger_lut,
-   u32 safe_lut);
  
  	/**

-* setup_creq_lut - setup CREQ LUT
+* setup_qos_lut - setup QoS LUTs
 * @ctx: Pointer to pipe context
-* @creq_lut: LUT for generate creq level based on fill level
-*
+* @cfg: LUT configuration
 */
-   void (*setup_creq_lut)(struct dpu_hw_sspp *ctx,
-   u6

Re: [Freedreno] [PATCH v2 8/9] drm/msm/dpu: remove struct dpu_hw_pipe_qos_cfg

2023-05-05 Thread Jeykumar Sankaran




On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:

Now as the struct dpu_hw_pipe_qos_cfg consists of only one bool field,
drop the structure and use corresponding bool directly.

Signed-off-by: Dmitry Baryshkov 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 10 +++---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 13 ++---
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c   | 11 +++
  3 files changed, 8 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
index 341e3a8fc927..2533c4629021 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
@@ -568,17 +568,13 @@ static void dpu_hw_sspp_setup_creq_lut(struct dpu_hw_sspp 
*ctx,
  }
  
  static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_sspp *ctx,

-   struct dpu_hw_pipe_qos_cfg *cfg)
+  bool danger_safe_en)
  {
-   u32 qos_ctrl = 0;
-
if (!ctx)
return;
  
-	if (cfg->danger_safe_en)

-   qos_ctrl |= SSPP_QOS_CTRL_DANGER_SAFE_EN;
-
-   DPU_REG_WRITE(&ctx->hw, SSPP_QOS_CTRL, qos_ctrl);
+   DPU_REG_WRITE(&ctx->hw, SSPP_QOS_CTRL,
+ danger_safe_en ? SSPP_QOS_CTRL_DANGER_SAFE_EN : 0);
  }
  
  static void dpu_hw_sspp_setup_cdp(struct dpu_sw_pipe *pipe,

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
index aaf6f41d546c..4278c421b6ac 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
@@ -163,14 +163,6 @@ struct dpu_sw_pipe_cfg {
struct drm_rect dst_rect;
  };
  
-/**

- * struct dpu_hw_pipe_qos_cfg : Source pipe QoS configuration
- * @danger_safe_en: enable danger safe generation
- */
-struct dpu_hw_pipe_qos_cfg {
-   bool danger_safe_en;
-};
-
  /**
   * struct dpu_hw_pipe_ts_cfg - traffic shaper configuration
   * @size: size to prefill in bytes, or zero to disable
@@ -285,11 +277,10 @@ struct dpu_hw_sspp_ops {
/**
 * setup_qos_ctrl - setup QoS control
 * @ctx: Pointer to pipe context
-* @cfg: Pointer to pipe QoS configuration
-*
+* @danger_safe_en: flags controlling enabling of danger/safe QoS/LUT
 */
void (*setup_qos_ctrl)(struct dpu_hw_sspp *ctx,
-   struct dpu_hw_pipe_qos_cfg *cfg);
+  bool danger_safe_en);
  
  	/**

 * setup_histogram - setup histograms
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index d1443c4b2915..c8837d0aa0c3 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -343,22 +343,17 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane 
*plane,
bool enable)
  {
struct dpu_plane *pdpu = to_dpu_plane(plane);
-   struct dpu_hw_pipe_qos_cfg pipe_qos_cfg;
-
-   memset(&pipe_qos_cfg, 0, sizeof(pipe_qos_cfg));
-
-   pipe_qos_cfg.danger_safe_en = enable;
  
  	if (!pdpu->is_rt_pipe)

-   pipe_qos_cfg.danger_safe_en = false;
+   enable = false;
  
  	DPU_DEBUG_PLANE(pdpu, "pnum:%d ds:%d is_rt:%d\n",

pdpu->pipe - SSPP_VIG0,
-   pipe_qos_cfg.danger_safe_en,
+   enable,
pdpu->is_rt_pipe);
  
  	pipe->sspp->ops.setup_qos_ctrl(pipe->sspp,

-   &pipe_qos_cfg);
+  enable);
  }
  
  /**

Reviewed-by: Jeykumar Sankaran 


Re: [Freedreno] [PATCH v2 7/9] drm/msm/dpu: drop DPU_PLANE_QOS_PANIC_CTRL

2023-05-05 Thread Jeykumar Sankaran




On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:

This flag is always passed to _dpu_plane_set_qos_ctrl(), so drop it and
remove corresponding conditions from the mentioned function.

Signed-off-by: Dmitry Baryshkov 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 27 +++
  1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 0ed350776775..d1443c4b2915 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -70,15 +70,6 @@ static const uint32_t qcom_compressed_supported_formats[] = {
DRM_FORMAT_P010,
  };
  
-/**

- * enum dpu_plane_qos - Different qos configurations for each pipe
- *
- * @DPU_PLANE_QOS_PANIC_CTRL: Setup panic for the pipe.
- */
-enum dpu_plane_qos {
-   DPU_PLANE_QOS_PANIC_CTRL = BIT(2),
-};
-
  /*
   * struct dpu_plane - local dpu plane structure
   * @aspace: address space pointer
@@ -349,15 +340,14 @@ static void _dpu_plane_set_danger_lut(struct drm_plane 
*plane,
   */
  static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane,
struct dpu_sw_pipe *pipe,
-   bool enable, u32 flags)
+   bool enable)
  {
struct dpu_plane *pdpu = to_dpu_plane(plane);
struct dpu_hw_pipe_qos_cfg pipe_qos_cfg;
  
  	memset(&pipe_qos_cfg, 0, sizeof(pipe_qos_cfg));
  
-	if (flags & DPU_PLANE_QOS_PANIC_CTRL)

-   pipe_qos_cfg.danger_safe_en = enable;
+   pipe_qos_cfg.danger_safe_en = enable;
  
  	if (!pdpu->is_rt_pipe)

pipe_qos_cfg.danger_safe_en = false;
@@ -1058,7 +1048,7 @@ static void dpu_plane_sspp_update_pipe(struct drm_plane 
*plane,
  
  	/* override for color fill */

if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) {
-   _dpu_plane_set_qos_ctrl(plane, pipe, false, 
DPU_PLANE_QOS_PANIC_CTRL);
+   _dpu_plane_set_qos_ctrl(plane, pipe, false);
  
  		/* skip remaining processing on color fill */

return;
@@ -1104,8 +1094,7 @@ static void dpu_plane_sspp_update_pipe(struct drm_plane 
*plane,
_dpu_plane_set_danger_lut(plane, pipe, fmt);
_dpu_plane_set_qos_ctrl(plane, pipe,
pipe->sspp->idx != SSPP_CURSOR0 &&
-   pipe->sspp->idx != SSPP_CURSOR1,
-   DPU_PLANE_QOS_PANIC_CTRL);
+   pipe->sspp->idx != SSPP_CURSOR1);
  
  	if (pipe->sspp->idx != SSPP_CURSOR0 &&

pipe->sspp->idx != SSPP_CURSOR1)
@@ -1224,10 +1213,10 @@ static void dpu_plane_destroy(struct drm_plane *plane)
  
  	if (pdpu) {

pstate = to_dpu_plane_state(plane->state);
-   _dpu_plane_set_qos_ctrl(plane, &pstate->pipe, false, 
DPU_PLANE_QOS_PANIC_CTRL);
+   _dpu_plane_set_qos_ctrl(plane, &pstate->pipe, false);
  
  		if (pstate->r_pipe.sspp)

-   _dpu_plane_set_qos_ctrl(plane, &pstate->r_pipe, false, 
DPU_PLANE_QOS_PANIC_CTRL);
+   _dpu_plane_set_qos_ctrl(plane, &pstate->r_pipe, false);
  
  		mutex_destroy(&pdpu->lock);
  
@@ -1384,9 +1373,9 @@ void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)

return;
  
  	pm_runtime_get_sync(&dpu_kms->pdev->dev);

-   _dpu_plane_set_qos_ctrl(plane, &pstate->pipe, enable, 
DPU_PLANE_QOS_PANIC_CTRL);
+   _dpu_plane_set_qos_ctrl(plane, &pstate->pipe, enable);
if (pstate->r_pipe.sspp)
-   _dpu_plane_set_qos_ctrl(plane, &pstate->r_pipe, enable, 
DPU_PLANE_QOS_PANIC_CTRL);
+   _dpu_plane_set_qos_ctrl(plane, &pstate->r_pipe, enable);
pm_runtime_put_sync(&dpu_kms->pdev->dev);
  }
  #endif

Reviewed-by: Jeykumar Sankaran 


Re: [Freedreno] [PATCH v2 6/9] drm/msm/dpu: simplify qos_ctrl handling

2023-05-05 Thread Jeykumar Sankaran




On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:

After removal of DPU_PLANE_QOS_VBLANK_CTRL, several fields of struct
dpu_hw_pipe_qos_cfg are fixed to false/0. Drop them from the structure
(and drop the corresponding code from the functions).

The DPU_PLANE_QOS_VBLANK_AMORTIZE flag is also removed, since it is now
a NOP.

Signed-off-by: Dmitry Baryshkov 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 10 --
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h |  6 --
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c   | 17 ++---
  3 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
index b198def5534b..341e3a8fc927 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
@@ -575,16 +575,6 @@ static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_sspp 
*ctx,
if (!ctx)
return;
  
-	if (cfg->vblank_en) {

-   qos_ctrl |= ((cfg->creq_vblank &
-   SSPP_QOS_CTRL_CREQ_VBLANK_MASK) <<
-   SSPP_QOS_CTRL_CREQ_VBLANK_OFF);
-   qos_ctrl |= ((cfg->danger_vblank &
-   SSPP_QOS_CTRL_DANGER_VBLANK_MASK) <<
-   SSPP_QOS_CTRL_DANGER_VBLANK_OFF);
-   qos_ctrl |= SSPP_QOS_CTRL_VBLANK_EN;
-   }
-
if (cfg->danger_safe_en)
qos_ctrl |= SSPP_QOS_CTRL_DANGER_SAFE_EN;
  
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h

index 86bf4b2cda77..aaf6f41d546c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
@@ -165,15 +165,9 @@ struct dpu_sw_pipe_cfg {
  
  /**

   * struct dpu_hw_pipe_qos_cfg : Source pipe QoS configuration
- * @creq_vblank: creq value generated to vbif during vertical blanking
- * @danger_vblank: danger value generated during vertical blanking
- * @vblank_en: enable creq_vblank and danger_vblank during vblank
   * @danger_safe_en: enable danger safe generation
   */
  struct dpu_hw_pipe_qos_cfg {
-   u32 creq_vblank;
-   u32 danger_vblank;
-   bool vblank_en;
bool danger_safe_en;
  };
  
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

index 3cb891917b65..0ed350776775 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -73,12 +73,9 @@ static const uint32_t qcom_compressed_supported_formats[] = {
  /**
   * enum dpu_plane_qos - Different qos configurations for each pipe
   *
- * @DPU_PLANE_QOS_VBLANK_AMORTIZE: Enables Amortization within pipe.
- * this configuration is mutually exclusive from VBLANK_CTRL.
   * @DPU_PLANE_QOS_PANIC_CTRL: Setup panic for the pipe.
   */
  enum dpu_plane_qos {
-   DPU_PLANE_QOS_VBLANK_AMORTIZE = BIT(1),
DPU_PLANE_QOS_PANIC_CTRL = BIT(2),
  };
  
@@ -359,25 +356,15 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane,
  
  	memset(&pipe_qos_cfg, 0, sizeof(pipe_qos_cfg));
  
-	if (flags & DPU_PLANE_QOS_VBLANK_AMORTIZE) {

-   pipe_qos_cfg.vblank_en = false;
-   pipe_qos_cfg.creq_vblank = 0; /* clear vblank bits */
-   }
-
if (flags & DPU_PLANE_QOS_PANIC_CTRL)
pipe_qos_cfg.danger_safe_en = enable;
  
-	if (!pdpu->is_rt_pipe) {

-   pipe_qos_cfg.vblank_en = false;
+   if (!pdpu->is_rt_pipe)
pipe_qos_cfg.danger_safe_en = false;
-   }
  
-	DPU_DEBUG_PLANE(pdpu, "pnum:%d ds:%d vb:%d pri[0x%x, 0x%x] is_rt:%d\n",

+   DPU_DEBUG_PLANE(pdpu, "pnum:%d ds:%d is_rt:%d\n",
pdpu->pipe - SSPP_VIG0,
pipe_qos_cfg.danger_safe_en,
-   pipe_qos_cfg.vblank_en,
-   pipe_qos_cfg.creq_vblank,
-   pipe_qos_cfg.danger_vblank,
pdpu->is_rt_pipe);
  
  	pipe->sspp->ops.setup_qos_ctrl(pipe->sspp,

Reviewed-by: Jeykumar Sankaran 


Re: [Freedreno] [PATCH v2 5/9] drm/msm/dpu: drop DPU_PLANE_QOS_VBLANK_CTRL

2023-05-05 Thread Jeykumar Sankaran




On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:

Drop support for DPU_PLANE_QOS_VBLANK_CTRL flag. It is not used both
in upstream driver and in vendor SDE driver.

Signed-off-by: Dmitry Baryshkov 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |  4 
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c|  8 
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c  | 10 --
  3 files changed, 22 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
index b2831b45ac64..d47e7061a36b 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
@@ -371,8 +371,6 @@ struct dpu_caps {
  /**
   * struct dpu_sspp_sub_blks : SSPP sub-blocks
   * common: Pointer to common configurations shared by sub blocks
- * @creq_vblank: creq priority during vertical blanking
- * @danger_vblank: danger priority during vertical blanking
   * @maxdwnscale: max downscale ratio supported(without DECIMATION)
   * @maxupscale:  maxupscale ratio supported
   * @smart_dma_priority: hw priority of rect1 of multirect pipe
@@ -387,8 +385,6 @@ struct dpu_caps {
   * @dpu_rotation_cfg: inline rotation configuration
   */
  struct dpu_sspp_sub_blks {
-   u32 creq_vblank;
-   u32 danger_vblank;
u32 maxdwnscale;
u32 maxupscale;
u32 smart_dma_priority;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
index 731199030336..b198def5534b 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
@@ -697,14 +697,6 @@ int _dpu_hw_sspp_init_debugfs(struct dpu_hw_sspp *hw_pipe, 
struct dpu_kms *kms,
0400,
debugfs_root,
(u32 *) &cfg->clk_ctrl);
-   debugfs_create_x32("creq_vblank",
-   0600,
-   debugfs_root,
-   (u32 *) &sblk->creq_vblank);
-   debugfs_create_x32("danger_vblank",
-   0600,
-   debugfs_root,
-   (u32 *) &sblk->danger_vblank);
  
  	return 0;

  }
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 586f089756fa..3cb891917b65 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -73,13 +73,11 @@ static const uint32_t qcom_compressed_supported_formats[] = 
{
  /**
   * enum dpu_plane_qos - Different qos configurations for each pipe
   *
- * @DPU_PLANE_QOS_VBLANK_CTRL: Setup VBLANK qos for the pipe.
   * @DPU_PLANE_QOS_VBLANK_AMORTIZE: Enables Amortization within pipe.
   *this configuration is mutually exclusive from VBLANK_CTRL.
   * @DPU_PLANE_QOS_PANIC_CTRL: Setup panic for the pipe.
   */
  enum dpu_plane_qos {
-   DPU_PLANE_QOS_VBLANK_CTRL = BIT(0),
DPU_PLANE_QOS_VBLANK_AMORTIZE = BIT(1),
DPU_PLANE_QOS_PANIC_CTRL = BIT(2),
  };
@@ -361,15 +359,7 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane 
*plane,
  
  	memset(&pipe_qos_cfg, 0, sizeof(pipe_qos_cfg));
  
-	if (flags & DPU_PLANE_QOS_VBLANK_CTRL) {

-   pipe_qos_cfg.creq_vblank = pipe->sspp->cap->sblk->creq_vblank;
-   pipe_qos_cfg.danger_vblank =
-   pipe->sspp->cap->sblk->danger_vblank;
-   pipe_qos_cfg.vblank_en = enable;
-   }
-
if (flags & DPU_PLANE_QOS_VBLANK_AMORTIZE) {
-   /* this feature overrules previous VBLANK_CTRL */
pipe_qos_cfg.vblank_en = false;
pipe_qos_cfg.creq_vblank = 0; /* clear vblank bits */
}

Reviewed-by: Jeykumar Sankaran 


Re: [Freedreno] [PATCH v2 4/9] drm/msm/dpu: rearrange QoS setting code

2023-05-05 Thread Jeykumar Sankaran




On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:

Slightly rearrainge code in dpu_plane_sspp_update_pipe() to group
QoS/LUT related functions.

Signed-off-by: Dmitry Baryshkov 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 12 +++-
  1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index b8ed7247a6af..586f089756fa 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1079,10 +1079,10 @@ static void dpu_plane_sspp_update_pipe(struct drm_plane 
*plane,
pipe->sspp->ops.setup_sourceaddress(pipe, layout);
}
  
-	_dpu_plane_set_qos_ctrl(plane, pipe, false, DPU_PLANE_QOS_PANIC_CTRL);

-
/* override for color fill */
if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) {
+   _dpu_plane_set_qos_ctrl(plane, pipe, false, 
DPU_PLANE_QOS_PANIC_CTRL);
+
/* skip remaining processing on color fill */
return;
}
@@ -1125,12 +1125,14 @@ static void dpu_plane_sspp_update_pipe(struct drm_plane 
*plane,
  
  	_dpu_plane_set_qos_lut(plane, pipe, fmt, pipe_cfg);

_dpu_plane_set_danger_lut(plane, pipe, fmt);
+   _dpu_plane_set_qos_ctrl(plane, pipe,
+   pipe->sspp->idx != SSPP_CURSOR0 &&
+   pipe->sspp->idx != SSPP_CURSOR1,
+   DPU_PLANE_QOS_PANIC_CTRL);
  
  	if (pipe->sspp->idx != SSPP_CURSOR0 &&

-   pipe->sspp->idx != SSPP_CURSOR1) {
-   _dpu_plane_set_qos_ctrl(plane, pipe, true, 
DPU_PLANE_QOS_PANIC_CTRL);
+   pipe->sspp->idx != SSPP_CURSOR1)
_dpu_plane_set_ot_limit(plane, pipe, pipe_cfg, frame_rate);
-   }
  
  	if (pstate->needs_qos_remap)

_dpu_plane_set_qos_remap(plane, pipe);

Reviewed-by: Jeykumar Sankaran 


Re: [Freedreno] [PATCH v2 3/9] drm/msm/dpu: fix the condition for (not) applying QoS to CURSOR SSPP

2023-05-05 Thread Jeykumar Sankaran




On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:

The function dpu_plane_sspp_update_pipe() contains code to skip enabling
the QoS and OT limitis for CURSOR pipes. However all DPU since sdm845
repurpose DMA SSPP for the cursor planes because they lack the real
CURSOR SSPP. Fix the condition to actually check that the plane is
CURSOR or not.

Signed-off-by: Dmitry Baryshkov 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 3b210320ea62..b8ed7247a6af 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1126,7 +1126,8 @@ static void dpu_plane_sspp_update_pipe(struct drm_plane 
*plane,
_dpu_plane_set_qos_lut(plane, pipe, fmt, pipe_cfg);
_dpu_plane_set_danger_lut(plane, pipe, fmt);
  
-	if (plane->type != DRM_PLANE_TYPE_CURSOR) {

+   if (pipe->sspp->idx != SSPP_CURSOR0 &&
+   pipe->sspp->idx != SSPP_CURSOR1) {
_dpu_plane_set_qos_ctrl(plane, pipe, true, 
DPU_PLANE_QOS_PANIC_CTRL);
_dpu_plane_set_ot_limit(plane, pipe, pipe_cfg, frame_rate);
}

Reviewed-by: Jeykumar Sankaran 


Re: [Freedreno] [PATCH v2 2/9] drm/msm/dpu: simplify CDP programming

2023-05-05 Thread Jeykumar Sankaran




On 5/2/2023 8:05 AM, Dmitry Baryshkov wrote:

Get rid of intermediatory configuration structure and defines. Pass the
format and the enablement bit directly to the new helper. The
WB_CDP_CNTL register ignores BIT(2), so we can write it for both SSPP
and WB CDP settings.

Signed-off-by: Dmitry Baryshkov 
---
  .../drm/msm/disp/dpu1/dpu_encoder_phys_wb.c   | 17 ---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c   | 17 ---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h   | 14 -
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c   | 21 +++
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h   | 19 +++--
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c | 19 -
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h | 11 ++
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 16 +++---
  8 files changed, 45 insertions(+), 89 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
index bac4aa807b4b..e7b65f6f53d6 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
@@ -140,7 +140,6 @@ static void dpu_encoder_phys_wb_setup_fb(struct 
dpu_encoder_phys *phys_enc,
struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
struct dpu_hw_wb *hw_wb;
struct dpu_hw_wb_cfg *wb_cfg;
-   struct dpu_hw_cdp_cfg cdp_cfg;
  
  	if (!phys_enc || !phys_enc->dpu_kms || !phys_enc->dpu_kms->catalog) {

DPU_ERROR("invalid encoder\n");
@@ -163,18 +162,10 @@ static void dpu_encoder_phys_wb_setup_fb(struct 
dpu_encoder_phys *phys_enc,
hw_wb->ops.setup_outformat(hw_wb, wb_cfg);
  
  	if (hw_wb->ops.setup_cdp) {

-   memset(&cdp_cfg, 0, sizeof(struct dpu_hw_cdp_cfg));
-
-   cdp_cfg.enable = phys_enc->dpu_kms->catalog->perf->cdp_cfg
-   [DPU_PERF_CDP_USAGE_NRT].wr_enable;
-   cdp_cfg.ubwc_meta_enable =
-   DPU_FORMAT_IS_UBWC(wb_cfg->dest.format);
-   cdp_cfg.tile_amortize_enable =
-   DPU_FORMAT_IS_UBWC(wb_cfg->dest.format) ||
-   DPU_FORMAT_IS_TILE(wb_cfg->dest.format);
-   cdp_cfg.preload_ahead = DPU_WB_CDP_PRELOAD_AHEAD_64;
-
-   hw_wb->ops.setup_cdp(hw_wb, &cdp_cfg);
+   const struct dpu_perf_cfg *perf = 
phys_enc->dpu_kms->catalog->perf;
+
+   hw_wb->ops.setup_cdp(hw_wb, wb_cfg->dest.format,
+
perf->cdp_cfg[DPU_PERF_CDP_USAGE_NRT].wr_enable);
}
  
  	if (hw_wb->ops.setup_outaddress)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
index 1bf717290dab..731199030336 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
@@ -592,13 +592,13 @@ static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_sspp 
*ctx,
  }
  
  static void dpu_hw_sspp_setup_cdp(struct dpu_sw_pipe *pipe,

-   struct dpu_hw_cdp_cfg *cfg)
+ const struct dpu_format *fmt,
+ bool enable)
  {
struct dpu_hw_sspp *ctx = pipe->sspp;
-   u32 cdp_cntl = 0;
u32 cdp_cntl_offset = 0;
  
-	if (!ctx || !cfg)

+   if (!ctx)
return;
  
  	if (pipe->multirect_index == DPU_SSPP_RECT_SOLO ||

@@ -607,16 +607,7 @@ static void dpu_hw_sspp_setup_cdp(struct dpu_sw_pipe *pipe,
else
cdp_cntl_offset = SSPP_CDP_CNTL_REC1;
  
-	if (cfg->enable)

-   cdp_cntl |= BIT(0);
-   if (cfg->ubwc_meta_enable)
-   cdp_cntl |= BIT(1);
-   if (cfg->tile_amortize_enable)
-   cdp_cntl |= BIT(2);
-   if (cfg->preload_ahead == DPU_SSPP_CDP_PRELOAD_AHEAD_64)
-   cdp_cntl |= BIT(3);
-
-   DPU_REG_WRITE(&ctx->hw, cdp_cntl_offset, cdp_cntl);
+   dpu_setup_cdp(&ctx->hw, cdp_cntl_offset, fmt, enable);
  }
  
  static void _setup_layer_ops(struct dpu_hw_sspp *c,

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
index 7a8d11ba618d..86bf4b2cda77 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
@@ -177,14 +177,6 @@ struct dpu_hw_pipe_qos_cfg {
bool danger_safe_en;
  };
  
-/**

- * enum CDP preload ahead address size
- */
-enum {
-   DPU_SSPP_CDP_PRELOAD_AHEAD_32,
-   DPU_SSPP_CDP_PRELOAD_AHEAD_64
-};
-
  /**
   * struct dpu_hw_pipe_ts_cfg - traffic shaper configuration
   * @size: size to prefill in bytes, or zero to disable
@@ -331,10 +323,12 @@ struct dpu_hw_sspp_ops {
/**
 * setup_cdp - setup client driven prefetch
 * @pipe: Pointer to software pipe context
-* @cfg: Pointer to cdp configuration
+* @fmt: format 

Re: [Freedreno] [PATCH v2 03/13] dt-bindings: display/msm: Add SM6350 DPU

2023-05-05 Thread Konrad Dybcio



On 25.04.2023 19:03, Rob Herring wrote:
> On Fri, Apr 21, 2023 at 12:31:12AM +0200, Konrad Dybcio wrote:
>> Document the SM6350 DPU.
>>
>> Signed-off-by: Konrad Dybcio 
>> ---
>>  .../bindings/display/msm/qcom,sm6350-dpu.yaml  | 94 
>> ++
>>  1 file changed, 94 insertions(+)
>>
>> diff --git 
>> a/Documentation/devicetree/bindings/display/msm/qcom,sm6350-dpu.yaml 
>> b/Documentation/devicetree/bindings/display/msm/qcom,sm6350-dpu.yaml
>> new file mode 100644
>> index ..979fcf81afc9
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/display/msm/qcom,sm6350-dpu.yaml
>> @@ -0,0 +1,94 @@
>> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/display/msm/qcom,sm6350-dpu.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Qualcomm Display DPU dt properties for SM6350 target
>> +
>> +maintainers:
>> +  - Konrad Dybcio 
>> +
>> +$ref: /schemas/display/msm/dpu-common.yaml#
>> +
>> +properties:
>> +  compatible:
>> +items:
>> +  - const: qcom,sm6350-dpu
>> +
>> +  reg:
>> +items:
>> +  - description: Address offset and size for mdp register set
>> +  - description: Address offset and size for vbif register set
>> +
>> +  reg-names:
>> +items:
>> +  - const: mdp
>> +  - const: vbif
>> +
>> +  clocks:
>> +items:
>> +  - description: Display axi clock
>> +  - description: Display ahb clock
>> +  - description: Display rot clock
>> +  - description: Display lut clock
>> +  - description: Display core clock
>> +  - description: Display vsync clock
>> +
>> +  clock-names:
>> +items:
>> +  - const: bus
>> +  - const: iface
>> +  - const: rot
>> +  - const: lut
>> +  - const: core
>> +  - const: vsync
> 
> Is there some reason the clocks are in different order?
Nope, I'll sort this out

They appear to 
> be the same minus the 'throttle' clock. Is there really no 'throttle' 
> clock?
Looks like GCC_DISP_THROTTLE_AXI_CLK does exist on sm6350 as well, no
idea how/if it's used though.. Perhaps I can just remove it from sm6375
and if it turns out necessary we can reintroduce it another day.

Maybe this platform just tied it to one of the same clocks in the 
> above?
Unlikely, most likely it's for some dire deep power saving stuff that
does not seem to be used/exposed, even on the bsp kernel

> 
> I really hate the mess that is clocks. We have the same or related 
> blocks with just totally different names and order. The result is 
> if/then schemas or separate schemas like this. Neither option is great, 
> but at least the if/then schemas provides some motivation to not have 
> pointless variations like this. 
It's a totally valid rant..

> 
> As it seems the only difference between these 2 bindings is 1 extra 
> clock, can't they be shared?
Sounds like a plan!

Konrad
> 
> Rob


Re: [Freedreno] [PATCH v2 07/13] drm/msm/dpu: Add SM6350 support

2023-05-05 Thread Dmitry Baryshkov

On 27/04/2023 18:37, Marijn Suijten wrote:

On 2023-04-21 00:31:16, Konrad Dybcio wrote:

Add SM6350 support to the DPU1 driver to enable display output.

Signed-off-by: Konrad Dybcio 
Signed-off-by: Konrad Dybcio 


After addressing the comments from Dmitry (CURSOR0->DMA1 and
CURSOR1->DMA2), this is:

Reviewed-by: Marijn Suijten 

See below for some nits.


[...]


+static const struct dpu_mdp_cfg sm6350_mdp[] = {
+   {
+   .name = "top_0", .id = MDP_TOP,
+   .base = 0x0, .len = 0x494,
+   .features = 0,
+   .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
+   .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
+   .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
+   .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
+   .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
+   },
+};
+
+static const struct dpu_ctl_cfg sm6350_ctl[] = {
+   {
+   .name = "ctl_0", .id = CTL_0,
+   .base = 0x1000, .len = 0x1dc,
+   .features = BIT(DPU_CTL_ACTIVE_CFG),
+   .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9),
+   },
+   {
+   .name = "ctl_1", .id = CTL_1,
+   .base = 0x1200, .len = 0x1dc,
+   .features = BIT(DPU_CTL_ACTIVE_CFG),
+   .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10),
+   },
+   {
+   .name = "ctl_2", .id = CTL_2,
+   .base = 0x1400, .len = 0x1dc,
+   .features = BIT(DPU_CTL_ACTIVE_CFG),
+   .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11),
+   },
+   {
+   .name = "ctl_3", .id = CTL_3,
+   .base = 0x1600, .len = 0x1dc,
+   .features = BIT(DPU_CTL_ACTIVE_CFG),
+   .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12),
+   },
+};
+
+static const struct dpu_sspp_cfg sm6350_sspp[] = {
+   SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK,
+sc7180_vig_sblk_0, 0,  SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0),
+   SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK,
+sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0),
+   SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, 0x1f8, DMA_CURSOR_SDM845_MASK,
+sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_CURSOR0),
+   SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, 0x1f8, DMA_CURSOR_SDM845_MASK,
+sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_CURSOR1),
+};
+
+static const struct dpu_lm_cfg sm6350_lm[] = {
+   LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK,
+   &sc7180_lm_sblk, PINGPONG_0, LM_1, DSPP_0),
+   LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK,
+   &sc7180_lm_sblk, PINGPONG_1, LM_0, 0),


These two entries are indented with two tabs and have one character too
many to align with the opening parenthesis on the previous line.  Can we
please settle on a single style, as this commit mostly uses tabs+spaces
to align with the opening parenthesis?

Dmitry vouched for `cino=(0` (when in unclosed parenthesis, align next
line with zero extra characters to the opening parenthesis), but I find
double tabs more convenient as it doesn't require reindenting when
changing the name of the macro (which happened too often in my INTF TE
series).


I mainly vote for 'cino=(0' for indenting conditions (where double tab 
is confusing) and for function calls. I do not have a strong opinion 
about macros expansions. We have been using double-tab there, which is 
fine with me.


Another option (which I personally find more appealing, but it doesn't 
play well with the current guidelines) is to have all macro arguments in 
a single line. It makes it easier to compare things.


And another option would be to expand these macros up to some point. 
Previous experience with clock and interconnect drivers showed that 
expanding such multi-arg acros makes it _easier_ to handle the data. 
Counterintuitive, but true.





+};
+
+static const struct dpu_dspp_cfg sm6350_dspp[] = {
+   DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
+&sm8150_dspp_sblk),
+};
+
+static struct dpu_pingpong_cfg sm6350_pp[] = {
+   PP_BLK("pingpong_0", PINGPONG_0, 0x7, PINGPONG_SM8150_MASK, 0, 
sdm845_pp_sblk,
+  DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
+  -1),
+   PP_BLK("pingpong_1", PINGPONG_1, 0x70800, PINGPONG_SM8150_MASK, 0, 
sdm845_pp_sblk,
+  DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
+  -1),


[skipped the rest]

--
With best wishes
Dmitry



Re: [Freedreno] [PATCH v6 06/15] drm/msm/a6xx: Introduce GMU wrapper support

2023-05-05 Thread Konrad Dybcio



On 5.05.2023 10:46, Akhil P Oommen wrote:
> On Thu, May 04, 2023 at 08:34:07AM +0200, Konrad Dybcio wrote:
>>
>>
>> On 3.05.2023 22:32, Akhil P Oommen wrote:
>>> On Tue, May 02, 2023 at 11:40:26AM +0200, Konrad Dybcio wrote:


 On 2.05.2023 09:49, Akhil P Oommen wrote:
> On Sat, Apr 01, 2023 at 01:54:43PM +0200, Konrad Dybcio wrote:
>> Some (particularly SMD_RPM, a.k.a non-RPMh) SoCs implement A6XX GPUs
>> but don't implement the associated GMUs. This is due to the fact that
>> the GMU directly pokes at RPMh. Sadly, this means we have to take care
>> of enabling & scaling power rails, clocks and bandwidth ourselves.
>>
>> Reuse existing Adreno-common code and modify the deeply-GMU-infused
>> A6XX code to facilitate these GPUs. This involves if-ing out lots
>> of GMU callbacks and introducing a new type of GMU - GMU wrapper (it's
>> the actual name that Qualcomm uses in their downstream kernels).
>>
>> This is essentially a register region which is convenient to model
>> as a device. We'll use it for managing the GDSCs. The register
>> layout matches the actual GMU_CX/GX regions on the "real GMU" devices
>> and lets us reuse quite a bit of gmu_read/write/rmw calls.
> << I sent a reply to this patch earlier, but not sure where it went.
> Still figuring out Mutt... >>
 Answered it here:

 https://lore.kernel.org/linux-arm-msm/4d3000c1-c3f9-0bfd-3eb3-23393f9a8...@linaro.org/
>>>
>>> Thanks. Will check and respond there if needed.
>>>

 I don't think I see any new comments in this "reply revision" (heh), so 
 please
 check that one out.

>
> Only convenience I found is that we can reuse gmu register ops in a few
> places (< 10 I think). If we just model this as another gpu memory
> region, I think it will help to keep gmu vs gmu-wrapper/no-gmu
> architecture code with clean separation. Also, it looks like we need to
> keep a dummy gmu platform device in the devicetree with the current
> approach. That doesn't sound right.
 That's correct, but.. if we switch away from that, VDD_GX/VDD_CX will
 need additional, gmuwrapper-configuration specific code anyway, as
 OPP & genpd will no longer make use of the default behavior which
 only gets triggered if there's a single power-domains=<> entry, afaicu.
>>> Can you please tell me which specific *default behviour* do you mean here?
>>> I am curious to know what I am overlooking here. We can always get a 
>>> cxpd/gxpd device
>>> and vote for the gdscs directly from the driver. Anything related to
>>> OPP?
>> I *believe* this is true:
>>
>> if (ARRAY_SIZE(power-domains) == 1) {
>>  of generic code will enable the power domain at .probe time
> we need to handle the voting directly. I recently shared a patch to
> vote cx gdsc from gpu driver. Maybe we can ignore this when gpu has
> only cx rail due to this logic you quoted here.
> 
> I see that you have handled it mostly correctly from the gpu driver in the 
> updated
> a6xx_pm_suspend() callback. Just the power domain device ptrs should be moved 
> to
> gpu from gmu.
> 
>>
>>  opp APIs will default to scaling that domain with required-opps
> 
>> }
>>
>> and we do need to put GX/CX (with an MX parent to match) there, as the
>> AP is responsible for voting in this configuration
> 
> We should vote to turn ON gx/cx headswitches through genpd from gpu driver. 
> When you vote for
> core clk frequency, *clock driver is supposed to scale* all the necessary
> regulators. At least that is how downstream works. You can refer the 
> downstream
> gpucc clk driver of these SoCs. I am not sure how much of that can be easily 
> converted to
> upstream.
> 
> Also, how does having a gmu dt node help in this regard? Feel free to
> elaborate, I am not very familiar with clk/regulator implementations.
Okay so I think we have a bit of a confusion here.

Currently, with this patchset we manage things like this:

1. GPU has a VDD_GX (or equivalent[1]) line passed in power-domains=<>, which
   is then used with OPP APIs to ensure it's being scaled on freq change [2].
   The VDD_lines coming from RPM(h) are described as power domains upstream
   *unlike downstream*, which represents them as regulators with preset voltage
   steps (and perhaps that's what had you confused). What's more is that GDSCs
   are also modeled as genpds instead of regulators, hence they sort of "fight"
   for the spot in power-domains=<> of a given node.

2. GMU wrapper gets CX_GDSC & GX_GDSC handles in power-domains=<> (just like
   the real GMU in the current state of upstream [3]), which are then governed
   through explicit genpd calls to turn them on/off when the GPU resume/suspend/
   crash recovery functions are called.

3. GPUs with GMU, like A630, don't get any power-domains=<> entries in DT,
   instead relying on the GMU firmware to communicate necessary requests
   to the VDD_xyz resources direct

Re: [Freedreno] [PATCH v6 06/15] drm/msm/a6xx: Introduce GMU wrapper support

2023-05-05 Thread Akhil P Oommen
On Thu, May 04, 2023 at 08:34:07AM +0200, Konrad Dybcio wrote:
> 
> 
> On 3.05.2023 22:32, Akhil P Oommen wrote:
> > On Tue, May 02, 2023 at 11:40:26AM +0200, Konrad Dybcio wrote:
> >>
> >>
> >> On 2.05.2023 09:49, Akhil P Oommen wrote:
> >>> On Sat, Apr 01, 2023 at 01:54:43PM +0200, Konrad Dybcio wrote:
>  Some (particularly SMD_RPM, a.k.a non-RPMh) SoCs implement A6XX GPUs
>  but don't implement the associated GMUs. This is due to the fact that
>  the GMU directly pokes at RPMh. Sadly, this means we have to take care
>  of enabling & scaling power rails, clocks and bandwidth ourselves.
> 
>  Reuse existing Adreno-common code and modify the deeply-GMU-infused
>  A6XX code to facilitate these GPUs. This involves if-ing out lots
>  of GMU callbacks and introducing a new type of GMU - GMU wrapper (it's
>  the actual name that Qualcomm uses in their downstream kernels).
> 
>  This is essentially a register region which is convenient to model
>  as a device. We'll use it for managing the GDSCs. The register
>  layout matches the actual GMU_CX/GX regions on the "real GMU" devices
>  and lets us reuse quite a bit of gmu_read/write/rmw calls.
> >>> << I sent a reply to this patch earlier, but not sure where it went.
> >>> Still figuring out Mutt... >>
> >> Answered it here:
> >>
> >> https://lore.kernel.org/linux-arm-msm/4d3000c1-c3f9-0bfd-3eb3-23393f9a8...@linaro.org/
> > 
> > Thanks. Will check and respond there if needed.
> > 
> >>
> >> I don't think I see any new comments in this "reply revision" (heh), so 
> >> please
> >> check that one out.
> >>
> >>>
> >>> Only convenience I found is that we can reuse gmu register ops in a few
> >>> places (< 10 I think). If we just model this as another gpu memory
> >>> region, I think it will help to keep gmu vs gmu-wrapper/no-gmu
> >>> architecture code with clean separation. Also, it looks like we need to
> >>> keep a dummy gmu platform device in the devicetree with the current
> >>> approach. That doesn't sound right.
> >> That's correct, but.. if we switch away from that, VDD_GX/VDD_CX will
> >> need additional, gmuwrapper-configuration specific code anyway, as
> >> OPP & genpd will no longer make use of the default behavior which
> >> only gets triggered if there's a single power-domains=<> entry, afaicu.
> > Can you please tell me which specific *default behviour* do you mean here?
> > I am curious to know what I am overlooking here. We can always get a 
> > cxpd/gxpd device
> > and vote for the gdscs directly from the driver. Anything related to
> > OPP?
> I *believe* this is true:
> 
> if (ARRAY_SIZE(power-domains) == 1) {
>   of generic code will enable the power domain at .probe time
we need to handle the voting directly. I recently shared a patch to
vote cx gdsc from gpu driver. Maybe we can ignore this when gpu has
only cx rail due to this logic you quoted here.

I see that you have handled it mostly correctly from the gpu driver in the 
updated
a6xx_pm_suspend() callback. Just the power domain device ptrs should be moved to
gpu from gmu.

> 
>   opp APIs will default to scaling that domain with required-opps

> }
> 
> and we do need to put GX/CX (with an MX parent to match) there, as the
> AP is responsible for voting in this configuration

We should vote to turn ON gx/cx headswitches through genpd from gpu driver. 
When you vote for
core clk frequency, *clock driver is supposed to scale* all the necessary
regulators. At least that is how downstream works. You can refer the downstream
gpucc clk driver of these SoCs. I am not sure how much of that can be easily 
converted to
upstream.

Also, how does having a gmu dt node help in this regard? Feel free to
elaborate, I am not very familiar with clk/regulator implementations.

-Akhil.
> 
> Konrad
> > 
> > -Akhil
> >>
> >> If nothing else, this is a very convenient way to model a part of the
> >> GPU (as that's essentially what GMU_CX is, to my understanding) and
> >> the bindings people didn't shoot me in the head for proposing this, so
> >> I assume it'd be cool to pursue this..
> >>
> >> Konrad
> 
>  Signed-off-by: Konrad Dybcio 
>  ---
>   drivers/gpu/drm/msm/adreno/a6xx_gmu.c   |  72 +++-
>   drivers/gpu/drm/msm/adreno/a6xx_gpu.c   | 255 
>  +---
>   drivers/gpu/drm/msm/adreno/a6xx_gpu.h   |   1 +
>   drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c |  14 +-
>   drivers/gpu/drm/msm/adreno/adreno_gpu.c |   8 +-
>   drivers/gpu/drm/msm/adreno/adreno_gpu.h |   6 +
>   6 files changed, 318 insertions(+), 38 deletions(-)
> 
>  diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c 
>  b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
>  index 87babbb2a19f..b1acdb027205 100644
>  --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
>  +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
>  @@ -1469,6 +1469,7 @@ static int a6xx_gmu_get_irq(struct a6xx_gmu *gmu, 
>