summaryrefslogtreecommitdiff
path: root/lib/igt_kms.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-03-20 18:40:10 +0100
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-03-20 18:40:45 +0100
commit5635ea9dae4a033d0ff144d9b58e184168a8c684 (patch)
tree872d9cec185577f5ecc555cc0746693472061a5f /lib/igt_kms.c
parent6bdbf92423cacf39a728c39d2669eb5ddb44f1fb (diff)
lib/igt_kms: Do not refresh all outputs in igt_display_commit
Now that igt_output_set_pipe handles refreshing igt_output, we only have to be sure that there are no conflicting outputs in igt_display_commit. Reported-and-tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r--lib/igt_kms.c53
1 files changed, 23 insertions, 30 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e12ed723..a986145e 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1434,17 +1434,13 @@ static void igt_display_log_shift(igt_display_t *display, int shift)
igt_assert(display->log_shift >= 0);
}
-static void igt_output_refresh(igt_output_t *output, bool final)
+static void igt_output_refresh(igt_output_t *output)
{
igt_display_t *display = output->display;
unsigned long crtc_idx_mask;
crtc_idx_mask = output->pending_crtc_idx_mask;
- /* we mask out the pipes already in use */
- if (final)
- crtc_idx_mask &= ~display->pipes_in_use;
-
kmstest_free_connector_config(&output->config);
_kmstest_connector_config(display->drm_fd, output->id, crtc_idx_mask,
@@ -1470,9 +1466,6 @@ static void igt_output_refresh(igt_output_t *output, bool final)
LOG(display, "%s: Selecting pipe %s\n", output->name,
kmstest_pipe_name(output->config.pipe));
-
- if (final)
- display->pipes_in_use |= 1 << output->config.pipe;
}
static bool
@@ -1714,7 +1707,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
output->id = resources->connectors[i];
output->display = display;
- igt_output_refresh(output, false);
+ igt_output_refresh(output);
output->config.pipe_changed = true;
}
@@ -1804,35 +1797,35 @@ void igt_display_fini(igt_display_t *display)
static void igt_display_refresh(igt_display_t *display)
{
- int i, j;
+ igt_output_t *output;
+ int i;
- display->pipes_in_use = 0;
+ unsigned long pipes_in_use = 0;
/* Check that two outputs aren't trying to use the same pipe */
- for (i = 0; i < display->n_outputs; i++) {
- igt_output_t *a = &display->outputs[i];
+ for (i = 0; i < display->n_outputs; i++) {
+ output = &display->outputs[i];
- if (!a->pending_crtc_idx_mask)
- continue;
+ if (pipes_in_use & output->pending_crtc_idx_mask)
+ goto report_dup;
- for (j = 0; j < display->n_outputs; j++) {
- igt_output_t *b = &display->outputs[j];
+ pipes_in_use |= output->pending_crtc_idx_mask;
- if (i == j)
- continue;
+ if (output->force_reprobe)
+ igt_output_refresh(output);
+ }
- igt_assert_f(a->pending_crtc_idx_mask !=
- b->pending_crtc_idx_mask,
- "%s and %s are both trying to use pipe %s\n",
- igt_output_name(a), igt_output_name(b),
- kmstest_pipe_name(ffs(a->pending_crtc_idx_mask) - 1));
- }
- }
+ return;
- for (i = 0; i < display->n_outputs; i++) {
- igt_output_t *output = &display->outputs[i];
+report_dup:
+ for (; i > 0; i--) {
+ igt_output_t *b = &display->outputs[i - 1];
- igt_output_refresh(output, true);
+ igt_assert_f(output->pending_crtc_idx_mask !=
+ b->pending_crtc_idx_mask,
+ "%s and %s are both trying to use pipe %s\n",
+ igt_output_name(output), igt_output_name(b),
+ kmstest_pipe_name(ffs(b->pending_crtc_idx_mask) - 1));
}
}
@@ -2761,7 +2754,7 @@ void igt_output_set_pipe(igt_output_t *output, enum pipe pipe)
output->config.pipe_changed = true;
- igt_output_refresh(output, false);
+ igt_output_refresh(output);
}
void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)