<div dir="ltr">Hi Mario,<div><br></div><div>I found I missed the part in drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c with kai.heng's review.</div><div>I will rebuild a new kernel and test it again, and reply later, sorry about that.</div><div><br><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 7, 2023 at 2:58 PM Kai-Heng Feng <<a href="mailto:kai.heng.feng@canonical.com">kai.heng.feng@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Dec 7, 2023 at 10:10 AM Mario Limonciello<br>
<<a href="mailto:mario.limonciello@amd.com" target="_blank">mario.limonciello@amd.com</a>> wrote:<br>
><br>
> On 12/6/2023 20:07, Kai-Heng Feng wrote:<br>
> > On Thu, Dec 7, 2023 at 9:57 AM Mario Limonciello<br>
> > <<a href="mailto:mario.limonciello@amd.com" target="_blank">mario.limonciello@amd.com</a>> wrote:<br>
> >><br>
> >> On 12/6/2023 19:23, Kai-Heng Feng wrote:<br>
> >>> On Wed, Dec 6, 2023 at 4:29 AM Mario Limonciello<br>
> >>> <<a href="mailto:mario.limonciello@amd.com" target="_blank">mario.limonciello@amd.com</a>> wrote:<br>
> >>>><br>
> >>>> On 12/5/2023 14:17, Hamza Mahfooz wrote:<br>
> >>>>> We currently don't support dirty rectangles on hardware rotated modes.<br>
> >>>>> So, if a user is using hardware rotated modes with PSR-SU enabled,<br>
> >>>>> use PSR-SU FFU for all rotated planes (including cursor planes).<br>
> >>>>><br>
> >>>><br>
> >>>> Here is the email for the original reporter to give an attribution tag.<br>
> >>>><br>
> >>>> Reported-by: Kai-Heng Feng <<a href="mailto:kai.heng.feng@canonical.com" target="_blank">kai.heng.feng@canonical.com</a>><br>
> >>><br>
> >>> For this particular issue,<br>
> >>> Tested-by: Kai-Heng Feng <<a href="mailto:kai.heng.feng@canonical.com" target="_blank">kai.heng.feng@canonical.com</a>><br>
> >><br>
> >> Can you confirm what kernel base you tested issue against?<br>
> >><br>
> >> I ask because Bin Li (+CC) also tested it against 6.1 based LTS kernel<br>
> >> but ran into problems.<br>
> ><br>
> > The patch was tested against ADSN.<br>
> ><br>
> >><br>
> >> I wonder if it's because of other dependency patches. If that's the<br>
> >> case it would be good to call them out in the Cc: @stable as<br>
> >> dependencies so when Greg or Sasha backport this 6.1 doesn't get broken.<br>
> ><br>
> > Probably. I haven't really tested any older kernel series.<br>
><br>
> Since you've got a good environment to test it and reproduce it would<br>
> you mind double checking it against 6.7-rc, 6.5 and 6.1 trees? If we<br>
> don't have confidence it works on the older trees I think we'll need to<br>
> drop the stable tag.<br>
<br>
Not seeing issues here when the patch is applied against 6.5 and 6.1<br>
(which needs to resolve a minor conflict).<br>
<br>
I am not sure what happened for Bin's case.<br>
<br>
Kai-Heng<br>
<br>
> ><br>
> > Kai-Heng<br>
> ><br>
> >><br>
> >> Bin,<br>
> >><br>
> >> Could you run ./scripts/decode_stacktrace.sh on your kernel trace to<br>
> >> give us a specific line number on the issue you hit?<br>
> >><br>
> >> Thanks!<br>
> >>><br>
> >>>><br>
> >>>>> Cc: <a href="mailto:stable@vger.kernel.org" target="_blank">stable@vger.kernel.org</a><br>
> >>>>> Link: <a href="https://gitlab.freedesktop.org/drm/amd/-/issues/2952" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/drm/amd/-/issues/2952</a><br>
> >>>>> Fixes: 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")<br>
> >>>>> Signed-off-by: Hamza Mahfooz <<a href="mailto:hamza.mahfooz@amd.com" target="_blank">hamza.mahfooz@amd.com</a>><br>
> >>>>> ---<br>
> >>>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++<br>
> >>>>> drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 1 +<br>
> >>>>> drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 12 ++++++++++--<br>
> >>>>> .../gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 3 ++-<br>
> >>>>> 4 files changed, 17 insertions(+), 3 deletions(-)<br>
> >>>>><br>
> >>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
> >>>>> index c146dc9cba92..79f8102d2601 100644<br>
> >>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
> >>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
> >>>>> @@ -5208,6 +5208,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,<br>
> >>>>> bool bb_changed;<br>
> >>>>> bool fb_changed;<br>
> >>>>> u32 i = 0;<br>
> >>>>> +<br>
> >>>><br>
> >>>> Looks like a spurious newline here.<br>
> >>>><br>
> >>>>> *dirty_regions_changed = false;<br>
> >>>>><br>
> >>>>> /*<br>
> >>>>> @@ -5217,6 +5218,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,<br>
> >>>>> if (plane->type == DRM_PLANE_TYPE_CURSOR)<br>
> >>>>> return;<br>
> >>>>><br>
> >>>>> + if (new_plane_state->rotation != DRM_MODE_ROTATE_0)<br>
> >>>>> + goto ffu;<br>
> >>>>> +<br>
> >>>><br>
> >>>> I noticed that the original report was specifically on 180°. Since<br>
> >>>> you're also covering 90° and 270° with this check it sounds like it's<br>
> >>>> actually problematic on those too?<br>
> >>><br>
> >>> 90 & 270 are problematic too. But from what I observed the issue is<br>
> >>> much more than just cursors.<br>
> >><br>
> >> Got it; thanks.<br>
> >><br>
> >>><br>
> >>> Kai-Heng<br>
> >>><br>
> >>>><br>
> >>>>> num_clips = drm_plane_get_damage_clips_count(new_plane_state);<br>
> >>>>> clips = drm_plane_get_damage_clips(new_plane_state);<br>
> >>>>><br>
> >>>>> diff --git a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h<br>
> >>>>> index 9649934ea186..e2a3aa8812df 100644<br>
> >>>>> --- a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h<br>
> >>>>> +++ b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h<br>
> >>>>> @@ -465,6 +465,7 @@ struct dc_cursor_mi_param {<br>
> >>>>> struct fixed31_32 v_scale_ratio;<br>
> >>>>> enum dc_rotation_angle rotation;<br>
> >>>>> bool mirror;<br>
> >>>>> + struct dc_stream_state *stream;<br>
> >>>>> };<br>
> >>>>><br>
> >>>>> /* IPP related types */<br>
> >>>>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c<br>
> >>>>> index 139cf31d2e45..89c3bf0fe0c9 100644<br>
> >>>>> --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c<br>
> >>>>> +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c<br>
> >>>>> @@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(<br>
> >>>>> if (src_y_offset < 0)<br>
> >>>>> src_y_offset = 0;<br>
> >>>>> /* Save necessary cursor info x, y position. w, h is saved in attribute func. */<br>
> >>>>> - hubp->cur_rect.x = src_x_offset + param->viewport.x;<br>
> >>>>> - hubp->cur_rect.y = src_y_offset + param->viewport.y;<br>
> >>>>> + if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&<br>
> >>>>> + param->rotation != ROTATION_ANGLE_0) {<br>
> >>>><br>
> >>>> Ditto on above about 90° and 270°.<br>
> >>>><br>
> >>>>> + hubp->cur_rect.x = 0;<br>
> >>>>> + hubp->cur_rect.y = 0;<br>
> >>>>> + hubp->cur_rect.w = param->stream->timing.h_addressable;<br>
> >>>>> + hubp->cur_rect.h = param->stream->timing.v_addressable;<br>
> >>>>> + } else {<br>
> >>>>> + hubp->cur_rect.x = src_x_offset + param->viewport.x;<br>
> >>>>> + hubp->cur_rect.y = src_y_offset + param->viewport.y;<br>
> >>>>> + }<br>
> >>>>> }<br>
> >>>>><br>
> >>>>> void hubp2_clk_cntl(struct hubp *hubp, bool enable)<br>
> >>>>> 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<br>
> >>>>> index 2b8b8366538e..ce5613a76267 100644<br>
> >>>>> --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c<br>
> >>>>> +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c<br>
> >>>>> @@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)<br>
> >>>>> .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,<br>
> >>>>> .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,<br>
> >>>>> .rotation = pipe_ctx->plane_state->rotation,<br>
> >>>>> - .mirror = pipe_ctx->plane_state->horizontal_mirror<br>
> >>>>> + .mirror = pipe_ctx->plane_state->horizontal_mirror,<br>
> >>>>> + .stream = pipe_ctx->stream<br>
> >>>><br>
> >>>> As a nit; I think it's worth leaving a harmless trailing ',' so that<br>
> >>>> there is less ping pong in the future when adding new members to a struct.<br>
> >>>><br>
> >>>>> };<br>
> >>>>> bool pipe_split_on = false;<br>
> >>>>> bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||<br>
> >>>><br>
> >>>><br>
> >><br>
><br>
</blockquote></div>