[RFC PATCH] drm/i915/psr: Full update when cursor in updated planes

Jouni Högander jouni.hogander at intel.com
Fri Feb 18 06:31:59 UTC 2022


Currently we are observing occasional screen flickering when
doing selective updates on cursor plane. As a first aid do
full frame fetch when updating cursor plane.

We have already similar workaround for cursor legacy updates.
Recent OSs e.g. Fedora35 are updating cursor using atomic commits.

Reported-by: Lyude Paul <lyude at redhat.com>
Cc: Mihai Harpau <mishu at piatafinanciara.ro>
Cc: José Roberto de Souza <jose.souza at intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/5077
Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index a1a663f362e7..cd29e283ee2d 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1576,13 +1576,18 @@ static void intel_psr2_sel_fetch_pipe_alignment(const struct intel_crtc_state *c
  * Plane scaling and rotation is not supported by selective fetch and both
  * properties can change without a modeset, so need to be check at every
  * atomic commmit.
+ *
+ * Cursor updates via atomic commit are causing screen
+ * flickering. Do full update for now.
  */
-static bool psr2_sel_fetch_plane_state_supported(const struct intel_plane_state *plane_state)
+static bool psr2_sel_fetch_plane_state_supported(const struct intel_plane *plane,
+						 const struct intel_plane_state *plane_state)
 {
 	if (plane_state->uapi.dst.y1 < 0 ||
 	    plane_state->uapi.dst.x1 < 0 ||
 	    plane_state->scaler_id >= 0 ||
-	    plane_state->uapi.rotation != DRM_MODE_ROTATE_0)
+	    plane_state->uapi.rotation != DRM_MODE_ROTATE_0 ||
+	    plane->id == PLANE_CURSOR)
 		return false;
 
 	return true;
@@ -1640,7 +1645,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
 		    !old_plane_state->uapi.visible)
 			continue;
 
-		if (!psr2_sel_fetch_plane_state_supported(new_plane_state)) {
+		if (!psr2_sel_fetch_plane_state_supported(plane, new_plane_state)) {
 			full_update = true;
 			break;
 		}
@@ -1717,7 +1722,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
 		if (!drm_rect_intersect(&inter, &new_plane_state->uapi.dst))
 			continue;
 
-		if (!psr2_sel_fetch_plane_state_supported(new_plane_state)) {
+		if (!psr2_sel_fetch_plane_state_supported(plane, new_plane_state)) {
 			full_update = true;
 			break;
 		}
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list