Skip to contentSkip to conversation

drm/msm/disp/dpu: consider SSPP line width during mode valid

PATCH In review Vishnu Saini 2 participants 7 messages Mar 28 – Apr 6

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm/disp/dpu: consider SSPP line width during mode valid

Few targets have lesser SSPP line width compared to mixer width, SSPP line width also needs to be considered during mode valid to avoid failures during atomic_check.

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +8 -4
index 6bf7c46379ae..af245c44959d 100644
@@ -1591,6 +1591,7 @@ static enum drm_mode_status dpu_crtc_mode_valid(struct drm_crtc *crtc,
 {
 	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc);
 	u64 adjusted_mode_clk;
+	u32 max_width;
 
 	/* if there is no 3d_mux block we cannot merge LMs so we cannot
 	 * split the large layer into 2 LMs, filter out such modes
@@ -1613,11 +1614,14 @@ static enum drm_mode_status dpu_crtc_mode_valid(struct drm_crtc *crtc,
 		return MODE_CLOCK_HIGH;
 
 	/*
-	 * max crtc width is equal to the max mixer width * 2 and max height is 4K
+	 * max crtc width is equal to the min of max mixer width * 2 and max sspp line width * 2
+	 * max height is 4K
 	 */
-	return drm_mode_validate_size(mode,
-				      2 * dpu_kms->catalog->caps->max_mixer_width,
-				      4096);
+	max_width = 2 * min_t(u32,
+			      dpu_kms->catalog->caps->max_mixer_width,
+			      dpu_kms->catalog->caps->max_linewidth);
+
+	return drm_mode_validate_size(mode, max_width, 4096);
 }
 
 /**

---
base-commit: 6efced27f5df9d7a57e4847fe2898cdd19f72311
change-id: 20260328-msm-next-70eb896ff64d

Best regards,

Signature · 1 line
Vishnu Saini <[email protected]>
#1 lore raw
Quoted 3 lines · Vishnu Saini

Few targets have lesser SSPP line width compared to mixer width, SSPP line width also needs to be considered during mode valid to avoid failures during atomic_check.

Technically this is not correct. There is no requirement for the planes to cover the whole CRTC. Nor is there a requirement to use only 2 rectangles to cover the screen. As such, it is perfectly fine in mode_valid, if CRTC is wider than 2x max_linewidth. It would be an error if the user tries to stretch 2 rectangles in such a case.

Quoted 6 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#2 lore raw
Quoted 10 lines · Dmitry Baryshkov
Quoted 3 lines · Vishnu Saini

Few targets have lesser SSPP line width compared to mixer width, SSPP line width also needs to be considered during mode valid to avoid failures during atomic_check.

Technically this is not correct. There is no requirement for the planes to cover the whole CRTC. Nor is there a requirement to use only 2 rectangles to cover the screen. As such, it is perfectly fine in mode_valid, if CRTC is wider than 2x max_linewidth. It would be an error if the user tries to stretch 2 rectangles in such a case.

This is to fix an issue with 5k monitor on rb3gen2, since SSPP maxlinewidth is 2400 it can't cover the whole 5k buffer in left right split mode.
Do we need to fix it from drm backend by dividing 5k buffer into 2 planes and use 2 pipes in split mode.
4 SSPP rects --> 2 LMs --> 3d_mux --> DP

Quoted 10 lines
Quoted 6 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#3 lore raw
Quoted 12 lines · Vishnu Saini
Quoted 10 lines · Dmitry Baryshkov
Quoted 3 lines · Vishnu Saini

Few targets have lesser SSPP line width compared to mixer width, SSPP line width also needs to be considered during mode valid to avoid failures during atomic_check.

Technically this is not correct. There is no requirement for the planes to cover the whole CRTC. Nor is there a requirement to use only 2 rectangles to cover the screen. As such, it is perfectly fine in mode_valid, if CRTC is wider than 2x max_linewidth. It would be an error if the user tries to stretch 2 rectangles in such a case.

Quoted 4 lines

This is to fix an issue with 5k monitor on rb3gen2, since SSPP maxlinewidth is 2400 it can't cover the whole 5k buffer in left right split mode.
Do we need to fix it from drm backend by dividing 5k buffer into 2 planes and use 2 pipes in split mode.

Quad pipe is pending for 7.2, most likely. However, I think, instead you should teach compositor that if the commit fails, it should retry with the lower resolution (it might require somethi g like -E2BIG from te commit).

Quoted 12 lines

4 SSPP rects --> 2 LMs --> 3d_mux --> DP

Quoted 10 lines
Quoted 6 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
Signature · 2 lines
With best wishes
Dmitry
#4 lore raw
Quoted 18 lines · Dmitry Baryshkov
Quoted 12 lines · Vishnu Saini
Quoted 10 lines · Dmitry Baryshkov
Quoted 3 lines · Vishnu Saini

Few targets have lesser SSPP line width compared to mixer width, SSPP line width also needs to be considered during mode valid to avoid failures during atomic_check.

Technically this is not correct. There is no requirement for the planes to cover the whole CRTC. Nor is there a requirement to use only 2 rectangles to cover the screen. As such, it is perfectly fine in mode_valid, if CRTC is wider than 2x max_linewidth. It would be an error if the user tries to stretch 2 rectangles in such a case.

Quoted 4 lines

This is to fix an issue with 5k monitor on rb3gen2, since SSPP maxlinewidth is 2400 it can't cover the whole 5k buffer in left right split mode.
Do we need to fix it from drm backend by dividing 5k buffer into 2 planes and use 2 pipes in split mode.

Quoted 4 lines

Quad pipe is pending for 7.2, most likely. However, I think, instead you should teach compositor that if the commit fails, it should retry with the lower resolution (it might require somethi g like -E2BIG from te commit).

Yes, from driver we are returning "-E2BIG" during atomic_check. Thank you for the clarity, will try to fix it from compositor.

Quoted 16 lines
Quoted 12 lines

4 SSPP rects --> 2 LMs --> 3d_mux --> DP

Quoted 10 lines
Quoted 6 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
Signature · 2 lines
With best wishes
Dmitry
#5 lore raw
Quoted 19 lines · Vishnu Saini
Quoted 18 lines · Dmitry Baryshkov
Quoted 16 lines · Vishnu Saini
Quoted 10 lines · Dmitry Baryshkov
Quoted 3 lines · Vishnu Saini

Few targets have lesser SSPP line width compared to mixer width, SSPP line width also needs to be considered during mode valid to avoid failures during atomic_check.

Technically this is not correct. There is no requirement for the planes to cover the whole CRTC. Nor is there a requirement to use only 2 rectangles to cover the screen. As such, it is perfectly fine in mode_valid, if CRTC is wider than 2x max_linewidth. It would be an error if the user tries to stretch 2 rectangles in such a case.

This is to fix an issue with 5k monitor on rb3gen2, since SSPP maxlinewidth is 2400 it can't cover the whole 5k buffer in left right split mode.
Do we need to fix it from drm backend by dividing 5k buffer into 2 planes and use 2 pipes in split mode.

Quoted 6 lines
Quoted 4 lines

Quad pipe is pending for 7.2, most likely. However, I think, instead you should teach compositor that if the commit fails, it should retry with the lower resolution (it might require somethi g like -E2BIG from te commit).

Yes, from driver we are returning "-E2BIG" during atomic_check. Thank you for the clarity, will try to fix it from compositor.

Just to point out: it's not different from the driver not being able to perform the atomic commit for any other reason. For example, if card has 3 outputs but can support only 2 concurrent outputs, then each connector will still have a list of valid modes, but trying to enable outputs on all three of them would still fail (or trying to enable high-enough resolution on all three, if that removes a possible question of limiting number of outputs by other means).

Quoted 17 lines
Quoted 17 lines
Quoted 13 lines

4 SSPP rects --> 2 LMs --> 3d_mux --> DP

Quoted 10 lines
Quoted 6 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
Signature · 2 lines
With best wishes
Dmitry
Signature · 2 lines
With best wishes
Dmitry
#6 lore raw
Quoted 27 lines · Dmitry Baryshkov
Quoted 19 lines · Vishnu Saini
Quoted 18 lines · Dmitry Baryshkov
Quoted 16 lines · Vishnu Saini
Quoted 10 lines · Dmitry Baryshkov
Quoted 3 lines · Vishnu Saini

Few targets have lesser SSPP line width compared to mixer width, SSPP line width also needs to be considered during mode valid to avoid failures during atomic_check.

Technically this is not correct. There is no requirement for the planes to cover the whole CRTC. Nor is there a requirement to use only 2 rectangles to cover the screen. As such, it is perfectly fine in mode_valid, if CRTC is wider than 2x max_linewidth. It would be an error if the user tries to stretch 2 rectangles in such a case.

This is to fix an issue with 5k monitor on rb3gen2, since SSPP maxlinewidth is 2400 it can't cover the whole 5k buffer in left right split mode.
Do we need to fix it from drm backend by dividing 5k buffer into 2 planes and use 2 pipes in split mode.

Quoted 6 lines
Quoted 4 lines

Quad pipe is pending for 7.2, most likely. However, I think, instead you should teach compositor that if the commit fails, it should retry with the lower resolution (it might require somethi g like -E2BIG from te commit).

Yes, from driver we are returning "-E2BIG" during atomic_check. Thank you for the clarity, will try to fix it from compositor.

Quoted 7 lines

Just to point out: it's not different from the driver not being able to perform the atomic commit for any other reason. For example, if card has 3 outputs but can support only 2 concurrent outputs, then each connector will still have a list of valid modes, but trying to enable outputs on all three of them would still fail (or trying to enable high-enough resolution on all three, if that removes a possible question of limiting number of outputs by other means).

Thanks for pointing this out. Agreed, this is consistent with other atomic commit failure scenarios caused by resource limits.
The compositor team is looking into this from their end.

Quoted 21 lines
Quoted 17 lines
Quoted 17 lines
Quoted 13 lines

4 SSPP rects --> 2 LMs --> 3d_mux --> DP

Quoted 10 lines
Quoted 6 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
Signature · 2 lines
With best wishes
Dmitry
Signature · 2 lines
With best wishes
Dmitry