Skip to contentSkip to conversation

tests/kms_frontbuffer_tracking: Extend the test to enable FBC for each plane

PATCH Superseded Nidhi Gupta 2 participants 3 messages Oct 25, 2023

v4 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 tests/kms_frontbuffer_tracking: Extend the test to enable FBC for each plane

Added a new subtest to validate FBC on each plane, this new subtest will first disable the fbc feature on all pipes and planes and then enable it on all plane one by one and confirm.

v2: Modify tests to disable primary and enable other plane
to check fbc is enabled or not. <Bhanu>

---
 tests/intel/kms_frontbuffer_tracking.c | 122 +++++++++++++++++++++++++
 1 file changed, 122 insertions(+)
tests/intel/kms_frontbuffer_tracking.c +122 -0
index f90d09f9f..1c7903249 100644
@@ -224,6 +224,8 @@ struct fb_region {
 	int h;
 };
 
+struct igt_fb default_fb;
+
 struct draw_pattern_info {
 	bool frames_stack;
 	int n_rects;
@@ -888,6 +890,14 @@ static bool fbc_mode_too_large(void)
 	return strstr(buf, "FBC disabled: mode too large for compression\n");
 }
 
+static bool fbc_enable_per_plane(void)
+{
+	char buf[128];
+
+	debugfs_read_crtc("i915_fbc_status", buf);
+	return strstr(buf, "*");
+}
+
 static bool drrs_wait_until_rr_switch_to_low(void)
 {
 	return igt_wait(is_drrs_low(), 5000, 1);
@@ -1691,6 +1701,31 @@ static void set_region_for_test(const struct test_mode *t,
 	do_assertions(ASSERT_NO_ACTION_CHANGE);
 }
 
+static void set_plane_for_test_fbc(const struct test_mode *t, igt_plane_t *plane)
+{
+	//create_fb
+	struct igt_fb fb;
+	uint32_t color;
+
+	igt_create_fb(drm.fd, prim_mode_params.mode.hdisplay, prim_mode_params.mode.vdisplay,
+			t->format, DRM_FORMAT_MOD_LINEAR, &fb);
+	//fill_fb_region
+	color = pick_color(&fb, COLOR_PRIM_BG);
+
+	igt_draw_rect_fb(drm.fd, drm.bops, 0, &fb, IGT_DRAW_BLT,
+			 0, 0, fb.width, fb.height,
+			 color);
+	set_mode_for_params(&prim_mode_params);
+	igt_plane_set_fb(plane, &fb);
+	igt_plane_set_position(plane, 0, 0);
+	igt_plane_set_size(plane, prim_mode_params.mode.hdisplay, prim_mode_params.mode.vdisplay);
+	igt_fb_set_size(&fb, plane, prim_mode_params.mode.hdisplay, prim_mode_params.mode.vdisplay);
+
+	igt_display_commit(&drm.display);
+	igt_require(!fbc_enable_per_plane());
+	do_assertions(ASSERT_NO_ACTION_CHANGE);
+}
+
 static bool enable_features_for_test(const struct test_mode *t)
 {
 	bool ret = false;
@@ -1941,6 +1976,65 @@ static void rte_subtest(const struct test_mode *t)
 	}
 }
 
