Skip to contentSkip to conversation

drm/amd/display: fix hw rotated modes when PSR-SU is enabled

PATCH Superseded Hamza Mahfooz 4 participants 11 messages Dec 5, 2023 – Dec 7, 2023

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: fix hw rotated modes when PSR-SU is enabled

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++--
 .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
 4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -0
index c146dc9cba92..79f8102d2601 100644
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
 	bool bb_changed;
 	bool fb_changed;
 	u32 i = 0;
+
 	*dirty_regions_changed = false;
 
 	/*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
 	if (plane->type == DRM_PLANE_TYPE_CURSOR)
 		return;
 
+	if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+		goto ffu;
+
 	num_clips = drm_plane_get_damage_clips_count(new_plane_state);
 	clips = drm_plane_get_damage_clips(new_plane_state);
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
 	struct fixed31_32 v_scale_ratio;
 	enum dc_rotation_angle rotation;
 	bool mirror;
+	struct dc_stream_state *stream;
 };
 
 /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +10 -2
index 139cf31d2e45..89c3bf0fe0c9 100644
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
 	if (src_y_offset < 0)
 		src_y_offset = 0;
 	/* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-	hubp->cur_rect.x = src_x_offset + param->viewport.x;
-	hubp->cur_rect.y = src_y_offset + param->viewport.y;
+	if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
+	    param->rotation != ROTATION_ANGLE_0) {
+		hubp->cur_rect.x = 0;
+		hubp->cur_rect.y = 0;
+		hubp->cur_rect.w = param->stream->timing.h_addressable;
+		hubp->cur_rect.h = param->stream->timing.v_addressable;
+	} else {
+		hubp->cur_rect.x = src_x_offset + param->viewport.x;
+		hubp->cur_rect.y = src_y_offset + param->viewport.y;
+	}
 }
 
 void hubp2_clk_cntl(struct hubp *hubp, bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
index 2b8b8366538e..ce5613a76267 100644
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
 		.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
 		.v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
 		.rotation = pipe_ctx->plane_state->rotation,
-		.mirror = pipe_ctx->plane_state->horizontal_mirror
+		.mirror = pipe_ctx->plane_state->horizontal_mirror,
+		.stream = pipe_ctx->stream
 	};
 	bool pipe_split_on = false;
 	bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
Signature · 1 line
2.43.0
#1 lore raw
Quoted 4 lines · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Here is the email for the original reporter to give an attribution tag.

Quoted 16 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
  drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++--
  .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
  4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5211

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
  	bool bb_changed;
  	bool fb_changed;
  	u32 i = 0;
+

Looks like a spurious newline here.

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5223

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
  	*dirty_regions_changed = false;
 
  	/*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
  	if (plane->type == DRM_PLANE_TYPE_CURSOR)
  		return;
 
+	if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+		goto ffu;
+

I noticed that the original report was specifically on 180°. Since you're also covering 90° and 270° with this check it sounds like it's actually problematic on those too?

Quoted 20 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
  	num_clips = drm_plane_get_damage_clips_count(new_plane_state);
  	clips = drm_plane_get_damage_clips(new_plane_state);
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
  	struct fixed31_32 v_scale_ratio;
  	enum dc_rotation_angle rotation;
  	bool mirror;
+	struct dc_stream_state *stream;
  };
 
  /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +0 -0
index 139cf31d2e45..89c3bf0fe0c9 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1081

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +2 -2
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
  	if (src_y_offset < 0)
  		src_y_offset = 0;
  	/* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-	hubp->cur_rect.x = src_x_offset + param->viewport.x;
-	hubp->cur_rect.y = src_y_offset + param->viewport.y;
+	if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
+	    param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +8 -0
+		hubp->cur_rect.x = 0;
+		hubp->cur_rect.y = 0;
+		hubp->cur_rect.w = param->stream->timing.h_addressable;
+		hubp->cur_rect.h = param->stream->timing.v_addressable;
+	} else {
+		hubp->cur_rect.x = src_x_offset + param->viewport.x;
+		hubp->cur_rect.y = src_y_offset + param->viewport.y;
+	}
  }
 
  void hubp2_clk_cntl(struct hubp *hubp, bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) · line 3421

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
  		.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
  		.v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
  		.rotation = pipe_ctx->plane_state->rotation,
-		.mirror = pipe_ctx->plane_state->horizontal_mirror
+		.mirror = pipe_ctx->plane_state->horizontal_mirror,
+		.stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a struct.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
  	};
  	bool pipe_split_on = false;
  	bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
Tested-by
#2 lore raw
Quoted 10 lines · Mario Limonciello
Quoted 4 lines · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Here is the email for the original reporter to give an attribution tag.

For this particular issue,

Quoted 31 lines
Quoted 17 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
  drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++--
  .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
  4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5211

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
      bool bb_changed;
      bool fb_changed;
      u32 i = 0;
+

Looks like a spurious newline here.

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
      *dirty_regions_changed = false;
 
      /*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
      if (plane->type == DRM_PLANE_TYPE_CURSOR)
              return;
 
Quoted 7 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5223

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
+     if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+             goto ffu;
+

I noticed that the original report was specifically on 180°. Since you're also covering 90° and 270° with this check it sounds like it's actually problematic on those too?

90 & 270 are problematic too. But from what I observed the issue is much more than just cursors.

Kai-Heng

Quoted 62 lines
Quoted 21 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
      num_clips = drm_plane_get_damage_clips_count(new_plane_state);
      clips = drm_plane_get_damage_clips(new_plane_state);
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
      struct fixed31_32 v_scale_ratio;
      enum dc_rotation_angle rotation;
      bool mirror;
+     struct dc_stream_state *stream;
  };
 
  /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +0 -0
index 139cf31d2e45..89c3bf0fe0c9 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1081

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +2 -2
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
      if (src_y_offset < 0)
              src_y_offset = 0;
      /* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-     hubp->cur_rect.x = src_x_offset + param->viewport.x;
-     hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
+         param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +8 -0
+             hubp->cur_rect.x = 0;
+             hubp->cur_rect.y = 0;
+             hubp->cur_rect.w = param->stream->timing.h_addressable;
+             hubp->cur_rect.h = param->stream->timing.v_addressable;
+     } else {
+             hubp->cur_rect.x = src_x_offset + param->viewport.x;
+             hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     }
  }
 
  void hubp2_clk_cntl(struct hubp *hubp, bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) · line 3421

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
              .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
              .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
              .rotation = pipe_ctx->plane_state->rotation,
-             .mirror = pipe_ctx->plane_state->horizontal_mirror
+             .mirror = pipe_ctx->plane_state->horizontal_mirror,
+             .stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a struct.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
      };
      bool pipe_split_on = false;
      bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
#3 lore raw
Quoted 9 lines · Kai-Heng Feng
Quoted 7 lines · Mario Limonciello
Quoted 4 lines · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Quoted 6 lines
Quoted 3 lines

Here is the email for the original reporter to give an attribution tag.

For this particular issue,

Can you confirm what kernel base you tested issue against?

I ask because Bin Li (+CC) also tested it against 6.1 based LTS kernel but ran into problems.

I wonder if it's because of other dependency patches. If that's the case it would be good to call them out in the Cc: @stable as dependencies so when Greg or Sasha backport this 6.1 doesn't get broken.

Bin,

Could you run ./scripts/decode_stacktrace.sh on your kernel trace to give us a specific line number on the issue you hit?

Thanks!

Quoted 40 lines
Quoted 32 lines
Quoted 18 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
---
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
   drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
   drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++--
   .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
   4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5211

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
       bool bb_changed;
       bool fb_changed;
       u32 i = 0;
+

Looks like a spurious newline here.

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
       *dirty_regions_changed = false;
 
       /*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
       if (plane->type == DRM_PLANE_TYPE_CURSOR)
               return;
 
Quoted 7 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5223

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
+     if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+             goto ffu;
+

I noticed that the original report was specifically on 180°. Since you're also covering 90° and 270° with this check it sounds like it's actually problematic on those too?

Quoted 2 lines

90 & 270 are problematic too. But from what I observed the issue is much more than just cursors.

Got it; thanks.

Quoted 65 lines

Kai-Heng

Quoted 62 lines
Quoted 21 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
       num_clips = drm_plane_get_damage_clips_count(new_plane_state);
       clips = drm_plane_get_damage_clips(new_plane_state);
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
       struct fixed31_32 v_scale_ratio;
       enum dc_rotation_angle rotation;
       bool mirror;
+     struct dc_stream_state *stream;
   };
 
   /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +0 -0
index 139cf31d2e45..89c3bf0fe0c9 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1081

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +2 -2
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
       if (src_y_offset < 0)
               src_y_offset = 0;
       /* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-     hubp->cur_rect.x = src_x_offset + param->viewport.x;
-     hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
+         param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +8 -0
+             hubp->cur_rect.x = 0;
+             hubp->cur_rect.y = 0;
+             hubp->cur_rect.w = param->stream->timing.h_addressable;
+             hubp->cur_rect.h = param->stream->timing.v_addressable;
+     } else {
+             hubp->cur_rect.x = src_x_offset + param->viewport.x;
+             hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     }
   }
 
   void hubp2_clk_cntl(struct hubp *hubp, bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) · line 3421

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
               .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
               .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
               .rotation = pipe_ctx->plane_state->rotation,
-             .mirror = pipe_ctx->plane_state->horizontal_mirror
+             .mirror = pipe_ctx->plane_state->horizontal_mirror,
+             .stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a struct.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
       };
       bool pipe_split_on = false;
       bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
#4 lore raw
Quoted 15 lines · Mario Limonciello
Quoted 13 lines · Kai-Heng Feng
Quoted 10 lines · Mario Limonciello
Quoted 4 lines · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Here is the email for the original reporter to give an attribution tag.

Quoted 7 lines
Quoted 2 lines

For this particular issue,

Can you confirm what kernel base you tested issue against?

I ask because Bin Li (+CC) also tested it against 6.1 based LTS kernel but ran into problems.

The patch was tested against ADSN.

Quoted 4 lines

I wonder if it's because of other dependency patches. If that's the case it would be good to call them out in the Cc: @stable as dependencies so when Greg or Sasha backport this 6.1 doesn't get broken.

Probably. I haven't really tested any older kernel series.

Kai-Heng

Quoted 118 lines

Bin,

Could you run ./scripts/decode_stacktrace.sh on your kernel trace to give us a specific line number on the issue you hit?

Thanks!

Quoted 40 lines
Quoted 32 lines
Quoted 18 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
---
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
   drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
   drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++--
   .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
   4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5211

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
       bool bb_changed;
       bool fb_changed;
       u32 i = 0;
+

Looks like a spurious newline here.

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
       *dirty_regions_changed = false;
 
       /*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
       if (plane->type == DRM_PLANE_TYPE_CURSOR)
               return;
 
Quoted 7 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5223

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
+     if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+             goto ffu;
+

I noticed that the original report was specifically on 180°. Since you're also covering 90° and 270° with this check it sounds like it's actually problematic on those too?

Quoted 2 lines

90 & 270 are problematic too. But from what I observed the issue is much more than just cursors.

Got it; thanks.

Quoted 65 lines

Kai-Heng

Quoted 62 lines
Quoted 21 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
       num_clips = drm_plane_get_damage_clips_count(new_plane_state);
       clips = drm_plane_get_damage_clips(new_plane_state);
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
       struct fixed31_32 v_scale_ratio;
       enum dc_rotation_angle rotation;
       bool mirror;
+     struct dc_stream_state *stream;
   };
 
   /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +0 -0
index 139cf31d2e45..89c3bf0fe0c9 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1081

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +2 -2
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
       if (src_y_offset < 0)
               src_y_offset = 0;
       /* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-     hubp->cur_rect.x = src_x_offset + param->viewport.x;
-     hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
+         param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +8 -0
+             hubp->cur_rect.x = 0;
+             hubp->cur_rect.y = 0;
+             hubp->cur_rect.w = param->stream->timing.h_addressable;
+             hubp->cur_rect.h = param->stream->timing.v_addressable;
+     } else {
+             hubp->cur_rect.x = src_x_offset + param->viewport.x;
+             hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     }
   }
 
   void hubp2_clk_cntl(struct hubp *hubp, bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) · line 3421

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
               .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
               .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
               .rotation = pipe_ctx->plane_state->rotation,
-             .mirror = pipe_ctx->plane_state->horizontal_mirror
+             .mirror = pipe_ctx->plane_state->horizontal_mirror,
+             .stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a struct.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
       };
       bool pipe_split_on = false;
       bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
#5 lore raw
Quoted 25 lines · Kai-Heng Feng
Quoted 15 lines · Mario Limonciello
Quoted 13 lines · Kai-Heng Feng
Quoted 10 lines · Mario Limonciello
Quoted 4 lines · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Here is the email for the original reporter to give an attribution tag.

Quoted 7 lines
Quoted 2 lines

For this particular issue,

Can you confirm what kernel base you tested issue against?

I ask because Bin Li (+CC) also tested it against 6.1 based LTS kernel but ran into problems.

Quoted 8 lines

The patch was tested against ADSN.

Quoted 4 lines

I wonder if it's because of other dependency patches. If that's the case it would be good to call them out in the Cc: @stable as dependencies so when Greg or Sasha backport this 6.1 doesn't get broken.

Probably. I haven't really tested any older kernel series.

Since you've got a good environment to test it and reproduce it would you mind double checking it against 6.7-rc, 6.5 and 6.1 trees? If we don't have confidence it works on the older trees I think we'll need to drop the stable tag.

Quoted 121 lines

Kai-Heng

Quoted 118 lines

Bin,

Could you run ./scripts/decode_stacktrace.sh on your kernel trace to give us a specific line number on the issue you hit?

Thanks!

Quoted 40 lines
Quoted 32 lines
Quoted 18 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
---
    drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
    drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
    drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++--
    .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
    4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5211

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
        bool bb_changed;
        bool fb_changed;
        u32 i = 0;
+

Looks like a spurious newline here.

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        *dirty_regions_changed = false;
 
        /*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
        if (plane->type == DRM_PLANE_TYPE_CURSOR)
                return;
 
Quoted 7 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5223

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
+     if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+             goto ffu;
+

I noticed that the original report was specifically on 180°. Since you're also covering 90° and 270° with this check it sounds like it's actually problematic on those too?

Quoted 2 lines

90 & 270 are problematic too. But from what I observed the issue is much more than just cursors.

Got it; thanks.

Quoted 65 lines

Kai-Heng

Quoted 62 lines
Quoted 21 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        num_clips = drm_plane_get_damage_clips_count(new_plane_state);
        clips = drm_plane_get_damage_clips(new_plane_state);
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
        struct fixed31_32 v_scale_ratio;
        enum dc_rotation_angle rotation;
        bool mirror;
+     struct dc_stream_state *stream;
    };
 
    /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +0 -0
index 139cf31d2e45..89c3bf0fe0c9 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1081

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +2 -2
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
        if (src_y_offset < 0)
                src_y_offset = 0;
        /* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-     hubp->cur_rect.x = src_x_offset + param->viewport.x;
-     hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
+         param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +8 -0
+             hubp->cur_rect.x = 0;
+             hubp->cur_rect.y = 0;
+             hubp->cur_rect.w = param->stream->timing.h_addressable;
+             hubp->cur_rect.h = param->stream->timing.v_addressable;
+     } else {
+             hubp->cur_rect.x = src_x_offset + param->viewport.x;
+             hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     }
    }
 
    void hubp2_clk_cntl(struct hubp *hubp, bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) · line 3421

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
                .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
                .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
                .rotation = pipe_ctx->plane_state->rotation,
-             .mirror = pipe_ctx->plane_state->horizontal_mirror
+             .mirror = pipe_ctx->plane_state->horizontal_mirror,
+             .stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a struct.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
        };
        bool pipe_split_on = false;
        bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
#6 lore raw
Quoted 34 lines · Mario Limonciello
Quoted 32 lines · Kai-Heng Feng
Quoted 15 lines · Mario Limonciello
Quoted 13 lines · Kai-Heng Feng
Quoted 10 lines · Mario Limonciello
Quoted 4 lines · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Here is the email for the original reporter to give an attribution tag.

Quoted 7 lines
Quoted 2 lines

For this particular issue,

Can you confirm what kernel base you tested issue against?

I ask because Bin Li (+CC) also tested it against 6.1 based LTS kernel but ran into problems.

The patch was tested against ADSN.

Quoted 4 lines

I wonder if it's because of other dependency patches. If that's the case it would be good to call them out in the Cc: @stable as dependencies so when Greg or Sasha backport this 6.1 doesn't get broken.

Quoted 6 lines
Quoted 1 line

Probably. I haven't really tested any older kernel series.

Since you've got a good environment to test it and reproduce it would you mind double checking it against 6.7-rc, 6.5 and 6.1 trees? If we don't have confidence it works on the older trees I think we'll need to drop the stable tag.

Not seeing issues here when the patch is applied against 6.5 and 6.1 (which needs to resolve a minor conflict).

I am not sure what happened for Bin's case.

Kai-Heng

Quoted 122 lines
Quoted 121 lines

Kai-Heng

Quoted 118 lines

Bin,

Could you run ./scripts/decode_stacktrace.sh on your kernel trace to give us a specific line number on the issue you hit?

Thanks!

Quoted 40 lines
Quoted 32 lines
Quoted 18 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
---
    drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
    drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
    drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++--
    .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
    4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5211

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
        bool bb_changed;
        bool fb_changed;
        u32 i = 0;
+

Looks like a spurious newline here.

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        *dirty_regions_changed = false;
 
        /*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
        if (plane->type == DRM_PLANE_TYPE_CURSOR)
                return;
 
Quoted 7 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5223

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
+     if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+             goto ffu;
+

I noticed that the original report was specifically on 180°. Since you're also covering 90° and 270° with this check it sounds like it's actually problematic on those too?

Quoted 2 lines

90 & 270 are problematic too. But from what I observed the issue is much more than just cursors.

Got it; thanks.

Quoted 65 lines

Kai-Heng

Quoted 62 lines
Quoted 21 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        num_clips = drm_plane_get_damage_clips_count(new_plane_state);
        clips = drm_plane_get_damage_clips(new_plane_state);
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
        struct fixed31_32 v_scale_ratio;
        enum dc_rotation_angle rotation;
        bool mirror;
+     struct dc_stream_state *stream;
    };
 
    /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +0 -0
index 139cf31d2e45..89c3bf0fe0c9 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1081

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +2 -2
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
        if (src_y_offset < 0)
                src_y_offset = 0;
        /* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-     hubp->cur_rect.x = src_x_offset + param->viewport.x;
-     hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
+         param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +8 -0
+             hubp->cur_rect.x = 0;
+             hubp->cur_rect.y = 0;
+             hubp->cur_rect.w = param->stream->timing.h_addressable;
+             hubp->cur_rect.h = param->stream->timing.v_addressable;
+     } else {
+             hubp->cur_rect.x = src_x_offset + param->viewport.x;
+             hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     }
    }
 
    void hubp2_clk_cntl(struct hubp *hubp, bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) · line 3421

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
                .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
                .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
                .rotation = pipe_ctx->plane_state->rotation,
-             .mirror = pipe_ctx->plane_state->horizontal_mirror
+             .mirror = pipe_ctx->plane_state->horizontal_mirror,
+             .stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a struct.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
        };
        bool pipe_split_on = false;
        bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
#8 lore raw
In reply to Bin Li

Hi Mario,

It's a false alarm from my side, after testing the 6.1.0-oem and
6.5.0-oem kernels, this patch works perfectly fine, sorry about that.

Quoted 182 lines · Bin Li

Hi Mario,

I found I missed the part in drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c with kai.heng's review. I will rebuild a new kernel and test it again, and reply later, sorry about that.

Quoted 173 lines · Kai-Heng Feng
Quoted 34 lines · Mario Limonciello
Quoted 32 lines · Kai-Heng Feng
Quoted 15 lines · Mario Limonciello
Quoted 13 lines · Kai-Heng Feng
Quoted 10 lines · Mario Limonciello
Quoted 4 lines · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Here is the email for the original reporter to give an attribution tag.

Quoted 7 lines
Quoted 2 lines

For this particular issue,

Can you confirm what kernel base you tested issue against?

I ask because Bin Li (+CC) also tested it against 6.1 based LTS kernel but ran into problems.

The patch was tested against ADSN.

Quoted 4 lines

I wonder if it's because of other dependency patches. If that's the case it would be good to call them out in the Cc: @stable as dependencies so when Greg or Sasha backport this 6.1 doesn't get broken.

Quoted 6 lines
Quoted 1 line

Probably. I haven't really tested any older kernel series.

Since you've got a good environment to test it and reproduce it would you mind double checking it against 6.7-rc, 6.5 and 6.1 trees? If we don't have confidence it works on the older trees I think we'll need to drop the stable tag.

Not seeing issues here when the patch is applied against 6.5 and 6.1 (which needs to resolve a minor conflict).

I am not sure what happened for Bin's case.

Kai-Heng

Quoted 122 lines
Quoted 121 lines

Kai-Heng

Quoted 118 lines

Bin,

Could you run ./scripts/decode_stacktrace.sh on your kernel trace to give us a specific line number on the issue you hit?

Thanks!

Quoted 40 lines
Quoted 32 lines
Quoted 18 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
---
    drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
    drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
    drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++--
    .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
    4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5211

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
        bool bb_changed;
        bool fb_changed;
        u32 i = 0;
+

Looks like a spurious newline here.

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        *dirty_regions_changed = false;
 
        /*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
        if (plane->type == DRM_PLANE_TYPE_CURSOR)
                return;
 
Quoted 7 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5223

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
+     if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+             goto ffu;
+

I noticed that the original report was specifically on 180°. Since you're also covering 90° and 270° with this check it sounds like it's actually problematic on those too?

Quoted 2 lines

90 & 270 are problematic too. But from what I observed the issue is much more than just cursors.

Got it; thanks.

Quoted 65 lines

Kai-Heng

Quoted 62 lines
Quoted 21 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        num_clips = drm_plane_get_damage_clips_count(new_plane_state);
        clips = drm_plane_get_damage_clips(new_plane_state);
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
        struct fixed31_32 v_scale_ratio;
        enum dc_rotation_angle rotation;
        bool mirror;
+     struct dc_stream_state *stream;
    };
 
    /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +0 -0
index 139cf31d2e45..89c3bf0fe0c9 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1081

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +2 -2
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
        if (src_y_offset < 0)
                src_y_offset = 0;
        /* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-     hubp->cur_rect.x = src_x_offset + param->viewport.x;
-     hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
+         param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +8 -0
+             hubp->cur_rect.x = 0;
+             hubp->cur_rect.y = 0;
+             hubp->cur_rect.w = param->stream->timing.h_addressable;
+             hubp->cur_rect.h = param->stream->timing.v_addressable;
+     } else {
+             hubp->cur_rect.x = src_x_offset + param->viewport.x;
+             hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     }
    }
 
    void hubp2_clk_cntl(struct hubp *hubp, bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) · line 3421

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
                .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
                .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
                .rotation = pipe_ctx->plane_state->rotation,
-             .mirror = pipe_ctx->plane_state->horizontal_mirror
+             .mirror = pipe_ctx->plane_state->horizontal_mirror,
+             .stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a struct.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
        };
        bool pipe_split_on = false;
        bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
#9 lore raw

Bin, KH,

Thanks for the confirmation!

Hamza,

I think you can add a Tested-by tag for Bin too.

Quoted 188 lines · Bin Li

Hi Mario,

It's a false alarm from my side, after testing the 6.1.0-oem and
6.5.0-oem kernels, this patch works perfectly fine, sorry about that.

Quoted 182 lines · Bin Li

Hi Mario,

I found I missed the part in drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c with kai.heng's review. I will rebuild a new kernel and test it again, and reply later, sorry about that.

Quoted 173 lines · Kai-Heng Feng
Quoted 34 lines · Mario Limonciello
Quoted 32 lines · Kai-Heng Feng
Quoted 15 lines · Mario Limonciello
Quoted 13 lines · Kai-Heng Feng
Quoted 10 lines · Mario Limonciello
Quoted 4 lines · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Here is the email for the original reporter to give an attribution tag.

Quoted 7 lines
Quoted 2 lines

For this particular issue,

Can you confirm what kernel base you tested issue against?

I ask because Bin Li (+CC) also tested it against 6.1 based LTS kernel but ran into problems.

The patch was tested against ADSN.

Quoted 4 lines

I wonder if it's because of other dependency patches. If that's the case it would be good to call them out in the Cc: @stable as dependencies so when Greg or Sasha backport this 6.1 doesn't get broken.

Quoted 6 lines
Quoted 1 line

Probably. I haven't really tested any older kernel series.

Since you've got a good environment to test it and reproduce it would you mind double checking it against 6.7-rc, 6.5 and 6.1 trees? If we don't have confidence it works on the older trees I think we'll need to drop the stable tag.

Not seeing issues here when the patch is applied against 6.5 and 6.1 (which needs to resolve a minor conflict).

I am not sure what happened for Bin's case.

Kai-Heng

Quoted 122 lines
Quoted 121 lines

Kai-Heng

Quoted 118 lines

Bin,

Could you run ./scripts/decode_stacktrace.sh on your kernel trace to give us a specific line number on the issue you hit?

Thanks!

Quoted 40 lines
Quoted 32 lines
Quoted 18 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
---
     drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
     drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
     drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++--
     .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
     4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5211

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
         bool bb_changed;
         bool fb_changed;
         u32 i = 0;
+

Looks like a spurious newline here.

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
         *dirty_regions_changed = false;
 
         /*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
         if (plane->type == DRM_PLANE_TYPE_CURSOR)
                 return;
 
Quoted 7 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane *plane, · line 5223

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
+     if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+             goto ffu;
+

I noticed that the original report was specifically on 180°. Since you're also covering 90° and 270° with this check it sounds like it's actually problematic on those too?

Quoted 2 lines

90 & 270 are problematic too. But from what I observed the issue is much more than just cursors.

Got it; thanks.

Quoted 65 lines

Kai-Heng

Quoted 62 lines
Quoted 21 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
         num_clips = drm_plane_get_damage_clips_count(new_plane_state);
         clips = drm_plane_get_damage_clips(new_plane_state);
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
         struct fixed31_32 v_scale_ratio;
         enum dc_rotation_angle rotation;
         bool mirror;
+     struct dc_stream_state *stream;
     };
 
     /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +0 -0
index 139cf31d2e45..89c3bf0fe0c9 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1081

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +2 -2
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
         if (src_y_offset < 0)
                 src_y_offset = 0;
         /* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-     hubp->cur_rect.x = src_x_offset + param->viewport.x;
-     hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
+         param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 16 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +8 -0
+             hubp->cur_rect.x = 0;
+             hubp->cur_rect.y = 0;
+             hubp->cur_rect.w = param->stream->timing.h_addressable;
+             hubp->cur_rect.h = param->stream->timing.v_addressable;
+     } else {
+             hubp->cur_rect.x = src_x_offset + param->viewport.x;
+             hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     }
     }
 
     void hubp2_clk_cntl(struct hubp *hubp, bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) · line 3421

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
                 .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
                 .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
                 .rotation = pipe_ctx->plane_state->rotation,
-             .mirror = pipe_ctx->plane_state->horizontal_mirror
+             .mirror = pipe_ctx->plane_state->horizontal_mirror,
+             .stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a struct.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
         };
         bool pipe_split_on = false;
         bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
#10 lore raw
In reply to Mario Limonciello
Quoted 34 lines · Mario Limonciello
Quoted 4 lines · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Here is the email for the original reporter to give an attribution tag.

Quoted 16 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++ drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 + drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12 ++++++++++-- .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-

  4 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane · line 5212

Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane 
 *plane,
       bool bb_changed;
       bool fb_changed;
       u32 i = 0;
+

Looks like a spurious newline here.

Quoted 11 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct drm_plane · line 5223

Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
       *dirty_regions_changed = false;
       /*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane 
 *plane,
       if (plane->type == DRM_PLANE_TYPE_CURSOR)
           return;
+    if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+        goto ffu;
+

I noticed that the original report was specifically on 180°.  Since you're also covering 90° and 270° with this check it sounds like it's actually problematic on those too?

Ya it's problematic for 90 and 270 as well, though most mainstream compositors don't use hardware rotation for those cases under any circumstances. So, I doubt that many people would encounter this issue in the wild for them.

Quoted 59 lines
Quoted 25 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
       num_clips = drm_plane_get_damage_clips_count(new_plane_state);
       clips = drm_plane_get_damage_clips(new_plane_state);
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index 9649934ea186..e2a3aa8812df 100644
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
       struct fixed31_32 v_scale_ratio;
       enum dc_rotation_angle rotation;
       bool mirror;
+    struct dc_stream_state *stream;
   };
   /* IPP related types */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +1 -2
