diff options
author | José Roberto de Souza <jose.souza@intel.com> | 2019-03-29 13:13:22 -0700 |
---|---|---|
committer | José Roberto de Souza <jose.souza@intel.com> | 2019-04-01 12:42:47 -0700 |
commit | 4383f7f7e0932ff652823db0ab8b80acf43a20e5 (patch) | |
tree | fe201d7e6bc597769d020af0cc0fd59baa6f4088 /lib/igt_kms.c | |
parent | d15e00b9b4ebda5bbacdb4eea0af1e80e3da16da (diff) |
lib: Share the 1024x768 mode among tests
Three test were duplicating this 1024x768 mode so lets move it to lib
and share it.
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r-- | lib/igt_kms.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 43f45997..ce9fe152 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -2155,6 +2155,29 @@ igt_output_t *igt_output_from_connector(igt_display_t *display, return found; } +const drmModeModeInfo *igt_std_1024_mode_get(void) +{ + static const drmModeModeInfo std_1024_mode = { + .clock = 65000, + .hdisplay = 1024, + .hsync_start = 1048, + .hsync_end = 1184, + .htotal = 1344, + .hskew = 0, + .vdisplay = 768, + .vsync_start = 771, + .vsync_end = 777, + .vtotal = 806, + .vscan = 0, + .vrefresh = 60, + .flags = 0xA, + .type = 0x40, + .name = "Custom 1024x768", + }; + + return &std_1024_mode; +} + static void igt_pipe_fini(igt_pipe_t *pipe) { free(pipe->planes); @@ -3627,7 +3650,7 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output) * mode obtained with get connectors. Note that the mode is used without * checking if the output supports it, so this might lead to unexpected results. */ -void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode) +void igt_output_override_mode(igt_output_t *output, const drmModeModeInfo *mode) { igt_pipe_t *pipe = igt_output_get_driving_pipe(output); |