summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGabriel Krisman Bertazi <krisman@collabora.co.uk>2017-11-15 17:36:57 -0200
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-12-04 16:13:55 +0200
commit5763c89080e3abb3955092f895896c9ee408e9e1 (patch)
treeec2236fe516f80e3f9e891ce91432dee74d0969c /lib
parent5ab074fc1081c29fe3e9ccc53ce4cc43520faded (diff)
lib/igt_kms: Fix off-by-one bug on skip of missing pipe
display->n_pipes is zero-indexed, so N returned in igt_display_get_n_pipes is already not a valid pipe. This patch prevents kms_ccs from going nuts when testing the first unexisting pipe. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 125ecb19..223dbe4c 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1955,7 +1955,7 @@ void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe)
{
igt_output_t *output;
- igt_skip_on_f(igt_display_get_n_pipes(display) < pipe,
+ igt_skip_on_f(pipe >= igt_display_get_n_pipes(display),
"Pipe %s does not exist.\n", kmstest_pipe_name(pipe));
for_each_valid_output_on_pipe(display, pipe, output)