summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c19
-rw-r--r--lib/igt_kms.h1
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 56e04bb4..5312f8d8 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1224,7 +1224,6 @@ static void igt_output_refresh(igt_output_t *output, bool final)
{
igt_display_t *display = output->display;
unsigned long crtc_idx_mask;
- bool valid;
crtc_idx_mask = output->pending_crtc_idx_mask;
@@ -1234,9 +1233,11 @@ static void igt_output_refresh(igt_output_t *output, bool final)
kmstest_free_connector_config(&output->config);
- valid = _kmstest_connector_config(display->drm_fd, output->id,
- crtc_idx_mask, &output->config,
- !output->name);
+ output->valid = _kmstest_connector_config(display->drm_fd,
+ output->id,
+ crtc_idx_mask,
+ &output->config,
+ output->valid < 0);
if (!output->name && output->config.connector) {
drmModeConnector *c = output->config.connector;
@@ -1249,7 +1250,7 @@ static void igt_output_refresh(igt_output_t *output, bool final)
igt_atomic_fill_connector_props(display, output,
IGT_NUM_CONNECTOR_PROPS, igt_connector_prop_names);
- if (!valid)
+ if (!output->valid)
return;
if (output->use_override_mode)
@@ -1498,6 +1499,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
* We don't assign each output a pipe unless
* a pipe is set with igt_output_set_pipe().
*/
+ output->valid = -1;
output->pending_crtc_idx_mask = 0;
output->id = resources->connectors[i];
output->display = display;
@@ -1534,7 +1536,8 @@ static void igt_pipe_fini(igt_pipe_t *pipe)
static void igt_output_fini(igt_output_t *output)
{
- kmstest_free_connector_config(&output->config);
+ if (output->valid > 0)
+ kmstest_free_connector_config(&output->config);
free(output->name);
}
@@ -2239,7 +2242,7 @@ static int do_display_commit(igt_display_t *display,
igt_pipe_t *pipe_obj = &display->pipes[pipe];
igt_output_t *output = igt_pipe_get_output(pipe_obj);
- if (output)
+ if (output && output->valid > 0)
valid_outs++;
ret = igt_pipe_commit(pipe_obj, s, fail_on_error);
@@ -2439,7 +2442,7 @@ void igt_output_set_pipe(igt_output_t *output, enum pipe pipe)
igt_display_t *display = output->display;
igt_pipe_t *old_pipe;
- igt_assert(output->name);
+ igt_assert(output->valid != -1);
if (output->pending_crtc_idx_mask) {
old_pipe = igt_output_get_driving_pipe(output);
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index fb207655..5234f6c1 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -297,6 +297,7 @@ typedef struct {
uint32_t id; /* KMS id */
struct kmstest_connector_config config;
char *name;
+ int valid; /* -1 == never probed */
unsigned long pending_crtc_idx_mask;
bool use_override_mode;
drmModeModeInfo override_mode;