[Intel-gfx] [PATCH i-g-t v2 00/15] Add support for atomic modeset to IGT.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Wed Jul 6 09:55:40 UTC 2016


With legacy modesets if the primary plane had a null fb it was disabled,
and code would often do the following:

for_each_pipe(...)
	for_each_output(...) {
		igt_output_set_pipe(output, pipe);

		igt_display_commit();

		if (!output->valid)
			bail;

		cleanup;
		igt_output_set_pipe(output, PIPE_ANY);
		igt_display_commit();
	}

A straightforward replacement of igt_display_commit with
igt_display_commit2(COMMIT_ATOMIC) will not work with this
series, since in this case it can perform a modeset without
primary framebuffer, and invalid configurations get rejected.

Best solution is to do the following to get atomic behavior,
with fallback to legacy:

bool valid = false;

for_each_pipe_with_valid_output(display, pipe, output) {
	valid = true;

	igt_output_set_pipe(output, pipe);
	/* perform more setup here for planes, etc */
	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);

	/* tests + cleanup */
	igt_output_set_pipe(output, PIPE_NONE);
}

igt_require_f(valid, "no valid crtc/connector combinations found\n");

If the test requires a fixed pipe, use for_each_valid_output_on_pipe instead.

XXX: Make a igt_require_valid_output() for test fixtures?

Unfortunately it made me learn that that setting connector properties with
the atomic api doesn't work yet, needs more tests and changes in the kernel.
But we'll get there, converting encoder api in the kernel to use the atomic
state is a first step.

Changes since first series:
- Silence compiler warning about unused variable 'encoder'.
- Update pan members patch to fix ordering.
- Clean up more tests that rely on outputs with unassigned pipes having
  filled in a default pipe.
- Add kms_atomic_transition
- Add atomic test for fastset panel fitting changes, to ensure no modeset's done.
  Removing the call to intel_update_pipe_config in the kernel caused fifo underruns
  and hw state validator failures, so I think this test works as intended. :-)

Maarten Lankhorst (15):
  igt_kms: Remove kmstest_connector_config.crtc_idx
  igt_kms: Find optimal encoder only after selecting pipe
  kms_psr_sink_crc: Use for_each_pipe_with_valid_output to find a valid
    config.
  igt_kms: Make PIPE_ANY a alias for PIPE_NONE
  tests/kms: Clean up more users of unassigned pipes.
  igt_kms: Change PIPE_ANY behavior to mean unassigned
  igt_kms: Handle atomic pipe properties better.
  igt_kms: Remove pan members from igt_plane, v2.
  igt_kms: Clear all _changed members centrally
  igt_kms: Add modeset support to atomic commits.
  tests: Add kms_rmfb test.
  tests: Add kms_atomic_transition
  igt_kms: Add more apis for panel fitting test.
  igt_kms: Allow disabling previous override mode
  kms_panel_fitting: Add tests for fastboot.

 lib/igt_kms.c                     | 698 +++++++++++++++++++++++---------------
 lib/igt_kms.h                     |  51 ++-
 tests/Makefile.sources            |   2 +
 tests/kms_atomic_transition.c     | 189 +++++++++++
 tests/kms_crtc_background_color.c |   3 +-
 tests/kms_flip_tiling.c           |  50 +--
 tests/kms_panel_fitting.c         | 108 +++++-
 tests/kms_plane.c                 |   8 +-
 tests/kms_plane_scaling.c         |   7 +-
 tests/kms_psr_sink_crc.c          |   5 +-
 tests/kms_rmfb.c                  | 171 ++++++++++
 tests/testdisplay.c               |   4 +-
 12 files changed, 954 insertions(+), 342 deletions(-)
 create mode 100644 tests/kms_atomic_transition.c
 create mode 100644 tests/kms_rmfb.c

-- 
2.5.5



More information about the Intel-gfx mailing list