diff mbox

[1/4] lib/igt_kms: Fix erroneous assert

Message ID 20170605132840.9125-2-liviu.dudau@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Liviu Dudau June 5, 2017, 1:28 p.m. UTC
From: Brian Starkey <brian.starkey@arm.com>

In trying to fix igt_display_init() for devices without cursors, I
actually made matters worse. Fix the assert.

Fixes: 545aa3398223 lib/igt_kms: Remove redundant cursor code
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
---
 lib/igt_kms.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Arkadiusz Hiler June 6, 2017, 10:32 a.m. UTC | #1
On Mon, Jun 05, 2017 at 02:28:37PM +0100, Liviu Dudau wrote:
> From: Brian Starkey <brian.starkey@arm.com>
> 
> In trying to fix igt_display_init() for devices without cursors, I
> actually made matters worse. Fix the assert.
> 
> Fixes: 545aa3398223 lib/igt_kms: Remove redundant cursor code
> Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
diff mbox

Patch

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index c77716b4..5e2ef97b 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1794,11 +1794,11 @@  void igt_display_init(igt_display_t *display, int drm_fd)
 		 */
 		igt_assert_eq(pipe->plane_primary, 0);
 
-		/*
-		 * There should be no gaps. If there is, something happened
-		 * which we can't handle (e.g. all planes are cursors).
-		 */
-		igt_assert_eq(p, last_plane);
+		/* Check that we filled every slot exactly once */
+		if (display->has_cursor_plane)
+			igt_assert_eq(p, last_plane);
+		else
+			igt_assert_eq(p, n_planes);
 
 		pipe->n_planes = n_planes;