All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources()
@ 2018-10-03 19:43 Chris Wilson
  2018-10-03 20:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Chris Wilson @ 2018-10-03 19:43 UTC (permalink / raw)
  To: igt-dev

If KMS is not supported on the device, drmModeGetResources() will return
NULL, often this is an indication that we should not attempt to run the
test. Although it would be preferred to use something like
igt_require_display() as the canonical check and assert that
drmModeGetResources() did not hit an error, it is not always practical
as the tests do not utilize the common igt_display abstraction.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_exec_nop.c              | 2 +-
 tests/kms_3d.c                    | 2 ++
 tests/kms_chamelium.c             | 2 +-
 tests/kms_draw_crc.c              | 1 +
 tests/kms_fbcon_fbt.c             | 1 +
 tests/kms_flip.c                  | 4 ++--
 tests/kms_force_connector_basic.c | 3 ++-
 tests/kms_hdmi_inject.c           | 2 ++
 tests/kms_invalid_dotclock.c      | 3 +++
 tests/kms_setmode.c               | 2 +-
 tests/kms_tv_load_detect.c        | 3 ++-
 tests/kms_universal_plane.c       | 1 +
 tests/perf_pmu.c                  | 2 +-
 tests/pm_lpsp.c                   | 1 +
 tests/testdisplay.c               | 9 ++++++---
 15 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index 74d27522..59a08ad0 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -280,7 +280,7 @@ static void headless(int fd, uint32_t handle)
 	double n_display, n_headless;
 
 	res = drmModeGetResources(fd);
