]> www.infradead.org Git - users/hch/block.git/commitdiff
drm/i915/psr: Calculate PIPE_SRCSZ_ERLY_TPT value
authorJouni Högander <jouni.hogander@intel.com>
Tue, 19 Mar 2024 12:33:23 +0000 (14:33 +0200)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 3 Apr 2024 18:26:09 +0000 (14:26 -0400)
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
(cherry picked from commit f3b899f0b4b17fa0b20e27c23f78604d5686383d)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_psr.c

index 9104f18753b484fde2b439f85494fc77a3d27c87..bf3f942e19c3d38a314d2e5c5065dbb73b36682f 100644 (file)
@@ -1423,6 +1423,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 */
index 6927785fd6ff2fed2406a6ca1889cdf455f548e7..2c4978e189a3ad8b081c9e9433dd4e63d6cc1d79 100644 (file)
@@ -2051,6 +2051,20 @@ exit:
        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)
@@ -2338,6 +2352,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;
 }