+/**
+ * SUBTEST: plane-%u-fbc-rte
+ * Description: Disable the provided %arg[1] plane and enable again
+ * Driver requirement: i915, xe
+ * Functionality: fbc
+ * Mega feature: General Display Features
+ * Test category: functionality test
+ *
+ * arg[1].values:  0, 1, 2
+ */
+
+/**
+ * SUBTEST: plane-0-fbc-rte
+ * Description: Disable the provided %arg[1] plane and enable again
+ * Driver requirement: i915, xe
+ * Functionality: fbc
+ * Mega feature: General Display Features
+ * Test category: functionality test
+ *
+ * SUBTEST: plane-1-fbc-rte
+ * Description: Disable the provided %arg[1] plane and enable again
+ * Driver requirement: i915, xe
+ * Functionality: fbc
+ * Mega feature: General Display Features
+ * Test category: functionality test
+ *
+ * SUBTEST: plane-2-fbc-rte
+ * Description: Disable the provided %arg[1] plane and enable again
+ * Driver requirement: i915, xe
+ * Functionality: fbc
+ * Mega feature: General Display Features
+ * Test category: functionality test
+ */
+
+/**
+ * plane-fbc-rte - the basic sanity test
+ *
+ * METHOD
+ *   Just disable all screens, assert everything is disabled, then enable all
+ *   screens  and planes  and assert that the tested feature is enabled.
+ *
+ * EXPECTED RESULTS
+ *   Blue screens and t->feature enabled.
+ *
+ * FAILURES
+ *   A failure here means that every other subtest will probably fail too. It
+ *   probably means that the Kernel is just not enabling the feature we want.
+ */
+static void plane_fbc_rte_subtest(const struct test_mode *t, igt_plane_t *plane)
+{
+	do_assertions(ASSERT_FBC_DISABLED);
+
+	if (plane->index == 0)
+		enable_prim_screen_and_wait(t);
+	if (plane->index > 0)
+		set_plane_for_test_fbc(t, plane);
+
+}
+
 static void update_wanted_crc(const struct test_mode *t, igt_crc_t *crc)
 {
 	if (t->screen == SCREEN_PRIM)
@@ -4910,6 +5004,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
 {
 	struct test_mode t;
 	int devid;
+	igt_plane_t *plane;
 
 	igt_fixture {
 		setup_environment();
@@ -4936,6 +5031,33 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
 		}
 	}
 
+	igt_subtest_with_dynamic("plane-fbc-rte") {
+
+		int n_planes = 0;
+
+		t.pipes = PIPE_SINGLE;
+		t.feature = FEATURE_FBC;
+		t.screen = SCREEN_PRIM;
+		t.fbs = FBS_INDIVIDUAL;
+		t.format = FORMAT_DEFAULT;
+		/* Make sure nothing is using these values. */
+		t.flip = -1;
+		t.method = -1;
+		t.tiling = opt.tiling;
+
+		for_each_plane_on_pipe(&drm.display, prim_mode_params.pipe, plane) {
+			n_planes++;
+			if (n_planes == 4)
+				break;
+			igt_dynamic_f("plane-%u-fbc-rte", plane->index) {
+				prepare_subtest_data(&t, NULL);
+				unset_all_crtcs();
+				plane_fbc_rte_subtest(&t, plane);
+				n_planes++;
+			}
+		}
+	}
+
 	TEST_MODE_ITER_BEGIN(t)
 
 		igt_subtest_f("%s-%s-%s-%s-%s-draw-%s",
Signature · 1 line
2.39.0
#1 lore raw

[igt-dev] ✗ Fi.CI.BUILD: failure for tests/kms_frontbuffer_tracking: Extend the test to enable FBC for each plane (rev4)

== Series Details ==

== Series Details ==

Series: tests/kms_frontbuffer_tracking: Extend the test to enable FBC for each plane (rev4)
URL : https://patchwork.freedesktop.org/series/123724/
State : failure

== Summary ==

IGT patchset build failed on latest successful build 18fc864d68d382847596594d7eb3488f2c8fb45e tests/kms_flip: disable DRRS if eDP support variable refresh rate

Tail of build.log:
[1602/1645] Linking target tools/amd_hdmi_compliance.
[1603/1645] Linking target tools/intel_l3_parity.
[1604/1645] Linking target tools/intel_gem_info.
[1605/1645] Linking target tools/lsgpu.
[1606/1645] Linking target tools/intel_dp_compliance.
[1607/1645] Linking target runner/igt_comms_decoder.
[1608/1645] Linking target tools/msm_dp_compliance.
[1609/1645] Linking target tools/intel_reg.
[1610/1645] Generating gem_stress.testlist with a meson_exe.py custom command.
[1611/1645] Linking target runner/igt_results.
[1612/1645] Linking target runner/testdata/abort-fixture.
[1613/1645] Linking target runner/testdata/no-subtests.
[1614/1645] Linking target runner/testdata/abort-simple.
[1615/1645] Linking target runner/testdata/successtest.
[1616/1645] Linking target runner/testdata/skippers.
[1617/1645] Linking target runner/testdata/abort-dynamic.
[1618/1645] Linking target runner/igt_runner.
[1619/1645] Linking target runner/testdata/abort.
[1620/1645] Linking target runner/runner_json_test.
[1621/1645] Linking target runner/igt_resume.
[1622/1645] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_mtlgt3.c.o'.
[1623/1645] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt1.c.o'.
[1624/1645] Compiling C object 'runner/527aa9f@@runner_test@exe/runner_tests.c.o'.
[1625/1645] Linking target runner/runner_test.
[1626/1645] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt2.c.o'.
[1627/1645] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt3.c.o'.
[1628/1645] Linking target lib/libi915_perf.so.1.5.
[1629/1645] Generating symbol file 'lib/76b5a35@@i915_perf@sha/libi915_perf.so.1.5.symbols'.
[1630/1645] Linking target tools/i915-perf/i915-perf-configs.
[1631/1645] Linking target tools/i915-perf/i915-perf-reader.
[1632/1645] Linking target tools/i915-perf/i915-perf-recorder.
[1633/1645] Linking target tests/perf.
[1634/1645] Linking target tests/gem_barrier_race.
[1635/1645] Linking target tests/core_hotunplug.
[1636/1645] Generating perf.testlist with a meson_exe.py custom command.
[1637/1645] Generating core_hotunplug.testlist with a meson_exe.py custom command.
[1638/1645] Generating gem_barrier_race.testlist with a meson_exe.py custom command.
[1639/1645] Generating xe_tests.rst with a custom command.
[1640/1645] Generating i915_tests.rst with a custom command.
[1641/1645] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/usr/src/igt-gpu-tools/scripts/igt_doc.py --config /usr/src/igt-gpu-tools/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst --check-testlist --igt-build-path /opt/igt/build
Warning: Documented igt@kms_frontbuffer_tracking@plane-0-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-1-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-2-fbc-rte doesn't exist on source files
Warning: Missing documentation for igt@kms_frontbuffer_tracking@plane-fbc-rte
Please refer: docs/test_documentation.md for more details
[1642/1645] Generating xe_tests.html with a custom command.
[1643/1645] Generating i915_tests.html with a custom command.
ninja: build stopped: subcommand failed.

#2 lore raw

[igt-dev] ✗ GitLab.Pipeline: warning for tests/kms_frontbuffer_tracking: Extend the test to enable FBC for each plane (rev4)

In reply to Nidhi Gupta
== Series Details ==

== Series Details ==

Series: tests/kms_frontbuffer_tracking: Extend the test to enable FBC for each plane (rev4)
URL : https://patchwork.freedesktop.org/series/123724/
State : warning

== Summary ==

Pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/1018792 for the overview.

build:tests-debian-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/50757436):
[1640/1642] Generating i915_tests.html with a custom command.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/727] Generating version.h with a custom command.
[2/4] Linking target runner/runner_test.
[3/4] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Documented igt@kms_frontbuffer_tracking@plane-0-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-1-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-2-fbc-rte doesn't exist on source files
Warning: Missing documentation for igt@kms_frontbuffer_tracking@plane-fbc-rte
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1698252389:step_script
section_start:1698252389:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1698252391:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/50757431):
[1646/1648] Generating i915_tests.html with a custom command.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/729] Generating version.h with a custom command.
[2/4] Linking target runner/runner_test.
[3/4] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Documented igt@kms_frontbuffer_tracking@plane-0-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-1-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-2-fbc-rte doesn't exist on source files
Warning: Missing documentation for igt@kms_frontbuffer_tracking@plane-fbc-rte
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1698252359:step_script
section_start:1698252359:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1698252361:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/50757435):
Please refer: docs/test_documentation.md for more details
[1647/1648] Generating i915_tests.html with a custom command.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/729] Generating version.h with a custom command.
[2/3] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Documented igt@kms_frontbuffer_tracking@plane-0-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-1-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-2-fbc-rte doesn't exist on source files
Warning: Missing documentation for igt@kms_frontbuffer_tracking@plane-fbc-rte
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1698252382:step_script
section_start:1698252382:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1698252383:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-no-libdrm-nouveau has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/50757434):
[1490/1492] Generating i915_tests.html with a custom command.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/683] Generating version.h with a custom command.
[2/4] Linking target runner/runner_test.
[3/4] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Documented igt@kms_frontbuffer_tracking@plane-0-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-1-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-2-fbc-rte doesn't exist on source files
Warning: Missing documentation for igt@kms_frontbuffer_tracking@plane-fbc-rte
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1698252359:step_script
section_start:1698252359:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1698252360:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-no-libunwind has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/50757432):
[1646/1648] Generating i915_tests.html with a custom command.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/729] Generating version.h with a custom command.
[2/4] Linking target runner/runner_test.
[3/4] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Documented igt@kms_frontbuffer_tracking@plane-0-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-1-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-2-fbc-rte doesn't exist on source files
Warning: Missing documentation for igt@kms_frontbuffer_tracking@plane-fbc-rte
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1698252357:step_script
section_start:1698252357:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1698252358:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-oldest-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/50757433):
[1646/1648] Generating i915_tests.html with a custom command.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/729] Generating version.h with a custom command.
[2/4] Linking target runner/runner_test.
[3/4] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Documented igt@kms_frontbuffer_tracking@plane-0-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-1-fbc-rte doesn't exist on source files
Warning: Documented igt@kms_frontbuffer_tracking@plane-2-fbc-rte doesn't exist on source files
Warning: Missing documentation for igt@kms_frontbuffer_tracking@plane-fbc-rte
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1698252357:step_script
section_start:1698252357:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1698252359:cleanup_file_variables
ERROR: Job failed: exit code 1

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/1018792