summaryrefslogtreecommitdiff
path: root/tests/kms_lease.c
diff options
context:
space:
mode:
authorMohammed Khajapasha <mohammed.khajapasha@intel.com>2020-07-20 20:50:39 +0530
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2020-07-21 12:58:19 +0300
commitf4e4b6c1f634d38f15e323f660b4b9066e30edb3 (patch)
tree113e6b55ead0025de53b202e7d2113371cd60387 /tests/kms_lease.c
parentc087c36c1c9bda0a1c95c00eff95cf995510c4d7 (diff)
tests/kms_lease: Read crtc id for a valid pipe
Read crtc id for enabled pipes only. v2: Using for_each_pipe() macro for enabled pipes <Hiler, Arkadiusz> Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests/kms_lease.c')
-rw-r--r--tests/kms_lease.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/kms_lease.c b/tests/kms_lease.c
index 4ec9d49f..bafb3bfb 100644
--- a/tests/kms_lease.c
+++ b/tests/kms_lease.c
@@ -136,9 +136,10 @@ static enum pipe crtc_id_to_pipe(igt_display_t *display, uint32_t crtc_id)
{
enum pipe pipe;
- for (pipe = 0; pipe < display->n_pipes; pipe++)
- if (display->pipes[pipe].crtc_id == crtc_id)
+ for_each_pipe(display, pipe) {
+ if(display->pipes[pipe].crtc_id == crtc_id)
return pipe;
+ }
return -1;
}