diff mbox series

[06/11] drm/i915: Remove pointless visible check in unlink_nv12_plane()

Message ID 20250127172156.21928-7-ville.syrjala@linux.intel.com (mailing list archive)
State New
Headers show
Series drm/i915: joiner and Y plane fixes and reorganization | expand

Commit Message

Ville Syrjälä Jan. 27, 2025, 5:21 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

visible can't be true when is_y_plane is true. Replace the
bogus check with an WARN_ON(). Flatten the function while
at it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index bc62298b1b49..8004ad20ed0a 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -4405,19 +4405,23 @@  static bool check_single_encoder_cloning(struct intel_atomic_state *state,
 static void unlink_nv12_plane(struct intel_crtc_state *crtc_state,
 			      struct intel_plane_state *plane_state)
 {
+	struct intel_display *display = to_intel_display(plane_state);
 	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
 
 	plane_state->planar_linked_plane = NULL;
 
-	if (plane_state->is_y_plane && !plane_state->uapi.visible) {
-		crtc_state->enabled_planes &= ~BIT(plane->id);
-		crtc_state->active_planes &= ~BIT(plane->id);
-		crtc_state->update_planes |= BIT(plane->id);
-		crtc_state->data_rate[plane->id] = 0;
-		crtc_state->rel_data_rate[plane->id] = 0;
-	}
+	if (!plane_state->is_y_plane)
+		return;
+
+	drm_WARN_ON(display->drm, plane_state->uapi.visible);
 
 	plane_state->is_y_plane = false;
+
+	crtc_state->enabled_planes &= ~BIT(plane->id);
+	crtc_state->active_planes &= ~BIT(plane->id);
+	crtc_state->update_planes |= BIT(plane->id);
+	crtc_state->data_rate[plane->id] = 0;
+	crtc_state->rel_data_rate[plane->id] = 0;
 }
 
 static int icl_check_nv12_planes(struct intel_atomic_state *state,