drm/i915/display: Use drm helper instead of own loop for damage clips
Use existing drm_atomic_helper_damage_merged from generic drm code instead of implementing own loop to iterate over damage_clips. Signed-off-by: Jouni Högander <jouni.hogander@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220823112920.352563-4-jouni.hogander@intel.com Reviewed-by: Mika Kahola <mika.kahola@intel.com>
This commit is contained in:
parent
f4a2f27303
commit
4ff0856db0
@ -1722,8 +1722,6 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
|
||||
new_plane_state, i) {
|
||||
struct drm_rect src, damaged_area = { .x1 = 0, .y1 = -1,
|
||||
.x2 = INT_MAX };
|
||||
struct drm_atomic_helper_damage_iter iter;
|
||||
struct drm_rect clip;
|
||||
|
||||
if (new_plane_state->uapi.crtc != crtc_state->uapi.crtc)
|
||||
continue;
|
||||
@ -1771,20 +1769,15 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
|
||||
src = drm_plane_state_src(&new_plane_state->uapi);
|
||||
drm_rect_fp_to_int(&src, &src);
|
||||
|
||||
drm_atomic_helper_damage_iter_init(&iter,
|
||||
&old_plane_state->uapi,
|
||||
&new_plane_state->uapi);
|
||||
drm_atomic_for_each_plane_damage(&iter, &clip) {
|
||||
if (drm_rect_intersect(&clip, &src))
|
||||
clip_area_update(&damaged_area, &clip,
|
||||
&crtc_state->pipe_src);
|
||||
}
|
||||
|
||||
if (damaged_area.y1 == -1)
|
||||
if (!drm_atomic_helper_damage_merged(&old_plane_state->uapi,
|
||||
&new_plane_state->uapi, &damaged_area))
|
||||
continue;
|
||||
|
||||
damaged_area.y1 += new_plane_state->uapi.dst.y1 - src.y1;
|
||||
damaged_area.y2 += new_plane_state->uapi.dst.y1 - src.y1;
|
||||
damaged_area.x1 += new_plane_state->uapi.dst.x1 - src.x1;
|
||||
damaged_area.x2 += new_plane_state->uapi.dst.x1 - src.x1;
|
||||
|
||||
clip_area_update(&pipe_clip, &damaged_area, &crtc_state->pipe_src);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user