if (o->flags & TEST_PAN) {
int count = do_flip ?
o->flip_state.count : o->vblank_state.count;
- int x_ofs = count * 10 > o->fb_width ? o->fb_width : count * 10;
+ int x_ofs = count * 10 > o->fb_width - o->kmode[0].hdisplay ? o->fb_width - o->kmode[0].hdisplay : count * 10;
if (set_mode(o, o->fb_ids[o->current_fb_id], x_ofs, 0)){
- fprintf(stderr, "failed to pan (%dx%d@%dHz): %s\n",
- o->fb_width, o->fb_height,
- o->kmode[0].vrefresh, strerror(errno));
+ fprintf(stderr, "failed to pan (%dx%d@%dHz)+%d: %s\n",
+ o->kmode[0].hdisplay, o->kmode[0].vdisplay, o->kmode[0].vrefresh,
+ x_ofs, strerror(errno));
igt_fail(7);
}
}
o->fb_width = o->kmode[0].hdisplay;
o->fb_height = o->kmode[0].vdisplay;
-
}
static bool mode_compatible(const drmModeModeInfo *a, const drmModeModeInfo *b)
igt_subtest_name(), o->_crtc[0], o->_connector[0]);
if (o->flags & TEST_PAN)
- o->fb_width *= 2;
+ o->fb_width <<= 1;
o->fb_ids[0] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height,
o->bpp, o->depth, false, &o->fb_info[0]);
o->bpp, o->depth, false, &o->fb_info[1]);
o->fb_ids[2] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height,
o->bpp, o->depth, true, &o->fb_info[2]);
-
if (!o->fb_ids[0] || !o->fb_ids[1] || !o->fb_ids[2]) {
fprintf(stderr, "failed to create fbs\n");
igt_fail(3);
*/
if (0) {
fprintf(stderr, "failed to set mode (%dx%d@%dHz): %s\n",
- o->fb_width, o->fb_height, o->kmode[0].vrefresh,
+ o->kmode[0].hdisplay, o->kmode[0].vdisplay, o->kmode[0].vrefresh,
strerror(errno));
}
goto out;
o->bpp, o->depth, false, &o->fb_info[1]);
o->fb_ids[2] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height,
o->bpp, o->depth, true, &o->fb_info[2]);
-
if (!o->fb_ids[0] || !o->fb_ids[1] || !o->fb_ids[2]) {
fprintf(stderr, "failed to create fbs\n");
igt_fail(3);
*/
if (0) {
fprintf(stderr, "failed to set mode (%dx%d@%dHz): %s\n",
- o->fb_width, o->fb_height, o->kmode[0].vrefresh,
+ o->kmode[0].hdisplay, o->kmode[0].vdisplay, o->kmode[0].vrefresh,
strerror(errno));
}
goto out;