All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/i915/kms_cdclk: Add new subtest
@ 2022-06-03 16:12 Swati Sharma
  2022-06-03 16:28 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
  0 siblings, 1 reply; 2+ messages in thread
From: Swati Sharma @ 2022-06-03 16:12 UTC (permalink / raw)
  To: igt-dev

Driver still works in such a way that CDCLK is never decreased, but
always increase. This is done in order to avoid continuous CDCLK
switching.

So, in case if new CDCLK(after transition from low to high mode)
is same as reference CDCLK i.e. reference = new because of
above stated driver optimization; the current mode-transition test
is passed else ref < new condition is checked (as we expect CDCLK
will bump after mode transition from low to high mode). This is done
in current mode-transition subtest where we are checking mode
transition on each valid output.

In this patch, a new subtest is added which lowers modes of
all valid outputs simultaneously and then switches to highest
mode to get proper DVFS behavior along with the above mentioned
driver policy. In this case, we should expect CDCLK switch from low
to high.

Along with this, few cleanups have been done.

Cc: Uma Shankar<uma.shankar@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/i915/kms_cdclk.c | 109 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 101 insertions(+), 8 deletions(-)

diff --git a/tests/i915/kms_cdclk.c b/tests/i915/kms_cdclk.c
index 818cbfd5..08750e25 100644
--- a/tests/i915/kms_cdclk.c
+++ b/tests/i915/kms_cdclk.c
@@ -26,12 +26,12 @@
 
 #include "igt.h"
 
-IGT_TEST_DESCRIPTION("Test cdclk features : crawling");
+IGT_TEST_DESCRIPTION("Test cdclk features : crawling and squashing");
 
-#define HDISPLAY_4K     3840
-#define VDISPLAY_4K     2160
+#define HDISPLAY_4K	3840
+#define VDISPLAY_4K	2160
 #define VREFRESH	60
