drm/msm/dpu: simplify QoS/CDP programming
v2 cover drm/msm/dpu: simplify QoS/CDP programming
Merge SSPP and WB code programming QoS and CDP. This allows us to drop intermediate structures and duplicate code.
Changes since v1:
- Fixed kerneldoc for _dpu_plane_set_qos_ctrl()
- Fixed danger_safe_en programming conditions (Jeykumar)
- Simplified the code surrounding setup_cdp() calls (Jeykumar)
Dmitry Baryshkov (9):
drm/msm/dpu: fix SSPP register definitions
drm/msm/dpu: simplify CDP programming
drm/msm/dpu: fix the condition for (not) applying QoS to CURSOR SSPP drm/msm/dpu: rearrange QoS setting code
drm/msm/dpu: drop DPU_PLANE_QOS_VBLANK_CTRL
drm/msm/dpu: simplify qos_ctrl handling
drm/msm/dpu: drop DPU_PLANE_QOS_PANIC_CTRL
drm/msm/dpu: remove struct dpu_hw_pipe_qos_cfg drm/msm/dpu: use common helper for WB and SSPP QoS setup
.../drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 21 +-- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 4 - drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 142 +++++---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 52 ++---- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 52 ++++++ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h | 32 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c | 48 +---- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h | 27 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 165 +++++------------- 9 files changed, 194 insertions(+), 349 deletions(-)
Signature · 1 line
2.39.2
PATCH v2 1/9 drm/msm/dpu: fix SSPP register definitions
Reorder SSPP register definitions to sort them in the ascending order. Move register bitfields after the register definitions.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 66 +++++++++++---------- 1 file changed, 34 insertions(+), 32 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +34 -32
@@ -26,45 +26,18 @@#define SSPP_SRC_FORMAT 0x30#define SSPP_SRC_UNPACK_PATTERN 0x34#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_REC1 0x184 -#define SSPP_EXCL_REC_XY_REC1 0x188 - -#define MDSS_MDP_OP_DEINTERLACE BIT(22) -#define MDSS_MDP_OP_DEINTERLACE_ODD BIT(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_UD BIT(14) -#define MDSS_MDP_OP_FLIP_LR BIT(13) -#define MDSS_MDP_OP_BWC_EN BIT(0) -#define MDSS_MDP_OP_PE_OVERRIDE BIT(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_COLOR 0x3c#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_LUT 0x60#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_STATUS 0x70#define SSPP_CREQ_LUT_0 0x74#define SSPP_CREQ_LUT_1 0x78 +#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_PREFILL 0x150#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_REC1 0x184 +#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_MODE 0x0 -#define SSPP_TRAFFIC_SHAPER_BPC_MAX 0xFF + +/* SSPP_SRC_OP_MODE & OP_MODE_REC1 */ +#define MDSS_MDP_OP_DEINTERLACE BIT(22) +#define MDSS_MDP_OP_DEINTERLACE_ODD BIT(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_UD BIT(14) +#define MDSS_MDP_OP_FLIP_LR BIT(13) +#define MDSS_MDP_OP_BWC_EN BIT(0) +#define MDSS_MDP_OP_PE_OVERRIDE BIT(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_EN BIT(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_CSC_10_OP_MODE 0x0 + +/* SSPP_TRAFFIC_SHAPER and _REC1 */ +#define SSPP_TRAFFIC_SHAPER_BPC_MAX 0xFF +/* * Definitions for ViG op modes */
Signature · 1 line
2.39.2
Re: [Freedreno] [PATCH v2 1/9] drm/msm/dpu: fix SSPP register definitions
Quoted 106 lines · Dmitry Baryshkov
Reorder SSPP register definitions to sort them in the ascending order. Move register bitfields after the register definitions.
Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 66 +++++++++++---------- 1 file changed, 34 insertions(+), 32 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +28
-32@@ -26,45 +26,18 @@#define SSPP_SRC_FORMAT 0x30#define SSPP_SRC_UNPACK_PATTERN 0x34#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_REC1 0x184 -#define SSPP_EXCL_REC_XY_REC1 0x188 - -#define MDSS_MDP_OP_DEINTERLACE BIT(22) -#define MDSS_MDP_OP_DEINTERLACE_ODD BIT(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_UD BIT(14) -#define MDSS_MDP_OP_FLIP_LR BIT(13) -#define MDSS_MDP_OP_BWC_EN BIT(0) -#define MDSS_MDP_OP_PE_OVERRIDE BIT(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_COLOR 0x3c#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_LUT 0x60#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_STATUS 0x70#define SSPP_CREQ_LUT_0 0x74#define SSPP_CREQ_LUT_1 0x78 +#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_PREFILL 0x150#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_REC1 0x184 +#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_MODE 0x0 -#define SSPP_TRAFFIC_SHAPER_BPC_MAX 0xFF + +/* SSPP_SRC_OP_MODE & OP_MODE_REC1 */ +#define MDSS_MDP_OP_DEINTERLACE BIT(22) +#define MDSS_MDP_OP_DEINTERLACE_ODD BIT(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_UD BIT(14) +#define MDSS_MDP_OP_FLIP_LR BIT(13) +#define MDSS_MDP_OP_BWC_EN BIT(0) +#define MDSS_MDP_OP_PE_OVERRIDE BIT(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_EN BIT(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
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c line 108
Quoted 6 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +3
-0@@ -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_CSC_10_OP_MODE 0x0 +
There is an existing grouping for CSC 10 bit op modes. You can add to that.
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c line 109
Quoted 1 line
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +1
-0+/* SSPP_TRAFFIC_SHAPER and _REC1 */
I dont get the _REC1 comment. How is it relevent for this flag?
Quoted 5 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +2
-0+#define SSPP_TRAFFIC_SHAPER_BPC_MAX 0xFF +/* * Definitions for ViG op modes */
Re: [Freedreno] [PATCH v2 1/9] drm/msm/dpu: fix SSPP register definitions
Quoted 113 lines · Jeykumar Sankaran
Quoted 109 lines · Dmitry Baryshkov
Reorder SSPP register definitions to sort them in the ascending order. Move register bitfields after the register definitions.
Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 66 +++++++++++---------- 1 file changed, 34 insertions(+), 32 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +28
-32@@ -26,45 +26,18 @@#define SSPP_SRC_FORMAT 0x30#define SSPP_SRC_UNPACK_PATTERN 0x34#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_REC1 0x184 -#define SSPP_EXCL_REC_XY_REC1 0x188 - -#define MDSS_MDP_OP_DEINTERLACE BIT(22) -#define MDSS_MDP_OP_DEINTERLACE_ODD BIT(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_UD BIT(14) -#define MDSS_MDP_OP_FLIP_LR BIT(13) -#define MDSS_MDP_OP_BWC_EN BIT(0) -#define MDSS_MDP_OP_PE_OVERRIDE BIT(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_COLOR 0x3c#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_LUT 0x60#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_STATUS 0x70#define SSPP_CREQ_LUT_0 0x74#define SSPP_CREQ_LUT_1 0x78 +#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_PREFILL 0x150#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_REC1 0x184 +#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_MODE 0x0 -#define SSPP_TRAFFIC_SHAPER_BPC_MAX 0xFF + +/* SSPP_SRC_OP_MODE & OP_MODE_REC1 */ +#define MDSS_MDP_OP_DEINTERLACE BIT(22) +#define MDSS_MDP_OP_DEINTERLACE_ODD BIT(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_UD BIT(14) +#define MDSS_MDP_OP_FLIP_LR BIT(13) +#define MDSS_MDP_OP_BWC_EN BIT(0) +#define MDSS_MDP_OP_PE_OVERRIDE BIT(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_EN BIT(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
Quoted 4 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c line 108
Quoted 3 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +3
-0+/* DPU_SSPP_CSC_10BIT space */ +#define SSPP_VIG_CSC_10_OP_MODE 0x0 +There is an existing grouping for CSC 10 bit op modes. You can add to that.
Good idea, thanks!
Quoted 2 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c line 109
Quoted 1 line
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +1
-0+/* SSPP_TRAFFIC_SHAPER and _REC1 */ I dont get the
_REC1comment. How is it relevent for this flag?
Because this define is applicable to the SSPP_T_S and SSPP_T_S_REC1 registers.
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +2
-0+#define SSPP_TRAFFIC_SHAPER_BPC_MAX 0xFF +/* * Definitions for ViG op modes */
Signature · 2 lines
With best wishes Dmitry
PATCH v2 2/9 drm/msm/dpu: simplify CDP programming
In reply to Dmitry BaryshkovGet 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.
--- .../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(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +4 -13
@@ -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)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +4 -13
@@ -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,
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +4 -10
@@ -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 used by the sw pipe +* @enable: whether the CDP should be enabled for this pipe */ void (*setup_cdp)(struct dpu_sw_pipe *pipe, -struct dpu_hw_cdp_cfg *cfg); +const struct dpu_format *fmt, +bool enable); };/**
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +21 -0
@@ -494,3 +494,24 @@ int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,return 0 ; } + +#define CDP_ENABLE BIT(0) +#define CDP_UBWC_META_ENABLE BIT(1) +#define CDP_TILE_AMORTIZE_ENABLE BIT(2) +#define CDP_PRELOAD_AHEAD_64 BIT(3) + +void dpu_setup_cdp (struct dpu_hw_blk_reg_map *c,u32 offset, +const struct dpu_format *fmt,bool enable) +{ +u32 cdp_cntl =CDP_PRELOAD_AHEAD_64 ; + +if (enable) + cdp_cntl |=CDP_ENABLE ; +if (DPU_FORMAT_IS_UBWC (fmt)) + cdp_cntl |=CDP_UBWC_META_ENABLE ; +if (DPU_FORMAT_IS_UBWC (fmt) || +DPU_FORMAT_IS_TILE (fmt)) + cdp_cntl |=CDP_TILE_AMORTIZE_ENABLE ; + +DPU_REG_WRITE (c, offset, cdp_cntl); +}
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +3 -16
@@ -305,22 +305,6 @@ struct dpu_drm_scaler_v2 {struct dpu_drm_de_v1 de; }; -/** -* struct dpu_hw_cdp_cfg : CDP configuration -* @enable: true to enable CDP -* @ubwc_meta_enable: true to enable ubwc metadata preload -* @tile_amortize_enable: true to enable amortization control for tile format -* @preload_ahead: number of request to preload ahead -* DPU_*_CDP_PRELOAD_AHEAD_32, -* DPU_*_CDP_PRELOAD_AHEAD_64 -*/ -struct dpu_hw_cdp_cfg { -bool enable; -bool ubwc_meta_enable; -bool tile_amortize_enable; -u32 preload_ahead; -}; -u32 *dpu_hw_util_get_log_mask_ptr (void ); void dpu_reg_write(struct dpu_hw_blk_reg_map *c,
@@ -346,6 +330,9 @@ void dpu_hw_csc_setup(struct dpu_hw_blk_reg_map *c,u32 csc_reg_off, const struct dpu_csc_cfg *data, bool csc10); +void dpu_setup_cdp (struct dpu_hw_blk_reg_map *c,u32 offset, +const struct dpu_format *fmt,bool enable); +u64 _dpu_hw_get_qos_lut (const struct dpu_qos_lut_tbl *tbl,u32 total_fl);
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c +4 -15
@@ -164,24 +164,13 @@ static void dpu_hw_wb_setup_qos_lut(struct dpu_hw_wb *ctx, }static void dpu_hw_wb_setup_cdp (struct dpu_hw_wb *ctx, -struct dpu_hw_cdp_cfg *cfg) +const struct dpu_format *fmt, +bool enable) { -struct dpu_hw_blk_reg_map *c; -u32 cdp_cntl =0 ; - -if (!ctx || !cfg) +if (!ctx)return ; - c = &ctx->hw; - -if (cfg->enable) - cdp_cntl |=BIT (0 ); -if (cfg->ubwc_meta_enable) - cdp_cntl |=BIT (1 ); -if (cfg->preload_ahead ==DPU_WB_CDP_PRELOAD_AHEAD_64 ) - cdp_cntl |=BIT (3 ); - -DPU_REG_WRITE (c,WB_CDP_CNTL , cdp_cntl); +dpu_setup_cdp (&ctx->hw,WB_CDP_CNTL , fmt, enable); } static void dpu_hw_wb_bind_pingpong_blk(
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h +2 -9
@@ -21,14 +21,6 @@ struct dpu_hw_wb_cfg {struct drm_rect crop; }; -/** -* enum CDP preload ahead address size -*/ -enum { -DPU_WB_CDP_PRELOAD_AHEAD_32 , -DPU_WB_CDP_PRELOAD_AHEAD_64 -}; -/** * struct dpu_hw_wb_qos_cfg : Writeback pipe QoS configuration * @danger_lut: LUT for generate danger level based on fill level
@@ -67,7 +59,8 @@ struct dpu_hw_wb_ops { struct dpu_hw_wb_qos_cfg *cfg);void (*setup_cdp)(struct dpu_hw_wb *ctx, -struct dpu_hw_cdp_cfg *cfg); +const struct dpu_format *fmt, +bool enable);void (*bind_pingpong_blk)(struct dpu_hw_wb *ctx,bool enable,const enum dpu_pingpong pp);
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +3 -13
@@ -1116,20 +1116,10 @@ static void dpu_plane_sspp_update_pipe(struct drm_plane *plane, pipe->sspp->ops.setup_format (pipe, fmt, src_flags);if (pipe->sspp->ops.setup_cdp) { -struct dpu_hw_cdp_cfg cdp_cfg; +const struct dpu_perf_cfg *perf = pdpu->catalog->perf; -memset (&cdp_cfg,0 ,sizeof (struct dpu_hw_cdp_cfg )); - - cdp_cfg.enable = pdpu->catalog->perf->cdp_cfg - [DPU_PERF_CDP_USAGE_RT ].rd_enable; - cdp_cfg.ubwc_meta_enable = -DPU_FORMAT_IS_UBWC (fmt); - cdp_cfg.tile_amortize_enable = -DPU_FORMAT_IS_UBWC (fmt) || -DPU_FORMAT_IS_TILE (fmt); - cdp_cfg.preload_ahead =DPU_SSPP_CDP_PRELOAD_AHEAD_64 ; - - pipe->sspp->ops.setup_cdp (pipe, &cdp_cfg); + pipe->sspp->ops.setup_cdp (pipe, fmt, + perf->cdp_cfg[DPU_PERF_CDP_USAGE_RT ].rd_enable); } }
Signature · 1 line
2.39.2
Re: [Freedreno] [PATCH v2 2/9] drm/msm/dpu: simplify CDP programming
Quoted 271 lines · Dmitry Baryshkov
Get rid of intermediatory configuration structure and defines. Pass the format and the enablement bit directly to the new helper. The
WB_CDP_CNTLregister ignores BIT(2), so we can write it for both SSPP and WB CDP settings.Signed-off-by Dmitry Baryshkov <[email protected]>--- .../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(-)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +4
-13@@ -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)drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +4
-13@@ -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,drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +4
-10@@ -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 used by the sw pipe +* @enable: whether the CDP should be enabled for this pipe */ void (*setup_cdp)(struct dpu_sw_pipe *pipe, -struct dpu_hw_cdp_cfg *cfg); +const struct dpu_format *fmt, +bool enable); };/** drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +21
-0@@ -494,3 +494,24 @@ int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,return 0 ; } + +#define CDP_ENABLE BIT(0) +#define CDP_UBWC_META_ENABLE BIT(1) +#define CDP_TILE_AMORTIZE_ENABLE BIT(2) +#define CDP_PRELOAD_AHEAD_64 BIT(3) + +void dpu_setup_cdp (struct dpu_hw_blk_reg_map *c,u32 offset, +const struct dpu_format *fmt,bool enable) +{ +u32 cdp_cntl =CDP_PRELOAD_AHEAD_64 ; + +if (enable) + cdp_cntl |=CDP_ENABLE ; +if (DPU_FORMAT_IS_UBWC (fmt)) + cdp_cntl |=CDP_UBWC_META_ENABLE ; +if (DPU_FORMAT_IS_UBWC (fmt) || +DPU_FORMAT_IS_TILE (fmt)) + cdp_cntl |=CDP_TILE_AMORTIZE_ENABLE ; + +DPU_REG_WRITE (c, offset, cdp_cntl); +}drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +3
-16@@ -305,22 +305,6 @@ struct dpu_drm_scaler_v2 {struct dpu_drm_de_v1 de; }; -/** -* struct dpu_hw_cdp_cfg : CDP configuration -* @enable: true to enable CDP -* @ubwc_meta_enable: true to enable ubwc metadata preload -* @tile_amortize_enable: true to enable amortization control for tile format -* @preload_ahead: number of request to preload ahead -* DPU_*_CDP_PRELOAD_AHEAD_32, -* DPU_*_CDP_PRELOAD_AHEAD_64 -*/ -struct dpu_hw_cdp_cfg { -bool enable; -bool ubwc_meta_enable; -bool tile_amortize_enable; -u32 preload_ahead; -}; -u32 *dpu_hw_util_get_log_mask_ptr (void ); void dpu_reg_write(struct dpu_hw_blk_reg_map *c,@@ -346,6 +330,9 @@ void dpu_hw_csc_setup(struct dpu_hw_blk_reg_map *c,u32 csc_reg_off, const struct dpu_csc_cfg *data, bool csc10); +void dpu_setup_cdp (struct dpu_hw_blk_reg_map *c,u32 offset, +const struct dpu_format *fmt,bool enable); +u64 _dpu_hw_get_qos_lut (const struct dpu_qos_lut_tbl *tbl,u32 total_fl);drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c +4
-15@@ -164,24 +164,13 @@ static void dpu_hw_wb_setup_qos_lut(struct dpu_hw_wb *ctx, }static void dpu_hw_wb_setup_cdp (struct dpu_hw_wb *ctx, -struct dpu_hw_cdp_cfg *cfg) +const struct dpu_format *fmt, +bool enable) { -struct dpu_hw_blk_reg_map *c; -u32 cdp_cntl =0 ; - -if (!ctx || !cfg) +if (!ctx)return ; - c = &ctx->hw; - -if (cfg->enable) - cdp_cntl |=BIT (0 ); -if (cfg->ubwc_meta_enable) - cdp_cntl |=BIT (1 ); -if (cfg->preload_ahead ==DPU_WB_CDP_PRELOAD_AHEAD_64 ) - cdp_cntl |=BIT (3 ); - -DPU_REG_WRITE (c,WB_CDP_CNTL , cdp_cntl); +dpu_setup_cdp (&ctx->hw,WB_CDP_CNTL , fmt, enable); } static void dpu_hw_wb_bind_pingpong_blk(drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h +2
-9@@ -21,14 +21,6 @@ struct dpu_hw_wb_cfg {struct drm_rect crop; }; -/** -* enum CDP preload ahead address size -*/ -enum { -DPU_WB_CDP_PRELOAD_AHEAD_32 , -DPU_WB_CDP_PRELOAD_AHEAD_64 -}; -/** * struct dpu_hw_wb_qos_cfg : Writeback pipe QoS configuration * @danger_lut: LUT for generate danger level based on fill level @@ -67,7 +59,8 @@ struct dpu_hw_wb_ops { struct dpu_hw_wb_qos_cfg *cfg);void (*setup_cdp)(struct dpu_hw_wb *ctx, -struct dpu_hw_cdp_cfg *cfg); +const struct dpu_format *fmt, +bool enable);void (*bind_pingpong_blk)(struct dpu_hw_wb *ctx,bool enable,const enum dpu_pingpong pp);drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +1
-8@@ -1116,20 +1116,10 @@ static void dpu_plane_sspp_update_pipe(struct drm_plane *plane, pipe->sspp->ops.setup_format (pipe, fmt, src_flags);if (pipe->sspp->ops.setup_cdp) { -struct dpu_hw_cdp_cfg cdp_cfg; +const struct dpu_perf_cfg *perf = pdpu->catalog->perf; -memset (&cdp_cfg,0 ,sizeof (struct dpu_hw_cdp_cfg )); - - cdp_cfg.enable = pdpu->catalog->perf->cdp_cfg - [DPU_PERF_CDP_USAGE_RT ].rd_enable; - cdp_cfg.ubwc_meta_enable = -DPU_FORMAT_IS_UBWC (fmt); - cdp_cfg.tile_amortize_enable =
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c static void dpu_plane_sspp_update_pipe(struct drm_plane *plane, · line 1125
Quoted 10 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +2
-5-DPU_FORMAT_IS_UBWC (fmt) || -DPU_FORMAT_IS_TILE (fmt); - cdp_cfg.preload_ahead =DPU_SSPP_CDP_PRELOAD_AHEAD_64 ; - - pipe->sspp->ops.setup_cdp (pipe, &cdp_cfg); + pipe->sspp->ops.setup_cdp (pipe, fmt, + perf->cdp_cfg[DPU_PERF_CDP_USAGE_RT ].rd_enable); } }
PATCH v2 3/9 drm/msm/dpu: fix the condition for (not) applying QoS to CURSOR SSPP
In reply to Dmitry BaryshkovThe 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.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +2 -1
@@ -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); }
Signature · 1 line
2.39.2
Re: [Freedreno] [PATCH v2 3/9] drm/msm/dpu: fix the condition for (not) applying QoS to CURSOR SSPP
Quoted 16 lines · Dmitry Baryshkov
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 <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +0
-0
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c static void dpu_plane_sspp_update_pipe(struct drm_plane *plane, · line 1133
Quoted 9 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +2
-1@@ -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); }
PATCH v2 4/9 drm/msm/dpu: rearrange QoS setting code
In reply to Dmitry BaryshkovSlightly rearrainge code in dpu_plane_sspp_update_pipe() to group QoS/LUT related functions.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +7 -5
@@ -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);
Signature · 1 line
2.39.2
Re: [Freedreno] [PATCH v2 4/9] drm/msm/dpu: rearrange QoS setting code
Quoted 33 lines · Dmitry Baryshkov
Slightly rearrainge code in
dpu_plane_sspp_update_pipe()to group QoS/LUT related functions.Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +6
-2@@ -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 );
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c static void dpu_plane_sspp_update_pipe(struct drm_plane *plane, · line 1138
Quoted 10 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +1
-3if (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);
PATCH v2 5/9 drm/msm/dpu: drop DPU_PLANE_QOS_VBLANK_CTRL
In reply to Dmitry BaryshkovDrop support for DPU_PLANE_QOS_VBLANK_CTRL flag. It is not used both in upstream driver and in vendor SDE driver.
--- 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(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +0 -4
@@ -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;
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +0 -8
@@ -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 ; }
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +0 -10
@@ -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 */ }
Signature · 1 line
2.39.2
Re: [Freedreno] [PATCH v2 5/9] drm/msm/dpu: drop DPU_PLANE_QOS_VBLANK_CTRL
Quoted 75 lines · Dmitry Baryshkov
Drop support for
DPU_PLANE_QOS_VBLANK_CTRLflag. It is not used both in upstream driver and in vendor SDE driver.Signed-off-by Dmitry Baryshkov <[email protected]>--- 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(-)drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +0
-4@@ -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;drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +0
-8@@ -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 ; }drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +0
-4@@ -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;
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, · line 365
Quoted 10 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +0
-6- 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 */ }
PATCH v2 6/9 drm/msm/dpu: simplify qos_ctrl handling
In reply to Dmitry BaryshkovAfter 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.
--- 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(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +0 -10
@@ -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 ;
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +0 -6
@@ -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; };
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +2 -15
@@ -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,
Signature · 1 line
2.39.2
Re: [Freedreno] [PATCH v2 6/9] drm/msm/dpu: simplify qos_ctrl handling
Quoted 90 lines · Dmitry Baryshkov
After removal of
DPU_PLANE_QOS_VBLANK_CTRL, several fields of structdpu_hw_pipe_qos_cfgare fixed to false/0. Drop them from the structure (and drop the corresponding code from the functions).The
DPU_PLANE_QOS_VBLANK_AMORTIZEflag is also removed, since it is now a NOP.Signed-off-by Dmitry Baryshkov <[email protected]>--- 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(-)drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +0
-10@@ -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 ;drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +0
-6@@ -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; };drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +1
-11@@ -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; - }
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, · line 370
Quoted 10 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +1
-4-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,
PATCH v2 7/9 drm/msm/dpu: drop DPU_PLANE_QOS_PANIC_CTRL
In reply to Dmitry BaryshkovThis flag is always passed to _dpu_plane_set_qos_ctrl(), so drop it and remove corresponding conditions from the mentioned function.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 27 +++++++---------------- 1 file changed, 8 insertions(+), 19 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +8 -19
@@ -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
Signature · 1 line
2.39.2
Re: [Freedreno] [PATCH v2 7/9] drm/msm/dpu: drop DPU_PLANE_QOS_PANIC_CTRL
Quoted 80 lines · Dmitry Baryshkov
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 <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 27 +++++++---------------- 1 file changed, 8 insertions(+), 19 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +6
-17@@ -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 ;
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable) · line 1381
Quoted 10 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +2
-2pm_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
PATCH v2 8/9 drm/msm/dpu: remove struct dpu_hw_pipe_qos_cfg
In reply to Dmitry BaryshkovNow as the struct dpu_hw_pipe_qos_cfg consists of only one bool field, drop the structure and use corresponding bool directly.
--- 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(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +3 -7
@@ -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,
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +2 -11
@@ -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
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +3 -8
@@ -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); }/**
Signature · 1 line
2.39.2
Re: [Freedreno] [PATCH v2 8/9] drm/msm/dpu: remove struct dpu_hw_pipe_qos_cfg
Quoted 88 lines · Dmitry Baryshkov
Now as the struct
dpu_hw_pipe_qos_cfgconsists of only one bool field, drop the structure and use corresponding bool directly.Signed-off-by Dmitry Baryshkov <[email protected]>--- 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(-)drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +3
-7@@ -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,drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +2
-11@@ -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 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +1
-6@@ -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,
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, · line 359
Quoted 10 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +2
-2- pipe_qos_cfg.danger_safe_en, + enable, pdpu->is_rt_pipe); pipe->sspp->ops.setup_qos_ctrl (pipe->sspp, - &pipe_qos_cfg); + enable); }/**
PATCH v2 9/9 drm/msm/dpu: use common helper for WB and SSPP QoS setup
In reply to Dmitry BaryshkovRework SSPP and WB code to use common helper for programming QoS settings.
--- .../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(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +2 -2
@@ -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 ];
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +7 -24
@@ -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; }
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +4 -15
@@ -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, -u64 creq_lut); +void (*setup_qos_lut)(struct dpu_hw_sspp *ctx, +struct dpu_hw_qos_cfg *cfg);/** * setup_qos_ctrl - setup QoS control
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +31 -0
@@ -73,6 +73,19 @@ static u32 dpu_hw_util_log_mask = DPU_DBG_MASK_NONE;#define QSEED3LITE_SEP_LUT_SIZE \ (QSEED3LITE_LUT_SIZE * QSEED3LITE_SEPARABLE_LUTS * sizeof(u32)) +/* QOS_LUT */ +#define QOS_DANGER_LUT 0x00 +#define QOS_SAFE_LUT 0x04 +#define QOS_CREQ_LUT 0x08 +#define QOS_QOS_CTRL 0x0C +#define QOS_CREQ_LUT_0 0x14 +#define QOS_CREQ_LUT_1 0x18 + +/* QOS_QOS_CTRL */ +#define QOS_QOS_CTRL_DANGER_SAFE_EN BIT(0) +#define QOS_QOS_CTRL_DANGER_VBLANK_MASK GENMASK(5, 4) +#define QOS_QOS_CTRL_VBLANK_EN BIT(16) +#define QOS_QOS_CTRL_CREQ_VBLANK_MASK GENMASK(21, 20) void dpu_reg_write(struct dpu_hw_blk_reg_map *c, u32 reg_off,
@@ -450,6 +463,24 @@ u64 _dpu_hw_get_qos_lut(const struct dpu_qos_lut_tbl *tbl,return 0 ; } +void _dpu_hw_setup_qos_lut (struct dpu_hw_blk_reg_map *c,u32 offset, +bool qos_8lvl, +const struct dpu_hw_qos_cfg *cfg) +{ +DPU_REG_WRITE (c, offset +QOS_DANGER_LUT , cfg->danger_lut); +DPU_REG_WRITE (c, offset +QOS_SAFE_LUT , cfg->safe_lut); + +if (qos_8lvl) { +DPU_REG_WRITE (c, offset +QOS_CREQ_LUT_0 , cfg->creq_lut); +DPU_REG_WRITE (c, offset +QOS_CREQ_LUT_1 , cfg->creq_lut >>32 ); + }else { +DPU_REG_WRITE (c, offset +QOS_CREQ_LUT , cfg->creq_lut); + } + +DPU_REG_WRITE (c, offset +QOS_QOS_CTRL , + cfg->danger_safe_en ?QOS_QOS_CTRL_DANGER_SAFE_EN :0 ); +} +void dpu_hw_setup_misr (struct dpu_hw_blk_reg_map *c,u32 misr_ctrl_offset,bool enable,u32 frame_count)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +21 -0
@@ -305,6 +305,23 @@ struct dpu_drm_scaler_v2 {struct dpu_drm_de_v1 de; }; +/** +* struct dpu_hw_qos_cfg: pipe QoS configuration +* @danger_lut: LUT for generate danger level based on fill level +* @safe_lut: LUT for generate safe level based on fill level +* @creq_lut: LUT for generate creq level based on fill level +* @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_qos_cfg { +u32 danger_lut; +u32 safe_lut; +u64 creq_lut; +bool danger_safe_en; +}; +u32 *dpu_hw_util_get_log_mask_ptr (void ); void dpu_reg_write(struct dpu_hw_blk_reg_map *c,
@@ -336,6 +353,10 @@ void dpu_setup_cdp(struct dpu_hw_blk_reg_map *c, u32 offset,u64 _dpu_hw_get_qos_lut (const struct dpu_qos_lut_tbl *tbl,u32 total_fl); +void _dpu_hw_setup_qos_lut (struct dpu_hw_blk_reg_map *c,u32 offset, +bool qos_8lvl, +const struct dpu_hw_qos_cfg *cfg); + void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c, u32 misr_ctrl_offset, bool enable,
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c +4 -25
@@ -49,9 +49,6 @@#define WB_OUT_IMAGE_SIZE 0x2C0#define WB_OUT_XY 0x2C4 -/* WB_QOS_CTRL */ -#define WB_QOS_CTRL_DANGER_SAFE_EN BIT(0) -static void dpu_hw_wb_setup_outaddress (struct dpu_hw_wb *ctx,struct dpu_hw_wb_cfg *data) {
@@ -135,32 +132,14 @@ static void dpu_hw_wb_roi(struct dpu_hw_wb *ctx, struct dpu_hw_wb_cfg *wb) }static void dpu_hw_wb_setup_qos_lut (struct dpu_hw_wb *ctx, -struct dpu_hw_wb_qos_cfg *cfg) +struct dpu_hw_qos_cfg *cfg) { -struct dpu_hw_blk_reg_map *c = &ctx->hw; -u32 qos_ctrl =0 ; -if (!ctx || !cfg)return ; -DPU_REG_WRITE (c,WB_DANGER_LUT , cfg->danger_lut); -DPU_REG_WRITE (c,WB_SAFE_LUT , cfg->safe_lut); - -/* -* for chipsets not using DPU_WB_QOS_8LVL but still using DPU -* driver such as msm8998, the reset value of WB_CREQ_LUT is -* sufficient for writeback to work. SW doesn't need to explicitly -* program a value. -*/ -if (ctx->caps &&test_bit (DPU_WB_QOS_8LVL , &ctx->caps->features)) { -DPU_REG_WRITE (c,WB_CREQ_LUT_0 , cfg->creq_lut); -DPU_REG_WRITE (c,WB_CREQ_LUT_1 , cfg->creq_lut >>32 ); - } - -if (cfg->danger_safe_en) - qos_ctrl |=WB_QOS_CTRL_DANGER_SAFE_EN ; - -DPU_REG_WRITE (c,WB_QOS_CTRL , qos_ctrl); +_dpu_hw_setup_qos_lut (&ctx->hw,WB_DANGER_LUT , +test_bit (DPU_WB_QOS_8LVL , &ctx->caps->features), + cfg); } static void dpu_hw_wb_setup_cdp(struct dpu_hw_wb *ctx,
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h +1 -15
@@ -21,20 +21,6 @@ struct dpu_hw_wb_cfg {struct drm_rect crop; }; -/** -* struct dpu_hw_wb_qos_cfg : Writeback pipe QoS configuration -* @danger_lut: LUT for generate danger level based on fill level -* @safe_lut: LUT for generate safe level based on fill level -* @creq_lut: LUT for generate creq level based on fill level -* @danger_safe_en: enable danger safe generation -*/ -struct dpu_hw_wb_qos_cfg { -u32 danger_lut; -u32 safe_lut; -u64 creq_lut; -bool danger_safe_en; -}; -/** * * struct dpu_hw_wb_ops : Interface to the wb hw driver functions
@@ -56,7 +42,7 @@ struct dpu_hw_wb_ops { struct dpu_hw_wb_cfg *wb);void (*setup_qos_lut)(struct dpu_hw_wb *ctx, -struct dpu_hw_wb_qos_cfg *cfg); +struct dpu_hw_qos_cfg *cfg); void (*setup_cdp)(struct dpu_hw_wb *ctx, const struct dpu_format *fmt,
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +30 -55
148 lines not on this page · raw message
Signature · 1 line
2.39.2
Re: [Freedreno] [PATCH v2 9/9] drm/msm/dpu: use common helper for WB and SSPP QoS setup
Quoted 443 lines · Dmitry Baryshkov
Rework SSPP and WB code to use common helper for programming QoS settings.
Signed-off-by Dmitry Baryshkov <[email protected]>--- .../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(-)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +2
-2@@ -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 ];drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +7
-24@@ -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; }drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +4
-15@@ -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, -u64 creq_lut); +void (*setup_qos_lut)(struct dpu_hw_sspp *ctx, +struct dpu_hw_qos_cfg *cfg);/** * setup_qos_ctrl - setup QoS control drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +31
-0@@ -73,6 +73,19 @@ static u32 dpu_hw_util_log_mask = DPU_DBG_MASK_NONE;#define QSEED3LITE_SEP_LUT_SIZE \ (QSEED3LITE_LUT_SIZE * QSEED3LITE_SEPARABLE_LUTS * sizeof(u32)) +/* QOS_LUT */ +#define QOS_DANGER_LUT 0x00 +#define QOS_SAFE_LUT 0x04 +#define QOS_CREQ_LUT 0x08 +#define QOS_QOS_CTRL 0x0C +#define QOS_CREQ_LUT_0 0x14 +#define QOS_CREQ_LUT_1 0x18 + +/* QOS_QOS_CTRL */ +#define QOS_QOS_CTRL_DANGER_SAFE_EN BIT(0) +#define QOS_QOS_CTRL_DANGER_VBLANK_MASK GENMASK(5, 4) +#define QOS_QOS_CTRL_VBLANK_EN BIT(16) +#define QOS_QOS_CTRL_CREQ_VBLANK_MASK GENMASK(21, 20) void dpu_reg_write(struct dpu_hw_blk_reg_map *c, u32 reg_off,@@ -450,6 +463,24 @@ u64 _dpu_hw_get_qos_lut(const struct dpu_qos_lut_tbl *tbl,return 0 ; } +void _dpu_hw_setup_qos_lut (struct dpu_hw_blk_reg_map *c,u32 offset, +bool qos_8lvl, +const struct dpu_hw_qos_cfg *cfg) +{ +DPU_REG_WRITE (c, offset +QOS_DANGER_LUT , cfg->danger_lut); +DPU_REG_WRITE (c, offset +QOS_SAFE_LUT , cfg->safe_lut); + +if (qos_8lvl) { +DPU_REG_WRITE (c, offset +QOS_CREQ_LUT_0 , cfg->creq_lut); +DPU_REG_WRITE (c, offset +QOS_CREQ_LUT_1 , cfg->creq_lut >>32 ); + }else { +DPU_REG_WRITE (c, offset +QOS_CREQ_LUT , cfg->creq_lut); + } + +DPU_REG_WRITE (c, offset +QOS_QOS_CTRL , + cfg->danger_safe_en ?QOS_QOS_CTRL_DANGER_SAFE_EN :0 ); +} +void dpu_hw_setup_misr (struct dpu_hw_blk_reg_map *c,u32 misr_ctrl_offset,bool enable,u32 frame_count)drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +21
-0@@ -305,6 +305,23 @@ struct dpu_drm_scaler_v2 {struct dpu_drm_de_v1 de; }; +/** +* struct dpu_hw_qos_cfg: pipe QoS configuration +* @danger_lut: LUT for generate danger level based on fill level +* @safe_lut: LUT for generate safe level based on fill level +* @creq_lut: LUT for generate creq level based on fill level +* @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_qos_cfg { +u32 danger_lut; +u32 safe_lut; +u64 creq_lut; +bool danger_safe_en; +}; +u32 *dpu_hw_util_get_log_mask_ptr (void ); void dpu_reg_write(struct dpu_hw_blk_reg_map *c,@@ -336,6 +353,10 @@ void dpu_setup_cdp(struct dpu_hw_blk_reg_map *c, u32 offset,u64 _dpu_hw_get_qos_lut (const struct dpu_qos_lut_tbl *tbl,u32 total_fl); +void _dpu_hw_setup_qos_lut (struct dpu_hw_blk_reg_map *c,u32 offset, +bool qos_8lvl, +const struct dpu_hw_qos_cfg *cfg); + void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c, u32 misr_ctrl_offset, bool enable,drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c +4
-25@@ -49,9 +49,6 @@#define WB_OUT_IMAGE_SIZE 0x2C0#define WB_OUT_XY 0x2C4 -/* WB_QOS_CTRL */ -#define WB_QOS_CTRL_DANGER_SAFE_EN BIT(0) -static void dpu_hw_wb_setup_outaddress (struct dpu_hw_wb *ctx,struct dpu_hw_wb_cfg *data) {@@ -135,32 +132,14 @@ static void dpu_hw_wb_roi(struct dpu_hw_wb *ctx, struct dpu_hw_wb_cfg *wb) }static void dpu_hw_wb_setup_qos_lut (struct dpu_hw_wb *ctx, -struct dpu_hw_wb_qos_cfg *cfg) +struct dpu_hw_qos_cfg *cfg) { -struct dpu_hw_blk_reg_map *c = &ctx->hw; -u32 qos_ctrl =0 ; -if (!ctx || !cfg)return ; -DPU_REG_WRITE (c,WB_DANGER_LUT , cfg->danger_lut); -DPU_REG_WRITE (c,WB_SAFE_LUT , cfg->safe_lut); - -/* -* for chipsets not using DPU_WB_QOS_8LVL but still using DPU -* driver such as msm8998, the reset value of WB_CREQ_LUT is -* sufficient for writeback to work. SW doesn't need to explicitly -* program a value. -*/ -if (ctx->caps &&test_bit (DPU_WB_QOS_8LVL , &ctx->caps->features)) { -DPU_REG_WRITE (c,WB_CREQ_LUT_0 , cfg->creq_lut); -DPU_REG_WRITE (c,WB_CREQ_LUT_1 , cfg->creq_lut >>32 ); - } - -if (cfg->danger_safe_en) - qos_ctrl |=WB_QOS_CTRL_DANGER_SAFE_EN ; - -DPU_REG_WRITE (c,WB_QOS_CTRL , qos_ctrl); +_dpu_hw_setup_qos_lut (&ctx->hw,WB_DANGER_LUT , +test_bit (DPU_WB_QOS_8LVL , &ctx->caps->features), + cfg); } static void dpu_hw_wb_setup_cdp(struct dpu_hw_wb *ctx,drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h +1
-15@@ -21,20 +21,6 @@ struct dpu_hw_wb_cfg {struct drm_rect crop; }; -/** -* struct dpu_hw_wb_qos_cfg : Writeback pipe QoS configuration -* @danger_lut: LUT for generate danger level based on fill level -* @safe_lut: LUT for generate safe level based on fill level -* @creq_lut: LUT for generate creq level based on fill level -* @danger_safe_en: enable danger safe generation -*/ -struct dpu_hw_wb_qos_cfg { -u32 danger_lut; -u32 safe_lut; -u64 creq_lut; -bool danger_safe_en; -}; -/** * * struct dpu_hw_wb_ops : Interface to the wb hw driver functions @@ -56,7 +42,7 @@ struct dpu_hw_wb_ops { struct dpu_hw_wb_cfg *wb);void (*setup_qos_lut)(struct dpu_hw_wb *ctx, -struct dpu_hw_wb_qos_cfg *cfg); +struct dpu_hw_qos_cfg *cfg); void (*setup_cdp)(struct dpu_hw_wb *ctx, const struct dpu_format *fmt,drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +30
-51@@ -190,12 +190,14 @@ static u64 _dpu_plane_calc_clk(const struct drm_display_mode *mode,* _dpu_plane_calc_fill_level - calculate fill level of the given source format * @plane: Pointer to drm plane * @pipe: Pointer to software pipe +* @lut_usage: LUT usecase * @fmt: Pointer to source buffer format * @src_width: width of source buffer * Return: fill level corresponding to the source buffer/format or 0 if error */ static int _dpu_plane_calc_fill_level (struct drm_plane *plane,struct dpu_sw_pipe *pipe, +enum dpu_qos_lut_usage lut_usage,const struct dpu_format *fmt,u32 src_width) {struct dpu_plane *pdpu;@@ -207,6 +209,9 @@ static int _dpu_plane_calc_fill_level(struct drm_plane *plane,return 0 ; } +if (lut_usage ==DPU_QOS_LUT_USAGE_NRT ) +return 0 ; + pdpu =to_dpu_plane (plane); fixed_buff_size = pdpu->catalog->caps->pixel_ram_size;@@ -252,83 +257,58 @@ static void _dpu_plane_set_qos_lut(struct drm_plane *plane, const struct dpu_format *fmt, struct dpu_sw_pipe_cfg *pipe_cfg) { struct dpu_plane *pdpu = to_dpu_plane(plane); -u64 qos_lut; -u32 total_fl =0 , lut_usage; +struct dpu_hw_qos_cfg cfg; +u32 total_fl, lut_usage;if (!pdpu->is_rt_pipe) { lut_usage =DPU_QOS_LUT_USAGE_NRT ; }else { - total_fl =_dpu_plane_calc_fill_level (plane, pipe, fmt, -drm_rect_width (&pipe_cfg->src_rect)); -if (fmt &&DPU_FORMAT_IS_LINEAR (fmt)) lut_usage =DPU_QOS_LUT_USAGE_LINEAR ;else lut_usage =DPU_QOS_LUT_USAGE_MACROTILE ; } - qos_lut =_dpu_hw_get_qos_lut ( - &pdpu->catalog->perf->qos_lut_tbl[lut_usage], total_fl); + total_fl =_dpu_plane_calc_fill_level (plane, pipe, lut_usage, fmt, +drm_rect_width (&pipe_cfg->src_rect)); + + cfg.creq_lut =_dpu_hw_get_qos_lut (&pdpu->catalog->perf->qos_lut_tbl[lut_usage], total_fl); + cfg.danger_lut = pdpu->catalog->perf->danger_lut_tbl[lut_usage]; + cfg.safe_lut = pdpu->catalog->perf->safe_lut_tbl[lut_usage]; + +if (pipe->sspp->idx !=SSPP_CURSOR0 && + pipe->sspp->idx !=SSPP_CURSOR1 && + pdpu->is_rt_pipe) + cfg.danger_safe_en = true; + +DPU_DEBUG_PLANE (pdpu,"pnum:%d ds:%d is_rt:%d\n" , + pdpu->pipe -SSPP_VIG0 , + cfg.danger_safe_en, + pdpu->is_rt_pipe);trace_dpu_perf_set_qos_luts (pipe->sspp->idx -SSPP_VIG0 , (fmt) ? fmt->base.pixel_format :0 , - pdpu->is_rt_pipe, total_fl, qos_lut, lut_usage); + pdpu->is_rt_pipe, total_fl, cfg.creq_lut, lut_usage);DPU_DEBUG_PLANE (pdpu,"pnum:%d fmt: %4.4s rt:%d fl:%u lut:0x%llx\n" , pdpu->pipe -SSPP_VIG0 , fmt ? (char *)&fmt->base.pixel_format :NULL , - pdpu->is_rt_pipe, total_fl, qos_lut); - - pipe->sspp->ops.setup_creq_lut (pipe->sspp, qos_lut); -} - -/** -* _dpu_plane_set_danger_lut - set danger/safe LUT of the given plane -* @plane: Pointer to drm plane -* @pipe: Pointer to software pipe -* @fmt: Pointer to source buffer format -*/ -static void _dpu_plane_set_danger_lut (struct drm_plane *plane, -struct dpu_sw_pipe *pipe, -const struct dpu_format *fmt) -{ -struct dpu_plane *pdpu =to_dpu_plane (plane); -u32 danger_lut, safe_lut; - -if (!pdpu->is_rt_pipe) { - danger_lut = pdpu->catalog->perf->danger_lut_tbl - [DPU_QOS_LUT_USAGE_NRT ]; - safe_lut = pdpu->catalog->perf->safe_lut_tbl - [DPU_QOS_LUT_USAGE_NRT ]; - }else { -if (fmt &&DPU_FORMAT_IS_LINEAR (fmt)) { - danger_lut = pdpu->catalog->perf->danger_lut_tbl - [DPU_QOS_LUT_USAGE_LINEAR ]; - safe_lut = pdpu->catalog->perf->safe_lut_tbl - [DPU_QOS_LUT_USAGE_LINEAR ]; - }else { - danger_lut = pdpu->catalog->perf->danger_lut_tbl - [DPU_QOS_LUT_USAGE_MACROTILE ]; - safe_lut = pdpu->catalog->perf->safe_lut_tbl - [DPU_QOS_LUT_USAGE_MACROTILE ]; - } - } + pdpu->is_rt_pipe, total_fl, cfg.creq_lut);trace_dpu_perf_set_danger_luts (pdpu->pipe -SSPP_VIG0 , (fmt) ? fmt->base.pixel_format :0 , (fmt) ? fmt->fetch_mode :0 , - danger_lut, - safe_lut); + cfg.danger_lut, + cfg.safe_lut);DPU_DEBUG_PLANE (pdpu,"pnum:%d fmt: %4.4s mode:%d luts[0x%x, 0x%x]\n" , pdpu->pipe -SSPP_VIG0 , fmt ? (char *)&fmt->base.pixel_format :NULL , fmt ? fmt->fetch_mode :-1 , - danger_lut, - safe_lut); + cfg.danger_lut, + cfg.safe_lut); - pipe->sspp->ops.setup_danger_safe_lut (pipe->sspp, - danger_lut, safe_lut); + pipe->sspp->ops.setup_qos_lut (pipe->sspp, &cfg); }/** @@ -336,7 +316,6 @@ static void _dpu_plane_set_danger_lut(struct drm_plane *plane,* @plane: Pointer to drm plane * @pipe: Pointer to software pipe * @enable: true to enable QoS control -* @flags: QoS control mode (enum dpu_plane_qos) */ static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, struct dpu_sw_pipe *pipe,
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c static void dpu_plane_sspp_update_pipe(struct drm_plane *plane, · line 1070
Quoted 10 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +0
-4@@ -1086,10 +1065,6 @@ 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 );if (pipe->sspp->idx !=SSPP_CURSOR0 && pipe->sspp->idx !=SSPP_CURSOR1 )