From patchwork Thu Aug 10 07:00:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marta Lofstedt X-Patchwork-Id: 9892915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D897603B4 for ; Thu, 10 Aug 2017 07:00:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57C4228AD6 for ; Thu, 10 Aug 2017 07:00:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CC0728AD8; Thu, 10 Aug 2017 07:00:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B188328AD7 for ; Thu, 10 Aug 2017 07:00:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E82B56E20F; Thu, 10 Aug 2017 07:00:15 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98D906E20F for ; Thu, 10 Aug 2017 07:00:14 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Aug 2017 00:00:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,351,1498546800"; d="scan'208";a="121952506" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by orsmga002.jf.intel.com with ESMTP; 10 Aug 2017 00:00:12 -0700 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.174]) by irsmsx105.ger.corp.intel.com ([169.254.7.25]) with mapi id 14.03.0319.002; Thu, 10 Aug 2017 08:00:10 +0100 From: "Lofstedt, Marta" To: "Taylor, Clinton A" , "intel-gfx@lists.freedesktop.org" Thread-Topic: [PATCH v3 i-g-t] tests/kms: increase max threshold time for edid read Thread-Index: AQHTEWHm+rrR9QUEwkm7lYfq5huxOKJ9I+EQgAAFnXA= Date: Thu, 10 Aug 2017 07:00:09 +0000 Message-ID: References: <20170807162026.37wa7j4mcjqxpytx@phenom.ffwll.local> <1502319112-7758-1-git-send-email-clinton.a.taylor@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDMyMTlmMmUtZjk2NS00ZGQ0LTllMmQtMTYyYTA1YzRhODQ5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkZFRTZjZjJNT1BsNkFMTUdnSXRyK3hjKzZwRlU4TlVhUjFTZnlUdlp3K289In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.181] MIME-Version: 1.0 Cc: "Vetter, Daniel" Subject: Re: [Intel-gfx] [PATCH v3 i-g-t] tests/kms: increase max threshold time for edid read X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP With this tweak the test pass: > -----Original Message----- > From: Lofstedt, Marta > Sent: Thursday, August 10, 2017 9:41 AM > To: Taylor, Clinton A ; intel- > gfx@lists.freedesktop.org > Cc: Vetter, Daniel > Subject: RE: [PATCH v3 i-g-t] tests/kms: increase max threshold time for edid > read > > Sorry Clinton I fail the test again on my BDW NUCi5 with this V3. > > Check: https://bugs.freedesktop.org/show_bug.cgi?id=100047 > For details. > > /Marta > > > -----Original Message----- > > From: Taylor, Clinton A > > Sent: Thursday, August 10, 2017 1:52 AM > > To: intel-gfx@lists.freedesktop.org > > Cc: Taylor, Clinton A ; Vetter, Daniel > > ; Lofstedt, Marta > > Subject: [PATCH v3 i-g-t] tests/kms: increase max threshold time for > > edid read > > > > From: Clint Taylor > > > > Current 50ms max threshold timing for an EDID read is very close to > > the actual time for a 2 block HDMI EDID read. Adjust the timings base > > on connector type as DP reads are at 1 MBit and HDMI at 100K bit. If > > an LSPcon is connected to device under test the -l option should be > > passed to update the threshold timing to allow the LSPcon to read the EDID > at the HDMI timing. > > The -l option should be used when LSPcon is on the motherboard or if a > > USB_C->HDMI converter is present > > > > V2: Adjust timings based on connector type, EDID size, and Add an > > option to specify if an LSPcon is present. > > V3: added bugzilla to commit message > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100047 > > > > Cc: Daniel Vetter > > Cc: Marta Lofstedt > > Signed-off-by: Clint Taylor > > --- > > tests/kms_sysfs_edid_timing.c | 76 > > +++++++++++++++++++++++++++++++++++-------- > > 1 file changed, 62 insertions(+), 14 deletions(-) > > > > diff --git a/tests/kms_sysfs_edid_timing.c > > b/tests/kms_sysfs_edid_timing.c index 1201388..441dfee 100644 > > --- a/tests/kms_sysfs_edid_timing.c > > +++ b/tests/kms_sysfs_edid_timing.c > > @@ -26,21 +26,46 @@ > > #include > > #include > > > > -#define THRESHOLD_PER_CONNECTOR 10 > > -#define THRESHOLD_TOTAL 50 > > -#define CHECK_TIMES 15 > > +#define THRESHOLD_FOR_EMPTY_CONNECTOR 10 > > +#define THRESHOLD_PER_EDID_BLOCK 5 > > +#define HDMI_THRESHOLD_MULTIPLIER 10 > > +#define CHECK_TIMES 10 > > > > IGT_TEST_DESCRIPTION("This check the time we take to read the content > > of all " > > "the possible connectors. Without the edid - > ENXIO patch " > > > > "(http://permalink.gmane.org/gmane.comp.video.dri.devel/62083), " > > - "we sometimes take a *really* long time. " > > - "So let's just check for some reasonable > > timing here"); > > + "we sometimes take a *really* long time. So > > let's check " > > + "an approximate time per edid block based on > > connector " > > + "type. The -l option adjusts DP timing to > > reflect HDMI read " > > + "timings from LSPcon."); > > + > > +/* The -l option has been added to correctly handle timings when an > > +LSPcon is > > + * present. This could be on the platform itself or in a USB_C->HDMI > > converter. > > + * With LSPCon EDID read timing will need to change from the 1 Mbit > > +AUX > > + * bus speed to the 100 Kbit HDMI DDC bus speed */ bool > > +lspcon_present; > > > > +static int opt_handler(int opt, int opt_index, void *data) { > > + if (opt == 'l') { > > + lspcon_present = true; > > + igt_info("set LSPcon present on DP ports\n"); > > + } > > > > -igt_simple_main > > + return 0; > > +} > > + > > +int main(int argc, char **argv) > > { > > DIR *dirp; > > struct dirent *de; > > + lspcon_present = false; > > + > > + igt_simple_init_parse_opts(&argc, argv, "l", NULL, NULL, > > + opt_handler, > > NULL); > > + > > + igt_skip_on_simulation(); > > > > dirp = opendir("/sys/class/drm"); > > igt_assert(dirp != NULL); > > @@ -49,17 +74,36 @@ igt_simple_main > > struct igt_mean mean = {}; > > struct stat st; > > char path[PATH_MAX]; > > - int i; > > + char edid_path[PATH_MAX]; > > + char edid[512]; /* enough for 4 block edid */ > > + unsigned long edid_size = 0; > > + int i, fd_edid; > > + unsigned int threshold = 0; > > > > if (*de->d_name == '.') > > continue;; > > > > snprintf(path, sizeof(path), > > "/sys/class/drm/%s/status", > > de->d_name); > > + snprintf(edid_path, sizeof(edid_path), > > "/sys/class/drm/%s/edid", > > + de->d_name); > > > > if (stat(path, &st)) > > continue; > > > > + fd_edid = open(edid_path, O_RDONLY); > > + if (fd_edid == -1) { > > + igt_warn("Read Error EDID\n"); > > + continue; > > + } > > + > > + edid_size = read(fd_edid, edid, 512); > > + threshold = THRESHOLD_PER_EDID_BLOCK * > > (edid_size / 128); > > + if (lspcon_present || (edid_size > 128 && > > + !strncmp(de->d_name, "card0-HDMI", 10))) { > > + threshold *= > > HDMI_THRESHOLD_MULTIPLIER; > > + } > > + > > igt_mean_init(&mean); > > for (i = 0; i < CHECK_TIMES; i++) { > > struct timespec ts = {}; > > @@ -76,22 +120,26 @@ igt_simple_main > > } > > > > igt_debug("%s: mean.max %.2fns, %.2fus, > %.2fms, " > > - "mean.avg %.2fns, %.2fus, > > %.2fms\n", > > + "mean.avg %.2fns, %.2fus, > > %.2fms, " > > + "edid_size %lu, threshold %d\n", > > de->d_name, > > mean.max, mean.max / 1e3, > > mean.max / 1e6, > > - mean.mean, mean.mean / 1e3, > > mean.mean / 1e6); > > + mean.mean, mean.mean / 1e3, > > mean.mean / 1e6, > > + edid_size, threshold); > > > > - if (mean.max > (THRESHOLD_PER_CONNECTOR > > * 1e6)) { > > + if (edid_size == 0 && > > + (mean.max > > > (THRESHOLD_FOR_EMPTY_CONNECTOR * 1e6))) { > > igt_warn("%s: probe time exceed > > 10ms, " > > "max=%.2fms, > > avg=%.2fms\n", de->d_name, > > mean.max / 1e6, > > mean.mean / 1e6); > > } > > - igt_assert_f(mean.mean < (THRESHOLD_TOTAL > > * 1e6), > > - "%s: average probe time > > exceeded 50ms, " > > - "max=%.2fms, avg=%.2fms\n", > > de->d_name, > > + if (edid_size > 0) > > + igt_assert_f(mean.mean < > > (threshold * 1e6), > > + "%s: average probe time > > exceeded %dms, " > > + "max=%.2fms, avg=%.2fms\n", > > de->d_name, threshold, > > mean.max / 1e6, mean.mean / > > 1e6); > > > > } > > closedir(dirp); > > - > > + igt_exit(); > > } > > -- > > 1.9.1 --- a/tests/kms_sysfs_edid_timing.c +++ b/tests/kms_sysfs_edid_timing.c @@ -99,7 +99,7 @@ int main(int argc, char **argv) edid_size = read(fd_edid, edid, 512); threshold = THRESHOLD_PER_EDID_BLOCK * (edid_size / 128); - if (lspcon_present || (edid_size > 128 && + if (lspcon_present || (edid_size >= 128 && !strncmp(de->d_name, "card0-HDMI", 10))) { threshold *= HDMI_THRESHOLD_MULTIPLIER; }