mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 02:16:17 +00:00
lib/display: Wait for a vblank after SetPlane()
Let's be testing friendly and gently wait for the next vblank before returning from commit() when needed. After igt_display_commit() one can safely look at the CRC. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
parent
da0f1cf570
commit
fb146aa782
@ -1175,11 +1175,13 @@ static int igt_cursor_commit(igt_plane_t *plane, igt_output_t *output)
|
|||||||
static int igt_drm_plane_commit(igt_plane_t *plane, igt_output_t *output)
|
static int igt_drm_plane_commit(igt_plane_t *plane, igt_output_t *output)
|
||||||
{
|
{
|
||||||
igt_display_t *display = output->display;
|
igt_display_t *display = output->display;
|
||||||
|
igt_pipe_t *pipe;
|
||||||
uint32_t fb_id, crtc_id;
|
uint32_t fb_id, crtc_id;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
fb_id = igt_plane_get_fd_id(plane);
|
fb_id = igt_plane_get_fd_id(plane);
|
||||||
crtc_id = output->config.crtc->crtc_id;
|
crtc_id = output->config.crtc->crtc_id;
|
||||||
|
pipe = igt_output_get_driving_pipe(output);
|
||||||
|
|
||||||
if (plane->fb_changed && fb_id == 0) {
|
if (plane->fb_changed && fb_id == 0) {
|
||||||
LOG(display,
|
LOG(display,
|
||||||
@ -1228,6 +1230,7 @@ static int igt_drm_plane_commit(igt_plane_t *plane, igt_output_t *output)
|
|||||||
|
|
||||||
plane->fb_changed = false;
|
plane->fb_changed = false;
|
||||||
plane->position_changed = false;
|
plane->position_changed = false;
|
||||||
|
pipe->need_wait_for_vblank = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1347,6 +1350,11 @@ static int igt_output_commit(igt_output_t *output)
|
|||||||
igt_plane_commit(plane, output);
|
igt_plane_commit(plane, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pipe->need_wait_for_vblank) {
|
||||||
|
igt_wait_for_vblank(display->drm_fd, pipe->pipe);
|
||||||
|
pipe->need_wait_for_vblank = false;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,8 +136,9 @@ typedef struct {
|
|||||||
struct igt_pipe {
|
struct igt_pipe {
|
||||||
igt_display_t *display;
|
igt_display_t *display;
|
||||||
enum pipe pipe;
|
enum pipe pipe;
|
||||||
unsigned int need_set_crtc : 1;
|
unsigned int need_set_crtc : 1;
|
||||||
unsigned int need_set_cursor : 1;
|
unsigned int need_set_cursor : 1;
|
||||||
|
unsigned int need_wait_for_vblank : 1;
|
||||||
#define IGT_MAX_PLANES 4
|
#define IGT_MAX_PLANES 4
|
||||||
int n_planes;
|
int n_planes;
|
||||||
igt_plane_t planes[IGT_MAX_PLANES];
|
igt_plane_t planes[IGT_MAX_PLANES];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user