|
@@ -663,6 +663,25 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static bool
|
|
|
+plane_switching_crtc(struct drm_atomic_state *state,
|
|
|
+ struct drm_plane *plane,
|
|
|
+ struct drm_plane_state *plane_state)
|
|
|
+{
|
|
|
+ if (!plane->state->crtc || !plane_state->crtc)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ if (plane->state->crtc == plane_state->crtc)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ /* This could be refined, but currently there's no helper or driver code
|
|
|
+ * to implement direct switching of active planes nor userspace to take
|
|
|
+ * advantage of more direct plane switching without the intermediate
|
|
|
+ * full OFF state.
|
|
|
+ */
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* drm_atomic_plane_check - check plane state
|
|
|
* @plane: plane to check
|
|
@@ -734,6 +753,12 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
|
|
|
return -ENOSPC;
|
|
|
}
|
|
|
|
|
|
+ if (plane_switching_crtc(state->state, plane, state)) {
|
|
|
+ DRM_DEBUG_ATOMIC("[PLANE:%d] switching CRTC directly\n",
|
|
|
+ plane->base.id);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|