-#define MAX_CDCLK_4K    307200
+#define MAX_CDCLK_4K	307200
 
 /* Test flags */
 enum {
@@ -237,6 +237,94 @@ static void test_mode_transition(data_t *data, enum pipe pipe, igt_output_t *out
 	igt_remove_fb(display->drm_fd, &fb);
 }
 
+static void test_mode_transition_on_all_outputs(data_t *data)
+{
+	igt_display_t *display = &data->display;
+	int debugfs_fd = data->debugfs_fd;
+	drmModeModeInfo *mode, *mode_hi, *mode_lo;
+	igt_output_t *output;
+	int valid_outputs = 0;
+	int cdclk_ref, cdclk_new;
+	uint16_t width = 0, height = 0;
+	struct igt_fb fb;
+	igt_pipe_t *pipe;
+	igt_plane_t *plane;
+	int i = 0, j = 0;
+
+	do_cleanup_display(display);
+	igt_display_reset(display);
+
+	for_each_connected_output(&data->display, output)
+		valid_outputs++;
+
+	for_each_connected_output(display, output) {
+		mode = igt_output_get_mode(output);
+		igt_assert(mode);
+
+		igt_output_set_pipe(output, PIPE_NONE);
+
+		width = max(width, mode->hdisplay);
+		height = max(height, mode->vdisplay);
+	}
+
+	igt_create_pattern_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
+			      DRM_FORMAT_MOD_LINEAR, &fb);
+	i = 0;
+	for_each_connected_output(display, output) {
+		pipe = &display->pipes[i];
+		plane = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
+
+		mode = NULL;
+
+		igt_output_set_pipe(output, i);
+		mode = igt_output_get_mode(output);
+		igt_assert(mode);
+
+		mode_lo = get_lowres_mode(output);
+
+		igt_output_override_mode(output, mode_lo);
+		igt_plane_set_fb(plane, &fb);
+		igt_fb_set_size(&fb, plane, mode_lo->hdisplay, mode_lo->vdisplay);
+		igt_plane_set_size(plane, mode_lo->hdisplay, mode_lo->vdisplay);
+		i++;
+	}
+
+	igt_display_commit2(display, COMMIT_ATOMIC);
+	cdclk_ref = get_current_cdclk_freq(debugfs_fd);
+
+	j = 0;
+	for_each_connected_output(display, output) {
+		pipe = &display->pipes[j];
+		plane = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
+
+		mode = NULL;
+
+		igt_output_set_pipe(output, j);
+		mode = igt_output_get_mode(output);
+		igt_assert(mode);
+
+		mode_hi = get_highres_mode(output);
+		igt_require(mode_hi != NULL);
+
+		igt_output_override_mode(output, mode_hi);
+		igt_plane_set_fb(plane, &fb);
+		igt_fb_set_size(&data->fb, plane, mode_hi->hdisplay, mode_hi->vdisplay);
+		igt_plane_set_size(plane, mode_hi->hdisplay, mode_hi->vdisplay);
+		j++;
+	}
+
+	igt_display_commit2(display, COMMIT_ATOMIC);
+	cdclk_new = get_current_cdclk_freq(debugfs_fd);
+	igt_info("CD clock frequency %d -> %d\n", cdclk_ref, cdclk_new);
+
+	/* cdclk should bump */
+	igt_assert_lt(cdclk_ref, cdclk_new);
+
+	igt_plane_set_fb(plane, NULL);
+	do_cleanup_display(display);
+	igt_remove_fb(data->drm_fd, &fb);
+}
+
 static void run_cdclk_test(data_t *data, uint32_t flags)
 {
 	igt_display_t *display = &data->display;
@@ -244,7 +332,7 @@ static void run_cdclk_test(data_t *data, uint32_t flags)
 	enum pipe pipe;
 
 	for_each_pipe_with_valid_output(display, pipe, output) {
-		igt_dynamic_f("%s-pipe-%s", output->name, kmstest_pipe_name(pipe))
+		igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name)
 			if (igt_pipe_connector_valid(pipe, output)) {
 				if (flags & TEST_PLANESCALING)
 					test_plane_scaling(data, pipe, output);
@@ -266,18 +354,23 @@ igt_main
 		kmstest_set_vt_graphics_mode();
 		data.devid = intel_get_drm_devid(data.drm_fd);
 		igt_require_f(hardware_supported(&data),
-			      "Hardware doesn't support crawling.\n");
+			      "Hardware doesn't support crawling/squashing.\n");
 		igt_display_require(&data.display, data.drm_fd);
 		igt_display_require_output(&data.display);
 	}
 
-	igt_describe("Plane scaling test to validate cdclk frequency change");
+	igt_describe("Plane scaling test to validate cdclk frequency change.");
 	igt_subtest_with_dynamic("plane-scaling")
 		run_cdclk_test(&data, TEST_PLANESCALING);
-	igt_describe("Mode transition (low to high) test to validate cdclk frequency change");
+	igt_describe("Mode transition (low to high) test to validate cdclk frequency change.");
 	igt_subtest_with_dynamic("mode-transition")
 		run_cdclk_test(&data, TEST_MODETRANSITION);
 
+	igt_describe("Mode transition (low to high) test to validate cdclk frequency change "
+		     "by simultaneous modesets on all pipes with valid outputs.");
+	igt_subtest("mode-transition-all-outputs")
+		test_mode_transition_on_all_outputs(&data);
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 	}
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915/kms_cdclk: Add new subtest
  2022-06-03 16:12 [igt-dev] [PATCH i-g-t] tests/i915/kms_cdclk: Add new subtest Swati Sharma
