summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoegeun Kwon <hoegeun.kwon@samsung.com>2017-10-12 16:40:44 +0900
committerInki Dae <inki.dae@samsung.com>2017-11-06 02:31:42 +0000
commitb05c7c61599c4dda49c60449fc65ebca32174c12 (patch)
tree3913b1d8283692e7990ed5494220916f689ff39e
parentddb3f215c73d075313960a387cb0ff57b561c3a6 (diff)
downloadlibdrm-atomic.tar.gz
libdrm-atomic.tar.bz2
libdrm-atomic.zip
Add select the enable crtcatomic
There is a probelm selecting crtc which is not used. so modify to select crtc which is used. Change-Id: Ic1b240dd6c688f4560f22b7a521564843749c9c4 Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
-rw-r--r--tests/atomictest/atomictest.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/atomictest/atomictest.c b/tests/atomictest/atomictest.c
index a393b01b..5e94432b 100644
--- a/tests/atomictest/atomictest.c
+++ b/tests/atomictest/atomictest.c
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
uint32_t *plane_w = NULL, *plane_h = NULL;
struct sp_dev *dev;
struct sp_plane **plane = NULL;
- struct sp_crtc *test_crtc;
+ struct sp_crtc *test_crtc = NULL;
fd_set fds;
drmModeAtomicReqPtr pset;
drmEventContext event_context = {
@@ -66,7 +66,14 @@ int main(int argc, char *argv[])
printf("Failed to initialize screens\n");
goto out;
}
- test_crtc = &dev->crtcs[0];
+
+ for (i = 0; i < dev->num_crtcs; i++) {
+ if (!dev->crtcs[i].crtc->mode.hdisplay)
+ continue;
+ test_crtc = &dev->crtcs[i];
+ }
+ if (!test_crtc)
+ goto out;
plane = calloc(dev->num_planes, sizeof(*plane));
if (!plane) {