index 139cf31d2e45..89c3bf0fe0c9 100644
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
       if (src_y_offset < 0)
           src_y_offset = 0;
       /* Save necessary cursor info x, y position. w, h is saved in attribute func. */
-    hubp->cur_rect.x = src_x_offset + param->viewport.x;
-    hubp->cur_rect.y = src_y_offset + param->viewport.y;
+    if (param->stream->link->psr_settings.psr_version >= 
Quoted 2 lines

DC_PSR_VERSION_SU_1 &&
+        param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 15 lines

+        hubp->cur_rect.x = 0;
+        hubp->cur_rect.y = 0;
+        hubp->cur_rect.w = param->stream->timing.h_addressable; +        hubp->cur_rect.h = param->stream->timing.v_addressable; +    } else {
+        hubp->cur_rect.x = src_x_offset + param->viewport.x; +        hubp->cur_rect.y = src_y_offset + param->viewport.y; +    }
  }
  void hubp2_clk_cntl(struct hubp *hubp, bool enable)

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct pipe_ctx · line 3422

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx 
 *pipe_ctx)
           .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
           .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
           .rotation = pipe_ctx->plane_state->rotation,
-        .mirror = pipe_ctx->plane_state->horizontal_mirror
+        .mirror = pipe_ctx->plane_state->horizontal_mirror,
+        .stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a struct.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
       };
       bool pipe_split_on = false;

      bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||

