[PATCH i-g-t v3 00/13] Add support for atomic modeset to IGT.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 second version:
- Split out 2 commits from 'Change PIPE_ANY behavior', to increase readability.
- Small fixes found by review, annotated in the patches.

Maarten Lankhorst (13):
  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, v2.
  kms_sink_crc_basic: 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: Assign pipe properties in pipe init
  igt_kms: Use pipes for committing, not outputs
  igt_kms: Change PIPE_ANY behavior to mean unassigned, v2.
  igt_kms: Handle atomic pipe properties better.
  igt_kms: Remove pan members from igt_plane, v2.
  igt_kms: Clear all _changed members centrally, v2.
  igt_kms: Add modeset support to atomic commits.

 lib/igt_kms.c                     | 623 +++++++++++++++++++++-----------------
 lib/igt_kms.h                     |  48 ++-
 tests/kms_crtc_background_color.c |   3 +-
 tests/kms_flip_tiling.c           |  50 +--
 tests/kms_panel_fitting.c         |   7 +-
 tests/kms_plane.c                 |   8 +-
 tests/kms_plane_scaling.c         |   7 +-
 tests/kms_psr_sink_crc.c          |   8 +-
 tests/kms_sink_crc_basic.c        |   8 +-
 tests/testdisplay.c               |   4 +-
 10 files changed, 431 insertions(+), 335 deletions(-)

-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux