mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-22 23:36:30 +00:00
lib/kms: Track need for vblank wait locally
The need to wait for a vblank after programming is due to the way we actually program the hardware. Move need_wait_for_vblank out of the pipe and into a local variable in preparation for future programming styles (e.g., atomic pageflip) that will need different logic. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
parent
3cc60bab46
commit
2a3e212acc
@ -759,13 +759,11 @@ 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_fb_id(plane);
|
fb_id = igt_plane_get_fb_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,
|
||||||
@ -814,7 +812,6 @@ 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;
|
||||||
@ -840,6 +837,7 @@ static int igt_output_commit(igt_output_t *output)
|
|||||||
igt_plane_t *primary;
|
igt_plane_t *primary;
|
||||||
igt_plane_t *cursor;
|
igt_plane_t *cursor;
|
||||||
int i;
|
int i;
|
||||||
|
bool need_wait_for_vblank = false;
|
||||||
|
|
||||||
pipe = igt_output_get_driving_pipe(output);
|
pipe = igt_output_get_driving_pipe(output);
|
||||||
primary = igt_pipe_get_plane(pipe, IGT_PLANE_PRIMARY);
|
primary = igt_pipe_get_plane(pipe, IGT_PLANE_PRIMARY);
|
||||||
@ -925,17 +923,24 @@ static int igt_output_commit(igt_output_t *output)
|
|||||||
igt_assert(ret == 0);
|
igt_assert(ret == 0);
|
||||||
|
|
||||||
cursor->fb_changed = false;
|
cursor->fb_changed = false;
|
||||||
|
need_wait_for_vblank = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < pipe->n_planes; i++) {
|
for (i = 0; i < pipe->n_planes; i++) {
|
||||||
igt_plane_t *plane = &pipe->planes[i];
|
igt_plane_t *plane = &pipe->planes[i];
|
||||||
|
|
||||||
|
if (plane->fb_changed || plane->position_changed)
|
||||||
|
need_wait_for_vblank = true;
|
||||||
|
|
||||||
igt_plane_commit(plane, output);
|
igt_plane_commit(plane, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pipe->need_wait_for_vblank) {
|
/*
|
||||||
|
* If the crtc is enabled, wait until the next vblank before returning
|
||||||
|
* if we made changes to any of the planes.
|
||||||
|
*/
|
||||||
|
if (need_wait_for_vblank && igt_plane_get_fb_id(primary) != 0) {
|
||||||
igt_wait_for_vblank(display->drm_fd, pipe->pipe);
|
igt_wait_for_vblank(display->drm_fd, pipe->pipe);
|
||||||
pipe->need_wait_for_vblank = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -120,7 +120,6 @@ 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_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