Signature · 1 line
Hamza
#7 lore raw
In reply to Kai-Heng Feng

Hi Mario,

I found I missed the part
in drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c with kai.heng's review.
I will rebuild a new kernel and test it again, and reply later, sorry about that.

Quoted 195 lines · Kai-Heng Feng
Quoted 11 lines · Mario Limonciello
Quoted 9 lines · Kai-Heng Feng
Quoted 7 lines · Mario Limonciello
Quoted 5 lines · Kai-Heng Feng
Quoted 3 lines · Mario Limonciello
Quoted 1 line · Hamza Mahfooz

We currently don't support dirty rectangles on hardware rotated

modes.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes).

Here is the email for the original reporter to give an attribution

tag.

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

For this particular issue,

Can you confirm what kernel base you tested issue against?

I ask because Bin Li (+CC) also tested it against 6.1 based LTS kernel but ran into problems.

Quoted 6 lines
Quoted 6 lines

The patch was tested against ADSN.

Quoted 4 lines

I wonder if it's because of other dependency patches. If that's the case it would be good to call them out in the Cc: @stable as dependencies so when Greg or Sasha backport this 6.1 doesn't get

broken.

Quoted 7 lines
Quoted 2 lines

Probably. I haven't really tested any older kernel series.

Since you've got a good environment to test it and reproduce it would you mind double checking it against 6.7-rc, 6.5 and 6.1 trees? If we don't have confidence it works on the older trees I think we'll need to drop the stable tag.

