diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2016-07-05 15:09:56 +0200 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2016-07-26 14:50:27 +0200 |
commit | 11eeb47a60750bc55d07fce769e78b32fe8c776b (patch) | |
tree | 632f06b96c2df1e829d08467bf3e0d690750f782 /lib/igt_kms.c | |
parent | 826150fa43dc85a29915ccaba68a12531843609e (diff) |
igt_kms: Allow disabling previous override mode
By passing a null argument.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r-- | lib/igt_kms.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index f264f996..d5268218 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -2376,7 +2376,7 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output) /** * igt_output_override_mode: * @output: Output of which the mode will be overridden - * @mode: New mode + * @mode: New mode, or NULL to disable override. * * Overrides the output's mode with @mode, so that it is used instead of the * mode obtained with get connectors. Note that the mode is used without @@ -2386,8 +2386,14 @@ void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode) { igt_pipe_t *pipe = igt_output_get_driving_pipe(output); - output->override_mode = *mode; - output->use_override_mode = true; + if (mode) + output->override_mode = *mode; + else /* restore default_mode, may have been overwritten in igt_output_refresh */ + kmstest_get_connector_default_mode(output->display->drm_fd, + output->config.connector, + &output->config.default_mode); + + output->use_override_mode = !!mode; if (pipe) pipe->mode_changed = true; |