[why&how]
primary planes for external displays getting incorrect clip
values, detect such a scenario and pass correct parameters
Reviewed-by: Ovidiu (Ovi) Bunea <ovidiu.bunea@amd.com>
Signed-off-by: Ausef Yousof <auyousof@amd.com>
Signed-off-by: Matthew Stewart <matthew.stewart2@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* for each plane.
*/
bool translate_by_source;
+
+ /**
+ * @use_viewport_for_clip: Use viewport position for clip_x calculation
+ * instead of clip_rect. Required to protect against clip being overwritten
+ */
+ bool use_viewport_for_clip;
};
struct dc_cursor_mi_param {
int y_plane = pipe_ctx->plane_state->dst_rect.y;
int x_pos = pos_cpy.x;
int y_pos = pos_cpy.y;
- int clip_x = pipe_ctx->plane_state->clip_rect.x;
+ bool is_primary_plane = (pipe_ctx->plane_state->layer_index == 0);
+
+ int clip_x = (pos_cpy.use_viewport_for_clip && is_primary_plane &&
+ !odm_combine_on && !pipe_split_on && param.viewport.x != 0)
+ ? param.viewport.x : pipe_ctx->plane_state->clip_rect.x;
int clip_width = pipe_ctx->plane_state->clip_rect.width;
if ((pipe_ctx->top_pipe != NULL) || (pipe_ctx->bottom_pipe != NULL)) {