If test all modes rather than preferred mode, remove framebuffer and set CRTC to zero after each connector mode setting. Signed-off-by: Sun Yi <yi.sun at intel.com> --- tests/testdisplay.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 3c9741c..7e25296 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -373,7 +373,10 @@ static void connector_find_preferred_mode(struct connector *c) } c->crtc = resources->crtcs[i]; c->pipe = i; - resources->crtcs[i] = 0; + + if(test_preferred_mode) + resources->crtcs[i] = 0; + c->connector = connector; } @@ -941,6 +944,7 @@ set_mode(struct connector *c) continue; } + fprintf(stdout, "CRTS(%u):",c->crtc); dump_mode(&c->mode); if (drmModeSetCrtc(fd, c->crtc, fb_id, 0, 0, &c->id, 1, &c->mode)) { @@ -955,6 +959,12 @@ set_mode(struct connector *c) if (sleep_between_modes && test_all_modes) sleep(sleep_between_modes); + + } + + if(!test_preferred_mode){ + drmModeRmFB(fd,fb_id); + drmModeSetCrtc(fd, c->crtc, fb_id, 0, 0, &c->id, 1, 0); } drmModeFreeEncoder(c->encoder); -- 1.7.5.1