summaryrefslogtreecommitdiff
path: root/lib/igt_kms.c
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2016-05-18 20:07:04 -0400
committerMarius Vlad <marius.c.vlad@intel.com>2016-07-04 17:15:57 +0300
commit235ff7af4fbb75552fd0130055f4e3b2d31783d5 (patch)
treebca1e00a99f0bf473a5799abc893dbfa39b787ce /lib/igt_kms.c
parent556a59ed64c17c41d96a7ef8f50f8c742b9f04b9 (diff)
lib/igt_kms: Fix plane counting in igt_display_init.
Fix issue where the plane counting fails due to the number and configuration of planes being unlike the intel configuration. Signed-off-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r--lib/igt_kms.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 513e5106..20ba5353 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1301,6 +1301,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
igt_plane_t *plane;
int p = IGT_PLANE_2;
int j, type;
+ uint8_t n_planes = 0;
pipe->crtc_id = resources->crtcs[i];
pipe->display = display;
@@ -1348,8 +1349,10 @@ void igt_display_init(igt_display_t *display, int drm_fd)
break;
}
+ n_planes++;
plane->pipe = pipe;
plane->drm_plane = drm_plane;
+
if (is_atomic == 0) {
display->is_atomic = 1;
igt_atomic_fill_plane_props(display, plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names);
@@ -1398,8 +1401,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
plane->is_cursor = true;
}
- /* planes = 1 primary, (p-1) sprites, 1 cursor */
- pipe->n_planes = p + 1;
+ pipe->n_planes = n_planes;
/* make sure we don't overflow the plane array */
igt_assert(pipe->n_planes <= IGT_MAX_PLANES);