-	igt_assert(res);
+	igt_require(res);
 
 	/* require at least one connected connector for the test */
 	for (int i = 0; i < res->count_connectors; i++) {
diff --git a/tests/kms_3d.c b/tests/kms_3d.c
index bfc981ee..df8185ab 100644
--- a/tests/kms_3d.c
+++ b/tests/kms_3d.c
@@ -36,7 +36,9 @@ igt_simple_main
 	int mode_count, connector_id;
 
 	drm_fd = drm_open_driver_master(DRIVER_INTEL);
+
 	res = drmModeGetResources(drm_fd);
+	igt_require(res);
 
 	igt_assert(drmSetClientCap(drm_fd, DRM_CLIENT_CAP_STEREO_3D, 1) >= 0);
 
diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index cf7e3c9a..5ebac8dc 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -420,7 +420,7 @@ prepare_output(data_t *data,
 	enum pipe pipe;
 	bool found = false;
 
-	igt_assert(res = drmModeGetResources(data->drm_fd));
+	igt_require(res = drmModeGetResources(data->drm_fd));
 
 	/* The chamelium's default EDID has a lot of resolutions, way more then
 	 * we need to test
diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
index 90904714..ea14db9a 100644
--- a/tests/kms_draw_crc.c
+++ b/tests/kms_draw_crc.c
@@ -254,6 +254,7 @@ static void setup_environment(void)
 	igt_require(drm_fd >= 0);
 
 	drm_res = drmModeGetResources(drm_fd);
+	igt_require(drm_res);
 	igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
 
 	for (i = 0; i < drm_res->count_connectors; i++)
diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index 8de3da83..24d3ad90 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -63,6 +63,7 @@ static void setup_drm(struct drm_info *drm)
 	drm->debugfs_fd = igt_debugfs_dir(drm->fd);
 
 	drm->res = drmModeGetResources(drm->fd);
+	igt_require(drm->res);
 	igt_assert(drm->res->count_connectors <= MAX_CONNECTORS);
 
 	for (i = 0; i < drm->res->count_connectors; i++)
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 44a82053..f28272dd 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1355,7 +1355,7 @@ static int run_test(int duration, int flags)
 		igt_require(igt_setup_runtime_pm());
 
 	resources = drmModeGetResources(drm_fd);
-	igt_assert(resources);
+	igt_require(resources);
 
 	/* Count output configurations to scale test runtime. */
 	for (i = 0; i < resources->count_connectors; i++) {
@@ -1412,7 +1412,7 @@ static int run_pair(int duration, int flags)
 	igt_require((flags & TEST_HANG) == 0 || !is_wedged(drm_fd));
 
 	resources = drmModeGetResources(drm_fd);
-	igt_assert(resources);
+	igt_require(resources);
 
 	/* Find a pair of connected displays */
 	for (i = 0; i < resources->count_connectors; i++) {
diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c
index 89431232..e9325dec 100644
--- a/tests/kms_force_connector_basic.c
+++ b/tests/kms_force_connector_basic.c
@@ -89,8 +89,9 @@ int main(int argc, char **argv)
 		unsigned vga_connector_id = 0;
 
 		drm_fd = drm_open_driver_master(DRIVER_INTEL);
+
 		res = drmModeGetResources(drm_fd);
-		igt_assert(res);
+		igt_require(res);
 
 		/* find the vga connector */
 		for (int i = 0; i < res->count_connectors; i++) {
diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c
index 22570a4b..699bad5b 100644
--- a/tests/kms_hdmi_inject.c
+++ b/tests/kms_hdmi_inject.c
@@ -254,7 +254,9 @@ igt_main
 
 	igt_fixture {
 		drm_fd = drm_open_driver_master(DRIVER_INTEL);
+
 		res = drmModeGetResources(drm_fd);
+		igt_require(res);
 
 		connector = get_connector(drm_fd, res);
 		igt_require(connector);
diff --git a/tests/kms_invalid_dotclock.c b/tests/kms_invalid_dotclock.c
index 568889a9..8c4c3122 100644
--- a/tests/kms_invalid_dotclock.c
+++ b/tests/kms_invalid_dotclock.c
@@ -133,8 +133,11 @@ igt_simple_main
 
 	igt_enable_connectors(data.drm_fd);
 	kmstest_set_vt_graphics_mode();
+
 	igt_display_require(&data.display, data.drm_fd);
 	data.res = drmModeGetResources(data.drm_fd);
+	igt_assert(data.res);
+
 	kmstest_unset_all_crtcs(data.drm_fd, data.res);
 
 	data.max_dotclock = i915_max_dotclock(&data);
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 47d04fb5..68149604 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -858,7 +858,7 @@ int main(int argc, char **argv)
 			kmstest_set_vt_graphics_mode();
 
 		drm_resources = drmModeGetResources(drm_fd);
-		igt_assert(drm_resources);
+		igt_require(drm_resources);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
diff --git a/tests/kms_tv_load_detect.c b/tests/kms_tv_load_detect.c
index 5684b267..012d0629 100644
--- a/tests/kms_tv_load_detect.c
+++ b/tests/kms_tv_load_detect.c
@@ -37,8 +37,9 @@ int main(int argc, char **argv)
 
 	igt_fixture {
 		drm_fd = drm_open_driver_master(DRIVER_INTEL);
+
 		res = drmModeGetResources(drm_fd);
-		igt_assert(res);
+		igt_require(res);
 
 		/* find the TV connector */
 		for (int i = 0; i < res->count_connectors; i++) {
diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index cb5070b1..30c03bbb 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -333,6 +333,7 @@ sanity_test_init(sanity_test_t *test, igt_output_t *output, enum pipe pipe)
 			    &test->undersized_fb);
 
 	test->moderes = drmModeGetResources(data->drm_fd);
+	igt_assert(test->moderes);
 }
 
 static void
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 6ab2595b..b34bc66c 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1398,7 +1398,7 @@ test_rc6(int gem_fd, unsigned int flags)
 		drmModeRes *res;
 
 		res = drmModeGetResources(gem_fd);
-		igt_assert(res);
+		igt_require(res);
 
 		/* force all connectors off */
 		kmstest_set_vt_graphics_mode();
diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c
index a741cb78..b319dbe9 100644
--- a/tests/pm_lpsp.c
+++ b/tests/pm_lpsp.c
@@ -199,6 +199,7 @@ igt_main
 		devid = intel_get_drm_devid(drm_fd);
 
 		drm_res = drmModeGetResources(drm_fd);
+		igt_require(drm_res);
 		igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
 
 		for (i = 0; i < drm_res->count_connectors; i++)
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 0ff98a2b..b13c3d70 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -156,12 +156,15 @@ static void dump_connectors_fd(int drmfd)
 
 static void dump_crtcs_fd(int drmfd)
 {
-	int i;
-	drmModeRes *mode_resources = drmModeGetResources(drmfd);
+	drmModeRes *mode_resources;
+
+	mode_resources = drmModeGetResources(drmfd);
+	if (!mode_resources)
+		return;
 
 	igt_info("CRTCs:\n");
 	igt_info("id\tfb\tpos\tsize\n");
-	for (i = 0; i < mode_resources->count_crtcs; i++) {
+	for (int i = 0; i < mode_resources->count_crtcs; i++) {
 		drmModeCrtc *crtc;
 
 		crtc = drmModeGetCrtc(drmfd, mode_resources->crtcs[i]);
-- 
2.19.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for igt: Check drmModeGetResources()
  2018-10-03 19:43 [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources() Chris Wilson
@ 2018-10-03 20:36 ` Patchwork
  2018-10-04  9:03 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2018-10-04 12:44 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
  2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-10-03 20:36 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt: Check drmModeGetResources()
URL   : https://patchwork.freedesktop.org/series/50522/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4918 -> IGTPW_1904 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/50522/revisions/1/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1904 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@core_auth@basic-auth:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#105719)

    igt@drv_module_reload@basic-reload:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106248, fdo#106725)

    igt@drv_selftest@live_sanitycheck:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#107726)

    igt@gem_render_tiled_blits@basic:
      fi-skl-6770hq:      PASS -> DMESG-WARN (fdo#105541)

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-glk-j4005:       PASS -> FAIL (fdo#100368)

    igt@kms_pipe_crc_basic@read-crc-pipe-c-frame-sequence:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106000)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362, fdo#103191)

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#105541 https://bugs.freedesktop.org/show_bug.cgi?id=105541
  fdo#105719 https://bugs.freedesktop.org/show_bug.cgi?id=105719
  fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
  fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
  fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726


== Participating hosts (48 -> 40) ==

  Additional (1): fi-cfl-guc 
  Missing    (9): fi-kbl-soraka fi-cnl-u fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-pnv-d510 fi-icl-u fi-bdw-samus 


== Build changes ==

    * IGT: IGT_4662 -> IGTPW_1904

  CI_DRM_4918: f595aba3a6e2f6972bb158eb8434b58d22d0e5f0 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1904: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1904/
  IGT_4662: ebf6a1dd1795e2f014ff3c47fe2eb4d5255845bd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1904/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for igt: Check drmModeGetResources()
  2018-10-03 19:43 [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources() Chris Wilson
  2018-10-03 20:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-10-04  9:03 ` Patchwork
  2018-10-04 12:44 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
  2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-10-04  9:03 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt: Check drmModeGetResources()
URL   : https://patchwork.freedesktop.org/series/50522/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4662_full -> IGTPW_1904_full =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/50522/revisions/1/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1904_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_available_modes_crc@available_mode_test_crc:
      shard-apl:          PASS -> FAIL (fdo#106641)

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
      shard-snb:          NOTRUN -> DMESG-WARN (fdo#107956)

    igt@kms_cursor_crc@cursor-128x42-sliding:
      shard-apl:          PASS -> FAIL (fdo#103232) +3

    igt@kms_cursor_crc@cursor-64x64-random:
      shard-kbl:          PASS -> FAIL (fdo#103232) +1

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
      shard-kbl:          PASS -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-onoff:
      shard-apl:          PASS -> FAIL (fdo#103167) +1

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-apl:          PASS -> FAIL (fdo#103166)

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@gem_pwrite@big-gtt-fbr:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@kms_available_modes_crc@available_mode_test_crc:
      shard-snb:          FAIL (fdo#106641) -> PASS

    igt@kms_busy@extended-pageflip-hang-newfb-render-c:
      shard-apl:          DMESG-WARN (fdo#107956) -> PASS

    igt@kms_color@pipe-a-degamma:
      shard-apl:          FAIL (fdo#108145) -> PASS

    igt@kms_cursor_crc@cursor-128x128-suspend:
      shard-apl:          FAIL (fdo#103232, fdo#103191) -> PASS
      shard-kbl:          FAIL (fdo#103232, fdo#103191) -> PASS

    igt@kms_cursor_crc@cursor-256x85-random:
      shard-apl:          FAIL (fdo#103232) -> PASS +2

    igt@kms_cursor_crc@cursor-64x21-onscreen:
      shard-kbl:          FAIL (fdo#103232) -> PASS +1

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
      shard-apl:          FAIL (fdo#103167) -> PASS
      shard-kbl:          FAIL (fdo#103167) -> PASS

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-apl:          FAIL (fdo#103166) -> PASS +1

    igt@kms_rotation_crc@sprite-rotation-180:
      shard-snb:          FAIL (fdo#103925) -> PASS

    igt@pm_rpm@system-suspend-modeset:
      shard-kbl:          INCOMPLETE (fdo#107807, fdo#103665) -> PASS

    
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
  fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
  fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (6 -> 3) ==

  Missing    (3): shard-skl shard-glk shard-hsw 


== Build changes ==

    * IGT: IGT_4662 -> IGTPW_1904
    * Linux: CI_DRM_4915 -> CI_DRM_4918

  CI_DRM_4915: 26e7a7d954a9c28b97af8ca7813f430fd9117232 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4918: f595aba3a6e2f6972bb158eb8434b58d22d0e5f0 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1904: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1904/
  IGT_4662: ebf6a1dd1795e2f014ff3c47fe2eb4d5255845bd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1904/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources()
  2018-10-03 19:43 [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources() Chris Wilson
  2018-10-03 20:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2018-10-04  9:03 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2018-10-04 12:44 ` Arkadiusz Hiler
  2018-10-04 13:27   ` Daniel Vetter
  2 siblings, 1 reply; 9+ messages in thread
From: Arkadiusz Hiler @ 2018-10-04 12:44 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Wed, Oct 03, 2018 at 08:43:49PM +0100, Chris Wilson wrote:
> If KMS is not supported on the device, drmModeGetResources() will return
> NULL, often this is an indication that we should not attempt to run the
> test. Although it would be preferred to use something like
> igt_require_display() as the canonical check and assert that
> drmModeGetResources() did not hit an error, it is not always practical
> as the tests do not utilize the common igt_display abstraction.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

and pushed
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources()
  2018-10-04 12:44 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
@ 2018-10-04 13:27   ` Daniel Vetter
  2018-10-04 15:14     ` Chris Wilson
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2018-10-04 13:27 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

On Thu, Oct 04, 2018 at 03:44:46PM +0300, Arkadiusz Hiler wrote:
> On Wed, Oct 03, 2018 at 08:43:49PM +0100, Chris Wilson wrote:
> > If KMS is not supported on the device, drmModeGetResources() will return
> > NULL, often this is an indication that we should not attempt to run the
> > test. Although it would be preferred to use something like
> > igt_require_display() as the canonical check and assert that
> > drmModeGetResources() did not hit an error, it is not always practical
> > as the tests do not utilize the common igt_display abstraction.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> 
> and pushed

I still think a kmstest_require() or so, plus then removing the pile of
add-how igt_require we just sprinkled all over, would be more maintainable
long term. kmstest_require() would also allow us to drop a not-so-cryptic
message into logs.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources()
  2018-10-04 13:27   ` Daniel Vetter
@ 2018-10-04 15:14     ` Chris Wilson
  2018-10-04 19:19       ` Daniel Vetter
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2018-10-04 15:14 UTC (permalink / raw)
  To: Arkadiusz Hiler, Daniel Vetter; +Cc: igt-dev

Quoting Daniel Vetter (2018-10-04 14:27:05)
> On Thu, Oct 04, 2018 at 03:44:46PM +0300, Arkadiusz Hiler wrote:
> > On Wed, Oct 03, 2018 at 08:43:49PM +0100, Chris Wilson wrote:
> > > If KMS is not supported on the device, drmModeGetResources() will return
> > > NULL, often this is an indication that we should not attempt to run the
> > > test. Although it would be preferred to use something like
> > > igt_require_display() as the canonical check and assert that
> > > drmModeGetResources() did not hit an error, it is not always practical
> > > as the tests do not utilize the common igt_display abstraction.
> > > 
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > 
> > and pushed
> 
> I still think a kmstest_require() or so, plus then removing the pile of
> add-how igt_require we just sprinkled all over, would be more maintainable
> long term. kmstest_require() would also allow us to drop a not-so-cryptic
> message into logs.

But what does kmstest mean? igt_require_kms(), which can be the raw
drm_mode_getresources ioctl, matches my expectations of a lowlevel check.
But is that as descriptive for the tests that are just using
drmModeGetResources() directly? That is the conundrum.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources()
  2018-10-04 15:14     ` Chris Wilson
@ 2018-10-04 19:19       ` Daniel Vetter
  2018-10-05  7:44         ` Arkadiusz Hiler
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2018-10-04 19:19 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, Daniel Vetter

On Thu, Oct 04, 2018 at 04:14:15PM +0100, Chris Wilson wrote:
> Quoting Daniel Vetter (2018-10-04 14:27:05)
> > On Thu, Oct 04, 2018 at 03:44:46PM +0300, Arkadiusz Hiler wrote:
> > > On Wed, Oct 03, 2018 at 08:43:49PM +0100, Chris Wilson wrote:
> > > > If KMS is not supported on the device, drmModeGetResources() will return
> > > > NULL, often this is an indication that we should not attempt to run the
> > > > test. Although it would be preferred to use something like
> > > > igt_require_display() as the canonical check and assert that
> > > > drmModeGetResources() did not hit an error, it is not always practical
> > > > as the tests do not utilize the common igt_display abstraction.
> > > > 
> > > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > > 
> > > and pushed
> > 
> > I still think a kmstest_require() or so, plus then removing the pile of
> > add-how igt_require we just sprinkled all over, would be more maintainable
> > long term. kmstest_require() would also allow us to drop a not-so-cryptic
> > message into logs.
> 
> But what does kmstest mean? igt_require_kms(), which can be the raw
> drm_mode_getresources ioctl, matches my expectations of a lowlevel check.
> But is that as descriptive for the tests that are just using
> drmModeGetResources() directly? That is the conundrum.

We should probably change the kmstest_ prefix to something slightly more
meaningful. And yeah there might be a few too many shades of grey with the
low-level tests. But fore the high-level ones I think outright requiring
that you have an output and at least one pipe seems reasonable.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources()
  2018-10-04 19:19       ` Daniel Vetter
@ 2018-10-05  7:44         ` Arkadiusz Hiler
  2018-10-05  8:27           ` Daniel Vetter
  0 siblings, 1 reply; 9+ messages in thread
From: Arkadiusz Hiler @ 2018-10-05  7:44 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: igt-dev

On Thu, Oct 04, 2018 at 09:19:43PM +0200, Daniel Vetter wrote:
> On Thu, Oct 04, 2018 at 04:14:15PM +0100, Chris Wilson wrote:
> > Quoting Daniel Vetter (2018-10-04 14:27:05)
> > > On Thu, Oct 04, 2018 at 03:44:46PM +0300, Arkadiusz Hiler wrote:
> > > > On Wed, Oct 03, 2018 at 08:43:49PM +0100, Chris Wilson wrote:
> > > > > If KMS is not supported on the device, drmModeGetResources() will return
> > > > > NULL, often this is an indication that we should not attempt to run the
> > > > > test. Although it would be preferred to use something like
> > > > > igt_require_display() as the canonical check and assert that
> > > > > drmModeGetResources() did not hit an error, it is not always practical
> > > > > as the tests do not utilize the common igt_display abstraction.
> > > > > 
> > > > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > > > 
> > > > and pushed
> > > 
> > > I still think a kmstest_require() or so, plus then removing the pile of
> > > add-how igt_require we just sprinkled all over, would be more maintainable
> > > long term. kmstest_require() would also allow us to drop a not-so-cryptic
> > > message into logs.

Yeah. Sorry for missing some of them, I have botched up escaping of "("
which made the search fail silently for me.

Something to improve in my tooling ;-)

> > But what does kmstest mean? igt_require_kms(), which can be the raw
> > drm_mode_getresources ioctl, matches my expectations of a lowlevel check.
> > But is that as descriptive for the tests that are just using
> > drmModeGetResources() directly? That is the conundrum.
> 
> We should probably change the kmstest_ prefix to something slightly more
> meaningful. And yeah there might be a few too many shades of grey with the
> low-level tests. But fore the high-level ones I think outright requiring
> that you have an output and at least one pipe seems reasonable.
> -Daniel

I think that the overall change here, from hard assert to require, was
in a good direction. And even better that this discussion followed.

I am with Chris on this one. Doing the check on resources carries more
meaning than any other options I have seen here.

It would be nice to have this consolidated in a single slick
yyy_require_zzz but naming is hard.

Any ideas for a better name for kmstest and a good name for the require?

-- 
Cheers,
Arek
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources()
  2018-10-05  7:44         ` Arkadiusz Hiler
@ 2018-10-05  8:27           ` Daniel Vetter
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2018-10-05  8:27 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev, Daniel Vetter

On Fri, Oct 05, 2018 at 10:44:17AM +0300, Arkadiusz Hiler wrote:
> On Thu, Oct 04, 2018 at 09:19:43PM +0200, Daniel Vetter wrote:
> > On Thu, Oct 04, 2018 at 04:14:15PM +0100, Chris Wilson wrote:
> > > Quoting Daniel Vetter (2018-10-04 14:27:05)
> > > > On Thu, Oct 04, 2018 at 03:44:46PM +0300, Arkadiusz Hiler wrote:
> > > > > On Wed, Oct 03, 2018 at 08:43:49PM +0100, Chris Wilson wrote:
> > > > > > If KMS is not supported on the device, drmModeGetResources() will return
> > > > > > NULL, often this is an indication that we should not attempt to run the
> > > > > > test. Although it would be preferred to use something like
> > > > > > igt_require_display() as the canonical check and assert that
> > > > > > drmModeGetResources() did not hit an error, it is not always practical
> > > > > > as the tests do not utilize the common igt_display abstraction.
> > > > > > 
> > > > > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > > > > 
> > > > > and pushed
> > > > 
> > > > I still think a kmstest_require() or so, plus then removing the pile of
> > > > add-how igt_require we just sprinkled all over, would be more maintainable
> > > > long term. kmstest_require() would also allow us to drop a not-so-cryptic
> > > > message into logs.
> 
> Yeah. Sorry for missing some of them, I have botched up escaping of "("
> which made the search fail silently for me.
> 
> Something to improve in my tooling ;-)
> 
> > > But what does kmstest mean? igt_require_kms(), which can be the raw
> > > drm_mode_getresources ioctl, matches my expectations of a lowlevel check.
> > > But is that as descriptive for the tests that are just using
> > > drmModeGetResources() directly? That is the conundrum.
> > 
> > We should probably change the kmstest_ prefix to something slightly more
> > meaningful. And yeah there might be a few too many shades of grey with the
> > low-level tests. But fore the high-level ones I think outright requiring
> > that you have an output and at least one pipe seems reasonable.
> > -Daniel
> 
> I think that the overall change here, from hard assert to require, was
> in a good direction. And even better that this discussion followed.
> 
> I am with Chris on this one. Doing the check on resources carries more
> meaning than any other options I have seen here.
> 
> It would be nice to have this consolidated in a single slick
> yyy_require_zzz but naming is hard.
> 
> Any ideas for a better name for kmstest and a good name for the require?

drmmode is what we use in libdrm. Not sure that's better.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-10-05  8:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 19:43 [igt-dev] [PATCH i-g-t] igt: Check drmModeGetResources() Chris Wilson
2018-10-03 20:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-10-04  9:03 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-10-04 12:44 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
2018-10-04 13:27   ` Daniel Vetter
2018-10-04 15:14     ` Chris Wilson
2018-10-04 19:19       ` Daniel Vetter
2018-10-05  7:44         ` Arkadiusz Hiler
2018-10-05  8:27           ` Daniel Vetter

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.