Not seeing issues here when the patch is applied against 6.5 and 6.1 (which needs to resolve a minor conflict).

I am not sure what happened for Bin's case.

Kai-Heng

Quoted 9 lines
Quoted 9 lines

Kai-Heng

Quoted 6 lines

Bin,

Could you run ./scripts/decode_stacktrace.sh on your kernel trace to give us a specific line number on the issue you hit?

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Thanks!

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Fixes 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS

support")

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
---
    drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++++
    drivers/gpu/drm/amd/display/dc/dc_hw_types.h         |  1 +
    drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c    | 12

++++++++++--

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Review

Quoted 4 lines
    .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c  |  3 ++-
    4 files changed, 17 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct

Quoted 4 lines

index c146dc9cba92..79f8102d2601 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
@@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct

drm_plane *plane,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct · line 5211

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
        bool bb_changed;
        bool fb_changed;
        u32 i = 0;
+

Looks like a spurious newline here.

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        *dirty_regions_changed = false;
 
        /*
@@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct

drm_plane *plane,

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void fill_dc_dirty_rects(struct · line 5223

Quoted 6 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
        if (plane->type == DRM_PLANE_TYPE_CURSOR)
                return;
 
+     if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
+             goto ffu;
+

I noticed that the original report was specifically on 180°. Since you're also covering 90° and 270° with this check it sounds like

it's

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

actually problematic on those too?

90 & 270 are problematic too. But from what I observed the issue is much more than just cursors.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Got it; thanks.

Quoted 5 lines

Kai-Heng

Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        num_clips =

drm_plane_get_damage_clips_count(new_plane_state);

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Review

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        clips = drm_plane_get_damage_clips(new_plane_state);
 
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

index 9649934ea186..e2a3aa8812df 100644

drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
        struct fixed31_32 v_scale_ratio;
        enum dc_rotation_angle rotation;
        bool mirror;
+     struct dc_stream_state *stream;
    };
 
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +0 -0
    /* IPP related types */
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1079

