@@ -2116,21 +2116,36 @@ static void intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_st
2116
2116
* cursor fully when cursor is in SU area.
2117
2117
*/
2118
2118
static void
2119
- intel_psr2_sel_fetch_et_alignment (struct intel_crtc_state * crtc_state ,
2120
- struct intel_plane_state * cursor_state )
2119
+ intel_psr2_sel_fetch_et_alignment (struct intel_atomic_state * state ,
2120
+ struct intel_crtc * crtc )
2121
2121
{
2122
- struct drm_rect inter ;
2122
+ struct intel_crtc_state * crtc_state = intel_atomic_get_new_crtc_state (state , crtc );
2123
+ struct intel_plane_state * new_plane_state ;
2124
+ struct intel_plane * plane ;
2125
+ int i ;
2123
2126
2124
- if (!crtc_state -> enable_psr2_su_region_et ||
2125
- !cursor_state -> uapi .visible )
2127
+ if (!crtc_state -> enable_psr2_su_region_et )
2126
2128
return ;
2127
2129
2128
- inter = crtc_state -> psr2_su_area ;
2129
- if (!drm_rect_intersect (& inter , & cursor_state -> uapi .dst ))
2130
- return ;
2130
+ for_each_new_intel_plane_in_state (state , plane , new_plane_state , i ) {
2131
+ struct drm_rect inter ;
2131
2132
2132
- clip_area_update (& crtc_state -> psr2_su_area , & cursor_state -> uapi .dst ,
2133
- & crtc_state -> pipe_src );
2133
+ if (new_plane_state -> uapi .crtc != crtc_state -> uapi .crtc )
2134
+ continue ;
2135
+
2136
+ if (plane -> id != PLANE_CURSOR )
2137
+ continue ;
2138
+
2139
+ if (!new_plane_state -> uapi .visible )
2140
+ continue ;
2141
+
2142
+ inter = crtc_state -> psr2_su_area ;
2143
+ if (!drm_rect_intersect (& inter , & new_plane_state -> uapi .dst ))
2144
+ continue ;
2145
+
2146
+ clip_area_update (& crtc_state -> psr2_su_area , & new_plane_state -> uapi .dst ,
2147
+ & crtc_state -> pipe_src );
2148
+ }
2134
2149
}
2135
2150
2136
2151
/*
@@ -2173,8 +2188,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
2173
2188
{
2174
2189
struct drm_i915_private * dev_priv = to_i915 (state -> base .dev );
2175
2190
struct intel_crtc_state * crtc_state = intel_atomic_get_new_crtc_state (state , crtc );
2176
- struct intel_plane_state * new_plane_state , * old_plane_state ,
2177
- * cursor_plane_state = NULL ;
2191
+ struct intel_plane_state * new_plane_state , * old_plane_state ;
2178
2192
struct intel_plane * plane ;
2179
2193
bool full_update = false;
2180
2194
int i , ret ;
@@ -2259,13 +2273,6 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
2259
2273
damaged_area .x2 += new_plane_state -> uapi .dst .x1 - src .x1 ;
2260
2274
2261
2275
clip_area_update (& crtc_state -> psr2_su_area , & damaged_area , & crtc_state -> pipe_src );
2262
-
2263
- /*
2264
- * Cursor plane new state is stored to adjust su area to cover
2265
- * cursor are fully.
2266
- */
2267
- if (plane -> id == PLANE_CURSOR )
2268
- cursor_plane_state = new_plane_state ;
2269
2276
}
2270
2277
2271
2278
/*
@@ -2294,9 +2301,13 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
2294
2301
if (ret )
2295
2302
return ret ;
2296
2303
2297
- /* Adjust su area to cover cursor fully as necessary */
2298
- if (cursor_plane_state )
2299
- intel_psr2_sel_fetch_et_alignment (crtc_state , cursor_plane_state );
2304
+ /*
2305
+ * Adjust su area to cover cursor fully as necessary (early
2306
+ * transport). This needs to be done after
2307
+ * drm_atomic_add_affected_planes to ensure visible cursor is added into
2308
+ * affected planes even when cursor is not updated by itself.
2309
+ */
2310
+ intel_psr2_sel_fetch_et_alignment (state , crtc );
2300
2311
2301
2312
intel_psr2_sel_fetch_pipe_alignment (crtc_state );
2302
2313
0 commit comments