summaryrefslogtreecommitdiff
path: root/tests/kms_atomic_transition.c
diff options
context:
space:
mode:
authorJessica Zhang <quic_jesszhan@quicinc.com>2022-04-12 17:22:24 -0700
committerPetri Latvala <petri.latvala@intel.com>2022-04-22 14:15:54 +0300
commitfa0608879f2894fe6ad5954eb18738d44fa23f57 (patch)
tree2c57b757357e07d8cdd758d87e26af43554b1954 /tests/kms_atomic_transition.c
parente1492eaa7fce69519ba50f756a59b5b6485a9483 (diff)
tests/kms_atomic_transition: Separate commits for pipes with shared planes
Currently the helper method set_combinations() will set the properties for each pipe/plane then push everything as a single commit. This will cause issues for drivers which do not dedicate planes to pipes and allow planes to be shared, as it causes the new pipe to overwrite the plane properties that have been set by the old pipe. In addition, the DRM framework forbids directly switching the assigned pipe for a plane within the same commit [1]. To avoid this, we can first disable any pipes that currently are handling a shared plane before setting the fb to be committed. Note: This patch only fixes the issue for single display cases. Fixes for multi-display cases will be addressed in a separate patch Changes since V1: - Removed shared plane bitmask - Instead of immediately doing a NULL commit to disable the current pipe when primary plane is shared, disable the previous pipe using the primary plane before preparing the framebuffers for commit - Removed commit for non-NULL framebuffers [1] https://gitlab.freedesktop.org/drm/msm/-/blob/msm-next/drivers/gpu/drm/drm_atomic.c#L695 Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/kms_atomic_transition.c')
-rw-r--r--tests/kms_atomic_transition.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index 4be24f9e..d8462bfc 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -719,6 +719,25 @@ static unsigned set_combinations(data_t *data, unsigned mask, struct igt_fb *fb)
for_each_pipe(&data->display, pipe) {
igt_plane_t *plane = igt_pipe_get_plane_type(&data->display.pipes[pipe],
DRM_PLANE_TYPE_PRIMARY);
+
+ enum pipe old_pipe = plane->ref->pipe->pipe;
+
+ /*
+ * If a plane is being shared by multiple pipes, we must disable the pipe that
+ * currently is holding the plane
+ */
+ if (old_pipe != pipe) {
+ igt_plane_t *old_plane = igt_pipe_get_plane_type(&data->display.pipes[old_pipe],
+ DRM_PLANE_TYPE_PRIMARY);
+
+ igt_plane_set_fb(old_plane, NULL);
+ igt_display_commit2(&data->display, COMMIT_ATOMIC);
+ }
+ }
+
+ for_each_pipe(&data->display, pipe) {
+ igt_plane_t *plane = igt_pipe_get_plane_type(&data->display.pipes[pipe],
+ DRM_PLANE_TYPE_PRIMARY);
drmModeModeInfo *mode = NULL;
if (!(mask & (1 << pipe))) {