Quoted 7 lines

index 139cf31d2e45..89c3bf0fe0c9 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +0 -0
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
        if (src_y_offset < 0)
                src_y_offset = 0;
        /* Save necessary cursor info x, y position. w, h is saved

in attribute func. */

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1080

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +1 -2
-     hubp->cur_rect.x = src_x_offset + param->viewport.x;
-     hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     if (param->stream->link->psr_settings.psr_version >=

DC_PSR_VERSION_SU_1 &&

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1081

Quoted 1 line
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +1 -0
+         param->rotation != ROTATION_ANGLE_0) {

Ditto on above about 90° and 270°.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +3 -0
+             hubp->cur_rect.x = 0;
+             hubp->cur_rect.y = 0;
+             hubp->cur_rect.w =

param->stream->timing.h_addressable;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c void hubp2_cursor_set_position( · line 1085

Quoted 1 line
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +1 -0
+             hubp->cur_rect.h =

param->stream->timing.v_addressable;

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +4 -0
+     } else {
+             hubp->cur_rect.x = src_x_offset + param->viewport.x;
+             hubp->cur_rect.y = src_y_offset + param->viewport.y;
+     }
    }
 
    void hubp2_clk_cntl(struct hubp *hubp, bool enable)

diff --git

a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct

Quoted 4 lines

index 2b8b8366538e..ce5613a76267 100644

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct

pipe_ctx *pipe_ctx)

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct · line 3417

Quoted 1 line
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
                .h_scale_ratio =

pipe_ctx->plane_res.scl_data.ratios.horz,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct · line 3418

Quoted 1 line
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
                .v_scale_ratio =

pipe_ctx->plane_res.scl_data.ratios.vert,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c void dcn10_set_cursor_position(struct · line 3421

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -1
                .rotation = pipe_ctx->plane_state->rotation,
-             .mirror = pipe_ctx->plane_state->horizontal_mirror
+             .mirror = pipe_ctx->plane_state->horizontal_mirror,
+             .stream = pipe_ctx->stream

As a nit; I think it's worth leaving a harmless trailing ',' so that there is less ping pong in the future when adding new members to a

struct.

Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +0 -0
        };
        bool pipe_split_on = false;
        bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||