mirror of
https://github.com/openbsd/src.git
synced 2026-04-25 14:45:52 +00:00
drm/i915/psr: Repeat Selective Update area alignment
From Jouni Hogander 0189bf176dbe6e07cde08a6121108eda3bd18b06 in linux-6.18.y/6.18.19 1be2fca84f520105413d0d89ed04bb0ff742ab16 in mainline linux
This commit is contained in:
@@ -2559,11 +2559,12 @@ static void clip_area_update(struct drm_rect *overlap_damage_area,
|
||||
overlap_damage_area->y2 = damage_area->y2;
|
||||
}
|
||||
|
||||
static void intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_state)
|
||||
static bool intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
|
||||
u16 y_alignment;
|
||||
bool su_area_changed = false;
|
||||
|
||||
/* ADLP aligns the SU region to vdsc slice height in case dsc is enabled */
|
||||
if (crtc_state->dsc.compression_enable &&
|
||||
@@ -2572,10 +2573,18 @@ static void intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_st
|
||||
else
|
||||
y_alignment = crtc_state->su_y_granularity;
|
||||
|
||||
crtc_state->psr2_su_area.y1 -= crtc_state->psr2_su_area.y1 % y_alignment;
|
||||
if (crtc_state->psr2_su_area.y2 % y_alignment)
|
||||
if (crtc_state->psr2_su_area.y1 % y_alignment) {
|
||||
crtc_state->psr2_su_area.y1 -= crtc_state->psr2_su_area.y1 % y_alignment;
|
||||
su_area_changed = true;
|
||||
}
|
||||
|
||||
if (crtc_state->psr2_su_area.y2 % y_alignment) {
|
||||
crtc_state->psr2_su_area.y2 = ((crtc_state->psr2_su_area.y2 /
|
||||
y_alignment) + 1) * y_alignment;
|
||||
su_area_changed = true;
|
||||
}
|
||||
|
||||
return su_area_changed;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2708,7 +2717,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
|
||||
struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
|
||||
struct intel_plane_state *new_plane_state, *old_plane_state;
|
||||
struct intel_plane *plane;
|
||||
bool full_update = false, cursor_in_su_area = false;
|
||||
bool full_update = false, su_area_changed;
|
||||
int i, ret;
|
||||
|
||||
if (!crtc_state->enable_psr2_sel_fetch)
|
||||
@@ -2815,15 +2824,32 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* Adjust su area to cover cursor fully as necessary (early
|
||||
* transport). This needs to be done after
|
||||
* drm_atomic_add_affected_planes to ensure visible cursor is added into
|
||||
* affected planes even when cursor is not updated by itself.
|
||||
*/
|
||||
intel_psr2_sel_fetch_et_alignment(state, crtc, &cursor_in_su_area);
|
||||
do {
|
||||
bool cursor_in_su_area;
|
||||
|
||||
intel_psr2_sel_fetch_pipe_alignment(crtc_state);
|
||||
/*
|
||||
* Adjust su area to cover cursor fully as necessary
|
||||
* (early transport). This needs to be done after
|
||||
* drm_atomic_add_affected_planes to ensure visible
|
||||
* cursor is added into affected planes even when
|
||||
* cursor is not updated by itself.
|
||||
*/
|
||||
intel_psr2_sel_fetch_et_alignment(state, crtc, &cursor_in_su_area);
|
||||
|
||||
su_area_changed = intel_psr2_sel_fetch_pipe_alignment(crtc_state);
|
||||
|
||||
/*
|
||||
* If the cursor was outside the SU area before
|
||||
* alignment, the alignment step (which only expands
|
||||
* SU) may pull the cursor partially inside, so we
|
||||
* must run ET alignment again to fully cover it. But
|
||||
* if the cursor was already fully inside before
|
||||
* alignment, expanding the SU area won't change that,
|
||||
* so no further work is needed.
|
||||
*/
|
||||
if (cursor_in_su_area)
|
||||
break;
|
||||
} while (su_area_changed);
|
||||
|
||||
/*
|
||||
* Now that we have the pipe damaged area check if it intersect with
|
||||
|
||||
Reference in New Issue
Block a user