* [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes
@ 2015-12-01 10:24 Daniel Vetter
2015-12-01 10:24 ` [PATCH i-g-t 2/3] lib/kms+tests: Use cached connector state Daniel Vetter
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Daniel Vetter @ 2015-12-01 10:24 UTC (permalink / raw)
To: Intel Graphics Development; +Cc: Daniel Vetter, Thomas Wood, Daniel Vetter
Somehow the kernel's mode list changed with our EDID. No idea
whether that's the right thing here since I'm not really an EDID
expert. But then again the testcase wants to check that the
injection works, not validate the kernel's parser.
v2: Only check the preferred mode for more future-proofing (Thomas).
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
tests/kms_force_connector.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c
index 838a3b0ae2e6..99a5649ec0c3 100644
--- a/tests/kms_force_connector.c
+++ b/tests/kms_force_connector.c
@@ -150,10 +150,8 @@ int main(int argc, char **argv)
vga_connector->connector_id);
CHECK_MODE(temp->modes[0], 1920, 1080, 60);
- CHECK_MODE(temp->modes[1], 1280, 720, 60);
- CHECK_MODE(temp->modes[2], 1024, 768, 60);
- CHECK_MODE(temp->modes[3], 800, 600, 60);
- CHECK_MODE(temp->modes[4], 640, 480, 60);
+ /* Don't check non-preferred modes to avoid to tight coupling
+ * with the in-kernel EDID parser. */
drmModeFreeConnector(temp);
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH i-g-t 2/3] lib/kms+tests: Use cached connector state 2015-12-01 10:24 [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes Daniel Vetter @ 2015-12-01 10:24 ` Daniel Vetter 2015-12-01 10:24 ` [PATCH i-g-t 3/3] tests/kms_force_connector: Include in BAT set Daniel Vetter 2015-12-01 11:12 ` [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes Jani Nikula 2 siblings, 0 replies; 12+ messages in thread From: Daniel Vetter @ 2015-12-01 10:24 UTC (permalink / raw) To: Intel Graphics Development; +Cc: Daniel Vetter, Thomas Wood, Daniel Vetter Speeds up testcases except for those where we want to exercise the probing itself. The only exceptions left where we do a full probe are - pm_rpm: We use it to make sure the kernel doesn't get things wrong with power domains, so we really want to exercise the full probe paths. And there the only place really is the specific validation done with the data gathered by get_drm_info. - kmstest_force_ functions: Newer kernels should be better at re-probing state when the force sysfs fields change, but better safe than sorry. v2: I also consolidated the start_n_modes and start_connectors while at it - move one of the fixup hunks to this patch that accidentally got misplaced (Thomas). Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> --- lib/igt_kms.c | 16 ++++++++++++++-- tests/kms_3d.c | 4 ++-- tests/kms_draw_crc.c | 4 ++-- tests/kms_fbcon_fbt.c | 2 +- tests/kms_flip.c | 2 +- tests/kms_force_connector.c | 41 +++++++++++++++++++++++++--------------- tests/kms_frontbuffer_tracking.c | 2 +- tests/kms_setmode.c | 2 +- tests/pm_lpsp.c | 2 +- tests/pm_rpm.c | 4 +++- tests/testdisplay.c | 3 ++- 11 files changed, 54 insertions(+), 28 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 528164499828..fd4f05e81f3d 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -393,6 +393,7 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector, char *path, **tmp; const char *value; int debugfs_fd, ret, len; + drmModeConnector *temp; uint32_t devid; devid = intel_get_drm_devid(drm_fd); @@ -459,6 +460,11 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector, igt_install_exit_handler(reset_connectors_at_exit); + /* To allow callers to always use GetConnectorCurrent we need to force a + * redetection here. */ + temp = drmModeGetConnector(drm_fd, connector->connector_id); + drmModeFreeConnector(temp); + igt_assert(ret != -1); return (ret == -1) ? false : true; } @@ -480,6 +486,7 @@ void kmstest_force_edid(int drm_fd, drmModeConnector *connector, { char *path; int debugfs_fd, ret; + drmModeConnector *temp; igt_assert_neq(asprintf(&path, "%s-%d/edid_override", kmstest_connector_type_str(connector->connector_type), connector->connector_type_id), -1); @@ -494,6 +501,11 @@ void kmstest_force_edid(int drm_fd, drmModeConnector *connector, ret = write(debugfs_fd, edid, length); close(debugfs_fd); + /* To allow callers to always use GetConnectorCurrent we need to force a + * redetection here. */ + temp = drmModeGetConnector(drm_fd, connector->connector_id); + drmModeFreeConnector(temp); + igt_assert(ret != -1); } @@ -556,7 +568,7 @@ bool kmstest_get_connector_config(int drm_fd, uint32_t connector_id, } /* First, find the connector & mode */ - connector = drmModeGetConnector(drm_fd, connector_id); + connector = drmModeGetConnectorCurrent(drm_fd, connector_id); if (!connector) goto err2; @@ -1979,7 +1991,7 @@ void igt_enable_connectors(void) for (int i = 0; i < res->count_connectors; i++) { - c = drmModeGetConnector(drm_fd, res->connectors[i]); + c = drmModeGetConnectorCurrent(drm_fd, res->connectors[i]); /* don't attempt to force connectors that are already connected */ diff --git a/tests/kms_3d.c b/tests/kms_3d.c index 4cf765cd713d..bfc981ee279d 100644 --- a/tests/kms_3d.c +++ b/tests/kms_3d.c @@ -43,7 +43,7 @@ igt_simple_main /* find an hdmi connector */ for (int i = 0; i < res->count_connectors; i++) { - connector = drmModeGetConnector(drm_fd, res->connectors[i]); + connector = drmModeGetConnectorCurrent(drm_fd, res->connectors[i]); if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA && connector->connection == DRM_MODE_DISCONNECTED) @@ -66,7 +66,7 @@ igt_simple_main /* check for 3D modes */ mode_count = 0; - connector = drmModeGetConnector(drm_fd, connector_id); + connector = drmModeGetConnectorCurrent(drm_fd, connector_id); for (int i = 0; i < connector->count_modes; i++) { if (connector->modes[i].flags & DRM_MODE_FLAG_3D_MASK) mode_count++; diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c index dccf5355c287..3f801749fc2b 100644 --- a/tests/kms_draw_crc.c +++ b/tests/kms_draw_crc.c @@ -232,8 +232,8 @@ static void setup_environment(void) igt_assert(drm_res->count_connectors <= MAX_CONNECTORS); for (i = 0; i < drm_res->count_connectors; i++) - drm_connectors[i] = drmModeGetConnector(drm_fd, - drm_res->connectors[i]); + drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd, + drm_res->connectors[i]); kmstest_set_vt_graphics_mode(); diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c index 0feb1a4969a9..3c93378eb96b 100644 --- a/tests/kms_fbcon_fbt.c +++ b/tests/kms_fbcon_fbt.c @@ -63,7 +63,7 @@ static void setup_drm(struct drm_info *drm) igt_assert(drm->res->count_connectors <= MAX_CONNECTORS); for (i = 0; i < drm->res->count_connectors; i++) - drm->connectors[i] = drmModeGetConnector(drm->fd, + drm->connectors[i] = drmModeGetConnectorCurrent(drm->fd, drm->res->connectors[i]); kmstest_set_vt_graphics_mode(); diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 7157e709f0eb..a3acc3dd28e8 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -418,7 +418,7 @@ static void dpms_off_other_outputs(struct test_output *o) goto next; } - connector = drmModeGetConnector(drm_fd, connector_id); + connector = drmModeGetConnectorCurrent(drm_fd, connector_id); kmstest_set_connector_dpms(drm_fd, connector, DRM_MODE_DPMS_ON); kmstest_set_connector_dpms(drm_fd, connector, DRM_MODE_DPMS_OFF); diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index 99a5649ec0c3..637f625a852f 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -42,7 +42,8 @@ static void reset_connectors(void) for (int i = 0; i < res->count_connectors; i++) { - connector = drmModeGetConnector(drm_fd, res->connectors[i]); + connector = drmModeGetConnectorCurrent(drm_fd, + res->connectors[i]); kmstest_force_connector(drm_fd, connector, FORCE_CONNECTOR_UNSPECIFIED); @@ -71,7 +72,7 @@ int main(int argc, char **argv) int drm_fd = 0; drmModeRes *res; drmModeConnector *vga_connector = NULL, *temp; - int start_n_modes; + int start_n_modes, start_connection; struct option long_opts[] = { {"reset", 0, 0, 'r'}, {0, 0, 0, 0} @@ -89,10 +90,14 @@ int main(int argc, char **argv) /* find the vga connector */ for (int i = 0; i < res->count_connectors; i++) { - vga_connector = drmModeGetConnector(drm_fd, res->connectors[i]); + vga_connector = drmModeGetConnectorCurrent(drm_fd, + res->connectors[i]); - if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) + if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) { + start_n_modes = vga_connector->count_modes; + start_connection = vga_connector->connection; break; + } drmModeFreeConnector(vga_connector); @@ -108,7 +113,8 @@ int main(int argc, char **argv) /* force the connector on and check the reported values */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); igt_assert_lt(0, temp->count_modes); drmModeFreeConnector(temp); @@ -123,7 +129,8 @@ int main(int argc, char **argv) /* force the connector off */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_OFF); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); igt_assert_eq(0, temp->count_modes); drmModeFreeConnector(temp); @@ -131,23 +138,26 @@ int main(int argc, char **argv) /* check that the previous state is restored */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_UNSPECIFIED); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert_eq(temp->connection, vga_connector->connection); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + igt_assert_eq(temp->connection, start_connection); drmModeFreeConnector(temp); } igt_subtest("force-edid") { kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - start_n_modes = temp->count_modes; + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); drmModeFreeConnector(temp); /* test edid forcing */ kmstest_force_edid(drm_fd, vga_connector, igt_kms_get_base_edid(), EDID_LENGTH); - temp = drmModeGetConnector(drm_fd, - vga_connector->connector_id); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + + igt_debug("num_conn %i\n", temp->count_modes); CHECK_MODE(temp->modes[0], 1920, 1080, 60); /* Don't check non-preferred modes to avoid to tight coupling @@ -157,14 +167,15 @@ int main(int argc, char **argv) /* remove edid */ kmstest_force_edid(drm_fd, vga_connector, NULL, 0); - temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_UNSPECIFIED); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); /* the connector should now have the same number of modes that * it started with */ igt_assert_eq(temp->count_modes, start_n_modes); drmModeFreeConnector(temp); - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_UNSPECIFIED); } igt_fixture { diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 4734f25398b4..fbeeb4bf0b8d 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -1266,7 +1266,7 @@ static void setup_drm(void) igt_assert(drm.res->count_connectors <= MAX_CONNECTORS); for (i = 0; i < drm.res->count_connectors; i++) - drm.connectors[i] = drmModeGetConnector(drm.fd, + drm.connectors[i] = drmModeGetConnectorCurrent(drm.fd, drm.res->connectors[i]); rc = drmSetClientCap(drm.fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c index cf06aabf3e5a..d5ac8f931b55 100644 --- a/tests/kms_setmode.c +++ b/tests/kms_setmode.c @@ -504,7 +504,7 @@ static int get_one_connector(drmModeRes *resources, int connector_id, drmModeConnector *connector; drmModeModeInfo mode; - connector = drmModeGetConnector(drm_fd, connector_id); + connector = drmModeGetConnectorCurrent(drm_fd, connector_id); igt_assert(connector); cconf->connector = connector; diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c index b62876c4c253..257ae1b8b1d9 100644 --- a/tests/pm_lpsp.c +++ b/tests/pm_lpsp.c @@ -231,7 +231,7 @@ igt_main igt_assert(drm_res->count_connectors <= MAX_CONNECTORS); for (i = 0; i < drm_res->count_connectors; i++) - drm_connectors[i] = drmModeGetConnector(drm_fd, + drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd, drm_res->connectors[i]); disable_audio_runtime_pm(); diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index e9ba9ea24307..37aef96ed267 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -370,7 +370,7 @@ static void init_mode_set_data(struct mode_set_data *data) igt_assert(data->res->count_connectors <= MAX_CONNECTORS); for (i = 0; i < data->res->count_connectors; i++) { - data->connectors[i] = drmModeGetConnector(drm_fd, + data->connectors[i] = drmModeGetConnectorCurrent(drm_fd, data->res->connectors[i]); data->edids[i] = get_connector_edid(data->connectors[i], i); } @@ -405,6 +405,8 @@ static void get_drm_info(struct compare_data *data) igt_assert(data->res->count_crtcs <= MAX_CRTCS); for (i = 0; i < data->res->count_connectors; i++) { + /* Don't use GetConnectorCurrent, we want to force a reprobe + * here. */ data->connectors[i] = drmModeGetConnector(drm_fd, data->res->connectors[i]); data->edids[i] = get_connector_edid(data->connectors[i], i); diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 28875b2d21e5..74e60b6f4bda 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -132,7 +132,8 @@ static void dump_connectors_fd(int drmfd) for (i = 0; i < mode_resources->count_connectors; i++) { drmModeConnector *connector; - connector = drmModeGetConnector(drmfd, mode_resources->connectors[i]); + connector = drmModeGetConnectorCurrent(drmfd, + mode_resources->connectors[i]); if (!connector) { igt_warn("could not get connector %i: %s\n", mode_resources->connectors[i], strerror(errno)); continue; -- 2.1.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH i-g-t 3/3] tests/kms_force_connector: Include in BAT set 2015-12-01 10:24 [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes Daniel Vetter 2015-12-01 10:24 ` [PATCH i-g-t 2/3] lib/kms+tests: Use cached connector state Daniel Vetter @ 2015-12-01 10:24 ` Daniel Vetter 2015-12-01 10:33 ` Thomas Wood 2015-12-01 11:12 ` [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes Jani Nikula 2 siblings, 1 reply; 12+ messages in thread From: Daniel Vetter @ 2015-12-01 10:24 UTC (permalink / raw) To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset=a, Size: 13685 bytes --] Forcing connector state is a basic piece of our test infrastructure that we use in all the kms_ tests. It allows us to run tests even if no outputs are connected. They're also really fast, so perfect candidates for inclusion into the BAT set. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> --- tests/.gitignore | 2 +- tests/Makefile.sources | 2 +- tests/kms_force_connector.c | 189 -------------------------------------- tests/kms_force_connector_basic.c | 189 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 191 deletions(-) delete mode 100644 tests/kms_force_connector.c create mode 100644 tests/kms_force_connector_basic.c diff --git a/tests/.gitignore b/tests/.gitignore index 43d63d3abac9..900c681caec9 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -138,7 +138,7 @@ kms_fence_pin_leak kms_flip kms_flip_event_leak kms_flip_tiling -kms_force_connector +kms_force_connector_basic kms_frontbuffer_tracking kms_legacy_colorkey kms_mmio_vs_cs_flip diff --git a/tests/Makefile.sources b/tests/Makefile.sources index b70bca060253..63de439d8717 100644 --- a/tests/Makefile.sources +++ b/tests/Makefile.sources @@ -163,7 +163,7 @@ TESTS_progs = \ gen7_forcewake_mt \ kms_3d \ kms_fence_pin_leak \ - kms_force_connector \ + kms_force_connector_basic \ kms_pwrite_crc \ kms_sink_crc_basic \ prime_udl \ diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c deleted file mode 100644 index 637f625a852f..000000000000 --- a/tests/kms_force_connector.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright © 2014 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - */ - -#include "igt.h" - -IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" - " correctly."); - -#define CHECK_MODE(m, h, w, r) \ - igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ - igt_assert_eq(m.vrefresh, r); - -static void reset_connectors(void) -{ - int drm_fd = 0; - drmModeRes *res; - drmModeConnector *connector = NULL; - - drm_fd = drm_open_driver_master(DRIVER_INTEL); - res = drmModeGetResources(drm_fd); - - for (int i = 0; i < res->count_connectors; i++) { - - connector = drmModeGetConnectorCurrent(drm_fd, - res->connectors[i]); - - kmstest_force_connector(drm_fd, connector, - FORCE_CONNECTOR_UNSPECIFIED); - - kmstest_force_edid(drm_fd, connector, NULL, 0); - - drmModeFreeConnector(connector); - } -} - -static int opt_handler(int opt, int opt_index, void *data) -{ - switch (opt) { - case 'r': - reset_connectors(); - exit(0); - break; - } - - return 0; -} - -int main(int argc, char **argv) -{ - /* force the VGA output and test that it worked */ - int drm_fd = 0; - drmModeRes *res; - drmModeConnector *vga_connector = NULL, *temp; - int start_n_modes, start_connection; - struct option long_opts[] = { - {"reset", 0, 0, 'r'}, - {0, 0, 0, 0} - }; - const char *help_str = - " --reset\t\tReset all connector force states and edid.\n"; - - igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, - opt_handler, NULL); - - igt_fixture { - drm_fd = drm_open_driver_master(DRIVER_INTEL); - res = drmModeGetResources(drm_fd); - - /* find the vga connector */ - for (int i = 0; i < res->count_connectors; i++) { - - vga_connector = drmModeGetConnectorCurrent(drm_fd, - res->connectors[i]); - - if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) { - start_n_modes = vga_connector->count_modes; - start_connection = vga_connector->connection; - break; - } - - drmModeFreeConnector(vga_connector); - - vga_connector = NULL; - } - - igt_require(vga_connector); - igt_skip_on(vga_connector->connection == DRM_MODE_CONNECTED); - } - - igt_subtest("force-connector-state") { - igt_display_t display; - - /* force the connector on and check the reported values */ - kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); - temp = drmModeGetConnectorCurrent(drm_fd, - vga_connector->connector_id); - igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); - igt_assert_lt(0, temp->count_modes); - drmModeFreeConnector(temp); - - /* attempt to use the display */ - kmstest_set_vt_graphics_mode(); - igt_display_init(&display, drm_fd); - igt_display_commit(&display); - igt_display_fini(&display); - - - /* force the connector off */ - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_OFF); - temp = drmModeGetConnectorCurrent(drm_fd, - vga_connector->connector_id); - igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); - igt_assert_eq(0, temp->count_modes); - drmModeFreeConnector(temp); - - /* check that the previous state is restored */ - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_UNSPECIFIED); - temp = drmModeGetConnectorCurrent(drm_fd, - vga_connector->connector_id); - igt_assert_eq(temp->connection, start_connection); - drmModeFreeConnector(temp); - } - - igt_subtest("force-edid") { - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_ON); - temp = drmModeGetConnectorCurrent(drm_fd, - vga_connector->connector_id); - drmModeFreeConnector(temp); - - /* test edid forcing */ - kmstest_force_edid(drm_fd, vga_connector, - igt_kms_get_base_edid(), EDID_LENGTH); - temp = drmModeGetConnectorCurrent(drm_fd, - vga_connector->connector_id); - - igt_debug("num_conn %i\n", temp->count_modes); - - CHECK_MODE(temp->modes[0], 1920, 1080, 60); - /* Don't check non-preferred modes to avoid to tight coupling - * with the in-kernel EDID parser. */ - - drmModeFreeConnector(temp); - - /* remove edid */ - kmstest_force_edid(drm_fd, vga_connector, NULL, 0); - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_UNSPECIFIED); - temp = drmModeGetConnectorCurrent(drm_fd, - vga_connector->connector_id); - /* the connector should now have the same number of modes that - * it started with */ - igt_assert_eq(temp->count_modes, start_n_modes); - drmModeFreeConnector(temp); - - } - - igt_fixture { - drmModeFreeConnector(vga_connector); - close(drm_fd); - - reset_connectors(); - } - - igt_exit(); -} diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c new file mode 100644 index 000000000000..637f625a852f --- /dev/null +++ b/tests/kms_force_connector_basic.c @@ -0,0 +1,189 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +#include "igt.h" + +IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" + " correctly."); + +#define CHECK_MODE(m, h, w, r) \ + igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ + igt_assert_eq(m.vrefresh, r); + +static void reset_connectors(void) +{ + int drm_fd = 0; + drmModeRes *res; + drmModeConnector *connector = NULL; + + drm_fd = drm_open_driver_master(DRIVER_INTEL); + res = drmModeGetResources(drm_fd); + + for (int i = 0; i < res->count_connectors; i++) { + + connector = drmModeGetConnectorCurrent(drm_fd, + res->connectors[i]); + + kmstest_force_connector(drm_fd, connector, + FORCE_CONNECTOR_UNSPECIFIED); + + kmstest_force_edid(drm_fd, connector, NULL, 0); + + drmModeFreeConnector(connector); + } +} + +static int opt_handler(int opt, int opt_index, void *data) +{ + switch (opt) { + case 'r': + reset_connectors(); + exit(0); + break; + } + + return 0; +} + +int main(int argc, char **argv) +{ + /* force the VGA output and test that it worked */ + int drm_fd = 0; + drmModeRes *res; + drmModeConnector *vga_connector = NULL, *temp; + int start_n_modes, start_connection; + struct option long_opts[] = { + {"reset", 0, 0, 'r'}, + {0, 0, 0, 0} + }; + const char *help_str = + " --reset\t\tReset all connector force states and edid.\n"; + + igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, + opt_handler, NULL); + + igt_fixture { + drm_fd = drm_open_driver_master(DRIVER_INTEL); + res = drmModeGetResources(drm_fd); + + /* find the vga connector */ + for (int i = 0; i < res->count_connectors; i++) { + + vga_connector = drmModeGetConnectorCurrent(drm_fd, + res->connectors[i]); + + if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) { + start_n_modes = vga_connector->count_modes; + start_connection = vga_connector->connection; + break; + } + + drmModeFreeConnector(vga_connector); + + vga_connector = NULL; + } + + igt_require(vga_connector); + igt_skip_on(vga_connector->connection == DRM_MODE_CONNECTED); + } + + igt_subtest("force-connector-state") { + igt_display_t display; + + /* force the connector on and check the reported values */ + kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); + igt_assert_lt(0, temp->count_modes); + drmModeFreeConnector(temp); + + /* attempt to use the display */ + kmstest_set_vt_graphics_mode(); + igt_display_init(&display, drm_fd); + igt_display_commit(&display); + igt_display_fini(&display); + + + /* force the connector off */ + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_OFF); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); + igt_assert_eq(0, temp->count_modes); + drmModeFreeConnector(temp); + + /* check that the previous state is restored */ + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_UNSPECIFIED); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + igt_assert_eq(temp->connection, start_connection); + drmModeFreeConnector(temp); + } + + igt_subtest("force-edid") { + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_ON); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + drmModeFreeConnector(temp); + + /* test edid forcing */ + kmstest_force_edid(drm_fd, vga_connector, + igt_kms_get_base_edid(), EDID_LENGTH); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + + igt_debug("num_conn %i\n", temp->count_modes); + + CHECK_MODE(temp->modes[0], 1920, 1080, 60); + /* Don't check non-preferred modes to avoid to tight coupling + * with the in-kernel EDID parser. */ + + drmModeFreeConnector(temp); + + /* remove edid */ + kmstest_force_edid(drm_fd, vga_connector, NULL, 0); + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_UNSPECIFIED); + temp = drmModeGetConnectorCurrent(drm_fd, + vga_connector->connector_id); + /* the connector should now have the same number of modes that + * it started with */ + igt_assert_eq(temp->count_modes, start_n_modes); + drmModeFreeConnector(temp); + + } + + igt_fixture { + drmModeFreeConnector(vga_connector); + close(drm_fd); + + reset_connectors(); + } + + igt_exit(); +} -- 2.1.0 [-- Attachment #2: Type: text/plain, Size: 159 bytes --] _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH i-g-t 3/3] tests/kms_force_connector: Include in BAT set 2015-12-01 10:24 ` [PATCH i-g-t 3/3] tests/kms_force_connector: Include in BAT set Daniel Vetter @ 2015-12-01 10:33 ` Thomas Wood 2015-12-01 13:39 ` Daniel Vetter 0 siblings, 1 reply; 12+ messages in thread From: Thomas Wood @ 2015-12-01 10:33 UTC (permalink / raw) To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development On 1 December 2015 at 10:24, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > Forcing connector state is a basic piece of our test infrastructure > that we use in all the kms_ tests. It allows us to run tests even if > no outputs are connected. > > They're also really fast, so perfect candidates for inclusion into the > BAT set. > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > --- > tests/.gitignore | 2 +- > tests/Makefile.sources | 2 +- > tests/kms_force_connector.c | 189 -------------------------------------- > tests/kms_force_connector_basic.c | 189 ++++++++++++++++++++++++++++++++++++++ Would it be worth renaming the subtests instead, in case there are future tests that would make sense in kms_force_connector but that shouldn't be included in the BAT list? > 4 files changed, 191 insertions(+), 191 deletions(-) > delete mode 100644 tests/kms_force_connector.c > create mode 100644 tests/kms_force_connector_basic.c > > diff --git a/tests/.gitignore b/tests/.gitignore > index 43d63d3abac9..900c681caec9 100644 > --- a/tests/.gitignore > +++ b/tests/.gitignore > @@ -138,7 +138,7 @@ kms_fence_pin_leak > kms_flip > kms_flip_event_leak > kms_flip_tiling > -kms_force_connector > +kms_force_connector_basic > kms_frontbuffer_tracking > kms_legacy_colorkey > kms_mmio_vs_cs_flip > diff --git a/tests/Makefile.sources b/tests/Makefile.sources > index b70bca060253..63de439d8717 100644 > --- a/tests/Makefile.sources > +++ b/tests/Makefile.sources > @@ -163,7 +163,7 @@ TESTS_progs = \ > gen7_forcewake_mt \ > kms_3d \ > kms_fence_pin_leak \ > - kms_force_connector \ > + kms_force_connector_basic \ > kms_pwrite_crc \ > kms_sink_crc_basic \ > prime_udl \ > diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c > deleted file mode 100644 > index 637f625a852f..000000000000 > --- a/tests/kms_force_connector.c > +++ /dev/null > @@ -1,189 +0,0 @@ > -/* > - * Copyright © 2014 Intel Corporation > - * > - * Permission is hereby granted, free of charge, to any person obtaining a > - * copy of this software and associated documentation files (the "Software"), > - * to deal in the Software without restriction, including without limitation > - * the rights to use, copy, modify, merge, publish, distribute, sublicense, > - * and/or sell copies of the Software, and to permit persons to whom the > - * Software is furnished to do so, subject to the following conditions: > - * > - * The above copyright notice and this permission notice (including the next > - * paragraph) shall be included in all copies or substantial portions of the > - * Software. > - * > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS > - * IN THE SOFTWARE. > - * > - */ > - > -#include "igt.h" > - > -IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" > - " correctly."); > - > -#define CHECK_MODE(m, h, w, r) \ > - igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ > - igt_assert_eq(m.vrefresh, r); > - > -static void reset_connectors(void) > -{ > - int drm_fd = 0; > - drmModeRes *res; > - drmModeConnector *connector = NULL; > - > - drm_fd = drm_open_driver_master(DRIVER_INTEL); > - res = drmModeGetResources(drm_fd); > - > - for (int i = 0; i < res->count_connectors; i++) { > - > - connector = drmModeGetConnectorCurrent(drm_fd, > - res->connectors[i]); > - > - kmstest_force_connector(drm_fd, connector, > - FORCE_CONNECTOR_UNSPECIFIED); > - > - kmstest_force_edid(drm_fd, connector, NULL, 0); > - > - drmModeFreeConnector(connector); > - } > -} > - > -static int opt_handler(int opt, int opt_index, void *data) > -{ > - switch (opt) { > - case 'r': > - reset_connectors(); > - exit(0); > - break; > - } > - > - return 0; > -} > - > -int main(int argc, char **argv) > -{ > - /* force the VGA output and test that it worked */ > - int drm_fd = 0; > - drmModeRes *res; > - drmModeConnector *vga_connector = NULL, *temp; > - int start_n_modes, start_connection; > - struct option long_opts[] = { > - {"reset", 0, 0, 'r'}, > - {0, 0, 0, 0} > - }; > - const char *help_str = > - " --reset\t\tReset all connector force states and edid.\n"; > - > - igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, > - opt_handler, NULL); > - > - igt_fixture { > - drm_fd = drm_open_driver_master(DRIVER_INTEL); > - res = drmModeGetResources(drm_fd); > - > - /* find the vga connector */ > - for (int i = 0; i < res->count_connectors; i++) { > - > - vga_connector = drmModeGetConnectorCurrent(drm_fd, > - res->connectors[i]); > - > - if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) { > - start_n_modes = vga_connector->count_modes; > - start_connection = vga_connector->connection; > - break; > - } > - > - drmModeFreeConnector(vga_connector); > - > - vga_connector = NULL; > - } > - > - igt_require(vga_connector); > - igt_skip_on(vga_connector->connection == DRM_MODE_CONNECTED); > - } > - > - igt_subtest("force-connector-state") { > - igt_display_t display; > - > - /* force the connector on and check the reported values */ > - kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); > - temp = drmModeGetConnectorCurrent(drm_fd, > - vga_connector->connector_id); > - igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); > - igt_assert_lt(0, temp->count_modes); > - drmModeFreeConnector(temp); > - > - /* attempt to use the display */ > - kmstest_set_vt_graphics_mode(); > - igt_display_init(&display, drm_fd); > - igt_display_commit(&display); > - igt_display_fini(&display); > - > - > - /* force the connector off */ > - kmstest_force_connector(drm_fd, vga_connector, > - FORCE_CONNECTOR_OFF); > - temp = drmModeGetConnectorCurrent(drm_fd, > - vga_connector->connector_id); > - igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); > - igt_assert_eq(0, temp->count_modes); > - drmModeFreeConnector(temp); > - > - /* check that the previous state is restored */ > - kmstest_force_connector(drm_fd, vga_connector, > - FORCE_CONNECTOR_UNSPECIFIED); > - temp = drmModeGetConnectorCurrent(drm_fd, > - vga_connector->connector_id); > - igt_assert_eq(temp->connection, start_connection); > - drmModeFreeConnector(temp); > - } > - > - igt_subtest("force-edid") { > - kmstest_force_connector(drm_fd, vga_connector, > - FORCE_CONNECTOR_ON); > - temp = drmModeGetConnectorCurrent(drm_fd, > - vga_connector->connector_id); > - drmModeFreeConnector(temp); > - > - /* test edid forcing */ > - kmstest_force_edid(drm_fd, vga_connector, > - igt_kms_get_base_edid(), EDID_LENGTH); > - temp = drmModeGetConnectorCurrent(drm_fd, > - vga_connector->connector_id); > - > - igt_debug("num_conn %i\n", temp->count_modes); > - > - CHECK_MODE(temp->modes[0], 1920, 1080, 60); > - /* Don't check non-preferred modes to avoid to tight coupling > - * with the in-kernel EDID parser. */ > - > - drmModeFreeConnector(temp); > - > - /* remove edid */ > - kmstest_force_edid(drm_fd, vga_connector, NULL, 0); > - kmstest_force_connector(drm_fd, vga_connector, > - FORCE_CONNECTOR_UNSPECIFIED); > - temp = drmModeGetConnectorCurrent(drm_fd, > - vga_connector->connector_id); > - /* the connector should now have the same number of modes that > - * it started with */ > - igt_assert_eq(temp->count_modes, start_n_modes); > - drmModeFreeConnector(temp); > - > - } > - > - igt_fixture { > - drmModeFreeConnector(vga_connector); > - close(drm_fd); > - > - reset_connectors(); > - } > - > - igt_exit(); > -} > diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c > new file mode 100644 > index 000000000000..637f625a852f > --- /dev/null > +++ b/tests/kms_force_connector_basic.c > @@ -0,0 +1,189 @@ > +/* > + * Copyright © 2014 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS > + * IN THE SOFTWARE. > + * > + */ > + > +#include "igt.h" > + > +IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" > + " correctly."); > + > +#define CHECK_MODE(m, h, w, r) \ > + igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ > + igt_assert_eq(m.vrefresh, r); > + > +static void reset_connectors(void) > +{ > + int drm_fd = 0; > + drmModeRes *res; > + drmModeConnector *connector = NULL; > + > + drm_fd = drm_open_driver_master(DRIVER_INTEL); > + res = drmModeGetResources(drm_fd); > + > + for (int i = 0; i < res->count_connectors; i++) { > + > + connector = drmModeGetConnectorCurrent(drm_fd, > + res->connectors[i]); > + > + kmstest_force_connector(drm_fd, connector, > + FORCE_CONNECTOR_UNSPECIFIED); > + > + kmstest_force_edid(drm_fd, connector, NULL, 0); > + > + drmModeFreeConnector(connector); > + } > +} > + > +static int opt_handler(int opt, int opt_index, void *data) > +{ > + switch (opt) { > + case 'r': > + reset_connectors(); > + exit(0); > + break; > + } > + > + return 0; > +} > + > +int main(int argc, char **argv) > +{ > + /* force the VGA output and test that it worked */ > + int drm_fd = 0; > + drmModeRes *res; > + drmModeConnector *vga_connector = NULL, *temp; > + int start_n_modes, start_connection; > + struct option long_opts[] = { > + {"reset", 0, 0, 'r'}, > + {0, 0, 0, 0} > + }; > + const char *help_str = > + " --reset\t\tReset all connector force states and edid.\n"; > + > + igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, > + opt_handler, NULL); > + > + igt_fixture { > + drm_fd = drm_open_driver_master(DRIVER_INTEL); > + res = drmModeGetResources(drm_fd); > + > + /* find the vga connector */ > + for (int i = 0; i < res->count_connectors; i++) { > + > + vga_connector = drmModeGetConnectorCurrent(drm_fd, > + res->connectors[i]); > + > + if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) { > + start_n_modes = vga_connector->count_modes; > + start_connection = vga_connector->connection; > + break; > + } > + > + drmModeFreeConnector(vga_connector); > + > + vga_connector = NULL; > + } > + > + igt_require(vga_connector); > + igt_skip_on(vga_connector->connection == DRM_MODE_CONNECTED); > + } > + > + igt_subtest("force-connector-state") { > + igt_display_t display; > + > + /* force the connector on and check the reported values */ > + kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); > + temp = drmModeGetConnectorCurrent(drm_fd, > + vga_connector->connector_id); > + igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); > + igt_assert_lt(0, temp->count_modes); > + drmModeFreeConnector(temp); > + > + /* attempt to use the display */ > + kmstest_set_vt_graphics_mode(); > + igt_display_init(&display, drm_fd); > + igt_display_commit(&display); > + igt_display_fini(&display); > + > + > + /* force the connector off */ > + kmstest_force_connector(drm_fd, vga_connector, > + FORCE_CONNECTOR_OFF); > + temp = drmModeGetConnectorCurrent(drm_fd, > + vga_connector->connector_id); > + igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); > + igt_assert_eq(0, temp->count_modes); > + drmModeFreeConnector(temp); > + > + /* check that the previous state is restored */ > + kmstest_force_connector(drm_fd, vga_connector, > + FORCE_CONNECTOR_UNSPECIFIED); > + temp = drmModeGetConnectorCurrent(drm_fd, > + vga_connector->connector_id); > + igt_assert_eq(temp->connection, start_connection); > + drmModeFreeConnector(temp); > + } > + > + igt_subtest("force-edid") { > + kmstest_force_connector(drm_fd, vga_connector, > + FORCE_CONNECTOR_ON); > + temp = drmModeGetConnectorCurrent(drm_fd, > + vga_connector->connector_id); > + drmModeFreeConnector(temp); > + > + /* test edid forcing */ > + kmstest_force_edid(drm_fd, vga_connector, > + igt_kms_get_base_edid(), EDID_LENGTH); > + temp = drmModeGetConnectorCurrent(drm_fd, > + vga_connector->connector_id); > + > + igt_debug("num_conn %i\n", temp->count_modes); > + > + CHECK_MODE(temp->modes[0], 1920, 1080, 60); > + /* Don't check non-preferred modes to avoid to tight coupling > + * with the in-kernel EDID parser. */ > + > + drmModeFreeConnector(temp); > + > + /* remove edid */ > + kmstest_force_edid(drm_fd, vga_connector, NULL, 0); > + kmstest_force_connector(drm_fd, vga_connector, > + FORCE_CONNECTOR_UNSPECIFIED); > + temp = drmModeGetConnectorCurrent(drm_fd, > + vga_connector->connector_id); > + /* the connector should now have the same number of modes that > + * it started with */ > + igt_assert_eq(temp->count_modes, start_n_modes); > + drmModeFreeConnector(temp); > + > + } > + > + igt_fixture { > + drmModeFreeConnector(vga_connector); > + close(drm_fd); > + > + reset_connectors(); > + } > + > + igt_exit(); > +} > -- > 2.1.0 > > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx > _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH i-g-t 3/3] tests/kms_force_connector: Include in BAT set 2015-12-01 10:33 ` Thomas Wood @ 2015-12-01 13:39 ` Daniel Vetter 0 siblings, 0 replies; 12+ messages in thread From: Daniel Vetter @ 2015-12-01 13:39 UTC (permalink / raw) To: Thomas Wood; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter On Tue, Dec 01, 2015 at 10:33:22AM +0000, Thomas Wood wrote: > On 1 December 2015 at 10:24, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > > Forcing connector state is a basic piece of our test infrastructure > > that we use in all the kms_ tests. It allows us to run tests even if > > no outputs are connected. > > > > They're also really fast, so perfect candidates for inclusion into the > > BAT set. > > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > --- > > tests/.gitignore | 2 +- > > tests/Makefile.sources | 2 +- > > tests/kms_force_connector.c | 189 -------------------------------------- > > tests/kms_force_connector_basic.c | 189 ++++++++++++++++++++++++++++++++++++++ > > Would it be worth renaming the subtests instead, in case there are > future tests that would make sense in kms_force_connector but that > shouldn't be included in the BAT list? If we in the future can inject hdmi screens (or maybe even DP) I think that should still stay a BAT testcase since it's basic test infrastructure. Same reason for why all the pipe CRC and sink CRC tests are in BAT in their entirety - if any of that fails large amounts of testcase results will be highly suspect. That's why I opted to rename the test binary, not the subtests. -Daniel > > > > 4 files changed, 191 insertions(+), 191 deletions(-) > > delete mode 100644 tests/kms_force_connector.c > > create mode 100644 tests/kms_force_connector_basic.c > > > > diff --git a/tests/.gitignore b/tests/.gitignore > > index 43d63d3abac9..900c681caec9 100644 > > --- a/tests/.gitignore > > +++ b/tests/.gitignore > > @@ -138,7 +138,7 @@ kms_fence_pin_leak > > kms_flip > > kms_flip_event_leak > > kms_flip_tiling > > -kms_force_connector > > +kms_force_connector_basic > > kms_frontbuffer_tracking > > kms_legacy_colorkey > > kms_mmio_vs_cs_flip > > diff --git a/tests/Makefile.sources b/tests/Makefile.sources > > index b70bca060253..63de439d8717 100644 > > --- a/tests/Makefile.sources > > +++ b/tests/Makefile.sources > > @@ -163,7 +163,7 @@ TESTS_progs = \ > > gen7_forcewake_mt \ > > kms_3d \ > > kms_fence_pin_leak \ > > - kms_force_connector \ > > + kms_force_connector_basic \ > > kms_pwrite_crc \ > > kms_sink_crc_basic \ > > prime_udl \ > > diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c > > deleted file mode 100644 > > index 637f625a852f..000000000000 > > --- a/tests/kms_force_connector.c > > +++ /dev/null > > @@ -1,189 +0,0 @@ > > -/* > > - * Copyright © 2014 Intel Corporation > > - * > > - * Permission is hereby granted, free of charge, to any person obtaining a > > - * copy of this software and associated documentation files (the "Software"), > > - * to deal in the Software without restriction, including without limitation > > - * the rights to use, copy, modify, merge, publish, distribute, sublicense, > > - * and/or sell copies of the Software, and to permit persons to whom the > > - * Software is furnished to do so, subject to the following conditions: > > - * > > - * The above copyright notice and this permission notice (including the next > > - * paragraph) shall be included in all copies or substantial portions of the > > - * Software. > > - * > > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > > - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > > - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > > - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > > - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > > - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS > > - * IN THE SOFTWARE. > > - * > > - */ > > - > > -#include "igt.h" > > - > > -IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" > > - " correctly."); > > - > > -#define CHECK_MODE(m, h, w, r) \ > > - igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ > > - igt_assert_eq(m.vrefresh, r); > > - > > -static void reset_connectors(void) > > -{ > > - int drm_fd = 0; > > - drmModeRes *res; > > - drmModeConnector *connector = NULL; > > - > > - drm_fd = drm_open_driver_master(DRIVER_INTEL); > > - res = drmModeGetResources(drm_fd); > > - > > - for (int i = 0; i < res->count_connectors; i++) { > > - > > - connector = drmModeGetConnectorCurrent(drm_fd, > > - res->connectors[i]); > > - > > - kmstest_force_connector(drm_fd, connector, > > - FORCE_CONNECTOR_UNSPECIFIED); > > - > > - kmstest_force_edid(drm_fd, connector, NULL, 0); > > - > > - drmModeFreeConnector(connector); > > - } > > -} > > - > > -static int opt_handler(int opt, int opt_index, void *data) > > -{ > > - switch (opt) { > > - case 'r': > > - reset_connectors(); > > - exit(0); > > - break; > > - } > > - > > - return 0; > > -} > > - > > -int main(int argc, char **argv) > > -{ > > - /* force the VGA output and test that it worked */ > > - int drm_fd = 0; > > - drmModeRes *res; > > - drmModeConnector *vga_connector = NULL, *temp; > > - int start_n_modes, start_connection; > > - struct option long_opts[] = { > > - {"reset", 0, 0, 'r'}, > > - {0, 0, 0, 0} > > - }; > > - const char *help_str = > > - " --reset\t\tReset all connector force states and edid.\n"; > > - > > - igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, > > - opt_handler, NULL); > > - > > - igt_fixture { > > - drm_fd = drm_open_driver_master(DRIVER_INTEL); > > - res = drmModeGetResources(drm_fd); > > - > > - /* find the vga connector */ > > - for (int i = 0; i < res->count_connectors; i++) { > > - > > - vga_connector = drmModeGetConnectorCurrent(drm_fd, > > - res->connectors[i]); > > - > > - if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) { > > - start_n_modes = vga_connector->count_modes; > > - start_connection = vga_connector->connection; > > - break; > > - } > > - > > - drmModeFreeConnector(vga_connector); > > - > > - vga_connector = NULL; > > - } > > - > > - igt_require(vga_connector); > > - igt_skip_on(vga_connector->connection == DRM_MODE_CONNECTED); > > - } > > - > > - igt_subtest("force-connector-state") { > > - igt_display_t display; > > - > > - /* force the connector on and check the reported values */ > > - kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); > > - temp = drmModeGetConnectorCurrent(drm_fd, > > - vga_connector->connector_id); > > - igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); > > - igt_assert_lt(0, temp->count_modes); > > - drmModeFreeConnector(temp); > > - > > - /* attempt to use the display */ > > - kmstest_set_vt_graphics_mode(); > > - igt_display_init(&display, drm_fd); > > - igt_display_commit(&display); > > - igt_display_fini(&display); > > - > > - > > - /* force the connector off */ > > - kmstest_force_connector(drm_fd, vga_connector, > > - FORCE_CONNECTOR_OFF); > > - temp = drmModeGetConnectorCurrent(drm_fd, > > - vga_connector->connector_id); > > - igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); > > - igt_assert_eq(0, temp->count_modes); > > - drmModeFreeConnector(temp); > > - > > - /* check that the previous state is restored */ > > - kmstest_force_connector(drm_fd, vga_connector, > > - FORCE_CONNECTOR_UNSPECIFIED); > > - temp = drmModeGetConnectorCurrent(drm_fd, > > - vga_connector->connector_id); > > - igt_assert_eq(temp->connection, start_connection); > > - drmModeFreeConnector(temp); > > - } > > - > > - igt_subtest("force-edid") { > > - kmstest_force_connector(drm_fd, vga_connector, > > - FORCE_CONNECTOR_ON); > > - temp = drmModeGetConnectorCurrent(drm_fd, > > - vga_connector->connector_id); > > - drmModeFreeConnector(temp); > > - > > - /* test edid forcing */ > > - kmstest_force_edid(drm_fd, vga_connector, > > - igt_kms_get_base_edid(), EDID_LENGTH); > > - temp = drmModeGetConnectorCurrent(drm_fd, > > - vga_connector->connector_id); > > - > > - igt_debug("num_conn %i\n", temp->count_modes); > > - > > - CHECK_MODE(temp->modes[0], 1920, 1080, 60); > > - /* Don't check non-preferred modes to avoid to tight coupling > > - * with the in-kernel EDID parser. */ > > - > > - drmModeFreeConnector(temp); > > - > > - /* remove edid */ > > - kmstest_force_edid(drm_fd, vga_connector, NULL, 0); > > - kmstest_force_connector(drm_fd, vga_connector, > > - FORCE_CONNECTOR_UNSPECIFIED); > > - temp = drmModeGetConnectorCurrent(drm_fd, > > - vga_connector->connector_id); > > - /* the connector should now have the same number of modes that > > - * it started with */ > > - igt_assert_eq(temp->count_modes, start_n_modes); > > - drmModeFreeConnector(temp); > > - > > - } > > - > > - igt_fixture { > > - drmModeFreeConnector(vga_connector); > > - close(drm_fd); > > - > > - reset_connectors(); > > - } > > - > > - igt_exit(); > > -} > > diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c > > new file mode 100644 > > index 000000000000..637f625a852f > > --- /dev/null > > +++ b/tests/kms_force_connector_basic.c > > @@ -0,0 +1,189 @@ > > +/* > > + * Copyright © 2014 Intel Corporation > > + * > > + * Permission is hereby granted, free of charge, to any person obtaining a > > + * copy of this software and associated documentation files (the "Software"), > > + * to deal in the Software without restriction, including without limitation > > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > > + * and/or sell copies of the Software, and to permit persons to whom the > > + * Software is furnished to do so, subject to the following conditions: > > + * > > + * The above copyright notice and this permission notice (including the next > > + * paragraph) shall be included in all copies or substantial portions of the > > + * Software. > > + * > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS > > + * IN THE SOFTWARE. > > + * > > + */ > > + > > +#include "igt.h" > > + > > +IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" > > + " correctly."); > > + > > +#define CHECK_MODE(m, h, w, r) \ > > + igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ > > + igt_assert_eq(m.vrefresh, r); > > + > > +static void reset_connectors(void) > > +{ > > + int drm_fd = 0; > > + drmModeRes *res; > > + drmModeConnector *connector = NULL; > > + > > + drm_fd = drm_open_driver_master(DRIVER_INTEL); > > + res = drmModeGetResources(drm_fd); > > + > > + for (int i = 0; i < res->count_connectors; i++) { > > + > > + connector = drmModeGetConnectorCurrent(drm_fd, > > + res->connectors[i]); > > + > > + kmstest_force_connector(drm_fd, connector, > > + FORCE_CONNECTOR_UNSPECIFIED); > > + > > + kmstest_force_edid(drm_fd, connector, NULL, 0); > > + > > + drmModeFreeConnector(connector); > > + } > > +} > > + > > +static int opt_handler(int opt, int opt_index, void *data) > > +{ > > + switch (opt) { > > + case 'r': > > + reset_connectors(); > > + exit(0); > > + break; > > + } > > + > > + return 0; > > +} > > + > > +int main(int argc, char **argv) > > +{ > > + /* force the VGA output and test that it worked */ > > + int drm_fd = 0; > > + drmModeRes *res; > > + drmModeConnector *vga_connector = NULL, *temp; > > + int start_n_modes, start_connection; > > + struct option long_opts[] = { > > + {"reset", 0, 0, 'r'}, > > + {0, 0, 0, 0} > > + }; > > + const char *help_str = > > + " --reset\t\tReset all connector force states and edid.\n"; > > + > > + igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, > > + opt_handler, NULL); > > + > > + igt_fixture { > > + drm_fd = drm_open_driver_master(DRIVER_INTEL); > > + res = drmModeGetResources(drm_fd); > > + > > + /* find the vga connector */ > > + for (int i = 0; i < res->count_connectors; i++) { > > + > > + vga_connector = drmModeGetConnectorCurrent(drm_fd, > > + res->connectors[i]); > > + > > + if (vga_connector->connector_type == DRM_MODE_CONNECTOR_VGA) { > > + start_n_modes = vga_connector->count_modes; > > + start_connection = vga_connector->connection; > > + break; > > + } > > + > > + drmModeFreeConnector(vga_connector); > > + > > + vga_connector = NULL; > > + } > > + > > + igt_require(vga_connector); > > + igt_skip_on(vga_connector->connection == DRM_MODE_CONNECTED); > > + } > > + > > + igt_subtest("force-connector-state") { > > + igt_display_t display; > > + > > + /* force the connector on and check the reported values */ > > + kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); > > + temp = drmModeGetConnectorCurrent(drm_fd, > > + vga_connector->connector_id); > > + igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); > > + igt_assert_lt(0, temp->count_modes); > > + drmModeFreeConnector(temp); > > + > > + /* attempt to use the display */ > > + kmstest_set_vt_graphics_mode(); > > + igt_display_init(&display, drm_fd); > > + igt_display_commit(&display); > > + igt_display_fini(&display); > > + > > + > > + /* force the connector off */ > > + kmstest_force_connector(drm_fd, vga_connector, > > + FORCE_CONNECTOR_OFF); > > + temp = drmModeGetConnectorCurrent(drm_fd, > > + vga_connector->connector_id); > > + igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); > > + igt_assert_eq(0, temp->count_modes); > > + drmModeFreeConnector(temp); > > + > > + /* check that the previous state is restored */ > > + kmstest_force_connector(drm_fd, vga_connector, > > + FORCE_CONNECTOR_UNSPECIFIED); > > + temp = drmModeGetConnectorCurrent(drm_fd, > > + vga_connector->connector_id); > > + igt_assert_eq(temp->connection, start_connection); > > + drmModeFreeConnector(temp); > > + } > > + > > + igt_subtest("force-edid") { > > + kmstest_force_connector(drm_fd, vga_connector, > > + FORCE_CONNECTOR_ON); > > + temp = drmModeGetConnectorCurrent(drm_fd, > > + vga_connector->connector_id); > > + drmModeFreeConnector(temp); > > + > > + /* test edid forcing */ > > + kmstest_force_edid(drm_fd, vga_connector, > > + igt_kms_get_base_edid(), EDID_LENGTH); > > + temp = drmModeGetConnectorCurrent(drm_fd, > > + vga_connector->connector_id); > > + > > + igt_debug("num_conn %i\n", temp->count_modes); > > + > > + CHECK_MODE(temp->modes[0], 1920, 1080, 60); > > + /* Don't check non-preferred modes to avoid to tight coupling > > + * with the in-kernel EDID parser. */ > > + > > + drmModeFreeConnector(temp); > > + > > + /* remove edid */ > > + kmstest_force_edid(drm_fd, vga_connector, NULL, 0); > > + kmstest_force_connector(drm_fd, vga_connector, > > + FORCE_CONNECTOR_UNSPECIFIED); > > + temp = drmModeGetConnectorCurrent(drm_fd, > > + vga_connector->connector_id); > > + /* the connector should now have the same number of modes that > > + * it started with */ > > + igt_assert_eq(temp->count_modes, start_n_modes); > > + drmModeFreeConnector(temp); > > + > > + } > > + > > + igt_fixture { > > + drmModeFreeConnector(vga_connector); > > + close(drm_fd); > > + > > + reset_connectors(); > > + } > > + > > + igt_exit(); > > +} > > -- > > 2.1.0 > > > > > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes 2015-12-01 10:24 [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes Daniel Vetter 2015-12-01 10:24 ` [PATCH i-g-t 2/3] lib/kms+tests: Use cached connector state Daniel Vetter 2015-12-01 10:24 ` [PATCH i-g-t 3/3] tests/kms_force_connector: Include in BAT set Daniel Vetter @ 2015-12-01 11:12 ` Jani Nikula 2015-12-01 13:38 ` Daniel Vetter 2 siblings, 1 reply; 12+ messages in thread From: Jani Nikula @ 2015-12-01 11:12 UTC (permalink / raw) To: Intel Graphics Development; +Cc: Daniel Vetter, Thomas Wood, Daniel Vetter On Tue, 01 Dec 2015, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > Somehow the kernel's mode list changed with our EDID. I do not undestand what you're trying to say here. BR, Jani. -- Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes 2015-12-01 11:12 ` [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes Jani Nikula @ 2015-12-01 13:38 ` Daniel Vetter 2015-12-02 11:50 ` Jani Nikula 0 siblings, 1 reply; 12+ messages in thread From: Daniel Vetter @ 2015-12-01 13:38 UTC (permalink / raw) To: Jani Nikula Cc: Daniel Vetter, Intel Graphics Development, Thomas Wood, Daniel Vetter On Tue, Dec 01, 2015 at 01:12:43PM +0200, Jani Nikula wrote: > On Tue, 01 Dec 2015, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > > Somehow the kernel's mode list changed with our EDID. > > I do not undestand what you're trying to say here. The EDID we injected stayed the same, but the kernel started listing more modes for it. I didn't do a bisect nor analyse the root-cause since that would mean decoding the edid by hand to double-check what's going on. Suggestions for better phrasing? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes 2015-12-01 13:38 ` Daniel Vetter @ 2015-12-02 11:50 ` Jani Nikula 2015-12-04 9:51 ` Daniel Vetter 0 siblings, 1 reply; 12+ messages in thread From: Jani Nikula @ 2015-12-02 11:50 UTC (permalink / raw) To: Daniel Vetter Cc: Daniel Vetter, Intel Graphics Development, Thomas Wood, Daniel Vetter On Tue, 01 Dec 2015, Daniel Vetter <daniel@ffwll.ch> wrote: > On Tue, Dec 01, 2015 at 01:12:43PM +0200, Jani Nikula wrote: >> On Tue, 01 Dec 2015, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: >> > Somehow the kernel's mode list changed with our EDID. >> >> I do not undestand what you're trying to say here. > > The EDID we injected stayed the same, but the kernel started listing more > modes for it. I didn't do a bisect nor analyse the root-cause since that > would mean decoding the edid by hand to double-check what's going on. > > Suggestions for better phrasing? Your first sentence above. BR, Jani. -- Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes 2015-12-02 11:50 ` Jani Nikula @ 2015-12-04 9:51 ` Daniel Vetter 0 siblings, 0 replies; 12+ messages in thread From: Daniel Vetter @ 2015-12-04 9:51 UTC (permalink / raw) To: Jani Nikula Cc: Daniel Vetter, Intel Graphics Development, Thomas Wood, Daniel Vetter On Wed, Dec 02, 2015 at 01:50:36PM +0200, Jani Nikula wrote: > On Tue, 01 Dec 2015, Daniel Vetter <daniel@ffwll.ch> wrote: > > On Tue, Dec 01, 2015 at 01:12:43PM +0200, Jani Nikula wrote: > >> On Tue, 01 Dec 2015, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > >> > Somehow the kernel's mode list changed with our EDID. > >> > >> I do not undestand what you're trying to say here. > > > > The EDID we injected stayed the same, but the kernel started listing more > > modes for it. I didn't do a bisect nor analyse the root-cause since that > > would mean decoding the edid by hand to double-check what's going on. > > > > Suggestions for better phrasing? > > Your first sentence above. Done, and pushed all three patches to master. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes @ 2015-12-01 8:08 Daniel Vetter 2015-12-01 10:11 ` Thomas Wood 0 siblings, 1 reply; 12+ messages in thread From: Daniel Vetter @ 2015-12-01 8:08 UTC (permalink / raw) To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter Two things: - Somehow the kernel's mode list changed with our EDID. No idea whether that's the right thing here since I'm not really an EDID expert. But then again the testcase wants to check that the injection works, not validate the kernel's parser. - We need to disable the forcing _before_ we reprobe to check whether everything is back to normal: With the EDID gone but the connection still force to on the kernel will fall back to a default low-res mode list, making the testcase fail. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> --- tests/kms_force_connector.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index 838a3b0ae2e6..5f3f4a5400f5 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -153,20 +153,22 @@ int main(int argc, char **argv) CHECK_MODE(temp->modes[1], 1280, 720, 60); CHECK_MODE(temp->modes[2], 1024, 768, 60); CHECK_MODE(temp->modes[3], 800, 600, 60); - CHECK_MODE(temp->modes[4], 640, 480, 60); + CHECK_MODE(temp->modes[4], 800, 600, 56); + CHECK_MODE(temp->modes[5], 848, 480, 60); + CHECK_MODE(temp->modes[6], 640, 480, 60); drmModeFreeConnector(temp); /* remove edid */ kmstest_force_edid(drm_fd, vga_connector, NULL, 0); + kmstest_force_connector(drm_fd, vga_connector, + FORCE_CONNECTOR_UNSPECIFIED); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); /* the connector should now have the same number of modes that * it started with */ igt_assert_eq(temp->count_modes, start_n_modes); drmModeFreeConnector(temp); - kmstest_force_connector(drm_fd, vga_connector, - FORCE_CONNECTOR_UNSPECIFIED); } igt_fixture { -- 2.1.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes 2015-12-01 8:08 Daniel Vetter @ 2015-12-01 10:11 ` Thomas Wood 2015-12-01 10:19 ` Daniel Vetter 0 siblings, 1 reply; 12+ messages in thread From: Thomas Wood @ 2015-12-01 10:11 UTC (permalink / raw) To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development On 1 December 2015 at 08:08, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > Two things: > - Somehow the kernel's mode list changed with our EDID. No idea > whether that's the right thing here since I'm not really an EDID > expert. But then again the testcase wants to check that the > injection works, not validate the kernel's parser. If only checking that the injection worked, perhaps it would be more robust just to check that at least one of the expected modes is present, in any position in the array. Ideally this would be a mode that isn't included in the default modes when a connector is enabled. > > - We need to disable the forcing _before_ we reprobe to check whether > everything is back to normal: With the EDID gone but the connection > still force to on the kernel will fall back to a default low-res > mode list, making the testcase fail. This should be taken into account with the value of start_n_modes, since this is calculated after the connector is enabled. > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > --- > tests/kms_force_connector.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c > index 838a3b0ae2e6..5f3f4a5400f5 100644 > --- a/tests/kms_force_connector.c > +++ b/tests/kms_force_connector.c > @@ -153,20 +153,22 @@ int main(int argc, char **argv) > CHECK_MODE(temp->modes[1], 1280, 720, 60); > CHECK_MODE(temp->modes[2], 1024, 768, 60); > CHECK_MODE(temp->modes[3], 800, 600, 60); > - CHECK_MODE(temp->modes[4], 640, 480, 60); > + CHECK_MODE(temp->modes[4], 800, 600, 56); > + CHECK_MODE(temp->modes[5], 848, 480, 60); > + CHECK_MODE(temp->modes[6], 640, 480, 60); > > drmModeFreeConnector(temp); > > /* remove edid */ > kmstest_force_edid(drm_fd, vga_connector, NULL, 0); > + kmstest_force_connector(drm_fd, vga_connector, > + FORCE_CONNECTOR_UNSPECIFIED); > temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); > /* the connector should now have the same number of modes that > * it started with */ > igt_assert_eq(temp->count_modes, start_n_modes); > drmModeFreeConnector(temp); > > - kmstest_force_connector(drm_fd, vga_connector, > - FORCE_CONNECTOR_UNSPECIFIED); > } > > igt_fixture { > -- > 2.1.0 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes 2015-12-01 10:11 ` Thomas Wood @ 2015-12-01 10:19 ` Daniel Vetter 0 siblings, 0 replies; 12+ messages in thread From: Daniel Vetter @ 2015-12-01 10:19 UTC (permalink / raw) To: Thomas Wood; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter On Tue, Dec 01, 2015 at 10:11:14AM +0000, Thomas Wood wrote: > On 1 December 2015 at 08:08, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > > Two things: > > - Somehow the kernel's mode list changed with our EDID. No idea > > whether that's the right thing here since I'm not really an EDID > > expert. But then again the testcase wants to check that the > > injection works, not validate the kernel's parser. > > If only checking that the injection worked, perhaps it would be more > robust just to check that at least one of the expected modes is > present, in any position in the array. Ideally this would be a mode > that isn't included in the default modes when a connector is enabled. One option would be to check for the 1920x1080 mode only. That's the preferred one, so really must be first. And it's way more high-res than any of the default modes we inject (those top out at 1024x768). Ok with that? > > - We need to disable the forcing _before_ we reprobe to check whether > > everything is back to normal: With the EDID gone but the connection > > still force to on the kernel will fall back to a default low-res > > mode list, making the testcase fail. > > This should be taken into account with the value of start_n_modes, > since this is calculated after the connector is enabled. Oops, I did accidentally break this in my GetConnectorCurrent patch, since there I consolidated them all to avoid overhead. And didn't notice because of the earlier breakage. I'll respin these two and shift the 2nd change to the 2nd patch. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-12-04 9:51 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-12-01 10:24 [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes Daniel Vetter 2015-12-01 10:24 ` [PATCH i-g-t 2/3] lib/kms+tests: Use cached connector state Daniel Vetter 2015-12-01 10:24 ` [PATCH i-g-t 3/3] tests/kms_force_connector: Include in BAT set Daniel Vetter 2015-12-01 10:33 ` Thomas Wood 2015-12-01 13:39 ` Daniel Vetter 2015-12-01 11:12 ` [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes Jani Nikula 2015-12-01 13:38 ` Daniel Vetter 2015-12-02 11:50 ` Jani Nikula 2015-12-04 9:51 ` Daniel Vetter -- strict thread matches above, loose matches on Subject: below -- 2015-12-01 8:08 Daniel Vetter 2015-12-01 10:11 ` Thomas Wood 2015-12-01 10:19 ` Daniel Vetter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox