Skip to content

Commit

Permalink
drm/i915/psr: Calculate PIPE_SRCSZ_ERLY_TPT value
Browse files Browse the repository at this point in the history
When early transport is enabled we need to write PIPE_SRCSZ_ERLY_TPT on
every flip doing selective update. This patch calculates
PIPE_SRCSZ_ERLY_TPT same way as is done for PSR2_MAN_TRK_CTL value and
stores i in intel_crtc_state->pipe_srcsz_early_tpt to be written later
during flip.

Bspec: 68927

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240319123327.1661097-2-jouni.hogander@intel.com
  • Loading branch information
Jouni Högander committed Mar 28, 2024
1 parent ddf8a8b commit f3b899f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/display/intel_display_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,8 @@ struct intel_crtc_state {

u32 psr2_man_track_ctl;

u32 pipe_srcsz_early_tpt;

struct drm_rect psr2_su_area;

/* Variable Refresh Rate state */
Expand Down
16 changes: 16 additions & 0 deletions drivers/gpu/drm/i915/display/intel_psr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,20 @@ static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state,
crtc_state->psr2_man_track_ctl = val;
}

static u32 psr2_pipe_srcsz_early_tpt_calc(struct intel_crtc_state *crtc_state,
bool full_update)
{
int width, height;

if (!crtc_state->enable_psr2_su_region_et || full_update)
return 0;

width = drm_rect_width(&crtc_state->psr2_su_area);
height = drm_rect_height(&crtc_state->psr2_su_area);

return PIPESRC_WIDTH(width - 1) | PIPESRC_HEIGHT(height - 1);
}

static void clip_area_update(struct drm_rect *overlap_damage_area,
struct drm_rect *damage_area,
struct drm_rect *pipe_src)
Expand Down Expand Up @@ -2359,6 +2373,8 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,

skip_sel_fetch_set_loop:
psr2_man_trk_ctl_calc(crtc_state, full_update);
crtc_state->pipe_srcsz_early_tpt =
psr2_pipe_srcsz_early_tpt_calc(crtc_state, full_update);
return 0;
}

Expand Down

0 comments on commit f3b899f

Please sign in to comment.