summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c21
-rw-r--r--lib/igt_kms.h2
2 files changed, 7 insertions, 16 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index ce9fe152..1e2415bf 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1634,27 +1634,18 @@ static void kmstest_get_crtc(int device, enum pipe pipe, struct kmstest_crtc *cr
*
* Asserts only if the plane's visibility state matches the status being passed by @visibility
*/
-void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility)
+void igt_assert_plane_visible(int fd, enum pipe pipe, int plane_index, bool visibility)
{
struct kmstest_crtc crtc;
- int i;
- bool visible;
+ bool visible = true;
kmstest_get_crtc(fd, pipe, &crtc);
- visible = true;
- for (i = 0; i < crtc.n_planes; i++) {
- if (crtc.planes[i].type == DRM_PLANE_TYPE_PRIMARY)
- continue;
+ igt_assert(plane_index < crtc.n_planes);
- if (crtc.planes[i].pos_x > crtc.width) {
- visible = false;
- break;
- } else if (crtc.planes[i].pos_y > crtc.height) {
- visible = false;
- break;
- }
- }
+ if (crtc.planes[plane_index].pos_x > crtc.width ||
+ crtc.planes[plane_index].pos_y > crtc.height)
+ visible = false;
free(crtc.planes);
igt_assert_eq(visible, visibility);
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index e392e0ef..38bdc08f 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -228,7 +228,7 @@ void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size,
void kmstest_dumb_destroy(int fd, uint32_t handle);
void kmstest_wait_for_pageflip(int fd);
unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int flags);
-void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility);
+void igt_assert_plane_visible(int fd, enum pipe pipe, int plane_index, bool visibility);
/*
* A small modeset API