summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLyude <lyude@redhat.com>2016-12-07 19:02:04 -0500
committerLyude <lyude@redhat.com>2016-12-08 11:26:26 -0500
commit80baeb023223e7948ebfa22ebb4d3b706b4bc550 (patch)
tree5aae4d51683c3a1bb64388afb53bc595cbd0538e /lib
parent4f0866610a4300d2d740b75122ea3b92e0134c08 (diff)
igt_kms: Remove support for drivers with <1 drm_plane
We've had support for universal planes since kernel version 3.15, so there's not really a good reason to try supporting drivers that lack plane support now. As well, the current has_universal_planes logic is broken anyway as it makes the assumption that having display planes always means we have both a primary plane and a cursor plane (this isn't true on radeon/amdgpu and nouveau). So, remove this, and just check for whether or not we have a cursor plane. Signed-off-by: Lyude <lyude@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c29
-rw-r--r--lib/igt_kms.h2
2 files changed, 11 insertions, 20 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 82bb41d3..0e7b8e88 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1407,7 +1407,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
plane = &pipe->planes[IGT_PLANE_PRIMARY];
plane->is_primary = 1;
plane->index = IGT_PLANE_PRIMARY;
- display->has_universal_planes = 1;
break;
case DRM_PLANE_TYPE_CURSOR:
/*
@@ -1420,7 +1419,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
plane = &pipe->planes[IGT_PLANE_CURSOR];
plane->is_cursor = 1;
plane->index = IGT_PLANE_CURSOR;
- display->has_universal_planes = 1;
+ display->has_cursor_plane = true;
break;
default:
plane = &pipe->planes[p];
@@ -1445,35 +1444,27 @@ void igt_display_init(igt_display_t *display, int drm_fd)
plane->rotation = (igt_rotation_t)prop_value;
}
- if (display->has_universal_planes) {
- /*
- * If we have universal planes, we should have both
- * primary and cursor planes setup now.
- */
- igt_assert(pipe->planes[IGT_PLANE_PRIMARY].drm_plane &&
- pipe->planes[IGT_PLANE_CURSOR].drm_plane);
+ /*
+ * At the bare minimum, we should expect to have a primary
+ * plane
+ */
+ igt_assert(pipe->planes[IGT_PLANE_PRIMARY].drm_plane);
+ if (display->has_cursor_plane) {
/*
* Cursor was put in the last slot. If we have 0 or
* only 1 sprite, that's the wrong slot and we need to
* move it down.
*/
if (p != IGT_PLANE_CURSOR) {
- pipe->planes[p] = pipe->planes[IGT_PLANE_CURSOR];
+ pipe->planes[p] =
+ pipe->planes[IGT_PLANE_CURSOR];
pipe->planes[p].index = p;
memset(&pipe->planes[IGT_PLANE_CURSOR], 0,
sizeof *plane);
}
} else {
- /*
- * No universal plane support. Add drm_plane-less
- * primary and cursor planes.
- */
- plane = &pipe->planes[IGT_PLANE_PRIMARY];
- plane->pipe = pipe;
- plane->index = IGT_PLANE_PRIMARY;
- plane->is_primary = true;
-
+ /* Add drm_plane-less cursor */
plane = &pipe->planes[p];
plane->pipe = pipe;
plane->index = p;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 6422adc0..0dcb325c 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -311,7 +311,7 @@ struct igt_display {
unsigned long pipes_in_use;
igt_output_t *outputs;
igt_pipe_t pipes[I915_MAX_PIPES];
- bool has_universal_planes;
+ bool has_cursor_plane;
bool is_atomic;
};