Skip to content

Commit 0497ae6

Browse files
effective-lightalexdeucher
authored andcommitted
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). Cc: [email protected] Fixes: 30ebe41 ("drm/amd/display: add FB_DAMAGE_CLIPS support") Reported-by: Kai-Heng Feng <[email protected]> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2952 Tested-by: Kai-Heng Feng <[email protected]> Tested-by: Bin Li <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Hamza Mahfooz <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent df2a5f7 commit 0497ae6

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5241,6 +5241,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
52415241
if (plane->type == DRM_PLANE_TYPE_CURSOR)
52425242
return;
52435243

5244+
if (new_plane_state->rotation != DRM_MODE_ROTATE_0)
5245+
goto ffu;
5246+
52445247
num_clips = drm_plane_get_damage_clips_count(new_plane_state);
52455248
clips = drm_plane_get_damage_clips(new_plane_state);
52465249

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ struct dc_cursor_mi_param {
465465
struct fixed31_32 v_scale_ratio;
466466
enum dc_rotation_angle rotation;
467467
bool mirror;
468+
struct dc_stream_state *stream;
468469
};
469470

470471
/* IPP related types */

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,8 +1077,16 @@ void hubp2_cursor_set_position(
10771077
if (src_y_offset < 0)
10781078
src_y_offset = 0;
10791079
/* Save necessary cursor info x, y position. w, h is saved in attribute func. */
1080-
hubp->cur_rect.x = src_x_offset + param->viewport.x;
1081-
hubp->cur_rect.y = src_y_offset + param->viewport.y;
1080+
if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 &&
1081+
param->rotation != ROTATION_ANGLE_0) {
1082+
hubp->cur_rect.x = 0;
1083+
hubp->cur_rect.y = 0;
1084+
hubp->cur_rect.w = param->stream->timing.h_addressable;
1085+
hubp->cur_rect.h = param->stream->timing.v_addressable;
1086+
} else {
1087+
hubp->cur_rect.x = src_x_offset + param->viewport.x;
1088+
hubp->cur_rect.y = src_y_offset + param->viewport.y;
1089+
}
10821090
}
10831091

10841092
void hubp2_clk_cntl(struct hubp *hubp, bool enable)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3417,7 +3417,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
34173417
.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
34183418
.v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
34193419
.rotation = pipe_ctx->plane_state->rotation,
3420-
.mirror = pipe_ctx->plane_state->horizontal_mirror
3420+
.mirror = pipe_ctx->plane_state->horizontal_mirror,
3421+
.stream = pipe_ctx->stream,
34213422
};
34223423
bool pipe_split_on = false;
34233424
bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||

0 commit comments

Comments
 (0)