igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
Cc: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 3/6] tests/psr: Avoid opening of already open debugfs dir
Date: Tue, 4 Sep 2018 22:08:35 +0000	[thread overview]
Message-ID: <2dd54c42f88722c9d5e6d6f2ae9bf899487f520d.camel@intel.com> (raw)
In-Reply-To: <bbf946851f5015796bddea969abb4f3c0aaa9a02.camel@intel.com>

On Tue, 2018-09-04 at 15:07 -0700, José Roberto de Souza wrote:
> On Wed, 2018-08-29 at 14:57 -0700, Dhinakaran Pandiyan wrote:
> > The tests calls igt_debugfs_dir() to open the debugfs dir and
> > further
> > along calls igt_debugfs_read() each i915_edp_psr_status needs to be
> > read. The igt_debugfs_read() calls open the directory again, fix
> > this
> > by
> > making use of the newly added __igt_debugfs_read()
> > 

Just forgot this:

s/newly added __igt_debugfs_read()/newly added
igt_debugfs_simple_read()

> 
> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
> 
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > ---
> >  lib/igt_psr.c                    |  2 +-
> >  tests/kms_frontbuffer_tracking.c |  3 ++-
> >  tests/kms_psr.c                  | 10 ++++++----
> >  3 files changed, 9 insertions(+), 6 deletions(-)
> > 
> > diff --git a/lib/igt_psr.c b/lib/igt_psr.c
> > index 614caa6f..b9bfd607 100644
> > --- a/lib/igt_psr.c
> > +++ b/lib/igt_psr.c
> > @@ -30,7 +30,7 @@ bool psr_active(int fd, bool check_active)
> >  	bool active;
> >  	char buf[512];
> >  
> > -	igt_debugfs_read(fd, "i915_edp_psr_status", buf);
> > +	igt_debugfs_simple_read(fd, "i915_edp_psr_status", buf,
> > sizeof(buf));
> >  	active = strstr(buf, "HW Enabled & Active bit: yes\n") &&
> >  		(strstr(buf, "SRDENT") || strstr(buf, "SLEEP"));
> >  	return check_active ? active : !active;
> > diff --git a/tests/kms_frontbuffer_tracking.c
> > b/tests/kms_frontbuffer_tracking.c
> > index 822f3e74..1ffe7467 100644
> > --- a/tests/kms_frontbuffer_tracking.c
> > +++ b/tests/kms_frontbuffer_tracking.c
> > @@ -1632,7 +1632,8 @@ static void do_status_assertions(int flags)
> >  	if (flags & ASSERT_PSR_ENABLED)
> >  		igt_assert_f(psr_wait_entry(drm.fd), "PSR still
> > disabled\n");
> >  	else if (flags & ASSERT_PSR_DISABLED)
> > -		igt_assert_f(psr_active(drm.fd, false), "PSR still
> > enabled\n");
> > +		igt_assert_f(psr_active(drm.debugfs, false),
> > +			     "PSR still enabled\n");
> >  }
> >  
> >  static void __do_assertions(const struct test_mode *t, int flags,
> > diff --git a/tests/kms_psr.c b/tests/kms_psr.c
> > index 218b3960..3e64cf04 100644
> > --- a/tests/kms_psr.c
> > +++ b/tests/kms_psr.c
> > @@ -192,7 +192,8 @@ static bool sink_support(data_t *data)
> >  {
> >  	char buf[512];
> >  
> > -	igt_debugfs_read(data->drm_fd, "i915_edp_psr_status", buf);
> > +	igt_debugfs_simple_read(data->debugfs_fd,
> > "i915_edp_psr_status",
> > +			 buf, sizeof(buf));
> >  
> >  	return data->with_psr_disabled ||
> >  		strstr(buf, "Sink_Support: yes\n");
> > @@ -203,7 +204,7 @@ static bool psr_wait_entry_if_enabled(data_t
> > *data)
> >  	if (data->with_psr_disabled)
> >  		return true;
> >  
> > -	return psr_wait_entry(data->drm_fd);
> > +	return psr_wait_entry(data->debugfs_fd);
> >  }
> >  
> >  static inline void manual(const char *expected)
> > @@ -215,7 +216,8 @@ static bool drrs_disabled(data_t *data)
> >  {
> >  	char buf[512];
> >  
> > -	igt_debugfs_read(data->drm_fd, "i915_drrs_status", buf);
> > +	igt_debugfs_simple_read(data->debugfs_fd, "i915_drrs_status",
> > +			 buf, sizeof(buf));
> >  
> >  	return !strstr(buf, "DRRS Supported: Yes\n");
> >  }
> > @@ -292,7 +294,7 @@ static void run_test(data_t *data)
> >  		expected = "screen GREEN";
> >  		break;
> >  	}
> > -	igt_assert(psr_active(data->drm_fd, false));
> > +	igt_assert(psr_active(data->debugfs_fd, false));
> >  	manual(expected);
> >  }
> >  
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-09-04 22:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 21:57 [igt-dev] [PATCH i-g-t 1/6] lib/psr: Add support for toggling edp psr through debugfs, v5 Dhinakaran Pandiyan
2018-08-29 21:57 ` [igt-dev] [PATCH i-g-t 2/6] lib/debugfs: Function to read debugfs with the directory already open Dhinakaran Pandiyan
2018-09-04 21:58   ` Souza, Jose
2018-08-29 21:57 ` [igt-dev] [PATCH i-g-t 3/6] tests/psr: Avoid opening of already open debugfs dir Dhinakaran Pandiyan
2018-09-04 22:07   ` Souza, Jose
2018-09-04 22:08     ` Souza, Jose [this message]
2018-08-29 21:57 ` [igt-dev] [PATCH i-g-t 4/6] tests/fbcon_fbt: Avoid opening debugfs dir repeatedly Dhinakaran Pandiyan
2018-09-04 22:12   ` Souza, Jose
2018-08-29 21:57 ` [igt-dev] [PATCH i-g-t 5/6] tests/psr: Test PSR1 in kms_psr Dhinakaran Pandiyan
2018-09-04 22:18   ` Souza, Jose
2018-09-05  1:31     ` Dhinakaran Pandiyan
2018-09-04 22:20   ` Souza, Jose
2018-08-29 21:57 ` [igt-dev] [PATCH i-g-t 6/6] tests/fbcon_fbt: Enable PSR1 via debugfs Dhinakaran Pandiyan
2018-09-05 21:10   ` Souza, Jose
2018-08-30  8:10 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/6] lib/psr: Add support for toggling edp psr through debugfs, v5 Patchwork
2018-08-30  8:12 ` Patchwork
2018-08-30  8:15 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2018-08-30  8:27 ` Patchwork
2018-08-30  9:04 ` Patchwork
2018-08-30  9:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-09-04 21:59 ` [igt-dev] [PATCH i-g-t 1/6] " Souza, Jose
2018-09-05 17:09   ` Pandiyan, Dhinakaran
2018-09-05 21:05     ` Souza, Jose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2dd54c42f88722c9d5e6d6f2ae9bf899487f520d.camel@intel.com \
    --to=jose.souza@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).