@ 2022-06-03 16:28 ` Patchwork
  0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2022-06-03 16:28 UTC (permalink / raw)
  To: Swati Sharma; +Cc: igt-dev

== Series Details ==

Series: tests/i915/kms_cdclk: Add new subtest
URL   : https://patchwork.freedesktop.org/series/104735/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
edb1a467fb622b23b927e28ff603fa43851fea97 tests/amdgpu: refactoring and update amd_basic tests

[468/655] Linking target tests/gem_request_retire
[469/655] Linking target tests/gem_reset_stats
[470/655] Linking target tests/gem_ringfill
[471/655] Linking target tests/gem_set_tiling_vs_blt
[472/655] Linking target tests/gem_set_tiling_vs_gtt
[473/655] Linking target tests/gem_set_tiling_vs_pwrite
[474/655] Linking target tests/gem_shrink
[475/655] Linking target tests/gem_softpin
[476/655] Linking target tests/gem_streaming_writes
[477/655] Linking target tests/gem_spin_batch
[478/655] Linking target tests/gem_sync
[479/655] Linking target tests/gem_tiled_blits
[480/655] Linking target tests/gem_tiled_fence_blits
[481/655] Linking target tests/gem_tiled_partial_pwrite_pread
[482/655] Linking target tests/gem_tiled_swapping
[483/655] Linking target tests/gem_tiled_pread_basic
[484/655] Linking target tests/gem_tiled_pread_pwrite
[485/655] Linking target tests/gem_tiling_max_stride
[486/655] Linking target tests/gem_tiled_wb
[487/655] Linking target tests/gem_tiled_wc
[488/655] Linking target tests/gem_unfence_active_buffers
[489/655] Linking target tests/i915_fb_tiling
[490/655] Linking target tests/gem_unref_active_buffers
[491/655] Linking target tests/gem_wait
[492/655] Linking target tests/gem_userptr_blits
[493/655] Linking target tests/gem_vm_create
[494/655] Linking target tests/gem_watchdog
[495/655] Linking target tests/gem_workarounds
[496/655] Linking target tests/i915_getparams_basic
[497/655] Linking target tests/i915_hangman
[498/655] Linking target tests/i915_pciid
[499/655] Linking target tests/i915_module_load
[500/655] Linking target tests/i915_pm_dc
[501/655] Linking target tests/i915_pm_backlight
[502/655] Linking target tests/i915_pm_lpsp
[503/655] Linking target tests/i915_pm_rpm
[504/655] Linking target tests/i915_pm_rps
[505/655] Linking target tests/kms_big_fb
[506/655] Linking target tests/i915_pm_sseu
[507/655] Linking target tests/i915_query
[508/655] Linking target tests/i915_selftest
[509/655] Linking target tests/i915_suspend
[510/655] Compiling C object tests/kms_cdclk.p/i915_kms_cdclk.c.o
FAILED: tests/kms_cdclk.p/i915_kms_cdclk.c.o 
ccache cc -Itests/kms_cdclk.p -Itests -I../tests -I../include/drm-uapi -I../include/linux-uapi -Ilib -I../lib -I../lib/stubs/syscalls -I. -I.. -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libpng12 -I/usr/include/libdrm -I/usr/include/libdrm/nouveau -I/usr/include/x86_64-linux-gnu -I/usr/include/alsa -I/usr/include -I/home/cidrm/kernel_headers/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wimplicit-fallthrough=0 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fcommon -pthread -MD -MQ tests/kms_cdclk.p/i915_kms_cdclk.c.o -MF tests/kms_cdclk.p/i915_kms_cdclk.c.o.d -o tests/kms_cdclk.p/i915_kms_cdclk.c.o -c ../tests/i915/kms_cdclk.c
../tests/i915/kms_cdclk.c: In function ‘test_mode_transition_on_all_outputs’:
../tests/i915/kms_cdclk.c:311:24: error: ‘data_t’ {aka ‘struct <anonymous>’} has no member named ‘fb’
   igt_fb_set_size(&data->fb, plane, mode_hi->hdisplay, mode_hi->vdisplay);
                        ^~
ninja: build stopped: subcommand failed.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-03 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 16:12 [igt-dev] [PATCH i-g-t] tests/i915/kms_cdclk: Add new subtest Swati Sharma
2022-06-03 16:28 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.